|
@@ -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" });
|
|
|
},
|