From faf1d3cc35a3a5f83558946c8056537a4d77fa1f Mon Sep 17 00:00:00 2001
From: liuleilei <234@qq.com>
Date: 星期一, 11 九月 2023 09:34:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 minipro_standard/pages/index/index.vue |  290 ++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 223 insertions(+), 67 deletions(-)

diff --git a/minipro_standard/pages/index/index.vue b/minipro_standard/pages/index/index.vue
index e6335a7..8da7917 100644
--- a/minipro_standard/pages/index/index.vue
+++ b/minipro_standard/pages/index/index.vue
@@ -9,22 +9,22 @@
 					:style="{paddingTop: `${statusbarHeight}px`, height: `${navHeight}px`, lineHeight:`${navHeight}px`, textAlign: 'center'}">
 					寰呭姙</view>
 				<view class="cY">
-					<u-search placeholder="鎼滅储鍏抽敭瀛�" bgColor="#f7f7f7" :showAction="false" @search="scrolltoupper"
-						shape="square" v-model="searchForm.name"></u-search>
+					<u-search placeholder="鎼滅储鍏抽敭瀛�" bgColor="#f7f7f7" :showAction="false" @search="search"
+						shape="square" v-model="searchForm.mixParam"></u-search>
 					<image src="../../static/filter@2x.png" class="img48 ml20" @click="filterAction" mode=""></image>
 				</view>
 				<view class="cY mt30">
-					<view class="sbtn rd8" :class="searchForm.status==0?'sbtn_green':'sbtn_black_rim'"
-						@click="selectType(0)">寰呭姙</view>
-					<view class="sbtn rd8 ml20" :class="searchForm.status==1?'sbtn_green':'sbtn_black_rim'"
-						@click="selectType(1)">宸插姙</view>
+					<view v-for="item in tagList" :key="item.id" class="sbtn rd8 mr10"
+						:class="searchForm.status==item.id?'sbtn_green':'sbtn_black_rim'" @click="selectType(item.id)">
+						{{`${item.name}(${item.num})`}}
+					</view>
 				</view>
 			</view>
 		</u-sticky>
-
-		<u-list :showScrollbar="false" @scrolltolower="scrolltolower" @scrolltoupper="scrolltoupper"
-			:height="windowHeight - (statusbarHeight + navHeight + 120) + 'px'">
-			<u-list-item v-for="(item, index) in projectList" :key="index">
+		<scroll-view v-if="projectList.length" scroll-y refresher-enabled="true" :refresher-triggered="triggered" @scrolltolower="loadMore"
+			@refresherrefresh="refresh"
+		>
+			<view v-for="(item, index) in projectList" :key="index">
 				<view class="box_list">
 					<view class="box_list_item" @click="jump(item)">
 						<view class="box_list_item_icon">
@@ -41,15 +41,24 @@
 						</view>
 					</view>
 				</view>
-			</u-list-item>
-		</u-list>
+			</view>
+		</scroll-view>
+		<view v-else class="tc c6">鏆傛棤鏁版嵁...</view>
 		<u-popup :show="show" @close="close" :round="8" zIndex="20000">
 			<view class="rp p40 contanir">
-				<view class="c2 b">绫诲瀷</view>
-				<view class="flex ap tc bottom-view">
-					<view class="fx1 ptb20 sbtn_gray c9">閲嶇疆</view>
-					<view class="fx1 ml20 ptb20 sbtn_green">纭畾</view>
-				</view>
+				<view class="c2 b">绫诲瀷</view>
+				<view class="content">
+					<u-grid col="2" :border="false">
+						<u-grid-item v-for="item in types" :key="item.id">
+							<view class="ptb20 c9 type-style tc rd10" :class="type===item.id?'sbtn_green':'sbtn_gray'"
+								@click="type=item.id">{{ item.name }}</view>
+						</u-grid-item>
+					</u-grid>
+				</view>
+				<view class="flex ap tc bottom-view">
+					<view class="fx1 ptb20 sbtn_gray c9" @click="resetType">閲嶇疆</view>
+					<view class="fx1 ml20 ptb20 sbtn_green" @click="confirm">纭畾</view>
+				</view>
 			</view>
 		</u-popup>
 		<myTabbar :index="0" />
