Andy 3 yıl önce
ebeveyn
işleme
e750dad704
1 değiştirilmiş dosya ile 69 ekleme ve 40 silme
  1. 69 40
      src/views/OrderMannage/BusinessOrderlist/edit.vue

+ 69 - 40
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -764,7 +764,12 @@
                   <div
                     v-for="(sub_part_detail, idx) in part_detail.sub_part"
                     :key="idx + '999'"
-                    v-show="sub_part_detail.title.indexOf('线条') > 0"
+                    v-show="
+                      (
+                        sub_part_detail.title ||
+                        sub_part_detail.material_detail_title
+                      ).indexOf('线条') > 0
+                    "
                     :style="
                       idx != part_detail.sub_part.length - 1
                         ? {
@@ -774,7 +779,10 @@
                         : { padding: '10px 0' }
                     "
                   >
-                    {{ sub_part_detail.title }}
+                    {{
+                      sub_part_detail.title ||
+                        sub_part_detail.material_detail_title
+                    }}
                   </div>
                 </div>
               </div>
@@ -791,7 +799,10 @@
                   <div
                     v-for="(sub_part_detail, idx) in part_detail.part_detail"
                     :key="idx + 'part_detail'"
-                    v-show="sub_part_detail.title.indexOf('线条') > 0"
+                    v-show="
+                      sub_part_detail.title &&
+                        sub_part_detail.title.indexOf('线条') > 0
+                    "
                     :style="
                       idx != part_detail.part_detail.length - 1
                         ? {
@@ -822,7 +833,10 @@
                   <div
                     v-for="(sub_part_detail, idx) in part_detail.part_detail"
                     :key="idx + 'part_detail'"
-                    v-show="sub_part_detail.title.indexOf('线条') > 0"
+                    v-show="
+                      sub_part_detail.title &&
+                        sub_part_detail.title.indexOf('线条') > 0
+                    "
                     :style="
                       idx != part_detail.part_detail.length - 1
                         ? {
@@ -863,7 +877,10 @@
                   <div
                     v-for="(sub_part_detail, idx) in part_detail.part_detail"
                     :key="idx + 'part_detail'"
-                    v-show="sub_part_detail.title.indexOf('线条') > 0"
+                    v-show="
+                      sub_part_detail.title &&
+                        sub_part_detail.title.indexOf('线条') > 0
+                    "
                     :style="
                       idx != part_detail.part_detail.length - 1
                         ? {
@@ -888,7 +905,10 @@
                   <div
                     v-for="(sub_part_detail, idx) in part_detail.part_detail"
                     :key="idx + 'part_detail'"
-                    v-show="sub_part_detail.title.indexOf('线条') > 0"
+                    v-show="
+                      sub_part_detail.title &&
+                        sub_part_detail.title.indexOf('线条') > 0
+                    "
                     :style="
                       idx != part_detail.part_detail.length - 1
                         ? {
@@ -1241,7 +1261,7 @@
       <div label="线条:" style="margin-left:20px;width:95%">
         <div style="font-size:20px">
           <span>线条:</span>
-          <span>{{print_line_data===''?'无':print_line_data}}</span>
+          <span>{{ print_line_data === "" ? "无" : print_line_data }}</span>
           <!-- <span v-if="wood_title_count.length < 1">无</span>
           <span
             v-else
@@ -1264,7 +1284,7 @@
             v-else
             v-for="(item, index) in parts_title_count"
             :key="item.title + '' + index"
-            v-show="item.title.indexOf('线条') == -1"
+            v-show="item.title && item.title.indexOf('线条') == -1"
             >{{ item.title }}:{{ item.num }}{{ item.unit }}
             <span v-show="index < parts_title_count.length - 1">;</span>
           </span>
@@ -1470,6 +1490,7 @@
                       size="small"
                       :disabled="isCheck"
                       v-model="modalData.unit_price"
+                      @on-focus="handleUnitPriceFocus"
                       @on-change="
                         (e) => handleProductUnit_priceChange(e, modalData)
                       "
@@ -1481,6 +1502,7 @@
                     <Input
                       size="small"
                       :disabled="isCheck"
+                      @on-focus="handleExtPriceFocus"
                       v-model="modalData.ext_price"
                       @on-change="
                         (e) => handleProductExt_priceChange(e, modalData)
@@ -1493,6 +1515,7 @@
                     <Input
                       :disabled="isCheck"
                       size="small"
+                      @on-focus="handleOverPriceFocus"
                       @on-change="
                         (e) => handleProductOver_priceChange(e, modalData)
                       "
@@ -1505,7 +1528,7 @@
                     <Input
                       :disabled="isCheck"
                       size="small"
-                      @on-focus="handlePriceFocus(modalData.price)"
+                      @on-focus="handlePriceFocus"
                       v-model="modalData.price"
                       style="width: 120px"
                       placeholder="自动带出"
@@ -2412,7 +2435,7 @@ export default {
       timeout: null,
       copiedLinePart: {},
       mentoubanList: [],
-      print_line_data:'',
+      print_line_data: "",
     };
   },
   computed: {
@@ -2425,12 +2448,11 @@ export default {
   created() {
     //获取部件分类
     this.axios.get("/api/basics_parts_index").then((res) => {
-      res.data.data.map((v, k) => {
-        if (v.title == "门头板") {
-          // this.mentoubanList = res.data.data.splice(k, 1)[0];
-        }
-      });
-      console.log(`this.mentoubanList`, this.mentoubanList);
+      // res.data.data.map((v, k) => {
+      //   if (v.title == "门头板") {
+      //     // this.mentoubanList = res.data.data.splice(k, 1)[0];
+      //   }
+      // });
       this.part_type_total = res.data.data;
     });
     // 获取测量字段
@@ -2520,8 +2542,8 @@ export default {
       this.initData(this.order_no);
     }
     this.getProducts();
-    if(this.$route.query.type != 1){
-       this.print_line();
+    if (this.$route.query.type != 1) {
+      this.print_line();
     }
     addEventListener("resize", (e) => {
       this.tableWidth = e.target.innerWidth - 300;
@@ -2529,17 +2551,17 @@ export default {
     });
   },
   methods: {
-    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
-        })
+    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;
@@ -2866,15 +2888,8 @@ export default {
               this.info.service_id = re.data.detail.service_id;
               this.info.predict_price = sum.toFixed(2);
               this.info.order_price = (
-                (this.info.predict_price * this.fax) /
-                100
+                this.info.predict_price - this.info.fax_price
               ).toFixed(2);
-              const temp_fax_price =
-                (this.info.predict_price - this.info.order_price).toFixed(2) ||
-                0;
-              if (!this.info.fax_price) {
-                this.info.fax_price = temp_fax_price;
-              }
               this.$forceUpdate();
             });
         }
@@ -3097,7 +3112,6 @@ export default {
                                     .wide || 0}*${__temp[0].high || 0}`,
                                 }));
                             });
-                            console.log(this.tableData)
                           } else {
                             this.wood_title_count.map((v) => {
                               v.title == el.material_detail_title &&
@@ -5370,11 +5384,26 @@ export default {
       }
       this.$forceUpdate();
     },
-    handlePriceFocus(price) {
-      if (price == 0.0 || price == 0) {
+    handlePriceFocus() {
+      if (this.modalData.price == 0.0 || this.modalData.price == 0) {
         this.modalData.price = "";
       }
     },
+    handleUnitPriceFocus() {
+      if (this.modalData.unit_price == 0.0 || this.modalData.unit_price == 0) {
+        this.modalData.unit_price = "";
+      }
+    },
+    handleExtPriceFocus() {
+      if (this.modalData.ext_price == 0.0 || this.modalData.ext_price == 0) {
+        this.modalData.ext_price = "";
+      }
+    },
+    handleOverPriceFocus() {
+      if (this.modalData.over_price == 0.0 || this.modalData.over_price == 0) {
+        this.modalData.over_price = "";
+      }
+    },
     handleMaterialChange(val, row) {
       if (val) {
         let tempRow = row.material_detail_list.filter(