|
@@ -7,7 +7,7 @@
|
|
|
:logList="logList"
|
|
|
:loading="loading"
|
|
|
@searchData="init"
|
|
|
- @changeSelected='changeSelected'
|
|
|
+ @changeSelected="changeSelected"
|
|
|
@changePage="changePage"
|
|
|
@changeSize="changeSize"
|
|
|
@selectTable="selectTable"
|
|
@@ -466,7 +466,7 @@ export default {
|
|
|
multiple: true,
|
|
|
filterable: true,
|
|
|
value: "",
|
|
|
- change:true,
|
|
|
+ change: true,
|
|
|
serverName: "house",
|
|
|
placeholder: "请选择楼幢",
|
|
|
option: [],
|
|
@@ -478,7 +478,7 @@ export default {
|
|
|
multiple: true,
|
|
|
filterable: true,
|
|
|
value: "",
|
|
|
- change:true,
|
|
|
+ change: true,
|
|
|
serverName: "unit",
|
|
|
placeholder: "请选择单元",
|
|
|
option: [],
|
|
@@ -489,7 +489,7 @@ export default {
|
|
|
multiple: true,
|
|
|
filterable: true,
|
|
|
value: "",
|
|
|
- change:true,
|
|
|
+ change: true,
|
|
|
serverName: "layer",
|
|
|
placeholder: "请选择楼层",
|
|
|
option: [],
|
|
@@ -500,7 +500,7 @@ export default {
|
|
|
multiple: true,
|
|
|
filterable: true,
|
|
|
value: "",
|
|
|
- change:true,
|
|
|
+ change: true,
|
|
|
serverName: "number_detail",
|
|
|
placeholder: "请选择房号",
|
|
|
option: [],
|
|
@@ -511,7 +511,7 @@ export default {
|
|
|
multiple: true,
|
|
|
filterable: true,
|
|
|
value: "",
|
|
|
- change:true,
|
|
|
+ change: true,
|
|
|
serverName: "part",
|
|
|
placeholder: "请选择部件",
|
|
|
option: [],
|
|
@@ -522,7 +522,7 @@ export default {
|
|
|
multiple: true,
|
|
|
filterable: true,
|
|
|
value: "",
|
|
|
- change:true,
|
|
|
+ change: true,
|
|
|
serverName: "product",
|
|
|
placeholder: "请选择产品",
|
|
|
option: [],
|
|
@@ -531,7 +531,7 @@ export default {
|
|
|
title: "是否存在工艺路线",
|
|
|
name: "Select",
|
|
|
value: "",
|
|
|
- change:true,
|
|
|
+ change: true,
|
|
|
serverName: "process_router",
|
|
|
option: [
|
|
|
{ label: "是", value: 1 },
|
|
@@ -562,7 +562,7 @@ export default {
|
|
|
title: "部件状态",
|
|
|
name: "Select",
|
|
|
value: "",
|
|
|
- change:true,
|
|
|
+ change: true,
|
|
|
serverName: "part_state",
|
|
|
option: [
|
|
|
{ label: "未下计划", value: 0 },
|
|
@@ -575,7 +575,7 @@ export default {
|
|
|
multiple: true,
|
|
|
filterable: true,
|
|
|
value: "",
|
|
|
- change:true,
|
|
|
+ change: true,
|
|
|
serverName: "img_number",
|
|
|
placeholder: "请选择图号",
|
|
|
option: [],
|
|
@@ -669,7 +669,7 @@ export default {
|
|
|
title: "工艺要求",
|
|
|
align: "center",
|
|
|
key: "rework_require",
|
|
|
- minWidth: 200
|
|
|
+ minWidth: 200,
|
|
|
},
|
|
|
// {
|
|
|
// title: "部件是否贴标签",
|
|
@@ -872,16 +872,16 @@ export default {
|
|
|
show_add_detail: false,
|
|
|
show_add: false,
|
|
|
processLineTableData: [],
|
|
|
- formData:{
|
|
|
- house:'',
|
|
|
- unit:'',
|
|
|
- layer:'',
|
|
|
- number_detail:'',
|
|
|
- part:'',
|
|
|
- product:'',
|
|
|
- process_router:'',
|
|
|
- part_state:'',
|
|
|
- img_number:''
|
|
|
+ formData: {
|
|
|
+ house: "",
|
|
|
+ unit: "",
|
|
|
+ layer: "",
|
|
|
+ number_detail: "",
|
|
|
+ part: "",
|
|
|
+ product: "",
|
|
|
+ process_router: "",
|
|
|
+ part_state: "",
|
|
|
+ img_number: "",
|
|
|
},
|
|
|
info: {
|
|
|
title: "",
|
|
@@ -1015,16 +1015,16 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
- changeSelected(row){
|
|
|
- this.formData.house = row[0].value;
|
|
|
- this.formData.unit = row[1].value;
|
|
|
- this.formData.layer = row[2].value;
|
|
|
- this.formData.number_detail= row[3].value;
|
|
|
- this.formData.part= row[4].value;
|
|
|
- this.formData.product= row[5].value;
|
|
|
- this.formData.process_router= row[6].value;
|
|
|
- this.formData.part_state= row[7].value;
|
|
|
- this.formData.img_number= row[8].value;
|
|
|
+ changeSelected(row) {
|
|
|
+ this.formData.house = row[0].value;
|
|
|
+ this.formData.unit = row[1].value;
|
|
|
+ this.formData.layer = row[2].value;
|
|
|
+ this.formData.number_detail = row[3].value;
|
|
|
+ this.formData.part = row[4].value;
|
|
|
+ this.formData.product = row[5].value;
|
|
|
+ this.formData.process_router = row[6].value;
|
|
|
+ this.formData.part_state = row[7].value;
|
|
|
+ this.formData.img_number = row[8].value;
|
|
|
},
|
|
|
getOptions() {
|
|
|
this.axios("/api/order_detail_word", {
|
|
@@ -1086,28 +1086,36 @@ export default {
|
|
|
if (Array.isArray(row)) {
|
|
|
//批量下生产操作
|
|
|
if (row.length < 1) {
|
|
|
-
|
|
|
- if(this.formData.house||this.formData.unit||this.formData.layer||this.formData.number_detail||this.formData.part||this.formData.product||this.formData.process_router||this.formData.part_state||this.formData.img_number){
|
|
|
- // this.axios.post('/api/orders_plan',this.formData);
|
|
|
- let data = {zero:{},type:1};
|
|
|
- data.zero.order_no = this.$route.query.order_no;
|
|
|
- for(let i in this.formData){
|
|
|
- data.zero[i]=this.formData[i]
|
|
|
- };
|
|
|
- this.downProduction({
|
|
|
- title: "下生产排产",
|
|
|
- type: 1,
|
|
|
- params: data,
|
|
|
- then: (e) => {
|
|
|
- this.getData(this.proxyObj);
|
|
|
- },
|
|
|
- cancel: (e) => {},
|
|
|
- });
|
|
|
- return;
|
|
|
- }else{
|
|
|
- return this.$Message.warning("请至少选择一项");
|
|
|
+ if (
|
|
|
+ this.formData.house ||
|
|
|
+ this.formData.unit ||
|
|
|
+ this.formData.layer ||
|
|
|
+ this.formData.number_detail ||
|
|
|
+ this.formData.part ||
|
|
|
+ this.formData.product ||
|
|
|
+ this.formData.process_router ||
|
|
|
+ this.formData.part_state ||
|
|
|
+ this.formData.img_number
|
|
|
+ ) {
|
|
|
+ // this.axios.post('/api/orders_plan',this.formData);
|
|
|
+ let data = { zero: {}, type: 1 };
|
|
|
+ data.zero.order_no = this.$route.query.order_no;
|
|
|
+ for (let i in this.formData) {
|
|
|
+ data.zero[i] = this.formData[i];
|
|
|
}
|
|
|
-
|
|
|
+ this.downProduction({
|
|
|
+ title: "下生产排产",
|
|
|
+ type: 1,
|
|
|
+ params: data,
|
|
|
+ then: (e) => {
|
|
|
+ this.getData(this.proxyObj);
|
|
|
+ },
|
|
|
+ cancel: (e) => {},
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ return this.$Message.warning("请至少选择一项");
|
|
|
+ }
|
|
|
}
|
|
|
let result = [];
|
|
|
row.map((v) => result.push(v.pr_id));
|
|
@@ -1380,12 +1388,16 @@ export default {
|
|
|
})
|
|
|
.then((resp) => {
|
|
|
if (resp.code == 200) {
|
|
|
- const result = resp.data;
|
|
|
- console.log(result, "多打印");
|
|
|
- this.handlePrintChips(resp.data);
|
|
|
- // if (result && result.length > 0) {
|
|
|
- // result.map((ele) => this.printDemo(ele));
|
|
|
- // }
|
|
|
+ this.axios.get("/api/get_print_local_url").then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.data.state) {
|
|
|
+ this.handlePrintChipsUsb(resp.data, res.data.type);
|
|
|
+ } else {
|
|
|
+ this.handlePrintChipsIp(resp.data, res.data.type);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1413,12 +1425,211 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
- handlePrintChips(contents) {
|
|
|
+ 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();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handlePrintChipsIp(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";
|
|
|
+ data.reqParam = "1"; //这个一般不用改,如需改,查api
|
|
|
let printparamsJsonArray = [];
|
|
|
// let IP = "192.168.1.58";//print_url
|
|
|
// let IP = "192.168.0.199"; //print_url
|
|
@@ -1434,164 +1645,184 @@ export default {
|
|
|
PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
|
|
|
});
|
|
|
printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
|
|
|
- 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,
|
|
|
+ console.log(`contents`, contents);
|
|
|
+ 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" });
|
|
|
});
|
|
|
- // 17,35 420
|
|
|
- printparamsJsonArray.push({
|
|
|
- PTK_RWRFIDLabel:
|
|
|
- "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
|
|
|
+ } 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_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_CloseConnect: "" });
|
|
|
data.printparams = printparamsJsonArray;
|
|
|
- // data.printparams = JSON.stringify(printparamsJsonArray);
|
|
|
- this.test_content = JSON.stringify(data);
|
|
|
- this.test_url = url;
|
|
|
- this.test_modal = true;
|
|
|
+ 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();
|
|
|
+ },
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
handleConnectPrinter() {
|