@@ -58,6 +67,10 @@
 
 <script>
 	import myTabbar from "@/components/myTabber.vue"
+	import {
+		getList,
+		pageCount
+	} from '@/util/api/agencyAPI'
 	import {
 		mapState
 	} from 'vuex'
@@ -107,70 +120,202 @@
 						name: '瀹㈤��/杩斿搧鍥炲巶妫�楠�'
 					}
 				],
+				tagList: [{
+						id: 0,
+						name: '寰呭姙',
+						num: 0
+					},
+					{
+						id: 1,
+						name: '宸插姙',
+						num: 0
+					}
+				],
+				type: '',
 				searchForm: {
-					name: '',
-					status: 0
+					mixParam: '',
+					status: 0,
+					type: ''
 				},
-				projectList: [{
-						title: '212132',
-						createTime: '2023-08-28',
-						content: 'asdsadsax鎵嬫墦澶ц惃杈剧殑鍟婂疄鎵揳s'
-					},
-					{
-						title: '212132',
-						createTime: '2023-08-28',
-						content: 'asdsadsax鎵嬫墦澶ц惃杈剧殑鍟婂疄鎵揳s'
-					},
-					{
-						title: '212132',
-						createTime: '2023-08-28',
-						content: 'asdsadsax鎵嬫墦澶ц惃杈剧殑鍟婂疄鎵揳s'
-					},
-					{
-						title: '212132',
-						createTime: '2023-08-28',
-						content: 'asdsadsax鎵嬫墦澶ц惃杈剧殑鍟婂疄鎵揳s'
-					},
-				]
+				page: {
+					total: 0,
+					capacity: 10,
+					page: 1,
+				},
+				triggered: false,
+				finished: false,
+				projectList: []
 			}
 		},
 		computed: {
 			...mapState(['statusbarHeight', 'navHeight']),
 		},
