diff --git a/src/views/modules/rohs/rohsRecord.vue b/src/views/modules/rohs/rohsRecord.vue index 9094240..01e2a1d 100644 --- a/src/views/modules/rohs/rohsRecord.vue +++ b/src/views/modules/rohs/rohsRecord.vue @@ -1259,6 +1259,7 @@ export default { rohsRemarkForm: { remark: '' }, + hsfStandardDefaultText: 'With the follow environmental specification: Macallan regulated Substances specification(069-0135) /Macallan sustainable fiber specification(099-00532)', modalData: { site: 'DEFAULT', referenceNo: '', @@ -1363,6 +1364,9 @@ export default { this.refreshCurrentRowFromServer(this.modalData.site, this.modalData.referenceNo) }) } + }, + 'modalData.endCustomer' () { + this.applyHsfStandardDefaultByCustomer(this.modalData) } }, methods: { @@ -1618,13 +1622,24 @@ export default { shouldShowHsfStandard (customerCode) { return String(customerCode || '').trim().toUpperCase() === 'C00052' }, + applyHsfStandardDefaultByCustomer (formData) { + if (!formData || !this.shouldShowHsfStandard(formData.endCustomer)) { + return + } + const currentValue = String(formData.hsfStandard || '').trim() + if (!currentValue) { + this.$set(formData, 'hsfStandard', this.hsfStandardDefaultText) + } + }, normalizeHsfStandardByCustomer (formData) { if (!formData) { return } if (!this.shouldShowHsfStandard(formData.endCustomer)) { this.$set(formData, 'hsfStandard', '') + return } + this.applyHsfStandardDefaultByCustomer(formData) }, syncHsfApproverFields () { const sourceList = Array.isArray(this.modalData.hsfApproverList) @@ -2398,6 +2413,7 @@ export default { this.$set(this.modalData, 'validUntilValue', this.normalizeValidUntilValue(this.modalData.validUntilValue)) this.syncHsfApproverFields() this.fillDisplayFields(this.modalData, row || {}) + this.applyHsfStandardDefaultByCustomer(this.modalData) // 编辑时不允许修改最终客户和项目编码 this.$set(this.modalData, 'endCustomerFlag', true) this.$set(this.modalData, 'projectIdFlag', true)