Browse Source

修改地市用户,提交选择全变报错问题以及地市提示无数据问题

wangrulan 1 năm trước cách đây
mục cha
commit
82453be47e
1 tập tin đã thay đổi với 10 bổ sung2 xóa
  1. 10 2
      src/components/permissions/user/index.vue

+ 10 - 2
src/components/permissions/user/index.vue

@@ -465,6 +465,8 @@ export default {
       modelList: [],
       formCityList: [],
       areasList:[],
+      cityId:'',
+      cityName:'',
     };
   },
   computed: {},
@@ -487,6 +489,9 @@ export default {
         this.formCityList = re.data;
         if(!this.formCityList.children) {
           this.form.cityId = re.data.value
+          this.cityId = re.data.value
+          this.cityName = re.data.label
+          console.log('this.form.cityId----: ', this.form.cityId);
           getAreasByCityId({cityId: re.data.value}).then(res=>{
           console.log('res: ', res);
           this.areasList = res.data;
@@ -621,6 +626,9 @@ export default {
             this.isHaveUser = true;
             this.form.provinceId = -1;
             this.form.provinceName = '河北省';
+            this.form.cityId = this.cityId
+            this.form.cityName = this.cityName
+            console.log('this.form: ', this.form);
             this.$message({
               type: "error",
               message: res.message,
@@ -725,7 +733,7 @@ export default {
         });
     },
     aa(val) {
-      // console.log('this.form.cityId: ', this.form.cityId);
+      console.log('this.form.cityId: ', this.form.cityId);
       if(this.form.cityId){
         if(this.modelList.indexOf(val.roleName) != -1){
           // console.log('this.modelList.indexOf(val.roleName): ', this.modelList.indexOf(val.roleName));
@@ -740,7 +748,7 @@ export default {
         this.modelList=[]
         this.$message({
                 type: "error",
-                message: "先输入账号并查询用户信息!",
+                message: "先输入账号并查询用户信息!",
               });
       }
     },