|
@@ -223,6 +223,14 @@
|
|
|
</Form>
|
|
</Form>
|
|
|
</Modal>
|
|
</Modal>
|
|
|
</FullPage>
|
|
</FullPage>
|
|
|
|
|
+ <Modal
|
|
|
|
|
+ class-name="vertical-center-modal-PL"
|
|
|
|
|
+ v-model="test_modal"
|
|
|
|
|
+ title="打印内容"
|
|
|
|
|
+ @on-ok="test_run_print(test_url,test_content)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <Input type="textarea" v-model="test_content" :rows='40' />
|
|
|
|
|
+ </Modal>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -237,6 +245,9 @@ export default {
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ test_url:'',
|
|
|
|
|
+ test_modal: false,
|
|
|
|
|
+ test_content: null,
|
|
|
list: [
|
|
list: [
|
|
|
{
|
|
{
|
|
|
title: "楼幢",
|
|
title: "楼幢",
|
|
@@ -658,6 +669,7 @@ export default {
|
|
|
this.getOptions();
|
|
this.getOptions();
|
|
|
// const wxsoect = new WebSocket("ws://localhost:8080");
|
|
// const wxsoect = new WebSocket("ws://localhost:8080");
|
|
|
// this.wxsoect = wxsoect;
|
|
// this.wxsoect = wxsoect;
|
|
|
|
|
+ // console.log("this.wxsoect :>> ", this.wxsoect);
|
|
|
// wxsoect.onopen = function(evt) {
|
|
// wxsoect.onopen = function(evt) {
|
|
|
// console.log(`已成功打开`);
|
|
// console.log(`已成功打开`);
|
|
|
// };
|
|
// };
|
|
@@ -1016,9 +1028,27 @@ export default {
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ test_run_print(url, data) {
|
|
|
|
|
+ let sub_data = JSON.parse(data)
|
|
|
|
|
+ sub_data.printparams = JSON.stringify(sub_data.printparams)
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ type: "post",
|
|
|
|
|
+ url,
|
|
|
|
|
+ data:sub_data,
|
|
|
|
|
+ dataType: "json",
|
|
|
|
|
+ timeout: 5000,
|
|
|
|
|
+ success: function(result) {
|
|
|
|
|
+ if (result.retval == "0") {
|
|
|
|
|
+ this.$Message.success("发送成功");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$Message.error("发送失败,返回结果:" + result.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
handlePrintChips(contents) {
|
|
handlePrintChips(contents) {
|
|
|
let data = {};
|
|
let data = {};
|
|
|
- let url = "http://192.168.1.110:888/postek/print";
|
|
|
|
|
|
|
+ let url = "http://192.168.1.112:888/postek/print";
|
|
|
data.reqParam = "1";
|
|
data.reqParam = "1";
|
|
|
let printparamsJsonArray = [];
|
|
let printparamsJsonArray = [];
|
|
|
let IP = "192.168.1.58";
|
|
let IP = "192.168.1.58";
|
|
@@ -1028,11 +1058,11 @@ export default {
|
|
|
printparamsJsonArray.push({ PTK_ClearBuffer: "" });
|
|
printparamsJsonArray.push({ PTK_ClearBuffer: "" });
|
|
|
printparamsJsonArray.push({ PTK_SetDirection: "B" });
|
|
printparamsJsonArray.push({ PTK_SetDirection: "B" });
|
|
|
printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
|
|
printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
|
|
|
- printparamsJsonArray.push({ PTK_SetDarkness: "10" });
|
|
|
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetDarkness: "10" });
|
|
|
printparamsJsonArray.push({
|
|
printparamsJsonArray.push({
|
|
|
- PTK_SetLabelHeight: 75 + "," + 2 + ",0,false",
|
|
|
|
|
|
|
+ PTK_SetLabelHeight: 236 + "," + 24 + ",0,false",
|
|
|
});
|
|
});
|
|
|
- printparamsJsonArray.push({ PTK_SetLabelWidth: 10 });
|
|
|
|
|
|
|
+ printparamsJsonArray.push({ PTK_SetLabelWidth: 873 });
|
|
|
contents.map((content) => {
|
|
contents.map((content) => {
|
|
|
const printContent_l1 = `项目:${content.client_name} 图号:${content.url_number} 区域:${content.house}号楼-${content.layer}层${content.number_detail}`;
|
|
const printContent_l1 = `项目:${content.client_name} 图号:${content.url_number} 区域:${content.house}号楼-${content.layer}层${content.number_detail}`;
|
|
|
printparamsJsonArray.push({
|
|
printparamsJsonArray.push({
|
|
@@ -1061,16 +1091,15 @@ export default {
|
|
|
printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
|
|
printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
|
|
|
});
|
|
});
|
|
|
printparamsJsonArray.push({ PTK_CloseConnect: "" });
|
|
printparamsJsonArray.push({ PTK_CloseConnect: "" });
|
|
|
- data.printparams = JSON.stringify(printparamsJsonArray);
|
|
|
|
|
|
|
+ data.printparams = printparamsJsonArray
|
|
|
|
|
+ // data.printparams = JSON.stringify(printparamsJsonArray);
|
|
|
|
|
+ this.test_content = JSON.stringify(data);
|
|
|
|
|
+ this.test_url = url
|
|
|
|
|
+ this.test_modal = true
|
|
|
// $.ajax({
|
|
// $.ajax({
|
|
|
// type: "post",
|
|
// type: "post",
|
|
|
// url,
|
|
// url,
|
|
|
// data,
|
|
// data,
|
|
|
- // headers: {
|
|
|
|
|
- // "Access-Control-Allow-Origin": "*",
|
|
|
|
|
- // "Access-Control-Allow-Methods": "POST",
|
|
|
|
|
- // "Access-Control-Allow-Headers": "x-requested-with,content-type",
|
|
|
|
|
- // },
|
|
|
|
|
// dataType: "json",
|
|
// dataType: "json",
|
|
|
// timeout: 5000,
|
|
// timeout: 5000,
|
|
|
// success: function(result) {
|
|
// success: function(result) {
|
|
@@ -1081,19 +1110,19 @@ export default {
|
|
|
// }
|
|
// }
|
|
|
// },
|
|
// },
|
|
|
// });
|
|
// });
|
|
|
- axios
|
|
|
|
|
- .post(url, data)
|
|
|
|
|
- .then((result) => {
|
|
|
|
|
- console.log(result.msg);
|
|
|
|
|
- if (result.retval == "0") {
|
|
|
|
|
- this.$Message.success("发送成功");
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$Message.error("发送失败,返回结果:" + result.msg);
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .catch((err) => {
|
|
|
|
|
- this.$Message.error("请求失败,请重试" + err.msg);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // axios
|
|
|
|
|
+ // .post(url, data)
|
|
|
|
|
+ // .then((result) => {
|
|
|
|
|
+ // console.log(result);
|
|
|
|
|
+ // if (result.retval == "0") {
|
|
|
|
|
+ // this.$Message.success("发送成功");
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.$Message.error("发送失败,返回结果:" + result.msg);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .catch((err) => {
|
|
|
|
|
+ // this.$Message.error("请求失败,请重试" + err.msg);
|
|
|
|
|
+ // });
|
|
|
},
|
|
},
|
|
|
handleConnectPrinter() {
|
|
handleConnectPrinter() {
|
|
|
let data = {};
|
|
let data = {};
|
|
@@ -1229,9 +1258,9 @@ export default {
|
|
|
// st.send("ClosePort");
|
|
// st.send("ClosePort");
|
|
|
// },
|
|
// },
|
|
|
printChip(rows) {
|
|
printChip(rows) {
|
|
|
- if (this.wxsoect.readyState != 1) {
|
|
|
|
|
- return this.$Message.error("打印机未正常连接,请检查");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (this.wxsoect.readyState != 1) {
|
|
|
|
|
+ // return this.$Message.error("打印机未正常连接,请检查");
|
|
|
|
|
+ // }
|
|
|
this.axios("/api/get_sub_part", { params: { id: rows.id } }).then(
|
|
this.axios("/api/get_sub_part", { params: { id: rows.id } }).then(
|
|
|
(res) => {
|
|
(res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|