Ver código fonte

fix(inspectionWork): 修复实验报告表单数据保存和初始化问题

- 移除业务类型枚举,避免重复定义
- 添加空值检查,防止组件未加载时报错
- 补充质量结果字段到提交数据中
- 修正流程组件初始化参数格式为数组
yusheng 4 dias atrás
pai
commit
4d7b8eb413

+ 0 - 1
src/enum/dict.js

@@ -46,7 +46,6 @@ export const numberList = [
   'inspection_plan_status',
   'inspection_scheme',
   'industry_type',
-  'business_type',
   'record_template_style',
   'checklist_type',
   'record_rules_report_work_type',

+ 5 - 4
src/views/inspectionWork/components/experimentReport.vue

@@ -767,8 +767,8 @@
         this.$refs.formRef.validate((valid) => {
           if (!valid) return false;
           let data = JSON.parse(JSON.stringify(this.form));
-          let procedureJson = this.$refs.experimentationProcess1.getValue();
-          let recordJson = this.$refs.experimentationProcess2.getValue();
+          let procedureJson = this.$refs.experimentationProcess1?.getValue();
+          let recordJson = this.$refs.experimentationProcess2?.getValue();
           if (procedureJson) {
             data.procedureJson = {
               tempJson: JSON.stringify(procedureJson)
@@ -782,6 +782,7 @@
           let row = JSON.parse(JSON.stringify(this.tableData[0]));
           if (!this.pageName) {
             row.experiment = data;
+            row.qualityResults = this.form.results;
             this.$emit('done', row);
             this.handleClose();
 
@@ -806,8 +807,8 @@
           ...defForm
         };
         this.$nextTick(() => {
-          this.$refs.experimentationProcess1.init('{}');
-          this.$refs.experimentationProcess2.init('{}');
+          this.$refs.experimentationProcess1.init('[]');
+          this.$refs.experimentationProcess2.init('[]');
           this.visible = false;
         });
       }