Browse Source

BUG修改

JX.Li 1 year ago
parent
commit
12484c16af

+ 2 - 2
src/views/zdsz/engineeringCivil/index.vue

@@ -1437,7 +1437,7 @@ export default {
       this.reset();
       const id = row.id || this.ids
       getEngineeringCivil(id).then(res => {
-        debugger
+
         that.loading = false;
         // let newData = res.data
         // // 手动调用行政区发生改变
@@ -1458,7 +1458,7 @@ export default {
             updateEngineeringCivil(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
-              debugger
+
               this.getList();
             }).finally(() => {
               this.buttonLoading = false;

+ 17 - 3
src/views/zdsz/engineeringIndustry/index.vue

@@ -585,6 +585,13 @@ export default {
           zEngineeringMaterialBo: []
         },
       }
+      this.zEngineeringMaterialBo = [ // 用料对象
+        {
+          materialQuality: '', // 用料材质
+          specifications: '', // 用料规格
+          number: '' // 用料数量
+        },
+      ]
       const id = row.id
       putEngineeEngineeIndustry(id).then(response => {
         this.loading = false;
@@ -637,6 +644,7 @@ export default {
         if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == null) {
           valid = false;
         }
+
         if (valid) {
           this.zEngineeringMaterialBo.push({
             materialQuality: '', // 用料材质
@@ -784,8 +792,14 @@ export default {
       putEngineeEngineeIndustry(id).then(response => {
         this.loading = false;
         this.form = response.data;
-        this.zEngineeringNodeBo = response.data.zEngineeringNodeBoList[0]
-        this.zEngineeringNodeBo.zEngineeringInfoBo = response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
+        if (response.data.zEngineeringNodeBoList !== undefined && response.data.zEngineeringNodeBoList.length > 0) {
+          this.zEngineeringNodeBo = response.data.zEngineeringNodeBoList[0]
+          if (response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList !== undefined && response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList.length > 0) {
+            this.zEngineeringNodeBo.zEngineeringInfoBo = response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
+          }
+        }
+
+
         this.title = (this.form.type === '1' ? "修改工业工程" : "修改市政工程");
         this.currentType = 'put'
         this.open = true;
@@ -799,7 +813,7 @@ export default {
         this.form.zEngineeringNodeBo = this.zEngineeringNodeBo
         this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.zEngineeringMaterialBo
       }
-      debugger
+
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.form.files = this.$refs.obsFileUpload.fileList;