Andy 3 anos atrás
pai
commit
1a3c4469c2

+ 5 - 0
package-lock.json

@@ -6732,6 +6732,11 @@
         }
       }
     },
+    "jquery": {
+      "version": "3.6.0",
+      "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
+      "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
+    },
     "js-base64": {
       "version": "2.6.4",
       "resolved": "https://registry.npm.taobao.org/js-base64/download/js-base64-2.6.4.tgz?cache=0&sync_timestamp=1604450430432&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
     "echarts": "^4.9.0",
     "element-ui": "^2.15.5",
     "epic-spinners": "^1.1.0",
+    "jquery": "^3.6.0",
     "node-sass": "^4.14.1",
     "sass-loader": "^9.0.3",
     "v-charts": "^1.19.0",

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

@@ -319,7 +319,7 @@
           <Input
             v-model="info.order_price"
             v-if="type != 3"
-            @on-change="handleOrderPriceChange($event,info)"
+            @on-change="handleOrderPriceChange($event, info)"
             class="auto-width"
             placeholder="自动生成"
           />
@@ -2911,7 +2911,7 @@ export default {
       let idx = this.$refs.tabsRef.activeKey;
       let obj = JSON.parse(JSON.stringify(this.modalArray[idx]));
       obj.index = JSON.parse(JSON.stringify(this.modalArray.length));
-      this.pre_bp_id = this.modalArray[idx].bp_id
+      this.pre_bp_id = this.modalArray[idx].bp_id;
       this.modalArray.push(obj);
     },
     handleProductDele() {
@@ -4330,9 +4330,12 @@ export default {
         });
       }
     },
-    handleOrderPriceChange(e,info){
-      this.info.order_price = e.target.value
-      this.info.fax_price = this.info.predict_price - e.target.value
+    handleOrderPriceChange(e, info) {
+      this.info.order_price = e.target.value;
+      this.info.fax_price = (this.info.predict_price - e.target.value).toFixed(
+        2
+      );
+      this.$forceUpdate()
     },
     handleClearExtInfo(modalData, pre_id, cur_id) {
       if (cur_id != pre_id) {
@@ -4807,7 +4810,7 @@ export default {
         });
       });
       product.total_num = e.target.value;
-      product.num = product.total_num * product.num_temp_save;
+      product.num = (product.total_num * product.num_temp_save).toFixed(2);
       product.price =
         (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
         (product.over_price * 1 || 0) +
@@ -5137,13 +5140,13 @@ export default {
           product.num = eval(product.num_formula_temp);
           product.num = product.num.toFixed(2);
           product.over_price = product.over_price.toFixed(2);
+          product.num_temp_save = JSON.parse(JSON.stringify(product.num));
           product.price =
             (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
             (product.over_price * 1 || 0) +
             (product.ext_price * 1 || 0);
           product.price = product.price.toFixed(2);
         }
-
         this.$forceUpdate();
       }
     },

+ 50 - 28
src/views/ProductionOrderList/ProductionsOrder/Decorationlist.vue

@@ -228,6 +228,8 @@
 
 <script>
 import { SlickList, SlickItem } from "vue-slicksort";
