From c478bc1b36e38774cf01c02fd5e23858bd70a4a3 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期三, 29 十一月 2023 13:42:46 +0800
Subject: [PATCH] #

---
 pages/business/goBusiness/goBusinessDetil.vue |  111 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 107 insertions(+), 4 deletions(-)

diff --git a/pages/business/goBusiness/goBusinessDetil.vue b/pages/business/goBusiness/goBusinessDetil.vue
index 167dfb8..df6eb00 100644
--- a/pages/business/goBusiness/goBusinessDetil.vue
+++ b/pages/business/goBusiness/goBusinessDetil.vue
@@ -14,6 +14,12 @@
 				</view>
 			</view>
 		</view>
+		
+		<view class="floor">
+			<view class="wran">鍒犻櫎</view>
+			<view class="default" v-show="settle == 1" @click="edit()">淇敼</view>
+			<view class="primary" @click="submit()">{{subTitle}}</view>
+		</view>
 	</view>
 </template>
 
@@ -21,6 +27,8 @@
 	export default {
 		data() {
 			return {
+				settle: 1,
+				subTitle: '鐢宠鎶ラ攢',
 				list: [{
 					businessTripReasons: '娌熼�氱珛搴撲簨瀹�',
 					businessTransportation$: '浜ら�氬伐鍏�',
@@ -64,16 +72,16 @@
 					},
 					{
 						label: "缁撴潫鏃ユ湡",
-						attribute: "businessStartTimeDay$",
+						attribute: "businessEndTimeDay$",
 					},
 					
 					{
 						label: "鍑哄樊鏃堕暱",
-						attribute: "businessStartTimeDay$",
+						attribute: "businessDuration$",
 					},
 					{
 						label: "鍑哄樊澶╂暟",
-						attribute: "businessEndTimeDay$",
+						attribute: "businessTripDays$",
 					},
 					{
 						label: "鍚岃浜�",
@@ -104,13 +112,75 @@
 		},
 		onLoad(option) {
 			let _this = this
+			_this.list = []
 			const eventChannel = this.getOpenerEventChannel();
 			eventChannel.on('busunessDetl', function(data) {
 				_this.list.push(data.data)
-				console.log(data)
+				_this.settle = data.data.settle
+				if (data.data.settle == 1) {
+					_this.subTitle = '瀹℃壒'
+				}
 			})
 		},
 		methods: {
+			submit() {
+				if (this.settle == 1) {
+					this.approval()
+				} else {
+					this.reimburse()
+				}
+			},
+			// 瀹℃壒
+			approval() {
+				let _this = this
+				uni.request({
+					url: `${_this.baseUrl}/businessTrip/approval/auth`,
+					header: { 
+						'token': uni.getStorageSync('token'),
+						'content-type': 'application/x-www-form-urlencoded;charset=UTF-8'
+					},
+					method: 'POST',
+					sslVerify: false,
+					data: {planId: _this.list[0].id},
+					success(res) {
+						res = res.data
+						// console.log(res);
+						if (res.code === 200) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							setTimeout(()=>{
+								uni.navigateBack({})
+							},1000)
+						} else if (res.code === 500) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+						}
+					}
+				})
+			},
+			// 鐢宠鎶ラ攢
+			reimburse() {
+				let _this = this
+				uni.navigateTo({
+					url: '/pages/business/goBusiness/modiReimburseOnlineDetl',
+					success: function(res) {
+						res.eventChannel.emit('reimburseOnlineDetl', {
+							data: 'add2',
+							detl: _this.list[0]
+						})
+					}
+				})
+			},
+			edit() {
+				let _this = this
+				uni.navigateTo({
+					url: '/pages/business/goBusiness/addgoBusiness',
+					success: function(res) {
+						res.eventChannel.emit('modiGoBusinessDetl', {
+							data: 'modi',
+							detl: _this.list[0]
+						})
+					}
+				})
+			},
 			back() {
 				uni.navigateBack({})
 			},
@@ -141,4 +211,37 @@
 	.box-single-row {
 		display: flex;
 	}
+	
+	.floor {
+		height: 100rpx;
+		line-height: 100rpx;
+		width: 100%;
+		background-color: #fff;
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		display: flex;
+		align-items: center;
+		text-align: center;
+		letter-spacing: 10rpx;
+	}
+	.default {
+		flex: 2;
+	}
+	.default:active {
+		background-color: #eff0f1;
+	}
+	.wran {
+		flex: 1;
+		background-color: #ff5722;
+		color: #fff;
+	}
+	.primary {
+		flex: 2;
+		background-color: #2d8cf0;
+		color: #fff;
+	}
+	.primary:active {
+		background-color: #007dea;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1