Andy 4 jaren geleden
bovenliggende
commit
2b699b11ee
3 gewijzigde bestanden met toevoegingen van 356 en 330 verwijderingen
  1. 310 304
      src/views/ChipPrintScreen/ChipPrintScreen.vue
  2. 44 24
      src/views/OrderMannage/BusinessOrderlist/edit.vue
  3. 2 2
      vue.config.js

+ 310 - 304
src/views/ChipPrintScreen/ChipPrintScreen.vue

@@ -981,13 +981,13 @@ export default {
       }).then((resp) => {
         if (resp.code == 200) {
           // usb打印/ip打印
-          this.axios.get("/apiget_print_local_url").then((res) => {
+          this.axios.get("/api/get_print_local_url").then((res) => {
             console.log(res);
             if (res.code == 200) {
               if (res.data.state) {
-                this.handlePrintChipsUsb(resp.data);
+                this.handlePrintChipsUsb(resp.data, res.data.type);
               } else {
-                this.handlePrintChipsIp(resp.data);
+                this.handlePrintChipsIp(resp.data, res.data.type);
               }
             }
           });
@@ -1171,7 +1171,7 @@ export default {
         }
       });
     },
-    handlePrintChipsUsb(contents) {
+    handlePrintChipsUsb(contents, type) {
       this.axios.get("/api/get_print_url").then((res) => {
         let data = {};
         // let url = "http://192.168.0.145:888/postek/print"; //request_url
@@ -1190,158 +1190,161 @@ export default {
           PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
         });
         printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
-        console.log(`contents`, contents);
-        contents.map((content) => {
-          //贝斯特打印格式
-          //上
-          const printContent_l1 = `项目:${content.client_name}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
-          });
-          const printContent_l1_2 = `区域:${
-            content.house ? content.house + "-" : ""
-          }${content.layer ? content.layer : ""}${
-            content.position ? content.position : ""
-          }`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
-          });
-          const printContent_l2 = `房号:${content.number_detail}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
-          });
-          const printContent_l2_2 = `产品:${content.product_title}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
-          });
-          const printContent_l3 = `图号:${content.url_number}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
-          });
-          const printContent_l3_2 = `部件:${content.part_title}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
-          });
-          const printContent_l4 = `木皮:${content.color_title}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,320,60,0,微软雅黑,1,700,0,0,0," + printContent_l4,
-          });
-          const printContent_l4_2 = `尺寸:${content.measure}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
-          });
-          //下
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+        // 打印类型 1江山 2贝斯特
+        if (type == 1) {
+          contents.map((content) => {
+            //江山打印格式
+            //上
+            const printContent_l1 = `单号:${content.order_no}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+            });
+            const printContent_l1_2 = `型号:${content.product_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+            });
+            const printContent_l2 = `尺寸:${content.measure}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+            });
+            const printContent_l2_2 = `工艺:${content.process_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+            });
+            const printContent_l3 = `颜色:${content.color_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+            });
+            const printContent_l3_2 = `部件:${content.part_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+            });
+            //下
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+            });
+            printparamsJsonArray.push({
+              PTK_RWRFIDLabel:
+                "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
+            });
+            printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
           });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
-          });
-          // 17,35 420
-          printparamsJsonArray.push({
-            PTK_RWRFIDLabel:
-              "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
+        } else {
+          contents.map((content) => {
+            //贝斯特打印格式
+            //上
+            const printContent_l1 = `项目:${content.client_name}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+            });
+            const printContent_l1_2 = `区域:${
+              content.house ? content.house + "-" : ""
+            }${content.layer ? content.layer : ""}${
+              content.position ? content.position : ""
+            }`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+            });
+            const printContent_l2 = `房号:${content.number_detail}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+            });
+            const printContent_l2_2 = `产品:${content.product_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+            });
+            const printContent_l3 = `图号:${content.url_number}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+            });
+            const printContent_l3_2 = `部件:${content.part_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+            });
+            const printContent_l4 = `木皮:${content.color_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,320,60,0,微软雅黑,1,700,0,0,0," + printContent_l4,
+            });
+            const printContent_l4_2 = `尺寸:${content.measure}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
+            });
+            //下
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
+            });
+            // 17,35 420
+            printparamsJsonArray.push({
+              PTK_RWRFIDLabel:
+                "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
+            });
+            printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
           });
