Browse Source

2024-6-27

cmy 1 year ago
parent
commit
c39a82470c
1 changed files with 41 additions and 31 deletions
  1. 41 31
      src/pages/user/list/handle/userForm.vue

+ 41 - 31
src/pages/user/list/handle/userForm.vue

@@ -67,7 +67,8 @@
 								<div class="width-add">
 									<div v-if="dataLabel.length">
 										<Tag closable v-for="(item,index) in dataLabel" @on-close="closeLabel(item)">
-											{{item.label_name}}</Tag>
+											{{item.label_name}}
+										</Tag>
 									</div>
 									<span class="span" v-else>选择用户关联标签</span>
 								</div>
@@ -171,10 +172,10 @@
 					street: 0,
 					spread_uid: 0,
 					spread_uid_nickname: '',
-					area_admin:"0",
-					area_admin_province:'',
-					area_admin_city:'',
-					area_admin_district:'',
+					area_admin: "0",
+					area_admin_province: '',
+					area_admin_city: '',
+					area_admin_district: '',
 				},
 				dataLabel: [],
 				//省市区
@@ -226,9 +227,9 @@
 			this.labelList();
 			this.cityInfo({
 				pid: 0
-			},'addresData');
-			if(this.psInfo.area_admin){
-				this.changearea(this.psInfo.area_admin.toString(),"init");
+			}, 'addresData');
+			if (this.psInfo.area_admin) {
+				this.changearea(this.psInfo.area_admin.toString(), "init");
 			}
 			if (this.psInfo.province) {
 				this.addressSelect.push(this.psInfo.province);
@@ -239,39 +240,48 @@
 			if (this.psInfo.area) {
 				this.addressSelect.push(this.psInfo.area);
 			}
-			console.log(this.addressSelect,'addressSelect')
+			console.log(this.addressSelect, 'addressSelect')
 			if (this.psInfo.street) {
 				this.addressSelect.push(this.psInfo.street);
 			}
 		},
 		methods: {
 			// 选择运营中心
-			changearea(e,type='reload'){
-				try{
+			changearea(e, type = 'reload') {
+				try {
 					console.log(type);
-					if(type=='reload'){
+					if (type == 'reload') {
 						this.addressSelectDl = [];
 					}
-					if(type=='init'){
-						this.addressSelectDl=this.psInfo.area_provincials.split('/').map((re)=>{
+					if (type == 'init') {
+						this.addressSelectDl = this.psInfo.area_provincials.split('/').map((re) => {
 							return +re
 						});
 					}
 					console.log(type);
-					if(e==3){
-						this.cityInfo({pid:0,type:4},"addresData2")
-					}else
-					if(e==2){
-						this.cityInfo({pid:0,type:1},"addresData2")
-					}else
-					if(e==1){
-						this.cityInfo({pid:0,type:2},"addresData2")
+					if (e == 3) {
+						this.cityInfo({
+							pid: 0,
+							type: 4
+						}, "addresData2")
+					} else
+					if (e == 2) {
+						this.cityInfo({
+							pid: 0,
+							type: 1
+						}, "addresData2")
+					} else
+					if (e == 1) {
+						this.cityInfo({
+							pid: 0,
+							type: 2
+						}, "addresData2")
 					}
-				}catch(e){
+				} catch (e) {
 					console.log(e);
 					//TODO handle the exception
 				}
-				
+
 			},
 			clearSpread() {
 				this.formData.spread_uid = 0;
@@ -354,12 +364,12 @@
 					});
 			},
 			// 省市区数据
-			cityInfo(data,name) {
+			cityInfo(data, name) {
 				cityApi(data).then(res => {
 					this[name] = res.data
 				})
 			},
-			getCityData(item, callback,type=0){
+			getCityData(item, callback, type = 0) {
 				item.loading = true;
 				cityApi({
 					pid: item.value,
@@ -372,14 +382,14 @@
 			},
 			// 省市区选择
 			loadData(item, callback) {
-				this.getCityData(item, callback,0)
+				this.getCityData(item, callback, 0)
 			},
 			// 代理省市区选择
 			loadData2(item, callback) {
-				if(this.formData.area_admin=="2"){
-					this.getCityData(item, callback,1)
-				}else if(this.formData.area_admin=="1"){
-					this.getCityData(item, callback,2)
+				if (this.formData.area_admin == "2") {
+					this.getCityData(item, callback, 1)
+				} else if (this.formData.area_admin == "1") {
+					this.getCityData(item, callback, 2)
 				}
 			},
 			addchack(e, selectedData) {