diff --git a/dist.zip b/dist.zip new file mode 100644 index 00000000..25121089 Binary files /dev/null and b/dist.zip differ diff --git a/src/views/core/base/product/add-or-updata.vue b/src/views/core/base/product/add-or-updata.vue index 2b6fd3d3..85dbb17f 100644 --- a/src/views/core/base/product/add-or-updata.vue +++ b/src/views/core/base/product/add-or-updata.vue @@ -71,10 +71,11 @@ - - - + + + @@ -190,7 +191,7 @@ export default { unitDictValue: '', // 单位id originalSpecifications: '', // 原片规格 originalArea: 0, // 原片单位平方数 - processType:undefined, + processTypes: [], }, listQuery: { pageSize: 10, @@ -199,18 +200,18 @@ export default { }, processTypeList: [ { - id: '0', + value: '1', label:'压花丝印' }, { - id: '1', + value: '2', label: '无印打孔' }, { - id: '2', + value: '3', label: '单层镀膜' }, { - id: '3', + value: '4', label: '双层镀膜' } ], @@ -275,7 +276,8 @@ export default { init(id, isdetail) { this.initData(); this.isdetail = isdetail || false; - this.dataForm.id = id || null; + this.dataForm.id = id || null; + // this.dataForm.processTypes = [] // 清空工艺选择 this.visible = true; this.$nextTick(() => { @@ -283,9 +285,26 @@ export default { if (this.dataForm.id) { // 获取产品详情 - getProduct(id).then((response) => { - this.dataForm = response.data; - }); + getProduct(id).then((res) => { + const resData = res.data || {}; + // 逐个字段赋值(保留响应式) + this.dataForm.name = resData.name || ''; + this.dataForm.code = resData.code || ''; + this.dataForm.area = resData.area || 0; + this.dataForm.typeDictValue = resData.typeDictValue || null; + this.dataForm.processTime = resData.processTime || null; + this.dataForm.specifications = resData.specifications || ''; + this.dataForm.unitDictValue = resData.unitDictValue || ''; + this.dataForm.originalSpecifications = resData.originalSpecifications || ''; + this.dataForm.originalArea = resData.originalArea || 0; + + // 处理工艺列表:确保是数组,过滤空值 + this.dataForm.processTypes = resData.processType + ? resData.processType.split(',').filter(Boolean) + : []; + + console.log('工艺列表(编辑时):', this.dataForm.processTypes); // 验证是否为 ["1","2"] 格式 + }); // 获取产品的属性列表 this.getList(); } else { @@ -341,7 +360,7 @@ export default { // 表单提交 dataFormSubmit() { this.$refs['dataForm'].validate((valid) => { - if (valid) { + if (valid) { // 修改的提交 if (this.dataForm.id) { updateProduct(this.dataForm).then((response) => { diff --git a/src/views/equipment/equipmentOverview/add-or-updata.vue b/src/views/equipment/equipmentOverview/add-or-updata.vue index 0e3c8403..6e812ccc 100644 --- a/src/views/equipment/equipmentOverview/add-or-updata.vue +++ b/src/views/equipment/equipmentOverview/add-or-updata.vue @@ -63,9 +63,9 @@ export default { init(data) { console.log(data.paramMonitors,'data'); - this.dataForm.equipmentId = data.equipmentId || undefined; - this.dataForm.equipmentName = data.equipmentName || undefined; - this.dataForm.lineId = data.lineId || undefined; + this.dataForm.equipmentId = data.equipmentId || ''; + this.dataForm.equipmentName = data.equipmentName || ''; + this.dataForm.lineId = data.lineId || ''; this.visible = true; diff --git a/src/views/equipment/equipmentOverview/alarm-or-updata.vue b/src/views/equipment/equipmentOverview/alarm-or-updata.vue index 1a5341b3..a78b1d89 100644 --- a/src/views/equipment/equipmentOverview/alarm-or-updata.vue +++ b/src/views/equipment/equipmentOverview/alarm-or-updata.vue @@ -1,5 +1,5 @@