diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue index 1c51151..595c3ff 100644 --- a/src/views/modules/part/partInformation.vue +++ b/src/views/modules/part/partInformation.vue @@ -3256,6 +3256,11 @@ attributeDialog: true, uploadDialog: false, saveItemModelFlag: false, + mainInfoFlag: false, // 主信息标识 + costsInfoFlag: false, // costs标识 + manufacturingInfoFlag: false, // Manufacturing标识 + planningInfoFlag: false, // planning标识 + partItemInfoFlag: false, // 属性信息标识 fromPartModelFlag: false, filterVisible: false, isFilterSearch: false, @@ -3294,6 +3299,7 @@ this.searchData.plmPartNo = partNo; } this.getDataList() + this.setupWatchers() }, activated() { @@ -3323,6 +3329,76 @@ }, methods: { + + // 重置标识 + resetFlags () { + this.mainInfoFlag = false + this.costsInfoFlag = false + this.manufacturingInfoFlag = false + this.planningInfoFlag = false + this.partItemInfoFlag = false + }, + + // 设置监听 + setupWatchers() { + this.teardownWatchers() + const groups = { + mainInfoFlag: ['partType', 'hazardCode', 'productGroupId4', 'productGroupId3', + 'umId', 'groupId', 'productGroupId1', 'familyId', 'productGroupId2', 'typeDesignation', + 'assetClass', 'dimQuality', 'partStatus', 'weightNet', 'uomForWeightNet', 'frequencyClass', + 'abcClass', 'volumeNet', 'uomForVolumeNet', 'lifecycleStage', 'manufacturingLeadTime', + 'countryOfOrigin', 'expectedLeadTime', 'durabilityDay', 'regionOfOrigin', 'intrastatConvFactor', + 'customsStatNo', 'remark', 'inventoryValuationMethod', 'partCostGroupId', 'inventoryPartCostLevel', + 'invoiceConsideration', 'zeroCostFlag'], + costsInfoFlag: ['estimatedMaterialCost'], + manufacturingInfoFlag: ['cumLeadTime', 'backFlushPart', 'byProdAsSupplyInMrpDb', 'unprotectedLeadTime', + 'issueType', 'mrpControlFlagDb', 'fixedLeadTimeDay', 'overReporting', 'useTheoreticalDensityDb', + 'variableLeadTimeDay', 'overReportTolerance', 'fixedLeadTimeHour', 'density', 'variableLeadTimeHour'], + planningInfoFlag: ['planningMethod', 'safetyStock', 'minOrderQty', 'maxOrderQty', 'mulOrderQty', + 'safetyLeadTime', 'shrinkageFac', 'stdOrderQty'], + } + Object.entries(groups).forEach(([flagName, keys]) => { + keys.forEach(key => { + const unwatch = this.$watch( + () => this.modalData[key], + (newVal, oldVal) => { + if (oldVal === undefined) return; // 忽略初始化赋值 + if (newVal !== oldVal && !this[flagName]) { + this[flagName] = true + } + } + ) + this.watchers.push(unwatch) + }) + }) + + let isFirstChange = true + this.unwatchTable = this.$watch( + () => JSON.stringify(this.partItemList), + (newVal, oldVal) => { + if (isFirstChange) { + isFirstChange = false + return // 第一次不处理 + } + if (newVal !== oldVal) { + this.partItemInfoFlag = true + } + } + ) + }, + + // 清除监听 + teardownWatchers () { + // 清除其他信息监听 + this.watchers.forEach(unwatch => unwatch()) + this.watchers = [] + // 清除属性监听 + if (this.unwatchTable) { + this.unwatchTable() + this.unwatchTable = null + } + }, + // 默认全选 defaultChecked () { this.$nextTick(() => { @@ -3574,20 +3650,12 @@ sizeChangeHandle (val) { this.pageSize = val this.pageIndex = 1 - if ( this.isFilterSearch === false){ - this.getDataList() - } else { - this.queryByAnyField(this.filterSearchData) - } + this.getDataList() }, // 当前页 currentChangeHandle (val) { this.pageIndex = val - if ( this.isFilterSearch === false){ - this.getDataList() - } else { - this.queryByAnyField(this.filterSearchData) - } + this.getDataList() }, // 每页数 locationSizeChangeHandle (val) { @@ -3613,7 +3681,7 @@ }, // ======== 页签切换相关方法 ======== - // 未知 + selectFlag(row, index) { if (row.status !== 'Y') { return true @@ -3742,7 +3810,6 @@ } } }) - this.isFilterSearch = false }, // 其他页面跳转来的查询方法,如果该料号已经转正,则按照IFS料号跳转 @@ -3876,6 +3943,10 @@ plmPartNo: '', showInQueryFlag: 'Y', temporaryPartFlag: 'Y', + mainInfoFlag: false, // 主信息标识 + costsInfoFlag: false, // costs标识 + manufacturingInfoFlag: false, // Manufacturing标识 + planningInfoFlag: false, // planning标识 } this.partItemList = [] this.inventoryPartTable = 'General' @@ -3992,7 +4063,13 @@ ifsPartNo: row.ifsPartNo, showInQueryFlag: row.showInQueryFlag, temporaryPartFlag: row.temporaryPartFlag, + mainInfoFlag: false, // 主信息标识 + costsInfoFlag: false, // costs标识 + manufacturingInfoFlag: false, // Manufacturing标识 + planningInfoFlag: false, // planning标识 } + this.resetFlags() // 重置标识 + this.setupWatchers() // 设置监听 this.getPartCharacteristicList() this.inventoryPartTable = 'General' this.modalDisableFlag = true @@ -4104,6 +4181,10 @@ ifsPartNo: row.ifsPartNo, showInQueryFlag: row.showInQueryFlag, temporaryPartFlag: row.temporaryPartFlag, + mainInfoFlag: false, // 主信息标识 + costsInfoFlag: false, // costs标识 + manufacturingInfoFlag: false, // Manufacturing标识 + planningInfoFlag: false, // planning标识 } this.getPartCharacteristicList() this.inventoryPartTable = 'General' @@ -4217,6 +4298,10 @@ plmPartNo: row.plmPartNo, showInQueryFlag: row.showInQueryFlag, temporaryPartFlag: row.temporaryPartFlag, + mainInfoFlag: false, // 主信息标识 + costsInfoFlag: false, // costs标识 + manufacturingInfoFlag: false, // Manufacturing标识 + planningInfoFlag: false, // planning标识 } this.getPartCharacteristicList() // 查出该物料的BOM和routing的替代 @@ -4226,6 +4311,18 @@ this.modalFlag = true }, + // 关闭模态框 + closeModal () { + this.modalFlag = false + }, + + // 模态框关闭事件 + handleDialogClose () { + if (this.modalData.flag === '2') { + this.teardownWatchers() // 清除监听 + } + }, + // 查出该物料的BOM和routing的替代 getBomAndRoutingList () { getBomAndRoutingList(this.modalData).then(({data}) => { @@ -4714,6 +4811,7 @@ this.saveLoading = true partInformationSave(this.modalData).then(({data}) => { if (data && data.code === 0) { + this.searchData.plmPartNo = this.modalData.partNo this.getDataList() this.modalFlag = false this.$message({ @@ -4728,8 +4826,6 @@ }) } this.saveLoading = false - this.searchData.plmPartNo = this.modalData.partNo - this.getDataList() }).catch(()=>{ this.saveLoading = false }) @@ -4774,9 +4870,15 @@ this.saveLoading = false }) } else { + this.modalData.mainInfoFlag = this.mainInfoFlag + this.modalData.costsInfoFlag = this.costsInfoFlag + this.modalData.manufacturingInfoFlag = this.manufacturingInfoFlag + this.modalData.planningInfoFlag = this.planningInfoFlag + this.modalData.partItemInfoFlag = this.partItemInfoFlag this.saveLoading = true partInformationEdit(this.modalData).then(({data}) => { if (data && data.code === 0) { + this.searchData.plmPartNo = this.modalData.plmPartNo this.getDataList() this.modalFlag = false this.$message({ @@ -4791,8 +4893,6 @@ }) } this.saveLoading = false - this.searchData.plmPartNo = this.modalData.plmPartNo - this.getDataList() }).catch(()=>{ this.saveLoading = false }) @@ -5675,29 +5775,6 @@ localStorage.setItem('recipeData', JSON.stringify(inData)) window.open('#/part-recipeManagement') }, - - queryByAnyField(params){ - params.no = this.pageIndex - params.size = this.pageSize - params.site = this.$store.state.user.site - params.userId = this.$store.state.user.id.toString() - this.dataListLoading = true; - partInformationSearchAny(params).then(({data})=>{ - if (data && data.code === 0){ - this.dataList = data.page.list - }else { - this.$message.warning(data.msg) - } - this.dataListLoading = false; - this.totalPage = data.page.totalCount - }).catch((error)=>{ - this.$message.error(error) - this.dataListLoading = false; - }) - this.filterSearchData = params - this.isFilterSearch = true - this.filterVisible = false - }, } } diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue index de0f2f0..e58ec8f 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue @@ -23,7 +23,7 @@ - + UL文件号/UL Product Model @@ -808,36 +808,19 @@ this.superAdmin = data.superAdmin if (data.superAdmin) { this.ifDisableFlag = false - return false - } - if (data.status === '已完成' || data.status === '已升版' || data.status === 'Dead') { + } else if (data.status === '已完成' || data.status === '已升版' || data.status === 'Dead') { this.ifDisableFlag = true - return false } - if(data.status === '审批中') { - let tempData = { - site: row.site, - stepId: row.stepId, - menuId: '103002' - } - getNodeAuthority(tempData).then(({data}) => { - if (data && data.code === 0) { - // this.ifDisableFlag = true - // let plmStepRoleBaseBm = data.rows.plm_stepRole_base_bm - // let arr = plmStepRoleBaseBm.filter(a => a.fieldId === this.searchData.fieldId) - // if (arr.length > 0) { - // if (arr[0].updateFlag === 'N') { - // this.ifDisableFlag = true - // } else { - // this.ifDisableFlag = false - // } - // } else { - // this.ifDisableFlag = true - // } - this.plmTechnicalSpecificationSheetArr = data.rows.plm_technical_specification_sheet - } - }) + let tempData = { + site: row.site, + stepId: row.stepId, + menuId: '103002' } + getNodeAuthority(tempData).then(({data}) => { + if (data && data.code === 0) { + this.plmTechnicalSpecificationSheetArr = data.rows.plm_technical_specification_sheet + } + }) }) }, diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_customerInformation.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_customerInformation.vue index 8d79172..1531782 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_customerInformation.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_customerInformation.vue @@ -52,7 +52,7 @@ clearable filterable dict-type="finalCustomer" :use-default-value="true" - :disabled="ifDisableFlag || plmStepRoleBaseBmFlag('finalCustomerNo') === 'N'"> + :disabled="plmStepRoleBaseBmFlag('finalCustomerNo') === 'N'"> @@ -81,7 +81,7 @@
- +
@@ -91,28 +91,28 @@
- +
- +
- +
- + @@ -132,7 +132,7 @@ resize='none' maxlength="120" show-word-limit - :disabled="ifDisableFlag || plmTechnicalSpecificationSheetFlag('customerRemark') === 'N'" + :disabled="plmTechnicalSpecificationSheetFlag('customerRemark') === 'N'" style="height: 60px"> @@ -150,7 +150,7 @@ resize='none' maxlength="120" show-word-limit - :disabled="ifDisableFlag || plmTechnicalSpecificationSheetFlag('projectRemark') === 'N'" + :disabled="plmTechnicalSpecificationSheetFlag('projectRemark') === 'N'" style="height: 60px"> @@ -161,7 +161,7 @@
- + 附加客户图纸/Attach Customer Drawing(点击跳转) @@ -247,7 +247,7 @@ maxlength="120" show-word-limit style="height: 60px" - :disabled="ifDisableFlag || plmTechnicalSpecificationSheetFlag('remark') === 'N'"> + :disabled="plmTechnicalSpecificationSheetFlag('remark') === 'N'">
@@ -581,25 +581,20 @@ this.superAdmin = data.superAdmin if (data.superAdmin) { this.ifDisableFlag = false - return false + } else if (data.status === '已完成' || data.status === '已升版' || data.status === 'Dead') { + this.ifDisableFlag = true } - if (data.status === '已完成' || data.status === '已升版' || data.status === 'Dead') { - this.ifDisableFlag = true - return false + let tempData = { + site: row.site, + stepId: row.stepId, + menuId: '103002' } - if (data.status === '审批中') { - let tempData = { - site: row.site, - stepId: row.stepId, - menuId: '103002' + getNodeAuthority(tempData).then(({data}) => { + if (data && data.code === 0) { + this.plmStepRoleBaseBmArr = data.rows.plm_stepRole_base_bm + this.plmTechnicalSpecificationSheetArr = data.rows.plm_technical_specification_sheet } - getNodeAuthority(tempData).then(({data}) => { - if (data && data.code === 0) { - this.plmStepRoleBaseBmArr = data.rows.plm_stepRole_base_bm - this.plmTechnicalSpecificationSheetArr = data.rows.plm_technical_specification_sheet - } - }) - } + }) }) }, diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue index bd9a661..9f5312e 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue @@ -313,7 +313,7 @@ this.ifDisableFlag = true return false } - if (data.status === '审批中') { + if (data.status === '审批中' || data.status === '草稿') { let tempData = { site: row.site, stepId: row.stepId, diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue index 3baebb7..73bc736 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue @@ -11,16 +11,16 @@ :use-default-value="false" dict-type="bm_process" style="width: 120px" - :disabled="ifDisableFlag || plmTechnicalSpecificationSheetFlag('process') === 'N'"> + :disabled="plmTechnicalSpecificationSheetFlag('process') === 'N'"> - 热转移打印人员/Technician + 热转移打印人员/Technician 热转移打印人员/Technician - 印刷人员/Technician + 印刷人员/Technician 印刷人员/Technician @@ -245,7 +245,7 @@ :use-default-value="false" dict-type="bm_simplex_duplex" style="width: 160px" - :disabled="ifDisableFlag || plmTechnicalSpecificationSheetFlag('simplexDuplex') === 'N'"> + :disabled="plmTechnicalSpecificationSheetFlag('simplexDuplex') === 'N'"> @@ -256,26 +256,26 @@ v-model="sheetData.repeat" dict-type="bm_repeat" style="width: 120px" - :disabled="ifDisableFlag || plmTechnicalSpecificationSheetFlag('repeat') === 'N'"> + :disabled="plmTechnicalSpecificationSheetFlag('repeat') === 'N'"> - + - + - + - + - +
@@ -285,7 +285,7 @@ - + @@ -298,11 +298,11 @@ v-model="sheetData.printCopyPosition" dict-type="bm_print_copy_position" style="width: 170px" - :disabled="ifDisableFlag || plmTechnicalSpecificationSheetFlag('printCopyPosition') === 'N'"> + :disabled="plmTechnicalSpecificationSheetFlag('printCopyPosition') === 'N'"> - + + :disabled="plmTechnicalSpecificationSheetFlag('newCutter') === 'N'"> - + - + - + @@ -1765,24 +1765,19 @@ this.superAdmin = data.superAdmin if (data.superAdmin) { this.ifDisableFlag = false - return false - } - if (data.status === '已完成' || data.status === '已升版' || data.status === 'Dead') { + } else if (data.status === '已完成' || data.status === '已升版' || data.status === 'Dead') { this.ifDisableFlag = true - return false } - if (data.status === '审批中') { - let tempData = { - site: row.site, - stepId: row.stepId, - menuId: '103002' - } - getNodeAuthority(tempData).then(({data}) => { - if (data && data.code === 0) { - this.plmTechnicalSpecificationSheetArr = data.rows.plm_technical_specification_sheet - } - }) + let tempData = { + site: row.site, + stepId: row.stepId, + menuId: '103002' } + getNodeAuthority(tempData).then(({data}) => { + if (data && data.code === 0) { + this.plmTechnicalSpecificationSheetArr = data.rows.plm_technical_specification_sheet + } + }) }) }, // 打开提交模态框 diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue index b85d236..aefb1c3 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue @@ -94,7 +94,7 @@ - + @@ -103,7 +103,7 @@
- + @@ -130,21 +130,21 @@ - + - - + + - - + + @@ -153,7 +153,7 @@
- 客服人员/ CS + 客服人员/ CS 客服人员/ CS @@ -162,7 +162,7 @@
- 工程人员/Engineer + 工程人员/Engineer 工程人员/Engineer @@ -171,7 +171,7 @@
- 设计制图人员/Artwork + 设计制图人员/Artwork 设计制图人员/Artwork @@ -188,7 +188,7 @@
- 技术员/Technician + 技术员/Technician 技术员/Technician @@ -221,7 +221,7 @@
- 计划人员/Planner + 计划人员/Planner 计划人员/Planner @@ -229,7 +229,7 @@
- + 质检人员/CQC @@ -241,7 +241,7 @@
- + 首件检测/FAI @@ -253,7 +253,7 @@
- + 文件管控专员/DCC @@ -269,7 +269,7 @@
- +
@@ -278,7 +278,7 @@
- +
@@ -1076,37 +1076,20 @@ this.superAdmin = data.superAdmin if (data.superAdmin) { this.ifDisableFlag = false - return false - } - if (data.status === '已完成' || data.status === '已升版' || data.status === 'Dead') { + } else if (data.status === '已完成' || data.status === '已升版' || data.status === 'Dead') { this.ifDisableFlag = true - return false } - if (data.status === '审批中') { - let tempData = { - site: row.site, - stepId: row.stepId, - menuId: '103002' - } - getNodeAuthority(tempData).then(({data}) => { - if (data && data.code === 0) { - //this.ifDisableFlag = true - this.plmTechnicalSpecificationSheetArr = data.rows.plm_technical_specification_sheet - this.plmTechnicalSpecificationTeamArr = data.rows.plm_technicalSpecification_team - // let plmStepRoleBaseBm = data.rows.plm_stepRole_base_bm - // let arr = plmStepRoleBaseBm.filter(a => a.fieldId === 'basicInformation') - // if (arr.length > 0) { - // if (arr[0].updateFlag === 'N') { - // this.ifDisableFlag = true - // } else { - // this.ifDisableFlag = false - // } - // } else { - // this.ifDisableFlag = true - // } - } - }) + let tempData = { + site: row.site, + stepId: row.stepId, + menuId: '103002' } + getNodeAuthority(tempData).then(({data}) => { + if (data && data.code === 0) { + this.plmTechnicalSpecificationSheetArr = data.rows.plm_technical_specification_sheet + this.plmTechnicalSpecificationTeamArr = data.rows.plm_technicalSpecification_team + } + }) }) },