Explorar o código

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

mushencc %!s(int64=3) %!d(string=hai) anos
pai
achega
f95c7f535c

+ 34 - 4
src/components/product/add/index.vue

@@ -822,7 +822,7 @@ export default {
         type_name: "产品" + (this.addProductArray.length + 1),
         position: "",
         index,
-        extArray: [{ type: 2 }],
+        extArray: [],
       });
     },
     handleAddProductSelect(row) {
@@ -864,6 +864,7 @@ export default {
             this.support_remark = res.data.support_remark;
             let modalData = this.currencyProduct;
             modalData.url = res.data.url;
+            modalData.support_remark = res.data.support_remark;
             modalData.total_num = res.data.total_num || 1;
             modalData.ext_price = res.data.ext_price || 0;
             modalData.unit_price = res.data.price || 0;
@@ -926,6 +927,17 @@ export default {
                       el.high = el.high || "0";
                     });
                   });
+                  element.part_detail.map((_part_detail) => {
+                    _part_detail.material_detail_org_num =
+                      _part_detail.num || 0;
+                    _part_detail.part_detail_option = [];
+                    _part_detail.material_detail_list.map((v) => {
+                      _part_detail.part_detail_option.push({
+                        label: `${v.long}*${v.wide}*${v.high}`,
+                        value: v.material_detail_id,
+                      });
+                    });
+                  });
                 }
               }
             });
@@ -1000,7 +1012,20 @@ export default {
               }
             });
             if (res.data.bp_id == this.pre_bp_id) {
-              modalData.extArray = this.tempExtArray;
+              modalData.extArray = this.deepClone(this.tempExtArray);
+              if (modalData.extArray.length == 1) {
+                modalData.ext_price =
+                  modalData.extArray[0].num * 1 * modalData.extArray[0].price;
+              } else {
+                modalData.ext_price = modalData.extArray.reduce(
+                  (pre, pur) => pre.total_price * 1 + pur.num * pur.price * 1
+                );
+              }
+              modalData.price =
+                (modalData.unit_price * 1 || 0) * (modalData.num * 1 || 1) +
+                (modalData.over_price * 1 || 0) +
+                (modalData.ext_price * 1 || 0);
+              modalData.price = modalData.price.toFixed(2);
             } else {
               modalData.extArray = [];
             }
