Andy пре 3 година
родитељ
комит
8d61bed15b

+ 67 - 11
src/views/ChipPrintScreen/ChipPrintScreen.vue

@@ -4,7 +4,7 @@
       <div slot="header">
         <span style="font-size: 0.5rem">工位屏</span>
         <div class="fullscreen-title-btn">
-          <!-- <Button
+          <Button
             @click="handleWideScreenClick"
             size="large"
             id="full_screen_btn"
@@ -12,7 +12,7 @@
             style="margin-right: 1rem"
           >
             {{ isWideScreen ? "退  出" : "宽屏模式" }}
-          </Button> -->
+          </Button>
           <Button
             @click="handleFullScreenClick"
             size="large"
@@ -144,35 +144,53 @@
             :key="choose.row"
             @click="handleChooseBlockClick(choose)"
           >
-            <div class="chip-tag" v-show="choose.type == 1">
+            <div
+              :class="[isWideScreen ? 'chip-tag-choosed' : 'chip-tag']"
+              v-show="choose.type == 1"
+            >
               芯片
               <Icon
                 size="20px"
+                :style="
+                  isWideScreen
+                    ? 'font-size: 1rem; transform: translate(0, -50%)'
+                    : 'font-size: 1rem; transform: translate(0, -40%)'
+                "
                 style="font-size: 1rem; transform: translate(0, -40%)"
                 :color="choose.isChoosed ? '#2d8cf0' : 'white'"
                 type="md-arrow-dropup"
               />
             </div>
-            <div>
+            <div v-show="!isWideScreen">
               <span>行号</span>
               <span>{{ choose.row_no }}</span>
             </div>
-            <div>
+            <div v-show="!isWideScreen">
               <span>部件</span>
               <span>{{ choose.part_title }}</span>
             </div>
-            <div>
+            <div v-show="!isWideScreen">
               <span>材料</span>
               <span>{{ choose.sub_part_title }}</span>
             </div>
-            <div>
+            <div v-show="!isWideScreen">
               <span>毛料尺寸</span>
               <span>{{ choose.wool_size }}</span>
             </div>
-            <div>
+            <div v-show="!isWideScreen">
               <span>精裁尺寸</span>
               <span>{{ choose.cut_size }}</span>
             </div>
+            <div v-show="isWideScreen" class="wide-screen-rowno">
+              <span
+                :class="[
+                  choose.isChoosed
+                    ? 'wide-screen-rowno-span-choosed'
+                    : 'wide-screen-rowno-span',
+                ]"
+                >{{ choose.row_no }}</span
+              >
+            </div>
             <div>
               <span>未完成数量</span>
               <span>
@@ -1598,21 +1616,23 @@ export default {
   font-weight: bold;
   .fullscreen-content-select {
     display: flex;
-    justify-content: space-around;
+    justify-content: flex-start;
+    // justify-content: space-around;
     padding-bottom: 0.1rem;
     border-bottom: 1px solid #e8eaec;
     .fullscreen-content-select-block {
       display: flex;
-      justify-content: center;
+      justify-content: flex-start;
       align-items: center;
     }
     .fullscreen-content-select-block:nth-child(1) {
       width: 30%;
     }
     .fullscreen-content-select-block:nth-child(2) {
-      width: 20%;
+      width: 30%;
     }
     .fullscreen-content-select-block:nth-child(3) {
+      width: 20%;
     }
   }
   .fullscreen-content-choose {
@@ -1648,6 +1668,21 @@ export default {
         padding-top: 0.15rem;
         transform: translate(-50%, -10%);
       }
+      .chip-tag-choosed {
+        display: inline-block;
+        position: absolute;
+        width: 1rem;
+        top: 0;
+        left: 15%;
+        font-size: 18px;
+        background-color: #fadb14;
+        color: black;
+        height: 0.75rem;
+        border-radius: 15%;
+        text-align: center;
+        padding-top: 0.15rem;
+        transform: translate(-10%, -10%) !important;
+      }
     }
     .fullscreen-content-choose-block-choosen {
       color: white;
@@ -1758,4 +1793,25 @@ export default {
   display: flex;
   justify-content: space-around;
 }
+.wide-screen-rowno {
+  display: flex;
+  justify-content: center !important;
+  span {
+    display: inline-block;
+    text-align: center;
+    width: 3rem;
+    height: 3rem;
+    line-height: 3rem;
+    border-radius: 50%;
+    font-size: 1.5rem;
+  }
+  .wide-screen-rowno-span-choosed {
+    color: #2d8cf0;
+    background-color: white;
+  }
+  .wide-screen-rowno-span {
+    color: white;
+    background-color: #2d8cf0;
+  }
+}
 </style>

+ 164 - 168
src/views/ChipPrintScreen/ChipPrintScreenCheck.vue

@@ -903,28 +903,20 @@ export default {
         data,
       }).then((resp) => {
         if (resp.code == 200) {
-          this.handlePrintChips(resp.data);
+          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, res.data.type);
+              } else {
+                this.handlePrintChipsIp(resp.data, res.data.type);
+              }
+            }
+          });
           this.printModal = false;
           this.roomModal = false;
         }
       });
