Commit da559e09 by liangjianmin

refactor(tallyReceive): 优化导航链接格式及更新获取选项逻辑

- 将导航链接的URL格式化为多行,提升可读性
- 更新获取选项的方法,支持同时处理产地和COD参数,增强代码清晰度
- 确保在初始化时正确传递COO和COD值,提升用户体验
parent 9c74c5e3
...@@ -144,7 +144,14 @@ ...@@ -144,7 +144,14 @@
<text class="label">待理货数量:</text> <text class="label">待理货数量:</text>
<text class="ttt">{{ item.wait_tally_qty }}</text> <text class="ttt">{{ item.wait_tally_qty }}</text>
</view> </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 + '&flag=' + fastParams.flag + '&qty=' + fastParams.qty + '&batch=' + fastParams.batch + '&origin=' + fastParams.origin" 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> <view class="btn row rowCenter verCenter">理货</view>
</navigator> </navigator>
</view> </view>
......
...@@ -659,33 +659,39 @@ ...@@ -659,33 +659,39 @@
} }
}, 500), }, 500),
/** /**
* @param {Object} value * @param {Object} coo 产地
* @param {Object} cod COD
* 获取产地和COD选项数据 * 获取产地和COD选项数据
*/ */
getUseOption(value) { getUseOption(coo, cod) {
this.request(API.getUseOption, 'GET', { type: 'coo' }, false).then(res => { this.request(API.getUseOption, 'GET', { type: 'coo' }, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data.length > 0) { if (res.data.length > 0) {
this.useOption = res.data; this.useOption = res.data;
this.codOption = res.data; this.codOption = res.data;
//上游传入过来有产地则选中 //上游传入过来有产地则选中
if (value) { if (coo) {
var index = this.useOption.findIndex(item => item.name.split('|').includes(value)); var cooIndex = this.useOption.findIndex(item => item.name.split('|').includes(coo));
if (index != -1) { if (cooIndex != -1) {
this.useOptionIndex = index; this.useOptionIndex = cooIndex;
this.codOptionIndex = index;
this.formParams.coo = res.data[this.useOptionIndex].value; this.formParams.coo = res.data[this.useOptionIndex].value;
}
}
//上游传入过来有COD则选中
if (cod) {
var codIndex = this.codOption.findIndex(item => item.name.split('|').includes(cod));
if (codIndex != -1) {
this.codOptionIndex = codIndex;
this.formParams.cod = res.data[this.codOptionIndex].value; this.formParams.cod = res.data[this.codOptionIndex].value;
} }
} }
//如果携带产地就自动赋值 // 这里是处理DigiKey 供应商快速扫描过来的
if (this.fastParams.origin) { if (this.fastParams.origin) {
var index = res.data.findIndex(item => item.name.split('|').includes(this.fastParams.origin)); var index = res.data.findIndex(item => item.name.split('|').includes(this.fastParams.origin));
if (index != -1) { if (index != -1) {
this.useOptionIndex = index; this.useOptionIndex = index;
this.codOptionIndex = index; this.codOptionIndex = index;
this.formParams.coo = res.data[this.useOptionIndex].value; this.formParams.coo = res.data[this.useOptionIndex].value;
this.formParams.cod = res.data[this.codOptionIndex].value;
} }
} }
} }
...@@ -731,7 +737,7 @@ ...@@ -731,7 +737,7 @@
this.getOrderIsPrintLabel(res.data.list[0].order_items_id); this.getOrderIsPrintLabel(res.data.list[0].order_items_id);
this.getUseOption(res.data.list[0].coo); //初始化产地和COD this.getUseOption(res.data.list[0].coo, res.data.list[0].cod); //初始化产地和COD
} }
} else { } else {
uni.showToast({ 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