mushencc 3 lat temu
rodzic
commit
fd1070eae3

+ 160 - 74
src/views/OrderMannage/BusinessOrderlist/confirmNew.vue

@@ -696,7 +696,8 @@
               {{ row.is_metal ? "" : row[measure.e_title] }}</template
             >
           </vxe-column>
-          <vxe-column
+               <!-- 线条门套门扇 -->
+            <vxe-column
             v-for="part_type in part_type_total"
             :key="part_type.id + '999'"
             :title="part_type.title"
@@ -710,8 +711,8 @@
                   :key="part_index"
                   v-show="part_detail.type_id == part_type.id"
                   :style="
-                    part_index != scope.row.part.filter(v=>{return v.type_id == part_type.id}).length - 1 &&
-                    scope.row.part.filter(v=>{return v.type_id == part_type.id}).length > 1
+                    scope.row.part.filter(v=>{return v.type_id == part_type.id}).length > 1 &&
+                  part_detail.part_id!=scope.row.part.filter(v=>(v.type_id==part_type.id))[scope.row.part.filter(v=>(v.type_id==part_type.id)).length-1].part_id
                       ? {
                           borderBottom: '1px solid #e8eaec',
                           padding: '10px 0',
@@ -722,7 +723,7 @@
                   <Select
                     clearable
                     transfer
-                    filter
+                    filterable
                     filter-by-label
                     label-in-value
                     v-model="part_detail.change_id"
@@ -754,8 +755,8 @@
                   :key="part_index"
                   v-show="part_detail.type_id == part_type.id"
                   :style="
-                    part_index != scope.row.part.filter(v=>{return v.type_id == part_type.id}).length - 1 &&
-                    scope.row.part.filter(v=>{return v.type_id == part_type.id}).length > 1
+                   scope.row.part.filter(v=>{return v.type_id == part_type.id}).length > 1 &&
+                  part_detail.part_id!=scope.row.part.filter(v=>(v.type_id==part_type.id))[scope.row.part.filter(v=>(v.type_id==part_type.id)).length-1].part_id
                       ? {
                           borderBottom: '1px solid #e8eaec',
                           padding: '10px 0',
@@ -809,15 +810,16 @@
           >
             <template #edit="scope">
               <Input
-                v-if="!scope.row.is_metal"
+               
                 v-model="scope.row.total_num"
                 @on-change="(e) => changeEditTotalNum(e, scope.row)"
               />
-              <Input
+               <!-- v-if="!scope.row.is_metal" -->
+              <!-- <Input
                 v-else
                 v-model="scope.row.num"
                 @on-change="(e) => changeEditMetalNum(e, scope.row)"
-              />
+              /> -->
             </template>
             <template #default="scope">
               {{ scope.row.is_metal ? scope.row.num : scope.row.total_num }}
@@ -1316,7 +1318,6 @@
       <div label="线条:" style="margin-left:20px;width:95%">
         <div style="font-size:20px">
           <span>线条:</span>
-          <!-- <span>{{ print_line_data === "" ? "无" : print_line_data }}</span> -->
           <span v-if="wood_title_count.length < 1">无</span>
           <span
             v-else
@@ -1535,7 +1536,7 @@
                     <Input
                       size="small"
                       v-model="modalData.num"
-                      :disabled='!modalData.addMTB'
+                      :disabled='!modalData.surePrice'
                       @on-change='handleModalTotalPrice'
                       style="width: 120px"
                       placeholder="自动带出"
@@ -2575,7 +2576,6 @@ export default {
       timeout: null,
       copiedLinePart: {},
       mentoubanList: [],
-      print_line_data: "",
       MTBList: [],
     };
   },
@@ -2683,9 +2683,6 @@ export default {
       this.initData(this.order_no);
     }
     this.getProducts();
-    if (this.$route.query.type != 1) {
-      this.print_line();
-    }
     addEventListener("resize", (e) => {
       this.tableWidth = e.target.innerWidth - 300;
       this.$forceUpdate();
@@ -2736,12 +2733,15 @@ export default {
      }
     },
     changeNum(row,index,arr){
+       let sum = 0;
+      arr.extArray.map((v) => {
+        return (sum += v.total_price * 1);
+      });
       if(row.MTBnum&&row.MTBsize&&row.MTBprice){
-
         row.MTBtotal = (row.MTBnum*1*row.MTBsize*row.MTBprice).toFixed(2)
         arr.part[index].MTBtotal = (row.MTBnum*1*row.MTBsize*row.MTBprice).toFixed(2)
-        this.MTBtotal = arr.part[index].MTBtotal*1
-        arr.ext_price = this.ext_sum*1 + this.MTBtotal*1; 
+        this.MTBtotal = arr.part[index].MTBtotal*1;
+        arr.ext_price = sum*1 + this.MTBtotal*1; 
         arr.price =
         (arr.unit_price * 1 || 0) * (arr.num * 1 || 1) +
         (arr.over_price_total * 1 || 0) +
@@ -2749,7 +2749,15 @@ export default {
       arr.price = arr.price.toFixed(2);
         this.$forceUpdate();
       }else{
-       return 
+            row.MTBtotal = '';
+            this.MTBtotal = 0;
+            arr.ext_price = sum*1;
+            arr.price =
+        (arr.unit_price * 1 || 0) * (arr.num * 1 || 1) +
+        (arr.over_price_total * 1 || 0) +
+        (arr.ext_price * 1 || 0);
+      arr.price = arr.price.toFixed(2);
+        this.$forceUpdate();
       }
      
     },
@@ -2786,18 +2794,6 @@ export default {
         }
       });
     },
