Andy 3 年之前
父节点
当前提交
06224a75fc
共有 2 个文件被更改,包括 205 次插入4 次删除
  1. 198 0
      src/views/ChipPrintScreen/ChipPrintScreenCheck.vue
  2. 7 4
      src/views/OrderMannage/BusinessOrderlist/edit.vue

+ 198 - 0
src/views/ChipPrintScreen/ChipPrintScreenCheck.vue

@@ -945,6 +945,204 @@ export default {
         }
       });
     },
+    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();
+          },
+        });
+      });
+    },
     handleOk() {
       if (!this.selectedObj.isChoosed) {
         return this.$Message.warning("请选择数据");

+ 7 - 4
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -762,7 +762,11 @@
                       : { padding: '10px 0' }
                   "
                 >
-                  {{ part_detail.part_title || part_detail.title }}
+                  {{
+                    part_detail.change_id
+                      ? part_detail.part_title || part_detail.title
+                      : ""
+                  }}
                 </div>
               </div>
             </template>
@@ -4240,7 +4244,7 @@ export default {
           obj = {
             isCopied: row.isCopied,
             select_all_id: $event.value,
-            product_id: "",
+            product_id: arr[0] * 1,
             type_name: "", //展示用产品名称
             position: "", //位置
             over_price: "", //超标单价
@@ -4286,7 +4290,7 @@ export default {
             type: 1,
             is_metal: true,
             material_id: "",
-            product_id: "",
+            product_id: arr[0] * 1,
             title: "",
             price: 0,
             single_price: 0,
@@ -4294,7 +4298,6 @@ export default {
             unit: "",
           };
         }
-        obj.product_id = arr[0];
         this.tableData.splice(rowIndex, 1, obj);
         if (arr[1] === "1") {
           this.changeEditTableData(obj, rowIndex, $event, scope);