From 76e5433c49a1dc0ccd9f0b37a385f3297d568411 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期二, 09 九月 2025 15:47:52 +0800 Subject: [PATCH] 增加手动发起流程 --- src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue | 151 +++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 137 insertions(+), 14 deletions(-) diff --git a/src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue b/src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue index d305e4e..6b1496a 100644 --- a/src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue +++ b/src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue @@ -1,22 +1,29 @@ <template> <div> - <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" - :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> - + <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading" + :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> + <!-- 瀛楃涓茶秴闀挎埅鍙栫渷鐣ュ彿鏄剧ず--> + <span slot="docName" slot-scope="text"> + <j-ellipsis :value="text"/> + </span> </a-table> <DocumentModal ref="modalForm" @ok="modalFormOk"/> + + <NcDocumentAssignModal :size="size" ref="documentAssignModalRef" + :currentDocumentInfo="currentRightClickedDocumentInfo"/> </div> </template> <script> - import { getAction } from '@/api/manage' +import { getAction, postAction } from '@/api/manage' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import DocumentModal from '../../../../common/DocumentModal' + import NcDocumentAssignModal from '@views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue' export default { name: 'OtherDocumentTableList', - components: { DocumentModal }, + components: { NcDocumentAssignModal, DocumentModal }, mixins: [JeecgListMixin], props: { currentTreeNodeInfo: { @@ -40,18 +47,61 @@ return parseInt(index) + 1 } }, - { title: '鏂囦欢鍚嶇О', dataIndex: 'docName', align: 'center' }, + { + title: '鏂囦欢鍚嶇О', + dataIndex: 'docName', + key: 'docName', + align: 'center', + scopedSlots: { customRender: 'docName' }, + width: 300, + sorter: true + }, { title: '璁惧缂栧彿', dataIndex: 'docCode', align: 'center' }, - { title: '鍑哄簱鐘舵��', dataIndex: 'pullStatus_dictText', align: 'center' }, - { title: '鐘� 鎬�', dataIndex: 'docStatus_dictText', align: 'center' }, - { title: '绯荤粺鎸囧畾鐗堟湰', dataIndex: 'publishVersion', align: 'center' }, - { title: '涓婁紶鏃堕棿', dataIndex: 'createTime', align: 'center' } + { + title: '鐢熷懡鍛ㄦ湡', + dataIndex: 'pullStatus_dictText', + key: 'pullStatus', + align: 'center', + filters: [ + { text: '鏈嚭搴�', value: 1 }, + { text: '宸插嚭搴�', value: 2 } + ] + }, + { + title: '鐘� 鎬�', + dataIndex: 'docDispatchStatus_dictText', + key: 'docDispatchStatus', + align: 'center', + filters: [ + { text: '缂栧埗', value: 1 }, + { text: '鏍″', value: 2 }, + { text: '鎵瑰噯', value: 3 }, + ] + }, + { title: '绯荤粺鎸囧畾鐗堟湰', dataIndex: 'publishVersion', align: 'center', width: 200 }, + { + title: '鍒涘缓鏃堕棿', + dataIndex: 'createTime', + align: 'center', + width: 200, + sorter: true + } ], dataSource: [], - currentDocumentInfo: {}, + currentRightClickedDocumentInfo: {}, + currentClickedDocumentInfo: {}, url: { - list: '/nc/doc/find/page' + list: '/nc/doc/find/page', + startDispatchFile:'/dncFlow/dispatchFile/startDispatchFile', } + } + }, + watch: { + currentTreeNodeInfo: { + handler(value) { + this.currentClickedDocumentInfo = this.currentRightClickedDocumentInfo = {} + }, + immediate: true } }, created() { @@ -91,25 +141,98 @@ customRow(record) { return { + style: { + backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent' + }, on: { contextmenu: event => { event.preventDefault() + this.currentRightClickedDocumentInfo = Object.assign({ param: 'OTHER' }, record) this.$emit('handleTableContextMenuOpen', { ...record, param: 'OTHER' }) }, click: () => { - if (this.currentDocumentInfo.docId === record.docId) return - this.currentDocumentInfo = Object.assign({}, record) + if (this.currentClickedDocumentInfo.docId === record.docId) return + this.currentClickedDocumentInfo = Object.assign({}, record) this.$bus.$emit('sendCurrentClickedDocumentInfo', record) } } } }, + /** + * 琛ㄦ牸鍒嗛〉銆佹帓搴忔敼鍙樸�佺瓫閫夋椂瑙﹀彂 + * @param pagination 鍒嗛〉鍣ㄩ�夐」 + * @param filters 绛涢�夐�夐」 + * @param sorter 鎺掑簭閫夐」 + */ + handleTableChange(pagination, filters, sorter) { + if (sorter.order) { + this.isorter.column = sorter.field + this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' + } else { + this.isorter.column = 'createTime' + this.isorter.order = 'desc' + } + for (let key in filters) { + this.filters[key] = filters[key].join(',') + } + this.ipagination = pagination + this.loadData() + }, + handleDocumentEdit(record, modalTitle) { + if (!this.$refs.modalForm) return this.$refs.modalForm.edit(record) this.$refs.modalForm.title = modalTitle }, + handleDocumentAssign(record, modalTitle) { + if (!this.$refs.documentAssignModalRef) return + this.$refs.documentAssignModalRef.title = modalTitle + this.$refs.documentAssignModalRef.visible = true + }, + handleDocumentDispatch(record) { + const that = this + console.log("sssss",record) + that.$confirm({ + title: '鎻愮ず', + content: `纭鍙戣捣瀹$娴佺▼鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + let dispatchFile = { + 'docId':record.docId, + 'attributionId':record.attributionId, + 'attributionType':record.attributionType, + 'fileId':record.publishFileId, + 'docClassCode':record.classificationId_dictText, + } + postAction(this.url.startDispatchFile,dispatchFile) + .then(res => { + if (res.success) { + this.$message.success('娴佺▼鍙戣捣鎴愬姛') + } else { + that.$notification.error({ + message: '娑堟伅', + description: res.message + }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message + }) + }) + .finally(() => { + that.$destroyAll() + }) + }, + onCancel: () => { + that.$destroyAll() + } + }) + }, handleDelete() { // 姝ゅ鍑芥暟涓哄睆钄絤ixins涓殑鍚屽悕鍑芥暟锛岄�氱敤鍑芥暟鍐欏湪鐖剁骇涓� }, -- Gitblit v1.9.3