-    print_line() {
-      this.axios({
-        method: "get",
-        url: "/api/printe_order_detail",
-        params: {
-          order_no: this.$route.query.order_no,
-          box_id: "",
-        },
-      }).then((res) => {
-        this.print_line_data = res.msg.foot.amount_detail;
-      });
-    },
     handleFaxPriceChange(e) {
       this.info.fax_price = e.target.value;
       this.info.order_price = (
@@ -3021,9 +3017,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;
-                }
+                // if (elem.title.indexOf("门头板") != -1) {
+                //   elem.addMTB = true;
+                // }
                 // 表格数据展示字段
                 elem.isBP = true;
                 elem.process_str = elem.process;
@@ -4181,25 +4177,49 @@ export default {
           if (row.is_metal) {
          
           } else {
+            obj.addMTB = false;
             obj.position = "";
             obj.measure.map((v) => {
               v.value = "";
               obj[v.e_title] = "";
             });
+            // console.log(row.process_obj)
+            // console.log(row);
+            let arr =  row.process_obj.filter(v=>(v.name!=='颜色'))
+            let process =JSON.parse(JSON.stringify(obj.process)).split('/');
+           arr.forEach(v=>{
+             obj[v.id] = '';
+             obj.procedure_properties[v.id]='';
+           })
+         for(let key in obj.procedure_properties){
+            if(!obj.procedure_properties[key]){
+              process[Number(key)-1]='';
+            }
+         }
+         obj.process = process.join('/').toString();
+         obj.process_str = obj.process;
+         console.log(obj);
             if (!row.is_metal) {
               this.route_id_at_copy = row.route_id;
             }
+            
             this.pre_process_obj = JSON.parse(
-              JSON.stringify(row.procedure_properties)
+              JSON.stringify(obj.procedure_properties)
             );
           }
           //复制一条数据,更换了产品之后,
           //线条的内容要保留(不管更换的这个产品的默认线条是什么,都是只展示复制下来的)
           //摘自Tower #2004
           obj.part &&
-            obj.part.map((v) => {
-              if (v.title.indexOf("线条") != -1) {
+            obj.part.map((v,idx) => {
+              if (v.title.indexOf("线条") != -1||(v.part_title?v.part_title.indexOf("线条") != -1:false)) {
                 this.copiedLinePart = this.deepClone(v);
+              }else{
+                if(v.addMTB){
+                    obj.part.splice(idx,1);
+                }
+                v.change_id ='';
+
               }
             });
           //因为是复制,插件id为_XID会相同导致bug,置空后会自动生成
@@ -4279,6 +4299,7 @@ export default {
       }
     },
     handleExtChange(row, e, item) {
+      //item 就是tableData那一行的数据 row附加项那一行那个的数据 e选择的值;
  if(e){
      row.ext_id = e.value;
       row.title = e.label;
@@ -4457,7 +4478,7 @@ export default {
       this.handleCalcCount();
     },
     changeEditMeasure(e, row, measure) {
-     
+     console.log(row);
       if (e.target.value) {
         row.isEdit = true;
         row.measure.map((v) => {
@@ -4465,13 +4486,13 @@ export default {
             v.value = e.target.value;
           }
         });
-        if(this.measure_total.every((v)=>(row[v.e_title]))){
+        // if(this.measure_total.every((v)=>(row[v.e_title]))){
              this.handleProductMeasureBlur(
           e,
           row,
           row.measure.filter((v) => v.id == measure.id)[0]
         );
-        }
+        // }
      
       }
     },
@@ -4490,6 +4511,7 @@ export default {
       this.handleCalcCount();
     },
     handleMetailPriceChange(e, row) {
+      row.isEdit = true;
       row.price = 1 * e.target.value * row.num;
       this.handleCalcCount();
     },
@@ -4503,7 +4525,9 @@ export default {
       this.handleCalcCount();
     },
     changeEditExt(row, e, item,arr,idx) {
-      if (e) {
+      //e 是选择的附加项 row是附加项里的每一条数据 item是table那一行的数据 arr是附加项所有的数据 idx是附加项改动的当前行
+      this.$nextTick(()=>{
+         if (e) {
         item.isEdit = true;
         row.ext_id = e.value;
         this.handleExtChange(row, e, item);
@@ -4519,6 +4543,8 @@ export default {
                        item
                       )
       }
+      })
+     
     },
     changeEditPart(row, part_type, part_detail, e, rowIndex) {
       if (e) {
@@ -4602,13 +4628,17 @@ export default {
             unit: "",
           };
         }
-        this.tableData.splice(rowIndex, 1, obj);
+        this.$nextTick(()=>{
+          this.tableData.splice(rowIndex, 1, obj);
+        })
+        
         // this.handleTableAdd();
         if (arr[1] === "1") {
           this.changeEditTableData(obj, rowIndex, $event, scope);
         } else {
           this.changeEditMetal(obj, rowIndex, $event, scope);
         }
+        console.log(row)
         this.HandleAutoCreateNewLine();
       }
     },
@@ -4656,7 +4686,7 @@ export default {
             (row.ext_price * 1 || 0);
           row.price = row.price.toFixed(2);
           row.selected_ids = [];
-          res.data.part.forEach((element) => {
+          res.data.part.forEach((element,eleIndex) => {
             // 选择不是附加项目的,
             if (!element.is_metal) {
               // 选择不是线条、或者基础档案中要默认为空的部件
@@ -4701,12 +4731,20 @@ export default {
                 }
                 element.change_id = element.change[0].id;
               }
-              if (isCopied && element.title.indexOf("线条") != -1) {
+              if(isCopied&&this.tableData[rowIndex-1].part.filter(v=>(v.title.indexOf('线条')!=-1)).length==res.data.part.filter(c=>(c.part_title.indexOf('线条')!=-1)).length&&this.bpp_list.filter(v=>(v.name=='颜色'))[0].cld.filter(e=>(e.id==row.procedure_properties[2])).length!=0){
+                
+                 if (element.title.indexOf("线条") != -1) {
+                   if(res.data.part[eleIndex].change.filter(x=>(x.id==element.change_id)).length!=0){
+                      element = Object.assign(element, this.copiedLinePart);
+                   }
                 //2020.3.15 有线条的产品线条需要保留
                 // delete this.copiedLinePart.change;
                 // delete this.copiedLinePart.change_id;
-                element = Object.assign(element, this.copiedLinePart);
+                
+               
               }
+              }
+             
               element.part_detail = element.sub_part;
               //展示非拆分部件
               // 默认替换部件
@@ -4752,7 +4790,7 @@ export default {
             element.value = "";
             element.measureCalc = element.e_title;
           });
-          res.data.title.indexOf('门头板')!=-1&&this.handleMTBClick(row);
+          res.data.title.indexOf('门头板')!=-1&&(row.surePrice=true);
           this.tableData.splice(rowIndex, 1, row);
           this.handleClearExtInfo(row, this.pre_bp_id, res.data.bp_id);
           row.get_first_data = false;
@@ -5093,6 +5131,7 @@ export default {
               part.part_title = res.data.part_title;
               // part.process = res.data.process;
             }
+            console.log(this.modalData.part)
           });
         });
     },
@@ -5247,13 +5286,24 @@ export default {
         });
       });
       product.total_num = e.target.value;
-      product.num = (product.total_num*1*product.num_temp_save*1).toFixed(2);
+      console.log(product)
+      if(product.num_temp_save&&product.measure.every(v=>(product[v.e_title||v.measureCalc]!=''))){
+        product.num = (product.total_num*1*product.num_temp_save*1);
+        if(product.num>=0.01){
+          product.num = product.num.toFixed(2)
+        }else{
+          product.num = product.num.toFixed(4);
+        }
+      }else{
+       return this.$Message.warning('请先确定测量字段!')
+      }
       product.over_price_total = (product.total_num*1*product.over_price).toFixed(2);
       product.price =
-        (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
+        (product.unit_price * 1 || 0) * (product.num * 1||1) +
         (product.over_price_total * 1 || 0) +
         (product.ext_price * 1 || 0);
       product.price = product.price.toFixed(2);
+      console.log(product);
       this.handleCalcCount();
       this.$forceUpdate();
     },
@@ -5349,15 +5399,20 @@ export default {
         });
       }
     },
