From ccf28d1fed1aa2e5437dbe64b5133ba1cbde6ec7 Mon Sep 17 00:00:00 2001
From: renkang <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 03 一月 2025 15:30:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 h5/pages/workOrder/list.vue |  351 ++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 218 insertions(+), 133 deletions(-)

diff --git a/h5/pages/workOrder/list.vue b/h5/pages/workOrder/list.vue
index 0ea131f..7d8e1d2 100644
--- a/h5/pages/workOrder/list.vue
+++ b/h5/pages/workOrder/list.vue
@@ -1,125 +1,196 @@
 <template>
 	<view class="main_app">
-		<view class="head_wrap">
-			<view class="search_wrap">
-				<image class="mr12 search" src="@/static/home/ic_search@2x.png" mode="widthFix"></image>
-				<input v-model="param.keyword" @confirm="getList()" type="text" placeholder="鎼滅储妤煎畤/鎴块棿鍚嶇О" placeholder-class="placeholder9" />
-			</view>
-		</view>
-		<!--  -->
-		<view class="tabs">
-			<view class="tab" :class="{active: activeTab == 0}" @click="tabsClick(0)">
-				<text>寰呭鐞�</text>
-				<text class="border"></text>
-			</view>
-			<view class="tab" :class="{active: activeTab == 1}" @click="tabsClick(1)">
-				<text>宸插鐞�</text>
-				<text class="border"></text>
-			</view>
-			<view class="tab" @click="allClick">
-				<view class="name">
-					<image v-if="selectAll" class="icon" src="@/static/checked.png" mode=""></image>
-					<image v-else class="icon" src="@/static/check.png" mode=""></image>
-					<text>鏌ョ湅鍏ㄩ儴</text>
-				</view>
-				<text class="border"></text>
-			</view>
-		</view>
-		<!--  -->
-		<view class="list">
-			<view class="item" v-for="item in 10" @click="itemClick(item)">
-				<image v-if="item.stats == 1" src="@/static/side/workordered.png" class="icon"></image>
-				<image v-else src="@/static/side/workorder.png" class="icon"></image>
-				<view class="content">
-					<view class="name_wrap line">
-						<view class="name">A搴�/401</view>
-						<view class="status">宸插鐞�</view>
-					</view>
-					<view class="line">宸ュ崟绫诲瀷锛歺xx</view>
-					<view class="line">鎶ヤ慨鐗╁搧锛�121212</view>
-					<view class="line">涓婃姤鏃堕棿锛�121212</view>
-					<view class="line">涓婇棬鏃堕棿锛�121212</view>
+		<div class="main_head">
+			<view class="head_wrap">
+				<view class="search_wrap">
+					<image class="mr12 search" src="@/static/home/ic_search@2x.png" mode="widthFix"></image>
+					<input v-model="param.roomName" @confirm="handleQuery" type="text" placeholder="鎼滅储妤煎畤/鎴块棿鍚嶇О"
+						placeholder-class="placeholder9" />
 				</view>
 			</view>
