Administrator 4 lat temu
rodzic
commit
25d7c8ed83

+ 56 - 29
src/main/resources/static/js/supplier-center/setting/information.js

@@ -56,24 +56,24 @@
         HonorImagesList:[],
         productImagesList:[],
         mentuzCampNullList:[
-            {value:'1',name:'产品'},
-            {value:'2',name:'仪器'},
-            {value:'3',name:'服务'}
+            {value:'1',name:'产品',checked:false},
+            {value:'2',name:'仪器',checked:false},
+            {value:'3',name:'服务',checked:false}
         ],
         Scopelist:[
-            {value:'1',name:'仪器护理类'},
-            {value:'2',name:'护肤品类'},
-            {value:'3',name:'纹绣类'},
-            {value:'4',name:'美体内衣'},
-            {value:'5',name:'整形耗材'},
-            {value:'6',name:'国际品牌'},
-            {value:'7',name:'美胸类'},
-            {value:'8',name:'健康保健类'},
-            {value:'9',name:'面膜类'},
-            {value:'10',name:'抗衰老'},
-            {value:'11',name:'生殖保养'},
-            {value:'12',name:'健康养生'},
-            {value:'13',name:'纤体减肥'}
+            {value:'1',name:'仪器护理类',checked:false},
+            {value:'2',name:'护肤品类',checked:false},
+            {value:'3',name:'纹绣类',checked:false},
+            {value:'4',name:'美体内衣',checked:false},
+            {value:'5',name:'整形耗材',checked:false},
+            {value:'6',name:'国际品牌',checked:false},
+            {value:'7',name:'美胸类',checked:false},
+            {value:'8',name:'健康保健类',checked:false},
+            {value:'9',name:'面膜类',checked:false},
+            {value:'10',name:'抗衰老',checked:false},
+            {value:'11',name:'生殖保养',checked:false},
+            {value:'12',name:'健康养生',checked:false},
+            {value:'13',name:'纤体减肥',checked:false}
         ],
         shopMainPros: [],
         shopScope:[],
@@ -137,8 +137,8 @@
                     _this.params.registeredCapital = shop.registeredCapital;
                     _this.params.nature = shop.nature;
                     _this.params.turnover = shop.turnover;
-                    _this.shopMainPros = _this.setNewMainpro(shop.mainpro);
-                    _this.shopScope = _this.setNewScope(shop.businessScope);
+                    // _this.shopMainPros = _this.setNewMainpro(shop.mainpro);
+                    // _this.shopScope = _this.setNewScope(shop.businessScope);
                     _this.params2.firstShopType = shop.firstShopType;
                     _this.params2.secondShopType = shop.secondShopType;
                     _this.params2.medicalPracticeLicenseImg1 = shop.medicalPracticeLicenseImg1;
@@ -153,6 +153,22 @@
                     _this.params3.certificateHonor = shop.hygienicLicense;
                     _this.HonorImagesList = res.data.certificateHonor;
                     _this.productImagesList = res.data.productCertification;
+                    if(shop.mainpro != "" && shop.mainpro != null){
+							_this.mentuzCampNullList =  _this.setNewMainpro(shop.mainpro);
+                            _this.mentuzCampNullList.forEach(function (item) {
+                                if(item.checked){
+                                _this.shopMainPros.push(item.name)
+                                }
+                             })
+						}
+						if(shop.businessScope != "" && shop.businessScope != null){
+							_this.Scopelist = _this.setNewScope(shop.businessScope);
+							 _this.Scopelist.forEach(function (item) {
+                                if(item.checked){
+                                _this.shopScope.push(item.name)
+                                }
+                             })
+						}
                     if(shop.cityID!=''&&shop.cityID!=null){
                         _this.getcity()
                     }
@@ -162,6 +178,24 @@
                 }
              })
          },
+        changeMainPros:function(event){
+                var _this = this;
+                var	values = event.target.value;
+                if(event.target.checked){
+                    _this.shopMainPros.push(values)
+                }else {
+                    _this.shopMainPros.splice(_this.shopMainPros.indexOf(values), 1);
+                }
+        },
+        changeScope:function(event){
+                 var _this = this;
+                 var values = event.target.value;
+                if(event.target.checked){
+                    _this.shopScope.push(values)
+                }else {
+                    _this.shopScope.splice(_this.shopScope.indexOf(values), 1);
+                }
+        },
          shopSubmit:function(){ //提交
             var _self = this;
             var params = {};
@@ -382,24 +416,17 @@
         },
         setNewMainpro:function(arr){//回显处理主营内容
             var newArr = [];
-            console.log(arr)
-            arr.split('/').forEach(function(item){
-                newArr.push(item);
+            arr.split('/').forEach(function(item,index){
+                newArr.push({value:(index+1).toString(),'name':item,checked:true});
             });
             return newArr
         },
         setNewScope:function(arr) {//回显处理主营内容
               var newArr = [];
-              console.log(arr)
-              if(arr!=null){
-                 arr.split('/').forEach(function(item){
-                    newArr.push(item);
+                 arr.split('/').forEach(function(item,index){
+                    newArr.push({value:(index+1).toString(),'name':item,checked:true});
                 });
                  return newArr
-              }else {
-                return newArr
-              }
-
 
         },
     },

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

@@ -157,7 +157,7 @@
                             <div class="formLine">
                                 <p><em>*</em>主营产品:</p>
                                 <p class="business">
-                                    <label v-for="pro in mentuzCampNullList" class="diyBox second"><input type="checkbox"v-model="shopMainPros" :value="pro.name" ><i class="icon mIcon">{{pro.name}}</i></label>
+                                    <label v-for="pro in mentuzCampNullList" class="diyBox second"><input type="checkbox" v-model="pro.checked" :value="pro.name" @input="changeMainPros"><i class="icon mIcon">{{pro.name}}</i></label>
                                 </p>
                                 <p class="addbusiness">
                                     <input type="text" placeholder="请输入自定义主营内容" v-model.trim="mainProEdit" maxlength="5" >
@@ -168,7 +168,7 @@
                             <div class="formLine">
                                 <p><em>*</em>经营范围:</p>
                                 <p class="business">
-                                    <label v-for="pro in Scopelist" class="diyBox second"><input type="checkbox" name="secondShopType" v-model="shopScope" :value="pro.name" ><i class="icon mIcon">{{pro.name}}</i></label>
+                                    <label v-for="pro in Scopelist" class="diyBox second"><input type="checkbox" name="secondShopType" v-model="pro.checked" :value="pro.name" @input="changeScope"><i class="icon mIcon">{{pro.name}}</i></label>
                                 </p>
                                 <p class="addbusiness">
                                     <input type="text" placeholder="请输入自定义经营范围" v-model.trim="shopScopeEdit" maxlength="5" >