-          printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
-        });
-        // contents.map((content) => {
-        //   //江山打印格式
-        //   //上
-        //   const printContent_l1 = `单号:${content.order_no}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
-        //   });
-        //   const printContent_l1_2 = `型号:${content.product_title}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
-        //   });
-        //   const printContent_l2 = `尺寸:${content.measure}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
-        //   });
-        //   const printContent_l2_2 = `工艺:${content.process_title}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
-        //   });
-        //   const printContent_l3 = `颜色:${content.color_title}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
-        //   });
-        //   const printContent_l3_2 = `部件:${content.part_title}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
-        //   });
-        //   //下
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_RWRFIDLabel:
-        //       "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
-        //   });
-        //   printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
-        // });
+        }
         printparamsJsonArray.push({ PTK_CloseUSBPort: "" });
         data.printparams = printparamsJsonArray;
         let sub_data = JSON.parse(JSON.stringify(data));
@@ -1367,7 +1370,7 @@ export default {
         });
       });
     },
-    handlePrintChipsIp(contents) {
+    handlePrintChipsIp(contents, type) {
       this.axios.get("/api/get_print_url").then((res) => {
         let data = {};
         // let url = "http://192.168.0.145:888/postek/print"; //request_url
@@ -1389,157 +1392,160 @@ export default {
         });
         printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
         console.log(`contents`, contents);
-        contents.map((content) => {
-          //贝斯特打印格式
-          //上
-          const printContent_l1 = `项目:${content.client_name}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+        if (type == 1) {
+          contents.map((content) => {
+            //江山打印格式
+            //上
+            const printContent_l1 = `单号:${content.order_no}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+            });
+            const printContent_l1_2 = `型号:${content.product_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+            });
+            const printContent_l2 = `尺寸:${content.measure}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+            });
+            const printContent_l2_2 = `工艺:${content.process_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+            });
+            const printContent_l3 = `颜色:${content.color_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+            });
+            const printContent_l3_2 = `部件:${content.part_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+            });
+            //下
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+            });
+            printparamsJsonArray.push({
+              PTK_RWRFIDLabel:
+                "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
+            });
+            printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
           });
-          const printContent_l1_2 = `区域:${
-            content.house ? content.house + "-" : ""
-          }${content.layer ? content.layer : ""}${
-            content.position ? content.position : ""
-          }`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
-          });
-          const printContent_l2 = `房号:${content.number_detail}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
-          });
-          const printContent_l2_2 = `产品:${content.product_title}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
-          });
-          const printContent_l3 = `图号:${content.url_number}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
-          });
-          const printContent_l3_2 = `部件:${content.part_title}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
-          });
-          const printContent_l4 = `木皮:${content.color_title}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,320,60,0,微软雅黑,1,700,0,0,0," + printContent_l4,
-          });
-          const printContent_l4_2 = `尺寸:${content.measure}`;
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
-          });
-          //下
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "100,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
-          });
-          printparamsJsonArray.push({
-            PTK_DrawText_TrueType:
-              "600,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
-          });
-          // 17,35 420
-          printparamsJsonArray.push({
-            PTK_RWRFIDLabel:
-              "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
+        } else {
+          contents.map((content) => {
+            //贝斯特打印格式
+            //上
+            const printContent_l1 = `项目:${content.client_name}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+            });
+            const printContent_l1_2 = `区域:${
+              content.house ? content.house + "-" : ""
+            }${content.layer ? content.layer : ""}${
+              content.position ? content.position : ""
+            }`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+            });
+            const printContent_l2 = `房号:${content.number_detail}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+            });
+            const printContent_l2_2 = `产品:${content.product_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+            });
+            const printContent_l3 = `图号:${content.url_number}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+            });
+            const printContent_l3_2 = `部件:${content.part_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+            });
+            const printContent_l4 = `木皮:${content.color_title}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,320,60,0,微软雅黑,1,700,0,0,0," + printContent_l4,
+            });
+            const printContent_l4_2 = `尺寸:${content.measure}`;
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
+            });
+            //下
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "100,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
+            });
+            printparamsJsonArray.push({
+              PTK_DrawText_TrueType:
+                "600,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
+            });
+            // 17,35 420
+            printparamsJsonArray.push({
+              PTK_RWRFIDLabel:
+                "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
+            });
+            printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
           });
-          printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
-        });
-        // contents.map((content) => {
-        //   //江山打印格式
-        //   //上
-        //   const printContent_l1 = `单号:${content.order_no}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
-        //   });
-        //   const printContent_l1_2 = `型号:${content.product_title}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
-        //   });
-        //   const printContent_l2 = `尺寸:${content.measure}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
-        //   });
-        //   const printContent_l2_2 = `工艺:${content.process_title}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
-        //   });
-        //   const printContent_l3 = `颜色:${content.color_title}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
-        //   });
-        //   const printContent_l3_2 = `部件:${content.part_title}`;
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
-        //   });
-        //   //下
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_DrawText_TrueType:
-        //       "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
-        //   });
-        //   printparamsJsonArray.push({
-        //     PTK_RWRFIDLabel:
-        //       "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
-        //   });
-        //   printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
-        // });
+        }
         printparamsJsonArray.push({ PTK_CloseConnect: "" });
         data.printparams = printparamsJsonArray;
         let sub_data = JSON.parse(JSON.stringify(data));