@@ -1024,7 +1049,7 @@ export default {
           });
         });
         let list = product.process.map((item) => {
-          return { type_id: item.key|| item.id, value: item.value || "" };
+          return { type_id: item.key || item.id, value: item.value || "" };
         });
         ele.cld = [];
         this.axios({
@@ -1302,6 +1327,9 @@ export default {
         product.part.forEach((element) => {
           console.log("element :>> ", element);
           if (!element.is_metal) {
+            element.highCalc = element.highCalc + "";
+            element.longCalc = element.longCalc + "";
+            element.wideCalc = element.wideCalc + "";
             //处理公式
             if (element.highCalc.indexOf(cur_measure) != -1) {
               element.high = element.highCalc.replace(
@@ -1648,7 +1676,9 @@ export default {
       this.$forceUpdate();
     },
     handleTabsPaneChange(name) {
-      this.tempExtArray = this.addProductArray[this.currentTabIndex].extArray;
+      this.tempExtArray = this.deepClone(
+        this.addProductArray[this.currentTabIndex].extArray
+      );
       this.pre_bp_id = this.addProductArray[this.currentTabIndex].bp_id;
       this.currentTabIndex = this.$refs.tabsRef.activeKey;
       this.currencyProduct = this.addProductArray[this.currentTabIndex];

+ 31 - 13
src/views/BidSystem/ContractList/edit.vue

@@ -37,12 +37,12 @@
         >
           添加特殊字段
         </Button>
-        <Button
+        <!-- <Button
           @click="showSupModal = true"
           type="primary"
           style="margin-right: 10px"
           >项目辅料</Button
-        >
+        > -->
         <Button
           @click="goback()"
           type="primary"
@@ -1881,8 +1881,8 @@ export default {
         res.data.head[3] &&
           res.data.head[3].length > 0 &&
           res.data.head[3].forEach((item) => {
-            console.log("item :>> ", item);
             // ele[key] = item.key
+            /////
             arr.push({
               title: item.key,
               key: item.key,
@@ -1890,6 +1890,7 @@ export default {
               minWidth: 80,
             });
           });
+        console.log("arr :>> ", arr);
         this.tableColumns = [
           { title: "序号123", key: "index", align: "center", minWidth: 80 },
           {
@@ -2035,12 +2036,13 @@ export default {
                       pdt.index = index + 1;
                       pdt.special &&
                         pdt.special.length > 0 &&
-                        pdt.special.forEach((_pdt) => {
-                          this.formData.head[3].forEach((element) => {
-                            if (_pdt.head_id == element.id) {
-                              _pdt = Object.assign(_pdt, element);
+                        pdt.special.map((_pdt) => {
+                          this.formData.head[3].map((v) => {
+                            if (_pdt.head_id == v.id) {
+                              _pdt = Object.assign(_pdt, v);
+                              v = Object.assign(_pdt, v);
                               pdt[_pdt.key] = _pdt.value;
-                              this.productSpecValueList.push(_pdt);
+                              // this.productSpecValueList.push(_pdt);
                             }
                           });
                         });
@@ -2055,6 +2057,7 @@ export default {
         this.areaSpecValueList = this.formData.head[2]
           ? this.formData.head[2]
           : [];
+        console.log("this.formData.head[3] :>> ", this.formData.head[3]);
         this.productSpecValueList = this.formData.head[3]
           ? this.formData.head[3]
           : [];
@@ -2891,15 +2894,30 @@ export default {
     set_tableColumns() {
       if (this.productSetTableData.length < 1) {
         return this.tableColumns;
+      } else {
+        return this.func.computedHeader(
+          this.productSetTableData,
+          this.tableColumns
+        );
       }
-      return this.func.computedHeader(
-        this.productSetTableData,
-        this.tableColumns
-      );
     },
   },
   // 监控data中的数据变化
-  watch: {},
+  watch: {
+    productSpecValueList() {
+      let arr = [];
+      this.productSpecValueList.length > 0 &&
+        this.productSpecValueList.forEach((element) => {
+          arr.push({
+            title: element.value||element.key,
+            key: element.key,
+            align: "center",
+            minWidth: 80,
+          });
+        });
+      this.set_tableColumns.splice(this.set_tableColumns.length - 1, 0, ...arr);
+    },
+  },
   beforeCreate() {}, // 生命周期 - 创建之前
   beforeMount() {}, // 生命周期 - 挂载之前
   beforeUpdate() {}, // 生命周期 - 更新之前

+ 2 - 2
src/views/BidSystem/ContractList/info.vue

@@ -31,12 +31,12 @@
           style="margin-right: 10px"
           >下深化</Button
         >
-        <Button
+        <!-- <Button
           @click="showSupModal = true"
           type="primary"
           style="margin-right: 10px"
           >项目辅料</Button
-        >
+        > -->
         <Button
           @click="goback()"
           type="primary"

+ 30 - 27
src/views/BidSystem/ProductDeOrder/deorderdetail.vue

@@ -186,7 +186,7 @@
               <Option
                 v-for="sitem in partsItem.partsNameList"
                 :key="sitem.id"
-                :label="sitem.title"
+                :label="sitem.title + ''"
                 :value="sitem.id"
               >
               </Option>
@@ -264,7 +264,7 @@
           </FormItem>
           <FormItem
             v-for="item of partsItem.ProcessAttrList"
-            :key="item.id"
+            :key="item.id + ''"
             :label="(item.name || item.title) + ':'"
           >
             <Select
@@ -279,19 +279,19 @@
               <OptionGroup
                 v-for="OptionGroup in item.cld"
                 :key="OptionGroup.type_title"
-                :label="OptionGroup.type_title"
+                :label="OptionGroup.type_title + ''"
               >
                 <Option
                   v-for="Option in OptionGroup.list"
                   :value="Option.id"
-                  :key="Option.id"
+                  :key="Option.id + ''"
                   >{{ Option.title }}</Option
                 >
               </OptionGroup>
               <Option
                 v-for="sitem in item.partsNameList"
                 :key="sitem.id"
-                :label="sitem.title"
+                :label="sitem.title + ''"
                 :value="sitem.id"
               >
               </Option>
@@ -417,7 +417,7 @@
                     v-for="item of materialWoodList"
                     :key="item.id"
                     :value="item.id"
-                    :label="item.title"
+                    :label="item.title + ''"
                   ></Option>
                 </Select>
               </div>
@@ -498,7 +498,7 @@
                   v-for="item in processRequireList"
                   :key="item.id"
                   :value="item.id"
-                  :label="item.title"
+                  :label="item.title + ''"
                 ></Option>
               </Select>
             </template>
@@ -1286,7 +1286,7 @@ export default {
       similarProductLoading: false,
       PDTTypeList: [{ id: "", title: "" }], //产品分类列表
       ProcessAttrList: [], //工艺属性列表
-      partsList: [{ id: "", title: "" }], //部件分类名称列表
+      partsList: [], //部件分类名称列表
       similarProductData: {
         type_id: "",
         title: "",
@@ -1851,25 +1851,28 @@ export default {
             item.partsWoodTableData = res.data.detail.filter(
               (v) => v.type_id == 1 || v.type_id == 2
             );
-            item.partsWoodTableData.map((v, k) => {
-              const temp_arr = res.data.detail.filter((w) => w.id == v.id);
-              v.wool_long = "";
-              v.wool_wide = "";
-              if (temp_arr.length > 0) {
-                v.long = temp_arr[temp_arr.length - 1].long;
-                v.wool_long = temp_arr[temp_arr.length - 1].wool_long;
-                v.wide = temp_arr[temp_arr.length - 1].wide;
-                v.wool_wide = temp_arr[temp_arr.length - 1].wool_wide;
-              }
-              if (result) {
-                v.long = result.data.parts[index].detail[k].long;
-                v.wide = result.data.parts[index].detail[k].wide;
-                v.wool_long = result.data.parts[index].detail[k].wool_long;
-                v.wool_wide = result.data.parts[index].detail[k].wool_wide;
-                v.row = result.data.parts[index].detail[k].row;
-                v.sort = result.data.parts[index].detail[k].sort;
-              }
-            });
+            item.partsWoodTableData.length > 0 &&
+              item.partsWoodTableData.map((v, k) => {
+                const temp_arr = res.data.detail.filter((w) => w.id == v.id);
+                v.wool_long = "";
+                v.wool_wide = "";
+                if (temp_arr.length > 0) {
+                  v.long = temp_arr[temp_arr.length - 1].long;
+                  v.wool_long = temp_arr[temp_arr.length - 1].wool_long;
+                  v.wide = temp_arr[temp_arr.length - 1].wide;
+                  v.wool_wide = temp_arr[temp_arr.length - 1].wool_wide;
+                }
+                if (result) {
+                  if (result.data.parts[index].detail) {
+                    v.long = result.data.parts[index].detail[k].long;
+                    v.wide = result.data.parts[index].detail[k].wide;
+                    v.wool_long = result.data.parts[index].detail[k].wool_long;
+                    v.wool_wide = result.data.parts[index].detail[k].wool_wide;
+                    v.row = result.data.parts[index].detail[k].row;
+                    v.sort = result.data.parts[index].detail[k].sort;
+                  }
+                }
+              });
             item.partsMetalseData = res.data.detail.filter(
               (v) => v.type_id == 5
             );

+ 137 - 94
src/views/BidSystem/ProductDeOrder/infoDetail.vue

@@ -28,15 +28,27 @@
       <div class="form">
         <Form class="form_content" :label-width="100">
           <FormItem label="项目编号:">
-            <Input v-if="type == 6" v-model="saveData.order_no" placeholder="请输入项目编码"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.order_no"
+              placeholder="请输入项目编码"
+            />
             <span style="width: 120px" v-else>{{ formData.order_no }}</span>
           </FormItem>
           <FormItem label="项目名称:">
-            <Input v-if="type == 6" v-model="saveData.residential_name" placeholder="请输入项目名称"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.residential_name"
+              placeholder="请输入项目名称"
+            />
             <span v-else>{{ formData.residential_name }}</span>
           </FormItem>
           <FormItem label="项目简称:">
-            <Input v-if="type == 6" v-model="saveData.abbreviation" placeholder="请输入项目简称"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.abbreviation"
+              placeholder="请输入项目简称"
+            />
             <span v-else>{{ formData.abbreviation }}</span>
           </FormItem>
           <FormItem label="客户名称:">
@@ -57,11 +69,7 @@
             <span v-else>{{ formData.custom_title }}</span>
           </FormItem>
           <FormItem label="紧急程度:">
-            <Select
-              clearable
-              v-model="saveData.warning_state"
-              v-if="type == 6"
-            >
+            <Select clearable v-model="saveData.warning_state" v-if="type == 6">
               <Option
                 v-for="(item, index) in warning_state_list"
                 :key="index"
@@ -72,7 +80,11 @@
             <span v-else>{{ formData.warning_state }}</span>
           </FormItem>
           <FormItem label="项目定金:">
-            <Input v-if="type == 6" v-model="saveData.front_money" placeholder="请输入项目定金"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.front_money"
+              placeholder="请输入项目定金"
+            />
             <span v-else>{{ formData.front_money }}</span>
           </FormItem>
           <FormItem label="详细地址:">
@@ -155,7 +167,12 @@
             <span v-else>{{ formData.nickname }}</span>
           </FormItem>
           <FormItem label="备注:">
-            <Input v-if="type == 6" v-model="saveData.remark" type="textarea" placeholder="请输入备注"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.remark"
+              type="textarea"
+              placeholder="请输入备注"
+            />
             <span v-else>{{ formData.remark }}</span>
           </FormItem>
         </Form>
@@ -448,20 +465,20 @@
                 <template slot="setSlot" slot-scope="{ row }">
                   <a @click="handleGoPage(row)">详情</a>
                 </template>
-           <template slot="urlSet" slot-scope="{ index }">
-              <div
-                class="items"
-                v-show="totalData[index].url.length !== 0 ? true : false"
-              >
-                <img
-                  @click="looks(totalData[index].url)"
-                  v-for="(el, idx) in totalData[index].url"
-                  :key="idx"
-                  :src="$store.state.ip + el"
-                  alt=""
-                />
-              </div>
-        </template>
+                <template slot="urlSet" slot-scope="{ index }">
+                  <div
+                    class="items"
+                    v-show="totalData[index].url.length !== 0 ? true : false"
+                  >
+                    <img
+                      @click="looks(totalData[index].url)"
+                      v-for="(el, idx) in totalData[index].url"
+                      :key="idx"
+                      :src="$store.state.ip + el"
+                      alt=""
+                    />
+                  </div>
+                </template>
               </Table>
               <Page
                 :page-size-opts="[10, 20, 30, 40, 100, 1000]"
@@ -480,20 +497,20 @@
                 <template slot="setSlot" slot-scope="{ row }">
                   <a @click="handleGoPage(row)">详情</a>
                 </template>
-                 <template slot="urlSet" slot-scope="{ index }">
-              <div
-                class="items"
-                v-show="detailData[index].url.length !== 0 ? true : false"
-              >
-                <img
-                  @click="looks(detailData[index].url)"
-                  v-for="(el, idx) in detailData[index].url"
-                  :key="idx"
-                  :src="$store.state.ip + el"
-                  alt=""
-                />
-              </div>
-        </template>
+                <template slot="urlSet" slot-scope="{ index }">
+                  <div
+                    class="items"
+                    v-show="detailData[index].url.length !== 0 ? true : false"
+                  >
+                    <img
+                      @click="looks(detailData[index].url)"
+                      v-for="(el, idx) in detailData[index].url"
+                      :key="idx"
+                      :src="$store.state.ip + el"
+                      alt=""
+                    />
+                  </div>
+                </template>
               </Table>
               <Page
                 :page-size-opts="[10, 20, 30, 40, 100, 1000]"
@@ -541,10 +558,15 @@
 export default {
   data() {
     return {
-        ruleValidate: {
-                    name: [
-                        { required: true, message: 'The name cannot be empty', trigger: 'blur' }
-                    ]},
+      ruleValidate: {
+        name: [
+          {
+            required: true,
+            message: "The name cannot be empty",
+            trigger: "blur",
+          },
+        ],
+      },
       totalColumns: [
         { type: "selection", align: "center", width: 60 },
         { title: "序号", align: "center", type: "index", minWidth: 200 },
@@ -569,7 +591,13 @@ export default {
         { title: "材质", align: "center", key: "material", minWidth: 200 },
         { title: "颜色", align: "center", key: "color", minWidth: 200 },
         { title: "工艺", align: "center", key: "work", minWidth: 200 },
-        { title: "图纸", align: "center", key: "url", minWidth: 200 ,slot:"urlSet"},
+        {
+          title: "图纸",
+          align: "center",
+          key: "url",
+          minWidth: 200,
+          slot: "urlSet",
+        },
         {
           title: "左右式",
           align: "center",
@@ -646,7 +674,13 @@ export default {
         { title: "材质", align: "center", key: "material", minWidth: 200 },
         { title: "颜色", align: "center", key: "color", minWidth: 200 },
         { title: "工艺", align: "center", key: "work", minWidth: 200 },
-        { title: "图纸", align: "center", key: "url", minWidth: 200 ,slot:"urlSet"},
+        {
+          title: "图纸",
+          align: "center",
+          key: "url",
+          minWidth: 200,
+          slot: "urlSet",
+        },
         {
           title: "左右式",
           align: "center",
@@ -695,10 +729,10 @@ export default {
         custom_detail_mobile: "",
         custom_detail_id: "",
       },
-      formData:{},
-      custom_title_list:[],
-      warning_state_list:[],
-      nickname_list:[],
+      formData: {},
+      custom_title_list: [],
+      warning_state_list: [],
+      nickname_list: [],
       searchData: {
         area_code: [],
         area_title: [],
@@ -713,7 +747,7 @@ export default {
         url_number: [],
         product_title: [],
         material: "",
-        color: '',
+        color: "",
         work: "",
         state: "",
       },
@@ -749,16 +783,19 @@ export default {
       clientDetailList_address: [],
     };
   },
-  computed:{
-      uploadData(){
-        return {order_no:this.saveData.order_no||this.$route.query.order_no}
-      }
+  computed: {
+    uploadData() {
+      return { order_no: this.saveData.order_no || this.$route.query.order_no };
+    },
   },
   created() {
     if (this.$route.query.type == 3) {
       this.axios
         .get("/api/order_area_orders", {
-          params: { order_no: this.$route.query.order_no },
+          params: {
+            order_no: this.$route.query.order_no,
+            oa_id: this.$route.query.oa_id,
+          },
         })
         .then((res) => {
           this.formData = res.data;
@@ -779,7 +816,7 @@ export default {
     }
   },
   methods: {
-     looks(arr) {
+    looks(arr) {
       // const array = [{ img_url: img }];
       const array = arr.map((v) => {
         return { img_url: v };
@@ -791,9 +828,7 @@ export default {
         baseTitleField: "",
       });
     },
-    handleBeforeUpload(){
-
-    },
+    handleBeforeUpload() {},
     handleClientDetailChange(val) {
       val && (this.info.custom_detail_id = val);
     },
@@ -876,12 +911,12 @@ export default {
       this.getData(1);
     },
     getData(type) {
-      console.log('type :>> ', type);
       if (type === 1) {
         if (this.search_state) {
           this.axios
             .post("/api/order_area_details", {
               order_no: this.$route.query.order_no,
+              oa_id: this.$route.query.oa_id,
               page_index: this.page_index,
               page_size: this.page_size,
               ...this.searchData,
@@ -896,6 +931,7 @@ export default {
             this.axios
               .post("/api/order_area_details", {
                 order_no: this.$route.query.order_no || this.saveData.order_no,
+                oa_id: this.$route.query.oa_id,
                 page_index: this.page_index,
                 page_size: this.page_size,
               })
@@ -923,12 +959,13 @@ export default {
               });
         }
       } else if (type === 0) {
-        console.log('111 :>> ', 111);
+        console.log("111 :>> ", 111);
         this.axios
           .post("/api/order_area_details", {
-            type:1,
+            type: 1,
             order_no: this.$route.query.order_no || this.saveData.order_no,
             page_index: this.page_index,
+            oa_id: this.$route.query.oa_id,
             page_size: this.page_size,
             ...this.searchData,
           })
@@ -959,21 +996,22 @@ export default {
         this.axios
           .post("/api/order_area_details", {
             type: this.$route.query.type,
+            oa_id: this.$route.query.oa_id,
             order_no: this.$route.query.order_no || this.saveData.order_no,
             ...{ page_index: this.page_index, page_size: this.page_size },
             ...this.searchData,
           })
           .then((res) => {
-              console.log(res.msg.house_type,this.house_type)
-            
+            console.log(res.msg.house_type, this.house_type);
+
             this.totalData = res.data.data;
             this.total = res.data.total;
             this.area_code = res.data.area_code;
             this.area_title = res.data.area_title;
-            this.color = res.data.color ;
+            this.color = res.data.color;
             this.fashion = res.data.fashion;
             this.house = res.data.house;
-            this.house_type = res.data.house_type ;
+            this.house_type = res.data.house_type;
             this.layer = res.data.layer;
             this.material = res.data.material;
             this.number = res.data.number;
@@ -983,7 +1021,7 @@ export default {
             this.state = res.data.state;
             this.unit = res.data.unit;
             this.url_number = res.data.url_number;
-            this.work = res.data.work ;
+            this.work = res.data.work;
             this.copy_form = this.searchData;
           });
       }
@@ -992,7 +1030,6 @@ export default {
       this.$Message.error(err.msg || "导入失败");
     },
     uploadSuccess(res) {
-        
       if (res.code == 200) {
         this.$Message.success("导入成功");
         this.search_state = true;
@@ -1032,16 +1069,22 @@ export default {
       //     });
     },
     save() {
-        if(!this.saveData.order_no&&!this.saveData.residential_name&&!this.saveData.abbreviation&&!this.saveData.custom_title&&!this.saveData.warning_state){
-            this.$message.error('请填写必要信息!');
-        }else{ 
-            this.axios.post('/api/order_area_save',{...this.saveData}).then(res=>{
-           this.$message.success(res.msg)
-           this.save_state = true;
-      })
-
-        }
-     
+      if (
+        !this.saveData.order_no &&
+        !this.saveData.residential_name &&
+        !this.saveData.abbreviation &&
+        !this.saveData.custom_title &&
+        !this.saveData.warning_state
+      ) {
+        this.$message.error("请填写必要信息!");
+      } else {
+        this.axios
+          .post("/api/order_area_save", { ...this.saveData })
+          .then((res) => {
+            this.$message.success(res.msg);
+            this.save_state = true;
+          });
+      }
     },
     goback() {
       this.$router.go(-1);
@@ -1056,7 +1099,7 @@ export default {
   },
 };
 </script>
-<style scoped lang='scss'>
+<style scoped lang="scss">
 .changeDetail {
   .content {
     overflow: auto;
@@ -1075,23 +1118,23 @@ export default {
     }
   }
 }
-.ivu-form-item{
-    width: 250px;
+.ivu-form-item {
+  width: 250px;
 }
-.upload{
-    display: flex;
-    justify-content: space-around;
+.upload {
+  display: flex;
+  justify-content: space-around;
 }
- .items {
-    width: auto;
-    height: 40px;
-    margin-bottom: 10px;
+.items {
+  width: auto;
+  height: 40px;
+  margin-bottom: 10px;
   overflow: hidden;
-    border-radius: 5px;
-    position: relative;
-    img {
-      max-width: 40px;
-      max-height: 40px;
-    }
+  border-radius: 5px;
+  position: relative;
+  img {
+    max-width: 40px;
+    max-height: 40px;
   }
-</style>
+}
+</style>

+ 7 - 7
src/views/BidSystem/ProductDeOrder/list.vue

@@ -299,13 +299,13 @@ export default {
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {},
   methods: {
-    gopage(){
-          this.$router.push({
-            path: "/cms/BidSystem/ProductDeOrder/infodetail",
-            query: {
-              type:6
-            },
-          });
+    gopage() {
+      this.$router.push({
+        path: "/cms/BidSystem/ProductDeOrder/infodetail",
+        query: {
+          type: 6,
+        },
+      });
     },
     handleProcess() {
       this.process_control = true;

+ 332 - 227
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -458,8 +458,17 @@
               v-else
               v-for="(item, index) in tableData"
               :key="item.title + '' + index"
-              v-show="item.is_metal"
-              >{{ item.title }}:{{ item.num }}{{ item.unit }}
+              v-show="item.type == 1"
+              >{{
+                metalList.filter((v) => v.id == item.ext_id).length > 0
+                  ? metalList.filter((v) => v.id == item.ext_id)[0].title
+                  : ""
+              }}:{{ item.num
+              }}{{
+                metalList.filter((v) => v.id == item.ext_id).length > 0
+                  ? metalList.filter((v) => v.id == item.ext_id)[0].unit
+                  : ""
+              }}
               <span v-show="index < parts_title_count.length - 1">;</span>
             </span>
           </div>
@@ -530,13 +539,12 @@
               {{ scope.row.is_metal ? "" : scope.row.position }}
             </template>
           </vxe-column>
-          <vxe-column title="产品名称" min-width="150" :edit-render="{}">
+          <vxe-column title="产品名称/五金" min-width="150" :edit-render="{}">
             <template #edit="scope">
               <Select
                 filterable
                 clearable
                 transfer
-                filter-by-label
                 label-in-value
                 v-if="!scope.row.is_metal"
                 v-model="scope.row.product_id"
@@ -762,11 +770,11 @@
                   v-show="!part_detail.is_metal"
                 >
                   <div
-                    v-for="(sub_part_detail, idx) in part_detail.sub_part"
-                    :key="idx + 'sub_part'"
+                    v-for="(sub_part_detail, idx) in part_detail.part_detail"
+                    :key="idx + 'part_detail'"
                     v-show="sub_part_detail.title.indexOf('线条') > 0"
                     :style="
-                      idx != part_detail.sub_part.length - 1
+                      idx != part_detail.part_detail.length - 1
                         ? {
                             borderBottom: '1px solid #e8eaec',
                             padding: '10px 0',
@@ -793,11 +801,11 @@
                   v-show="!part_detail.is_metal"
                 >
                   <div
-                    v-for="(sub_part_detail, idx) in part_detail.sub_part"
-                    :key="idx + 'sub_part'"
+                    v-for="(sub_part_detail, idx) in part_detail.part_detail"
+                    :key="idx + 'part_detail'"
                     v-show="sub_part_detail.title.indexOf('线条') > 0"
                     :style="
-                      idx != part_detail.sub_part.length - 1
+                      idx != part_detail.part_detail.length - 1
                         ? {
                             borderBottom: '1px solid #e8eaec',
                             padding: '10px 0',
@@ -833,11 +841,11 @@
                   v-show="!part_detail.is_metal"
                 >
                   <div
-                    v-for="(sub_part_detail, idx) in part_detail.sub_part"
-                    :key="idx + 'sub_part'"
+                    v-for="(sub_part_detail, idx) in part_detail.part_detail"
+                    :key="idx + 'part_detail'"
                     v-show="sub_part_detail.title.indexOf('线条') > 0"
                     :style="
-                      idx != part_detail.sub_part.length - 1
+                      idx != part_detail.part_detail.length - 1
                         ? {
                             borderBottom: '1px solid #e8eaec',
                             padding: '10px 0',
@@ -858,11 +866,11 @@
                   v-show="!part_detail.is_metal"
                 >
                   <div
-                    v-for="(sub_part_detail, idx) in part_detail.sub_part"
-                    :key="idx + 'sub_part'"
+                    v-for="(sub_part_detail, idx) in part_detail.part_detail"
+                    :key="idx + 'part_detail'"
                     v-show="sub_part_detail.title.indexOf('线条') > 0"
                     :style="
-                      idx != part_detail.sub_part.length - 1
+                      idx != part_detail.part_detail.length - 1
                         ? {
                             borderBottom: '1px solid #e8eaec',
                             padding: '10px 0',
@@ -912,12 +920,16 @@
               />
               <Input
                 v-else
-                v-model="scope.row.price"
+                v-model="scope.row.single_price"
                 @on-change="(e) => handleMetailPriceChange(e, scope.row)"
               />
             </template>
             <template #default="scope">
-              {{ scope.row.is_metal ? scope.row.price : scope.row.unit_price }}
+              {{
+                scope.row.is_metal
+                  ? scope.row.single_price
+                  : scope.row.unit_price
+              }}
             </template>
           </vxe-column>
           <vxe-column title="附加项" min-width="150" :edit-render="{}">
@@ -934,6 +946,7 @@
                         }
                       : { padding: '10px 0' }
                   "
+                  v-show="ext_detail.type == 2"
                 >
                   <Select
                     filterable
@@ -964,44 +977,52 @@
               >
                 <span slot="content">
                   <div
-                    v-for="_item in scope.row.extArray"
+                    v-for="_item in scope.row.ext"
                     :key="_item.ext_id + 'ext'"
+                    v-show="_item.type == 2"
                   >
                     <div style="display:flex;justify-content: space-between;">
-                      <div style="width:120px">{{ _item.title }}</div>
+                      <div style="width:120px">
+                        {{
+                          extList.filter((v) => v.id == _item.ext_id).length > 0
+                            ? extList.filter((v) => v.id == _item.ext_id)[0]
+                                .title
+                            : ""
+                        }}
+                      </div>
                       <div style="width:80px">数量:{{ _item.num }}</div>
                       <div style="width:100px">单价:{{ _item.price }}</div>
                       <div style="width:120px">
-                        金额:{{ _item.total_price }}
+                        金额:{{ _item.num * 1 * _item.price }}
                       </div>
                       <div style="width:160px">备注:{{ _item.remark }}</div>
                     </div>
                   </div>
                 </span>
                 {{
-                  scope.row.ext
-                    .map((v) => {
-                      return v.title;
-                    })
-                    .join("/")
+                  scope.row.ext_list
+                    ? scope.row.ext_list
+                        .filter((v) => v.type == 2)
+                        .map((v) => v.title)
+                        .join("/")
+                    : scope.row.ext
+                        .filter((v) => v.type == 2)
+                        .map((v) => v.title)
+                        .join("/")
                 }}
               </Tooltip>
             </template>
           </vxe-column>
           <vxe-column title="附加金额" min-width="80">
             <template #default="scope"
-              >{{
-                scope.row.is_metal ? scope.row.total_price : scope.row.ext_price
-              }}
+              >{{ scope.row.is_metal ? scope.row.price : scope.row.ext_price }}
             </template>
           </vxe-column>
           <vxe-column field="over_price" title="超标金额" min-width="80">
           </vxe-column>
           <vxe-column title="总金额" min-width="80">
             <template #default="scope"
-              >{{
-                scope.row.is_metal ? scope.row.total_price : scope.row.price
-              }}
+              >{{ scope.row.is_metal ? scope.row.price : scope.row.price }}
             </template>
           </vxe-column>
           <vxe-column
@@ -1017,6 +1038,8 @@
                 v-if="!scope.row.is_metal"
                 transfer
                 v-model="scope.row.remark"
+                allow-create
+                @on-create="handleRemarkCreate"
                 @on-change="changeEditRemark(scope.row)"
               >
                 <Option
@@ -2492,9 +2515,6 @@ export default {
       let sendData = JSON.parse(JSON.stringify(this.info));
       // sendData.custom_detail_id = sendData.custom_id
       let sendList = JSON.parse(JSON.stringify(this.tableData));
-      sendList.map((item) => {
-        delete item.part;
-      });
       this.tableData.map((item, index) => {
         if (!item.is_metal) {
           item.part.map((it, idx) => {
@@ -2502,17 +2522,16 @@ export default {
               if (!sendList[index].part) {
                 sendList[index].part = [];
               }
-              sendList[index].part.push(it);
+              sendList[index].part[idx] = it;
             }
           });
-        } else {
-          item.type = 1;
-          this.sendList[0].part.extArray.push(item);
         }
       });
       // sendList= this.tableData.filter(item)
-      sendList.map((element) => {
-        if (element.is_metal) {
+      let tempMetalArr = [];
+
+      sendList.map((element, index) => {
+        if (!element.is_metal) {
           element.part.map((elem) => {
             if (!elem.is_metal) {
               // elem.part_detail = elem.sub_part;
@@ -2524,8 +2543,31 @@ export default {
               });
             }
           });
+          if (!element.measurement) {
+            element.measurement = "";
+          }
+          if (!element.measurement_no_letter) {
+            element.measurement_no_letter = "";
+          }
+          let tempStr = "";
+          let tempStr_no_letter = "";
+          element.measure.forEach((elem) => {
+            element[elem.e_title] = elem.value;
+            tempStr += elem.measureCalc + elem.value + "*";
+            tempStr_no_letter += elem.value + "*";
+          });
+          element.measurement = tempStr.substring(0, tempStr.length - 1);
+          element.measurement_no_letter = tempStr_no_letter.substring(
+            0,
+            tempStr_no_letter.length - 1
+          );
+        } else {
+          element.type = 1;
+          tempMetalArr.push(element);
+          sendList.splice(index, 1);
         }
       });
+      sendList[0].ext.push(...tempMetalArr);
       try {
         sendData.start_time = new Date(sendData.start_time)
           .toLocaleDateString()
@@ -2560,9 +2602,14 @@ export default {
             //表格编辑用数据
             element.num_temp_save = element.num;
             element.ext.map((v, k) => {
-              v.id = v.ext_id;
-              v = Object.assign(v, element.ext_list[k]);
-              v.total_price = v.num * v.price;
+              if (v.type == 2) {
+                v.id = v.ext_id;
+                v.total_price = v.num * v.price;
+              } else {
+                v.material_id = v.ext_id;
+                v.single_price = v.price;
+                v.price = v.num * v.single_price;
+              }
             });
             element.extArray = element.ext;
             element.type_name = element.title;
@@ -2654,6 +2701,16 @@ export default {
           this.originalData.forEach((element) => {
             element.total_price = (element.num * element.price).toFixed(2);
           });
+          console.log("this.tableData[0].ext :>> ", this.tableData[0].ext);
+          this.tableData[0].ext.map((v) => {
+            if (v.type === 1) {
+              v.is_metal = true;
+              v.material_id = v.ext_id;
+              console.log("v :>> ", v);
+              this.tableData.push(v);
+            }
+          });
+          console.log("this.tableData :>> ", this.tableData);
           this.handleCalcCount();
           //获取客户信息
           this.axios
@@ -2837,8 +2894,8 @@ export default {
       this.wood_title_count = [];
       let total_line_unit = "";
       this.tableData.forEach((element) => {
+        sum += element.price * 1;
         if (!element.is_metal) {
-          sum += element.price * 1;
           element.part.forEach((elem) => {
             if (!elem.is_metal) {
               // 统计部件
@@ -3280,12 +3337,14 @@ export default {
         });
       }
       // 拆分五金、附加信息
-      if (!curData.ext) {
-        curData.ext = curData.ext_list;
-      }
-      curData.ext.forEach((element) => {
-        element.type == 2 && modalData.extArray.push(element);
-      });
+      // if (!curData.ext) {
+      //   curData.ext = curData.ext_list;
+      // }
+      curData.ext &&
+        curData.ext.length > 0 &&
+        curData.ext.forEach((element) => {
+          element.type == 2 && modalData.extArray.push(element);
+        });
       modalData.extArray.forEach((element) => {
         element.id = element.ext_id;
         element.total_price = (element.price * element.num).toFixed(2);
@@ -3381,6 +3440,7 @@ export default {
         route_id_at_copy,
         then: (subAddProductData) => {
           console.log("subAddProductData :>> ", subAddProductData);
+          this.support_remark = subAddProductData[0].support_remark;
           this.modalArray = subAddProductData;
           this.modalArray.map((element) => {
             // 工艺属性
@@ -3497,41 +3557,48 @@ export default {
       });
     },
     handleTableAdd() {
-      let obj = {
-        position: "", //位置
-        over_price: "", //超标单价
-        unit_price: "", //单价
-        ext_price: "", //附加金额
-        price: "", //总金额
-        remark: "", //备注
-        measurement: "", //测量字段拼接
-        total_num: "", //数量
-        num: "", //核算数量
-        num_formula: "", //核算数量公式
-        url_number: "", //图号
-        url: [], //图纸
-        unit: "", //单位
-        title: "", //产品名
-        process: "", //工艺属性拼接
-        procedure_properties: {}, //工艺属性对象
-        overdraft: [], //超标公式
-        measure: this._measure, //测量字段数组
-        support_remark: this.support_remark, //备注列表
-        ext: [],
-        process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
-      };
-      this.process_obj.map(
-        (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
-      );
-      this.tableData.push(obj);
+      if (this.info.custom_id) {
+        this.currentTabIndex = "0";
+        let obj = {
+          position: "", //位置
+          over_price: "", //超标单价
+          unit_price: "", //单价
+          ext_price: "", //附加金额
+          price: "", //总金额
+          remark: "", //备注
+          measurement: "", //测量字段拼接
+          total_num: "", //数量
+          num: "", //核算数量
+          num_formula: "", //核算数量公式
+          url_number: "", //图号
+          url: [], //图纸
+          unit: "", //单位
+          title: "", //产品名
+          process: "", //工艺属性拼接
+          procedure_properties: {}, //工艺属性对象
+          overdraft: [], //超标公式
+          measure: this._measure, //测量字段数组
+          support_remark: this.support_remark, //备注列表
+          ext: [],
+          extArray: [],
+          process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
+        };
+        obj.process_obj.map(
+          (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
+        );
+        this.tableData.push(obj);
+      } else {
+        this.$Message.warning("请先选择客户");
+      }
     },
     handleMetalAdd() {
       this.tableData.push({
+        type: 1,
         is_metal: true,
         material_id: "",
         title: "",
-        total_price: 0,
         price: 0,
+        single_price: 0,
         num: 0,
         unit: "",
       });
@@ -3558,12 +3625,10 @@ export default {
           this.title_state = 2;
           this.isCheck = false;
           if (this.type == 1) {
-            console.log("1 :>> ", 1);
             this.showEditProduct = true;
             this.modalData = JSON.parse(JSON.stringify(row));
             this.currencyIndex = index;
           } else if (this.type == 2) {
-            console.log("2 :>> ", 2);
             //订单编辑点产品编辑
             if (row.get_first_data && !row.isEdit) {
               this.axios
@@ -3579,7 +3644,6 @@ export default {
                   }
                 });
             } else {
-              console.log("3 :>> ", 3);
               // 订单新增点产品编辑
               if (row.isEdit) {
                 row.measure.map((v) => {
@@ -3598,8 +3662,20 @@ export default {
           }
           break;
         case 3:
-          this.tableData.splice(index, 1);
-          this.handleCalcCount();
+          if (!row.is_metal) {
+            this.$Modal.confirm({
+              title: "确认删除?",
+              content: "请确认!",
+              onOk: () => {
+                this.tableData.splice(index, 1);
+                this.handleCalcCount();
+              },
+              onCancel: () => {},
+            });
+          } else {
+            this.tableData.splice(index, 1);
+            this.handleCalcCount();
+          }
           break;
         case 4:
           obj = JSON.parse(JSON.stringify(row));
@@ -3783,6 +3859,7 @@ export default {
         if (!item.is_metal) {
           //赋值默认工艺属性
           item.process = JSON.parse(JSON.stringify(this.bpp_list));
+          item.procedure_properties[obj.id] = row[obj.id];
           item.process.forEach((elem, index) => {
             elem.value = row.process_obj.filter(
               (v) => v.id == elem.id
@@ -3793,6 +3870,11 @@ export default {
     },
     changeEditMeasure(e, row, measure) {
       row.isEdit = true;
+      row.measure.map((v) => {
+        if (v.e_title == measure.e_title) {
+          v.value = e.target.value;
+        }
+      });
       this.handleProductMeasureChange(
         e,
         row,
@@ -3803,15 +3885,16 @@ export default {
       row.isEdit = true;
     },
     changeEditMetal(row, rowIndex, $event, scope) {
+      row.ext_id = $event.value;
       row.title = this.metalList.filter((v) => v.id == $event.value)[0].title;
       row.unit = this.metalList.filter((v) => v.id == $event.value)[0].unit;
     },
     changeEditMetalNum(e, row) {
-      row.total_price = 1 * e.target.value * row.price;
+      row.price = 1 * e.target.value * row.single_price;
       this.handleCalcCount();
     },
     handleMetailPriceChange(e, row) {
-      row.total_price = 1 * e.target.value * row.num;
+      row.price = 1 * e.target.value * row.num;
       this.handleCalcCount();
     },
     changeEditTotalNum(e, row) {
@@ -3831,9 +3914,11 @@ export default {
       }
     },
     changeEditPart(row, part_type, part_detail, e) {
-      row.isEdit = true;
-      part_detail.change_id = e.value;
-      this.handlePartChange(e, part_detail, row.measure, row.total_num);
+      if (e) {
+        row.isEdit = true;
+        part_detail.change_id = e.value;
+        this.handlePartChange(e, part_detail, row.measure, row.total_num);
+      }
     },
     changeEditTableData(row, rowIndex, $event, scope) {
       if ($event) {
@@ -3849,6 +3934,7 @@ export default {
           this.process_all_list = res.data.process_list;
           this.support_remark = res.data.support_remark;
           this.bpp_list.map((v) => (row[v.id] = ""));
+          this.measure_total.map((v) => (row[v.e_title] = ""));
           row.url = res.data.url;
           row.total_num = res.data.total_num || 1;
           row.ext_price = res.data.ext_price || 0;
@@ -3895,46 +3981,47 @@ export default {
               });
               if (element.is_null == 1) {
                 element.change_id = "";
+                element.part_title = "";
+                element.title = "";
               } else {
-                element.part_detail = element.sub_part;
-                //展示非拆分部件
-                // 默认替换部件
                 element.change_id = element.change[0].id;
-                //存计算公式
-                element.long ? "" : (element.long = 0);
-                element.wide ? "" : (element.wide = 0);
-                element.high ? "" : (element.high = 0);
-                element.longCalc = element.long + "";
-                element.wideCalc = element.wide + "";
-                element.highCalc = element.high + "";
-                element.part_detail.forEach((elem) => {
-                  elem.material_detail_title =
-                    elem.material_detail_list[0].title;
-                  elem.material_detail_id =
-                    elem.material_detail_list[0].material_detail_id;
-                  elem.part_detail_option = [];
-                  elem.material_detail_list.map((v) => {
-                    elem.part_detail_option.push({
-                      label: `${v.long}*${v.wide}*${v.high}`,
-                      value: v.material_detail_id,
-                    });
-                  });
-                  elem.org_num = elem.num;
-                  elem.material_detail_org_num = elem.num || 0;
-                  elem.material_detail_num = elem.num || 0;
-                  elem.long ? "" : (elem.long = 0);
-                  elem.wide ? "" : (elem.wide = 0);
-                  elem.high ? "" : (elem.high = 0);
-                  elem.longCalc = elem.long + "";
-                  elem.wideCalc = elem.wide + "";
-                  elem.highCalc = elem.high + "";
-                  elem.material_detail_list.forEach((el) => {
-                    el.long = el.long || "0";
-                    el.wide = el.wide || "0";
-                    el.high = el.high || "0";
+              }
+              element.part_detail = element.sub_part;
+              //展示非拆分部件
+              // 默认替换部件
+              //存计算公式
+              element.long ? "" : (element.long = 0);
+              element.wide ? "" : (element.wide = 0);
+              element.high ? "" : (element.high = 0);
+              element.longCalc = element.long + "";
+              element.wideCalc = element.wide + "";
+              element.highCalc = element.high + "";
+              element.part_detail.forEach((elem) => {
+                elem.material_detail_title = elem.material_detail_list[0].title;
+                elem.material_detail_id =
+                  elem.material_detail_list[0].material_detail_id;
+                elem.part_detail_option = [];
+                elem.material_detail_list.map((v) => {
+                  elem.part_detail_option.push({
+                    label: `${v.long}*${v.wide}*${v.high}`,
+                    value: v.material_detail_id,
                   });
                 });
-              }
+                elem.org_num = elem.num;
+                elem.material_detail_org_num = elem.num || 0;
+                elem.material_detail_num = elem.num || 0;
+                elem.long ? "" : (elem.long = 0);
+                elem.wide ? "" : (elem.wide = 0);
+                elem.high ? "" : (elem.high = 0);
+                elem.longCalc = elem.long + "";
+                elem.wideCalc = elem.wide + "";
+                elem.highCalc = elem.high + "";
+                elem.material_detail_list.forEach((el) => {
+                  el.long = el.long || "0";
+                  el.wide = el.wide || "0";
+                  el.high = el.high || "0";
+                });
+              });
             }
           });
           row.part = JSON.parse(JSON.stringify(res.data.part));
@@ -3946,7 +4033,7 @@ export default {
           });
           this.tableData.splice(rowIndex, 1, row);
           row.get_first_data = false;
-          this.$forceUpdate();
+          // this.$forceUpdate();
         });
       }
       // row.part=[]
@@ -4019,6 +4106,7 @@ export default {
                 // 选择不是线条、或者基础档案中要默认为空的部件
                 element.isBP = true;
                 element.isChoosed = true;
+
                 if (element.is_null == 1) {
                   element.change_id = "";
                 } else {
@@ -4054,6 +4142,17 @@ export default {
                       el.high = el.high || "0";
                     });
                   });
+                  element.part_detail.map((_part_detail) => {
+                    _part_detail.material_detail_org_num =
+                      _part_detail.num || 0;
+                    _part_detail.part_detail_option = [];
+                    _part_detail.material_detail_list.map((v) => {
+                      _part_detail.part_detail_option.push({
+                        label: `${v.long}*${v.wide}*${v.high}`,
+                        value: v.material_detail_id,
+                      });
+                    });
+                  });
                 }
               }
             });
@@ -4113,16 +4212,14 @@ export default {
           if (column.title == "附加金额") {
             let sum = 0;
             data.map((v) => {
-              v.is_metal
-                ? (sum += v.total_price * 1)
-                : (sum += v.ext_price * 1);
+              v.is_metal ? (sum += v.price * 1) : (sum += v.ext_price * 1);
             });
             return sum;
           }
           if (column.title == "总金额") {
             let sum = 0;
             data.map((v) => {
-              v.is_metal ? (sum += v.total_price * 1) : (sum += v.price * 1);
+              v.is_metal ? (sum += v.price * 1) : (sum += v.price * 1);
             });
             return sum;
           }
@@ -4272,6 +4369,16 @@ export default {
             ((elem.material_detail_org_num || elem.num) * product_num) | 0;
           elem.material_detail_num = elem.material_detail_org_num * product_num;
         });
+        row.part_detail.map((_part_detail) => {
+          _part_detail.material_detail_org_num = _part_detail.num || 0;
+          _part_detail.part_detail_option = [];
+          _part_detail.material_detail_list.map((v) => {
+            _part_detail.part_detail_option.push({
+              label: `${v.long}*${v.wide}*${v.high}`,
+              value: v.material_detail_id,
+            });
+          });
+        });
         measure.forEach((element) => {
           if ((row.long + "").indexOf(element.measureCalc) != -1) {
             if (typeof (element.value * 1) == "number") {
@@ -4523,128 +4630,126 @@ export default {
         //当前测量字段 L W H  修改部件测量字段
         product.part.forEach((element) => {
           if (!element.is_metal) {
-            if (!element.is_null == 1) {
-              element.highCalc = element.highCalc + "";
-              element.longCalc = element.longCalc + "";
-              element.wideCalc = element.wideCalc + "";
-              //处理公式
-              if (element.highCalc.indexOf(cur_measure) != -1) {
-                element.high = element.highCalc.replace(
+            element.highCalc = element.highCalc + "";
+            element.longCalc = element.longCalc + "";
+            element.wideCalc = element.wideCalc + "";
+            //处理公式
+            if (element.highCalc.indexOf(cur_measure) != -1) {
+              element.high = element.highCalc.replace(
+                new RegExp(cur_measure, "g"),
+                cur_value || ""
+              );
+            }
+            if (element.longCalc.indexOf(cur_measure) != -1) {
+              element.long = element.longCalc.replace(
+                new RegExp(cur_measure, "g"),
+                cur_value || ""
+              );
+            }
+            if (element.wideCalc.indexOf(cur_measure) != -1) {
+              element.wide = element.wideCalc.replace(
+                new RegExp(cur_measure, "g"),
+                cur_value || ""
+              );
+            }
+            //判断测量字段公式中是否还含有字母
+            let flag_high = false;
+            let flag_long = false;
+            let flag_wide = false;
+            for (let index = 0; index < product.measure.length; index++) {
+              const item = product.measure[index];
+              if (element.high.indexOf(item.measureCalc) != -1) {
+                flag_high = true;
+              }
+              if (element.long.indexOf(item.measureCalc) != -1) {
+                flag_long = true;
+              }
+              if (element.wide.indexOf(item.measureCalc) != -1) {
+                flag_wide = true;
+              }
+            }
+            if (flag_high) {
+            } else {
+              element.high = eval(element.high);
+              element.high += "";
+            }
+            if (flag_long) {
+            } else {
+              element.long = eval(element.long);
+              element.long += "";
+            }
+            if (flag_wide) {
+            } else {
+              element.wide = eval(element.wide);
+              element.wide += "";
+            }
+            element.part_detail.forEach((elem) => {
+              elem.highCalc = elem.high + "";
+              elem.longCalc = elem.long + "";
+              elem.wideCalc = elem.wide + "";
+              if (!elem.high) {
+              } else if (elem.highCalc.indexOf(cur_measure) != -1) {
+                elem.high = elem.highCalc.replace(
                   new RegExp(cur_measure, "g"),
                   cur_value || ""
                 );
               }
-              if (element.longCalc.indexOf(cur_measure) != -1) {
-                element.long = element.longCalc.replace(
+              if (!elem.long) {
+              } else if (elem.longCalc.indexOf(cur_measure) != -1) {
+                elem.long = elem.longCalc.replace(
                   new RegExp(cur_measure, "g"),
                   cur_value || ""
                 );
               }
-              if (element.wideCalc.indexOf(cur_measure) != -1) {
-                element.wide = element.wideCalc.replace(
+              if (!elem.wide) {
+              } else if (elem.wideCalc.indexOf(cur_measure) != -1) {
+                elem.wide = elem.wideCalc.replace(
                   new RegExp(cur_measure, "g"),
                   cur_value || ""
                 );
               }
               //判断测量字段公式中是否还含有字母
-              let flag_high = false;
-              let flag_long = false;
-              let flag_wide = false;
+              let _flag_high = false;
+              let _flag_long = false;
+              let _flag_wide = false;
+              // Number类型无法使用indexOf
+              elem.high += "";
+              elem.long += "";
+              elem.wide += "";
               for (let index = 0; index < product.measure.length; index++) {
                 const item = product.measure[index];
-                if (element.high.indexOf(item.measureCalc) != -1) {
-                  flag_high = true;
+                if (!elem.high) {
+                } else if (elem.high.indexOf(item.measureCalc) != -1) {
+                  _flag_high = true;
                 }
-                if (element.long.indexOf(item.measureCalc) != -1) {
-                  flag_long = true;
+                if (!elem.long) {
+                } else if (elem.long.indexOf(item.measureCalc) != -1) {
+                  _flag_long = true;
                 }
-                if (element.wide.indexOf(item.measureCalc) != -1) {
-                  flag_wide = true;
+                if (!elem.wide) {
+                } else if (elem.wide.indexOf(item.measureCalc) != -1) {
+                  _flag_wide = true;
                 }
               }
-              if (flag_high) {
+              if (_flag_high) {
               } else {
-                element.high = eval(element.high);
-                element.high += "";
+                elem.high = eval(elem.high);
+                elem.high += "";
+                elem.high == "null" && (elem.high = 0);
               }
-              if (flag_long) {
+              if (_flag_long) {
               } else {
-                element.long = eval(element.long);
-                element.long += "";
+                elem.long = eval(elem.long);
+                elem.long += "";
+                elem.long == "null" && (elem.long = 0);
               }
-              if (flag_wide) {
+              if (_flag_wide) {
               } else {
-                element.wide = eval(element.wide);
-                element.wide += "";
-              }
-              element.part_detail.forEach((elem) => {
-                elem.highCalc = elem.high + "";
-                elem.longCalc = elem.long + "";
-                elem.wideCalc = elem.wide + "";
-                if (!elem.high) {
-                } else if (elem.highCalc.indexOf(cur_measure) != -1) {
-                  elem.high = elem.highCalc.replace(
-                    new RegExp(cur_measure, "g"),
-                    cur_value || ""
-                  );
-                }
-                if (!elem.long) {
-                } else if (elem.longCalc.indexOf(cur_measure) != -1) {
-                  elem.long = elem.longCalc.replace(
-                    new RegExp(cur_measure, "g"),
-                    cur_value || ""
-                  );
-                }
-                if (!elem.wide) {
-                } else if (elem.wideCalc.indexOf(cur_measure) != -1) {
-                  elem.wide = elem.wideCalc.replace(
-                    new RegExp(cur_measure, "g"),
-                    cur_value || ""
-                  );
-                }
-                //判断测量字段公式中是否还含有字母
-                let _flag_high = false;
-                let _flag_long = false;
-                let _flag_wide = false;
-                // Number类型无法使用indexOf
-                elem.high += "";
-                elem.long += "";
+                elem.wide = eval(elem.wide);
                 elem.wide += "";
-                for (let index = 0; index < product.measure.length; index++) {
-                  const item = product.measure[index];
-                  if (!elem.high) {
-                  } else if (elem.high.indexOf(item.measureCalc) != -1) {
-                    _flag_high = true;
-                  }
-                  if (!elem.long) {
-                  } else if (elem.long.indexOf(item.measureCalc) != -1) {
-                    _flag_long = true;
-                  }
-                  if (!elem.wide) {
-                  } else if (elem.wide.indexOf(item.measureCalc) != -1) {
-                    _flag_wide = true;
-                  }
-                }
-                if (_flag_high) {
-                } else {
-                  elem.high = eval(elem.high);
-                  elem.high += "";
-                  elem.high == "null" && (elem.high = 0);
-                }
-                if (_flag_long) {
-                } else {
-                  elem.long = eval(elem.long);
-                  elem.long += "";
-                  elem.long == "null" && (elem.long = 0);
-                }
-                if (_flag_wide) {
-                } else {
-                  elem.wide = eval(elem.wide);
-                  elem.wide += "";
-                  elem.wide == "null" && (elem.wide = 0);
-                }
-              });
-            }
+                elem.wide == "null" && (elem.wide = 0);
+              }
+            });
           }
         });
         product.part.map((item) => {