wangguoyu 2 tháng trước cách đây
mục cha
commit
a7eda328ee
1 tập tin đã thay đổi với 38 bổ sung28 xóa
  1. 38 28
      pages/admin/Jiazheng/gerenZiliao.vue

+ 38 - 28
pages/admin/Jiazheng/gerenZiliao.vue

@@ -157,7 +157,7 @@
 					idtype: '1',
 					gender: '',
 					juzhuDizhi: '',
-					shenfenzhengUrl:'',
+					shenfenzhengUrl: '',
 					minzu: {},
 					shuxiang: {
 
@@ -202,27 +202,35 @@
 			}
 		},
 		created() {
-
+			uni.showLoading({
+				title: '加载中'
+			});
 			this.initRequests()
-
-
-
 		},
 		methods: {
 
 			async initRequests() {
-				await Promise.all([
-					this.getXueli(),
-					this.getHunyin(),
-					this.getMinzu(),
-					this.getXingzuo(),
-					this.getShuxiang(),
-					this.getJiguan(),
-				]);
-				if (this.status == 'edit') {
-					this.$emit('finishDom','gerenZiliao');
+				try {
+					await Promise.all([
+						this.getXueli(),
+						this.getHunyin(),
+						this.getMinzu(),
+						this.getXingzuo(),
+						this.getShuxiang(),
+						this.getJiguan(),
+					]);
+					uni.hideLoading();
+					if (this.status == 'edit') {
+						this.$emit('finishDom', 'gerenZiliao');
+					}
+				} catch (e) {
+					uni.hideLoading();
+					uni.showToast({
+						title: `请求失败!`,
+						icon: 'none',
+						duration: 2000
+					})
 				}
-
 			},
 			editinfo(data) {
 				this.$nextTick(() => {
@@ -236,10 +244,10 @@
 					this.formData.jiguanShiName = data.jiguanShiName
 					this.formData.juzhuDizhi = data.juzhuDizhi
 					this.formData.birthday = data.birthday
-					this.formData.minzu = this.dataForId(this.minzuList, data.minzu)||''
+					this.formData.minzu = this.dataForId(this.minzuList, data.minzu) || ''
 					this.formData.gender = data.gender
-					this.formData.xueli = this.dataForId(this.xueliList, data.xueli)||''
-					this.formData.hunyin = this.dataForId(this.hunyinList, data.hunyin)||''
+					this.formData.xueli = this.dataForId(this.xueliList, data.xueli) || ''
+					this.formData.hunyin = this.dataForId(this.hunyinList, data.hunyin) || ''
 					this.formData.hujiDizhi = data.hujiDizhi
 					this.formData.juzhuDizhi = data.juzhuDizhi
 					this.formData.xingzuo = this.dataForId(this.xingzuoList, data.xingzuo) || ''
@@ -481,14 +489,16 @@
 			getFileUrl(data) {
 				this.formData.shenfenzhengUrl = data
 				console.log('data', data);
-				jiazhengIdcard({url:this.formData.shenfenzhengUrl}).then(res=>{
-					console.log('res',res);
-					if(res.code ==0){	
-						
-					
-						
-						
-						
+				jiazhengIdcard({
+					url: this.formData.shenfenzhengUrl
+				}).then(res => {
+					console.log('res', res);
+					if (res.code == 0) {
+
+
+
+
+
 						this.formData.realName = res.data.name
 						this.formData.gender = res.data.genderId
 						this.formData.minzu.name = res.data.ethnicity
@@ -543,7 +553,7 @@
 				this.formData.gender = data
 			},
 			selectChangeHunyinList(data) {
-					console.log('data',data[0]);
+				console.log('data', data[0]);
 				this.formData.hunyin = data[0]
 			},
 			switchXingzuoChange(e) {