-		</view>
+			<!--  -->
+			<view class="tabs">
+				<view class="tab" :class="{active: activeTab == '0,1'}" @click="tabsClick('0,1')">
+					<text>寰呭鐞�</text>
+					<text class="border"></text>
+				</view>
+				<view class="tab" :class="{active: activeTab == 2}" @click="tabsClick(2)">
+					<text>宸插鐞�</text>
+					<text class="border"></text>
+				</view>
+				<view class="tab" @click="allClick">
+					<view class="name">
+						<image v-if="selectAll" class="icon" src="@/static/checked.png" mode=""></image>
+						<image v-else class="icon" src="@/static/check.png" mode=""></image>
+						<text>鏌ョ湅鍏ㄩ儴</text>
+					</view>
+					<text class="border"></text>
+				</view>
+			</view>
+		</div>
+		<!--  -->
+		<scroll-view scroll-y="true" class="scroll_Y" @scrolltolower="scrolltolower">
+			<view class="list">
+				<view class="item" v-for="item in list" @click="itemClick(item)">
+					<image v-if="item.dealStatus == 0 || item.dealStatus == 1" src="@/static/side/workordered.png" class="icon"></image>
+					<image v-else src="@/static/side/workorder.png" class="icon"></image>
+					<view class="content">
+						<view class="name_wrap line">
+							<view class="name">{{item.buildingName}}/{{item.roomNum || item.floorName}}</view>
+							<view class="status gray" v-if="item.dealStatus == 2">宸插鐞�</view>
+							<view class="status" v-if="item.dealStatus == 0">寰呭鐞�</view>
+							<view class="status" v-if="item.dealStatus == 1">寰呭鐞�</view>
+						</view>
+						<view class="line">浣嶇疆绫诲瀷锛歿{item.areaType == '0' ? '瀹ゅ唴瑁呬慨' : '鍏叡鍖哄煙'}}</view>
+						<view class="line">宸ュ崟鍒嗙被锛歿{item.categoryName}}</view>
+						<view class="line">涓婃姤鏃堕棿锛歿{item.createDate}}</view>
+						<view class="line" v-if="item.getDate">涓婇棬鏃堕棿锛歿{item.getDate}}</view>
+					</view>
+				</view>
+				<view v-if="list.length == 0" class="empty_wrap">
+					<image src="@/static/empty.png" mode=""></image>
+					<view class="">鏆傛棤鏁版嵁</view>
+				</view>
+			</view>
+		</scroll-view>
 		<!--  -->
 	</view>
 </template>
 
 <script>
