From 552be0f3f2b1b1ffc62a1d888e4c7b825fedb9dd Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期二, 13 五月 2025 10:31:14 +0800 Subject: [PATCH] 产品结构树工序和工步层级新增导入其他文档功能 --- src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue | 2 src/views/dnc/common/TableContextMenu.vue | 10 ++-- src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue | 2 src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue | 50 ++++++++++++------------ src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue | 4 +- src/views/dnc/common/ImportFileModal.vue | 35 +++++++++++++++-- 6 files changed, 64 insertions(+), 39 deletions(-) diff --git a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue index 912ebd5..58082fe 100644 --- a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue +++ b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue @@ -33,7 +33,7 @@ ], //璁惧 device: [ - { label: '瀵煎叆NC鏂囨。', code: 'device_import', icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆NC鏂囨。', code: 'device_nc_import', icon: 'import', isCommonMethod: true }, { label: '鏉冮檺閰嶇疆', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } ] } @@ -41,7 +41,7 @@ }, computed: { getCurrentMenuLevel() { - if (!this.treeParams.equipmentId) return 'workshop' + if (this.treeParams.type===1) return 'workshop' else return 'device' } }, diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue index 3af9ab7..a63cbc8 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue @@ -16,7 +16,7 @@ </div> </a-tab-pane> - <a-tab-pane :key="2" tab="鍏朵粬鏂囨。" v-if="currentTreeNodeInfo.type !==5 && currentTreeNodeInfo.type!==6"> + <a-tab-pane :key="2" tab="鍏朵粬鏂囨。"> <OtherDocumentTableList ref="otherDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> </a-tab-pane> diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue index 1fed810..514efc1 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue @@ -397,7 +397,7 @@ // 鎺у埗鍩虹鍙抽敭鑿滃崟鍏抽棴 handleBaseContextMenuClose() { - this.$refs.baseContextmenuRef.menuVisible = false + if(this.$refs.baseContextmenuRef)this.$refs.baseContextmenuRef.menuVisible = false document.body.removeEventListener('click', this.handleBaseContextMenuClose) }, diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue index d494690..a6f2026 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureTreeContextMenu.vue @@ -39,7 +39,7 @@ { label: '娣诲姞閮ㄤ欢', code: 'product_add_child', icon: 'plus', isCommonMethod: false }, { label: '缂栬緫浜у搧淇℃伅', code: 'product_edit', icon: 'edit', isCommonMethod: false }, // { label: '瀵煎嚭鏂囨。', code: 'product_export', icon: 'export', isCommonMethod: true }, - { label: '瀵煎叆鍏朵粬鏂囨。', code: 'product_import', icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆鍏朵粬鏂囨。', code: 'product_other_import', icon: 'import', isCommonMethod: true }, { label: '妫�绱㈢數瀛愭牱鏉�', code: 'product_search', icon: 'search', isCommonMethod: true }, { label: '鍒犻櫎', code: 'product_delete', icon: 'delete', isCommonMethod: true }, { label: '鏉冮檺閰嶇疆', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } @@ -51,7 +51,7 @@ { label: '鍒涘缓宸ュ簭', code: 'component_add_relative', icon: 'plus', isCommonMethod: false }, { label: '缂栬緫閮ㄤ欢淇℃伅', code: 'component_edit', icon: 'edit', isCommonMethod: false }, // { label: '瀵煎嚭鏂囨。', code: 'component_export', icon: 'export', isCommonMethod: true }, - { label: '瀵煎叆鍏朵粬鏂囨。', code: 'component_import', icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆鍏朵粬鏂囨。', code: 'component_other_import', icon: 'import', isCommonMethod: true }, { label: '妫�绱㈢數瀛愭牱鏉�', code: 'component_search', icon: 'search', isCommonMethod: true }, { label: '寮曠敤閮ㄤ欢',code: 'component_borrow',icon: 'plus',isCommonMethod: false}, { label: '鍒犻櫎', code: 'component_delete', icon: 'delete', isCommonMethod: true }, @@ -64,7 +64,7 @@ // { label: '鍒涘缓宸ュ簭', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, { label: '缂栬緫闆朵欢淇℃伅', code: 'parts_edit', icon: 'edit', isCommonMethod: false }, // { label: '瀵煎嚭鏂囨。', code: 'parts_export', icon: 'export', isCommonMethod: true }, - { label: '瀵煎叆鍏朵粬鏂囨。', code: 'parts_import', icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆鍏朵粬鏂囨。', code: 'parts_other_import', icon: 'import', isCommonMethod: true }, { label: '妫�绱㈢數瀛愭牱鏉�', code: 'parts_search', icon: 'search', isCommonMethod: true }, { label: '鍒犻櫎', code: 'parts_delete', icon: 'delete', isCommonMethod: true }, { label: '鏉冮檺閰嶇疆', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } @@ -74,7 +74,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_other_import', icon: 'import', isCommonMethod: true }, { label: '妫�绱㈢數瀛愭牱鏉�', code: 'version_search', icon: 'search', isCommonMethod: true }, { label: '鍒犻櫎', code: 'version_delete', icon: 'delete', isCommonMethod: true }, { label: '鏉冮檺閰嶇疆', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } @@ -87,7 +87,8 @@ { label: '缂栬緫宸ュ簭淇℃伅', code: 'process_edit', icon: 'edit', isCommonMethod: false }, { label: '鍒犻櫎', code: 'process_delete', icon: 'delete', isCommonMethod: true }, // { label: '瀵煎嚭NC绋嬪簭', code: 'process_export', icon: 'export', isCommonMethod: true }, - { label: '瀵煎叆NC绋嬪簭', code: 'process_import', icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆NC绋嬪簭', code: 'process_nc_import', icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆鍏朵粬鏂囨。', code: 'process_other_import', icon: 'import', isCommonMethod: true }, { label: '鏉冮檺閰嶇疆', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } ], //宸ユ @@ -97,7 +98,8 @@ { label: '娣诲姞璁惧绫�', code: 'processStep_add_type', icon: 'plus', isCommonMethod: true }, { label: '鍒犻櫎', code: 'processStep_delete', icon: 'delete', isCommonMethod: true }, // { label: '瀵煎嚭NC绋嬪簭', code: 'processStep_export', icon: 'import', isCommonMethod: true }, - { label: '瀵煎叆NC绋嬪簭', code: 'processStep_import', icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆NC绋嬪簭', code: 'processStep_nc_import', icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆鍏朵粬鏂囨。', code: 'processStep_other_import', icon: 'import', isCommonMethod: true }, { label: '鏉冮檺閰嶇疆', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } ] } @@ -120,30 +122,28 @@ return 'processStep' } }, - getCurrentDocClassCode() { - switch (+this.treeParams.type) { - case 1: - return 'OTHER' - case 2: - return 'OTHER' - case 3: - return 'OTHER' - case 4: - return 'OTHER' - case 5: - return 'NC' - case 6: - return 'NC' - } - } + // getCurrentDocClassCode() { + // switch (+this.treeParams.type) { + // case 1: + // return 'OTHER' + // case 2: + // return 'OTHER' + // case 3: + // return 'OTHER' + // case 4: + // return 'OTHER' + // case 5: + // return 'NC' + // case 6: + // return 'NC' + // } + // } }, methods: { onContextMenuClick(treeKey, menuKey) { const level = this.getCurrentMenuLevel - const param = this.getCurrentDocClassCode console.log('level---------------------', level) - console.log('param---------------------', param) - const treeNodeInfo = Object.assign({}, this.treeParams, { param }) + const treeNodeInfo = Object.assign({}, this.treeParams) console.log('treeNodeInfo******************', treeNodeInfo) const menuKeyArray = menuKey.split('_') const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod diff --git a/src/views/dnc/common/ImportFileModal.vue b/src/views/dnc/common/ImportFileModal.vue index 10be07c..475b8b4 100644 --- a/src/views/dnc/common/ImportFileModal.vue +++ b/src/views/dnc/common/ImportFileModal.vue @@ -49,12 +49,12 @@ }, methods: { /** - * 鐐瑰嚮瀵煎叆鏂囨。鎴朜C绋嬪簭鏃惰Е鍙� + * 鐐瑰嚮瀵煎叆NC绋嬪簭鏃惰Е鍙� * @param treeNodeInfo 鐐瑰嚮鏍戣妭鐐瑰彸閿彍鍗曞鍏ョ▼搴忔椂浼犲叆鏍戣妭鐐逛俊鎭� * @param tableRowInfo 鍙抽敭琛ㄦ牸琛屾椂浼犲叆琛屼俊鎭� * @param modalTitle 寮圭獥鏍囬 */ - handleImport(treeNodeInfo, tableRowInfo, modalTitle) { + handleNcImport(treeNodeInfo, tableRowInfo, modalTitle) { this.isUploadMultiple = true let attributionId // 鏂囨。鎵�灞炲眰绾d let attributionType // 鏂囨。鎵�灞炲眰绾х被鍨� @@ -62,16 +62,41 @@ if (treeNodeInfo) { attributionId = treeNodeInfo.treeKey attributionType = treeNodeInfo.type - docClassCode = treeNodeInfo.param + if(treeNodeInfo.param==='SEND'|| treeNodeInfo.param==='REC') docClassCode = treeNodeInfo.param + else docClassCode = 'NC' } else { // 鑻ュ伐搴忓強宸ユ灞傜骇涓嬫湁璁惧绫绘椂鍒欏鍏C鐨勫弬鏁伴渶瑕佽皟鏁� attributionId = tableRowInfo.param === 'deviceCustomType' ? tableRowInfo.id : tableRowInfo.attributionId attributionType = tableRowInfo.attributionType - docClassCode = tableRowInfo.param === 'deviceCustomType' ? 'NC' : tableRowInfo.param + if(tableRowInfo.param==='SEND'|| tableRowInfo.param==='REC') docClassCode = tableRowInfo.param + else docClassCode = 'NC' } this.setModalTitle(modalTitle, docClassCode) this.uploadParams = Object.assign({}, { attributionId, attributionType, docClassCode }) - console.log('uploadParams=====================', this.uploadParams) + console.log('NC=======uploadParams=====================', this.uploadParams) + this.visible = true + }, + + /** + * 鐐瑰嚮瀵煎叆鍏朵粬鏂囨。鏃惰Е鍙� + * @param treeNodeInfo 鐐瑰嚮鏍戣妭鐐瑰彸閿彍鍗曞鍏ョ▼搴忔椂浼犲叆鏍戣妭鐐逛俊鎭� + * @param tableRowInfo 鍙抽敭琛ㄦ牸琛屾椂浼犲叆琛屼俊鎭� + * @param modalTitle 寮圭獥鏍囬 + */ + handleOtherImport(treeNodeInfo, tableRowInfo, modalTitle){ + this.isUploadMultiple = true + let attributionId // 鏂囨。鎵�灞炲眰绾d + let attributionType // 鏂囨。鎵�灞炲眰绾х被鍨� + const docClassCode= 'OTHER' // 鏂囨。绫诲瀷 + if (treeNodeInfo) { + attributionId = treeNodeInfo.treeKey + attributionType = treeNodeInfo.type + } else { + attributionId = tableRowInfo.attributionId + attributionType = tableRowInfo.attributionType + } + this.uploadParams = Object.assign({}, { attributionId, attributionType, docClassCode }) + console.log('OTHER======uploadParams=====================', this.uploadParams) this.visible = true }, diff --git a/src/views/dnc/common/TableContextMenu.vue b/src/views/dnc/common/TableContextMenu.vue index 9fdf6b8..ba41200 100644 --- a/src/views/dnc/common/TableContextMenu.vue +++ b/src/views/dnc/common/TableContextMenu.vue @@ -45,13 +45,13 @@ deviceCustomType:[ { label: '缂栬緫璁惧绫讳俊鎭�', code: 'type_edit', subMenu: [], icon: 'edit', isCommonMethod: false }, { label: '鍒犻櫎', code: 'type_delete', subMenu: [], icon: 'delete', isCommonMethod: false }, - { label: '瀵煎叆NC绋嬪簭', code: 'type_import', subMenu: [], icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆NC绋嬪簭', code: 'type_nc_import', subMenu: [], icon: 'import', isCommonMethod: true }, ], //NC鏂囨。 NC: [ { label: '缂栬緫鏂囨。淇℃伅', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false }, { label: '鎸囨淳鍒拌澶�', code: 'document_assign', subMenu: [], icon: 'cluster', isCommonMethod: false }, - { label: '瀵煎叆NC绋嬪簭', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆NC绋嬪簭', code: 'document_nc_import', subMenu: [], icon: 'import', isCommonMethod: true }, { label: '涓嬭浇', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true }, { label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true }, { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true }, @@ -71,7 +71,7 @@ //鍏跺畠鏂囨。 OTHER: [ { label: '缂栬緫鏂囨。淇℃伅', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false }, - { label: '瀵煎叆鏂囨。', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆鏂囨。', code: 'document_other_import', subMenu: [], icon: 'import', isCommonMethod: true }, { label: '涓嬭浇', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true }, { label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true }, { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true }, @@ -91,7 +91,7 @@ //宸插彂閫佹枃妗� SEND: [ { label: '缂栬緫鏂囨。淇℃伅', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false }, - { label: '瀵煎叆NC绋嬪簭', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆NC绋嬪簭', code: 'document_nc_import', subMenu: [], icon: 'import', isCommonMethod: true }, { label: '涓嬭浇', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true }, { label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true }, { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true }, @@ -111,7 +111,7 @@ //宸叉帴鏀舵枃妗� REC: [ { label: '缂栬緫鏂囨。淇℃伅', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false }, - { label: '瀵煎叆NC绋嬪簭', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true }, + { label: '瀵煎叆NC绋嬪簭', code: 'document_nc_import', subMenu: [], icon: 'import', isCommonMethod: true }, { label: '涓嬭浇', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true }, { label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true }, { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true }, -- Gitblit v1.9.3