diff --git a/src/views/modules/rohs/rohsRecord.vue b/src/views/modules/rohs/rohsRecord.vue index e82302d..f39ae73 100644 --- a/src/views/modules/rohs/rohsRecord.vue +++ b/src/views/modules/rohs/rohsRecord.vue @@ -3166,6 +3166,7 @@ export default { const rohsStatus = String(latestData.rohsStatus || this.updateExpiryForm.rohsStatus || this.modalData.rohsStatus || 'Active').trim() || 'Active' const expiryDate = this.normalizeDateOnly(latestData.expiryDate || this.updateExpiryForm.expiryDate) const isExpiring = String(latestData.isExpiring || this.modalData.isExpiring || 'N').trim().toUpperCase() === 'Y' ? 'Y' : 'N' + const isDeadStatus = rohsStatus.toUpperCase() === 'DEAD' this.$set(this.modalData, 'expiredDate', expiredDate) this.$set(this.modalData, 'validUntilValue', validUntilValue) @@ -3173,6 +3174,15 @@ export default { this.$set(this.modalData, 'rohsStatus', rohsStatus) this.$set(this.modalData, 'expiryDate', expiryDate) this.$set(this.modalData, 'isExpiring', isExpiring) + if (Array.isArray(latestData.materialList)) { + this.$set(this.modalData, 'materialList', latestData.materialList) + } + if (isDeadStatus && Array.isArray(this.modalData.materialList) && this.modalData.materialList.length) { + this.$set(this.modalData, 'materialList', this.modalData.materialList.map(item => ({ + ...(item || {}), + partStatus: 'D' + }))) + } if (this.currentRow && this.currentRow.site === this.modalData.site && this.currentRow.referenceNo === this.modalData.referenceNo) { this.$set(this.currentRow, 'expiredDate', expiredDate) @@ -3181,6 +3191,15 @@ export default { this.$set(this.currentRow, 'rohsStatus', rohsStatus) this.$set(this.currentRow, 'expiryDate', expiryDate) this.$set(this.currentRow, 'isExpiring', isExpiring) + if (Array.isArray(latestData.materialList)) { + this.$set(this.currentRow, 'materialList', latestData.materialList) + } + if (isDeadStatus && Array.isArray(this.currentRow.materialList) && this.currentRow.materialList.length) { + this.$set(this.currentRow, 'materialList', this.currentRow.materialList.map(item => ({ + ...(item || {}), + partStatus: 'D' + }))) + } } const target = (this.dataList || []).find(item => item.site === this.modalData.site && item.referenceNo === this.modalData.referenceNo) if (target) {