+	import {
+		ywWorkorder
+	} from '@/api'
 	export default {
 		data() {
 			return {
-				param: {},
-				activeTab: 0,
-				selectAll: false
+				param: {},
+				activeTab: '0,1',
+				selectAll: false,
+
+				list: [],
+				total: 0,
+				page: 1,
 			};
 		},
-		methods: {
-			tabsClick(val) {
-				this.activeTab = val
-			},
-			allClick() {
-				this.selectAll = !this.selectAll
-			},
-			itemClick() {
-				uni.navigateTo({
-					url: '/pages/workOrder/detail'
-				})
-			},
-			getList() {
-				console.log('---');
+		onLoad() {
+			this.getList()
+		},
+		methods: {
+			scrolltolower() {
+				const {
+					total,
+					list
+				} = this
+				if (list.length < total) {
+					this.page = this.page + 1
+					this.getList()
+				} else {
+					this.showToast('鏆傛棤鏇村鏁版嵁')
+				}
+			},
+			tabsClick(val) {
+				this.activeTab = val
+				this.list = []
+				this.page = 1
+				this.getList()
+			},
+			allClick() {
+				this.selectAll = !this.selectAll
+				this.list = []
+				this.page = 1
+				this.getList()
+			},
+			itemClick(item) {
+				uni.navigateTo({
+					url: `/pages/workOrder/detail?id=${item.id}`
+				})
+			},
+			handleQuery() {
+				this.list = []
+				this.page = 1
+				this.getList()
+			},
+			getList() {
+				const {
+					page,
+					total,
+					list,
+					activeTab,
+					param,
+					selectAll
+				} = this
+				ywWorkorder({
+					page,
+					capacity: 10,
+					model: {
+						...param,
+						queryStatus: activeTab,
+						dealUserId: selectAll ? '' : uni.getStorageSync('userInfo').id,
+					}
+				}).then(res => {
+					this.list = [...this.list, ...res.data.records]
+					this.total = res.data.total
+				})
 			}
 		}
 	}
 </script>
 
-<style lang="scss" scoped>
-	.main_app{
-		padding: 0 30rpx;
-	}
-	.tabs{
-		display: flex;
-		width: 750rpx;
-		margin: 12rpx -30rpx 0;
-		border-bottom: 1rpx solid #E5E5E5;
-		.tab{
-			font-size: 30rpx;
-			color: #666666;
-			flex: 1;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			justify-content: flex-end;
-			height: 88rpx;
-			.name{
-				display: flex;
-				align-items: center;
-			}
-			.icon{
-				width: 28rpx;
-				height: 28rpx;
-				margin-right: 10rpx;
-			}
-			.border{
-				width: 54rpx;
-				height: 6rpx;
-				background-color: #fff;
-				border-radius: 3rpx;
-				margin-top: 24rpx;
-			}
-		}
-		.active{
-			font-weight: 600;
-			font-size: 32rpx;
-			color: #222222;
-			.border{
-				background-color: $primaryColor;
-			}
-			
-		}
-		
+<style lang="scss" scoped>
+	.main_app {
+		padding: 30rpx;
 	}
+
+	.tabs {
+		display: flex;
+		width: 750rpx;
+		margin: 12rpx -30rpx 0;
+		border-bottom: 1rpx solid #E5E5E5;
+
+		.tab {
+			font-size: 30rpx;
+			color: #666666;
+			flex: 1;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			justify-content: flex-end;
+			height: 88rpx;
+
+			.name {
+				display: flex;
+				align-items: center;
+			}
+
+			.icon {
+				width: 28rpx;
+				height: 28rpx;
+				margin-right: 10rpx;
+			}
+
+			.border {
+				width: 54rpx;
+				height: 6rpx;
+				background-color: #fff;
+				border-radius: 3rpx;
+				margin-top: 24rpx;
+			}
+		}
+
+		.active {
+			font-weight: 600;
+			font-size: 32rpx;
+			color: #222222;
+
+			.border {
+				background-color: $primaryColor;
+			}
+
+		}
+
+	}
+
 	.head_wrap {
 		display: flex;
 		align-items: center;
@@ -132,9 +203,11 @@
 			background: #F7F7F7;
 			border-radius: 38rpx;
 			padding-left: 30rpx;
-			input{
-				flex: 1;
+
+			input {
+				flex: 1;
 			}
+
 			.search {
 				width: 28rpx;
 				height: 28rpx;
@@ -142,45 +215,57 @@
 		}
 
 	}
-
+	.scroll_Y{
+		height: calc(100vh - 250rpx);
+	}
 	.list {
 		.item {
 			display: flex;
-			// height: 290rpx;
-			padding: 30rpx 0;
+			// height: 290rpx;
+			padding: 30rpx 0;
 			border-bottom: 2rpx solid #E5E5E5;
+		
 			.icon {
 				width: 80rpx;
-				height: 80rpx;
+				height: 80rpx;
 				margin-right: 24rpx;
 			}
 
 			.content {
-				flex: 1;
-				color: #666666;
-				display: flex;
-				flex-direction: column;
-				justify-content: space-between;
-				.line{
-					margin-bottom: 20rpx;
-					&:nth-last-child(1){
-						margin-bottom: 0;
-					}
-				}
-				.name_wrap{
-					display: flex;
-					justify-content: space-between;
-					align-items: center;
-					.name{
-						display: flex;
-						align-items: flex-end;
-						font-weight: 600;
-						font-size: 34rpx;
-						color: #222222;
-					}
-					.status{
-						color: $primaryColor;
-					}
+				flex: 1;
+				color: #666666;
+				display: flex;
+				flex-direction: column;
+				justify-content: space-between;
+
+				.line {
+					margin-bottom: 20rpx;
+
+					&:nth-last-child(1) {
+						margin-bottom: 0;
+					}
+				}
+
+				.name_wrap {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+
+					.name {
+						display: flex;
+						align-items: flex-end;
+						font-weight: 600;
+						font-size: 34rpx;
+						color: #222222;
+					}
+
+					.status {
+						color: $primaryColor;
+					}
+
+					.gray {
+						color: #999999;
+					}
 				}
 			}
 		}

--
Gitblit v1.9.3