Browse Source

修改智能投放地域

朱鑫波 4 years ago
parent
commit
8740dcb998

+ 17 - 11
src/views/modules/autoLaunch/configLaunchInfo.vue

@@ -481,19 +481,20 @@
                                 <a-radio-group   v-model="district" @change="cityChange">
                                     <a-radio-button value="NONE">不限</a-radio-button>
                                     <a-radio-button value="CITY">按省市</a-radio-button>
-                                    <a-radio-button value="COUNTY">按区县</a-radio-button>
+                                    <!-- <a-radio-button value="COUNTY">按区县</a-radio-button> -->
                                     
                                 </a-radio-group>
                             </a-form-item>
                             <div class="region" style="margin-top:20px" v-show="district!='NONE'">
                                 <!-- 省市 -->
                                 <div class="provincyCity" v-if="district=='CITY'">                                                                 
-                                    <linkMultiSelect title='省份' :listArr='regionList' :maxLayers='2' :listUrl='regionCityListUrl' @getSelectedArr='getSelectedCityArr'/>
+                                    <!-- <linkMultiSelect title='省份' :listArr='regionList' :maxLayers='2' :listUrl='regionCityListUrl' @getSelectedArr='getSelectedCityArr'/> -->
+                                     <select-region :checkData.sync="regionList" :dataValue="regionList" />
                                 </div>
                                 <!-- 区县 -->
-                                <div class="district" v-else-if="district=='COUNTY'">                                    
+                                <!-- <div class="district" v-else-if="district=='COUNTY'">                                    
                                     <linkMultiSelect title='省份' :listArr='regionList' :maxLayers='3' :listUrl='regionCityListUrl'  @getSelectedArr='getSelectedCountyArr'/>
-                                </div>
+                                </div> -->
 
                             </div> 
                         </div>
@@ -1659,6 +1660,7 @@ import radioCheck from '@/components/formComponents/checkBoxGroup'
 import linkMultiSelect from './components/linkMultiSelect'
 import singleLayersSelecte from './components/singleLayerSelecte'
 import scheduleTime from '@/components/formComponents/toutiaoTime'
+import selectRegion from '@/views/modules/kuaishouapp/account/stepForm/stepModule/selectRegion'
 import $ from "jquery"
 // import { filter } from 'vue/types/umd';
 var str = ""
@@ -1775,7 +1777,8 @@ export default {
         radioCheck,
             linkMultiSelect,
             singleLayersSelecte,
-            scheduleTime
+            scheduleTime,
+            selectRegion
     },
     data() {
         return {
@@ -2486,6 +2489,7 @@ export default {
             },
             cityChange(){
                 this.region=[];
+                this.regionList=[];
 
             },
             onChange(checkedList) {
@@ -2691,9 +2695,7 @@ export default {
                 if (!err) {     
                     // console.log(values)              
                     this.goNextloading=true;
-                    if(this.district!='NONE'){
-                        values.district=this.district
-                    }
+                   
                     // //console.log(this.excludeSelectedKeys,this.incluedSelectedKeys)
                     
                     // 设置广告位值
@@ -2732,8 +2734,12 @@ export default {
                     }
                     values.appId = undefined
                     values.agesRange=this.agesRange[0]==1?JSON.stringify([]):JSON.stringify(this.agesRange)
-                    values.region=JSON.stringify(this.region);
-                    
+                    values.region=JSON.stringify(this.regionList.map(item=>{return item.value}));
+                    if(this.district!='NONE'){
+                        values.district=this.district
+                    }else{
+                        values.region=[]
+                    }
                     values.convertId=this.convertId==''?undefined:this.convertId.key;
                     values.appInterest = JSON.stringify(values.appInterest)
                     
@@ -3198,7 +3204,7 @@ export default {
                     this.incluedSelectedRowKeys=res.result.population?JSON.parse(res.result.population):[]
                     this.excludeSelectedRowKeys=res.result.excludePopulation?JSON.parse(res.result.excludePopulation):[]
                     
-                    let region=res.result.region?JSON.parse(res.result.region):[]
+                    let region=res.result.region&&eval(res.result.region).length>0?JSON.parse(res.result.region):[]
                     if(region.length==0){
                         this.district='NONE'
                     }else{

+ 5 - 0
src/views/modules/kuaishouapp/account/stepForm/stepModule/selectRegion.vue

@@ -283,6 +283,7 @@
         })
       },
       checkAllBox() {
+        this.showCityData = false
         this.checkMatched = []
         this.checkData = []
         if (this.checkAll) {
@@ -342,6 +343,7 @@
         } else {
           this.checkAll = false
         }
+        this.showCity(item,index)
         this.$emit('update:checkData', this.checkData)
       },
       checkAllBoxCity() {
@@ -369,6 +371,7 @@
         if (allCity.length == this.city.length) {
           this.checkMatched.push(this.nowProvince.value)
           this.checkData.push(this.nowProvince)
+          this.showCityData = false
           for (var i = 0; i < allCity.length; i++) {
             for (var j = 0; j < this.checkData.length; j++) {
               if (allCity[i] == this.checkData[j].value) {
@@ -387,6 +390,7 @@
           } else {
             this.checkAll = false
           }
+          
         } else {
           if (this.checkMatched.indexOf(this.nowProvince.value) != -1) {
             var index1 = this.checkData.findIndex(v => v.value === this.nowProvince.value)
@@ -402,6 +406,7 @@
             var index1 = this.checkData.findIndex(v => v.value === item.value)
             this.checkData.splice(index1, 1)
           }
+          
         }
         this.$emit('update:checkData', this.checkData)
       },