Commit 20ba1f5f by liangjianmin

js

parent 43e048e3
......@@ -37,7 +37,7 @@
}, {
"path": "pages/tag/repairPrint",
"style": {
"navigationBarTitleText": "补打标签"
"navigationBarTitleText": "追加标签"
}
}, {
"path": "pages/goods/receiving",
......
......@@ -100,7 +100,7 @@ export default {
tips: ''
},
{
name: '补打标签',
name: '追加标签',
iconfont: 'icon-juxing9',
tips: ''
},
......@@ -162,7 +162,7 @@ export default {
uni.navigateTo({
url: '/pages/tag/print'
});
} else if (item.name == '补打标签') {
} else if (item.name == '追加标签') {
uni.navigateTo({
url: '/pages/tag/repairPrint'
});
......
......@@ -30,11 +30,11 @@
</view>
<view class="box row verCenter">
<view class="label">入仓号</view>
<input type="number" @input="onKeyInput" v-model="form.erp_order_sn_number" placeholder-style="font-size:24rpx;color:#404547;" class="uni-input" placeholder="请输入" />
<input type="number" v-model="form.erp_order_sn_number" placeholder-style="font-size:24rpx;color:#404547;" class="uni-input" placeholder="请输入" />
</view>
<view class="box row verCenter">
<view class="label">{{ text }}</view>
<input type="number" v-model="form.label_sort" placeholder-style="font-size:24rpx;color:#404547;" class="uni-input" placeholder="请输入" />
<input type="number" v-model="form.label_num" placeholder-style="font-size:24rpx;color:#404547;" class="uni-input" placeholder="请输入" />
</view>
</view>
<view class="btn row rowCenter verCenter" @click="submit()">提交打印</view>
......@@ -54,7 +54,7 @@ export default {
deviceId: '',
device_name: '',
characteristics: '',
text: '标签数量',
text: '总箱数',
index_erp_order_sn_pre: -1,
index_print_type: 0,
items_erp_order_sn_pre: ['A单号', 'B单号', 'D单号'],
......@@ -62,15 +62,13 @@ export default {
sendData64: '',
platform: 'android',
printLabelData: [],
print_text: '总箱数',
print_type: 1,
wstyptll_id: '',
form: {
is_add: 1,
print_type: 1,
erp_order_sn_pre: '',
erp_order_sn_number: '',
label_sort: ''
label_num: ''
}
};
},
......@@ -104,43 +102,25 @@ export default {
}
},
methods: {
onKeyInput: function(event) {
if (event.target.value.length > 3) {
this.getErpOrderSnPrintLabelType();
}
},
getErpOrderSnPrintLabelType() {
this.request(API.getErpOrderSnPrintLabelType, 'POST', { erp_order_sn: this.form.erp_order_sn_pre + this.form.erp_order_sn_number }, false).then(res => {
if (res.err_code === 0) {
if (res.data == 1) {
this.text = '标签数量';
this.print_type = 2;
} else {
this.text = '总箱数';
this.print_type = 1;
}
}
});
},
submit() {
// if (!this.device_name) {
// uni.showModal({
// title: '提示',
// content: '请连接蓝牙设备',
// showCancel: false,
// confirmText: '关闭',
// success: function(res) {
// if (res.confirm) {
// uni.navigateTo({
// url: '/pages/tag/deviceList'
// });
// } else if (res.cancel) {
// console.log('用户点击取消');
// }
// }
// });
// return false;
// }
if (!this.device_name) {
uni.showModal({
title: '提示',
content: '请连接蓝牙设备',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/tag/deviceList'
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
return false;
}
if (!this.form.erp_order_sn_pre) {
uni.showToast({
icon: 'error',
......@@ -164,7 +144,7 @@ export default {
return false;
}
if (!this.form.label_sort) {
if (!this.form.label_num) {
uni.showToast({
icon: 'error',
title: '请输入' + this.text
......@@ -172,7 +152,7 @@ export default {
return false;
}
if (!/(^[0-9]*$)/.test(this.form.label_sort)) {
if (!/(^[0-9]*$)/.test(this.form.label_num)) {
uni.showToast({
icon: 'error',
title: this.text + '为纯数字'
......@@ -180,7 +160,7 @@ export default {
return false;
}
this.request(API.getPrintLabel, 'POST', { erp_order_sn: this.form.erp_order_sn_pre + this.form.erp_order_sn_number, label_sort: this.form.label_sort, is_add: 1, print_type: this.form.print_type }, true).then(res => {
this.request(API.printLabel, 'POST', { erp_order_sn_pre: this.form.erp_order_sn_pre, erp_order_sn_number: this.form.erp_order_sn_number, label_num: this.form.label_num, is_add: 1, print_type: this.form.print_type }, true).then(res => {
if (res.err_code === 0) {
this.printLabelData = res.data;
this.wstyptll_id = res.data[0].wstyptll_id;
......
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