Merge remote-tracking branch 'origin/master'
| | |
| | | // ææ´¾ææ¡£å°è®¾å¤ |
| | | 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}`), |
| | | // ææ¡£åºåº |
| | |
| | | <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> |
| | |
| | | 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> |
| | |
| | | </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,// 产åç»ææ ä¸å®ä¹ç设å¤å±çº§type为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) |
| | | }, |
| | | |
| | | /** |
| | | * 彿 ç»ä»¶éä¸è®¾å¤å±çº§èç¹æ¶è§¦åè·åå·²åéææ¡£å表 |
| | | * @param treeNodeInfo æ èç¹ä¿¡æ¯ |
| | | */ |
| | | loadHasSentDocumentListData(treeNodeInfo) { |
| | | this.$nextTick(() => { |
| | | if (this.$refs.hasSentDocumentTableListRef) { |
| | | this.$refs.hasSentDocumentTableListRef.loadData(1) |
| | | this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * tabæ ç¾åæ¢æ¶è§¦å |
| | | * @param activeTabKey å½åå·²æ¿æ´»tabçkey |
| | | */ |
| | | 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) |
| | | /** |
| | | * 彿 ç»ä»¶éä¸è®¾å¤å±çº§èç¹æ¶è§¦åè·åå·²åéææ¡£å表 |
| | | * @param treeNodeInfo æ èç¹ä¿¡æ¯ |
| | | */ |
| | | loadHasSentDocumentListData(treeNodeInfo) { |
| | | this.$nextTick(() => { |
| | | if (this.$refs.hasSentDocumentTableListRef) { |
| | | this.$refs.hasSentDocumentTableListRef.loadData(1) |
| | | this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | } |
| | | }, |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ææ¡£ä»¥åNCç¨åºå¯¼å
¥/åºåº/å
¥åº/å 餿åå触åéæ°å è½½ææ¡£å表 |
| | | * @param docClassCode ææ¡£ç±»å« |
| | | * @param attributionId èç¹Id |
| | | */ |
| | | reloadDocumentListData({ docClassCode, attributionId }) { |
| | | // 妿ä¸ä¼ çææ¡£ä¸æ¯æå±äºå½åæå±ç¤ºèç¹çææ¡£åä¸éæ°è·åææ¡£å表 |
| | | 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 å½åå·²æ¿æ´»tabçkey |
| | | */ |
| | | 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ç¨åºå¯¼å
¥/åºåº/å
¥åº/å 餿åå触åéæ°å è½½ææ¡£å表 |
| | | * @param docClassCode ææ¡£ç±»å« |
| | | * @param attributionId èç¹Id |
| | | */ |
| | | reloadDocumentListData({ docClassCode, attributionId }) { |
| | | // 妿ä¸ä¼ çææ¡£ä¸æ¯æå±äºå½åæå±ç¤ºèç¹çææ¡£åä¸éæ°è·åææ¡£å表 |
| | | 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() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»å叿¶è§¦åå½åææ¡£åå¸ |
| | | * @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 => { |
| | | /** |
| | | * ç¹å»å叿¶è§¦åå½åææ¡£åå¸ |
| | | * @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() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * é彿¡£å½åå³é®éä¸ææ¡£ä¸åç»æ æ³ç»§ç»å叿彿¡£ |
| | | * @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 => { |
| | | /** |
| | | * é彿¡£å½åå³é®éä¸ææ¡£ä¸åç»æ æ³ç»§ç»å叿彿¡£ |
| | | * @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> |
| | |
| | | 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 |
| | |
| | | this.$bus.$emit('sendDeviceTreeNodeInfo', this.currentSelected) |
| | | if (selectedKeys.length === 0) return |
| | | this.selectedKeys = selectedKeys |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | const { param } = this.treeParams |
| | | const treeNodeInfo = Object.assign({}, this.treeParams, { param }) |
| | | console.log('treeNodeInfo++++++++++++++++++++++++++++', treeNodeInfo) |
| | | if (treeNodeInfo.type === 2) treeNodeInfo.type = 4 |
| | | // 设å¤ç»ææ èç¹ä¸ç设å¤å±çº§ä¸º2ï¼ä½å¨äº§åç»ææ ä¸å°è®¾å¤å±çº§çtype设置为4ï¼ä¸ºä¿è¯ä¸¤ä¸ªç»ææ å
±ç¨çæ¹æ³è½æ£å¸¸è¿è¡ï¼å æ¤å¨æ¤å¤åæ ·è®¾ç½®ä¸º4 |
| | | if (treeNodeInfo.type === 2) treeNodeInfo.type = 7 |
| | | // 设å¤ç»ææ èç¹ä¸ç设å¤å±çº§ä¸º2ï¼ä½å¨äº§åç»ææ ä¸å°è®¾å¤å±çº§çtype设置为7ï¼å æ¤å¨æ¤å¤è®¾ç½®ä¸º7 |
| | | const menuKeyArray = menuKey.split('_') |
| | | const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod |
| | | // product_add => handleAdd 触å对åºç»ä»¶äºä»¶ |
| | |
| | | <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> |
| | | |
| | |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | }, |
| | | currentTypeOfDevice:{ |
| | | type:Number |
| | | }, |
| | | size: { |
| | | type: String |
| | |
| | | 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 = [] |
| | |
| | | <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> |
| | | |
| | |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | }, |
| | | currentTypeOfDevice:{ |
| | | type:Number |
| | | }, |
| | | size: { |
| | | type: String |
| | |
| | | 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 = [] |
| | |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle, treeNodeInfo, tableRowInfo }) { |
| | | console.log('触åå³é®èå') |
| | | if (this[methodName]) { |
| | | console.log('触åå³é®èå') |
| | | this.title = modalTitle |
| | | this[methodName](treeNodeInfo, tableRowInfo) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | |
| | | <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"> |
| | |
| | | |
| | | <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"> |
| | |
| | | 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, |
| | |
| | | <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"> |
| | |
| | | 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: { |
| | | /** |
| | | * è·å设å¤ç±»åå表å¨å·¥åºåå·¥æ¥å±çº§çå±ç¤ºæé |
| | |
| | | */ |
| | | 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() |
| | | // 忢æ ä¹åæ¸
空NCç¨åºå表 |
| | | 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 |
| | |
| | | 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 |
| | |
| | | onOk: () => { |
| | | dncApi.documentOutboundApi({ docId, docName }) |
| | | .then(res => { |
| | | console.log('res------------------', res) |
| | | if (res.success) { |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | |
| | | this.getTreeDataByApi() |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | beforeDestroy() { |
| | | this.$bus.$off('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | getTreeDataByApi() { |
| | | this.loading = true |
| | |
| | | |
| | | /** |
| | | * èªå¨å±å¼æ·»å ä¸çº§èç¹çç¶èç¹ |
| | | * @param isAddNextLevel æ¯å¦éè¦å±å¼ä¸çº§ |
| | | */ |
| | | modalFormSubmitSuccess(isAddNextLevel) { |
| | | // 夿æ¯å¦ä¸ºæ·»å ä¸çº§å¹¶ä¸å¤æç¶èç¹æ¯å¦å±å¼ |
| | |
| | | { 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 } |
| | | ], |
| | |
| | | return 'OTHER' |
| | | case 3: |
| | | return 'OTHER' |
| | | case 4: |
| | | return 'OTHER' |
| | | case 5: |
| | | return 'NC' |
| | | case 6: |
| | |
| | | <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="代ç çæ¬">{{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> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | |
| | | |
| | | |
| | | |
| | | |