|
@@ -34,7 +34,7 @@
|
|
|
<scroll-view scroll-y="true" style="height: 300rpx;">
|
|
|
<view class="u-flex u-row-center">
|
|
|
<u-checkbox-group :wrap="true" @change="checkboxGroupChange" style="display: flex;justify-content: center">
|
|
|
- <u-checkbox v-model="item.checked" v-for="(item, index) in agentList" :key="index" :name="item.brand" shape="circle">
|
|
|
+ <u-checkbox v-model="item.checked" v-for="(item, index) in brandList" :key="index" :name="item.brand" shape="circle">
|
|
|
<view class="u-flex u-row-left" style="width: 150rpx;">
|
|
|
{{item.brand}}
|
|
|
</view>
|
|
@@ -51,7 +51,7 @@
|
|
|
已选合作品牌
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view slot="body" style="display:flex;width:100%;flex-flow: wrap;justify-content: space-around;">
|
|
|
+ <view slot="body" style="display:flex;width:100%;flex-flow: wrap;justify-content: space-around;align-items: center;">
|
|
|
<view v-for="(item,index) in querybrandList" :key="index" style="width: 250rpx;">
|
|
|
<u-image width="250rpx" :src="item.logUrl" mode="widthFix"></u-image>
|
|
|
</view>
|
|
@@ -78,8 +78,8 @@
|
|
|
<view style="margin-right: 10rpx;">
|
|
|
<u-icon name="order" size="36"></u-icon>
|
|
|
</view>
|
|
|
- <u-radio-group v-model="item.taskNum">
|
|
|
- <u-radio v-for="(i, index) in tasknameList" :key="index" :name="i.task" :disabled="i.taskdisabled">
|
|
|
+ <u-radio-group v-model="item.taskNum" :disabled="item.disabledGroup" @change="changeRadiogroup">
|
|
|
+ <u-radio v-for="(i, index) in tasknameList" :key="index" :name="i.task">
|
|
|
{{i.task}}
|
|
|
</u-radio>
|
|
|
</u-radio-group>
|
|
@@ -130,7 +130,8 @@
|
|
|
}]
|
|
|
},
|
|
|
protocol: false,
|
|
|
- querybrandList:[]
|
|
|
+ querybrandList:[],
|
|
|
+ brandList:[]
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -139,15 +140,12 @@
|
|
|
this.dataUrl = data.dataUrl
|
|
|
})
|
|
|
this.getAgentArea()
|
|
|
- this.getQuerybrand()
|
|
|
this.getTasknum()
|
|
|
},
|
|
|
methods: {
|
|
|
getAgentArea() {
|
|
|
- request({
|
|
|
- url: '/sailun/appStoreBasicInfo/getAgentArea',
|
|
|
- method: 'post',
|
|
|
- data: {
|
|
|
+ let data={
|
|
|
+
|
|
|
"area": this.formData.district,
|
|
|
"city": this.formData.city,
|
|
|
"province": this.formData.province,
|
|
@@ -158,25 +156,38 @@
|
|
|
"vkorg": "8100",
|
|
|
"vtweg": "10"
|
|
|
}
|
|
|
+ console.log(data)
|
|
|
+ request({
|
|
|
+ url: '/sailun/appStoreBasicInfo/getAgentArea',
|
|
|
+ method: 'post',
|
|
|
+ data: data
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 0) {
|
|
|
this.agentList = res.data.Data.data
|
|
|
this.agentList = this.agentList.reduce((res, item, index, array) => {
|
|
|
- for (let i = 0; i < array[index].brandList.length; i++) {
|
|
|
+ for (let i = 0; i < array[index].regionBrandList.length; i++) {
|
|
|
res.push({
|
|
|
- brand: array[index].brandList[i],
|
|
|
- brandCode: array[index].brandList[i],
|
|
|
+ brand: array[index].regionBrandList[i],
|
|
|
+ brandCode: array[index].regionBrandList[i],
|
|
|
name: item.name,
|
|
|
kunnr: item.kunnr,
|
|
|
agent_id: item.kunnr,
|
|
|
taskNum: "",
|
|
|
- checked: false,
|
|
|
- disabled: false,
|
|
|
+ disabledGroup:false,
|
|
|
})
|
|
|
}
|
|
|
return res;
|
|
|
}, []);
|
|
|
-
|
|
|
+ this.brandList=this.agentList.reduce((res, item, index, array) => {
|
|
|
+ res.push(item.brand)
|
|
|
+ return res;
|
|
|
+ }, []);
|
|
|
+ this.brandList=[...new Set(this.brandList)]
|
|
|
+ this.brandList=this.brandList.reduce((res, item, index, array) => {
|
|
|
+ res.push({brand:item})
|
|
|
+ return res;
|
|
|
+ }, []);
|
|
|
+ console.log(brandList)
|
|
|
}
|
|
|
if (res.data.code == 500) {
|
|
|
this.$u.toast(res.data.msg);
|
|
@@ -196,6 +207,8 @@
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 0) {
|
|
|
this.querybrandList=res.data.data
|
|
|
+ this.querybrandList = this.querybrandList.filter(item => this.cooperations.indexOf(item.brandCode) > -1)
|
|
|
+ console.log(this.querybrandList)
|
|
|
}
|
|
|
if (res.data.code == 500) {
|
|
|
this.$u.toast(res.data.msg);
|
|
@@ -217,7 +230,6 @@
|
|
|
this.tasknameList = this.taskList.reduce((res, item) => {
|
|
|
res.push({
|
|
|
task: item.signLv,
|
|
|
- taskdisabled: false,
|
|
|
})
|
|
|
return res;
|
|
|
}, []);
|
|
@@ -234,10 +246,36 @@
|
|
|
checkboxGroupChange(e) {
|
|
|
this.cooperations = e
|
|
|
},
|
|
|
+ changeRadiogroup(){
|
|
|
+ console.log(this.checkedAgentlist)
|
|
|
+ // let repeat=[]
|
|
|
+ // this.checkedAgentlist.reduce((res, item, index, array) => {
|
|
|
+ // return repeat.push({brand:item.brand,taskNum:item.taskNum})
|
|
|
+ // }, []);
|
|
|
+
|
|
|
+ // let arrD = [];
|
|
|
+ // const map = new Map();
|
|
|
+ // repeat.forEach(v => { if (map.get(v.brand) && arrD.every(vD => vD.brand != v.brand)) {
|
|
|
+ // arrD.push(v);
|
|
|
+ // } else {
|
|
|
+ // map.set(v.brand, v);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // var zdys = (repeat|| []).findIndex((profile) => profile.brand === arrD[0].brand);
|
|
|
+
|
|
|
+ // console.log(zdys);
|
|
|
+ // repeat.forEach((item,index,array)=>{
|
|
|
+ // if(!array[index].taskNum){
|
|
|
+
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+
|
|
|
+ },
|
|
|
getCooperation() {
|
|
|
if (this.cooperations != null) {
|
|
|
this.form.cooperation = this.cooperations.toString();
|
|
|
this.checkedAgentlist = this.agentList.filter(item => this.cooperations.indexOf(item.brand) > -1)
|
|
|
+ this.getQuerybrand()
|
|
|
this.brandShow = false
|
|
|
} else {
|
|
|
console.log("至少选择一项")
|