+import axios from "axios";
+import $ from "jquery";
 export default {
   components: {
     SlickList,
@@ -529,7 +531,6 @@ export default {
         },
         {
           title: "房号",
-          key: "",
           align: "center",
           key: "number_detail",
           minWidth: 100,
@@ -655,23 +656,21 @@ export default {
   },
   created() {
     this.getOptions();
-    const wxsoect = new WebSocket("ws://127.0.0.1:1808");
-    this.wxsoect = wxsoect;
-    wxsoect.onopen = function(evt) {
-      console.log(`已成功打开`);
-    };
-
-    wxsoect.onclose = function(evt) {
-      console.log(`已断开socket连接`);
-    };
-
-    wxsoect.onerror = function(err) {
-      throw new Error(err);
-    };
+    // const wxsoect = new WebSocket("ws://localhost:8080");
+    // this.wxsoect = wxsoect;
+    // wxsoect.onopen = function(evt) {
+    //   console.log(`已成功打开`);
+    // };
 
-    wxsoect.onmessage = function(message) {
-      console.log(message);
-    };
+    // wxsoect.onclose = function(evt) {
+    //   console.log(`已断开socket连接`);
+    // };
+    // wxsoect.onerror = function(err) {
+    //   throw new Error(err);
+    // };
+    // wxsoect.onmessage = function(message) {
+    //   console.log(message);
+    // };
     this.axios("/api/bp_list").then((res) => {
       this.info.bps = res.data;
     });
@@ -1019,17 +1018,17 @@ export default {
     },
     handlePrintChips(contents) {
       let data = {};
-      let url = "http://192.168.1.110/postek/print";
+      let url = "http://192.168.1.110:888/postek/print";
       data.reqParam = "1";
       let printparamsJsonArray = [];
-      let IP = "192.168.1.110";
+      let IP = "192.168.1.58";
       let port = 9100;
       let IP_Port = IP + "," + port;
       printparamsJsonArray.push({ PTK_Connect_Timer: IP_Port + ",1" });
       printparamsJsonArray.push({ PTK_ClearBuffer: "" });
       printparamsJsonArray.push({ PTK_SetDirection: "B" });
       printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
-      printparamsJsonArray.push({ PTK_SetDarkness: "10" });
+      printparamsJsonArray.push({ PTK_SetDarkness: "10" }); 
       printparamsJsonArray.push({
         PTK_SetLabelHeight: 75 + "," + 2 + ",0,false",
       });
@@ -1038,28 +1037,51 @@ export default {
         const printContent_l1 = `项目:${content.client_name} 图号:${content.url_number} 区域:${content.house}号楼-${content.layer}层${content.number_detail}`;
         printparamsJsonArray.push({
           PTK_DrawText_TrueType:
-            "1100,250,50,0,微软雅黑,1,7000,0,0" + printContent_l1,
+            "1100,250,50,0,微软雅黑,1,700,0,0,0," + printContent_l1,
         });
         const printContent_l2 = `产品:${content.product_title} 部件:${content.part_title} `;
         printparamsJsonArray.push({
           PTK_DrawText_TrueType:
-            "1100,200,50,0,微软雅黑,1,7000,0,0" + printContent_l2,
+            "1100,200,50,0,微软雅黑,1,700,0,0,0," + printContent_l2,
         });
         const printContent_l3 = `材料:${content.process} `;
         printparamsJsonArray.push({
           PTK_DrawText_TrueType:
-            "1100,150,50,0,微软雅黑,1,7000,0,0" + printContent_l3,
+            "1100,150,50,0,微软雅黑,1,700,0,0,0," + printContent_l3,
         });
         const printContent_l4 = `尺寸:${content.measure} 位置:${content.position} `;
         printparamsJsonArray.push({
           PTK_DrawText_TrueType:
-            "10,10,50,0,微软雅黑,1,7000,0,0" + printContent_l4,
+            "10,10,50,0,微软雅黑,1,700,0,0,0," + printContent_l4,
         });
-        printparamsJsonArray.push({ PTK_PrintLabel: data.length + ",1" });
+        printparamsJsonArray.push({
+          PTK_RWRFIDLabel:
+            "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
+        });
+        printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
       });
-      printparamsJsonArray.push({ PTK_CloseUSBPort: "" });
+      printparamsJsonArray.push({ PTK_CloseConnect: "" });
       data.printparams = JSON.stringify(printparamsJsonArray);
-      this.axios
+      // $.ajax({
+      //   type: "post",
+      //   url,
+      //   data,
+      //   headers: {
+      //     "Access-Control-Allow-Origin": "*",
+      //     "Access-Control-Allow-Methods": "POST",
+      //     "Access-Control-Allow-Headers": "x-requested-with,content-type",
+      //   },
+      //   dataType: "json",
+      //   timeout: 5000,
+      //   success: function(result) {
+      //     if (result.retval == "0") {
+      //       this.$Message.success("发送成功");
+      //     } else {
+      //       this.$Message.error("发送失败,返回结果:" + result.msg);
+      //     }
+      //   },
+      // });
+      axios
         .post(url, data)
         .then((result) => {
           console.log(result.msg);
@@ -1114,7 +1136,7 @@ export default {
       //执行打印  必须有PTK_PrintLabel 否则不执行打印       {"PTK_PrintLabel" : "number,cpnumber"}
       // number:打印标签的数量。取值:1 – 65535 的正整数
       // cpnumber:每张标签的复制份数。取值:1 – 65535 的正整数
-      printparamsJsonArray.push({ PTK_CloseUSBPort: "" });
+      printparamsJsonArray.push({ PTK_CloseConnect: "" });
       //执行打印完关闭打印机USB端口
       printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
     },

+ 9 - 1
vue.config.js

@@ -1,6 +1,6 @@
 const axios_default_ip =
     process.env.NODE_ENV == 'dev' ?
-    'http://121.41.102.225:82' :
+    'http://124.71.176.88:882' :
     process.env.NODE_ENV == 'test-prd' ?
     'http://124.71.176.88:882' //测试服
     :
@@ -28,7 +28,15 @@ module.exports = {
                     '^/proxy': '', // rewrite path
                 },
             },
+            '/postek/print': {
+                target: 'http://192.168.1.110:888',
+                changeOrigin: true,
+                // pathRewrite: {
+                //     '^/postek': '', // rewrite path
+                // },
+            }
         },
     },
+
     lintOnSave: false, //禁用eslint  便于开发
 };