Commit 5601a7cf by liangjianmin

bug

parent d0a9214f
......@@ -79,6 +79,7 @@
<script>
import { API } from '@/util/api.js';
import { titleCase } from '@/util/util.js';
import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default {
......@@ -244,7 +245,6 @@ export default {
});
return false;
}
if (!this.form.total_num) {
uni.showModal({
title: '提示',
......@@ -254,6 +254,26 @@ export default {
return false;
}
if (!this.form.logistics_company) {
uni.showModal({
title: '提示',
content: '请选择物流公司',
showCancel: false
});
return false;
}
if (!this.form.logistics_number) {
uni.showModal({
title: '提示',
content: '请输入物流单号',
showCancel: false
});
return false;
}
this.form.erp_order_sn = titleCase(this.form.erp_order_sn); //自动转成大写
this.request(API.addCheckIn, 'POST', this.form, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
......
......@@ -484,7 +484,7 @@ export default {
data.push('T 8 0 10 170 仓库代码:' + this.printLabelData[this.print_number].warehouse_code + '\r\n');
data.push('T 8 0 10 220 流水号:' + this.printLabelData[this.print_number].wstyptll_id_sn + '\r\n');
data.push('B QR 260 20 M 2 U 8\r\n');
data.push('MA,' + this.printLabelData[this.print_number].erp_order_sn + ',\r\n');
data.push('MA,' + this.printLabelData[this.print_number].erp_order_sn + '|\r\n');
data.push('ENDQR\r\n');
data.push('FORM\r\n');
data.push('PRINT\r\n');
......
......@@ -36,7 +36,7 @@
<view class="label">{{ text }}</view>
<input type="number" v-model="form.label_num" placeholder-style="font-size:24rpx;color:#404547;" class="uni-input" placeholder="请输入" />
</view>
<!-- <view class="box row verCenter">
<!-- <view class="box row verCenter">
<view class="label">放置托盘</view>
<view class="el-select row verCenter">
<picker @change="bindPickerChange" :value="index" :range="traySelectOption" range-key="tray_sn">
......@@ -87,7 +87,7 @@ export default {
console.log('停止搜索', JSON.stringify(res.errMsg));
}
});
try {
uni.removeStorageSync('device');
} catch (e) {
......@@ -96,7 +96,7 @@ export default {
},
onShow() {
//获取已连接蓝牙设备信息
const deviceData = uni.getStorageSync('device') || '';
const deviceData = uni.getStorageSync('device') || '';
if (deviceData) {
this.deviceId = deviceData.deviceId;
this.serviceId = deviceData.serviceId;
......@@ -211,18 +211,21 @@ export default {
console.log('第' + this.print_number + '次打印');
let data = [];
if (this.printLabelData.length > 0) {
data.push('! 60 200 200 250 1\r\n');
data.push('T 5 0 10 20 入仓号:' + this.printLabelData[this.print_number].erp_order_sn + '\r\n');
data.push('! 60 200 200 300 1\r\n');
data.push('SETMAG 3 4\r\n');
data.push('T 7 0 10 20 ' + this.printLabelData[this.print_number].erp_order_sn + '\r\n');
data.push('SETMAG 0 0\r\n');
if (this.form.print_type == 1) {
data.push('T 5 0 10 70 总箱数:' + this.printLabelData[this.print_number].label_num + '箱\r\n');
data.push('T 5 0 10 120 总箱数:' + this.printLabelData[this.print_number].label_num + '箱\r\n');
} else {
data.push('T 5 0 10 70 箱号:' + this.printLabelData[this.print_number].label_sort + '/' + this.printLabelData[this.print_number].label_num + '\r\n');
data.push('T 5 0 10 120 箱号:' + this.printLabelData[this.print_number].label_sort + '/' + this.printLabelData[this.print_number].label_num + '\r\n');
}
data.push('T 5 0 10 120 时间:' + this.printLabelData[this.print_number].create_time_cn + '\r\n');
data.push('T 5 0 10 170 仓库代码:' + this.printLabelData[this.print_number].warehouse_code + '\r\n');
data.push('T 5 0 10 220 流水号:' + this.printLabelData[this.print_number].wstyptll_id_sn + '\r\n');
data.push('B QR 260 20 M 2 U 8\r\n');
data.push('MA,' + this.printLabelData[this.print_number].erp_order_sn + ',\r\n');
data.push('SETMAG 0 0\r\n');
data.push('T 8 0 10 190 时间:' + this.printLabelData[this.print_number].create_time_cn + '\r\n');
data.push('T 8 0 10 230 仓库代码:' + this.printLabelData[this.print_number].warehouse_code + '\r\n');
data.push('T 8 0 10 270 流水号:' + this.printLabelData[this.print_number].wstyptll_id_sn + '\r\n');
data.push('B QR 280 110 M 2 U 8\r\n');
data.push('MA,' + this.printLabelData[this.print_number].erp_order_sn + '|\r\n');
data.push('ENDQR\r\n');
data.push('FORM\r\n');
data.push('PRINT\r\n');
......
......@@ -190,17 +190,21 @@ export default {
console.log('第' + this.print_number + '次打印');
let data = [];
if (this.printLabelData.length > 0) {
data.push('! 60 200 200 200 1\r\n');
data.push('T 5 0 10 20 入仓号:' + this.printLabelData[this.print_number].erp_order_sn + '\r\n');
data.push('! 60 200 200 300 1\r\n');
data.push('SETMAG 3 4\r\n');
data.push('T 7 0 10 20 ' + this.printLabelData[this.print_number].erp_order_sn + '\r\n');
data.push('SETMAG 0 0\r\n');
if (this.print_type == 1) {
data.push('T 5 0 10 70 总箱数:' + this.printLabelData[this.print_number].label_num + '箱\r\n');
data.push('T 5 0 10 120 总箱数:' + this.printLabelData[this.print_number].label_num + '箱\r\n');
} else {
data.push('T 5 0 10 70 箱号:' + this.printLabelData[this.print_number].label_sort + '/' + this.printLabelData[this.print_number].label_num + '\r\n');
data.push('T 5 0 10 120 箱号:' + this.printLabelData[this.print_number].label_sort + '/' + this.printLabelData[this.print_number].label_num + '\r\n');
}
data.push('T 5 0 10 120 时间:' + this.printLabelData[this.print_number].create_time_cn + '\r\n');
data.push('T 5 0 10 170 仓库代码:' + this.printLabelData[this.print_number].warehouse_code + '\r\n');
data.push('B QR 290 20 M 2 U 8\r\n');
data.push('MA,' + this.printLabelData[this.print_number].erp_order_sn + ',\r\n');
data.push('SETMAG 0 0\r\n');
data.push('T 8 0 10 190 时间:' + this.printLabelData[this.print_number].create_time_cn + '\r\n');
data.push('T 8 0 10 230 仓库代码:' + this.printLabelData[this.print_number].warehouse_code + '\r\n');
data.push('T 8 0 10 270 流水号:' + this.printLabelData[this.print_number].wstyptll_id_sn + '\r\n');
data.push('B QR 280 110 M 2 U 8\r\n');
data.push('MA,' + this.printLabelData[this.print_number].erp_order_sn + '|\r\n');
data.push('ENDQR\r\n');
data.push('FORM\r\n');
data.push('PRINT\r\n');
......
......@@ -58,7 +58,16 @@ const getPlatform = () => {
}
/**
* 首字母转成大写
*/
const titleCase = (str) => {
str = str.toLowerCase().split(" ").map(function(val) { return val.replace(/( |^)[a-z]/g, function(L) { return L.toUpperCase(); }); }).join(" ");
return str;
}
module.exports = {
request,
getPlatform
getPlatform,
titleCase
}
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