Commit 60948629 by LJM

产地

parent 7a2b57b9
Showing with 103 additions and 16 deletions
...@@ -337,7 +337,7 @@ ...@@ -337,7 +337,7 @@
} }
} else if (type == 2) { } else if (type == 2) {
if (value) { if (value) {
uni.hideKeyboard() uni.hideKeyboard();
this.identifyQrCodeNumAndSn(); this.identifyQrCodeNumAndSn();
} else { } else {
this.goods_type = ''; this.goods_type = '';
...@@ -588,11 +588,18 @@ ...@@ -588,11 +588,18 @@
//解析处理的产地 //解析处理的产地
if (res.data.origin) { if (res.data.origin) {
var originIndex = this.origin_list.findIndex(item => item.name.split('|').includes(res.data.origin)); //通过英文去匹配出对应的中文国家 var originIndex = this.origin_list.findIndex(item => item.name.split('|').includes(res.data.origin)); //通过英文去匹配出对应的中文国家
//排除已理货的数据
if (this.form[0].tally_status != 3) {
this.$set(this.form[0], 'origin', this.origin_list[originIndex].value); this.$set(this.form[0], 'origin', this.origin_list[originIndex].value);
} }
}
//解析处理的数量 //解析处理的数量
if (res.data.qty) { if (res.data.qty) {
this.$set(this.form[0], 'tally_num', res.data.qty); this.$set(this.form[0], 'tally_num', res.data.qty);
//排除已理货的数据
if (this.form[0].tally_status != 3) {
this.$set(this.form[0], 'tally_num', res.data.qty);
}
} }
} }
}); });
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</template> </template>
<!-- digikey等供应商--> <!-- digikey等供应商-->
<template v-else> <template v-else>
<input class="uni-input" :focus="is_focus_2" placeholder="输入或扫描" placeholder-style="color:#000;font-weight: bold;" v-model="keyword" @input="handleInput($event,2)" /> <input class="uni-input" :focus="is_focus_2" :confirm-type="'none'" :hold-keyboard="false" placeholder="输入或扫描" placeholder-style="color:#000;font-weight: bold;" v-model="keyword" @input="handleInput($event,2)" />
</template> </template>
</view> </view>
</view> </view>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</view> </view>
</view> </view>
<!-- 列表 --> <!-- 列表 -->
<view class="list" v-if="tallyData && tallyData.detail"> <view class="list" v-if="form.length > 0">
<scroll-view scroll-y="true" class="scroll-Y"> <scroll-view scroll-y="true" class="scroll-Y">
<view class="box" v-for="(item,index) in tallyData.detail" :key="index" :class="{disabled:item.tally_status == 3}"> <view class="box" v-for="(item,index) in tallyData.detail" :key="index" :class="{disabled:item.tally_status == 3}">
<view class="title pb16 row verCenter"> <view class="title pb16 row verCenter">
...@@ -47,10 +47,15 @@ ...@@ -47,10 +47,15 @@
<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> <text class="t5 row rowCenter verCenter">{{item.sync_status_cn}}</text>
</view> </view>
<view class="pb16 row"> <view class="pb16 row bothSide verCenter">
<view class="row" style="width: 50%;">
<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="row" style="width: 50%;justify-content: flex-end;" v-if="item.tally_status == 3">
<text class="t4" style="text-align: right;color: #197adb;">{{item.box_sn}}</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.erp_order_sn}}</text> <text class="t4">{{item.erp_order_sn}}</text>
...@@ -70,14 +75,35 @@ ...@@ -70,14 +75,35 @@
</view> </view>
</view> </view>
<view class="pb16 row" style="border-bottom: 1px solid #E6EDF0;padding-bottom: 24rpx;"> <view class="pb16 row" style="border-bottom: 1px solid #E6EDF0;padding-bottom: 24rpx;">
<view class="row" style="width: 50%;"> <!-- 完全理货 -->
<template v-if="item.tally_status == 3">
<view class="row">
<text class="t3 w130">总数量:</text> <text class="t3 w130">总数量:</text>
<text class="t4">{{item.order_numbers}}</text> <text class="t4">{{item.order_numbers}}</text>
</view> </view>
</template>
<!-- 1未理货2部分理货 -->
<template v-else>
<view class="row" style="width: 50%;">
<text class="t3 w130">待收数量:</text>
<text class="t4">{{item.wait_tally_num}}</text>
</view>
<view class="row" style="width: 50%;">
<text class="t3 w130" style="text-align: right;">总数量:</text>
<text class="t4">{{item.order_numbers}}</text>
</view>
</template>
</view> </view>
<view class="pb16 row verCenter bothSide" style="margin-top: 24rpx;"> <view class="pb16 row verCenter bothSide" style="margin-top: 24rpx;">
<view class="row verCenter"> <view class="row verCenter">
<!-- 完全理货 -->
<template v-if="item.tally_status == 3">
<text class="t3 w130">已入库数量:</text> <text class="t3 w130">已入库数量:</text>
</template>
<!-- 1未理货2部分理货 -->
<template v-else>
<text class="t3 w130">入库数量:</text>
</template>
<view class="input-text"> <view class="input-text">
<input class="uni-input" :disabled="item.tally_status == 3" type="number" inputmode="numeric" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].tally_num" /> <input class="uni-input" :disabled="item.tally_status == 3" type="number" inputmode="numeric" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].tally_num" />
</view> </view>
...@@ -85,9 +111,11 @@ ...@@ -85,9 +111,11 @@
<view class="row verCenter rowCenter"> <view class="row verCenter rowCenter">
<text class="t3 w130" style="width:105rpx;">原产地:</text> <text class="t3 w130" style="width:105rpx;">原产地:</text>
<view class="input-text"> <view class="input-text">
<!-- 完全理货 -->
<template v-if="item.tally_status == 3"> <template v-if="item.tally_status == 3">
<input class="uni-input" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" disabled="" v-model="form[index].origin" /> <input class="uni-input" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" disabled="" v-model="form[index].origin" />
</template> </template>
<!-- 1未理货2部分理货 -->
<template v-else> <template v-else>
<input class="uni-input" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" disabled="" @click="open(index)" v-model="form[index].origin" /> <input class="uni-input" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" disabled="" @click="open(index)" v-model="form[index].origin" />
</template> </template>
...@@ -122,6 +150,12 @@ ...@@ -122,6 +150,12 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<!-- 无数据 -->
<view class="no-data column verCenter rowCenter" v-if="form.length == 0 && tallyData.create_time_cn">
<text class="iconfont icon-jinggao2"></text>
<text class="text">查找不到相关信息</text>
<text class="p">1、请输入正确的入箱号和型号</text>
</view>
<!-- 选择国家 --> <!-- 选择国家 -->
<uni-popup ref="popup" background-color="#F1F4F6"> <uni-popup ref="popup" background-color="#F1F4F6">
<view class="popup-content"> <view class="popup-content">
...@@ -132,7 +166,7 @@ ...@@ -132,7 +166,7 @@
<view class="data-list"> <view class="data-list">
<template v-if="origin_list.length > 0"> <template v-if="origin_list.length > 0">
<view class="box row bothSide verCenter" v-for="(item, index) in origin_list" :key="index" :class="{ curr: filter_status[index] }" @click="filterChange(index)"> <view class="box row bothSide verCenter" v-for="(item, index) in origin_list" :key="index" :class="{ curr: filter_status[index] }" @click="filterChange(index)">
<text class="text">{{ item }}</text> <text class="text">{{ item.name }}</text>
<view class="check-ico"></view> <view class="check-ico"></view>
</view> </view>
</template> </template>
...@@ -221,6 +255,7 @@ ...@@ -221,6 +255,7 @@
bindPickerChange: function(e) { bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value); console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value; this.index = e.detail.value;
this.clearInput(2);
}, },
/** /**
* @param {Object} event 输入框监听 * @param {Object} event 输入框监听
...@@ -233,6 +268,7 @@ ...@@ -233,6 +268,7 @@
} }
} else if (type == 2) { } else if (type == 2) {
if (value) { if (value) {
uni.hideKeyboard();
this.identifyQrCodeNumAndSn(); this.identifyQrCodeNumAndSn();
} else { } else {
this.goods_type = ''; this.goods_type = '';
...@@ -242,7 +278,7 @@ ...@@ -242,7 +278,7 @@
} }
} else if (type == 3) { } else if (type == 3) {
this.origin_list = []; //数组清空 this.origin_list = []; //数组清空
this.getOrigin(); this.getOriginCn();
} }
}, 500), }, 500),
/** /**
...@@ -251,7 +287,7 @@ ...@@ -251,7 +287,7 @@
filterChange(index) { filterChange(index) {
this.$set(this.filter_status, index, (this.filter_status[index] = !this.filter_status[index])); this.$set(this.filter_status, index, (this.filter_status[index] = !this.filter_status[index]));
let filter_arr = this.findIndex(this.filter_status, true); let filter_arr = this.findIndex(this.filter_status, true);
let name = filter_arr.map(i => this.origin_list[i]); let name = filter_arr.map(i => this.origin_list[i].value);
this.form[this.curr].origin = name[0]; this.form[this.curr].origin = name[0];
this.$forceUpdate(); this.$forceUpdate();
this.$refs.popup.close(); this.$refs.popup.close();
...@@ -481,6 +517,22 @@ ...@@ -481,6 +517,22 @@
}); });
}, },
/** /**
* 获取产地升级版
*/
getOriginCn() {
this.request(API.getOriginCn, 'GET', { coo: this.origin }, true).then(res => {
if (res.err_code === 0) {
this.origin_list = res.data;
this.filter_status = createArray(this.origin_list.length, false);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
/**
* 识别 * 识别
*/ */
identifyQrCodeNumAndSn() { identifyQrCodeNumAndSn() {
...@@ -512,14 +564,33 @@ ...@@ -512,14 +564,33 @@
this.isRequestSent = true; // 设置标志,防止重复发送请求 this.isRequestSent = true; // 设置标志,防止重复发送请求
this.request(API.scanQrCode, 'POST', { data: this.keyword, type: codeType, device: device.deviceModel }, true).then(res => { this.request(API.scanQrCode, 'POST', { data: this.keyword, type: codeType, device: device.deviceModel }, true).then(res => {
this.isRequestSent = false; // 请求完成后重置标志 this.isRequestSent = false; // 请求完成后重置标志
if (res.code === 0) { if (res.err_code === 0) {
//如果后台搜索到型号则替换输入框的值 //如果后台搜索到型号则替换输入框的值
let model = res.data.model || res.data.model2; let model = res.data.model || res.data.model2;
if (model) { if (model) {
this.keyword = model; //兼容TME this.keyword = model; //兼容TME
this.goods_type = model; //赋值检索出来的型号 this.goods_type = model; //赋值检索出来的型号
} }
this.getTallyData(); this.getTallyData((json) => {
//解析出一个物料的情况下才执行此操作
if (json.length == 1) {
//解析处理的产地-重新赋值
if (res.data.origin) {
var originIndex = this.origin_list.findIndex(item => item.name.split('|').includes(res.data.origin)); //通过英文去匹配出对应的中文国家
//排除已理货的数据
if (this.form[0].tally_status != 3) {
this.$set(this.form[0], 'origin', this.origin_list[originIndex].value);
}
}
//解析处理的数量-重新赋值
if (res.data.qty) {
//排除已理货的数据
if (this.form[0].tally_status != 3) {
this.$set(this.form[0], 'tally_num', res.data.qty);
}
}
}
});
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
...@@ -535,12 +606,12 @@ ...@@ -535,12 +606,12 @@
* 获取锁定理货信息 * 获取锁定理货信息
* *
*/ */
getTallyData() { getTallyData(callback) {
this.request(API.getTallyData, 'POST', { box_sn: this.box_sn, goods_type: this.goods_type, all_search: this.all_search }, 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) {
this.getOrigin(); //获取产地 this.getOriginCn(); //获取产地
// 使用 map 方法生成表单数组 // 使用 map 方法生成表单数组
this.form = res.data.detail.map((item) => ({ this.form = res.data.detail.map((item) => ({
...@@ -564,11 +635,11 @@ ...@@ -564,11 +635,11 @@
this.image_list[index] = item.goods_check_pic.split(','); this.image_list[index] = item.goods_check_pic.split(',');
} }
}); });
typeof callback == 'function' && callback(this.form);
} else { } else {
uni.showToast({ this.form = [];
title: '查询不到该箱号信息',
icon: 'none'
});
} }
} else { } else {
uni.showToast({ uni.showToast({
...@@ -582,6 +653,15 @@ ...@@ -582,6 +653,15 @@
* 理货明细提交 * 理货明细提交
*/ */
submitTallyDetail(index) { submitTallyDetail(index) {
if (!this.box_sn) {
uni.showModal({
title: '',
content: '请先取箱号!并将打印的箱号贴于外箱上',
showCancel: false
});
return false;
}
if (!this.form[index].tally_num) { if (!this.form[index].tally_num) {
uni.showToast({ uni.showToast({
title: '入库数量必填', title: '入库数量必填',
......
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