Commit 8a5d98bf by LJM

移动端--拣货--权限及标签打印等优化

parent 6939c8e6
...@@ -482,7 +482,6 @@ ...@@ -482,7 +482,6 @@
.t1 { .t1 {
font-size: 20rpx; font-size: 20rpx;
color: #1969f9; color: #1969f9;
font-weight: bold;
} }
.print-type-box { .print-type-box {
margin-left: 12rpx; margin-left: 12rpx;
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<view class="search-bar row bothSide verCenter" :class="{ 'disabled-color': searchParams.position_name == '' ? true : false }"> <view class="search-bar row bothSide verCenter" :class="{ 'disabled-color': searchParams.position_name == '' ? true : false }">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<!-- 批量扫描 -->
<template v-if="is_batch"> <template v-if="is_batch">
<input class="uni-input" placeholder="请扫描入库标签" :disabled="searchParams.position_name == '' ? true : false" placeholder-style="color:#919399" :focus="isFocus" v-model="search_keyword" @input="handleInput(2, search_keyword)" maxlength="15" ref="myInput" /> <input class="uni-input" placeholder="请扫描入库标签" :disabled="searchParams.position_name == '' ? true : false" placeholder-style="color:#919399" :focus="isFocus" v-model="search_keyword" @input="handleInput(2, search_keyword)" maxlength="15" ref="myInput" />
</template> </template>
...@@ -222,7 +223,7 @@ ...@@ -222,7 +223,7 @@
<text class="label">货品编码:</text> <text class="label">货品编码:</text>
<text class="tt" style="max-width: 100%;">{{ detail.goods_sn }}</text> <text class="tt" style="max-width: 100%;">{{ detail.goods_sn }}</text>
</view> </view>
<view class="item row verCenter"> <view class="item row verCenter" v-if="detail.sku_id > 0">
<text class="label">自营货品ID:</text> <text class="label">自营货品ID:</text>
<text class="tt" style="max-width: 100%;">{{ detail.sku_id }}</text> <text class="tt" style="max-width: 100%;">{{ detail.sku_id }}</text>
</view> </view>
...@@ -335,7 +336,12 @@ ...@@ -335,7 +336,12 @@
</view> </view>
<!-- 拆货打印标签--> <!-- 拆货打印标签-->
<view class="print row verCenter" v-if="warehouse_id == 9"> <view class="print row verCenter" v-if="warehouse_id == 9">
<text class="t1" @click="rePrintTag(1)">拆货打印标签</text> <checkbox-group @change="onCheckboxChange">
<label>
<checkbox value="1" color="#1969f9" style="transform:scale(0.7)" checked />
</label>
</checkbox-group>
<text class="t1">拆货打印标签</text>
<view class="print-type-box row rowCenter verCenter"> <view class="print-type-box row rowCenter verCenter">
<picker @change="bindPickerChange" :value="print_style_index" :range="print_style" class="row rowCenter verCenter"> <picker @change="bindPickerChange" :value="print_style_index" :range="print_style" class="row rowCenter verCenter">
<view class="row rowCenter verCenter"> <view class="row rowCenter verCenter">
...@@ -538,6 +544,7 @@ ...@@ -538,6 +544,7 @@
data() { data() {
return { return {
isApp: uni.getSystemInfoSync().platform === 'android' || uni.getSystemInfoSync().platform === 'ios', isApp: uni.getSystemInfoSync().platform === 'android' || uni.getSystemInfoSync().platform === 'ios',
is_print: true, //是否打印货品标签
old_Label: false, //旧标签默认false old_Label: false, //旧标签默认false
isFocus: false, isFocus: false,
is_batch: true, //是否开启批量 is_batch: true, //是否开启批量
...@@ -608,6 +615,14 @@ ...@@ -608,6 +615,14 @@
}, },
methods: { methods: {
/** /**
* @param {Object} e
* 拆货打印标签监听是否选择
*/
onCheckboxChange(e) {
console.log('check 发生 change 事件,携带值为', e.detail.value);
this.is_print = e.detail.value.includes('1');
},
/**
* 打印货品标签样式切换监听 * 打印货品标签样式切换监听
* @param {Object} e * @param {Object} e
...@@ -623,7 +638,7 @@ ...@@ -623,7 +638,7 @@
switchChange(e, type) { switchChange(e, type) {
console.log('switch 发生 change 事件,携带值为', e.detail.value); console.log('switch 发生 change 事件,携带值为', e.detail.value);
if (type == 1) { if (type == 1) {
this.old_Label = e.detail.value;
} else { } else {
this.is_batch = e.detail.value; this.is_batch = e.detail.value;
//重置相关数据 //重置相关数据
...@@ -965,38 +980,6 @@ ...@@ -965,38 +980,6 @@
}); });
}, },
/** /**
*打印货品标签
*/
rePrintTag(type) {
if (type == 1) {
this.rePrintTagParams.stock_out_item_id = this.detail.stock_out_item_id;
this.rePrintTagParams.recheck_num = this.formParams.pick_qty;
} else {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请勾选数据',
icon: 'error'
});
return false;
}
this.rePrintTagParams.stock_out_item_id = this.rePrintTagParams.stock_out_item_id.join(','); //出库明细ids
}
this.request(API.RePrintTag, 'POST', this.rePrintTagParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 监听拣货数量 * 监听拣货数量
*/ */
handleInputNumber: debounce(function(event, num) { handleInputNumber: debounce(function(event, num) {
...@@ -1007,6 +990,22 @@ ...@@ -1007,6 +990,22 @@
} }
}, 500), }, 500),
/** /**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
this.searchParams.position_name = '';
this.input_flag_position_name = false;
} else if (type == 2) {
this.searchParams.stock_in_batch_sn = '';
this.input_flag_stock_in_batch_sn = false;
} else if (type == 3) {
this.searchParams.container_sn = '';
this.input_flag_container_sn = false;
}
this.getData();
},
/**
* 获取列表数据 * 获取列表数据
*/ */
getData(callback) { getData(callback) {
...@@ -1023,15 +1022,19 @@ ...@@ -1023,15 +1022,19 @@
title: this.stock_out_sn + '拣货' title: this.stock_out_sn + '拣货'
}); });
// 在进行条件判断之前,保存原始的stock_in_batch_sn值
const originalStockInBatchSn = this.searchParams.stock_in_batch_sn;
//入库批次号为自营仓库的时候,输入文本后自动截取前8位,作为入库批次号传给后台进行校验。 //入库批次号为自营仓库的时候,输入文本后自动截取前8位,作为入库批次号传给后台进行校验。
if (this.warehouse_id == 9 && this.old_Label) { if (this.warehouse_id == 9 && this.old_Label) {
this.searchParams.stock_in_batch_sn = this.searchParams.stock_in_batch_sn.substring(0, 8); this.searchParams.stock_in_batch_sn = this.searchParams.stock_in_batch_sn.substring(0, 8);
} else {
this.searchParams.stock_in_batch_sn = originalStockInBatchSn;
} }
this.request(URL, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { this.request(URL, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
//过滤出应拣数量不为0的数据 //过滤出应拣数量不为0的数据
if (this.curr == 0) { if (this.curr == 0) {
var filteredList = res.data.list.filter(item => item.lock_qty - item.pick_qty > 0); var filteredList = res.data.list.filter(item => item.lock_qty - item.pick_qty > 0);
...@@ -1051,20 +1054,37 @@ ...@@ -1051,20 +1054,37 @@
}); });
}, },
/** /**
* 清空数据 *打印货品标签
*/ */
clearInput(type) { rePrintTag(type) {
//根据情景序列号不同的参数
if (type == 1) { if (type == 1) {
this.searchParams.position_name = ''; this.rePrintTagParams.stock_out_item_id = this.detail.stock_out_item_id;
this.input_flag_position_name = false; this.rePrintTagParams.recheck_num = this.formParams.pick_qty;
} else if (type == 2) { } else {
this.searchParams.stock_in_batch_sn = ''; if (this.filter_id.length == 0) {
this.input_flag_stock_in_batch_sn = false; uni.showToast({
} else if (type == 3) { title: '请勾选数据',
this.searchParams.container_sn = ''; icon: 'error'
this.input_flag_container_sn = false; });
return false;
}
this.rePrintTagParams.stock_out_item_id = this.rePrintTagParams.stock_out_item_id.join(','); //出库明细ids
} }
this.getData();
this.request(API.RePrintTag, 'POST', this.rePrintTagParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
}, },
/** /**
* 按货品拣货提交 * 按货品拣货提交
...@@ -1081,6 +1101,12 @@ ...@@ -1081,6 +1101,12 @@
title: '拣货成功', title: '拣货成功',
icon: 'success' icon: 'success'
}); });
//如果勾选了打印则触发打印
if (is_print) {
this.rePrintTag(1);
}
setTimeout(() => { setTimeout(() => {
this.getData(); this.getData();
if (pick_qty_num == num) { if (pick_qty_num == num) {
...@@ -1089,7 +1115,7 @@ ...@@ -1089,7 +1115,7 @@
} else { } else {
this.picked_num = Number(this.picked_num) - pick_qty_num; this.picked_num = Number(this.picked_num) - pick_qty_num;
} }
}, 2000); }, 4000);
} else { } else {
uni.showModal({ uni.showModal({
itle: '提示', itle: '提示',
......
...@@ -640,7 +640,6 @@ ...@@ -640,7 +640,6 @@
this.searchParams.goods_name = ''; this.searchParams.goods_name = '';
this.is_focus = true; this.is_focus = true;
}, 500); }, 500);
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
......
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