From c172f50f28cb37b982eb39a0a9a257cbc60b3a3e Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期二, 18 三月 2025 18:04:53 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/mdc/base/EquipmentShutDownReasonList.vue | 170 ++++++ src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue | 4 src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue | 3 src/views/mdc/base/EquipmentStandbyShutDown.vue | 121 ++++ src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue | 4 src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue | 7 src/views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownList.vue | 213 +++++++ src/views/dnc/base/modules/ProductStructure/ProcessSpecVersion/ProcessSpecVersionInfo.vue | 36 + src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue | 7 src/api/dnc.js | 2 src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue | 2 src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue | 26 src/views/dnc/base/modules/DeviceStructure/DeviceStructureMainTop.vue | 715 ++++++++++++------------ src/views/mdc/base/modules/EquipmentShutDownReasonList/EquipmentShutDownReasonModal.vue | 159 +++++ src/views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownModal.vue | 167 +++++ src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue | 5 src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue | 11 src/views/dnc/base/modules/DeviceStructure/DeviceStructureMain.vue | 4 src/views/dnc/common/DocumentInfo.vue | 12 19 files changed, 1,289 insertions(+), 379 deletions(-) diff --git a/src/api/dnc.js b/src/api/dnc.js index 4875d2a..7945af3 100644 --- a/src/api/dnc.js +++ b/src/api/dnc.js @@ -28,7 +28,7 @@ // 鎸囨淳鏂囨。鍒拌澶� assignDocumentToDeviceApi: params => postAction('/nc/activit/assign/file/apply', params), // 涓嬭浇鏂囨。 - downloadDocumentApi: ({ docId, docName }) => downloadFile(`/nc/doc/download/${docId}`, docName), + downloadDocumentApi: ({ docId, docName }) => requestGetDownLoad(`/nc/doc/download/${docId}`, docName), // 鍒犻櫎鏂囨。 deleteDocumentApi: docId => deleteAction(`/nc/doc/delete?id=${docId}`), // 鏂囨。鍑哄簱 diff --git a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureMain.vue b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureMain.vue index 3014644..259d088 100644 --- a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureMain.vue +++ b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureMain.vue @@ -3,12 +3,12 @@ <template v-if="+currentTreeNodeInfo.type===2"> <div style="height: 100%;max-height: 748px"> <!--浜у搧缁撴瀯鏍戝彸渚ч《閮ㄥ尯鍩�--> - <div style="height: 45%;overflow: hidden"> + <div style="height: 55%;overflow: hidden"> <DeviceStructureMainTop :size="containerSize" ref="mainTopRef" :currentTreeNodeInfo="currentTreeNodeInfo"/> </div> <!--浜у搧缁撴瀯鏍戝彸渚у簳閮ㄥ尯鍩�--> - <div style="height: 55%;overflow: hidden"> + <div style="height: 45%;overflow: hidden"> <DeviceStructureMainBottom :size="containerSize" :currentTreeNodeInfo="currentTreeNodeInfo"/> </div> </div> diff --git a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureMainTop.vue b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureMainTop.vue index cfaa481..bdca851 100644 --- a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureMainTop.vue +++ b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureMainTop.vue @@ -4,11 +4,13 @@ v-if="Object.keys(currentTreeNodeInfo).length!==0"> <a-tab-pane :key="1" tab="鍙戦��"> <HasSentDocumentTableList ref="hasSentDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" + :currentTypeOfDevice="currentTypeOfDevice" @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> </a-tab-pane> <a-tab-pane :key="2" tab="鎺ユ敹"> <HasReceivedDocumentTableList ref="hasReceivedDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" + :currentTypeOfDevice="currentTypeOfDevice" @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> </a-tab-pane> @@ -22,403 +24,408 @@ </template> <script> - import dncApi from '@/api/dnc' - import TableContextMenu from '../../../common/TableContextMenu' - import HasSentDocumentTableList from './Document/HasSentDocumentTableList' - import HasReceivedDocumentTableList from './Document/HasReceivedDocumentTableList' - import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal' +import dncApi from '@/api/dnc' +import TableContextMenu from '../../../common/TableContextMenu' +import HasSentDocumentTableList from './Document/HasSentDocumentTableList' +import HasReceivedDocumentTableList from './Document/HasReceivedDocumentTableList' +import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal' - export default { - name: 'DeviceStructureMainTop', - components: { DocumentBatchDeleteModal, HasReceivedDocumentTableList, HasSentDocumentTableList, TableContextMenu }, - props: { - currentTreeNodeInfo: { - type: Object - } +export default { + name: 'DeviceStructureMainTop', + components: { DocumentBatchDeleteModal, HasReceivedDocumentTableList, HasSentDocumentTableList, TableContextMenu }, + props: { + currentTreeNodeInfo: { + type: Object + } + }, + data() { + return { + activeTabKey: 1, + tableContainerSize: 'small', + currentTypeOfDevice: 7,// 浜у搧缁撴瀯鏍戜腑瀹氫箟鐨勮澶囧眰绾ype涓�7 + currentRightClickedTableRowInfo: {}, + hasLoadedDataTabKeyArray: [] + } + }, + created() { + this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) + this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) + }, + beforeDestroy() { + this.$bus.$off('reloadDocumentListData', this.reloadDocumentListData) + this.$bus.$off('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) + }, + methods: { + /** + * 鎺у埗鍙抽敭鑿滃崟寮�鍚� + * @param record 褰撳墠琛ㄦ牸琛屼俊鎭� + */ + handleTableContextMenuOpen(record) { + this.currentRightClickedTableRowInfo = Object.assign({}, record) + this.$refs.tableContextMenuRef.currentMenuLevel = record.param + this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' + this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' + this.$refs.tableContextMenuRef.menuVisible = true + document.body.addEventListener('click', this.handleMenuClose) }, - data() { - return { - activeTabKey: 1, - tableContainerSize: 'small', - currentRightClickedTableRowInfo: {}, - hasLoadedDataTabKeyArray: [] - } - }, - created() { - this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) - this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) - }, - methods: { - /** - * 鎺у埗鍙抽敭鑿滃崟寮�鍚� - * @param record 褰撳墠琛ㄦ牸琛屼俊鎭� - */ - handleTableContextMenuOpen(record) { - this.currentRightClickedTableRowInfo = Object.assign({}, record) - this.$refs.tableContextMenuRef.currentMenuLevel = record.param - this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' - this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' - this.$refs.tableContextMenuRef.menuVisible = true - document.body.addEventListener('click', this.handleMenuClose) - }, - /** - * 褰撴爲缁勪欢閫変腑璁惧灞傜骇鑺傜偣鏃惰Е鍙戣幏鍙栧凡鍙戦�佹枃妗e垪琛� - * @param treeNodeInfo 鏍戣妭鐐逛俊鎭� - */ - loadHasSentDocumentListData(treeNodeInfo) { - this.$nextTick(() => { - if (this.$refs.hasSentDocumentTableListRef) { - this.$refs.hasSentDocumentTableListRef.loadData(1) - this.hasLoadedDataTabKeyArray.push(this.activeTabKey) - } - }) - }, - - /** - * tab鏍囩鍒囨崲鏃惰Е鍙� - * @param activeTabKey 褰撳墠宸叉縺娲籺ab鐨刱ey - */ - handleTabChange(activeTabKey) { - this.$bus.$emit('handleSwitchDeviceDocClassCode', activeTabKey) - if (activeTabKey && !this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { - if (activeTabKey === 1) { - this.$nextTick(() => { - if (this.$refs.hasSentDocumentTableListRef) this.$refs.hasSentDocumentTableListRef.loadData(1) - }) - } else { - this.$nextTick(() => { - if (this.$refs.hasReceivedDocumentTableListRef) this.$refs.hasReceivedDocumentTableListRef.loadData(1) - }) - } - this.hasLoadedDataTabKeyArray.push(activeTabKey) + /** + * 褰撴爲缁勪欢閫変腑璁惧灞傜骇鑺傜偣鏃惰Е鍙戣幏鍙栧凡鍙戦�佹枃妗e垪琛� + * @param treeNodeInfo 鏍戣妭鐐逛俊鎭� + */ + loadHasSentDocumentListData(treeNodeInfo) { + this.$nextTick(() => { + if (this.$refs.hasSentDocumentTableListRef) { + this.$refs.hasSentDocumentTableListRef.loadData(1) + this.hasLoadedDataTabKeyArray.push(this.activeTabKey) } - }, + }) + }, - /** - * 鏂囨。浠ュ強NC绋嬪簭瀵煎叆/鍑哄簱/鍏ュ簱/鍒犻櫎鎴愬姛鍚庤Е鍙戦噸鏂板姞杞芥枃妗e垪琛� - * @param docClassCode 鏂囨。绫诲埆 - * @param attributionId 鑺傜偣Id - */ - reloadDocumentListData({ docClassCode, attributionId }) { - // 濡傛灉涓婁紶鐨勬枃妗d笉鏄墍灞炰簬褰撳墠鎵�灞曠ず鑺傜偣鐨勬枃妗e垯涓嶉噸鏂拌幏鍙栨枃妗e垪琛� - if (this.currentTreeNodeInfo.key !== attributionId) return - if (docClassCode === 'SEND') { - if (this.$refs.hasSentDocumentTableListRef) this.$refs.hasSentDocumentTableListRef.loadData(1) - } else { - if (this.$refs.hasReceivedDocumentTableListRef) this.$refs.hasReceivedDocumentTableListRef.loadData(1) - } - }, - - // 涓嬭浇褰撳墠鍙抽敭閫変腑鏂囨。 - handleDownload() { - const that = this - const { docId, docName } = this.currentRightClickedTableRowInfo - dncApi.downloadDocumentApi({ docId, docName }) - .then(res => { - if (res && !res.success) { - that.$notification.error({ - message: '娑堟伅', - description: res.message - }) - } + /** + * tab鏍囩鍒囨崲鏃惰Е鍙� + * @param activeTabKey 褰撳墠宸叉縺娲籺ab鐨刱ey + */ + handleTabChange(activeTabKey) { + this.$bus.$emit('handleSwitchDeviceDocClassCode', activeTabKey) + if (activeTabKey && !this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { + if (activeTabKey === 1) { + this.$nextTick(() => { + if (this.$refs.hasSentDocumentTableListRef) this.$refs.hasSentDocumentTableListRef.loadData(1) }) - .catch(err => { + } else { + this.$nextTick(() => { + if (this.$refs.hasReceivedDocumentTableListRef) this.$refs.hasReceivedDocumentTableListRef.loadData(1) + }) + } + this.hasLoadedDataTabKeyArray.push(activeTabKey) + } + }, + + /** + * 鏂囨。浠ュ強NC绋嬪簭瀵煎叆/鍑哄簱/鍏ュ簱/鍒犻櫎鎴愬姛鍚庤Е鍙戦噸鏂板姞杞芥枃妗e垪琛� + * @param docClassCode 鏂囨。绫诲埆 + * @param attributionId 鑺傜偣Id + */ + reloadDocumentListData({ docClassCode, attributionId }) { + // 濡傛灉涓婁紶鐨勬枃妗d笉鏄墍灞炰簬褰撳墠鎵�灞曠ず鑺傜偣鐨勬枃妗e垯涓嶉噸鏂拌幏鍙栨枃妗e垪琛� + if (this.currentTreeNodeInfo.key !== attributionId) return + if (docClassCode === 'SEND') { + if (this.$refs.hasSentDocumentTableListRef) this.$refs.hasSentDocumentTableListRef.loadData(1) + } else { + if (this.$refs.hasReceivedDocumentTableListRef) this.$refs.hasReceivedDocumentTableListRef.loadData(1) + } + }, + + // 涓嬭浇褰撳墠鍙抽敭閫変腑鏂囨。 + handleDownload() { + const that = this + const { docId, docName } = this.currentRightClickedTableRowInfo + dncApi.downloadDocumentApi({ docId, docName }) + .then(res => { + if (res && !res.success) { that.$notification.error({ message: '娑堟伅', - description: err.message + description: res.message }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message }) - }, - - // 鍒犻櫎褰撳墠鍙抽敭閫変腑鏂囨。 - handleDelete() { - const { docId, param, attributionId } = this.currentRightClickedTableRowInfo - const that = this - that.$confirm({ - title: '鎻愮ず', - content: `鍒犻櫎鍚庝笉鍙彇娑堬紝纭鍒犻櫎鍚楋紵`, - okText: '纭', - cancelText: '鍙栨秷', - onOk: () => { - dncApi.deleteDeviceRelativeDocumentApi({ docId, attributionId }) - .then((res) => { - if (res.success) { - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.reloadDocumentListData({ docClassCode: param, attributionId }) - } else { - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) - .finally(() => { - that.$destroyAll() - }) - }, - onCancel: () => { - that.$destroyAll() - } }) - }, + }, - /** - * 鐐瑰嚮鎵归噺鍒犻櫎鍚庡嚭鐜板脊绐� - * @param modalTitle 寮圭獥鏍囬 - */ - handleBatchRemove(modalTitle) { - if (!this.$refs.documentBatchDeleteModalRef) return - this.$refs.documentBatchDeleteModalRef.title = modalTitle - this.$refs.documentBatchDeleteModalRef.visible = true - }, + // 鍒犻櫎褰撳墠鍙抽敭閫変腑鏂囨。 + handleDelete() { + const { docId, param, attributionId } = this.currentRightClickedTableRowInfo + const that = this + that.$confirm({ + title: '鎻愮ず', + content: `鍒犻櫎鍚庝笉鍙彇娑堬紝纭鍒犻櫎鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.deleteDeviceRelativeDocumentApi({ docId, attributionId }) + .then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.reloadDocumentListData({ docClassCode: param, attributionId }) + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + .finally(() => { + that.$destroyAll() + }) + }, + onCancel: () => { + that.$destroyAll() + } + }) + }, - /** - * 鍑哄簱褰撳墠鍙抽敭閫変腑鏂囨。 - * @param menuLabel - */ - handlePull(menuLabel) { - const that = this - const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo - that.$confirm({ - title: '鎻愮ず', - content: `纭${menuLabel}鍚楋紵`, - okText: '纭', - cancelText: '鍙栨秷', - onOk: () => { - dncApi.documentOutboundApi({ docId, docName }) - .then(res => { - console.log('res------------------', res) - if (res.success) { - this.reloadDocumentListData({ docClassCode: param, attributionId }) - that.$notification.success({ - message: '娑堟伅', - description: `${menuLabel}鎴愬姛` - }) - } else { - that.$notification.error({ - message: '娑堟伅', - description: res.message - }) - } - }) - .catch(err => { + /** + * 鐐瑰嚮鎵归噺鍒犻櫎鍚庡嚭鐜板脊绐� + * @param modalTitle 寮圭獥鏍囬 + */ + handleBatchRemove(modalTitle) { + if (!this.$refs.documentBatchDeleteModalRef) return + this.$refs.documentBatchDeleteModalRef.title = modalTitle + this.$refs.documentBatchDeleteModalRef.visible = true + }, + + /** + * 鍑哄簱褰撳墠鍙抽敭閫変腑鏂囨。 + * @param menuLabel + */ + handlePull(menuLabel) { + const that = this + const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo + that.$confirm({ + title: '鎻愮ず', + content: `纭${menuLabel}鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.documentOutboundApi({ docId, docName }) + .then(res => { + console.log('res------------------', res) + if (res.success) { + this.reloadDocumentListData({ docClassCode: param, attributionId }) + that.$notification.success({ + message: '娑堟伅', + description: `${menuLabel}鎴愬姛` + }) + } else { that.$notification.error({ message: '娑堟伅', - description: err.message + description: res.message }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message }) - .finally(() => { - that.$destroyAll() - }) - }, - onCancel: () => { - that.$destroyAll() - } - }) - }, + }) + .finally(() => { + that.$destroyAll() + }) + }, + onCancel: () => { + that.$destroyAll() + } + }) + }, - /** - * 鍙戝竷褰撳墠鍙抽敭閫変腑鏂囨。 - * @param menuLabel - */ - handleCancelPull(menuLabel) { - const that = this - const { docId, param, attributionId } = this.currentRightClickedTableRowInfo - that.$confirm({ - title: '鎻愮ず', - content: `纭${menuLabel}鍚楋紵`, - okText: '纭', - cancelText: '鍙栨秷', - onOk: () => { - dncApi.documentCancelOutboundApi(docId) - .then(res => { - if (res.success) { - this.reloadDocumentListData({ docClassCode: param, attributionId }) - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - } else { - that.$notification.error({ - message: '娑堟伅', - description: res.message - }) - } - }) - .catch(err => { + /** + * 鍙戝竷褰撳墠鍙抽敭閫変腑鏂囨。 + * @param menuLabel + */ + handleCancelPull(menuLabel) { + const that = this + const { docId, param, attributionId } = this.currentRightClickedTableRowInfo + that.$confirm({ + title: '鎻愮ず', + content: `纭${menuLabel}鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.documentCancelOutboundApi(docId) + .then(res => { + if (res.success) { + this.reloadDocumentListData({ docClassCode: param, attributionId }) + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + } else { that.$notification.error({ message: '娑堟伅', - description: err.message + description: res.message }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message }) - .finally(() => { - that.$destroyAll() - }) - }, - onCancel: () => { - that.$destroyAll() - } - }) - }, + }) + .finally(() => { + that.$destroyAll() + }) + }, + onCancel: () => { + that.$destroyAll() + } + }) + }, - /** - * 鐐瑰嚮鍙戝竷鏃惰Е鍙戝綋鍓嶆枃妗e彂甯� - * @param menuLabel - */ - handlePublish(menuLabel) { - const that = this - const { docId, param, attributionId } = this.currentRightClickedTableRowInfo - that.$confirm({ - title: '鎻愮ず', - content: `纭${menuLabel}鍚楋紵`, - okText: '纭', - cancelText: '鍙栨秷', - onOk: () => { - dncApi.documentPublishApi(docId) - .then(res => { - if (res.success) { - this.reloadDocumentListData({ docClassCode: param, attributionId }) - this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - } else { - that.$notification.error({ - message: '娑堟伅', - description: res.message - }) - } - }) - .catch(err => { + /** + * 鐐瑰嚮鍙戝竷鏃惰Е鍙戝綋鍓嶆枃妗e彂甯� + * @param menuLabel + */ + handlePublish(menuLabel) { + const that = this + const { docId, param, attributionId } = this.currentRightClickedTableRowInfo + that.$confirm({ + title: '鎻愮ず', + content: `纭${menuLabel}鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.documentPublishApi(docId) + .then(res => { + if (res.success) { + this.reloadDocumentListData({ docClassCode: param, attributionId }) + this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + } else { that.$notification.error({ message: '娑堟伅', - description: err.message + description: res.message }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message }) - .finally(() => { - that.$destroyAll() - }) - }, - onCancel: () => { - that.$destroyAll() - } - }) - }, + }) + .finally(() => { + that.$destroyAll() + }) + }, + onCancel: () => { + that.$destroyAll() + } + }) + }, - /** - * 閲嶆柊鍙戝竷褰撳墠鍙抽敭閫変腑鏂囨。骞堕噸鏂板彂甯冮��鍥炰笂涓�鏂囨。鐗堟湰 - * @param menuLabel - */ - handleRepublish(menuLabel) { - const that = this - const { docId, param, attributionId } = this.currentRightClickedTableRowInfo - that.$confirm({ - title: '鎻愮ず', - content: `纭${menuLabel}鍚楋紵`, - okText: '纭', - cancelText: '鍙栨秷', - onOk: () => { - dncApi.documentRepublishApi(docId) - .then(res => { - if (res.success) { - this.reloadDocumentListData({ docClassCode: param, attributionId }) - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - } else { - that.$notification.error({ - message: '娑堟伅', - description: res.message - }) - } - }) - .catch(err => { + /** + * 閲嶆柊鍙戝竷褰撳墠鍙抽敭閫変腑鏂囨。骞堕噸鏂板彂甯冮��鍥炰笂涓�鏂囨。鐗堟湰 + * @param menuLabel + */ + handleRepublish(menuLabel) { + const that = this + const { docId, param, attributionId } = this.currentRightClickedTableRowInfo + that.$confirm({ + title: '鎻愮ず', + content: `纭${menuLabel}鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.documentRepublishApi(docId) + .then(res => { + if (res.success) { + this.reloadDocumentListData({ docClassCode: param, attributionId }) + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + } else { that.$notification.error({ message: '娑堟伅', - description: err.message + description: res.message }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message }) - .finally(() => { - that.$destroyAll() - }) - }, - onCancel: () => { - that.$destroyAll() - } - }) - }, + }) + .finally(() => { + that.$destroyAll() + }) + }, + onCancel: () => { + that.$destroyAll() + } + }) + }, - /** - * 閲嶅綊妗e綋鍓嶅彸閿�変腑鏂囨。涓斿悗缁棤娉曠户缁彂甯冩垨褰掓。 - * @param menuLabel - */ - handlePigeonhole(menuLabel) { - const that = this - const { docId, param, attributionId } = this.currentRightClickedTableRowInfo - that.$confirm({ - title: '鎻愮ず', - content: `${menuLabel}鍚庝笉鍙彇娑堬紝纭${menuLabel}鍚楋紵`, - okText: '纭', - cancelText: '鍙栨秷', - onOk: () => { - dncApi.documentPigeonholeApi(docId) - .then(res => { - if (res.success) { - this.reloadDocumentListData({ docClassCode: param, attributionId }) - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - } else { - that.$notification.error({ - message: '娑堟伅', - description: res.message - }) - } - }) - .catch(err => { + /** + * 閲嶅綊妗e綋鍓嶅彸閿�変腑鏂囨。涓斿悗缁棤娉曠户缁彂甯冩垨褰掓。 + * @param menuLabel + */ + handlePigeonhole(menuLabel) { + const that = this + const { docId, param, attributionId } = this.currentRightClickedTableRowInfo + that.$confirm({ + title: '鎻愮ず', + content: `${menuLabel}鍚庝笉鍙彇娑堬紝纭${menuLabel}鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.documentPigeonholeApi(docId) + .then(res => { + if (res.success) { + this.reloadDocumentListData({ docClassCode: param, attributionId }) + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + } else { that.$notification.error({ message: '娑堟伅', - description: err.message + description: res.message }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message }) - .finally(() => { - that.$destroyAll() - }) - }, - onCancel: () => { - that.$destroyAll() - } - }) - }, + }) + .finally(() => { + that.$destroyAll() + }) + }, + onCancel: () => { + that.$destroyAll() + } + }) + }, - // 閲嶇疆tabKey骞朵笖閲婃斁鍔犺浇鏂囨。鍒楄〃鐨勬帴鍙� - releaseLoadDocumentListApi() { - this.hasLoadedDataTabKeyArray = [] - this.handleTabChange(this.activeTabKey) - }, + // 閲嶇疆tabKey骞朵笖閲婃斁鍔犺浇鏂囨。鍒楄〃鐨勬帴鍙� + releaseLoadDocumentListApi() { + this.hasLoadedDataTabKeyArray = [] + this.handleTabChange(this.activeTabKey) + }, - // 鎺у埗鍙抽敭鑿滃崟鍏抽棴 - handleMenuClose() { - this.$refs.tableContextMenuRef.menuVisible = false - document.body.removeEventListener('click', this.handleMenuClose) - }, + // 鎺у埗鍙抽敭鑿滃崟鍏抽棴 + handleMenuClose() { + this.$refs.tableContextMenuRef.menuVisible = false + document.body.removeEventListener('click', this.handleMenuClose) + }, - triggerCorrespondingMethod({ methodName, modalTitle }) { - if (this[methodName]) this[methodName](modalTitle) - } + triggerCorrespondingMethod({ methodName, modalTitle }) { + if (this[methodName]) this[methodName](modalTitle) } } +} </script> <style scoped> - /deep/ .ant-table-tbody .ant-table-row { - cursor: pointer; - } +/deep/ .ant-table-tbody .ant-table-row { + cursor: pointer; +} </style> \ No newline at end of file diff --git a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue index fef8b3d..11ff894 100644 --- a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue +++ b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue @@ -78,6 +78,10 @@ this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) this.$bus.$on('handleSwitchDeviceDocClassCode', this.setCurrentDeviceDocClassCode) }, + beforeDestroy() { + this.$bus.$off('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) + this.$bus.$off('handleSwitchDeviceDocClassCode', this.setCurrentDeviceDocClassCode) + }, methods: { getTreeDataByApi() { this.loading = true @@ -119,7 +123,6 @@ this.$bus.$emit('sendDeviceTreeNodeInfo', this.currentSelected) if (selectedKeys.length === 0) return this.selectedKeys = selectedKeys - }, /** diff --git a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue index 61f72e4..912ebd5 100644 --- a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue +++ b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue @@ -51,8 +51,8 @@ const { param } = this.treeParams const treeNodeInfo = Object.assign({}, this.treeParams, { param }) console.log('treeNodeInfo++++++++++++++++++++++++++++', treeNodeInfo) - if (treeNodeInfo.type === 2) treeNodeInfo.type = 4 - // 璁惧缁撴瀯鏍戣妭鐐逛腑鐨勮澶囧眰绾т负2锛屼絾鍦ㄤ骇鍝佺粨鏋勬爲涓皢璁惧灞傜骇鐨則ype璁剧疆涓�4锛屼负淇濊瘉涓や釜缁撴瀯鏍戝叡鐢ㄧ殑鏂规硶鑳芥甯歌繍琛岋紝鍥犳鍦ㄦ澶勫悓鏍疯缃负4 + if (treeNodeInfo.type === 2) treeNodeInfo.type = 7 + // 璁惧缁撴瀯鏍戣妭鐐逛腑鐨勮澶囧眰绾т负2锛屼絾鍦ㄤ骇鍝佺粨鏋勬爲涓皢璁惧灞傜骇鐨則ype璁剧疆涓�7锛屽洜姝ゅ湪姝ゅ璁剧疆涓�7 const menuKeyArray = menuKey.split('_') const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod // product_add => handleAdd 瑙﹀彂瀵瑰簲缁勪欢浜嬩欢 diff --git a/src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue b/src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue index 46d1425..64dbc46 100644 --- a/src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue +++ b/src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue @@ -1,7 +1,7 @@ <template> <div> <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" - :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> + :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> </a-table> @@ -21,6 +21,9 @@ props: { currentTreeNodeInfo: { type: Object + }, + currentTypeOfDevice:{ + type:Number }, size: { type: String @@ -109,7 +112,7 @@ var params = this.getQueryParams()//鏌ヨ鏉′欢 console.log('currentTreeNodeInfo', this.currentTreeNodeInfo) params.attributionId = this.currentTreeNodeInfo.key - params.attributionType = 4 + params.attributionType = this.currentTypeOfDevice params.docClassCode = 'REC' if (!params) return false this.dataSource = [] diff --git a/src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue b/src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue index 46ab561..ff4f57e 100644 --- a/src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue +++ b/src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue @@ -1,7 +1,7 @@ <template> <div> <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" - :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> + :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> </a-table> @@ -21,6 +21,9 @@ props: { currentTreeNodeInfo: { type: Object + }, + currentTypeOfDevice:{ + type:Number }, size: { type: String @@ -119,7 +122,7 @@ var params = this.getQueryParams()//鏌ヨ鏉′欢 console.log('currentTreeNodeInfo', this.currentTreeNodeInfo) params.attributionId = this.currentTreeNodeInfo.key - params.attributionType = 4 + params.attributionType = this.currentTypeOfDevice params.docClassCode = 'SEND' if (!params) return false this.dataSource = [] diff --git a/src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue b/src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue index 388f440..3e61670 100644 --- a/src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue +++ b/src/views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue @@ -69,8 +69,8 @@ }, triggerCorrespondingMethod({ methodName, modalTitle, treeNodeInfo, tableRowInfo }) { - console.log('瑙﹀彂鍙抽敭鑿滃崟') if (this[methodName]) { + console.log('瑙﹀彂鍙抽敭鑿滃崟') this.title = modalTitle this[methodName](treeNodeInfo, tableRowInfo) } diff --git a/src/views/dnc/base/modules/ProductStructure/ProcessSpecVersion/ProcessSpecVersionInfo.vue b/src/views/dnc/base/modules/ProductStructure/ProcessSpecVersion/ProcessSpecVersionInfo.vue new file mode 100644 index 0000000..fc15cd8 --- /dev/null +++ b/src/views/dnc/base/modules/ProductStructure/ProcessSpecVersion/ProcessSpecVersionInfo.vue @@ -0,0 +1,36 @@ +<template> + <a-descriptions bordered :size="size" :column="4"> + <a-descriptions-item label="宸ヨ壓瑙勭▼鐗堟湰鍙�" :span="2">{{ currentLevelDetails.processSpecVersionCode }} + </a-descriptions-item> + <a-descriptions-item label="宸ヨ壓瑙勭▼鐗堟湰鍚嶇О" :span="2">{{ currentLevelDetails.processSpecVersionName }} + </a-descriptions-item> + <a-descriptions-item label="鍒涘缓浜�">{{ currentLevelDetails.createBy_dictText }}</a-descriptions-item> + <a-descriptions-item label="鍒涘缓鏃堕棿">{{ currentLevelDetails.createTime }}</a-descriptions-item> + <a-descriptions-item label="淇敼浜�">{{ currentLevelDetails.updateBy_dictText }}</a-descriptions-item> + <a-descriptions-item label="淇敼鏃堕棿">{{ currentLevelDetails.updateTime }}</a-descriptions-item> + <a-descriptions-item label="鎻忚堪" :span="4">{{ currentLevelDetails.description }}</a-descriptions-item> + </a-descriptions> +</template> + +<script> +export default { + name: 'ProcessSpecVersionInfo', + components: {}, + props: { + currentLevelDetails: { + type: Object + }, + size: { + type: String + } + }, + data() { + return {} + }, + methods: {} +} +</script> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue index 518c220..1c1145a 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainBottom.vue @@ -1,5 +1,5 @@ <template> - <div v-if="+currentLevelInfo.type!==4" style="height: 100%"> + <div style="height: 100%"> <a-tabs style="height: 100%" v-model="activeTabKey" v-if="Object.keys(currentLevelInfo).length>0" @change="handleTabChange"> <a-tab-pane :key="1" tab="灞炴�т俊鎭�" v-if="+currentLevelInfo.type===1"> @@ -12,6 +12,10 @@ <a-tab-pane :key="1" tab="闆朵欢灞炴��" v-if="+currentLevelInfo.type===3"> <PartInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/> + </a-tab-pane> + + <a-tab-pane :key="1" tab="灞炴�т俊鎭�" v-if="+currentLevelInfo.type===4"> + <ProcessSpecVersionInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/> </a-tab-pane> <a-tab-pane :key="1" tab="宸ュ簭灞炴��" v-if="+currentLevelInfo.type===5"> @@ -72,13 +76,16 @@ import UseDocumentEquipmentTableList from './Document/UseNcDocumentEquipmentTableList' import FilePreview from '../../../common/FilePreview' import TableContextMenu from '../../../common/TableContextMenu' -import { getAction } from '@/api/manage' import UseDeviceCustomTypeEquipmentTableList from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/UseDeviceCustomTypeEquipmentTableList.vue' +import ProcessSpecVersionInfo + from '@views/dnc/base/modules/ProductStructure/ProcessSpecVersion/ProcessSpecVersionInfo.vue' +import { getAction } from '@/api/manage' export default { name: 'ProductStructureMainBottom', components: { + ProcessSpecVersionInfo, UseDeviceCustomTypeEquipmentTableList, CutterTableList, TableContextMenu, diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue index e961d5f..7655c68 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue @@ -1,5 +1,5 @@ <template> - <div v-if="+currentTreeNodeInfo.type!==4"> + <div> <a-tabs v-model="activeTabKey" @contextmenu.native="e=>e.preventDefault()" @change="handleTabChange" v-if="Object.keys(currentTreeNodeInfo).length!==0"> <a-tab-pane :key="1" tab="NC绠$悊" v-if="+currentTreeNodeInfo.type===5||+currentTreeNodeInfo.type===6"> @@ -69,6 +69,12 @@ this.getDeviceTypeListDisplayPermission('dnc_device_type_process', 'isProcessHasDeviceTypeList') this.getDeviceTypeListDisplayPermission('dnc_device_type_step', 'isProcessStepHasDeviceTypeList') }, + beforeDestroy() { + this.$bus.$off('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) + this.$bus.$off('sendCurrentClickedTypeInfo', this.receiveCurrentClickedTypeInfo) + this.$bus.$off('reloadDocumentListData', this.reloadDocumentListData) + this.$bus.$off('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) + }, methods: { /** * 鑾峰彇璁惧绫诲瀷鍒楄〃鍦ㄥ伐搴忓拰宸ユ灞傜骇鐨勫睍绀烘潈闄� @@ -89,15 +95,24 @@ */ receiveCurrentTreeNodeInfo(treeNodeInfo) { console.log('treeNodeInfo', treeNodeInfo) + const { id, type } = treeNodeInfo // 浠庢爲缁勪欢鎺ュ彈鏍戣妭鐐逛俊鎭悗浠庣埗缁勪欢娴佸叆瀛愮粍浠� this.currentTreeNodeInfo = treeNodeInfo + this.currentNCDocumentAttributionInfo = Object.assign({}, { + attributionId: id, + attributionType: type, + docClassCode: 'NC' + }) // 娓呯┖涓婁竴鑺傜偣宸茬粡鍔犺浇杩囧緱鏂囨。鍒楄〃tabKey this.hasLoadedDataTabKeyArray = [] - if (+treeNodeInfo.type === 5 || +treeNodeInfo.type === 6) { + if (+type === 5 || +type === 6) { this.activeTabKey = 1 this.$nextTick(() => { - if (this.$refs.deviceCustomTypeTableList) this.$refs.deviceCustomTypeTableList.setQueryParamAndLoadData() - else if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) + if (this.$refs.deviceCustomTypeTableList) { + this.$refs.deviceCustomTypeTableList.setQueryParamAndLoadData() + // 鍒囨崲鏍戜箣鍚庢竻绌篘C绋嬪簭鍒楄〃 + if (this.$refs.ncDocumentTableListRef && this.$refs.ncDocumentTableListRef.dataSource.length > 0) this.$refs.ncDocumentTableListRef.dataSource = [] + } else if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) }) } else { this.activeTabKey = 2 @@ -179,7 +194,7 @@ const { docId, docName } = this.currentRightClickedTableRowInfo dncApi.downloadDocumentApi({ docId, docName }) .then(res => { - if (res && !res.success) { + if (!res.success) { that.$notification.error({ message: '娑堟伅', description: res.message @@ -254,7 +269,6 @@ onOk: () => { dncApi.documentOutboundApi({ docId, docName }) .then(res => { - console.log('res------------------', res) if (res.success) { that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) that.$notification.success({ diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue index 6e45ede..3fea23d 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue @@ -114,6 +114,9 @@ this.getTreeDataByApi() this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) }, + beforeDestroy() { + this.$bus.$off('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) + }, methods: { getTreeDataByApi() { this.loading = true @@ -243,6 +246,7 @@ /** * 鑷姩灞曞紑娣诲姞涓嬬骇鑺傜偣鐨勭埗鑺傜偣 + * @param isAddNextLevel 鏄惁闇�瑕佸睍寮�涓嬬骇 */ modalFormSubmitSuccess(isAddNextLevel) { // 鍒ゆ柇鏄惁涓烘坊鍔犱笅绾у苟涓斿垽鏂埗鑺傜偣鏄惁灞曞紑 diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue index 338a3a0..6e4eacb 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue @@ -70,6 +70,7 @@ { label: '鍒涘缓宸ヨ壓瑙勭▼鐗堟湰', code: 'version_add', icon: 'plus', isCommonMethod: false }, { label: '鍒涘缓宸ュ簭', code: 'version_add_child', icon: 'plus', isCommonMethod: false }, { label: '缂栬緫宸ヨ壓瑙勭▼鐗堟湰淇℃伅', code: 'version_edit', icon: 'edit', isCommonMethod: false }, + { label: '瀵煎叆鍏朵粬鏂囨。', code: 'version_import', icon: 'import', isCommonMethod: true }, { label: '鍒犻櫎', code: 'version_delete', icon: 'delete', isCommonMethod: true }, { label: '鏉冮檺閰嶇疆', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } ], @@ -122,6 +123,8 @@ return 'OTHER' case 3: return 'OTHER' + case 4: + return 'OTHER' case 5: return 'NC' case 6: diff --git a/src/views/dnc/common/DocumentInfo.vue b/src/views/dnc/common/DocumentInfo.vue index 218d3e0..f5708c5 100644 --- a/src/views/dnc/common/DocumentInfo.vue +++ b/src/views/dnc/common/DocumentInfo.vue @@ -1,18 +1,18 @@ <template> - <a-descriptions bordered :size="size"> + <a-descriptions bordered :size="size" :column="4"> <a-descriptions-item label="鏂囨。鍚嶇О">{{currentLevelDetails.docName}}</a-descriptions-item> <a-descriptions-item label="浠g爜鐗堟湰">{{currentLevelDetails.docAlias}}</a-descriptions-item> - <a-descriptions-item label="璁惧缂栧彿 ">{{currentLevelDetails.docCode}}</a-descriptions-item> + <a-descriptions-item label="璁惧缂栧彿">{{currentLevelDetails.docCode}}</a-descriptions-item> <a-descriptions-item label="鏂囨。鍚庣紑">{{currentLevelDetails.docSuffix}}</a-descriptions-item> <a-descriptions-item label="鏂囨。鐘舵��">{{currentLevelDetails.docStatus_dictText}}</a-descriptions-item> <a-descriptions-item label="绯荤粺鎸囧畾鐗堟湰">{{currentLevelDetails.publishVersion}}</a-descriptions-item> <a-descriptions-item label="鍑哄簱鐘舵��">{{currentLevelDetails.pullStatus_dictText}}</a-descriptions-item> - <a-descriptions-item label="鍑哄簱浜�" :span="2">{{currentLevelDetails.pullUser_dictText}}</a-descriptions-item> + <a-descriptions-item label="鍑哄簱浜�">{{currentLevelDetails.pullUser_dictText}}</a-descriptions-item> <a-descriptions-item label="鍒涘缓浜�">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> - <a-descriptions-item label="鍒涘缓鏃堕棿" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> + <a-descriptions-item label="鍒涘缓鏃堕棿">{{currentLevelDetails.createTime}}</a-descriptions-item> <a-descriptions-item label="淇敼浜�">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> - <a-descriptions-item label="淇敼鏃堕棿" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> - <a-descriptions-item label="鎻忚堪" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> + <a-descriptions-item label="淇敼鏃堕棿">{{currentLevelDetails.updateTime}}</a-descriptions-item> + <a-descriptions-item label="鎻忚堪" :span="4">{{currentLevelDetails.description}}</a-descriptions-item> </a-descriptions> </template> diff --git a/src/views/mdc/base/EquipmentShutDownReasonList.vue b/src/views/mdc/base/EquipmentShutDownReasonList.vue new file mode 100644 index 0000000..897ce83 --- /dev/null +++ b/src/views/mdc/base/EquipmentShutDownReasonList.vue @@ -0,0 +1,170 @@ +<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 :md="4" :sm="4"> + <a-form-item label="鍋滄満绫诲瀷"> + <a-radio-group v-model="queryParam.downtimeType" placeholder="璇烽�夋嫨鍋滄満绫诲瀷" @change="searchQuery"> + <a-radio :value="0">璁″垝鍋滄満</a-radio> + <a-radio :value="1">闈炶鍒掑仠鏈�</a-radio> + </a-radio-group> + </a-form-item> + </a-col> + + <a-col :md="5" :sm="5"> + <a-form-item label="鍋滄満鍘熷洜鎻忚堪"> + <a-input v-model="queryParam.downtimeDescription" placeholder="璇疯緭鍏ュ仠鏈哄師鍥�"/> + </a-form-item> + </a-col> + + <a-col :md="4" :sm="4"> + <a-space> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> + </a-space> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay" @click="handleMenuClick"> + <a-menu-item key="1"> + <a-icon type="delete" @click="batchDel"/> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> + 鎵归噺鎿嶄綔 + <a-icon type="down"/> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i>宸查�夋嫨 <a style="font-weight: 600">{{ + selectedRowKeys.length + }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :scroll="{x:'max-content',y:600}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + <template slot="downtimeType" slot-scope="text"> + {{ text === 0 ? '璁″垝鍋滄満' : '闈炶鍒掑仠鏈�' }} + </template> + + <template slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical"/> + + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </template> + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <EquipmentShutDownReasonModal ref="modalForm" @ok="modalFormOk"/> + </a-card> +</template> + +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import EquipmentShutDownReasonModal from '@views/mdc/base/modules/EquipmentShutDownReasonList/EquipmentShutDownReasonModal.vue' + +export default { + name: 'EquipmentShutDownReasonList', + mixins: [JeecgListMixin], + components: { + EquipmentShutDownReasonModal + }, + data() { + return { + queryParam: {}, + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 30, + pageSizeOptions: ['30', '50', '100'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鍋滄満鍘熷洜', + align: 'center', + width: 350, + dataIndex: 'downtimeDescription' + }, + { + title: '鍋滄満绫诲瀷', + align: 'center', + scopedSlots: { customRender: 'downtimeType' }, + dataIndex: 'downtimeType', + width: 350 + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark', + width: 350 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 150 + } + ], + url: { + list: '/mdc/mdcDowntimeReason/list', + delete: '/mdc/mdcDowntimeReason/delete', + deleteBatch: '/mdc/mdcDowntimeReason/deleteBatch' + } + } + }, + methods: { + handleMenuClick(e) { + if (e.key == 1) { + this.batchDel() + } + } + } + +} +</script> \ No newline at end of file diff --git a/src/views/mdc/base/EquipmentStandbyShutDown.vue b/src/views/mdc/base/EquipmentStandbyShutDown.vue new file mode 100644 index 0000000..a7c4b3d --- /dev/null +++ b/src/views/mdc/base/EquipmentStandbyShutDown.vue @@ -0,0 +1,121 @@ +<template> + <div style="width: 100%; height: 100%;"> + <a-card :bordered="false"> + <a-row type="flex" :gutter="16"> + <a-col :md="5"> + <a-tabs :activeKey="activeKey" @change="tabChange"> + <a-tab-pane key="1" tab="杞﹂棿灞傜骇" force-render> + <base-tree @getCurrSelected="changeSelectionNode"></base-tree> + </a-tab-pane> + <a-tab-pane v-if="isDepartType == 0" key="2" tab="閮ㄩ棬灞傜骇"> + <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree> + </a-tab-pane> + </a-tabs> + </a-col> + <a-col :md="19"> + <EquipmentStandbyShutdownList :node='selectedEquipment' :Type="selectedTypeTree"/> + </a-col> + </a-row> + </a-card> + </div> + +</template> + +<script> +import BaseTree from '../common/BaseTree' +import DepartTree from './modules/DepartList/DepartListTree/DepartTree' +import { mapActions } from 'vuex' +import EquipmentStandbyShutdownList + from '@views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownList.vue' + +export default { + name: 'EquipmentStandbyShutDown', + components: { + EquipmentStandbyShutdownList, + BaseTree, + DepartTree + }, + data() { + return { + activeKey: '1', + selectedEquipment: {}, + selectedTypeTree: '', + isDepartType: '' + } + }, + created() { + this.queryTreeData() + }, + methods: { + ...mapActions(['QueryDepartTree']), + + queryTreeData() { + this.QueryDepartTree() + .then(res => { + if (res.success) { + this.isDepartType = res.result[0].value + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + + tabChange(val) { + this.activeKey = val + this.selectedTypeTree = val + }, + changeSelectionNode(val) { + this.selectedEquipment = val + this.selectedTypeTree = '1' + }, + changeSelectionNodedd(val) { + this.selectedEquipment = val + this.selectedTypeTree = '2' + } + } + +} +</script> +<style scoped> +@import '~@assets/less/common.less'; + +.equipMessage { + width: 100%; + height: 10%; +} + +.equipMessage table { + width: 60%; + height: 100%; + line-height: 50%; +} + +.equipMessage table td { + text-align: center; +} + +.equipMessage table td span { + display: inline-block; + width: 15px; + height: 15px; +} + +.equipMessage table td .equipShutdown { + background-color: #808080; +} + +.equipMessage table td .equipStandby { + background-color: #ffbf37; +} + +.equipMessage table td .equipRun { + background-color: #19FE01; +} + +.equipMessage table td .equipAlarm { + background-color: #FD0008; +} +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/EquipmentShutDownReasonList/EquipmentShutDownReasonModal.vue b/src/views/mdc/base/modules/EquipmentShutDownReasonList/EquipmentShutDownReasonModal.vue new file mode 100644 index 0000000..0b09b50 --- /dev/null +++ b/src/views/mdc/base/modules/EquipmentShutDownReasonList/EquipmentShutDownReasonModal.vue @@ -0,0 +1,159 @@ +<template> + <a-modal + :title="title" + :maskClosable="true" + :width="modalWidth" + @cancel="handleCancel" + :visible="visible"> + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules" :labelCol="labelColLong" + :wrapperCol="wrapperColLong"> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item prop="downtimeType" label="鍋滄満绫诲瀷"> +<!-- <a-select v-model="model.downtimeType" placeholder="璇烽�夋嫨鍋滄満绫诲瀷">--> +<!-- <a-select-option :key="0">璁″垝鍋滄満</a-select-option>--> +<!-- <a-select-option :key="1">闈炶鍒掑仠鏈�</a-select-option>--> +<!-- </a-select>--> + <a-radio-group v-model="model.downtimeType" placeholder="璇烽�夋嫨鍋滄満绫诲瀷"> + <a-radio :value="0">璁″垝鍋滄満</a-radio> + <a-radio :value="1">闈炶鍒掑仠鏈�</a-radio> + </a-radio-group> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item prop="downtimeDescription" label="鍋滄満鍘熷洜"> + <a-input v-model="model.downtimeDescription" placeholder="璇疯緭鍏ュ仠鏈哄師鍥�"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item label="澶囨敞"> + <a-textarea v-model="model.remark" placeholder="璇疯緭鍏ュ娉�"/> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + + <template slot="footer"> + <a-space> + <a-button @click="handleCancel">鍙栨秷</a-button> + <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">鎻愪氦</a-button> + </a-space> + </template> + + </a-modal> + +</template> + +<script> +import { postAction } from '@/api/manage' + +export default { + name: 'EquipmentCloseReasonModal', + components: {}, + data() { + return { + modalWidth: 500, + form: this.$form.createForm(this), + validatorRules: { + downtimeType: [ + { + required: true, message: '璇烽�夋嫨鍋滄満绫诲瀷' + } + ], + downtimeDescription: [ + { + required: true, message: '璇疯緭鍏ュ仠鏈哄師鍥�' + } + ] + }, + title: '鎿嶄綔', + visible: false, + model: {}, + labelColLong: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 17 } + }, + confirmLoading: false, + url: { + add: '/mdc/mdcDowntimeReason/add', + edit: '/mdc/mdcDowntimeReason/edit' + } + } + }, + methods: { + add() { + this.model = {} + this.visible = true + }, + + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + }, + + handleSubmit() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let apiUrl + if (!this.model.id) { + apiUrl = that.url.add + } else { + apiUrl = that.url.edit + } + postAction(apiUrl, that.model) + .then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok') + that.handleCancel() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + .finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + + handleCancel() { + this.visible = false + this.removeValidate() + }, + + // 鍏抽棴寮圭獥鏃舵竻妤氳〃鍗曟牎楠� + removeValidate() { + if (this.$refs.form) this.$refs.form.clearValidate() + } + } + +} +</script> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownList.vue b/src/views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownList.vue new file mode 100644 index 0000000..4aa61a5 --- /dev/null +++ b/src/views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownList.vue @@ -0,0 +1,213 @@ +<template> + <div class="page-container"> + <!-- 鏌ヨ鍖哄煙 --> + <div> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="4" :sm="4"> + <a-form-item label="鏃ユ湡"> + <a-date-picker value-format="YYYY-MM-DD" style="width: 100%" v-model="queryParam.theDate"/> + </a-form-item> + </a-col> + + <a-col :md="2" :sm="2" :xs="2"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + </a-col> + </a-row> + </a-form> + </div> + </div> + + <div style="overflow: hidden;width: 100%;flex: 1" id="DeviceList"> + <a-table ref="table" bordered :scroll="{x:'max-content',y:scrollY}" + size="middle" rowKey="id" :columns="columns" + @change="handleTableChange" + :dataSource="dataSource" :pagination="ipagination" + :loading="loading"> + <template slot="downtimeType" slot-scope="text"> + {{ text !== null ? text === 0 ? '璁″垝鍋滄満' : '闈炶鍒掑仠鏈�' : '' }} + </template> + + <template slot="action" slot-scope="text, record"> + <a @click="handleReport(record)">涓婃姤</a> + + <a-divider type="vertical"/> + + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </template> + </a-table> + </div> + + <EquipmentStandbyShutdownModal ref="modalForm" @ok="modalFormOk"/> + </div> +</template> + +<script> +import moment from 'moment' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import EquipmentStandbyShutdownModal + from '@views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownModal.vue' + +export default { + name: 'EquipmentStandbyShutdownList', + components: { EquipmentStandbyShutdownModal }, + mixins: [JeecgListMixin], + data() { + return { + disableMixinCreated: true, + scrollY: 465, + queryParam: { + theDate: moment().subtract('days', 1).format('YYYY-MM-DD') + }, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width: 200 + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + width: 200 + }, + { + title: '鍋滄満绫诲瀷', + align: 'center', + dataIndex: 'downtimeType', + scopedSlots: { customRender: 'downtimeType' }, + width: 150 + }, + { + title: '鍋滄満鍘熷洜', + align: 'center', + dataIndex: 'downtimeDescription', + width: 200 + }, + { + title: '寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'startDate', + width: 150 + }, + { + title: '缁撴潫鏃堕棿', + align: 'center', + dataIndex: 'endDate', + width: 150 + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark', + width: 200 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + width: 150, + scopedSlots: { customRender: 'action' }, + fixed: 'right' + } + ], + url: { + list: '/mdc/mdcDowntime/list', + delete: '/mdc/mdcDowntime/delete' + } + } + }, + props: { node: {}, Type: '' }, + created() { + this.queryParam.typeTree = '1' + this.loadData() + }, + mounted() { + window.addEventListener('resize', this.handleWindowResize) + this.handleWindowResize() + }, + beforeDestroy() { + window.removeEventListener('resize', this.handleWindowResize) + }, + watch: { + Type(valmath) { + this.queryParam.typeTree = valmath + }, + node(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + if (JSON.stringify(val) != '{}') { + if (val.equipmentId != null) { + this.queryParam.equipmentId = val.equipmentId + this.queryParam.parentId = '' + } else { + this.queryParam.parentId = val.key + this.queryParam.equipmentId = '' + } + this.loadData(1) + } + } + }, + methods: { + handleReport(record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '涓婃姤' + }, + + handleWindowResize() { + const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0, -2) + const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2) + this.scrollY = boxHeight - tableHeadHeight - 50 + } + } +} +</script> +<style scoped> +.page-container { + overflow: hidden; + display: flex; + flex-direction: column; +} + +@media screen and (min-width: 1920px) { + .page-container { + height: 812px !important; + } +} + +@media screen and (min-width: 1680px) and (max-width: 1920px) { + .page-container { + height: 812px !important; + } +} + +@media screen and (min-width: 1400px) and (max-width: 1680px) { + .page-container { + height: 664px !important; + } +} + +@media screen and (min-width: 1280px) and (max-width: 1400px) { + .page-container { + height: 565px !important; + } +} + +@media screen and (max-width: 1280px) { + .page-container { + height: 565px !important; + } +} +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownModal.vue b/src/views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownModal.vue new file mode 100644 index 0000000..3332d8a --- /dev/null +++ b/src/views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownModal.vue @@ -0,0 +1,167 @@ +<template> + <a-modal :title="title" :width="500" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk" + @cancel="handleCancel" cancelText="鍏抽棴"> + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules" :labelCol="labelColLong" + :wrapperCol="wrapperColLong"> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item label="鍋滄満绫诲瀷" prop="downtimeType"> + <a-radio-group v-model="model.downtimeType" placeholder="璇烽�夋嫨鍋滄満绫诲瀷" + @change="handleDowntimeTypeChange"> + <a-radio :value="0">璁″垝鍋滄満</a-radio> + <a-radio :value="1">闈炶鍒掑仠鏈�</a-radio> + </a-radio-group> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item label="鍋滄満鍘熷洜" prop="reasonId"> + <a-select v-model="model.reasonId" placeholder="璇烽�夋嫨鍋滄満鍘熷洜"> + <a-select-option v-for="item in downtimeDescriptionList" :key="item.id"> + {{ item.downtimeDescription }} + </a-select-option> + </a-select> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item label="澶囨敞"> + <a-textarea v-model="model.remark" placeholder="璇疯緭鍏ュ娉�"/> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </a-modal> +</template> + +<script> +import { getAction, postAction } from '@api/manage' + +export default { + name: 'EquipmentStandbyShutdownModal', + components: {}, + props: {}, + data() { + return { + title: '', + visible: false, + model: {}, + downtimeDescriptionList: [], + labelColLong: { + xs: { + span: 24 + }, + sm: { + span: 5 + } + }, + wrapperColLong: { + xs: { + span: 24 + }, + sm: { + span: 17 + } + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + downtimeType: [ + { + required: true, message: '璇烽�夋嫨鍋滄満绫诲瀷' + } + ], + reasonId: [ + { + required: true, message: '璇烽�夋嫨鍋滄満鍘熷洜' + } + ] + }, + url: { + edit: '/mdc/mdcDowntime/edit', + getDowntimeDescriptionListByDowntimeType: '/mdc/mdcDowntimeReason/downtimeReasonList' + } + } + }, + methods: { + edit(record) { + this.model = Object.assign({}, record) + this.getDowntimeDescriptionListByApi() + if (this.model.downtimeType === null) { + delete this.model.downtimeType + delete this.model.reasonId + } + this.visible = true + }, + + // 鍋滄満绫诲瀷鍊煎彂鐢熸敼鍙樻椂瑙﹀彂娓呯┖鍋滄満鍘熷洜骞堕噸鏂拌幏鍙栧搴斿仠鏈虹被鍨嬬殑鍋滄満鍘熷洜鍒楄〃 + handleDowntimeTypeChange() { + if (this.model.reasonId) delete this.model.reasonId + this.removeValidate() + this.getDowntimeDescriptionListByApi() + }, + + // 璋冪敤鎺ュ彛鑾峰彇鍋滄満鍘熷洜鍒楄〃 + getDowntimeDescriptionListByApi() { + const that = this + this.downtimeDescriptionList = [] + getAction(this.url.getDowntimeDescriptionListByDowntimeType, { downtimeType: this.model.downtimeType }) + .then(res => { + if (res.success) that.downtimeDescriptionList = res.result + }) + }, + + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + postAction(this.url.edit, that.model) + .then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok', res.result) + that.handleCancel() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + .finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + + handleCancel() { + this.visible = false + this.removeValidate() + }, + + // 鍏抽棴寮圭獥鏃舵竻妤氳〃鍗曟牎楠� + removeValidate() { + if (this.$refs.form) this.$refs.form.clearValidate() + } + } +} +</script> + + + + + -- Gitblit v1.9.3