-      // this.axios({
-      //   method: "post",
-      //   url: "/api/station_print",
-      //   data: {
-      //     order_no: this.selectedInfo.order_no,
-      //     product_id: this.selectedInfo.product_id,
-      //     rows: this.selectedInfo.rows,
-      //     num: this.selectedObj.print_num,
-      //     id: row.id,
-      //   },
-      // }).then((resp) => {
-      //   if (resp.code == 200) {
-      //     this.handlePrintChips(resp.data);
-      //     this.printModal = false;
-      //     this.roomModal = false;
-      //   }
-      // });
     },
     handleOk() {
       if (!this.selectedObj.isChoosed) {
@@ -1045,7 +1037,7 @@ export default {
         this.currentSearchValue
       );
     },
-    handlePrintChips(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
@@ -1066,157 +1058,161 @@ export default {
           PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
         });
         printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
-        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,
+        console.log(`contents`, contents);
+        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:
-              "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));

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

@@ -2581,44 +2581,49 @@ export default {
       let _save_metal = this.tableData.filter(
         (v) => v.is_metal && v.product_id
       );
-      _save_metal.map((v) => {
-        v.type = 1;
-        v.material_id = v.product_id;
-        v.ext_id = v.product_id;
-      });
-      sendList.map((element, index) => {
-        element.part.map((elem) => {
-          if (!elem.is_metal) {
-            // elem.part_detail = elem.sub_part;
-            if (!elem.part_detail) {
-              elem.part_detail = elem.sub_part;
+      _save_metal.length > 0 &&
+        _save_metal.map((v) => {
+          v.type = 1;
+          v.material_id = v.product_id;
+          v.ext_id = v.product_id;
+        });
+      sendList.length > 0 &&
+        sendList.map((element, index) => {
+          element.part.map((elem) => {
+            if (!elem.is_metal) {
+              // elem.part_detail = elem.sub_part;
+              if (!elem.part_detail) {
+                elem.part_detail = elem.sub_part;
+              }
+              elem.part_detail.map((el) => {
+                el.material_num = el.material_detail_num;
+              });
             }
-            elem.part_detail.map((el) => {
-              el.material_num = el.material_detail_num;
-            });
+          });
+          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
+          );
         });
-        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
-        );
-      });
-      sendList[0].ext = sendList[0].ext.filter((v) => v.type == 2);
-      sendList[0].ext.push(..._save_metal);
+      sendList.length > 0 &&
+        (sendList[0].ext = sendList[0].ext
+          ? sendList[0].ext.filter((v) => v.type == 2)
+          : "");
+      _save_metal.length > 0 && sendList[0].ext.push(..._save_metal);
       try {
         sendData.start_time = new Date(sendData.start_time)
           .toLocaleDateString()
@@ -2644,7 +2649,6 @@ 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;

+ 445 - 214
src/views/ProductionOrderList/ProductionsOrder/BST_Decorationlist.vue

@@ -7,7 +7,7 @@
       :logList="logList"
       :loading="loading"
       @searchData="init"
-      @changeSelected='changeSelected'
+      @changeSelected="changeSelected"
       @changePage="changePage"
       @changeSize="changeSize"
       @selectTable="selectTable"
@@ -466,7 +466,7 @@ export default {
           multiple: true,
           filterable: true,
           value: "",
-           change:true,
+          change: true,
           serverName: "house",
           placeholder: "请选择楼幢",
           option: [],
@@ -478,7 +478,7 @@ export default {
           multiple: true,
           filterable: true,
           value: "",
-           change:true,
+          change: true,
           serverName: "unit",
           placeholder: "请选择单元",
           option: [],
@@ -489,7 +489,7 @@ export default {
           multiple: true,
           filterable: true,
           value: "",
-           change:true,
+          change: true,
           serverName: "layer",
           placeholder: "请选择楼层",
           option: [],
@@ -500,7 +500,7 @@ export default {
           multiple: true,
           filterable: true,
           value: "",
-           change:true,
+          change: true,
           serverName: "number_detail",
           placeholder: "请选择房号",
           option: [],
@@ -511,7 +511,7 @@ export default {
           multiple: true,
           filterable: true,
           value: "",
-          change:true,
+          change: true,
           serverName: "part",
           placeholder: "请选择部件",
           option: [],
@@ -522,7 +522,7 @@ export default {
           multiple: true,
           filterable: true,
           value: "",
-           change:true,
+          change: true,
           serverName: "product",
           placeholder: "请选择产品",
           option: [],
@@ -531,7 +531,7 @@ export default {
           title: "是否存在工艺路线",
           name: "Select",
           value: "",
-           change:true,
+          change: true,
           serverName: "process_router",
           option: [
             { label: "是", value: 1 },
@@ -562,7 +562,7 @@ export default {
           title: "部件状态",
           name: "Select",
           value: "",
-           change:true,
+          change: true,
           serverName: "part_state",
           option: [
             { label: "未下计划", value: 0 },
@@ -575,7 +575,7 @@ export default {
           multiple: true,
           filterable: true,
           value: "",
-           change:true,
+          change: true,
           serverName: "img_number",
           placeholder: "请选择图号",
           option: [],
@@ -669,7 +669,7 @@ export default {
           title: "工艺要求",
           align: "center",
           key: "rework_require",
-          minWidth: 200
+          minWidth: 200,
         },
         // {
         //   title: "部件是否贴标签",
@@ -872,16 +872,16 @@ export default {
       show_add_detail: false,
       show_add: false,
       processLineTableData: [],
-      formData:{
-        house:'',
-        unit:'',
-        layer:'',
-        number_detail:'',
-        part:'',
-        product:'',
-        process_router:'',
-        part_state:'',
-        img_number:''
+      formData: {
+        house: "",
+        unit: "",
+        layer: "",
+        number_detail: "",
+        part: "",
+        product: "",
+        process_router: "",
+        part_state: "",
+        img_number: "",
       },
       info: {
         title: "",
@@ -1015,16 +1015,16 @@ export default {
         }
       );
     },
-    changeSelected(row){
-       this.formData.house = row[0].value;
-       this.formData.unit = row[1].value;
-         this.formData.layer = row[2].value;
-         this.formData.number_detail= row[3].value;
-        this.formData.part= row[4].value;
-        this.formData.product= row[5].value;
-        this.formData.process_router= row[6].value;
-        this.formData.part_state= row[7].value;
-        this.formData.img_number= row[8].value;
+    changeSelected(row) {
+      this.formData.house = row[0].value;
+      this.formData.unit = row[1].value;
+      this.formData.layer = row[2].value;
+      this.formData.number_detail = row[3].value;
+      this.formData.part = row[4].value;
+      this.formData.product = row[5].value;
+      this.formData.process_router = row[6].value;
+      this.formData.part_state = row[7].value;
+      this.formData.img_number = row[8].value;
     },
     getOptions() {
       this.axios("/api/order_detail_word", {
@@ -1086,28 +1086,36 @@ export default {
       if (Array.isArray(row)) {
         //批量下生产操作
         if (row.length < 1) {
-          
-            if(this.formData.house||this.formData.unit||this.formData.layer||this.formData.number_detail||this.formData.part||this.formData.product||this.formData.process_router||this.formData.part_state||this.formData.img_number){
-              //  this.axios.post('/api/orders_plan',this.formData);
-          let data = {zero:{},type:1};
-          data.zero.order_no = this.$route.query.order_no;
-              for(let i in this.formData){
-                data.zero[i]=this.formData[i]
-              };
-               this.downProduction({
-        title: "下生产排产",
-        type: 1,
-        params: data,
-        then: (e) => {
-          this.getData(this.proxyObj);
-        },
-        cancel: (e) => {},
-      });
-               return;
-            }else{
-               return this.$Message.warning("请至少选择一项");
+          if (
+            this.formData.house ||
+            this.formData.unit ||
+            this.formData.layer ||
+            this.formData.number_detail ||
+            this.formData.part ||
+            this.formData.product ||
+            this.formData.process_router ||
+            this.formData.part_state ||
+            this.formData.img_number
+          ) {
+            //  this.axios.post('/api/orders_plan',this.formData);
+            let data = { zero: {}, type: 1 };
+            data.zero.order_no = this.$route.query.order_no;
+            for (let i in this.formData) {
+              data.zero[i] = this.formData[i];
             }
-         
+            this.downProduction({
+              title: "下生产排产",
+              type: 1,
+              params: data,
+              then: (e) => {
+                this.getData(this.proxyObj);
+              },
+              cancel: (e) => {},
+            });
+            return;
+          } else {
+            return this.$Message.warning("请至少选择一项");
+          }
         }
         let result = [];
         row.map((v) => result.push(v.pr_id));
@@ -1380,12 +1388,16 @@ export default {
             })
             .then((resp) => {
               if (resp.code == 200) {
-                const result = resp.data;
-                console.log(result, "多打印");
-                this.handlePrintChips(resp.data);
-                // if (result && result.length > 0) {
-                //   result.map((ele) => this.printDemo(ele));
-                // }
+                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, res.data.type);
+                    } else {
+                      this.handlePrintChipsIp(resp.data, res.data.type);
+                    }
+                  }
+                });
               }
             });
         },
@@ -1413,12 +1425,211 @@ export default {
         },
       });
     },
-    handlePrintChips(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
+        let url = `http://${res.data.request_url}:888/postek/print`; //request_url
+        data.reqParam = "1"; //这个一般不用改,如需改,查api
+        let printparamsJsonArray = [];
+        // let IP = "192.168.1.58";//print_url
+        // let IP = "192.168.0.199"; //print_url
+        printparamsJsonArray.push({ PTK_OpenUSBPort: 255 });
+
+        printparamsJsonArray.push({ PTK_ClearBuffer: "" });
+        printparamsJsonArray.push({ PTK_SetDirection: "B" });
+        printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
+        printparamsJsonArray.push({ PTK_SetDarkness: "10" });
+        printparamsJsonArray.push({
+          PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
+        });
+        printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
+        // 打印类型 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" });
+          });
+        } 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_CloseUSBPort: "" });
+        data.printparams = printparamsJsonArray;
+        let sub_data = JSON.parse(JSON.stringify(data));
+        sub_data.printparams = JSON.stringify(sub_data.printparams);
+        let _this = this;
+        $.ajax({
+          type: "post",
+          url,
+          data: sub_data,
+          dataType: "json",
+          timeout: 5000,
+          success: function(result) {
+            _this.getChipDetail();
+            if (result.retval == "0") {
+              _this.$Message.success("发送成功");
+            } else {
+              _this.$Message.error("发送失败,返回结果:" + result.msg);
+            }
+          },
+          error: function() {
+            _this.getChipDetail();
+          },
+        });
+      });
+    },
+    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
         let url = `http://${res.data.request_url}:888/postek/print`; //request_url
-        data.reqParam = "1";
+        data.reqParam = "1"; //这个一般不用改,如需改,查api
         let printparamsJsonArray = [];
         // let IP = "192.168.1.58";//print_url
         // let IP = "192.168.0.199"; //print_url
@@ -1434,164 +1645,184 @@ export default {
           PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
         });
         printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
-        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,
+        console.log(`contents`, contents);
+        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" });
           });
-          // 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;
-        // data.printparams = JSON.stringify(printparamsJsonArray);
-        this.test_content = JSON.stringify(data);
-        this.test_url = url;
-        this.test_modal = true;
+        let sub_data = JSON.parse(JSON.stringify(data));
+        sub_data.printparams = JSON.stringify(sub_data.printparams);
+        let _this = this;
+        $.ajax({
+          type: "post",
+          url,
+          data: sub_data,
+          dataType: "json",
+          timeout: 5000,
+          success: function(result) {
+            _this.getChipDetail();
+            if (result.retval == "0") {
+              _this.$Message.success("发送成功");
+            } else {
+              _this.$Message.error("发送失败,返回结果:" + result.msg);
+            }
+          },
+          error: function() {
+            _this.getChipDetail();
+          },
+        });
       });
     },
     handleConnectPrinter() {

+ 387 - 163
src/views/ProductionOrderList/ProductionsOrder/demo_Decorationlist.vue

@@ -659,7 +659,7 @@ export default {
           title: "工艺要求",
           align: "center",
           key: "rework_require",
-          minWidth: 200
+          minWidth: 200,
         },
         // {
         //   title: "部件是否贴标签",
@@ -1327,12 +1327,17 @@ export default {
             })
             .then((resp) => {
               if (resp.code == 200) {
-                const result = resp.data;
-                console.log(result, "多打印");
-                this.handlePrintChips(resp.data);
-                // if (result && result.length > 0) {
-                //   result.map((ele) => this.printDemo(ele));
-                // }
+                // 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, res.data.type);
+                //     } else {
+                //       this.handlePrintChipsIp(resp.data, res.data.type);
+                this.handlePrintChipsIp(resp.data);
+                //     }
+                //   }
+                // });
               }
             });
         },
