From e6a02c8b09a796e436a501e9b87d19e25c34c9d1 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期日, 07 四月 2024 15:53:37 +0800
Subject: [PATCH] #

---
 pages/business/goBusiness/businessTripOther.vue |  238 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 233 insertions(+), 5 deletions(-)

diff --git a/pages/business/goBusiness/businessTripOther.vue b/pages/business/goBusiness/businessTripOther.vue
index 6408114..0606f5b 100644
--- a/pages/business/goBusiness/businessTripOther.vue
+++ b/pages/business/goBusiness/businessTripOther.vue
@@ -20,7 +20,26 @@
 			<u-search placeholder="杈撳叆" v-model="keyword" :clearabled="true" @custom="search()" @search="search()"></u-search>
 		</view>
 		
+		<view class="main-box">
+			<view class="box" v-for="item in list" @click="goDetl(item)">
+				<view style="display: flex;">
+					<view class="box-title" style="flex: 1;">{{item.userId$}}鎻愪氦鐨勫嚭宸敵璇�</view>
+					<view class="box-time">{{item.createTime$.substring(0,10)}}</view>
+				</view>
+				<view class="box-item">鍑哄樊浜嬬敱:{{item.businessTripReasons}}</view>
+				<view class="box-item">璺熻釜椤圭洰:{{item.orderId$}}</view>
+				<view style="display: flex;">
+					<view class="box-item" style="flex: 1;">鐘舵��:{{item.status$}}</view>
+					<view class="box-settle" :style="item.bgcolor">{{item.settle$}}</view>
+				</view>
+			</view>
+		</view>
+		
 		<u-empty v-if="true" icon="../../../static/image/emptyList.png" v-show="list.length <= 0" />
+		
+		<view class="fxbtn">
+			<uni-icons type="plusempty" color="#fff" @click="add()" ></uni-icons>
+		</view>
 		 
 	</view>
 </template>
@@ -37,7 +56,10 @@
 					type: ''
 				},
 				falg: true,
-				list:[]
+				list:[],
+				curr: 2,
+				reload: false,
+				status: 'more',
 			}
 		},
 		onShow() {
@@ -48,14 +70,114 @@
 				that.user.type = data.key
 				that.falg = false
 			})
-			setTimeout(()=> {
-				// this.getCsmtr1()
-			},50)
 			if (this.falg) {
 				this.getDetail()
 			}
+			setTimeout(()=> {
+				this.getBusinessTripOther1()
+			},50)
+		},
+		onReachBottom() {
+			this.status = 'more';
+			this.getBusinessTripOther()
 		},
 		methods: {
+			getBusinessTripOther1() {
+				let _this = this
+				_this.list = []
+				uni.showLoading({})
+				let param = {curr:1,limit:8,dept_id: 0,user_id: 67}
+				if (_this.user.type == 'user_id') {
+					param = {curr:1,limit:8,user_id: _this.user.id}
+				} else if(_this.user.type == 'dept_id') {
+					param = {curr:1,limit:8,dept_id: _this.user.id}
+				} else {
+					param = {curr:1,limit:8}
+				}
+				uni.request({
+					url: `${_this.baseUrl}/businessTripOther/list/auth`,
+					header: {
+						'token': uni.getStorageSync('token')
+					},
+					data: param,
+					success(res) {
+						res = res.data
+						if (res.code === 200) {
+							for (let k of res.data.records) {
+								if (k.settle == 2) {
+									k['bgcolor'] = 'color: #12d489'
+								} else if (k.settle == 1) {
+									k['bgcolor'] = 'color: #ffbd67'
+								}
+							}
+							let list = res.data.records
+							_this.list = _this.reload ? list : _this.list.concat(list);
+							if (res.data.records.length == 0) {
+								_this.status = 'noMore'
+							}
+						}
+					},
+					fail(result) {
+						uni.showToast({title: '璇锋眰澶辫触'})
+						setTimeout(() => {
+							uni.reLaunch({
+								url: '../../login/login'
+							});
+						}, 1000);
+					},
+					complete() {
+						uni.hideLoading()
+					}
+				})
+			},
+			getBusinessTripOther1() {
+				let _this = this
+				uni.showLoading({})
+				let param = {curr:_this.curr,limit:8,dept_id: 0,user_id: 67}
+				if (this.user.type == 'user_id') {
+					param = {curr:_this.curr,limit:8,user_id: _this.user.id}
+				} else if(this.user.type == 'dept_id') {
+					param = {curr:_this.curr,limit:8,dept_id: _this.user.id}
+				} else {
+					param = {curr:_this.curr,limit:8}
+				}
+				uni.request({
+					url: `${_this.baseUrl}/businessTripOther/list/auth`,
+					header: {
+						'token': uni.getStorageSync('token')
+					},
+					data: param,
+					success(res) {
+						res = res.data
+						if (res.code === 200) {
+							for (let k of res.data.records) {
+								if (k.settle == 2) {
+									k['bgcolor'] = 'color: #12d489'
+								} else if (k.settle == 1) {
+									k['bgcolor'] = 'color: #ffbd67'
+								}
+							}
+							let list = res.data.records
+							_this.list = _this.reload ? list : _this.list.concat(list);
+							_this.curr = _this.curr + 1
+							if (res.data.records.length == 0) {
+								_this.status = 'noMore'
+							}
+						}
+					},
+					fail(result) {
+						uni.showToast({title: '璇锋眰澶辫触'})
+						setTimeout(() => {
+							uni.reLaunch({
+								url: '../../login/login'
+							});
+						}, 1000);
+					},
+					complete() {
+						uni.hideLoading()
+					}
+				})
+			},
 			async getDetail() {
 				let res = await user.getDetail()
 				if (res.code === 200) {
@@ -73,6 +195,59 @@
 					});
 				}, 1000);
 			},
