Commit d4579db3 by LJM

理货--产地一栏,需要增加一套产地标准(即国家二字简写)

parent c45a04a6
......@@ -121,7 +121,7 @@
<text class="label">待理货数量:</text>
<text class="ttt">{{ item.wait_tally_qty }}</text>
</view>
<navigator class="btn-box row" :url="'/pages/tallyReceive/operate?stock_in_item_id=' + item.stock_in_item_id + '&stock_in_id=' + item.stock_in_id + '&container_id=' + searchParams.container_id + '&container_name=' + searchParams.container_name" hover-class="none">
<navigator class="btn-box row" :url="'/pages/tallyReceive/operate?stock_in_item_id=' + item.stock_in_item_id + '&stock_in_id=' + item.stock_in_id + '&container_id=' + searchParams.container_id + '&container_name=' + searchParams.container_name+'&flag='+fastParams.flag+'&qty='+fastParams.qty+'&batch='+fastParams.batch+'&origin='+fastParams.origin" hover-class="none">
<view class="btn row rowCenter verCenter">理货</view>
</navigator>
</view>
......@@ -247,6 +247,12 @@
tally_remark: '',
image_ids: '', //理货照片集合
is_print: 1
},
fastParams: {
flag: '',
qty: '',
batch: '',
origin: ''
}
};
},
......@@ -545,17 +551,79 @@
this.searchParams.goods_name = res.data.model; //赋值检索出来的型号
this.resetChange(); //清空数据
setTimeout(() => {
this.getData((data) => {
this.getData((data, type) => {
//TME 特殊处理
if (code_type == 'TME') {
//条件:后台搜索不到数据,则拿model2字段继续请求 只请求一次
if (data.length == 0 && res.data.model2 && !this.isStopRequest) {
this.isStopRequest = true;
this.searchParams.goods_name = res.data.model2;
self.getData(); //识别二维码的数量和型号
this.searchParams.goods_name = res.data.model2; //识别二维码的数量和型号
self.getData((data, type) => {
setTimeout(() => {
//如果搜索多个的情况
if (data.length > 0) {
const { qty, origin, batch } = res.data;
this.fastParams.flag = 'fast';
this.fastParams.qty = qty;
this.fastParams.batch = batch;
this.fastParams.origin = origin;
//如果搜索只有一个的情况
if (data.length == 1) {
const { stock_in_item_id, stock_in_id } = data[0];
const { container_id, container_name } = this.searchParams;
uni.navigateTo({
url: '/pages/tallyReceive/operate?stock_in_item_id=' + stock_in_item_id + '&stock_in_id=' + stock_in_id + '&container_id=' + container_id + '&container_name=' + container_name + '&flag=fast' + '&qty=' + qty + '&origin=' + origin + '&batch=' + batch
})
}
}
}, 0)
}, code_type);
} else {
self.getData((data, type) => {
setTimeout(() => {
//如果搜索多个的情况
if (data.length > 0) {
const { qty, origin, batch } = res.data;
this.fastParams.flag = 'fast';
this.fastParams.qty = qty;
this.fastParams.batch = batch;
this.fastParams.origin = origin;
//如果搜索只有一个的情况
if (data.length == 1) {
const { stock_in_item_id, stock_in_id } = data[0];
const { container_id, container_name } = this.searchParams;
uni.navigateTo({
url: '/pages/tallyReceive/operate?stock_in_item_id=' + stock_in_item_id + '&stock_in_id=' + stock_in_id + '&container_id=' + container_id + '&container_name=' + container_name + '&flag=fast' + '&qty=' + qty + '&origin=' + origin + '&batch=' + batch
})
}
}
}, 0)
}, code_type);
}
} else {
setTimeout(() => {
//如果搜索多个的情况
if (data.length > 0) {
const { qty, origin, batch } = res.data;
this.fastParams.flag = 'fast';
this.fastParams.qty = qty;
this.fastParams.batch = batch;
this.fastParams.origin = origin;
//如果搜索只有一个的情况
if (data.length == 1) {
const { stock_in_item_id, stock_in_id } = data[0];
const { container_id, container_name } = this.searchParams;
uni.navigateTo({
url: '/pages/tallyReceive/operate?stock_in_item_id=' + stock_in_item_id + '&stock_in_id=' + stock_in_id + '&container_id=' + container_id + '&container_name=' + container_name + '&flag=fast' + '&qty=' + qty + '&origin=' + origin + '&batch=' + batch
})
}
}
}, 0)
}
});
}, code_type);
}, 0)
} else {
uni.showToast({
......@@ -626,7 +694,7 @@
/**
* 获取列表数据 支持分页
*/
getData(callback) {
getData(callback, type) {
this.request(API.waitTallyReceiveList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
if (res.data.total > 0) {
......@@ -636,7 +704,7 @@
} else {
this.hasMoreData = false;
}
typeof callback == 'function' && callback(res.data.list);
typeof callback == 'function' && callback(res.data.list, type);
} else {
uni.showToast({
title: res.msg,
......
......@@ -161,6 +161,9 @@
<view class="input-title">
<text class="input-title-t1">*</text>
<text class="input-title-t2">理货数量:</text>
<template v-if="is_tips">
<text style="color: red;font-size:16rpx;">⚠注意:理货数与待理货数不一致</text>
</template>
</view>
<view class="input-box"><input type="number" class="uni-input" placeholder-style="color:#919399" placeholder="请输入理货数量" v-model="formParams.tally_qty" @input="handleInputNumber($event, detail.wait_tally_qty)" /></view>
</view>
......@@ -185,9 +188,9 @@
<text class="input-title-t2">产 地:</text>
</view>
<view class="pick-box">
<picker @change="bindPickerChange($event, 1)" :value="useOptionIndex" :range="useOption" :range-key="'country_cn'">
<picker @change="bindPickerChange($event, 1)" :value="useOptionIndex" :range="useOption" :range-key="'name'">
<view class="row verCenter">
<view class="uni-input">{{ useOptionIndex == -1 ? '请选择' : useOption[useOptionIndex].country_cn }}</view>
<view class="uni-input">{{ useOptionIndex == -1 ? '请选择' : useOption[useOptionIndex].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
......@@ -383,6 +386,13 @@
useOptionIndex: -1,
useOption: [], //产地
warehouse_id: '', //区分仓库
is_tips: false, //是否展示提示
fastParams: {
flag: '',
qty: '',
batch: '',
origin: ''
},
searchParams: {
stock_in_sn: '', //入库单号
tracking_no: '', //物流单号
......@@ -409,6 +419,11 @@
this.stock_in_id = options.stock_in_id || '';
this.searchParams.container_name = options.container_name || '';
this.searchParams.container_id = options.container_id || '';
//快速扫描
this.fastParams.flag = options.flag;
this.fastParams.qty = options.qty;
this.fastParams.batch = options.batch;
this.fastParams.origin = options.origin;
},
onShow() {
if (this.noexebshowFalg) {
......@@ -440,7 +455,7 @@
console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) {
this.useOptionIndex = e.detail.value;
this.formParams.coo = this.useOption[e.detail.value].coo_en;
this.formParams.coo = this.useOption[e.detail.value].value;
} else if (type == 2) {
this.print_style_index = e.detail.value;
//区分深圳自营和非深圳自营
......@@ -598,10 +613,13 @@
if (res.code === 0) {
if (res.data.length > 0) {
this.useOption = res.data;
let filter_arr = this.findIndex(res.data, this.coo);
if (filter_arr.length > 0) {
this.useOptionIndex = filter_arr[0];
this.formParams.coo = res.data[this.useOptionIndex].coo_en;
//如果携带产地就自动赋值
if (this.fastParams.origin) {
var index = res.data.findIndex(item => item.name.split('|').includes(this.fastParams.origin));
if (index != -1) {
this.useOptionIndex = index;
this.formParams.coo = res.data[this.useOptionIndex].value;
}
}
}
} else {
......@@ -625,18 +643,30 @@
this.formParams.date_code = res.data.list[0].expect_date_code;
this.coo = res.data.list[0].coo_key; //产地
this.is_watch = res.data.list[0].is_watch == 1 ? true : false; //是否看货
this.getUseOption(); //初始化产地
if (res.data.list[0].mobile_default_img) {
this.image_list = res.data.list[0].mobile_default_img.split(',');
} else {
this.image_list = [];
}
//DigiKey 供应商快速扫描过来的
if (this.fastParams.flag == 'fast') {
if (this.fastParams.qty) {
this.formParams.tally_qty = this.fastParams.qty; //理货数量
this.is_tips = res.data.list[0].wait_tally_qty != Number(this.formParams.tally_qty);
}
if (this.fastParams.batch) {
this.formParams.date_code = this.fastParams.batch; //D/C
}
}
uni.setNavigationBarTitle({
title: res.data.list[0].stock_in_sn + '-理货'
});
this.getOrderIsPrintLabel(res.data.list[0].order_items_id);
this.getUseOption(); //初始化产地
}
} else {
uni.showToast({
......
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