From c6d894ff985a2780c7e1c23f22facb04eee06826 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期四, 16 一月 2025 15:30:12 +0800 Subject: [PATCH] 我的工作台页面 DNC部门管理页面 --- src/views/system/DncDepartmentList.vue | 634 ++++++++++++++++++++++++++++++ src/views/dnc/base/WorkDoneList.vue | 178 ++++++++ src/views/dnc/base/WorkUpcomingList.vue | 221 ++++++++++ src/views/system/modules/DncDepartmentModal.vue | 197 +++++++++ 4 files changed, 1,230 insertions(+), 0 deletions(-) diff --git a/src/views/dnc/base/WorkDoneList.vue b/src/views/dnc/base/WorkDoneList.vue new file mode 100644 index 0000000..6957163 --- /dev/null +++ b/src/views/dnc/base/WorkDoneList.vue @@ -0,0 +1,178 @@ +<!-- + Description: 鎴戠殑宸ヤ綔鍙�-宸插姙 List + Author: 浣滆�� liuyh + Date: 2025-01-15 +--> +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> +<!-- <div class="table-page-search-wrapper">--> +<!-- <a-form layout="inline" @keyup.enter.native="searchQuery">--> +<!-- <a-row :gutter="24">--> +<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> +<!-- <a-form-item label="鏂囨。鍚嶇О">--> +<!-- <a-input placeholder="杈撳叆鏂囨。鍚嶇О" v-model="queryParam.actName"></a-input>--> +<!-- </a-form-item>--> +<!-- </a-col>--> +<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> +<!-- <a-form-item label="璁惧鍚嶇О">--> +<!-- <a-input placeholder="杈撳叆璁惧鍚嶇О" v-model="queryParam.actName"></a-input>--> +<!-- </a-form-item>--> +<!-- </a-col>--> +<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> +<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">--> +<!-- <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>--> +<!-- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>--> +<!-- </span>--> +<!-- </a-col>--> +<!-- </a-row>--> +<!-- </a-form>--> +<!-- </div>--> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button type="primary" @click="searchQuery" icon="search">鍒锋柊</a-button> +<!-- <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>--> + </div> + + <!-- table鍖哄煙-begin --> + <div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleDetail(record)">璇︽儏</a> + </span> + </a-table> + </div> + + + <AssignApproveUserModal ref="modalForm" @ok="modalFormOk"></AssignApproveUserModal> + + </a-card> +</template> + +<script> + +import '@assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JDictSelectTag from '@comp/dict/JDictSelectTag.vue' +import AssignApproveUserModal from './modules/AssignApproveUser/AssignApproveUserModal__Style#Drawer.vue' + +export default { + name: 'AssignApproveUser', + mixins:[JeecgListMixin, mixinDevice], + components: { + JDictSelectTag, + AssignApproveUserModal + }, + data () { + return { + description: '鎴戠殑宸ヤ綔鍙�-宸插姙', + // 琛ㄥご + columns: [ + { + title: '搴忓彿', + dataIndex: '', + key:'rowIndex', + width:200, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title: '鏂囨。鍚嶇О', + align: "center", + dataIndex: 'docName', + width: 250, + }, + { + title: '璁惧鍚嶇О', + align: "center", + dataIndex: 'deviceName', + width: 250, + }, + { + title: '鏂囨。鐗堟湰', + align: "center", + dataIndex: 'version', + width: 250, + }, + { + title: '瀵嗙骇', + align: "center", + dataIndex: 'secretLevel', + width:300 + }, + { + title: '瀹℃壒缁撴灉', + align: "center", + dataIndex: 'status_dictText', + width:300 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 200, + fixed: 'right' + } + ], + url: { + list: "/nc/activit/find/page", + delete: "/nc/definition/delete", + }, + dictOptions:{}, + } + }, + created() { + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + } + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/dnc/base/WorkUpcomingList.vue b/src/views/dnc/base/WorkUpcomingList.vue new file mode 100644 index 0000000..23453c8 --- /dev/null +++ b/src/views/dnc/base/WorkUpcomingList.vue @@ -0,0 +1,221 @@ +<!-- + Description: 鎴戠殑宸ヤ綔鍙�-浠e姙 List + Author: 浣滆�� liuyh + Date: 2025-01-15 +--> +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> +<!-- <div class="table-page-search-wrapper">--> +<!-- <a-form layout="inline" @keyup.enter.native="searchQuery">--> +<!-- <a-row :gutter="24">--> +<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> +<!-- <a-form-item label="鏂囨。鍚嶇О">--> +<!-- <a-input placeholder="杈撳叆鏂囨。鍚嶇О" v-model="queryParam.actName"></a-input>--> +<!-- </a-form-item>--> +<!-- </a-col>--> +<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> +<!-- <a-form-item label="璁惧鍚嶇О">--> +<!-- <a-input placeholder="杈撳叆璁惧鍚嶇О" v-model="queryParam.actName"></a-input>--> +<!-- </a-form-item>--> +<!-- </a-col>--> +<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> +<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">--> +<!-- <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>--> +<!-- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>--> +<!-- </span>--> +<!-- </a-col>--> +<!-- </a-row>--> +<!-- </a-form>--> +<!-- </div>--> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button type="primary" @click="searchQuery" icon="search">鍒锋柊</a-button> +<!-- <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>--> + </div> + + <!-- table鍖哄煙-begin --> + <div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 + <a-icon type="down" /> + </a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + </a-table> + </div> + + + <AssignApproveUserModal ref="modalForm" @ok="modalFormOk"></AssignApproveUserModal> + + </a-card> +</template> + +<script> + +import '@assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JDictSelectTag from '@comp/dict/JDictSelectTag.vue' +import AssignApproveUserModal from './modules/AssignApproveUser/AssignApproveUserModal__Style#Drawer.vue' + +export default { + name: 'AssignApproveUser', + mixins:[JeecgListMixin, mixinDevice], + components: { + JDictSelectTag, + AssignApproveUserModal + }, + data () { + return { + description: '鎴戠殑宸ヤ綔鍙�-浠e姙', + // 琛ㄥご + columns: [ + { + title: '搴忓彿', + dataIndex: '', + key:'rowIndex', + width:200, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title: '浜у搧鍚嶇О', + align: "center", + dataIndex: 'productName', + width: 200, + }, + { + title: '閮ㄤ欢鍚嶇О', + align: "center", + dataIndex: 'componentName', + width: 220, + }, + { + title: '闆朵欢鍚嶇О', + align: "center", + dataIndex: 'partsName', + width: 250, + }, + { + title: '鏂囨。鍚嶇О', + align: "center", + dataIndex: 'docName', + width: 250, + }, + { + title: '璁惧鍚嶇О', + align: "center", + dataIndex: 'deviceName', + width: 250, + }, + { + title: '鏂囨。鐗堟湰', + align: "center", + dataIndex: 'version', + width: 250, + }, + { + title: '鐢宠浜�', + align: "center", + dataIndex: 'applyUser_dictText', + width:300 + }, + { + title: '鐢宠鍘熷洜', + align: "center", + dataIndex: 'applyReason', + width:300 + }, + { + title: '鐢宠鏃堕棿', + align: "center", + dataIndex: 'applyTime', + width:300 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 200, + fixed: 'right' + } + ], + url: { + list: "/nc/activit/find/task/list", + delete: "/nc/definition/delete", + }, + dictOptions:{}, + } + }, + created() { + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + } + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/system/DncDepartmentList.vue b/src/views/system/DncDepartmentList.vue new file mode 100644 index 0000000..8d36317 --- /dev/null +++ b/src/views/system/DncDepartmentList.vue @@ -0,0 +1,634 @@ +<template xmlns:background-color="http://www.w3.org/1999/xhtml"> + <a-row :gutter="10"> + <a-col :md="12" :sm="24"> + <a-card :bordered="false"> + + <!-- 鎸夐挳鎿嶄綔鍖哄煙 --> + <a-row style="margin-left: 14px"> + <a-button @click="handleAdd(1)" type="primary">娣诲姞閮ㄩ棬</a-button> + <a-button @click="handleAdd(2)" type="primary">娣诲姞涓嬬骇</a-button> + <a-button title="鍒犻櫎澶氭潯鏁版嵁" @click="batchDel" type="default">鎵归噺鍒犻櫎</a-button> + <!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">鍒锋柊</a-button>--> + </a-row> + <div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px"> + <a-alert type="info" :showIcon="true"> + <div slot="message"> + 褰撳墠閫夋嫨锛�<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span> + <a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">鍙栨秷閫夋嫨</a> + </div> + </a-alert> + <a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="璇疯緭鍏ラ儴闂ㄥ悕绉�"/> + <!-- 鏍�--> + <a-col :md="10" :sm="24"> + <template> + <a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus"> + <span style="user-select: none"> + <a-tree + checkable + multiple + @select="onSelect" + @check="onCheck" + @rightClick="rightHandle" + :selectedKeys="selectedKeys" + :checkedKeys="checkedKeys" + :treeData="departTree" + :checkStrictly="checkStrictly" + :expandedKeys="iExpandedKeys" + :autoExpandParent="autoExpandParent" + @expand="onExpand"/> + </span> + <!--鏂板鍙抽敭鐐瑰嚮浜嬩欢,鍜屽鍔犳坊鍔犲拰鍒犻櫎鍔熻兘--> + <a-menu slot="overlay"> + <a-menu-item @click="handleAdd(3)" key="1">娣诲姞</a-menu-item> + <a-menu-item @click="handleDelete" key="2">鍒犻櫎</a-menu-item> + <a-menu-item @click="closeDrop" key="3">鍙栨秷</a-menu-item> + </a-menu> + </a-dropdown> + </template> + </a-col> + </div> + </a-card> + <!---- author:os_chengtgen -- date:20190827 -- for:鍒囨崲鐖跺瓙鍕鹃�夋ā寮� =======------> + <div class="drawer-bootom-button"> + <a-dropdown :trigger="['click']" placement="topCenter"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="switchCheckStrictly(1)">鐖跺瓙鍏宠仈</a-menu-item> + <a-menu-item key="2" @click="switchCheckStrictly(2)">鍙栨秷鍏宠仈</a-menu-item> + <a-menu-item key="3" @click="checkALL">鍏ㄩ儴鍕鹃��</a-menu-item> + <a-menu-item key="4" @click="cancelCheckALL">鍙栨秷鍏ㄩ��</a-menu-item> + <a-menu-item key="5" @click="expandAll">灞曞紑鎵�鏈�</a-menu-item> + <a-menu-item key="6" @click="closeAll">鍚堝苟鎵�鏈�</a-menu-item> + </a-menu> + <a-button> + 鏍戞搷浣� <a-icon type="up" /> + </a-button> + </a-dropdown> + </div> + <!---- author:os_chengtgen -- date:20190827 -- for:鍒囨崲鐖跺瓙鍕鹃�夋ā寮� =======------> + </a-col> + <a-col :md="12" :sm="24"> + <a-tabs defaultActiveKey="1"> + <a-tab-pane tab="鍩烘湰淇℃伅" key="1" > + <a-card :bordered="false" v-if="selectedKeys.length>0"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departName" label="鏈烘瀯鍚嶇О"> + <a-input placeholder="璇疯緭鍏ユ満鏋�/閮ㄩ棬鍚嶇О" v-model="model.departName" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="涓婄骇閮ㄩ棬"> + <a-tree-select + style="width:100%" + :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" + :treeData="treeData" + :disabled="disable" + v-model="model.parentId" + placeholder="鏃�"> + </a-tree-select> + </a-form-model-item> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orgCode" label="鏈烘瀯缂栫爜">--> + <!--<a-input disabled placeholder="璇疯緭鍏ユ満鏋勭紪鐮�" v-model="model.orgCode" />--> + <!--</a-form-model-item>--> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orgCategory" label="鏈烘瀯绫诲瀷">--> + <!--<template v-if="orgCategoryDisabled">--> + <!--<a-radio-group v-model="model.orgCategory" placeholder="璇烽�夋嫨鏈烘瀯绫诲瀷">--> + <!--<a-radio value="1">--> + <!--鍏徃--> + <!--</a-radio>--> + <!--</a-radio-group>--> + <!--</template>--> + <!--<template v-else>--> + <!--<a-radio-group v-model="model.orgCategory" placeholder="璇烽�夋嫨鏈烘瀯绫诲瀷">--> + <!--<a-radio value="2">--> + <!--閮ㄩ棬--> + <!--</a-radio>--> + <!--<a-radio value="3">--> + <!--宀椾綅--> + <!--</a-radio>--> + <!--</a-radio-group>--> + <!--</template>--> + <!--</a-form-model-item>--> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="閮ㄩ棬璐熻矗浜�">--> + <!--<j-select-multi-user v-model="model.directorUserIds" valueKey="id"></j-select-multi-user>--> + <!--</a-form-model-item>--> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鎺掑簭"> + <a-input-number v-model="model.priority" /> + </a-form-model-item> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鎵嬫満鍙�" prop="mobile">--> + <!--<a-input placeholder="璇疯緭鍏ユ墜鏈哄彿" v-model="model.mobile" />--> + <!--</a-form-model-item>--> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍦板潃">--> + <!--<a-input placeholder="璇疯緭鍏ュ湴鍧�" v-model="model.address"/>--> + <!--</a-form-model-item>--> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="澶囨敞"> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.description"/> + </a-form-model-item> + </a-form-model> + <div class="anty-form-btn"> + <a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">閲嶇疆</a-button> + <a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">淇濆瓨</a-button> + </div> + </a-card> + <a-card v-else > + <a-empty> + <span slot="description"> 璇峰厛閫夋嫨涓�涓儴闂�! </span> + </a-empty> + </a-card> + </a-tab-pane> + <a-tab-pane tab="閮ㄩ棬鏉冮檺" key="2" forceRender> + <DepartMentAuthModal ref="departAuth"/> + </a-tab-pane> + </a-tabs> + + </a-col> + <DncDepartmentModal ref="DncDepartmentModal" @ok="loadTree"></DncDepartmentModal> + </a-row> +</template> +<script> + import {queryDepartTreeList, searchByKeywords, deleteByDepartId} from '@/api/api' + import { httpAction, deleteAction, getAction } from '@/api/manage' + import {JeecgListMixin} from '@/mixins/JeecgListMixin' + import DncDepartmentModal from './modules/DncDepartmentModal' + import DepartMentAuthModal from './modules/DepartMentAuthModal' + import Vue from 'vue' + // 琛ㄥご + const columns = [ + { + title: '鏈烘瀯鍚嶇О', + dataIndex: 'departName' + }, + { + title: '鏈烘瀯绫诲瀷', + align: 'center', + dataIndex: 'orgType' + }, + { + title: '鏈烘瀯缂栫爜', + dataIndex: 'orgCode', + }, + { + title: '鎵嬫満鍙�', + dataIndex: 'mobile' + }, + { + title: '浼犵湡', + dataIndex: 'fax' + }, + { + title: '鍦板潃', + dataIndex: 'address' + }, + { + title: '鎺掑簭', + align: 'center', + dataIndex: 'departOrder' + }, + { + title: '鎿嶄綔', + align: 'center', + dataIndex: 'action', + scopedSlots: {customRender: 'action'} + } + ] + export default { + name: 'DepartList', + mixins: [JeecgListMixin], + components: { + DncDepartmentModal, + DepartMentAuthModal + }, + data() { + return { + iExpandedKeys: [], + loading: false, + autoExpandParent: true, + currFlowId: '', + currFlowName: '', + disable: true, + treeData: [], + visible: false, + departTree: [], + rightClickSelectedKey: '', + rightClickSelectedOrgCode: '', + hiding: true, + model: {}, + dropTrigger: '', + depart: {}, + columns: columns, + disableSubmit: false, + checkedKeys: [], + selectedKeys: [], + autoIncr: 1, + currSelected: {}, + allTreeKeys:[], + checkStrictly: true, + labelCol: { + xs: {span: 24}, + sm: {span: 5} + }, + wrapperCol: { + xs: {span: 24}, + sm: {span: 16} + }, + graphDatasource: { + nodes: [], + edges: [] + }, + validatorRules: { + departName: [{required: true, message: '璇疯緭鍏ユ満鏋�/閮ㄩ棬鍚嶇О!'}], + orgCode: [{required: true, message: '璇疯緭鍏ユ満鏋勭紪鐮�!'}], + orgCategory:[{required: true, message: '璇烽�夋嫨鏈烘瀯绫诲瀷!'}], + mobile: Vue.prototype.rules.mobile2 + }, + url: { + tree:"/ucenter/depart/queryTreeList", + delete: '/ucenter/depart/delete', + edit: '/ucenter/depart/edit', + deleteBatch: '/sys/sysDepart/deleteBatch', + searchBy:'/ucenter/depart/searchBy', + }, + orgCategoryDisabled:false, + oldDirectorUserIds:"" + } + }, + computed: { + importExcelUrl: function () { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + } + }, + methods: { + loadData() { + this.refresh(); + }, + loadTree() { + var that = this + that.treeData = [] + that.departTree = [] + //淇敼鎺ュ彛 + getAction(this.url.tree).then((res) => { + if (res.success) { + //閮ㄩ棬鍏ㄩ�夊悗锛屽啀娣诲姞閮ㄩ棬锛岄�変腑鏁伴噺澧炲 + this.allTreeKeys = []; + for (let i = 0; i < res.result.length; i++) { + let temp = res.result[i] + that.treeData.push(temp) + that.departTree.push(temp) + that.setThisExpandedKeys(temp) + that.getAllKeys(temp); + // console.log(temp.id) + } + this.loading = false + } + }) + }, + setThisExpandedKeys(node) { + if (node.children && node.children.length > 0) { + this.iExpandedKeys.push(node.key) + for (let a = 0; a < node.children.length; a++) { + this.setThisExpandedKeys(node.children[a]) + } + } + }, + refresh() { + this.loading = true + this.loadTree() + }, + // 鍙抽敭鎿嶄綔鏂规硶 + rightHandle(node) { + this.dropTrigger = 'contextmenu' + console.log(node.node.eventKey) + this.rightClickSelectedKey = node.node.eventKey + this.rightClickSelectedOrgCode = node.node.dataRef.orgCode + }, + onExpand(expandedKeys) { + console.log('onExpand', expandedKeys) + this.iExpandedKeys = expandedKeys + this.autoExpandParent = false + }, + backFlowList() { + this.$router.back(-1) + }, + // 鍙抽敭鐐瑰嚮涓嬫媺妗嗘敼鍙樹簨浠� + dropStatus(visible) { + if (visible == false) { + this.dropTrigger = '' + } + }, + // 鍙抽敭涓嬫媺鍏抽棴涓嬫媺妗� + closeDrop() { + this.dropTrigger = '' + }, + addRootNode() { + this.$refs.nodeModal.add(this.currFlowId, '') + }, + batchDel: function () { + console.log(this.checkedKeys) + if (this.checkedKeys.length <= 0) { + this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒') + } else { + var ids = '' + for (var a = 0; a < this.checkedKeys.length; a++) { + ids += this.checkedKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '纭鍒犻櫎', + content: '纭畾瑕佸垹闄ゆ墍閫変腑鐨� ' + this.checkedKeys.length + ' 鏉℃暟鎹紝浠ュ強瀛愯妭鐐规暟鎹悧?', + onOk: function () { + deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.loadTree() + that.onClearSelected() + } else { + that.$message.warning(res.message) + } + }) + } + }) + } + }, + onSearch(value) { + let that = this + if (value) { + getAction(this.url.searchBy,{keyWord: value}).then((res) => { + if (res.success) { + that.departTree = [] + for (let i = 0; i < res.result.length; i++) { + let temp = res.result[i] + that.departTree.push(temp) + } + } else { + that.$message.warning(res.message) + } + }) + } else { + that.loadTree() + } + + }, + nodeModalOk() { + this.loadTree() + }, + nodeModalClose() { + }, + hide() { + console.log(111) + this.visible = false + }, + onCheck(checkedKeys, info) { + console.log('onCheck', checkedKeys, info) + this.hiding = false + //---- author:os_chengtgen -- date:20190827 -- for:鍒囨崲鐖跺瓙鍕鹃�夋ā寮� =======------ + if(this.checkStrictly){ + this.checkedKeys = checkedKeys.checked; + }else{ + this.checkedKeys = checkedKeys + } + //---- author:os_chengtgen -- date:20190827 -- for:鍒囨崲鐖跺瓙鍕鹃�夋ā寮� =======------ + }, + onSelect(selectedKeys, e) { + console.log('selected', selectedKeys, e) + this.hiding = false + let record = e.node.dataRef + console.log('onSelect-record', record) + this.currSelected = Object.assign({}, record) + this.model = this.currSelected + this.selectedKeys = [record.key] + this.model.parentId = record.parentId + this.setValuesToForm(record) + this.$refs.departAuth.show(record.departId); + this.oldDirectorUserIds = record.directorUserIds + + //update-beign-author:taoyan date:20220316 for: VUEN-329銆恇ug銆戜负浠�涔堜笉鏄け鍘荤劍鐐圭殑鏃跺�欙紝瑙﹀彂鎵嬫満鍙锋牎楠� + this.$nextTick(()=>{ + this.$refs.form.validateField('mobile') + }) + //update-end-author:taoyan date:20220316 for: VUEN-329銆恇ug銆戜负浠�涔堜笉鏄け鍘荤劍鐐圭殑鏃跺�欙紝瑙﹀彂鎵嬫満鍙锋牎楠� + }, + // 瑙﹀彂onSelect浜嬩欢鏃�,涓洪儴闂ㄦ爲鍙充晶鐨刦orm琛ㄥ崟璧嬪�� + setValuesToForm(record) { + if(record.orgCategory == '1'){ + this.orgCategoryDisabled = true; + }else{ + this.orgCategoryDisabled = false; + } + }, + getCurrSelectedTitle() { + return !this.currSelected.title ? '' : this.currSelected.title + }, + onClearSelected() { + this.hiding = true + this.checkedKeys = [] + this.currSelected = {} + this.selectedKeys = [] + this.$refs.departAuth.departId = '' + }, + handleNodeTypeChange(val) { + this.currSelected.nodeType = val + }, + notifyTriggerTypeChange(value) { + this.currSelected.notifyTriggerType = value + }, + receiptTriggerTypeChange(value) { + this.currSelected.receiptTriggerType = value + }, + submitCurrForm() { + this.$refs.form.validate(valid => { + if (valid) { + if (!this.currSelected.departId) { + this.$message.warning('璇风偣鍑婚�夋嫨瑕佷慨鏀归儴闂�!') + return + } + + //update-begin---author:wangshuai ---date:20200308 for锛歔JTC-119]鍦ㄩ儴闂ㄧ鐞嗚彍鍗曚笅璁剧疆閮ㄩ棬璐熻矗浜� + this.currSelected.oldDirectorUserIds = this.oldDirectorUserIds + //update-end---author:wangshuai ---date:20200308 for锛歔JTC-119]鍦ㄩ儴闂ㄧ鐞嗚彍鍗曚笅璁剧疆閮ㄩ棬璐熻矗浜� + httpAction(this.url.edit+'/'+this.currSelected.departId, this.currSelected, 'put').then((res) => { + if (res.success) { + this.$message.success('淇濆瓨鎴愬姛!') + this.loadTree() + } else { + this.$message.error(res.message) + } + }) + } + }) + }, + emptyCurrForm() { + this.$refs.form.resetFields(); + this.model={} + }, + nodeSettingFormSubmit() { + this.$refs.form.validate(valid => { + if (valid) { + console.log('Received values of form: ', this.model) + } + }) + }, + openSelect() { + this.$refs.sysDirectiveModal.show() + }, + handleAdd(num) { + if (num == 1) { + this.$refs.DncDepartmentModal.add() + this.$refs.DncDepartmentModal.title = '鏂板' + } else if (num == 2) { + let key = this.currSelected.key + if (!key) { + this.$message.warning('璇峰厛鐐瑰嚮閫変腑涓婄骇閮ㄩ棬锛�') + return false + } + this.$refs.DncDepartmentModal.add(this.selectedKeys) + this.$refs.DncDepartmentModal.title = '鏂板' + } else { + this.$refs.DncDepartmentModal.add(this.rightClickSelectedKey) + this.$refs.DncDepartmentModal.title = '鏂板' + } + }, + handleDelete() { + var that = this + this.$confirm({ + title: '纭鍒犻櫎', + content: '纭畾瑕佸垹闄ゆ閮ㄩ棬浠ュ強瀛愯妭鐐规暟鎹悧?', + onOk: function () { + deleteAction(that.url.delete,{id: that.rightClickSelectedKey}).then((resp) => { + if (resp.success) { + //鍒犻櫎鎴愬姛鍚庯紝鍘婚櫎宸查�変腑涓殑鏁版嵁 + that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1); + that.$message.success('鍒犻櫎鎴愬姛!') + that.loadTree() + //鍒犻櫎鍚庡悓姝ユ竻绌哄彸渚у熀鏈俊鎭唴瀹� + let orgCode=that.model.orgCode; + if(orgCode && orgCode === that.rightClickSelectedOrgCode){ + that.onClearSelected() + } + } else { + that.$message.warning(resp.message) + } + }) + } + }) + }, + selectDirectiveOk(record) { + console.log('閫変腑鎸囦护鏁版嵁', record) + this.nodeSettingForm.setFieldsValue({directiveCode: record.directiveCode}) + this.currSelected.sysCode = record.sysCode + }, + getFlowGraphData(node) { + this.graphDatasource.nodes.push({ + id: node.id, + text: node.flowNodeName + }) + if (node.children.length > 0) { + for (let a = 0; a < node.children.length; a++) { + let temp = node.children[a] + this.graphDatasource.edges.push({ + source: node.id, + target: temp.id + }) + this.getFlowGraphData(temp) + } + } + }, + //---- author:os_chengtgen -- date:20190827 -- for:鍒囨崲鐖跺瓙鍕鹃�夋ā寮� =======------ + expandAll () { + this.iExpandedKeys = this.allTreeKeys + }, + closeAll () { + this.iExpandedKeys = [] + }, + checkALL () { + this.checkStriccheckStrictlytly = false + this.checkedKeys = this.allTreeKeys + }, + cancelCheckALL () { + //this.checkedKeys = this.defaultCheckedKeys + this.checkedKeys = [] + }, + switchCheckStrictly (v) { + if(v==1){ + this.checkStrictly = false + }else if(v==2){ + this.checkStrictly = true + } + }, + getAllKeys(node) { + // console.log('node',node); + this.allTreeKeys.push(node.key) + if (node.children && node.children.length > 0) { + for (let a = 0; a < node.children.length; a++) { + this.getAllKeys(node.children[a]) + } + } + } + //---- author:os_chengtgen -- date:20190827 -- for:鍒囨崲鐖跺瓙鍕鹃�夋ā寮� =======------ + + }, + created() { + this.currFlowId = this.$route.params.id + this.currFlowName = this.$route.params.name + // this.loadTree() + }, + + } +</script> +<style scoped> + .ant-card-body .table-operator { + margin: 15px; + } + + .anty-form-btn { + width: 100%; + text-align: center; + } + + .anty-form-btn button { + margin: 0 5px; + } + + .anty-node-layout .ant-layout-header { + padding-right: 0 + } + + .header { + padding: 0 8px; + } + + .header button { + margin: 0 3px + } + + .ant-modal-cust-warp { + height: 100% + } + + .ant-modal-cust-warp .ant-modal-body { + height: calc(100% - 110px) !important; + overflow-y: auto + } + + .ant-modal-cust-warp .ant-modal-content { + height: 90% !important; + overflow-y: hidden + } + + #app .desktop { + height: auto !important; + } + + /** Button鎸夐挳闂磋窛 */ + .ant-btn { + margin-left: 3px + } + + .drawer-bootom-button { + /*position: absolute;*/ + bottom: 0; + width: 100%; + border-top: 1px solid #e8e8e8; + padding: 10px 16px; + text-align: left; + left: 0; + background: #fff; + border-radius: 0 0 2px 2px; + } +</style> \ No newline at end of file diff --git a/src/views/system/modules/DncDepartmentModal.vue b/src/views/system/modules/DncDepartmentModal.vue new file mode 100644 index 0000000..40e6fcc --- /dev/null +++ b/src/views/system/modules/DncDepartmentModal.vue @@ -0,0 +1,197 @@ +<template> + <a-modal + :title="title" + :width="800" + :ok=false + :visible="visible" + :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="閮ㄩ棬缂栫爜" + prop="departName" + :hidden="false" + hasFeedback > + <a-input id="departCode" placeholder="璇疯緭鍏ラ儴闂ㄧ紪鐮�" v-model="model.departCode"/> + </a-form-model-item> + + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="閮ㄩ棬鍚嶇О" + prop="departName" + :hidden="false" + hasFeedback > + <a-input id="departName" placeholder="璇疯緭鍏ラ儴闂ㄥ悕绉�" v-model="model.departName"/> + </a-form-model-item> + + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :hidden="seen" label="涓婄骇閮ㄩ棬" hasFeedback> + <a-tree-select + style="width:100%" + :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" + :treeData="departTree" + v-model="model.parentId" + placeholder="璇烽�夋嫨涓婄骇閮ㄩ棬" + :disabled="condition"> + </a-tree-select> + </a-form-model-item> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="鎺掑簭"> + <a-input-number v-model="model.getPriority"/> + </a-form-model-item> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="澶囨敞"> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.description"/> + </a-form-model-item> + + </a-form-model> + </a-spin> + </a-modal> +</template> + +<script> +import { getAction, httpAction } from '@/api/manage' + import { queryIdTree } from '@/api/api' + import pick from 'lodash.pick' + import ATextarea from 'ant-design-vue/es/input/TextArea' + export default { + name: "SysDepartModal", + components: { ATextarea }, + data () { + return { + departTree:[], + orgTypeData:[], + phoneWarning:'', + departName:"", + departCode:"", + title:"鎿嶄綔", + seen:false, + visible: false, + condition:true, + disableSubmit:false, + model: {}, + defaultModel:{ + getPriority:0, + orgCategory:'1' + }, + menuhidden:false, + menuusing:true, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules:{ + departName:[{ required: true, message: '璇疯緭鍏ラ儴闂ㄥ悕绉�!' }], + departCode:[{ required: true, message: '璇疯緭鍏ラ儴闂ㄧ紪鐮�!' }], + mobile: [{validator:this.validateMobile}], + orgCategory:[{required: true, message: '璇疯緭鍏ラ儴闂ㄧ被鍨�!'}] + }, + url: { + tree:"/ucenter/depart/queryTreeList", + add: "/ucenter/depart/add", + }, + dictDisabled:true, + } + }, + created () { + }, + methods: { + loadTreeData(){ + var that = this; + getAction(this.url.tree).then((res) => { + if(res.success){ + that.departTree = []; + for (let i = 0; i < res.result.length; i++) { + let temp = res.result[i]; + that.departTree.push(temp); + } + } + + }) + }, + add (depart) { + if(depart){ + this.seen = false; + this.dictDisabled = false; + }else{ + this.seen = true; + this.dictDisabled = true; + } + this.edit(depart); + }, + edit (record) { + this.visible = true; + this.model = Object.assign({}, this.defaultModel, record) + this.loadTreeData(); + this.model.parentId = record!=null?record.toString():null; + if(this.seen){ + this.model.orgCategory = '1'; + }else{ + this.model.orgCategory = '2'; + } + }, + close () { + this.$emit('close'); + this.disableSubmit = false; + this.visible = false; + this.$refs.form.resetFields(); + }, + handleOk () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + httpAction(this.url.add,this.model,"post").then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.loadTreeData(); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + validateMobile(rule,value,callback){ + if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)){ + callback(); + }else{ + callback("鎮ㄧ殑鎵嬫満鍙风爜鏍煎紡涓嶆纭�!"); + } + + } + } + } +</script> + +<style scoped> + +</style> \ No newline at end of file -- Gitblit v1.9.3