| | |
| | | "style-resources-loader": "^1.5.0", |
| | | "vue": "^2.6.11", |
| | | "vue-cli-plugin-style-resources-loader": "^0.1.5", |
| | | "vue-json-excel": "^0.3.0", |
| | | "vue-quill-editor": "^3.0.6", |
| | | "vue-router": "^3.2.0", |
| | | "vuex": "^3.4.0" |
| | |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function getExportData(id){ |
| | | return request({ |
| | | url: '/org/user/export/' + id, |
| | | method: 'post', |
| | | }) |
| | | } |
| | | export function getOrgData(id){ |
| | | return request({ |
| | | url: '/org/structure/findByDistrictId/' + id, |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | import 'moment/locale/zh-cn'; |
| | | import '@/util/permission' |
| | | import {message,Modal} from "ant-design-vue"; |
| | | import JsonExcel from 'vue-json-excel' |
| | | Vue.component('downloadExcel', JsonExcel) |
| | | moment.locale('zh-cn'); |
| | | import prevent from './directive/index'//你的文件路径 |
| | | Vue.use(prevent) |
| | |
| | | { |
| | | path: '/', |
| | | name: 'login', |
| | | component: () => import('@/views/Login'), |
| | | component: () => import('@/views/Login1'), |
| | | meta: { title: '登录' }, |
| | | }, |
| | | { |
| | |
| | | :tree-data="areaData" |
| | | placeholder="行政区划" |
| | | :replaceFields="replaceFields" |
| | | disabled |
| | | @change="changeArea" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="组织架构"> |
| | | <a-input v-model="orgName" disabled/> |
| | | <a-select |
| | | v-model.trim="form.orgStructureId" |
| | | placeholder="选择组织架构" |
| | | style="width: 100%" |
| | | allowClear |
| | | show-search |
| | | > |
| | | <a-select-option v-for="item in orgData" :value="item.id" :key="item.id">{{item.orgName}}</a-select-option> |
| | | </a-select> |
| | | <!-- <a-input v-model="orgName" />--> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {addContactors,updateContactors} from '@/api/contactBook' |
| | | import {addContactors, getStructure, updateContactors} from '@/api/contactBook' |
| | | import {verifySimplePhone} from "@/util/validate"; |
| | | import {getDistrictInfo} from "@/api/login"; |
| | | import subMenu from "@/views/Admin/contactBook/subMenu.vue"; |
| | | import {getOrgData} from "@/api/user"; |
| | | export default { |
| | | name: 'addressUserMod', |
| | | components: {subMenu}, |
| | | props: ['groupList'], |
| | | data () { |
| | | let validatePhone = (rule, value, callback)=>{ |
| | |
| | | wrapperCol: { span: 14 }, |
| | | areaId: null, |
| | | orgName: '', |
| | | areaVal: [], |
| | | orgData: [], |
| | | fieldNames:{ |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children' |
| | | }, |
| | | form: { |
| | | id: null, |
| | | name: '', |
| | |
| | | key:'id', |
| | | value: 'id' |
| | | }, |
| | | currentKey: [], |
| | | openKeys: [], |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | const t = this |
| | | t.getDistrictInfo() |
| | | // t.getDistrictInfo() |
| | | t.getStructure() |
| | | }, |
| | | |
| | | |
| | | methods:{ |
| | | openDialog(type,data,areaId,orgName,orgId){ |
| | | openDialog(type,data,areaId,orgName,orgId) { |
| | | const t = this |
| | | t.changeArea(areaId) |
| | | t.createRules() |
| | | t.areaId = Number(areaId) |
| | | t.orgName = orgName |
| | | |
| | | if(type == 'add'){ |
| | | t.title = '新增责任人' |
| | | t.isView = false |
| | |
| | | } |
| | | } |
| | | t.visible = true |
| | | }, |
| | | onChange(value) { |
| | | const t = this |
| | | |
| | | }, |
| | | isValidKey(key, object){ |
| | | return key in object; |
| | |
| | | }); |
| | | }, |
| | | |
| | | async getStructure(){ |
| | | const t = this |
| | | const res = await getStructure() |
| | | if(res.data.code == 100){ |
| | | t.areaData = t.filterBranches(res.data.data,['自治区直辖县级行政区划']) |
| | | // const firstItem = this.firstIdWithOrgStructures(res.data.data[0]) |
| | | // if(firstItem){ |
| | | // t.openKeys = [firstItem.id +'-'+ firstItem.name] |
| | | // t.currentId = firstItem.id |
| | | // t.currentKey = [firstItem.orgStructures[0].id +'-'+ firstItem.orgStructures[0].orgName] |
| | | // }else{ |
| | | // t.$message.warning('暂无可操作的单位,请先进入“组织架构维护页面”新建相应的本级单位') |
| | | // } |
| | | }else{ |
| | | t.$message.warning(res.data.msg) |
| | | } |
| | | }, |
| | | filterBranches(branches, targetNames) { |
| | | return branches.filter(branch => { |
| | | if (targetNames.includes(branch.name)) { |
| | | return false; // 过滤掉当前分支 |
| | | } |
| | | if (branch.children && branch.children.length > 0) { |
| | | branch.children = this.filterBranches(branch.children, targetNames); |
| | | } |
| | | return true; // 保留当前分支 |
| | | }); |
| | | }, |
| | | async getDistrictInfo(){ |
| | | let res = await getDistrictInfo() |
| | | let res = await getStructure() |
| | | if(res.data.code == 100){ |
| | | this.areaData = res.data.data |
| | | } else { |
| | |
| | | handleCancel(e) { |
| | | const t = this |
| | | t.visible = false; |
| | | }, |
| | | changeArea(val){ |
| | | const t = this |
| | | t.form.districtId = val; |
| | | t.form.districtCode = t.findCodeById(t.areaData,val) |
| | | t.form.orgStructureId = null; |
| | | getOrgData(val).then(res => { |
| | | if(res.data.code === 100) { |
| | | console.log("res",res) |
| | | t.orgData = res.data.data |
| | | }else { |
| | | t.$message.warning(res.data.msg) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | <a-button type="danger" @click="deliverTask" v-if="!unittype || unittype == 1">下发更新任务</a-button> |
| | | </div> |
| | | </div> |
| | | <div style="margin: 20px 0"> |
| | | <a-button type="primary" style="margin-right: 10px" @click="editData('add',{})">新增</a-button> |
| | | <a-button type="primary" @click="massImport()">批量导入</a-button> |
| | | <div style="margin: 20px 0;display: flex;justify-content: space-between"> |
| | | <div> |
| | | <a-button type="primary" style="margin-right: 10px" @click="editData('add',{})">新增</a-button> |
| | | <a-button type="primary" @click="massImport()">批量导入</a-button> |
| | | </div> |
| | | <a-button type="primary" @click="openExport">批量导出</a-button> |
| | | |
| | | <!-- <download-excel :data="json_data" :fields="json_fields" name="责任人导出.xlsx" >--> |
| | | <!-- <a-button type="primary">批量导出</a-button>--> |
| | | <!-- </download-excel>--> |
| | | |
| | | </div> |
| | | |
| | | <div class="table-cont"> |
| | | <a-table :columns="columns" :data-source="tableData" :pagination="pagination" :rowKey="record=>record.id.toString()" bordered> |
| | | <template #index="text,record,index"> |
| | |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | </a-modal> |
| | | <a-modal v-model="exportDialog" title="导出通讯录" :footer="null" centered :afterClose="closeDialog"> |
| | | <a-form-model ref="ruleForm" :label-col="labelCol" :wrapper-col="wrapperCol" :colon="false"> |
| | | <a-form-model-item label="行政区划" > |
| | | <a-tree-select |
| | | v-model="exportAreaId" |
| | | style="width: 100%" |
| | | :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" |
| | | :tree-data="treeData" |
| | | placeholder="请选择行政区划" |
| | | :replaceFields="replaceFields" |
| | | @change="changeArea" |
| | | /> |
| | | </a-form-model-item> |
| | | <div v-if=" json_data.length>0"> |
| | | <download-excel :data="json_data" :fields="json_fields" name="责任人导出.xlsx" style="display: flex;justify-content: flex-end"> |
| | | <a-button type="primary">批量导出</a-button> |
| | | </download-excel> |
| | | </div> |
| | | <div v-else style="text-align: center;color: salmon">暂无人员导出</div> |
| | | |
| | | </a-form-model> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | } from "@/api/contactBook"; |
| | | import subMenu from "@/views/Admin/contactBook/subMenu"; |
| | | import contactorsMod from "@/views/Admin/components/contactorsMod" |
| | | import {importUser} from "@/api/user"; |
| | | import {getExportData, importUser} from "@/api/user"; |
| | | import importNew from "@/assets/importNew.xlsx"; |
| | | import JSONBig from 'json-bigint' |
| | | export default { |
| | |
| | | value: 'id', |
| | | children: 'children' |
| | | }, |
| | | currentId: null |
| | | currentId: null, |
| | | exportDialog: false, |
| | | areaId: null, |
| | | areaData: [], |
| | | exportAreaId: null, |
| | | replaceFields: { |
| | | children:'children', |
| | | title:'name', |
| | | key:'id', |
| | | value: 'code' |
| | | }, |
| | | json_fields: { |
| | | 'ID': 'id', |
| | | '姓名': 'name', |
| | | '所属当前级别行政区划': 'districtName', |
| | | '区划编号': 'districtCode', |
| | | '组织架构': 'orgStructureName', |
| | | '单位': 'company', |
| | | '职务': 'post', |
| | | '电话号码': 'phone', |
| | | '责任类型': { |
| | | field: 'orgUserTypes', |
| | | callback: (value) => { |
| | | return value?value.map(i=>i.typeName + '(' + i.orgUserTags.map(j=>j.tagName).join('/') +')').join(','): '' |
| | | } |
| | | }, |
| | | }, |
| | | json_data: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | clearMod(){ |
| | | this.fileList = [] |
| | | }, |
| | | closeDialog(){ |
| | | this.exportAreaId = null; |
| | | this.json_data = []; |
| | | this.exportDialog = false; |
| | | }, |
| | | async getStructure(){ |
| | | const t = this |
| | | const res = await getStructure() |
| | |
| | | t.$message.warning(res.data.msg) |
| | | } |
| | | }, |
| | | |
| | | |
| | | filterBranches(branches, targetNames) { |
| | | return branches.filter(branch => { |
| | |
| | | } |
| | | }, |
| | | |
| | | openExport() { |
| | | this.exportDialog = true |
| | | }, |
| | | |
| | | handleClick(e) { |
| | | this.currentId = e.keyPath[1]?e.keyPath[1].split('-')[0]:e.keyPath[0].split('-')[0] |
| | |
| | | }, |
| | | }); |
| | | }, |
| | | changeArea(value){ |
| | | console.log('val',this.exportAreaId) |
| | | getExportData(this.exportAreaId).then(res => { |
| | | if(res.data.code == 100){ |
| | | this.json_data = res.data.data |
| | | }else{ |
| | | this.$message.warning(res.data.msg); |
| | | } |
| | | }) |
| | | console.log('this.json_data',this.json_data) |
| | | }, |
| | | |
| | | async deliverTask(){ |
| | | const t = this |