| | |
| | | ref="deviceCustomTypeTableList" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | |
| | | <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | <NcDocumentTableList ref="ncDocumentTableListRef" |
| | | :currentNCDocumentAttributionInfo="currentNCDocumentAttributionInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | </div> |
| | | </a-tab-pane> |
| | |
| | | isProcessStepHasDeviceTypeList: false, |
| | | currentRightClickedTableRowInfo: {}, |
| | | currentTreeNodeInfo: {}, |
| | | currentClickedTypeInfo: {}, |
| | | currentNCDocumentAttributionInfo: {},//当前NC文档的所属级即父级的详细信息(引入设备类后NC挂载至设备类下反之则挂载在工序和工步下) |
| | | hasLoadedDataTabKeyArray: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | this.$bus.$on('sendCurrentClickedTypeInfo', this.receiveCurrentClickedTypeInfo) |
| | | this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.getDeviceTypeListDisplayPermission('dnc_device_type_process', 'isProcessHasDeviceTypeList') |
| | |
| | | this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | }, |
| | | |
| | | receiveCurrentClickedTypeInfo(record) { |
| | | const { id, attributionType } = record |
| | | this.currentClickedTypeInfo = Object.assign({}, record) |
| | | this.currentNCDocumentAttributionInfo = Object.assign({}, { |
| | | attributionId: id, |
| | | attributionType, |
| | | docClassCode: 'NC' |
| | | }) |
| | | this.$nextTick(() => { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 控制右键菜单开启 |
| | | * @param record 当前表格行信息 |
| | |
| | | /** |
| | | * 文档以及NC程序导入/出库/入库成功后触发重新加载文档列表 |
| | | * @param docClassCode 文档类别 |
| | | * @param attributionId 节点Id |
| | | * @param attributionType 文档父级type类型 |
| | | * @param attributionId 文档父级Id |
| | | */ |
| | | reloadDocumentListData({ docClassCode, attributionId }) { |
| | | // 如果上传的文档不是所属于当前所展示节点的文档则不重新获取文档列表 |
| | | if (this.currentTreeNodeInfo.id !== attributionId) return |
| | | reloadDocumentListData({ docClassCode, attributionType, attributionId }) { |
| | | console.log('docClassCode, attributionType, attributionId', docClassCode, attributionType, attributionId) |
| | | // 在此处设备NC文档父级参数是可此方法是结构树以及设备类两种不同导入方式的共同出口 |
| | | this.currentNCDocumentAttributionInfo = Object.assign({}, { docClassCode, attributionId, attributionType }) |
| | | // 若引入设备类则只需要判断当前出现的文档所属是否是当前左键选中的文档,若不是当前选中的文档则不刷新文档列表(避免无效刷新) |
| | | if (this.currentRightClickedTableRowInfo.hasOwnProperty('deviceManagementId')) { |
| | | if (this.currentClickedTypeInfo.id !== attributionId) return |
| | | } else { |
| | | if (this.currentTreeNodeInfo.id !== attributionId) return |
| | | } |
| | | if (docClassCode === 'NC') { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | this.$nextTick(() => { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | } else { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | } |
| | |
| | | |
| | | // 删除当前右键选中文档 |
| | | handleDelete() { |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | const that = this |
| | | that.$confirm({ |
| | | title: '提示', |
| | |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: '消息', |
| | |
| | | */ |
| | | handlePull(menuLabel) { |
| | | const that = this |
| | | const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, docName, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: '提示', |
| | | content: `确认${menuLabel}吗?`, |
| | |
| | | .then(res => { |
| | | console.log('res------------------', res) |
| | | if (res.success) { |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: '消息', |
| | | description: `${menuLabel}成功` |
| | |
| | | */ |
| | | handleCancelPull(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: '提示', |
| | | content: `确认${menuLabel}吗?`, |
| | |
| | | dncApi.documentCancelOutboundApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: '消息', |
| | | description: res.message |
| | |
| | | */ |
| | | handlePublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: '提示', |
| | | content: `确认${menuLabel}吗?`, |
| | |
| | | dncApi.documentPublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') |
| | | that.$notification.success({ |
| | | message: '消息', |
| | |
| | | */ |
| | | handleRepublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: '提示', |
| | | content: `确认${menuLabel}吗?`, |
| | |
| | | dncApi.documentRepublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: '消息', |
| | | description: res.message |
| | |
| | | */ |
| | | handlePigeonhole(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: '提示', |
| | | content: `${menuLabel}后不可取消,确认${menuLabel}吗?`, |
| | |
| | | dncApi.documentPigeonholeApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: '消息', |
| | | description: res.message |