Administrator 4 年 前
コミット
0221c697bd

+ 0 - 1
src/main/resources/static/css/user-center/setting/information.css

@@ -12,7 +12,6 @@ li{list-style:none}
 .subLine .btn-upgrade.none{border: 1px solid #E15616;background-color: #ffe6dc;box-shadow: 0px 3px 6px 0px rgba(249, 75, 75, 0.17);color: #e15616;}
 .subLine .btn-upgrade.disabled{background-color: #999999;}
 .formLine{width: 100%;float: left;margin-bottom: 10px;}
-.formLine .address textarea{margin-top: 0;}
 .formLine .form-upload{width: 128px;height: auto;float: left;margin-right: 20px;}
 .formLine .formLine-file{width: 128px;height: 90px;position: relative;}
 .formLine .form-upload-tips{width: 20px;height: 90px;float: left;position: relative;}

+ 24 - 8
src/main/resources/static/js/supplier-center/setting/information.js

@@ -23,6 +23,11 @@ jqMultipleShow("click", ".navList", ".tab", ".con");
             nature:'',//公司性质
             turnover:'',//年营业额
         },
+        form:{
+            townID:'',
+            provinceID: '',//省id
+            cityID: '',
+        },
         params2:{
             userID:'',
             shopID:'',
@@ -123,6 +128,12 @@ jqMultipleShow("click", ".navList", ".tab", ".con");
                     _this.params3.certificateHonor = shop.hygienicLicense;
                     _this.HonorImagesList = res.data.certificateHonor;
                     _this.productImagesList = res.data.productCertification;
+                    if(shop.cityID!=''&&shop.cityID!=null){
+                        _this.getcity()
+                    }
+                    if(shop.townID!=''&&shop.townID!=null){
+                        _this.getcTown();
+                    }
                 }
              })
          },
@@ -307,12 +318,14 @@ jqMultipleShow("click", ".navList", ".tab", ".con");
          province:function () {
            var _this = this;
            _this.params.provinceID = event.target.value;
-            if(_this.params.provinceID==''){//省为请选择时市区初始化
+            if(_this.params.provinceID==0){//省为请选择时市区初始化
                 _this.cityArray=[];
                 _this.townArray=[];
-                _this.params.townID=''
+                _this.params.townID=0;
+                _this.params.cityID = 0;
             }else {
               _this.getcity();
+              _this.params.cityID = 0;
             }
         },
         getcity:function(event){//加载市
@@ -321,10 +334,12 @@ jqMultipleShow("click", ".navList", ".tab", ".con");
                  if(response.code == 0 ){
                     _this.cityArray = response.data;
                      _this.params.cityID = event.target.value;
-                     if(_this.params.cityID==''){
+                     if(_this.params.cityID==0){
                            _this.townArray=[];
+                           _this.params.townID = 0;
                      }else {
                          _this.getcTown();
+                          _this.params.townID = 0;
                      }
                 }
             })
@@ -335,7 +350,6 @@ jqMultipleShow("click", ".navList", ".tab", ".con");
                 if(response.code == 0 ){
                     _this.townArray = response.data;
                     _this.params.townID = event.target.value;
-                    console.log(_this.params.townID)
                 }else{
                     CAIMEI.Alert(response.msg, '确定', false);
                 }
@@ -349,11 +363,13 @@ jqMultipleShow("click", ".navList", ".tab", ".con");
             return newArr
         },
         setNewScope:function(arr){//回显处理主营内容
+            if (arr!=null){
             var newArr = [];
-            arr.split('/').forEach(function(item){
-                newArr.push(item);
-            });
-            return newArr
+                arr.split('/').forEach(function(item){
+                    newArr.push(item);
+                });
+                return newArr
+            }
         },
     },
     mounted:function () {

+ 1 - 20
src/main/resources/static/js/user-center/setting/upgrade.js

@@ -222,16 +222,7 @@ var upgradePage = new Vue({
                 }
             })
         },
-        GetProvinceFn: function(){//获取全部省份
-            var _self = this;
-            PublicApi.GetProvince({},function(response){
-                if(response.code == 0){
-                    _self.ProvinceList =response.data;
-                }else{
-                    CAIMEI.Alert(response.msg,'确定',false);
-                }
-            })
-        },
+
         ChangeProvince:function () {//选择省份
             var _self = this;
             _self.addressfrom.provinceID = event.target.value;
@@ -258,16 +249,6 @@ var upgradePage = new Vue({
             var _self = this;
             _self.clubUpgradeUser.townID = event.target.value;
         },
-        GetProvinceFn: function(){//获取全部省份
-            var _self = this;
-            PublicApi.GetProvince({},function(response){
-                if(response.code == 0){
-                    _self.ProvinceList =response.data;
-                }else{
-                    CAIMEI.Alert(response.msg,'确定',false);
-                }
-            })
-        },
         GetCtiyFn: function(){//获取市
             var _self = this;
             PublicApi.GetCity({ provinceId: _self.addressfrom.provinceID },function(response){

+ 6 - 6
src/main/resources/templates/supplier-center/setting/information.html

@@ -53,16 +53,16 @@
                             </div>
                             <div class="formLine" >
                                 <p><em>*</em>公司地址:</p>
-                                 <select name="provinceID" id="cProvince" @change="province">
-                                     <option value="">请选择</option>
+                                 <select name="provinceID" id="cProvince" @change="province" v-model="params.provinceID">
+                                     <option value="0">请选择</option>
                                      <option v-for="item in provinceArray" :value="item.provinceID">{{item.name}}</option>
                                  </select>
-                                 <select name="cityID" id="cityID" @change="getcity($event)">
-                                     <option value="">请选择</option>
+                                 <select name="cityID" id="cityID" @change="getcity($event)" v-model="params.cityID">
+                                     <option value="0"  selected="">请选择</option>
                                      <option v-for="(item ,index) in cityArray" :key="index" :value="item.cityID">{{item.name}}</option>
                                  </select>
-                                 <select name="townID" id="townID" @change="getcTown($event)">
-                                     <option value="">请选择</option>
+                                 <select name="townID" id="townID" @change="getcTown($event)" v-model="params.townID">
+                                     <option value="0">请选择</option>
                                      <option v-for="(item ,index) in townArray" :key="index" :value="item.townID" >{{item.name}}</option>
                                  </select>
                                  <textarea placeholder="建议您如实填写详细地址,例如:街道名称,门牌号码,楼层和房间号等信息"  v-model="params.address" maxlength="25"></textarea>