From 3913b3c5c8cde03f8c92d1c738d28c4a9bae7e55 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期三, 22 十一月 2023 08:48:02 +0800
Subject: [PATCH] #

---
 pages/business/goBusiness/modiReimburseOnlineDetl.vue |   70 ++++++++++++++++++++++++++---------
 1 files changed, 52 insertions(+), 18 deletions(-)

diff --git a/pages/business/goBusiness/modiReimburseOnlineDetl.vue b/pages/business/goBusiness/modiReimburseOnlineDetl.vue
index 546379b..253f7e8 100644
--- a/pages/business/goBusiness/modiReimburseOnlineDetl.vue
+++ b/pages/business/goBusiness/modiReimburseOnlineDetl.vue
@@ -87,8 +87,8 @@
 			
 		</view>
 		
-		<u-picker :show="reimburseId" :columns="reimburseIds" @confirm="reimburseIdConfirm"></u-picker>
-		<u-picker :show="checkData" :columns="checkDatas" @confirm="checkDataConfirm"></u-picker>
+		<u-picker :show="reimburseId" :columns="reimburseIds" @confirm="reimburseIdConfirm" @cancel="cancel"></u-picker>
+		<u-picker :show="checkData" :columns="checkDatas" @confirm="checkDataConfirm" @cancel="cancel"></u-picker>
 		
 		<view>
 			<!-- 鏅�氬脊绐� -->
@@ -204,20 +204,34 @@
 						updateTime: '',
 						updateUserName: ''
 					},
+				type: 'modi'
 			}
 		},
 		onLoad(option) {
 			let _this = this
+			this.getOrderId('')
 			_this.list = []
 			const eventChannel = this.getOpenerEventChannel();
 			eventChannel.on('reimburseOnlineDetl', function(data) {
 				if (data.data == 'add') {
 					_this.title = '娣诲姞鎶ラ攢瀹℃壒'
+					_this.type = 'add'
 				}
-				console.log(data)
-				console.log(_this.title)
+				if (data.data == 'modi') {
+					// _this.title = '娣诲姞鎶ラ攢瀹℃壒'
+					_this.form[1].value = data.detl.list.templateName
+					for (let k in _this.reimburseIds[0]) {
+						if (_this.reimburseIds[0][k] == data.detl.list.templateName) {
+							_this.form[1].submitVal = k
+						}
+					}
+					_this.form[2].value = data.detl.list.checkData
+					_this.form[0].value = data.detl.list.name$
+					_this.getOrderId(data.detl.list.name$)
+					_this.tableData = data.detl.list.detl
+				}
 			})
-			this.getOrderId('')
+			
 		},
 		methods: {
 			addDetl(type) {
@@ -228,7 +242,6 @@
 			popChange(n) {
 				// var detl=JSON.parse(JSON.stringify(this.newDetl));  // 鐗涢��
 				let detl  = {...this.newDetl} // 鐗涢��
-				console.log(this.radiovalue2);
 				detl.expenseType$ = this.radiovalue2
 				for (let k in this.radiolist2) {
 					if (this.radiolist2[k].name == this.radiovalue2) {
@@ -239,7 +252,6 @@
 				this.$refs.popup.close()
 			},
 			radioChange(n) {
-				console.log('radioChange', n);
 			},
 			showPicker(e) {
 				switch(e) {
@@ -282,18 +294,14 @@
 				this.tableData.splice(index,1)
 			},
 			reimburseIdConfirm(e) {
-				console.log('confirm', e)
 				this.form[1].value = e.value[0]
 				this.form[1].submitVal = e.indexs[0]
 				this.reimburseId = false
-				console.log(this.form);
 			},
 			checkDataConfirm(e) {
-				console.log('confirm', e)
 				this.form[2].value = e.value[0]
 				this.form[2].submitVal = e.indexs[0]
 				this.checkData = false
-				console.log(this.form);
 			},
 			// 琛ㄥ崟鎻愪氦
 			submit() {
@@ -320,8 +328,6 @@
 						param.checkData = k.value
 					}
 				}
-				console.log(this.form);
-				console.log(param);
 				param.reimburseOnlineDetls = this.tableData
 				if (param.reimburseId == null || param.reimburseId === '') {
 					uni.showToast({title: '鎶ラ攢绫诲瀷涓嶈兘涓虹┖', icon: "none", position: 'top'})
@@ -335,10 +341,12 @@
 					uni.showToast({title: '璇锋坊鍔犳姤閿�鏄庣粏', icon: "none", position: 'top'})
 					return
 				}
-				// console.log(this.orderIdList);
-				// console.log(this.orderIds);
-				console.log(param);
-				this.formAdd(param)
+				if (this.type == 'add') {
+					this.formAdd(param)
+				} else {
+					this.formModi(param)
+				}
+				
 			},
 			formAdd(param) {
 				let _this = this
@@ -349,10 +357,36 @@
 					method: 'POST',
 					success(res) {
 						res = res.data
-						console.log(res);
+						if (res.code === 200) {
+							uni.navigateBack({})
+						} else if(res.code === 500) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+						}
 					}
 				})
 			},
+			formModi(param) {
+				let _this = this
+				uni.request({
+					url: `${_this.baseUrl}/reimburseOnline/from/modify/auth`,
+					header: { 'token': uni.getStorageSync('token') },
+					data: JSON.stringify(param),
+					method: 'POST',
+					success(res) {
+						res = res.data
+						if (res.code === 200) {
+							uni.navigateBack({})
+						} else if(res.code === 500) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+						}
+						
+					}
+				})
+			},
+			cancel() {
+				this.reimburseId = false
+				this.checkData = false
+			},
 			back() {
 				uni.navigateBack({})
 			},

--
Gitblit v1.9.1