@@ -1360,12 +1365,211 @@ export default {
         },
       });
     },
-    handlePrintChips(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
+        let url = `http://${res.data.request_url}:888/postek/print`; //request_url
+        data.reqParam = "1"; //这个一般不用改,如需改,查api
+        let printparamsJsonArray = [];
+        // let IP = "192.168.1.58";//print_url
+        // let IP = "192.168.0.199"; //print_url
+        printparamsJsonArray.push({ PTK_OpenUSBPort: 255 });
+
+        printparamsJsonArray.push({ PTK_ClearBuffer: "" });
+        printparamsJsonArray.push({ PTK_SetDirection: "B" });
+        printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
+        printparamsJsonArray.push({ PTK_SetDarkness: "10" });
+        printparamsJsonArray.push({
+          PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
+        });
+        printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
+        // 打印类型 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" });
+          });
+        } 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_CloseUSBPort: "" });
+        data.printparams = printparamsJsonArray;
+        let sub_data = JSON.parse(JSON.stringify(data));
+        sub_data.printparams = JSON.stringify(sub_data.printparams);
+        let _this = this;
+        $.ajax({
+          type: "post",
+          url,
+          data: sub_data,
+          dataType: "json",
+          timeout: 5000,
+          success: function(result) {
+            _this.getChipDetail();
+            if (result.retval == "0") {
+              _this.$Message.success("发送成功");
+            } else {
+              _this.$Message.error("发送失败,返回结果:" + result.msg);
+            }
+          },
+          error: function() {
+            _this.getChipDetail();
+          },
+        });
+      });
+    },
+    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
         let url = `http://${res.data.request_url}:888/postek/print`; //request_url
