Andy 3 rokov pred
rodič
commit
7f70fb3266

+ 209 - 2
src/views/ChipPrintScreen/ChipPrintScreen.vue

@@ -973,13 +973,24 @@ export default {
             num: this.selectedObj.print_num,
             id: row.id,
           };
+      // 获取打印数据
       this.axios({
         method: "post",
         url: "/api/station_print",
         data,
       }).then((resp) => {
         if (resp.code == 200) {
-          this.handlePrintChips(resp.data);
+          // usb打印/ip打印
+          this.axios.get("/apiget_print_local_url").then((res) => {
+            console.log(res);
+            if (res.code == 200) {
+              if (res.data.state) {
+                this.handlePrintChipsUsb(resp.data);
+              } else {
+                this.handlePrintChipsIp(resp.data);
+              }
+            }
+          });
           this.printModal = false;
           this.roomModal = false;
         }
@@ -1160,7 +1171,203 @@ export default {
         }
       });
     },
-    handlePrintChips(contents) {
+    handlePrintChipsUsb(contents) {
+      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 });
+        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,
+          });
+          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" });
+        });
+        // 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));
+        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) {
       this.axios.get("/api/get_print_url").then((res) => {
         let data = {};
         // let url = "http://192.168.0.145:888/postek/print"; //request_url

+ 20 - 19
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -684,12 +684,6 @@
                         changeEditPart(scope.row, part_type, part_detail, e)
                     "
                   >
-                    <!-- scope.row.part.filter((v) => v.type_id == part_type.id)
-                      .length > 0
-                      ? scope.row.part.filter(
-                          (v) => v.type_id == part_type.id
-                        )[0].part_id
-                      : '' -->
                     <Option
                       v-for="ch in part_detail.change"
                       :key="ch.id + '999'"
@@ -719,11 +713,6 @@
                   {{ part_detail.part_title || part_detail.title }}
                 </div>
               </div>
-              <!-- {{
-                row.part.filter((v) => v.type_id == part_type.id).length > 0
-                  ? row.part.filter((v) => v.type_id == part_type.id)[0].title
-                  : ""
-              }} -->
             </template>
           </vxe-column>
           <vxe-column title="原材料名称" min-width="100">
@@ -1506,6 +1495,7 @@
                     <Input
                       :disabled="isCheck"
                       size="small"
+                      @on-focus="handlePriceFocus(modalData.price)"
                       v-model="modalData.price"
                       style="width: 120px"
                       placeholder="自动带出"
@@ -1714,7 +1704,7 @@
                       v-model="element.long"
                       @on-blur="handleIsSpecialPart(modalData, element)"
                       style="width: 50px"
-                      placeholder="请输入"
+                      placeholder="请输入"
                     />
                   </FormItem>
                   <FormItem
@@ -1748,7 +1738,7 @@
                       :disabled="isCheck"
                       v-model="element.high"
                       style="width: 50px"
-                      placeholder="请输入"
+                      placeholder="请输入"
                     />
                   </FormItem>
                   <FormItem
@@ -4856,10 +4846,8 @@ export default {
       let flag = false;
       product.part.map((part) => {
         part.part_title.indexOf("线条") != -1 && (line = part.change);
+        part.part_title.indexOf("门头板") != -1 && (flag = true);
       });
-      if (element.title.indexOf("门头板") != -1) {
-        flag = true;
-      }
       this.handleCalcLines(product, line, flag);
     },
     handleCalcLines(product, line, isSpecialPart) {
@@ -4941,8 +4929,8 @@ export default {
         } catch (error) {
           console.log("error :>> ", error);
         }
-        let line = [];
         product.part.map((part) => {
+          part.part_title ? "" : (part.part_title = part.title);
           part.part_title.indexOf("线条") != -1 && (line = part.change);
           part.part_detail &&
             part.part_detail.length > 0 &&
@@ -4964,7 +4952,16 @@ export default {
               }
             });
         });
-        this.handleCalcLines(product, line, false);
+        product.process_obj.map((v) => {
+          v.value ? "" : (v.value = product[v.id]);
+        });
+        let line = [];
+        let flag = false;
+        product.part.map((part) => {
+          part.part_title.indexOf("线条") != -1 && (line = part.change);
+          part.part_title.indexOf("门头板") != -1 && (flag = true);
+        });
+        this.handleCalcLines(product, line, flag);
       }
     },
     handleProductMeasureChange(e, product, measure_detail) {
@@ -5143,7 +5140,6 @@ export default {
               }
             });
         });
-        product.over_price = product.over_price.toFixed(2);
         //修改核算数量
         // 如果没有核算数量公式,核算数量取产品数量
         if (product.num_formula == "") {
@@ -5254,6 +5250,11 @@ export default {
       }
       this.$forceUpdate();
     },
+    handlePriceFocus(price) {
+      if (price == 0.0 || price == 0) {
+        this.modalData.price = "";
+      }
+    },
     handleMaterialChange(val, row) {
       if (val) {
         let tempRow = row.material_detail_list.filter(

+ 0 - 3
src/views/leadMatch/MatchList/matchPage.vue

@@ -438,7 +438,6 @@
                         <Table
                           :columns="unmatchedRoomTableColumnsUsed"
                           border
-                          ref="selections"
                           :max-height="500"
                           @on-selection-change="handleSelectChange"
                           :data="unmatchedRoomList.house_list"
@@ -1159,7 +1158,6 @@ export default {
             if (v.id == this.matchedReopenTag) {
               v.isCurrenct = true;
               if (this.isClickMatch) {
-                console.log(`111`, 111);
                 this.getSheetDetailList(v, 1);
               }
             }
@@ -1229,7 +1227,6 @@ export default {
             this.currentChooseTitle = "";
             this.unmatchedSelectedList = [];
             this.isClickMatch = true;
-            this.$refs.selections.selectAll(false);
             this.handleSearchUnmatchedInfo();
           }
         });

+ 1 - 1
vue.config.js

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