Commit 1e5b25ab by LJM

修复产地未选中bug

parent 272774c7
Showing with 12 additions and 5 deletions
...@@ -606,13 +606,22 @@ ...@@ -606,13 +606,22 @@
} }
}, 500), }, 500),
/** /**
* 获取产地 * @param {Object} value
* 获取产地 是否选中产地
*/ */
getUseOption() { getUseOption(value) {
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;
//上游传入过来有产地则选中
if (value) {
var index = this.useOption.findIndex(item => item.name.split('|').includes(value));
if (index != -1) {
this.useOptionIndex = index;
this.formParams.coo = res.data[this.useOptionIndex].value;
}
}
//如果携带产地就自动赋值 //如果携带产地就自动赋值
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));
...@@ -641,9 +650,7 @@ ...@@ -641,9 +650,7 @@
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.is_watch = res.data.list[0].is_watch == 1 ? true : false; //是否看货 this.is_watch = res.data.list[0].is_watch == 1 ? true : false; //是否看货
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 {
...@@ -666,7 +673,7 @@ ...@@ -666,7 +673,7 @@
this.getOrderIsPrintLabel(res.data.list[0].order_items_id); this.getOrderIsPrintLabel(res.data.list[0].order_items_id);
this.getUseOption(); //初始化产地 this.getUseOption(res.data.list[0].coo_key); //初始化产地
} }
} 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