htc 3 месяцев назад
Родитель
Сommit
9d8a7dadf7
2 измененных файлов с 15 добавлено и 51 удалено
  1. 9 13
      pagesHouse/Mine/Businesses/Businesses.vue
  2. 6 38
      pagesHouse/Mine/Businesses/Catering.vue

+ 9 - 13
pagesHouse/Mine/Businesses/Businesses.vue

@@ -238,12 +238,8 @@
 		methods: {
 			// 获取数据 
 			getList() {
-				// this.$api.get('/merchant/merchantFisherman/home?id=' + this.homestayId).then(res => {
-				// 	console.log(res.data);
-				// })
 				let id = this.fishermanId
 				this.$api.get(`/api/merchant/food/merchant/${id}`).then(res => {
-					console.log(res.data);
 					this.list = res.data.data
 					this.getDict()
 				})
@@ -251,13 +247,8 @@
 			// 获取企业类型字典
 			getDict() {
 				this.$api.get('/sys/dict/type/all').then(res => {
-					console.log(res.data)
-					//this.$store.state.Dict = Object.assign(res.data);
-					// this.dictValue
 					this.typeList = res.data.data.find((p) => p.dictType == 'CompanyType').dataList;
-					console.log(this.typeList);
 					this.companyType = this.typeList.find((p) => p.dictValue == this.list.companyType).dictLabel
-					console.log(this.companyType);
 				})
 			},
 			// 立即保存
@@ -278,15 +269,20 @@
 				this.dto.linkName = this.list.linkName
 				this.dto.phone = this.list.phone
 				this.dto.areaDetail = this.list.areaDetail
-				this.dto.id = uni.getStorageSync('merchantId')
-				this.$api.put('/api/merchant/food/updateMerchantInfo', this.dto).then(res => {
-					console.log('0000', res.data);
+				this.dto.id = uni.getStorageSync('merchantId');
+				
+				let newDataForm = JSON.parse(JSON.stringify(this.dto));
+				newDataForm.idCard = this.$aesTm.encrypt(newDataForm.idCard);
+				newDataForm.legalPerson = this.$aesTm.encrypt(newDataForm.legalPerson);
+				newDataForm.linkName = this.$aesTm.encrypt(newDataForm.linkName);
+				newDataForm.phone = this.$aesTm.encrypt(newDataForm.phone);
+				
+				this.$api.put('/api/merchant/food/updateMerchantInfo', newDataForm).then(res => {
 					if (res.data.code == 0) {
 						this.$showToast('保存成功');
 						setTimeout(() => {
 							this.getList()
 						}, 1000)
-
 					}
 				})
 			},

+ 6 - 38
pagesHouse/Mine/Businesses/Catering.vue

@@ -255,13 +255,8 @@
 			// 获取企业类型字典
 			getDict() {
 				this.$api.get('/sys/dict/type/all').then(res => {
-					console.log(res.data)
-					//this.$store.state.Dict = Object.assign(res.data);
-					// this.dictValue
 					this.typeList = res.data.data.find((p) => p.dictType == 'CompanyType').dataList;
-					console.log(this.typeList);
 					this.companyType = this.typeList.find((p) => p.dictValue == this.list.companyType).dictLabel
-					console.log(this.companyType);
 				})
 			},
 			// 立即保存
@@ -281,42 +276,15 @@
 				this.dto.linkName = this.list.linkName
 				this.dto.phone = this.list.phone
 				this.dto.areaDetail = this.list.areaDetail
-				this.dto.id = uni.getStorageSync('merchantId')
+				this.dto.id = uni.getStorageSync('merchantId')
 				//加密
 				let newDataForm = JSON.parse(JSON.stringify(this.dto));
-				if (
-					newDataForm.legalPerson &&
-					this.tempLegalPerson != newDataForm.legalPerson
-				) {
-					//编辑了
-					newDataForm.legalPerson = encrypt(
-						newDataForm.legalPerson
-					);
-				} else {
-					newDataForm.legalPerson = null;
-				}
-				if (
-					newDataForm.idCard &&
-					this.tempIdCard != newDataForm.idCard
-				) {
-					newDataForm.idCard = encrypt(
-						newDataForm.idCard
-					);
-				} else {
-					newDataForm.idCard = null;
-				}
-				if (
-					newDataForm.linkName &&
-					this.tempLinkName != newDataForm.linkName
-				) {
-					newDataForm.linkName = encrypt(
-						newDataForm.linkName
-					);
-				} else {
-					newDataForm.linkName = null;
-				}
+				newDataForm.idCard = this.$aesTm.encrypt(newDataForm.idCard);
+				newDataForm.legalPerson = this.$aesTm.encrypt(newDataForm.legalPerson);
+				newDataForm.linkName = this.$aesTm.encrypt(newDataForm.linkName);
+				newDataForm.phone = this.$aesTm.encrypt(newDataForm.phone);
+				
 				this.$api.put('/api/merchant/food/updateMerchantInfo', newDataForm).then(res => {
-					console.log('0000', res.data);
 					if (res.data.code == 0) {
 						this.$showToast('保存成功');
 						setTimeout(() => {