-    // 查找最接近
-    handleFindNearest(array, value) {
-      const temp = JSON.parse(JSON.stringify(array));
-      temp.sort((a, b) => {
-        return Math.abs(a.long - value) - Math.abs(b.long - value);
-      });
-      return temp[0].material_detail_id;
-    },
+    // // 查找最接近
+    // handleFindNearest(array, value) {
+    //   const temp = JSON.parse(JSON.stringify(array));
+    //   temp.sort((a, b) => {
+    //     return Math.abs(a.long - value) - Math.abs(b.long - value);
+    //   });
+    //   return temp[0].material_detail_id;
+    // },
     handleCalcPartDetailLong(part_detail, product) {
+      console.log(part_detail,123123);
+      console.log(product,5555555);
+      if(!part_detail.material_detail_id){
+        return this.$Message.warning('请先选择部件!')
+      }
       for (const key in product.measure) {
         const element = product.measure[key];
         if (element.value) {
@@ -5384,12 +5439,21 @@ export default {
       let line = [];
       let flag = false;
       product.part.map((part) => {
-        part.part_title.indexOf("线条") != -1 && (line = part.change);
+        if(part.part_title){
+           part.part_title.indexOf("线条") != -1 && (line = part.change);
         part.part_title.indexOf("门头板") != -1 && (flag = true);
+         this.handleCalcLines(product, line, flag);
+        }else{
+          part.title.indexOf("线条") != -1 && (line = part.change);
+        part.title.indexOf("门头板") != -1 && (flag = true);
+         this.handleCalcLines(product, line, flag);
+        }
+       
       });
-      this.handleCalcLines(product, line, flag);
+      // this.handleCalcLines(product, line, flag); //会有多个部件,要放在循环里面
     },
     handleCalcLines(product, line, isSpecialPart) {
+      console.log(product,'hw');
       const process_ids = product.process_obj.map((v) => {
         return v.value;
       });
@@ -5466,7 +5530,7 @@ export default {
                       part_arr.part_detail &&
                       part_arr.part_detail.map((v) => {
                         if (v.part_detail_id == k) {
-                         
+                         //part_arr就是part中part_id与接口中的key一样的对象,里面有sub_part或者part_detail; k是第二层的键值
                           v.material_detail_id = match_item.material_detail_id;
                           v.material_detail_org_num = match_item.num*product.total_num*1;
                           v.material_detail_num = match_item.num*product.total_num*1;
@@ -5484,6 +5548,7 @@ export default {
     handleProductMeasureBlur(e, product, measure_detail) {
       console.log(product);
       this.handleProductMeasureChange(e, product, measure_detail);
+       console.log(product,11111);
       if (e.target.value) {
         try {
           measure_detail.value = eval(e.target.value);
@@ -5495,9 +5560,11 @@ export default {
           if(!part.addMTB){
              part.part_title.indexOf("线条") != -1 && (line = part.change);
           }
+          if(!part.addMTB){
           part.part_detail &&
             part.part_detail.length > 0 &&
             part.part_detail.map((part_detail) => {
+
               part_detail._longCalc = this.handleCalcPartDetailLong(
                 part_detail,
                 product
@@ -5514,17 +5581,26 @@ export default {
                 }
               }
             });
+        }
         });
+      
         product.process_obj.map((v) => {
           v.value ? "" : (v.value = product[v.id]);
         });
         let line = [];
         let flag = false;
         product.part.map((part) => {
-          part.part_title&&part.part_title.indexOf("线条") != -1 && (line = part.change);
-          part.part_title&&part.part_title.indexOf("门头板") != -1 && (flag = true);
+          if(part.part_title){//新增订单
+             part.part_title&&part.part_title.indexOf("线条") != -1 && (line = part.change);
+         part.part_title&&part.part_title.indexOf("门头板") != -1 && (flag = true);
+         this.handleCalcLines(product, line, flag);
+          }else{
+             part.title&&part.title.indexOf("线条") != -1 && (line = part.change);
+         part.title&&part.title.indexOf("门头板") != -1 && (flag = true);
+         this.handleCalcLines(product, line, flag);
+          }
         });
-        this.handleCalcLines(product, line, flag);
+        // this.handleCalcLines(product, line, flag);
       }
     },
     handleProductMeasureChange(e, product, measure_detail) {//对应高宽厚的值,整行数据,T字段的数据
@@ -5534,7 +5610,7 @@ export default {
         product[cur_measure] = cur_value;
         //当前测量字段 L W H  修改部件测量字段
         product.part.forEach((element) => {
-          if (!element.is_metal) {
+          if (!element.is_metal&&!element.addMTB) {
             element.highCalc = element.highCalc + "";
             element.longCalc = element.longCalc + "";
             element.wideCalc = element.wideCalc + "";
@@ -5709,7 +5785,7 @@ export default {
         //修改核算数量
         // 如果没有核算数量公式,核算数量取产品数量
         if (product.num_formula == "") {
-          product.total_num = product.num;
+          product.num = product.total_num;
         } else {
           product.num_formula_temp = product.num_formula;
           product.measure.forEach((element) => {
@@ -5721,16 +5797,26 @@ export default {
             }
           });
           product.num = eval(product.num_formula_temp);
-         if(product.num<0.3&&product.addMTB){
-           product.num = 0.3
-         }
         }
        
       
         // product.over_price = Number(product.over_price*product.total_num*1).toFixed(2);
         // product.save_over_price = JSON.parse(JSON.stringify(product.over_price*1/product.total_num*1));
-        product.num_temp_save = product.num*1 || 1;
-        product.num = (Number(product.num)*(product.total_num*1)).toFixed(2);
+        if(product.num<0.3&&product.surePrice){
+          product.num_temp_save = 0.3;
+        }else{
+          product.num_temp_save = product.num*1 || 1;
+        }
+        product.num = (Number(product.num)*(product.total_num*1));
+        if(product.num>=0.01){
+           product.num = product.num.toFixed(2);
+        }else{
+           product.num = product.num.toFixed(4);
+        }
+       
+     if(product.num<0.3&&product.surePrice){
+           product.num = 0.3
+         }
          product.over_price_total = (product.total_num*1*product.over_price).toFixed(2);
         product.price =
           (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
@@ -5970,11 +6056,11 @@ export default {
   top: 0px;
   color: red;
 }
-/deep/.ivu-tooltip-rel {
-  overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-}
+// /deep/.ivu-tooltip-rel {
+//   overflow: hidden;
+//   text-overflow: ellipsis;
+//   white-space: nowrap;
+// }
 .page-edit {
   overflow: hidden;
   overflow-y: auto;

+ 1 - 1
src/views/leadMatch/MatchList/HXYMatchCheck.vue

@@ -409,7 +409,7 @@ export default {
           key: "skin",
           minWidth: 90,
           render:(h,params)=>{
-            return h('span',{},params.row.skin==1?'单':params.row.skin ==2?'双':'素板')
+            return h('span',{},params.row.skin==1?'单':params.row.skin ==2?'双':params.row.skin==0?'素板':params.row.skin)
           }
         },
         {

+ 2 - 2
src/views/leadMatch/MatchList/HXYMatchPage.vue

@@ -994,7 +994,7 @@ export default {
           key: "skin",
           minWidth: 90,
           render:(h,params)=>{
-            return h('span',{},params.row.skin==1?'单':params.row.skin ==2?'双':'素板')
+            return h('span',{},params.row.skin==1?'单':params.row.skin ==2?'双':params.row.skin==0?'素板':params.row.skin)
           }
         },
         {
@@ -1058,7 +1058,7 @@ export default {
           key: "skin",
           minWidth: 90,
           render:(h,params)=>{
-            return h('span',{},params.row.skin==1?'单':params.row.skin ==2?'双':'素板')
+            return h('span',{},params.row.skin==1?'单':params.row.skin ==2?'双':params.row.skin==0?'素板':params.row.skin)
           }
         },
         {

+ 2 - 2
src/views/leadMatch/MatchList/NewHXYMatchPage.vue

@@ -847,7 +847,7 @@ export default {
           key: "skin",
           minWidth: 90,
           render:(h,params)=>{
-            return h('span',{},params.row.skin==1?'单':params.row.skin ==2?'双':'素板')
+            return h('span',{},params.row.skin==1?'单':params.row.skin ==2?'双':params.row.skin==0?'素板':params.row.skin)
           }
         },
         {
@@ -912,7 +912,7 @@ export default {
           key: "skin",
           minWidth: 90,
           render:(h,params)=>{
-            return h('span',{},params.row.skin==1?'单':params.row.skin ==2?'双':'素板')
+            return h('span',{},params.row.skin==1?'单':params.row.skin ==2?'双':params.row.skin==0?'素板':params.row.skin)
           }
         },
         {

+ 1 - 1
src/views/leadMatch/weightMemo/HXYedit.vue

@@ -354,7 +354,7 @@ export default {
                                        });
                                         }
                                 }
-                            }}):h('span',{},row.skin==1?'单':row.skin==2?'双':'素板');
+                            }}):h('span',{},row.skin==1?'单':row.skin==2?'双':row.skin==0?'素板':row.skin);
                         } },
                           { title: "封边", key: "band", align: "center",resizable: true,
                         width: 140,render:(h,params)=>{

+ 1 - 1
vue.config.js

@@ -2,7 +2,7 @@ const axios_default_ip =
   process.env.NODE_ENV == "dev"
     ? "http://124.71.176.88:882"
     : process.env.NODE_ENV == "test-prd"
-    ? "http://121.41.102.225:82" //测试服
+    ? "http://124.71.176.88:882" //
     : process.env.NODE_ENV == "prd_other"
     ? "http://121.37.173.82:82" //贝斯特
     : "http://124.71.176.88:882";