Browse Source

Merge branch 'master' of 121.41.102.225:Nidong/jiufang into hw

mushencc 3 years ago
parent
commit
32e38d7e83
1 changed files with 29 additions and 17 deletions
  1. 29 17
      src/views/OrderMannage/BusinessOrderlist/edit.vue

+ 29 - 17
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -2862,6 +2862,9 @@ export default {
             this._measure = JSON.parse(JSON.stringify(element.measure));
             element.part.forEach((elem) => {
               if (!elem.is_metal) {
+                if (elem.title.indexOf("门头板") != -1) {
+                  elem.addMTB = true;
+                }
                 // 表格数据展示字段
                 elem.isBP = true;
                 elem.process_str = elem.process;
@@ -3035,11 +3038,12 @@ export default {
           if (!this.modalData.procedure_properties_str) {
             this.modalData.procedure_properties_str = [];
           }
-          this.modalData.process_obj.forEach((elem, index) => {
-            const _temp = elem.cld.filter((item) => item.id == elem.value);
-            this.modalData.procedure_properties_str[index] =
-              _temp.length > 0 ? _temp[0].title : "";
-          });
+          this.modalData.process_obj &&
+            this.modalData.process_obj.forEach((elem, index) => {
+              const _temp = elem.cld.filter((item) => item.id == elem.value);
+              this.modalData.procedure_properties_str[index] =
+                _temp.length > 0 ? _temp[0].title : "";
+            });
           this.modalData.process_str = this.modalData.procedure_properties_str.join(
             "/"
           );
@@ -3076,9 +3080,10 @@ export default {
               elem.procedure_properties_str = [];
               if (elem.process) {
                 elem.process.forEach((item, index) => {
-                  const _temp = item.cld.filter(
-                    (_cld) => _cld.id == item.value
-                  );
+                  let _temp = [];
+                  if (item.cld) {
+                    item.cld.filter((_cld) => _cld.id == item.value);
+                  }
                   elem.procedure_properties_str[index] =
                     _temp.length > 0 ? _temp[0].title : "";
                 });
@@ -3348,7 +3353,7 @@ export default {
         hide_measure: [],
         process: [],
         part_id: 25, //门头板ID
-        hide_process: [],
+        hide_process: ["1", "2", "3"],
         part_detail: [
           {
             title: "",
@@ -4330,7 +4335,7 @@ export default {
             unit: "", //单位
             title: "", //产品名
             process: "", //工艺属性拼接
-            procedure_properties: {}, //工艺属性对象
+            procedure_properties: this.pre_process_obj || {}, //工艺属性对象
             overdraft: [], //超标公式
             measure: this._measure, //测量字段数组
             support_remark: this.support_remark, //备注列表
@@ -4350,9 +4355,7 @@ export default {
             ],
             process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
           };
-          obj.process_obj.map(
-            (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
-          );
+          obj.process_obj.map((v) => (obj[v.id] = ""));
         } else {
           obj = {
             select_all_id: $event.value,
@@ -4816,16 +4819,25 @@ export default {
       }
     },
     handeMTBSelection($event, row) {
-      console.log(`$event`, $event);
       this.axios
         .post("/api/get_part_detail_material", {
           id: $event.value,
         })
         .then((res) => {
           this.modalData.part.map((part) => {
-            if (part.id === 25) {
-              part.part_detail = res.data.msg.detail;
-              part = Object.assign(part, res.data.msg);
+            console.log(`part`, part);
+            if (part.part_id === 25) {
+              res.data.sub_part.map((v) => {
+                v.material_detail_id =
+                  v.material_detail_list[0].material_detail_id;
+                v.material_detail_num = 1;
+              });
+              part.part_detail = res.data.sub_part;
+              part.long = res.data.long;
+              part.high = res.data.high;
+              part.wide = res.data.wide;
+              part.route_id = res.data.route_id;
+              part.process = res.data.process;
             }
           });
         });