|  | @@ -33,10 +33,11 @@
 | 
	
		
			
				|  |  |  				<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: center">
 | 
	
		
			
				|  |  | -								<u-checkbox v-model="item.checked" v-for="(item, index) in brandList" :key="index" :name="item.brand" shape="circle">
 | 
	
		
			
				|  |  | +							
 | 
	
		
			
				|  |  | +							<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.brand}}
 | 
	
		
			
				|  |  | +										{{item.brandCode}}
 | 
	
		
			
				|  |  |  									</view>
 | 
	
		
			
				|  |  |  								</u-checkbox>
 | 
	
		
			
				|  |  |  							</u-checkbox-group>
 | 
	
	
		
			
				|  | @@ -44,7 +45,8 @@
 | 
	
		
			
				|  |  |  					</scroll-view>
 | 
	
		
			
				|  |  |  				</view>
 | 
	
		
			
				|  |  |  			</u-popup>
 | 
	
		
			
				|  |  | -			<u-card v-if="querybrandList.length" :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
 | 
	
		
			
				|  |  | +			<u-card v-if="this.form.cooperation.length" :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)"
 | 
	
		
			
				|  |  | +			 border-radius="20" :show-foot="false">
 | 
	
		
			
				|  |  |  				<view slot="head">
 | 
	
		
			
				|  |  |  					<view class="u-flex">
 | 
	
		
			
				|  |  |  						<view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
 | 
	
	
		
			
				|  | @@ -60,10 +62,15 @@
 | 
	
		
			
				|  |  |  			<u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false"
 | 
	
		
			
				|  |  |  			 v-for="(item, index) in checkedAgentlist" :key="index">
 | 
	
		
			
				|  |  |  				<view slot="head">
 | 
	
		
			
				|  |  | +					<view class="u-flex u-row-between">
 | 
	
		
			
				|  |  |  					<view class="u-flex">
 | 
	
		
			
				|  |  |  						<view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
 | 
	
		
			
				|  |  |  						{{item.brand}}合作品牌签约任务
 | 
	
		
			
				|  |  |  					</view>
 | 
	
		
			
				|  |  | +						<view @click="delAgent(index)">
 | 
	
		
			
				|  |  | +							<u-icon name="close" color="#666666" size="36"></u-icon>
 | 
	
		
			
				|  |  | +				</view>
 | 
	
		
			
				|  |  | +					</view>
 | 
	
		
			
				|  |  |  				</view>
 | 
	
		
			
				|  |  |  				<view slot="body">
 | 
	
		
			
				|  |  |  					<u-form-item>
 | 
	
	
		
			
				|  | @@ -79,7 +86,7 @@
 | 
	
		
			
				|  |  |  							<u-icon name="order" size="36"></u-icon>
 | 
	
		
			
				|  |  |  						</view>
 | 
	
		
			
				|  |  |  						<u-radio-group v-model="item.taskNum" :disabled="item.disabledGroup" @change="changeRadiogroup(item)">
 | 
	
		
			
				|  |  | -							<u-radio v-for="(i, index) in tasknameList" :key="index" :name="i.signLv">
 | 
	
		
			
				|  |  | +							<u-radio @click.native.prevent="clickitem(item,i.signLv)" :label-disabled="i.labelDisabled" v-for="(i, index2) in tasknameList" :key="index2" :name="i.signLv">
 | 
	
		
			
				|  |  |  								{{i.signLv}}
 | 
	
		
			
				|  |  |  							</u-radio>
 | 
	
		
			
				|  |  |  						</u-radio-group>
 | 
	
	
		
			
				|  | @@ -87,6 +94,18 @@
 | 
	
		
			
				|  |  |  				</view>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			</u-card>
 | 
	
		
			
				|  |  | +			<u-card v-if="checkedAgentlist.length==0&&this.form.cooperation.length" :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)"
 | 
	
		
			
				|  |  | +			 border-radius="20" :show-foot="false">
 | 
	
		
			
				|  |  | +				<view slot="head">
 | 
	
		
			
				|  |  | +					<view class="u-flex">
 | 
	
		
			
				|  |  | +						<view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
 | 
	
		
			
				|  |  | +						温馨提示
 | 
	
		
			
				|  |  | +					</view>
 | 
	
		
			
				|  |  | +				</view>
 | 
	
		
			
				|  |  | +				<view slot="body" style="display:flex;width:100%;flex-flow: wrap;justify-content: space-around;align-items: center;">
 | 
	
		
			
				|  |  | +					此地区暂无此品牌的经销商
 | 
	
		
			
				|  |  | +				</view>
 | 
	
		
			
				|  |  | +			</u-card>
 | 
	
		
			
				|  |  |  			<u-form-item :border-bottom="false">
 | 
	
		
			
				|  |  |  				<view style="margin:0 30rpx;">
 | 
	
		
			
				|  |  |  					<u-checkbox-group>
 | 
	
	
		
			
				|  | @@ -130,8 +149,9 @@
 | 
	
		
			
				|  |  |  					}]
 | 
	
		
			
				|  |  |  				},
 | 
	
		
			
				|  |  |  				protocol: false,
 | 
	
		
			
				|  |  | -				querybrandList:[],
 | 
	
		
			
				|  |  | -				brandList:[]
 | 
	
		
			
				|  |  | +				querybrandList: [],
 | 
	
		
			
				|  |  | +				brandList: [],
 | 
	
		
			
				|  |  | +				allbrandList:[]
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		created() {
 | 
	
	
		
			
				|  | @@ -141,19 +161,19 @@
 | 
	
		
			
				|  |  |  			})
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		mounted() {
 | 
	
		
			
				|  |  | -			uni.showLoading({
 | 
	
		
			
				|  |  | -				title: '加载中...'
 | 
	
		
			
				|  |  | -			});
 | 
	
		
			
				|  |  |  			this.getAgentArea()
 | 
	
		
			
				|  |  |  			this.getTasknum()
 | 
	
		
			
				|  |  | +			this.getAllbrandlist()
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		methods: {
 | 
	
		
			
				|  |  |  			getAgentArea() {
 | 
	
		
			
				|  |  | -				console.log(this.formData)
 | 
	
		
			
				|  |  | +				uni.showLoading({
 | 
	
		
			
				|  |  | +					title: '加载中...'
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  |  				request({
 | 
	
		
			
				|  |  |  					url: '/sailun/appStoreBasicInfo/getAgentArea',
 | 
	
		
			
				|  |  |  					method: 'post',
 | 
	
		
			
				|  |  | -					data:{
 | 
	
		
			
				|  |  | +					data: {
 | 
	
		
			
				|  |  |  						"area": this.formData.district,
 | 
	
		
			
				|  |  |  						"city": this.formData.city,
 | 
	
		
			
				|  |  |  						"province": this.formData.province,
 | 
	
	
		
			
				|  | @@ -168,24 +188,27 @@
 | 
	
		
			
				|  |  |  					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].brandList.length; ++i) {
 | 
	
		
			
				|  |  |  								res.push({
 | 
	
		
			
				|  |  | -									brand: array[index].regionBrandList[i],
 | 
	
		
			
				|  |  | -									brandCode: array[index].regionBrandList[i],
 | 
	
		
			
				|  |  | +									brand: array[index].brandList[i],
 | 
	
		
			
				|  |  | +									brandCode: array[index].brandList[i],
 | 
	
		
			
				|  |  |  									name: item.name,
 | 
	
		
			
				|  |  |  									kunnr: item.kunnr,
 | 
	
		
			
				|  |  |  									agent_id: item.kunnr,
 | 
	
		
			
				|  |  |  									taskNum: "",
 | 
	
		
			
				|  |  | -									disabledGroup:false,
 | 
	
		
			
				|  |  | +									disabledGroup: false,
 | 
	
		
			
				|  |  | +									checked:false,
 | 
	
		
			
				|  |  |  								})
 | 
	
		
			
				|  |  |  							}
 | 
	
		
			
				|  |  |  							return res;
 | 
	
		
			
				|  |  |  						}, []);
 | 
	
		
			
				|  |  | -						this.brandList=[...new Set(this.agentList.reduce((res, item, index, array) => {
 | 
	
		
			
				|  |  | +						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})
 | 
	
		
			
				|  |  | +							res.push({
 | 
	
		
			
				|  |  | +								brand: item
 | 
	
		
			
				|  |  | +							})
 | 
	
		
			
				|  |  |  							return res;
 | 
	
		
			
				|  |  |  						}, []);
 | 
	
		
			
				|  |  |  					}
 | 
	
	
		
			
				|  | @@ -199,14 +222,32 @@
 | 
	
		
			
				|  |  |  					uni.hideLoading()
 | 
	
		
			
				|  |  |  				})
 | 
	
		
			
				|  |  |  			},
 | 
	
		
			
				|  |  | -			getQuerybrand(){
 | 
	
		
			
				|  |  | +			getAllbrandlist() {
 | 
	
		
			
				|  |  |  				request({
 | 
	
		
			
				|  |  |  					url: '/sailun/appStoreBasicInfo/queryBrand',
 | 
	
		
			
				|  |  |  					method: 'get',
 | 
	
		
			
				|  |  |  					data: {},
 | 
	
		
			
				|  |  |  				}).then(res => {
 | 
	
		
			
				|  |  |  					if (res.data.code == 0) {
 | 
	
		
			
				|  |  | -					this.querybrandList=res.data.data
 | 
	
		
			
				|  |  | +						this.allbrandList = res.data.data
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +					if (res.data.code == 500) {
 | 
	
		
			
				|  |  | +						this.$u.toast(res.data.msg);
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				}).catch(err => {
 | 
	
		
			
				|  |  | +					console.log(err)
 | 
	
		
			
				|  |  | +				}).finally(() => {
 | 
	
		
			
				|  |  | +			
 | 
	
		
			
				|  |  | +				})
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			getQuerybrand() {
 | 
	
		
			
				|  |  | +				request({
 | 
	
		
			
				|  |  | +					url: '/sailun/appStoreBasicInfo/queryBrand',
 | 
	
		
			
				|  |  | +					method: 'get',
 | 
	
		
			
				|  |  | +					data: {},
 | 
	
		
			
				|  |  | +				}).then(res => {
 | 
	
		
			
				|  |  | +					if (res.data.code == 0) {
 | 
	
		
			
				|  |  | +						this.querybrandList = res.data.data
 | 
	
		
			
				|  |  |  					this.querybrandList = this.querybrandList.filter(item => this.cooperations.indexOf(item.brandCode) > -1)
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  					if (res.data.code == 500) {
 | 
	
	
		
			
				|  | @@ -225,14 +266,10 @@
 | 
	
		
			
				|  |  |  					data: {},
 | 
	
		
			
				|  |  |  				}).then(res => {
 | 
	
		
			
				|  |  |  					if (res.data.code == 0) {
 | 
	
		
			
				|  |  | -						this.tasknameList = res.data.data
 | 
	
		
			
				|  |  | -						this.tasknameList.push({
 | 
	
		
			
				|  |  | -							brand: null,
 | 
	
		
			
				|  |  | -							brandCode: null,
 | 
	
		
			
				|  |  | -							mainId:null,
 | 
	
		
			
				|  |  | -							numTask:null,
 | 
	
		
			
				|  |  | -							signLv: "无"
 | 
	
		
			
				|  |  | +						res.data.data.map(function(item, index) {
 | 
	
		
			
				|  |  | +							item.checked = false;
 | 
	
		
			
				|  |  |  						})
 | 
	
		
			
				|  |  | +						this.tasknameList = res.data.data
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  					if (res.data.code == 500) {
 | 
	
		
			
				|  |  |  						this.$u.toast(res.data.msg);
 | 
	
	
		
			
				|  | @@ -246,11 +283,21 @@
 | 
	
		
			
				|  |  |  			checkboxGroupChange(e) {
 | 
	
		
			
				|  |  |  				this.cooperations = e
 | 
	
		
			
				|  |  |  			},
 | 
	
		
			
				|  |  | -			changeRadiogroup(item){
 | 
	
		
			
				|  |  | -				if(item.taskNum=="无"){
 | 
	
		
			
				|  |  | -					this.checkedAgentlist.filter(e=>(e.brand===item.brand&&e.agent_id!=item.agent_id)).forEach(e=>e.disabledGroup=false)
 | 
	
		
			
				|  |  | +			changeRadiogroup(item) {
 | 
	
		
			
				|  |  | +				if (item.checked==true) {
 | 
	
		
			
				|  |  | +					this.checkedAgentlist.filter(e => (e.brand === item.brand && e.agent_id != item.agent_id)).forEach(e => e.disabledGroup =
 | 
	
		
			
				|  |  | +						false)
 | 
	
		
			
				|  |  | +				} else {
 | 
	
		
			
				|  |  | +					this.checkedAgentlist.filter(e => (e.brand === item.brand && e.agent_id != item.agent_id)).forEach(e => e.disabledGroup =
 | 
	
		
			
				|  |  | +						true)
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			clickitem (item,e) {
 | 
	
		
			
				|  |  | +				if(item.checked==false){
 | 
	
		
			
				|  |  | +					item.checked=true
 | 
	
		
			
				|  |  |  				}else{
 | 
	
		
			
				|  |  | -					this.checkedAgentlist.filter(e=>(e.brand===item.brand&&e.agent_id!=item.agent_id)).forEach(e=>e.disabledGroup=true)
 | 
	
		
			
				|  |  | +					item.checked=false
 | 
	
		
			
				|  |  | +					item.taskNum=""
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  			},
 | 
	
		
			
				|  |  |  			getCooperation() {
 | 
	
	
		
			
				|  | @@ -267,21 +314,27 @@
 | 
	
		
			
				|  |  |  			getTaskconfirm(e) {
 | 
	
		
			
				|  |  |  				this.form.tasklist = e[0].label;
 | 
	
		
			
				|  |  |  			},
 | 
	
		
			
				|  |  | +			delAgent(index){
 | 
	
		
			
				|  |  | +				this.checkedAgentlist.splice(index,1)
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  |  			submit() {
 | 
	
		
			
				|  |  |  				this.$refs.uForm.validate(valid => {
 | 
	
		
			
				|  |  |  					if (valid) {
 | 
	
		
			
				|  |  | -						if(!this.protocol)return this.$u.toast('请勾选协议');
 | 
	
		
			
				|  |  | +						this.brandAgentLvQueryList=this.checkedAgentlist.filter(item => (item.disabledGroup!=true))
 | 
	
		
			
				|  |  | +						let checkenLength=this.checkedAgentlist.filter(item => (item.checked==true))
 | 
	
		
			
				|  |  | +						if(checkenLength.length<this.brandAgentLvQueryList.length) return this.$u.toast('请完善任务条数');
 | 
	
		
			
				|  |  | +						if (!this.protocol) return this.$u.toast('请勾选协议');
 | 
	
		
			
				|  |  |  						this.setData()
 | 
	
		
			
				|  |  |  					} else {
 | 
	
		
			
				|  |  |  						console.log('验证失败');
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  				});
 | 
	
		
			
				|  |  |  			},
 | 
	
		
			
				|  |  | -			setData(){
 | 
	
		
			
				|  |  | -				this.brandAgentLvQueryList = this.checkedAgentlist.reduce((res, item) => {
 | 
	
		
			
				|  |  | +			setData() {
 | 
	
		
			
				|  |  | +				this.brandAgentLvQueryList = this.brandAgentLvQueryList.reduce((res, item) => {
 | 
	
		
			
				|  |  |  					res.push({
 | 
	
		
			
				|  |  |  						agent_id: item.agent_id,
 | 
	
		
			
				|  |  | -						agent_name:item.name,
 | 
	
		
			
				|  |  | +						agent_name: item.name,
 | 
	
		
			
				|  |  |  						brand: item.brand,
 | 
	
		
			
				|  |  |  						brandCode: item.brandCode,
 | 
	
		
			
				|  |  |  						kunnr: item.kunnr,
 | 
	
	
		
			
				|  | @@ -294,27 +347,25 @@
 | 
	
		
			
				|  |  |  					return res;
 | 
	
		
			
				|  |  |  				}, []);
 | 
	
		
			
				|  |  |  				let data = {
 | 
	
		
			
				|  |  | -					"brandAgentLvQueryList":this.brandAgentLvQueryList,
 | 
	
		
			
				|  |  | -					"city":this.formData.city,
 | 
	
		
			
				|  |  | -					"contactName":this.formData.name,
 | 
	
		
			
				|  |  | -					"district":this.formData.district,
 | 
	
		
			
				|  |  | -					"jd":this.formData.longitude,
 | 
	
		
			
				|  |  | -					"licenseUrl":this.dataUrl.licenseUrl,
 | 
	
		
			
				|  |  | -					"mobileCode":this.formData.code,
 | 
	
		
			
				|  |  | -					"province":this.formData.province,
 | 
	
		
			
				|  |  | -					"storeImageUrl":this.dataUrl.storeUrl,
 | 
	
		
			
				|  |  | -					"storeName":this.formData.store,
 | 
	
		
			
				|  |  | -					"storePhone":this.formData.phone,
 | 
	
		
			
				|  |  | -					"version":1.00,
 | 
	
		
			
				|  |  | -					"wd":this.formData.latitude,
 | 
	
		
			
				|  |  | +					"brandAgentLvQueryList": this.brandAgentLvQueryList,
 | 
	
		
			
				|  |  | +					"city": this.formData.city,
 | 
	
		
			
				|  |  | +					"contactName": this.formData.name,
 | 
	
		
			
				|  |  | +					"district": this.formData.district,
 | 
	
		
			
				|  |  | +					"jd": this.formData.longitude,
 | 
	
		
			
				|  |  | +					"licenseUrl": this.dataUrl.licenseUrl,
 | 
	
		
			
				|  |  | +					"mobileCode": this.formData.code,
 | 
	
		
			
				|  |  | +					"province": this.formData.province,
 | 
	
		
			
				|  |  | +					"storeImageUrl": this.dataUrl.storeUrl,
 | 
	
		
			
				|  |  | +					"storeName": this.formData.store,
 | 
	
		
			
				|  |  | +					"storePhone": this.formData.phone,
 | 
	
		
			
				|  |  | +					"version": 1.00,
 | 
	
		
			
				|  |  | +					"wd": this.formData.latitude,
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  | -				console.log(data)
 | 
	
		
			
				|  |  |  				request({
 | 
	
		
			
				|  |  |  					url: '/sailun/appStoreBasicInfo/storeReg',
 | 
	
		
			
				|  |  |  					method: 'post',
 | 
	
		
			
				|  |  |  					data: data
 | 
	
		
			
				|  |  |  				}).then(res => {
 | 
	
		
			
				|  |  | -					console.log(res)
 | 
	
		
			
				|  |  |  					if (res.data.code == 0) {
 | 
	
		
			
				|  |  |  						this.loading = true
 | 
	
		
			
				|  |  |  						this.$u.toast(res.data.msg);
 |