Commit 432ab023 by LJM

理货操作页面-产地默认填充进去

parent 87f780c7
...@@ -205,6 +205,7 @@ import debounce from 'lodash/debounce'; ...@@ -205,6 +205,7 @@ import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
coo: '', //产地
is_submit: true, is_submit: true,
stock_in_item_id: '', stock_in_item_id: '',
stock_in_id: '', stock_in_id: '',
...@@ -252,7 +253,6 @@ export default { ...@@ -252,7 +253,6 @@ export default {
onShow() { onShow() {
if (this.noexebshowFalg) { if (this.noexebshowFalg) {
this.getData(); this.getData();
this.getUseOption();
} }
}, },
watch: { watch: {
...@@ -275,6 +275,19 @@ export default { ...@@ -275,6 +275,19 @@ export default {
} }
}, },
/** /**
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item.coo_en === target) {
result.push(index);
}
});
return result;
},
/**
* 监听理货数量 * 监听理货数量
*/ */
handleInputNumber: debounce(function(event, wait_tally_qty) { handleInputNumber: debounce(function(event, wait_tally_qty) {
...@@ -402,6 +415,11 @@ export default { ...@@ -402,6 +415,11 @@ export default {
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;
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;
}
} }
} else { } else {
uni.showToast({ uni.showToast({
...@@ -421,6 +439,9 @@ export default { ...@@ -421,6 +439,9 @@ export default {
this.detail = res.data.list[0]; this.detail = res.data.list[0];
this.formParams.tally_qty = res.data.list[0].wait_tally_qty; this.formParams.tally_qty = res.data.list[0].wait_tally_qty;
this.formParams.date_code = res.data.list[0].expect_date_code; this.formParams.date_code = res.data.list[0].expect_date_code;
this.coo = res.data.list[0].coo_key; //产地
this.getUseOption(); //初始化产地
if (res.data.list[0].mobile_default_img) { if (res.data.list[0].mobile_default_img) {
this.image_list = res.data.list[0].mobile_default_img.split(','); this.image_list = res.data.list[0].mobile_default_img.split(',');
} else { } else {
......
...@@ -70,7 +70,6 @@ export default { ...@@ -70,7 +70,6 @@ export default {
} }
}; };
}, },
onLoad() {},
onShow() { onShow() {
this.getData(); this.getData();
}, },
......
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