Browse Source

2026-07-07

RoHS优化
master
fengyuan_yang 3 weeks ago
parent
commit
cebec58d79
  1. 32
      src/views/modules/lab/labRecord.vue
  2. 9
      src/views/modules/rohs/rohsRecord.vue

32
src/views/modules/lab/labRecord.vue

@ -1634,20 +1634,32 @@ export default {
}
const currentList = Array.isArray(this.modalData.propertyItemList) ? this.modalData.propertyItemList : []
const selectedNoSet = new Set(this.propertyItemSelections.map(item => item.itemNo))
const currentMap = new Map(currentList.map(item => [item.itemNo, this.normalizePropertyItem(item)]))
const mergedList = []
currentList.forEach(item => {
if (selectedNoSet.has(item.itemNo)) {
mergedList.push(this.normalizePropertyItem(item))
// Lab
this.propertyItemList.forEach(templateItem => {
const templateNo = templateItem.itemNo
if (!selectedNoSet.has(templateNo)) {
return
}
})
this.propertyItemSelections.forEach(selected => {
if (!mergedList.some(item => item.itemNo === selected.itemNo)) {
const normalized = this.normalizePropertyItem(selected)
normalized.itemValue = this.resolvePropertyDefaultValue(normalized)
mergedList.push(normalized)
const currentItem = currentMap.get(templateNo)
if (currentItem) {
const keepValueItem = this.normalizePropertyItem({
...templateItem,
...currentItem,
itemNo: templateItem.itemNo,
itemDesc: templateItem.itemDesc,
valueChooseFlag: templateItem.valueChooseFlag,
defaultValue: templateItem.defaultValue,
availableValueList: templateItem.availableValueList
})
mergedList.push(keepValueItem)
return
}
const normalized = this.normalizePropertyItem(templateItem)
normalized.itemValue = this.resolvePropertyDefaultValue(normalized)
mergedList.push(normalized)
})
this.$set(this.modalData, 'propertyItemList', mergedList.map((item, index) => ({

9
src/views/modules/rohs/rohsRecord.vue

@ -3699,6 +3699,15 @@ export default {
this.$message.warning('当前状态不允许保存')
return
}
const isAddMode = this.modalTitle === 'RoHS 新增'
if (isAddMode && !String(this.modalData.endCustomer || '').trim()) {
this.$message.warning('最终客户不能为空')
return
}
if (isAddMode && !String(this.modalData.projectId || '').trim()) {
this.$message.warning('项目编码不能为空')
return
}
this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
this.normalizeHsfStandardByCustomer(this.modalData)
this.syncHsfApproverFields()

Loading…
Cancel
Save