|
@@ -31,18 +31,13 @@
|
|
|
</view>
|
|
|
<u-line color="#e4e7ed"></u-line>
|
|
|
<view class="content">
|
|
|
- <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: left">
|
|
|
- <u-checkbox v-model="item.checked" v-for="(item, index) in allbrandList" :key="index" :name="item.brandCode" shape="circle">
|
|
|
- <view class="u-flex u-row-left" style="width: 150rpx;">
|
|
|
- {{item.brandCode}}
|
|
|
- </view>
|
|
|
- </u-checkbox>
|
|
|
- </u-checkbox-group>
|
|
|
- </view>
|
|
|
- </scroll-view>
|
|
|
+ <u-checkbox-group :wrap="true" @change="checkboxGroupChange" style="display: flex;justify-content: left">
|
|
|
+ <u-checkbox v-model="item.checked" v-for="(item, index) in allbrandList" :key="index" :name="item.brandCode" shape="circle">
|
|
|
+ <view class="u-flex u-row-left" style="width: 150rpx;">
|
|
|
+ {{item.brandCode}}
|
|
|
+ </view>
|
|
|
+ </u-checkbox>
|
|
|
+ </u-checkbox-group>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
<u-card v-if="this.form.cooperation.length" :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)"
|
|
@@ -150,8 +145,9 @@
|
|
|
},
|
|
|
protocol: false,
|
|
|
querybrandList: [],
|
|
|
- brandList: [],
|
|
|
- allbrandList:[]
|
|
|
+ // brandList: [],
|
|
|
+ allbrandList:[],//弹出窗获取brand数组
|
|
|
+ checkedBrandlist:[]//选中brand组成一个新数组
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -188,7 +184,7 @@
|
|
|
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].regionBrandList.length; ++i) {
|
|
|
+ for (let i = 0; i < array[index].regionBrandList.length;i++) {
|
|
|
res.push({
|
|
|
brand: array[index].regionBrandList[i],
|
|
|
brandCode: array[index].regionBrandList[i],
|
|
@@ -202,15 +198,15 @@
|
|
|
}
|
|
|
return res;
|
|
|
}, []);
|
|
|
- this.brandList = [...new Set(this.agentList.reduce((res, item, index, array) => {
|
|
|
- res.push(item.brand)
|
|
|
- return res;
|
|
|
- }, []))].reduce((res, item, index, array) => {
|
|
|
- res.push({
|
|
|
- brand: item
|
|
|
- })
|
|
|
- return res;
|
|
|
- }, []);
|
|
|
+ // this.brandList = [...new Set(this.agentList.reduce((res, item, index, array) => {
|
|
|
+ // res.push(item.brand)
|
|
|
+ // return res;
|
|
|
+ // }, []))].reduce((res, item, index, array) => {
|
|
|
+ // res.push({
|
|
|
+ // brand: item
|
|
|
+ // })
|
|
|
+ // return res;
|
|
|
+ // }, []);
|
|
|
}
|
|
|
if (res.data.code == 500) {
|
|
|
this.$u.toast(res.data.msg);
|
|
@@ -248,7 +244,7 @@
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 0) {
|
|
|
this.querybrandList = res.data.data
|
|
|
- this.querybrandList = this.querybrandList.filter(item => this.cooperations.indexOf(item.brandCode) > -1)
|
|
|
+ this.querybrandList = this.querybrandList.filter(item => this.checkedBrandlist.indexOf(item.brandCode) > -1)
|
|
|
}
|
|
|
if (res.data.code == 500) {
|
|
|
this.$u.toast(res.data.msg);
|
|
@@ -266,7 +262,7 @@
|
|
|
data: {},
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 0) {
|
|
|
- res.data.data.map(function(item, index) {
|
|
|
+ res.data.data.map((item, index)=> {
|
|
|
item.checked = false;
|
|
|
})
|
|
|
this.tasknameList = res.data.data
|
|
@@ -304,12 +300,15 @@
|
|
|
if (this.cooperations != null) {
|
|
|
this.form.cooperation = this.cooperations.toString();
|
|
|
this.checkedAgentlist = this.agentList.filter(item => this.cooperations.indexOf(item.brand) > -1)
|
|
|
+ this.checkedBrandlist=this.checkedAgentlist.reduce((res, item, index, array) => {
|
|
|
+ res.push(item.brand)
|
|
|
+ return res;
|
|
|
+ }, []);
|
|
|
this.getQuerybrand()
|
|
|
this.brandShow = false
|
|
|
} else {
|
|
|
console.log("至少选择一项")
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
getTaskconfirm(e) {
|
|
|
this.form.tasklist = e[0].label;
|
|
@@ -321,10 +320,10 @@
|
|
|
this.$refs.uForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
this.brandAgentLvQueryList=this.checkedAgentlist.filter(item => (item.disabledGroup!=true))
|
|
|
- let checkenLength=this.checkedAgentlist.filter(item => (item.checked==true))
|
|
|
- if(!checkenLength.length) return this.$u.toast('未正确选择经销商,请正确选择');
|
|
|
- if(checkenLength.length<this.brandAgentLvQueryList.length) return this.$u.toast('请完善任务条数');
|
|
|
- if (!this.protocol) return this.$u.toast('请勾选协议');
|
|
|
+ let checkenLength=this.checkedAgentlist.filter(item => (item.checked==false))
|
|
|
+ if(!this.brandAgentLvQueryList.length) return this.$u.toast('未正确选择经销商,请正确选择');
|
|
|
+ if(checkenLength.length!=0) return this.$u.toast('请选择'+checkenLength[0].brand+"品牌签约任务");
|
|
|
+ if (!this.protocol) return this.$u.toast('请阅读并同意用户协议和隐私协议');
|
|
|
this.setData()
|
|
|
} else {
|
|
|
console.log('验证失败');
|
|
@@ -369,7 +368,6 @@
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 0) {
|
|
|
this.loading = true
|
|
|
- this.$u.toast(res.data.msg);
|
|
|
setTimeout(() => {
|
|
|
this.$u.route({
|
|
|
url: 'pages/login/index',
|