+		async mounted() {
+			await this.$store.dispatch('getUpcomingNum')
+			this.tagList[0].num = this.$store.state.upcomingNum.d
+			this.tagList[1].num = this.$store.state.upcomingNum.y
+		},
 		onLoad() {
 			uni.getSystemInfo({
 				success: res => {
 					this.windowHeight = res.windowHeight
+
 				}
 			})
-
-			var that = this
-			uni.login({
-				provider: 'weixin',
-				success: function(loginRes) {
-					// console.log(loginRes);
-					that.code = loginRes.code
-					that.show = true
-				}
-			});
+			this.loadData()
 		},
 		methods: {
-			onMessage(e) {
-				console.log('12345654321')
+			loadData() {
+				getList({
+						model: this.searchForm,
+						...this.page
+					})
+					.then(res => {
+						let data = res.data
+						if (data.page == 1) {
+							this.projectList = []
+						}
+						this.page.page = data.page
+						this.page.total = data.total
+						this.projectList.push(...data.records)
+					})
+					.catch(err => {
+
+					})
+					.finally(() => {
+						this.triggered = false
+					})
 			},
-			scrolltolower() {},
-			scrolltoupper() {},
+			refresh() {
+				if (this.triggered) return
+				this.triggered = true;
+				this.page.page = 1
+				this.loadData()
+			},
+			loadMore() {
+				this.page.page += 1
+				this.loadData()
+			},
 			selectType(status) {
 				if (this.searchForm.status == status) return
-				this.searchForm.status = status
-				this.scrolltoupper()
+				this.searchForm.status = status
+				this.search()
 			},
-			selectProject(item) {},
+			jump(item) {
+				if ((item.type === 0 || item.type === 2 || item.type === 5) && item.status === 0) { // 璺宠浆鍑哄簱(杞簱鍗�)
+					uni.navigateTo({
+						url: `/pages/OutOperation/OutOperation?id=${item.objId}&dbid=${item.id}&type=7`
+					})
+				} else if ((item.type === 0 || item.type === 2 || item.type === 5) && item.status === 1) {
+					// router.push({
+					// 	name: 'wTransferDetail',
+					// 	query: {
+					// 		id: item.objId,
+					// 		status: item.status,
+					// 		type: item.type,
+					// 		dbid: item.id
+					// 	}
+					// })
+				} else if ((item.type === 1 || item.type === 4 || item.type === 6) && item.status === 0) { // 璺宠浆鍏ュ簱(杞簱鍗�)
+					if (item.type === 4) { // 璺宠浆瀹屽伐鍏ュ簱璇︽儏
+						// router.push({
+						// 	name: 'completionDetails',
+						// 	query: {
+						// 		id: item.objId,
+						// 		dbid: item.id,
+						// 		type: 7,
+						// 		isShow: 1,
+						// 		Type: item.type
+						// 	}
+						// })
+						return
+					}
+					uni.navigateTo({
+						url: `/pages/InOperation/InOperation?id=${item.objId}&dbid=${item.id}&type=7`
+					})
+					// router.push({
+					// 	name: 'warehousing',
+					// 	query: {
+					// 		id: item.objId,
+					// 		dbid: item.id,
+					// 		type: 7
+					// 	}
+					// })
+				} else if ((item.type === 1 || item.type === 4 || item.type === 6) && item.status === 1) {
+					if (item.type === 4) { // 璺宠洓瀹屽伐鍏ュ簱璇︽儏
+						// router.push({
+						// 	name: 'completionDetails',
+						// 	query: {
+						// 		id: item.objId,
+						// 		dbid: item.id,
+						// 		type: 7,
+						// 		isShow: 2
+						// 	}
+						// })
+						return
+					}
+					// router.push({
+					// 	name: 'wTransferDetail',
+					// 	query: {
+					// 		id: item.objId
+					// 	}
+					// })
+				} else if (item.type === 3 && item.status === 0) { // 纭澶囨枡
+					// router.push({
+					// 	name: 'orderStock',
+					// 	query: {
+					// 		id: item.objId,
+					// 		dbid: item.id
+					// 	}
+					// })
+				} else if (item.type === 3 && item.status === 1) { // 澶囨枡锛堣浆搴撳崟璇︽儏锛�
+					// router.push({ name: 'wInboundDetail', query: { id: item.objId } })
+					// router.push({
+					// 	name: 'wTransferDetail',
+					// 	query: {
+					// 		id: item.objId
+					// 	}
+					// })
+				} else if (item.type === 9 && item.status === 0) { // 璋冩暣鍏ュ簱(鍏ュ簱鍗�)
+					uni.navigateTo({
+						url: `/pages/InOperation/InOperation?id=${item.objId}&dbid=${item.id}&type=9`
+					})
+					// router.push({
+					// 	name: 'warehousing',
+					// 	query: {
+					// 		id: item.objId,
+					// 		dbid: item.id,
+					// 		type: 9
+					// 	}
+					// })
+				} else if (item.type === 9 && item.status === 1) {
+					// router.push({
+					// 	name: 'wInboundDetail',
+					// 	query: {
+					// 		id: item.objId
+					// 	}
+					// })
+				}
+			},
 			filterAction() {
 				this.show = true
-			},
-			close() {
+			},
+			close() {
+				this.show = false
+			},
+			resetType() {
+				this.type = ''
+				this.searchForm.type = ''
+				this.confirm()
+			},
+			confirm() {
+				this.searchForm.type = this.type
 				this.show = false
+				this.search()
+			},
+			search() {
+				this.page.page = 1
+				this.loadData()
 			}
 		}
 	}
@@ -271,13 +416,24 @@
 				}
 			}
 		}
-	}
-	.contanir {
-		min-height: calc(env(safe-area-inset-bottom) + 120rpx);
-	}
-	.bottom-view {
-		left: 40rpx;
-		right: 40rpx;
-		bottom: env(safe-area-inset-bottom);
+	}
+
+	.contanir {
+		height: calc(env(safe-area-inset-bottom) + 720rpx);
+
+		.content {
+			margin-top: 20rpx;
+
+			.type-style {
+				width: 325rpx;
+				margin-bottom: 20rpx;
+			}
+		}
+	}
+
+	.bottom-view {
+		left: 40rpx;
+		right: 40rpx;
+		bottom: 0
 	}
 </style>

--
Gitblit v1.9.3