-        data.reqParam = "1";
+        data.reqParam = "1"; //这个一般不用改,如需改,查api
         let printparamsJsonArray = [];
         // let IP = "192.168.1.58";//print_url
         // let IP = "192.168.0.199"; //print_url
@@ -1381,164 +1585,184 @@ export default {
           PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
         });
         printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
-        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,
+        console.log(`contents`, contents);
+        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" });
           });
-          // 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;
-        // data.printparams = JSON.stringify(printparamsJsonArray);
-        this.test_content = JSON.stringify(data);
-        this.test_url = url;
-        this.test_modal = true;
+        let sub_data = JSON.parse(JSON.stringify(data));
+        sub_data.printparams = JSON.stringify(sub_data.printparams);
+        let _this = this;
+        $.ajax({
+          type: "post",
+          url,
+          data: sub_data,
+          dataType: "json",
+          timeout: 5000,
+          success: function(result) {
+            _this.getChipDetail();
+            if (result.retval == "0") {
+              _this.$Message.success("发送成功");
+            } else {
+              _this.$Message.error("发送失败,返回结果:" + result.msg);
+            }
+          },
+          error: function() {
+            _this.getChipDetail();
+          },
+        });
       });
     },
     handleConnectPrinter() {

+ 1 - 1
vue.config.js

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