From 174350e855349919ee287a52d3198c7c7558b858 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 02 四月 2024 14:21:22 +0800
Subject: [PATCH] mrshi

---
 wx/pages/factoryChange/factoryChange.vue |   54 ++++++++++++++++++++++++++++++------------------------
 1 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/wx/pages/factoryChange/factoryChange.vue b/wx/pages/factoryChange/factoryChange.vue
index d150831..6b12f24 100644
--- a/wx/pages/factoryChange/factoryChange.vue
+++ b/wx/pages/factoryChange/factoryChange.vue
@@ -73,10 +73,10 @@
 					cyclePrice: ''
 				},
 				rules: {
-					'programmeName': {
+					'code': {
 						type: 'string',
 						required: true,
-						message: '璇烽�夋嫨淇濋櫓鏂规',
+						message: '璇烽�夋嫨淇濆崟鍙�',
 						trigger: ['blur', 'change']
 					},
 					'startDate': {
@@ -105,42 +105,48 @@
 					}
 				})
 			},
-			confirm(e) {
-				this.model.id = e.value[0].solutionId
-				this.model.code = e.value[0].code
-				this.id = e.value[0].id
-				if ([1,3].includes(this.compareDates(this.getDate(), e.value[0].startTime)) && !e.value[0].lastChangeDate) {
-					// 褰撳墠鏃ユ湡澶т簬绛変簬鐢熸晥鏃ユ湡骞朵笖鏈�鍚庝竴娆℃搷浣滄椂闂寸瓑浜庣┖
-					this.minDate = new Date(this.getTomorrow()).getTime()
-					this.maxDate = new Date(e.value[0].endTime).getTime()
-				} else if (this.compareDates(this.getDate(), e.value[0].startTime) === 2 && !e.value[0].lastChangeDate) {
-					// 褰撳墠鏃ユ湡灏忎簬鐢熸晥鏃ユ湡骞朵笖鏈�鍚庝竴娆℃搷浣滄椂闂寸瓑浜庣┖
-					this.minDate = new Date(e.value[0].startTime).getTime()
-					this.maxDate = new Date(e.value[0].endTime).getTime()
-				} else if (e.value[0].lastChangeDate) {
-					// 鏈�鍚庝竴娆℃搷浣滄椂闂存湁鍊�
-					if ([1,3].includes(this.compareDates(this.getDate(), e.value[0].lastChangeDate))) {
-						// 褰撳墠鏃ユ湡澶т簬鏈�鍚庝竴娆℃搷浣滄椂闂�
+			async confirm(e) {
+				// 鑾峰彇鏈�鏂版柟妗坕d
+				let res = await this.$u.api.insuranceApplyById(e.value[0].id)
+				if (res.code === 200) {
+					this.model.id = res.data.newVersionSolutionId
+					this.model.code = e.value[0].code
+					this.id = e.value[0].id
+					if ([1,3].includes(this.compareDates(this.getDate(), e.value[0].startTime)) && !e.value[0].lastChangeDate) {
+						// 褰撳墠鏃ユ湡澶т簬绛変簬鐢熸晥鏃ユ湡骞朵笖鏈�鍚庝竴娆℃搷浣滄椂闂寸瓑浜庣┖
 						this.minDate = new Date(this.getTomorrow()).getTime()
 						this.maxDate = new Date(e.value[0].endTime).getTime()
-					} else if (this.compareDates(this.getDate(), e.value[0].lastChangeDate) === 2) {
-						// 褰撳墠鏃堕棿灏忎簬鏈�鍚庝竴娆℃搷浣滄椂闂�
-						this.minDate = new Date(e.value[0].lastChangeDate).getTime()
+					} else if (this.compareDates(this.getDate(), e.value[0].startTime) === 2 && !e.value[0].lastChangeDate) {
+						// 褰撳墠鏃ユ湡灏忎簬鐢熸晥鏃ユ湡骞朵笖鏈�鍚庝竴娆℃搷浣滄椂闂寸瓑浜庣┖
+						this.minDate = new Date(e.value[0].startTime).getTime()
 						this.maxDate = new Date(e.value[0].endTime).getTime()
+					} else if (e.value[0].lastChangeDate) {
+						// 鏈�鍚庝竴娆℃搷浣滄椂闂存湁鍊�
+						if ([1,3].includes(this.compareDates(this.getDate(), e.value[0].lastChangeDate))) {
+							// 褰撳墠鏃ユ湡澶т簬鏈�鍚庝竴娆℃搷浣滄椂闂�
+							this.minDate = new Date(this.getTomorrow()).getTime()
+							this.maxDate = new Date(e.value[0].endTime).getTime()
+						} else if (this.compareDates(this.getDate(), e.value[0].lastChangeDate) === 2) {
+							// 褰撳墠鏃堕棿灏忎簬鏈�鍚庝竴娆℃搷浣滄椂闂�
+							this.minDate = new Date(e.value[0].lastChangeDate).getTime()
+							this.maxDate = new Date(e.value[0].endTime).getTime()
+						}
 					}
+					this.show = false
 				}
-				this.show = false
 			},
 			// 閫夋嫨鏃堕棿
 			confirm1(e) {
 				this.model.startDate = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') + ' 00:00:00'
 				this.$u.api.getChangeCountCyclePriceVO({
-					applyId: this.model.id,
+					applyId: this.id,
 					validTime: this.model.startDate
 				}).then(res => {
 					if (res.code === 200) {
 						this.model.cyclePrice = res.data.cyclePrice
 						this.show1 = false
+					} else {
+						this.model.startDate = ''
 					}
 				})
 			},
@@ -174,7 +180,7 @@
 			submit() {
 				this.$refs.uForm.validate().then(res => {
 					uni.navigateTo({
-						url: `/pages/addition_subtraction/addition_subtraction?id=${this.model.id}&codeId=${this.id}&cyclePrice=${this.model.cyclePrice}&startDate=${this.model.startDate}&code=${this.model.code}`
+						url: `/pages/factory_change_insurance/factory_change_insurance?id=${this.model.id}&codeId=${this.id}&cyclePrice=${this.model.cyclePrice}&startDate=${this.model.startDate}&code=${this.model.code}`
 					})
 				}).catch(errors => {
 					

--
Gitblit v1.9.3