From d492850f1cc64ddcfaf43798af9c76c2505414fd Mon Sep 17 00:00:00 2001
From: renkang <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 24 一月 2025 18:24:31 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1

---
 h5/pages/inventory/index.vue |  222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 222 insertions(+), 0 deletions(-)

diff --git a/h5/pages/inventory/index.vue b/h5/pages/inventory/index.vue
new file mode 100644
index 0000000..56dd855
--- /dev/null
+++ b/h5/pages/inventory/index.vue
@@ -0,0 +1,222 @@
+<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.name" @confirm="handleQuery" type="text" placeholder="鎼滅储鐩樼偣鍗曞悕绉�"
+					placeholder-class="placeholder9" />
+			</view>
+		</view>
+		<!--  -->
+		<scroll-view scroll-y="true" class="scroll_Y" @scrolltolower="scrolltolower">
+			<view class="list">
+				<view class="item" @click="itemClick(item)" v-for="item in list">
+					<image v-if="item.status == 0 || item.status == 1" class="img" src="@/static/side/ic_pandian@2x.png" mode="">
+					</image>
+					<image v-else class="img" src="@/static/side/ic_pandian_grey@2x.png" mode=""></image>
+					<view class="content">
+						<view class="head">
+							<view class="title">{{item.name}}</view>
+							<view class="status" v-if="item.status == 0">鏈紑濮�</view>
+							<view class="status green" v-if="item.status == 1">鐩樼偣涓�</view>
+							<view class="status gray" v-if="item.status == 2">宸插畬鎴�</view>
+							<view class="status gray" v-if="item.status == 3">宸插彇娑�</view>
+						</view>
+						<view class="line">鐩樼偣鏃ユ湡锛歿{item.planDate}}</view>
+						<view class="line">鐩樼偣浠撳簱锛歿{item.warehouseName}}</view>
+						<view class="line">
+							<view class="">鐩樼偣浜哄憳锛歿{item.userName}}</view>
+							<view class="btn" v-if="item.status == 0 && item.timeFlag" @click="startHandle(item)">寮�濮嬬洏鐐�</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+	import {
+		getYwStocktaking,
+		ywStocktakingBegin
+	} from '@/api'
+	import dayjs from 'dayjs';
+	export default {
+		data() {
+			return {
+				param: {},
+				list: [],
+				page: 0,
+				total: 0,
+			};
+		},
+		onShow() {
+			this.handleQuery()
+		},
+		methods: {
+			getList() {
+				const {
+					page,
+					param
+				} = this
+				getYwStocktaking({
+					capacity: 20,
+					page,
+					model: {
+						...param
+					}
+				}).then(res => {
+					this.list = [...this.list, ...res.data.records]
+					let date = dayjs().format('YYYY-MM-DD')
+					this.list.forEach(item => {
+						item.timeFlag = new Date(item.planDate).getTime() <= new Date(date+' 23:59:59').getTime()
+					})
+					this.total = res.data.total
+				})
+			},
+			itemClick(item) {
+				if (item.status != 0) {
+					uni.navigateTo({
+						url: '/pages/inventory/detail?id=' + item.id
+					})
+				}
+			},
+			startHandle(item) {
+				uni.showModal({
+					content: '鐩樼偣鏈熼棿涓嶅彲杩涜鍑哄叆搴撴搷浣�',
+					success: (res) => {
+						if (res.confirm) {
+							ywStocktakingBegin(item.id).then(() => {
+								uni.navigateTo({
+									url: '/pages/inventory/detail?id=' + item.id
+								})
+							})
+
+						}
+					}
+				})
+			},
+			handleQuery() {
+				this.list = []
+				this.page = 1
+				this.getList()
+			},
+			scrolltolower() {
+				const {
+					total,
+					list
+				} = this
+				if (list.length < total) {
+					this.page = this.page + 1
+					this.getList()
+				} else {
+					this.showToast('鏆傛棤鏇村鏁版嵁')
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.main_app {
+		padding: 0rpx 30rpx 0;
+		font-size: 28rpx;
+	}
+
+	.head_wrap {
+		display: flex;
+		align-items: center;
+		height: 110rpx;	
+		.search_wrap {
+			display: flex;
+			align-items: center;
+			width: 100%;
+			height: 76rpx;
+			background: #F7F7F7;
+			border-radius: 38rpx;
+			padding-left: 30rpx;
+
+			input {
+				flex: 1;
+			}
+
+			.search {
+				width: 28rpx;
+				height: 28rpx;
+			}
+		}
+
+	}
+	.scroll_Y{
+		height: calc(100vh - 126rpx);
+	}
+	.list {
+		.item {
+			display: flex;
+			border-bottom: 1rpx solid #E5E5E5;
+			padding-bottom: 28rpx;
+			margin-bottom: 20rpx;
+
+			.img {
+				width: 80rpx;
+				height: 80rpx;
+				background: rgba(0, 104, 255, 0.08);
+				border-radius: 12rpx;
+				margin-right: 24rpx;
+			}
+
+			.content {
+				flex: 1;
+
+				.head {
+					display: flex;
+					// align-items: center;
+					justify-content: space-between;
+					margin-bottom: 12rpx;
+
+					.title {
+						font-weight: 600;
+						font-size: 34rpx;
+						color: #222222;
+						flex: 1;
+					}
+
+					.status {
+						color: $primaryColor;
+						width: 96rpx;
+						padding-top: 3rpx;
+					}
+
+					.green {
+						color: #0ADE79;
+					}
+
+					.gray {
+						color: #AAAAAA;
+					}
+				}
+
+				.line {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					color: #666666;
+					height: 60rpx;
+
+					.btn {
+						width: 144rpx;
+						height: 60rpx;
+						background: $primaryColor;
+						box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 104, 255, 0.3);
+						border-radius: 30rpx;
+						color: #fff;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+						font-size: 26rpx;
+					}
+				}
+			}
+		}
+	}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3