Commit 54d35eda by LJM

add

parent 56c7996c
...@@ -30,9 +30,11 @@ ...@@ -30,9 +30,11 @@
color: #197adb; color: #197adb;
} }
.icon-jinggao2 { .icon-jinggao2 {
position: relative;
font-size: 30rpx; font-size: 30rpx;
color: #c6c7cc; color: #c6c7cc;
margin-right: 30rpx; margin-right: 30rpx;
z-index: 22;
} }
} }
.select-box { .select-box {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</view> </view>
<view class="action-bar row verCenter"> <view class="action-bar row verCenter">
<text class="iconfont icon-jinggao2" @click="clearInput(1)" v-if="box_sn"></text> <text class="iconfont icon-jinggao2" @click="clearInput(1)" v-if="box_sn"></text>
<template v-if="wsty_id"> <template v-if="box_sn && wsty_id">
<view class="btn1 row rowCenter verCenter" @click="print()" style="margin-right: 8rpx;">打印箱号</view> <view class="btn1 row rowCenter verCenter" @click="print()" style="margin-right: 8rpx;">打印箱号</view>
<view class="btn row rowCenter verCenter" @click="getBoxSn()">取箱号</view> <view class="btn row rowCenter verCenter" @click="getBoxSn()">取箱号</view>
</template> </template>
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
fixBoxStyle: '', fixBoxStyle: '',
noexebshowFalg: true, //控制是否会触发生命周期 noexebshowFalg: true, //控制是否会触发生命周期
index: 0, index: 0,
item: ['其他', 'DigiKey', 'Rochester', 'TME', 'Chip1stop', 'Mouser'], item: ['型号', 'DigiKey', 'Rochester', 'TME', 'Chip1stop', 'Mouser'],
box_sn: '', //箱号信息 box_sn: '', //箱号信息
wsty_id: '', //箱子id wsty_id: '', //箱子id
erp_order_sn: '', //入仓号 erp_order_sn: '', //入仓号
...@@ -279,31 +279,6 @@ ...@@ -279,31 +279,6 @@
this.$refs.inputDialog.close(); this.$refs.inputDialog.close();
}, },
/** /**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
this.box_sn = '';
this.is_focus_1 = false;
setTimeout(() => {
this.is_focus_1 = true;
}, 200);
} else if (type == 2) {
this.erp_order_sn = '';
this.is_focus_2 = false;
setTimeout(() => {
this.is_focus_2 = true;
}, 200);
} else if (type == 3) {
this.goods_type = '';
this.keyword = '';
this.is_focus_3 = false;
setTimeout(() => {
this.is_focus_3 = true;
}, 200);
}
},
/**
* 找出false对应的下标 * 找出false对应的下标
* @param {Object} arr * @param {Object} arr
* @param {Object} target * @param {Object} target
...@@ -351,6 +326,10 @@ ...@@ -351,6 +326,10 @@
} else if (type == 2) { } else if (type == 2) {
if (value) { if (value) {
this.identifyQrCodeNumAndSn(); this.identifyQrCodeNumAndSn();
} else {
this.goods_type = '';
this.keyword = '';
this.getTallyData();
} }
} else if (type == 3) { } else if (type == 3) {
this.origin_list = []; //数组清空 this.origin_list = []; //数组清空
...@@ -567,6 +546,7 @@ ...@@ -567,6 +546,7 @@
this.step = 2; //标记点击了哪个按钮 this.step = 2; //标记点击了哪个按钮
if (this.index == 0) { if (this.index == 0) {
//区分其他 //区分其他
this.keyword = '';
this.getTallyData(); this.getTallyData();
} else { } else {
let codeTypeByIndex = { let codeTypeByIndex = {
...@@ -699,6 +679,11 @@ ...@@ -699,6 +679,11 @@
this.image_list[index] = item.goods_check_pic.split(','); this.image_list[index] = item.goods_check_pic.split(',');
} }
}); });
} else {
uni.showToast({
title: '查询不到该箱号信息',
icon: 'none'
});
} }
} else { } else {
uni.showToast({ uni.showToast({
...@@ -920,6 +905,32 @@ ...@@ -920,6 +905,32 @@
}); });
}, },
/** /**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
this.box_sn = '';
this.is_focus_1 = false;
setTimeout(() => {
this.is_focus_1 = true;
}, 200);
} else if (type == 2) {
this.erp_order_sn = '';
this.is_focus_2 = false;
setTimeout(() => {
this.is_focus_2 = true;
}, 200);
} else if (type == 3) {
this.goods_type = '';
this.keyword = '';
this.is_focus_3 = false;
this.getTallyData();
setTimeout(() => {
this.is_focus_3 = true;
}, 200);
}
},
/**
* 再次获取焦点 * 再次获取焦点
*/ */
clearInputAndFocus() { clearInputAndFocus() {
......
<template> <template>
<view class="unboxing"> <view class="unboxing">
<view class="input-box row bothSide verCenter"> <view class="input-box row bothSide verCenter">
<input class="uni-input" placeholder="输入或扫描箱号" placeholder-style="color:#000;font-weight: bold;" v-model="box_sn" @input="handleInput($event,1)" /> <input class="uni-input" placeholder="输入或扫描箱号" :focus="is_focus_1" placeholder-style="color:#000;font-weight: bold;" v-model="box_sn" @input="handleInput($event,1)" />
<template v-if="tallyData.detail && tallyData.detail.length > 0"> <view class="action-bar row verCenter">
<text class="iconfont icon-jinggao2" @click="clearInput(1)" v-if="box_sn"></text>
<template v-if="box_sn && tallyData.detail && tallyData.detail.length > 0">
<view class="btn1 row rowCenter verCenter" @click="closeBox()">重新封箱</view> <view class="btn1 row rowCenter verCenter" @click="closeBox()">重新封箱</view>
</template> </template>
<template v-else> <template v-else>
<view class="btn row rowCenter verCenter" @click="unboxing()">开 箱</view> <view class="btn row rowCenter verCenter" @click="unboxing()">开 箱</view>
</template> </template>
</view> </view>
<view class="column-box row bothSide verCenter" style="margin-bottom: 0;"> </view>
<view class="column-box row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<view class="select-box"> <view class="select-box">
<picker @change="bindPickerChange" :value="index" :range="item"> <picker @change="bindPickerChange" :value="index" :range="item">
...@@ -20,17 +23,18 @@ ...@@ -20,17 +23,18 @@
</picker> </picker>
</view> </view>
<view class="input-box row verCenter"> <view class="input-box row verCenter">
<!-- 其他 --> <!-- 全量 -->
<template v-if="index == 0"> <template v-if="index == 0">
<input class="uni-input" placeholder="输入或扫描" placeholder-style="color:#000;font-weight: bold;" v-model="goods_type" @input="handleInput($event,2)" /> <input class="uni-input" :focus="is_focus_2" placeholder="输入或扫描" placeholder-style="color:#000;font-weight: bold;" v-model="all_search" @input="handleInput($event,2)" />
</template> </template>
<!-- digikey等供应商--> <!-- digikey等供应商-->
<template v-else> <template v-else>
<input class="uni-input" placeholder="输入或扫描" placeholder-style="color:#000;font-weight: bold;" v-model="keyword" @input="handleInput($event,2)" /> <input class="uni-input" :focus="is_focus_2" placeholder="输入或扫描" placeholder-style="color:#000;font-weight: bold;" v-model="keyword" @input="handleInput($event,2)" />
</template> </template>
</view> </view>
</view> </view>
<view class="action-bar"> <view class="action-bar row verCenter">
<text class="iconfont icon-jinggao2" @click="clearInput(2)" v-if="all_search || keyword"></text>
<view class="btn1 row rowCenter verCenter" @click="identifyQrCodeNumAndSn()">扫 描</view> <view class="btn1 row rowCenter verCenter" @click="identifyQrCodeNumAndSn()">扫 描</view>
</view> </view>
</view> </view>
...@@ -41,12 +45,17 @@ ...@@ -41,12 +45,17 @@
<view class="title pb16 row verCenter"> <view class="title pb16 row verCenter">
<text class="t1">{{item.goods_type}}</text> <text class="t1">{{item.goods_type}}</text>
<text class="t2 row rowCenter verCenter" v-if="item.is_goods_check"></text> <text class="t2 row rowCenter verCenter" v-if="item.is_goods_check"></text>
<text class="t5 row rowCenter verCenter">{{item.sync_status_cn}}</text>
</view> </view>
<view class="pb16 row"> <view class="pb16 row">
<text class="t3 w130">物料名称:</text> <text class="t3 w130">物料名称:</text>
<text class="t4">{{item.goods_title}}</text> <text class="t4">{{item.goods_title}}</text>
</view> </view>
<view class="pb16 row"> <view class="pb16 row">
<text class="t3 w130">入仓号:</text>
<text class="t4">{{item.erp_order_sn}}</text>
</view>
<view class="pb16 row">
<text class="t3 w130">品牌:</text> <text class="t3 w130">品牌:</text>
<text class="t4">{{item.brand}}</text> <text class="t4">{{item.brand}}</text>
</view> </view>
...@@ -140,6 +149,10 @@ ...@@ -140,6 +149,10 @@
<uni-popup ref="inputDialog" type="dialog" :mask-click="true" @maskClick="maskClick"> <uni-popup ref="inputDialog" type="dialog" :mask-click="true" @maskClick="maskClick">
<uni-popup-dialog ref="inputClose" mode="input" :title="title" v-model="gross_weight" value="" confirmText="新箱子" cancelText="不需要换箱" placeholder="请输入毛重" @close="dialogInputClose" @confirm="dialogInputConfirm" :before-close="true"></uni-popup-dialog> <uni-popup-dialog ref="inputClose" mode="input" :title="title" v-model="gross_weight" value="" confirmText="新箱子" cancelText="不需要换箱" placeholder="请输入毛重" @close="dialogInputClose" @confirm="dialogInputConfirm" :before-close="true"></uni-popup-dialog>
</uni-popup> </uni-popup>
<!-- 取消理货弹窗 -->
<uni-popup ref="canelInputDialog" type="dialog" :mask-click="true" @maskClick="maskClick">
<uni-popup-dialog ref="inputClose" mode="input" title="确定取消该商品理货吗?" value="" confirmText="确定" cancelText="取消" placeholder="请输入毛重" @close="dialogInputCanelClose" @confirm="dialogInputCanelConfirm" :before-close="true"></uni-popup-dialog>
</uni-popup>
</view> </view>
</template> </template>
...@@ -151,8 +164,11 @@ ...@@ -151,8 +164,11 @@
export default { export default {
data() { data() {
return { return {
is_focus_1: true, //获取焦点动态化
is_focus_2: false, //获取焦点动态化
box_sn: '', box_sn: '',
keyword: '', keyword: '',
all_search: '', //全量搜索字段
tallyData: {}, //理货信息 tallyData: {}, //理货信息
goods_type: '', //商品型号 goods_type: '', //商品型号
image_list: [], //图片列表 image_list: [], //图片列表
...@@ -161,10 +177,11 @@ ...@@ -161,10 +177,11 @@
curr: -1, //当前打开的是哪个产地 curr: -1, //当前打开的是哪个产地
origin: '', //搜索国家携带的参数 origin: '', //搜索国家携带的参数
form: {}, form: {},
formIndex: -1, //记录打开了那个物料
title: '', title: '',
gross_weight: '', gross_weight: '',
index: 0, index: 0,
item: ['其他', 'DigiKey', 'Rochester', 'TME', 'Chip1stop', 'Mouser'], item: ['全量', 'DigiKey', 'Rochester', 'TME', 'Chip1stop', 'Mouser'],
net_weight_total: 0 //净重合计 net_weight_total: 0 //净重合计
}; };
}, },
...@@ -185,6 +202,7 @@ ...@@ -185,6 +202,7 @@
*/ */
maskClick() { maskClick() {
this.$refs.inputDialog.close(); this.$refs.inputDialog.close();
this.$refs.canelInputDialog.close();
}, },
/** /**
* 找出false对应的下标 * 找出false对应的下标
...@@ -216,6 +234,11 @@ ...@@ -216,6 +234,11 @@
} else if (type == 2) { } else if (type == 2) {
if (value) { if (value) {
this.identifyQrCodeNumAndSn(); this.identifyQrCodeNumAndSn();
} else {
this.goods_type = '';
this.keyword = '';
this.all_search = '';
this.getTallyData();
} }
} else if (type == 3) { } else if (type == 3) {
this.origin_list = []; //数组清空 this.origin_list = []; //数组清空
...@@ -471,8 +494,10 @@ ...@@ -471,8 +494,10 @@
} }
if (this.index == 0) { if (this.index == 0) {
//区分其他 //区分其他
this.goods_type = '';
this.getTallyData(); this.getTallyData();
} else { } else {
this.all_search = '';
let codeTypeByIndex = { let codeTypeByIndex = {
1: 'DigiKey', 1: 'DigiKey',
2: 'Rochester', 2: 'Rochester',
...@@ -511,7 +536,7 @@ ...@@ -511,7 +536,7 @@
* *
*/ */
getTallyData() { getTallyData() {
this.request(API.getTallyData, 'POST', { box_sn: this.box_sn, goods_type: this.goods_type }, true).then(res => { this.request(API.getTallyData, 'POST', { box_sn: this.box_sn, goods_type: this.goods_type, all_search: this.all_search }, true).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {
this.tallyData = res.data; this.tallyData = res.data;
if (res.data.detail.length > 0) { if (res.data.detail.length > 0) {
...@@ -527,7 +552,8 @@ ...@@ -527,7 +552,8 @@
wstydl_id: item.wstydl_id, // 理货明细ID wstydl_id: item.wstydl_id, // 理货明细ID
erp_order_sn: this.erp_order_sn, // 入仓号 erp_order_sn: this.erp_order_sn, // 入仓号
box_sn: this.box_sn, // 箱子 box_sn: this.box_sn, // 箱子
is_goods_check: item.is_goods_check //是否商检 is_goods_check: item.is_goods_check, //是否商检
sync_status: item.sync_status //明细同步状态
})); }));
this.image_list = res.data.detail.map(() => new Array()); //图片特殊处理 this.image_list = res.data.detail.map(() => new Array()); //图片特殊处理
...@@ -608,26 +634,16 @@ ...@@ -608,26 +634,16 @@
* 理货明细撤销 * 理货明细撤销
*/ */
cancelTallyDetail(index) { cancelTallyDetail(index) {
uni.showModal({ //推送状态为 未推送,推送失败
title: '提示', if (this.form[index].sync_status == 1 || this.form[index].sync_status == 4) {
content: '确定取消该商品理货吗?', this.$refs.canelInputDialog.open();
success: (res) => { this.formIndex = index;
if (res.confirm) {
this.request(API.cancelTallyDetail, 'POST', { wstydl_id: this.form[index].wstydl_id, box_sn: this.box_sn }, true).then(res => {
if (res.err_code === 0) {
this.getTallyData(1);
} else { } else {
uni.showToast({ uni.showToast({
title: res.err_msg, title: '该状态不可取消理货',
icon: 'none' icon: 'none'
}); });
} }
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}, },
/** /**
* 关单封箱 * 关单封箱
...@@ -636,7 +652,7 @@ ...@@ -636,7 +652,7 @@
this.net_weight_total = this.form this.net_weight_total = this.form
.filter(item => item.tally_status === 3) // 筛选出 tally_status 等于 3 的数据 .filter(item => item.tally_status === 3) // 筛选出 tally_status 等于 3 的数据
.reduce((acc, curr) => acc + parseFloat(curr.net_weight), 0); // 将 net_weight 转换为数字并计算总和 .reduce((acc, curr) => acc + parseFloat(curr.net_weight), 0); // 将 net_weight 转换为数字并计算总和
this.title = `入仓号${this.erp_order_sn}已经全部验货完毕是否更换新的箱子?\n\n总净重:${this.net_weight_total}`; this.title = `箱号${this.box_sn}已经全部验货完毕是否更换新的箱子?\n\n总净重:${this.net_weight_total}`;
this.$refs.inputDialog.open(); this.$refs.inputDialog.open();
}, },
/** /**
...@@ -692,7 +708,63 @@ ...@@ -692,7 +708,63 @@
dialogInputClose() { dialogInputClose() {
this.$refs.inputDialog.close(); this.$refs.inputDialog.close();
this.tallyData = []; this.tallyData = [];
},
/**
* 取消理货取消
*/
dialogInputCanelClose() {
this.$refs.canelInputDialog.close();
},
/**
* 取消理货确认
*/
dialogInputCanelConfirm(val) {
if (!val) {
uni.showToast({
title: '请输入毛重',
icon: 'error'
});
return false;
} }
this.request(API.cancelTallyDetail, 'POST', { wstydl_id: this.form[this.formIndex].wstydl_id, box_sn: this.box_sn, gross_weight: val }, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '取消理货成功',
icon: 'success',
duration: 2000
});
setTimeout(() => {
this.getTallyData();
}, 2000);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
/**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
this.box_sn = '';
this.is_focus_1 = false;
setTimeout(() => {
this.is_focus_1 = true;
}, 200);
} else if (type == 2) {
this.all_search = '';
this.keyword = '';
this.goods_type = '';
this.is_focus_2 = false;
this.getTallyData();
setTimeout(() => {
this.is_focus_2 = true;
}, 200);
}
},
} }
}; };
</script> </script>
......
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