Andy 3 лет назад
Родитель
Сommit
63ab462b94

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

@@ -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;
@@ -1313,6 +1314,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(

+ 3 - 3
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"
@@ -2909,7 +2909,7 @@ export default {
       this.productSpecValueList.length > 0 &&
         this.productSpecValueList.forEach((element) => {
           arr.push({
-            title: element.key,
+            title: element.value||element.key,
             key: element.key,
             align: "center",
             minWidth: 80,

+ 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"

+ 100 - 103
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -897,9 +897,7 @@
               />
             </template>
             <template #default="scope">
-              {{
-                scope.row.is_metal ? scope.row.total_num : scope.row.total_num
-              }}
+              {{ scope.row.is_metal ? scope.row.num : scope.row.total_num }}
             </template>
           </vxe-column>
           <vxe-column field="unit" title="单位" min-width="70"> </vxe-column>
@@ -2846,8 +2844,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) {
               // 统计部件
@@ -3390,6 +3388,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) => {
             // 工艺属性
@@ -3545,9 +3544,9 @@ export default {
         is_metal: true,
         material_id: "",
         title: "",
-        total_price: 0,
+        price: 0,
         single_price: 0,
-        total_num: 0,
+        num: 0,
         unit: "",
       });
     },
@@ -4574,128 +4573,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) => {