+ 44 - 24
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -599,7 +599,7 @@
                 @on-change="changeEditProcess(scope.row, process)"
                 @on-open-change="
                   (e) =>
-                    handleGetProductMeasure(
+                    handleGetProductProcess(
                       e,
                       null,
                       scope.row,
@@ -642,6 +642,9 @@
               <Input
                 v-if="!scope.row.is_metal"
                 v-model="scope.row[measure.e_title]"
+                @on-change="
+                  (e) => handleGetProductMeasure(e, measure.e_title, scope)
+                "
                 @on-blur="(e) => changeEditMeasure(e, scope.row, measure)"
               />
             </template>
@@ -1397,7 +1400,7 @@
                           :disabled="isCheck"
                           @on-open-change="
                             (e) =>
-                              handleGetProductMeasure(e, idx, modalData, ele)
+                              handleGetProductProcess(e, idx, modalData, ele)
                           "
                           @on-change="
                             (e) =>
@@ -2641,6 +2644,7 @@ export default {
     initData(order_no) {
       this.axios("/api/order_detail_new", { params: { order_no } }).then(
         (res) => {
+          price;
           //获取产品
           this.info = res.data;
           this.info.img = this.info.imgs;
@@ -4031,17 +4035,19 @@ export default {
       this.handleCalcCount();
     },
     changeEditMeasure(e, row, measure) {
-      row.isEdit = true;
-      row.measure.map((v) => {
-        if (v.e_title == measure.e_title) {
-          v.value = e.target.value;
-        }
-      });
-      this.handleProductMeasureBlur(
-        e,
-        row,
-        row.measure.filter((v) => v.id == measure.id)[0]
-      );
+      if (e.target.value) {
+        row.isEdit = true;
+        row.measure.map((v) => {
+          if (v.e_title == measure.e_title) {
+            v.value = e.target.value;
+          }
+        });
+        this.handleProductMeasureBlur(
+          e,
+          row,
+          row.measure.filter((v) => v.id == measure.id)[0]
+        );
+      }
     },
     changeEditRemark(row) {
       row.isEdit = true;
@@ -4773,7 +4779,22 @@ export default {
       product.price = product.price.toFixed(2);
       this.$forceUpdate();
     },
-    handleGetProductMeasure(val, index, product, ele) {
+    handleGetProductMeasure(e, e_title, scope) {
+      if (scope.row.part.filter((v) => !v.change_id).length > 0) {
+        scope.row[e_title] = "";
+        scope.row.measure.map((v) => {
+          v.e_title == e_title && (v.value = "");
+        });
+        this.tableData.splice(
+          scope.rowIndex,
+          1,
+          JSON.parse(JSON.stringify(scope.row))
+        );
+        this.$forceUpdate();
+        return this.$Message.warning("请先选择部件!");
+      }
+    },
+    handleGetProductProcess(val, index, product, ele) {
       if (val) {
         let change = [];
         if (product.part.filter((v) => !v.change_id).length > 0) {
@@ -4969,7 +4990,6 @@ export default {
         let cur_measure = measure_detail.measureCalc;
         let cur_value = e.target.value;
         product[cur_measure] = cur_value;
-        product.over_price = 0;
         //当前测量字段 L W H  修改部件测量字段
         product.part.forEach((element) => {
           if (!element.is_metal) {
@@ -5155,17 +5175,17 @@ export default {
             }
           });
           product.num = eval(product.num_formula_temp);
-          product.num = product.num.toFixed(2);
-          product.over_price = product.over_price.toFixed(2);
-          product.num_temp_save = product.num || 1;
-          product.price =
-            (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
-            (product.over_price * 1 || 0) +
-            (product.ext_price * 1 || 0);
-          product.price = product.price.toFixed(2);
         }
-        this.$forceUpdate();
+        product.num = Number(product.num).toFixed(2);
+        product.over_price = Number(product.over_price).toFixed(2);
+        product.num_temp_save = product.num || 1;
+        product.price =
+          (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
+          (product.over_price * 1 || 0) +
+          (product.ext_price * 1 || 0);
+        product.price = product.price.toFixed(2);
       }
+      this.$forceUpdate();
     },
     handleSubpartNumChange(e, row) {
       row.material_detail_num = e.target.value;

+ 2 - 2
vue.config.js

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