+			getBusinessTripOther() {
+				let _this = this
+				let param = {curr:1,limit:16,dept_id: 0,user_id: 67}
+				if (_this.user.type == 'user_id') {
+					param = {curr:1,limit:16,user_id: _this.user.id}
+				} else if(_this.user.type == 'dept_id') {
+					param = {curr:1,limit:16,dept_id: _this.user.id}
+				} else {
+					param = {curr:1,limit:16}
+				}
+				uni.request({
+					url: `${_this.baseUrl}/businessTripOther/list/auth`,
+					header: {
+						'token': uni.getStorageSync('token')
+					},
+					data: param,
+					success(res) {
+						res = res.data
+						if (res.code === 200) {
+							for (let k of res.data.records) {
+								if (k.settle == 2) {
+									k['bgcolor'] = 'color: #12d489'
+								} else if (k.settle == 1) {
+									k['bgcolor'] = 'color: #ffbd67'
+								}
+							}
+							_this.list = res.data.records
+						}
+						// _this.list = 
+					}
+				})
+			},
+			goDetl(e) {
+				uni.navigateTo({
+					url: '/pages/business/goBusiness/businessTripOtherDetl',
+					success: function(res) {
+						res.eventChannel.emit('businessTripOtherDetl', {
+							data: e
+						})
+					}
+				})
+			},
+			// 鍑哄樊鐢宠
+			add() {
+				uni.navigateTo({
+					url: '/pages/business/goBusiness/addBusinessTripOther',
+					success: function(res) {
+						res.eventChannel.emit('businessTripOtherDetl', {
+							data: 'add'
+						})
+					}
+				})
+			},
 			back() {
 				uni.navigateBack({
 				})
@@ -87,5 +262,58 @@
 </script>
 
 <style>
-
+	.flex-row {
+		display: flex;
+	}
+	
+	.flex-col {
+		display: flex;
+		flex-direction: column;
+	}
+	
+	.main-box {
+		/* margin: 16rpx; */
+		/* background-color: #FFF; */
+		border-radius: 20rpx;
+		padding: 8rpx;
+	}
+	
+	.box {
+		margin: 16rpx 8rpx;
+		/* height: 200px; */
+		box-shadow: 0 0 5px #dddddd;
+		background-color: #FFF;
+		padding: 16rpx 32rpx;
+		position: relative;
+		border-radius: 20rpx;
+		font-size: 24rpx;
+		color: #bdbdbd;
+	}
+	
+	.box-flag {
+		position: absolute;
+		right: 0;
+		top: 10rpx;
+		background-color: #74B9E9;
+		padding: 6rpx;
+		font-size: 10rpx;
+		color: #FFF;
+	}
+	
+	.box-time {
+		color: #bdbdbd;
+	}
+	
+	.box-settle {
+		font-size: 26rpx;
+		/* font-weight: bold; */
+	}
+	
+	.box-title {
+		font-size: 28rpx;
+		font-weight: bold;
+		color: #000;
+	}
+	
+	.box-single-row {}
 </style>

--
Gitblit v1.9.1