Commit 1ea3c773 by liangjianmin

js

parent 2fc34521
......@@ -38,7 +38,6 @@
import { API } from '@/util/api.js';
import { getPlatform } from '@/util/util.js'
const ToBase64 = require('../../util/base64gb2312.js');
const cpclExp = require('../../util/cpcl-exp.js');
export default {
data() {
......@@ -57,6 +56,7 @@
sendData64: '',
platform: 'android',
printLabelData: [],
print_text: '总箱数',
form: {
erp_order_sn_pre: '',
print_type: 1,
......@@ -132,7 +132,6 @@
this.request(API.printLabel, 'POST', this.form, false).then(res => {
if (res.err_code === 0) {
this.printLabelData = res.data;
this.sendDataChangeAll();
this.openBluetoothAdapter();
} else {
uni.showToast({
......@@ -240,8 +239,12 @@
var h = 0; //记录高度增量
data.push("! 10 200 200 " + (this.printLabelData.length * 250) + " 1\r\n");
for (let i = 0; i < this.printLabelData.length; i++) {
data.push("T 8 0 10 " + ((50 * (i + 1)) - (30 * 1) + h) + " 入仓号:" + this.printLabelData[i].erp_order_sn + "\r\n")
data.push("T 8 0 10 " + ((50 * (i + 2)) - (30 * 1) + h) + " 箱号:" + this.printLabelData[i].label_sort + '/' + this.printLabelData[0].label_num + "\r\n");
data.push("T 8 0 10 " + ((50 * (i + 1)) - (30 * 1) + h) + " 入仓号:" + this.printLabelData[i].erp_order_sn + "\r\n");
if (this.form.print_type == 1) {
data.push("T 8 0 10 " + ((50 * (i + 2)) - (30 * 1) + h) + " 总箱数:" + this.printLabelData[0].label_num + "箱\r\n");
} else {
data.push("T 8 0 10 " + ((50 * (i + 2)) - (30 * 1) + h) + " 箱号:" + this.printLabelData[i].label_sort + '/' + this.printLabelData[0].label_num + "\r\n");
}
data.push("T 8 0 10 " + ((50 * (i + 3)) - (30 * 1) + h) + " 时间:" + this.printLabelData[i].create_time_cn + "\r\n");
data.push("T 8 0 10 " + ((50 * (i + 4)) - (30 * 1) + h) + " 仓库代码:" + i + "\r\n");
data.push("B QR 290 " + ((50 * (i + 1)) - (30 * 1) + h) + " M 2 U 8\r\n");
......@@ -341,9 +344,11 @@
if (index == 0) {
this.form.print_type = 1;
this.text = '总箱数';
this.print_text = '总箱数';
} else if (index == 1) {
this.text = '标签数量';
this.form.print_type = 2;
this.text = '标签数量';
this.print_text = '箱号';
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment