Commit cf59893b by LJM

香港wms-理货确认-打印标签

parent 7f901591
...@@ -61,11 +61,11 @@ ...@@ -61,11 +61,11 @@
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import { getPlatform } from '@/util/util.js'; import { getPlatform, findIndexOrZero } from '@/util/util.js';
const ToBase64 = require('../../util/base64gb2312.js'); const ToBase64 = require('../../util/base64gb2312.js');
export default { export default {
data() { data() {
return { return {
print_number: 0, print_number: 0,
...@@ -97,11 +97,38 @@ export default { ...@@ -97,11 +97,38 @@ export default {
label_num: '1', //总箱数 label_num: '1', //总箱数
number: 1, number: 1,
numbers: [] numbers: []
},
printParams: {
board_num: '', //板子数
box_num: '', //箱子数
erp_order_sn: '' //入仓号
} }
}; };
}, },
onLoad(option) { onLoad(option) {
this.platform = getPlatform(); this.platform = getPlatform();
this.printParams.board_num = option.board_num || '';
this.printParams.box_num = option.box_num || '';
this.printParams.erp_order_sn = option.erp_order_sn || '';
//如果【理货确认-箱】有数值,则【打印标签】打印类型为【散箱】并继承数据【标签数量】
if (this.printParams.box_num) {
this.index_print_type = 1;
this.form.label_num = this.printParams.box_num;
this.form.erp_order_sn = this.printParams.erp_order_sn;
}
//如果【理货确认-板】有数值,则【打印标签】打印类型为【卡板】并继承卡板数
if (this.printParams.board_num) {
this.index_print_type = 0;
this.form.erp_order_sn = this.printParams.erp_order_sn;
this.numberIndex = findIndexOrZero(this.numberArr, Number(this.printParams.board_num)); //匹配到卡板数就选中,否则就是默认0
}
//如果【理货确认-板/箱 均不为0】,则【打印标签】打印类型只继承入仓号,打印类型默认为【散箱】标签数量1 批次为0(保持原默认值)
if (this.printParams.box_num && this.printParams.board_num) {
this.form.erp_order_sn = this.printParams.erp_order_sn;
}
//停止搜索,节省系统资源 //停止搜索,节省系统资源
uni.stopBluetoothDevicesDiscovery({ uni.stopBluetoothDevicesDiscovery({
...@@ -414,8 +441,7 @@ export default { ...@@ -414,8 +441,7 @@ export default {
}, },
delErpOrderSnCodeManage() { delErpOrderSnCodeManage() {
this.request(API.delWstyptllIdErpOrderSnCodeManage, 'POST', { wstyptll_id: this.wstyptll_id }, false).then(res => { this.request(API.delWstyptllIdErpOrderSnCodeManage, 'POST', { wstyptll_id: this.wstyptll_id }, false).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {} else {
} else {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: res.err_msg, content: res.err_msg,
...@@ -447,9 +473,9 @@ export default { ...@@ -447,9 +473,9 @@ export default {
} }
} }
} }
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '../../assets/css/tag/print.scss'; @import '../../assets/css/tag/print.scss';
</style> </style>
\ No newline at end of file
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
</view> </view>
</view> </view>
<view class="btn row rowCenter verCenter" @click="submit()" :class="{ disabled: disabled }">确认提交</view> <view class="btn row rowCenter verCenter" @click="submit()" :class="{ disabled: disabled }">确认提交</view>
<view class="btn row rowCenter verCenter" style="margin-top: 12rpx;background-color: #f00;" @click="submit(1)" :class="{ disabled: disabled }">确认提交并打印</view>
</view> </view>
</template> </template>
...@@ -456,9 +457,10 @@ ...@@ -456,9 +457,10 @@
this.form.customs_clearance_price = index; this.form.customs_clearance_price = index;
}, },
/** /**
* @param {Object} type 1提交并打印
* 提交 * 提交
*/ */
submit() { submit(type) {
if (!this.form.erp_order_sn) { if (!this.form.erp_order_sn) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
...@@ -524,11 +526,18 @@ ...@@ -524,11 +526,18 @@
showCancel: false, showCancel: false,
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
if (type == 1) {
//点击【确认提交并打印】跳转至【打印标签】页面
uni.navigateTo({
url: '/pages/tag/print?board_num=' + this.form.board_num + '&box_num=' + this.form.box_num + '&erp_order_sn=' + this.form.erp_order_sn
})
} else {
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}); });
}, 2000); }, 2000);
}
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); console.log('用户点击取消');
} }
......
...@@ -86,7 +86,6 @@ const debounce = (fn, wait) => { ...@@ -86,7 +86,6 @@ const debounce = (fn, wait) => {
} }
} }
/** /**
* 来创建指定长度且所有元素都被初始化为 false 的数组 * 来创建指定长度且所有元素都被初始化为 false 的数组
*/ */
...@@ -94,11 +93,21 @@ const createArray = (length, value) => { ...@@ -94,11 +93,21 @@ const createArray = (length, value) => {
return Array(length).fill(value); return Array(length).fill(value);
} }
/**
* 数组内找出对于的索引
*/
const findIndexOrZero = (arr, value) => {
var index = arr.indexOf(value);
return index !== -1 ? index : 0;
}
module.exports = { module.exports = {
request, request,
getPlatform, getPlatform,
titleCase, titleCase,
debounce, debounce,
createArray createArray,
findIndexOrZero
} }
\ No newline at end of file
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