From 5dfb5ed052cfaaf804dd88749904029f0e9c1bae Mon Sep 17 00:00:00 2001 From: zhanglipeng Date: Wed, 7 Apr 2021 16:54:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=81=E5=B8=82=E5=8C=BA=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/benyi/customer/index.vue | 207 ++++++++++++++++---- 1 file changed, 166 insertions(+), 41 deletions(-) diff --git a/ruoyi-ui/src/views/benyi/customer/index.vue b/ruoyi-ui/src/views/benyi/customer/index.vue index a9cefce9d..d08d23699 100644 --- a/ruoyi-ui/src/views/benyi/customer/index.vue +++ b/ruoyi-ui/src/views/benyi/customer/index.vue @@ -178,7 +178,7 @@ /> - + - + @@ -382,7 +389,11 @@ - + @@ -396,12 +407,20 @@ - + - + - + - + - + - + @@ -439,7 +474,6 @@ :province="diglogForm.province" :city="diglogForm.city" :area="diglogForm.area" - @selected="onSelected" :disabled="true" > @@ -449,7 +483,11 @@ - + - + - + - + @@ -501,7 +547,10 @@ - + { + getUserProfile().then((response) => { this.loginuser = response.data.userId; }); }, @@ -730,13 +777,13 @@ export default { isShow(row) { if (row.fpid == this.loginuser) { return true; - } else if(row.createUserid == this.loginuser) { + } else if (row.createUserid == this.loginuser) { return true; - }else { + } else { return false; } }, - + // 取消按钮 cancel() { this.open = false; @@ -807,6 +854,22 @@ export default { const id = row.id || this.ids; getCustomer(id).then((response) => { this.form = response.data; + if (response.data.sheng == null) { + this.diglogForm.province = ""; + } else { + this.diglogForm.province = response.data.sheng; + } + if (response.data.shi == null) { + this.diglogForm.city = ""; + } else { + this.diglogForm.city = response.data.shi; + } + if (response.data.quxian == null) { + this.diglogForm.area = ""; + } else { + this.diglogForm.area = response.data.quxian; + } + this.open = true; this.title = "修改本一-客户关系管理"; }); @@ -817,6 +880,21 @@ export default { const id = row.id || this.ids; getCustomer(id).then((response) => { this.form = response.data; + if (response.data.sheng == null) { + this.diglogForm.province = ""; + } else { + this.diglogForm.province = response.data.sheng; + } + if (response.data.shi == null) { + this.diglogForm.city = ""; + } else { + this.diglogForm.city = response.data.shi; + } + if (response.data.quxian == null) { + this.diglogForm.area = ""; + } else { + this.diglogForm.area = response.data.quxian; + } this.open_check = true; this.title = "客户关系管理详情页"; }); @@ -827,9 +905,24 @@ export default { const id = row.id || this.ids; getCustomer(id).then((response) => { this.form = response.data; - this.diglogForm.province = response.data.sheng; - this.diglogForm.city = response.data.shi; - this.diglogForm.area = response.data.quxian; + // this.diglogForm.province = response.data.sheng; + // this.diglogForm.city = response.data.shi; + // this.diglogForm.area = response.data.quxian; + if (response.data.sheng == null) { + this.diglogForm.province = ""; + } else { + this.diglogForm.province = response.data.sheng; + } + if (response.data.shi == null) { + this.diglogForm.city = ""; + } else { + this.diglogForm.city = response.data.shi; + } + if (response.data.quxian == null) { + this.diglogForm.area = ""; + } else { + this.diglogForm.area = response.data.quxian; + } this.open_fp = true; this.title = "分配客户"; }); @@ -898,22 +991,54 @@ export default { .catch(function () {}); }, //所在省市区触发联动方法 - onSelected(data) { - if ( - data.province.code == undefined || - data.city.code == undefined || - data.area.code == undefined - ) { + // onSelected(data) { + // console.log(data); + // if ( + // data.province.code == undefined || + // data.city.code == undefined || + // data.area.code == undefined + // ) { + // this.form.sheng = undefined; + // } else { + // console.log(data); + // this.form.sheng = data.province.value; + // this.form.shengid = data.province.code; + // this.form.shi = data.city.value; + // this.form.shiid = data.city.code; + // this.form.quxian = data.area.value; + // this.form.quxianid = data.area.code; + // } + // }, + onChangeProvince(data) { + //console.log(data); + if (data.code == undefined) { this.form.sheng = undefined; } else { - this.form.sheng = data.province.value; - this.form.shengid = data.province.code; - this.form.shi = data.city.value; - this.form.shiid = data.city.code; - this.form.quxian = data.area.value; - this.form.quxianid = data.area.code; + //console.log(data); + this.form.sheng = data.value; + this.form.shengid = data.code; } - } + }, + onChangeCity(data) { + //console.log(data); + if (data.code == undefined) { + this.form.shi = undefined; + } else { + //console.log(data); + this.form.shi = data.value; + this.form.shiid = data.code; + } + }, + onChangeArea(data) { + //console.log(data); + if (data.code == undefined) { + this.form.quxian = undefined; + } else { + //console.log(data); + this.form.quxian = data.value; + this.form.quxianid = data.code; + } + }, }, };