From 68d975c737a051975cbb9b7c5bada7f37ae9e722 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期五, 01 九月 2023 09:11:57 +0800
Subject: [PATCH] Merge branch 'dev' of ssh://139.186.142.91:29418/productDev/dmMes into dev

---
 minipro_standard/pages_adjust/pages/InventoryQuery/InventoryQuery.vue |  485 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 485 insertions(+), 0 deletions(-)

diff --git a/minipro_standard/pages_adjust/pages/InventoryQuery/InventoryQuery.vue b/minipro_standard/pages_adjust/pages/InventoryQuery/InventoryQuery.vue
new file mode 100644
index 0000000..83ffa40
--- /dev/null
+++ b/minipro_standard/pages_adjust/pages/InventoryQuery/InventoryQuery.vue
@@ -0,0 +1,485 @@
+<template>
+	<view class="content">
+		<view class="content_search">
+			<Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true"
+				placeholder="鎼滅储浠撳簱鍚嶇О/鐗╂枡鍚嶇О">
+				<template v-slot:content>
+					<view class="Search_item">
+						<view class="Search_item_label">姹囨�讳緷鎹�</view>
+						<view class="Search_item_content">
+							<view class="tag">
+								<view
+									class="tag_item"
+									:class="{ tag_active: item.isActive }"
+									v-for="(item, i) in groupTypes"
+									:key="item.id"
+									@click="changeGroup(i)"
+								>
+									{{ item.name }}
+								</view>
+							</view>
+						</view>
+					</view>
+				</template>
+			</Search>
+		</view>
+		<view class="content_total" :style="{top: top}">鍏眥{controlData.total}}鏉℃暟鎹�</view>
+		<view class="content_list">
+			<scroll-view @scrolltolower="getLists" scroll-y :style="{height: height}">
+				<view class="content_list_item" v-for="(item, i) in list" :key="i">
+					<view class="content_list_item_top">
+						<view class="content_list_item_top_left">
+							<text>{{ item.materialName }}&nbsp;|&nbsp;{{ item.materialCode }}</text>
+						</view>
+						<view class="content_list_item_top_right">
+							<text class="created">{{ '搴撳瓨锛�' + item.num + item.unitName }}</text>
+						</view>
+					</view>
+					<view class="content_list_item_sx">
+						<text v-if="item.qualityType == 0" class="green">鍚堟牸 | </text>
+						<text v-if="item.qualityType == 1" class="yellow">涓嶈壇 | </text>
+						<text v-if="item.qualityType == 2" class="red">鎶ュ簾 | </text>
+						<text>{{ item.procedureName ? item.procedureName : '-' }} | </text>
+						<text>{{ item.batch ? item.batch : '-' }}</text>
+					</view>
+					<!-- item涓婚淇℃伅閮ㄥ垎 -->
+					<view class="content_list_item_content">
+						<view class="content_list_item_content_item">
+							<view class="content_list_item_content_item_label">瑙勬牸锛�</view>
+							<view class="content_list_item_content_item_nr">
+								{{ item.attr }}
+							</view>
+						</view>
+						<view class="content_list_item_content_item" v-if="data.groupType == '3' || data.groupType == '2'">
+							<view class="content_list_item_content_item_label">浠撳簱锛�</view>
+							<view class="content_list_item_content_item_nr">
+								{{ item.wareHouseName ? item.wareHouseName : '-' }}
+							</view>
+						</view>
+						<view class="content_list_item_content_item" v-if="data.groupType == '3' || data.groupType == '2'">
+							<view class="content_list_item_content_item_label">璐т綅锛�</view>
+							<view class="content_list_item_content_item_nr">
+								{{ item.locationName }}
+							</view>
+						</view>
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import Search from '@/components/Search.vue'
+	import { orderTyepToStr } from '@/util/constData.js'
+	export default {
+		components: {
+			Search
+		},
+		data() {
+			return {
+				height: '',
+				top: '',
+				controlData: {
+					finished: false,
+					loading: false,
+					total: 0,
+					page: 0,
+					capacity: 10,
+				},
+				groupTypes: [
+					{ name: '榛樿', id: '3', isActive: true },
+					{ name: '鐗╂枡', id: '1', isActive: false },
+					{ name: '鐗╂枡+浠撳簱', id: '2', isActive: false }
+				],
+				data: {
+					materialName: '',
+					groupType: '3'
+				},
+				list: []
+			};
+		},
+		onReady() {
+			var that = this
+			this.$nextTick(() => {
+				uni.createSelectorQuery().in(this).select('.content_search').boundingClientRect((rect) => {
+					that.height = `calc(100vh - ${rect.height + 80}px)`
+					that.top = `${rect.height}px`
+				}).exec()
+			})
+		},
+		methods: {
+			changeGroup(i) {
+				this.groupTypes[i].isActive = !this.groupTypes[i].isActive;
+				this.data.groupType = this.groupTypes[i].id
+				for (const index in this.groupTypes) {
+					if (index != i) {
+						// console.log(index, i)
+						const item = this.groupTypes[index]
+						item.isActive = false
+					}
+				}
+			},
+			tyepToStr(type) {
+				//  <!-- 1銆佽溅闂撮鏂欙紱2銆佽溅闂村鏂欙紱3銆佸叾浠栵紱4銆佸畬宸ュ叆搴� -->
+				for (const item of this.orderType) {
+					if (item.id == type) {
+						return item.name
+					}
+				}
+				return '-'
+			},
+			// 璺宠浆
+			jump(item) {
+				uni.navigateTo({
+					url: `/pages/planDetails/planDetails?id=${item.id}`
+				})
+			},
+			// 鑾峰彇澶撮儴缁勪欢楂樺害
+			getHeight(height) {
+				this.height = height
+			},
+			// 閲嶇疆
+			reset() {
+				this.listData.page = 0
+				this.finished = false
+				this.lists = []
+				this.listData.mixParam = ''
+				this.listData.startDate = ''
+				this.listData.endDate = ''
+				this.listData.procedureIds = []
+				if (this.factoryList.length > 0) {
+					this.listData.departIds = this.factoryList[0].id
+				}
+				if (this.data.length > 0) {
+					this.data.forEach(item => {
+						item.isActive = false
+					})
+				}
+				// this.getLists()
+				// this.pageCounts()
+			},
+			// 鏃ユ湡纭畾
+			timeConfirm(val) {
+				this.listData.startDate = val[0]
+				this.listData.endDate = val[val.length - 1]
+				this.timeShow = false
+			},
+			// 鍒囨崲宸ュ巶
+			changeTags(i, id) {
+				this.listData.departIds = id
+				this.getWorkingProcedures(id)
+				this.factoryList.forEach((item, index) => {
+					if (index === i) {
+						item.isActive = true
+					} else {
+						item.isActive = false
+					}
+				})
+			},
+			// 鎵撳紑鏃ユ湡鎻掍欢
+			openDate() {
+				this.timeShow = true
+			},
+			// 鎼滅储
+			searchInput(val) {
+				this.listData.mixParam = val
+				this.listData.page = 0
+				this.finished = false
+				this.lists = []
+				this.getLists()
+			},
+			// 鐐瑰嚮鏍囩鎼滅储
+			clickTag(ids) {
+				this.listData.cateIds = ids
+				this.listData.page = 0
+				this.finished = false
+				this.lists = []
+				// this.getLists()
+			},
+			// 鑾峰彇鍒楄〃缁熻
+			pageCounts() {
+				pageCount({
+					factoryId: this.listData.departIds,
+					procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [],
+					startDate: this.listData.startDate,
+					endDate: this.listData.endDate,
+					statusList: this.listData.cateIds
+				}).then(res => {
+					if (res.code === 200 && res.data) {
+						this.tagList[0].num = res.data.allNum.toString()
+						this.tagList[1].num = res.data.startNum.toString()
+						this.tagList[2].num = res.data.ingNum.toString()
+						this.tagList[3].num = res.data.endNum.toString()
+					}
+				})
+			},
+			// 鑾峰彇宸ュ巶鏁版嵁
+			getOrganizations() {
+				getOrganization({
+					type: 1
+				}).then(res => {
+					if (res.code === 200 && res.data && res.data.length !== 0) {
+						res.data.forEach((item, i) => {
+							item.isActive = i === 0;
+						})
+						if (res.data.length > 0) {
+							this.factoryList = res.data
+							this.listData.departIds = this.factoryList[0].id
+							this.listData.procedureIds = ''
+							this.finished = false
+							this.getWorkingProcedures(this.factoryList[0].id)
+							this.getLists()
+							this.pageCounts()
+						}
+					}
+				})
+			},
+			// 鑾峰彇宸ュ簭鏁版嵁
+			getWorkingProcedures(orgId) {
+				this.data = []
+				getWorkingProcedure({
+						orgId
+					})
+					.then(res => {
+						if (res.code === 200 && res.data && res.data.length !== 0) {
+							res.data.forEach((item, i) => {
+								item.isActive = false;
+							})
+							this.data = res.data
+						}
+					})
+			},
+			// 鎼滅储寮规鎻愪氦
+			submit() {
+				let pmodelOrgId = []
+				this.data.forEach((item) => {
+					if (item.isActive) {
+						pmodelOrgId.push(item.id)
+					}
+				})
+				this.listData.procedureIds = pmodelOrgId
+				this.listData.page = 0
+				this.finished = false
+				this.lists = []
+				// this.getLists()
+				// this.pageCounts()
+			},
+			// 鑾峰彇璁″垝鍒楄〃鏁版嵁
+			getLists() {
+				console.log('getLists')
+				if (!this.finished) {
+					this.loading = true
+					this.listData.page = this.listData.page++
+					getList({
+						capacity: this.listData.capacity,
+						model: {
+							mixParam: this.listData.mixParam,
+							startDate: this.listData.startDate,
+							endDate: this.listData.endDate,
+							procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [],
+							factoryId: this.listData.departIds,
+							statusList: this.listData.cateIds
+						},
+						page: this.listData.page,
+						sorts: [{
+							direction: 'ASC',
+							property: 'publishDate'
+						}]
+					}).then(res => {
+						this.loading = false
+						this.listData.total = res.data.total
+						if (this.refreshing) {
+							this.lists = []
+							this.refreshing = false;
+						}
+						if (res.code === 200 && res.data.records.length !== 0) {
+							if (this.lists.length === 0) {
+								this.lists = res.data.records
+							} else {
+								this.lists.push(...res.data.records)
+							}
+						} else {
+							this.finished = true
+						}
+					}).catch(err => {
+						this.loading = false
+						this.finished = true
+						if (this.refreshing) {
+							this.lists = []
+							this.refreshing = false;
+						}
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		.content_search {
+			width: 100%;
+			padding: 30rpx;
+			background: white;
+			position: sticky;
+			top: 0;
+			z-index: 999;
+			box-sizing: border-box;
+
+			.Search_item {
+				margin-bottom: 40rpx;
+
+				.Search_item_label {
+					font-size: 30rpx;
+					font-weight: 500;
+					color: #222222;
+				}
+
+				.Search_item_content {
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					margin-top: 30rpx;
+
+					.tag {
+						display: flex;
+						flex-wrap: wrap;
+						align-items: center;
+
+						.tag_active {
+							background: $nav-color !important;
+							color: #ffffff !important;
+						}
+
+						.tag_item {
+							padding: 22rpx 26rpx;
+							box-sizing: border-box;
+							background: #F2F2F2;
+							border-radius: 8rpx;
+							font-size: 26rpx;
+							font-weight: 400;
+							color: #333333;
+							display: flex;
+							align-items: center;
+							justify-content: center;
+							margin-right: 22rpx;
+							margin-bottom: 22rpx;
+						}
+					}
+
+					text {
+						font-size: 26rpx;
+						font-weight: 400;
+						color: #333333;
+						margin: 0 30rpx;
+					}
+
+					.Search_item_content_a {
+						padding: 20rpx 0;
+						flex: 1;
+						background: #F7F7F7;
+						border-radius: 8rpx;
+						border: 1rpx solid #EEEEEE;
+						font-size: 26rpx;
+						font-weight: 400;
+						color: #B2B2B2;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+					}
+				}
+			}
+
+			.content_search_x {
+				height: 24rpx;
+			}
+		}
+
+		.content_list {
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+			.content_list_item {
+				background: #ffffff;
+				padding: 30rpx;
+				display: flex;
+				flex-direction: column;
+				border-bottom: 1rpx solid #ececec;
+				.content_list_item_sx {
+					margin-top: 20rpx;
+				}
+				.content_list_item_top {
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					.content_list_item_top_left {
+						text {
+							font-size: 32rpx;
+							font-weight: 500;
+							color: #333333;
+						}
+					}
+					.content_list_item_top_right {
+						font-size: 26rpx;
+						font-weight: 400;
+						.created {
+							color: $nav-stateColor1 !important;
+						}
+						.warning {
+							color: $nav-stateColor5 !important;
+						}
+						.green {
+							color: $nav-stateColor6 !important;
+						}
+						.info {
+							color: $nav-stateColor3 !important;
+						}
+					}
+				}
+				.content_list_item_content {
+					padding: 24rpx 30rpx;
+					background: #f7f7f7;
+					border-radius: 16rpx;
+					display: flex;
+					flex-wrap: wrap;
+					justify-content: space-between;
+					margin-top: 32rpx;
+					.content_list_item_content_item {
+						width: 100%;
+						display: flex;
+						margin-top: 24rpx;
+						&:nth-child(1) {
+							margin-top: 0 !important;
+						}
+						.content_list_item_content_item_label {
+							font-size: 24rpx;
+							font-weight: 400;
+							color: #666666;
+							flex-shrink: 0;
+						}
+						.content_list_item_content_item_nr {
+							font-size: 24rpx;
+							font-weight: 400;
+							color: #222222;
+							margin-right: 10rpx;
+						}
+					}
+				}
+			}
+		}
+
+		.content_total {
+			width: 100%;
+			height: 80rpx;
+			padding: 24rpx 30rpx;
+			background: #F7F7F7;
+			font-size: 24rpx;
+			font-weight: 400;
+			box-sizing: border-box;
+			color: #666666;
+			position: sticky;
+			z-index: 99;
+		}
+	}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3