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/goBusiness.vue |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/pages/business/goBusiness/goBusiness.vue b/pages/business/goBusiness/goBusiness.vue
index fb0f68f..5e4aa80 100644
--- a/pages/business/goBusiness/goBusiness.vue
+++ b/pages/business/goBusiness/goBusiness.vue
@@ -14,6 +14,11 @@
 				</view>
 			</block>
 		</uni-nav-bar>
+		
+		<!-- 鎼滅储妗� -->
+		<view class="search-bg">
+			<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)">
@@ -29,6 +34,11 @@
 				</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 style="height: 120rpx;"></view>
@@ -36,14 +46,17 @@
 </template>
 
 <script>
+	import user from '@/pages/api/user/user.js'
 	export default {
 		data() {
 			return {
+				keyword: '',
 				user: {
-					username: '鏉ㄦ垚寮�',
+					username: '',
 					id: 0,
 					type: ''
 				},
+				falg: true,
 				list: [{
 						businessTripReasons: '娌熼�氱珛搴撲簨瀹�',
 						businessTransportation$: '浜ら�氬伐鍏�',
@@ -68,11 +81,31 @@
 			}
 		},
 		onShow() {
-			this.getBusinessTrip()
+			let that = this
+			uni.$on('isRefresh',function(data){
+				that.user.username = data.title
+				that.user.id = data.id
+				that.user.type = data.key
+				that.falg = false
+			})
+			setTimeout(()=> {
+				this.getBusinessTrip()
+			},50)
+			if (this.falg) {
+				this.getDetail()
+			}
 		},
 		methods: {
+			async getDetail() {
+				let res = await user.getDetail()
+				if (res.code === 200) {
+					this.user.username = res.data.username
+					this.user.id = res.data.id
+				} else if (res.code === 403) {
+					this.backLogin(res)
+				}
+			},
 			goDetl(e) {
-				console.log(e);
 				uni.navigateTo({
 					url: '/pages/business/goBusiness/goBusinessDetil',
 					success: function(res) {
@@ -84,11 +117,20 @@
 			},
 			getBusinessTrip() {
 				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}/businessTrip/list/auth`,
 					header: {
 						'token': uni.getStorageSync('token')
 					},
+					data: param,
 					success(res) {
 						res = res.data
 						if (res.code === 200) {
@@ -105,6 +147,17 @@
 					}
 				})
 			},
+			// 鍑哄樊鐢宠
+			add() {
+				uni.navigateTo({
+					url: '/pages/business/goBusiness/addgoBusiness',
+					success: function(res) {
+						res.eventChannel.emit('goBusinessDel', {
+							data: 'add'
+						})
+					}
+				})
+			},
 			back() {
 				uni.navigateBack({})
 			},

--
Gitblit v1.9.1