From 4b28ede0add31f776ffce57b54e93274d215b8cb Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 06 5月 2025 06:39:36 +0800
Subject: [PATCH] 22
---
HIAWms/web/src/widgets/WmsStoreInfo/Views/Pages/WmsPlace/WmsPlace.tsx | 267 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 264 insertions(+), 3 deletions(-)
diff --git a/HIAWms/web/src/widgets/WmsStoreInfo/Views/Pages/WmsPlace/WmsPlace.tsx b/HIAWms/web/src/widgets/WmsStoreInfo/Views/Pages/WmsPlace/WmsPlace.tsx
index b90811a..ddd7982 100644
--- a/HIAWms/web/src/widgets/WmsStoreInfo/Views/Pages/WmsPlace/WmsPlace.tsx
+++ b/HIAWms/web/src/widgets/WmsStoreInfo/Views/Pages/WmsPlace/WmsPlace.tsx
@@ -1,4 +1,4 @@
-import { defineComponent } from 'vue'
+import { defineComponent, onMounted, ref, computed, reactive } from 'vue'
import type { Ref } from 'vue'
import BaseTable from '@/components/Table/Table'
import styles from './WmsPlace.module.scss'
@@ -9,6 +9,12 @@
import { columns } from './Config'
import TdButton from '@/components/TdButton/TdButton'
import { vPermission } from '@/libs/Permission/Permission'
+import { ElForm, ElFormItem, ElInput, ElOption, ElSelect } from 'element-plus'
+import {
+ getWmsEnumData,
+ getAreaAreaDataList,
+ getAisleDataList,
+} from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer'
interface RenderTableType {
url?: string
@@ -46,6 +52,122 @@
onSuccess,
onBeforeUpload,
} = useWmsPlace(props, ctx)
+
+ // 鏂板鐨勬煡璇㈡潯浠�
+ const queryForm = ref({
+ placeNo: '',
+ storageTypeNo: '',
+ placeStatus: '',
+ areaCode: '',
+ aisle: '',
+ islock: '',
+ emptyContainer: '',
+ filter: '',
+ })
+
+ const queryParams = computed(() => ({
+ ...queryForm.value,
+ storageTypeNo: queryForm.value.storageTypeNo || '', // 澶勭悊涓嬫媺
+ placeStatus: queryForm.value.placeStatus || '',
+ islock: queryForm.value.islock || '',
+ aisle: queryForm.value.aisle || '',
+ areaCode: queryForm.value.areaCode || '',
+ emptyContainer: queryForm.value.emptyContainer || '',
+ }))
+
+ // 鍔ㄦ�佹灇涓鹃�夐」
+ const enumOptions = reactive({
+ storageTypeNo: [] as Array<{ label: string; value: any }>,
+ placeStatus: [] as Array<{ label: string; value: any }>,
+ yesOrNo: [] as Array<{ label: string; value: any }>,
+ })
+
+ let areaTypelist = [] as Array<{ label: string; value: any }>
+ let aisleTypelist = [] as Array<{ label: string; value: any }>
+
+ // 鑾峰彇鏋氫妇鏁版嵁
+ const fetchEnumData = async () => {
+ try {
+ // 鑾峰彇鐗╂枡绫诲瀷鏋氫妇
+ const storageTypeNoData = await getWmsEnumData({
+ EnumName: 'PlaceTypeEnum',
+ })
+ enumOptions.storageTypeNo = storageTypeNoData.map((item) => ({
+ label: item.description,
+ value: item.value,
+ }))
+
+ // 鑾峰彇閲囪喘绫诲瀷鏋氫妇
+ const placeStatusData = await getWmsEnumData({
+ EnumName: 'PlaceStatusEnum',
+ })
+ enumOptions.placeStatus = placeStatusData.map((item) => ({
+ label: item.description,
+ value: item.value,
+ }))
+
+ const yesNoData = await getWmsEnumData({
+ EnumName: 'YesNoEnum',
+ })
+ enumOptions.yesOrNo = yesNoData.map((item) => ({
+ label: item.description,
+ value: item.value,
+ }))
+ } catch (error) {
+ console.error('鑾峰彇鏋氫妇鏁版嵁澶辫触:', error)
+ }
+ }
+ const getAreaType = async () => {
+ try {
+ const areaListData = await getAreaAreaDataList()
+ areaTypelist = areaListData.map((item) => ({
+ label: item.areaName || '',
+ value: item.areaNo || '', // 鍚屼笂
+ }))
+ } catch (error) {
+ areaTypelist = [] // 澶辫触鏃堕噸缃负绌烘暟缁�
+ }
+ }
+
+ const getAisleList = async () => {
+ try {
+ const aisleListData = await getAisleDataList()
+ aisleTypelist = aisleListData.map((item) => ({
+ label: item.aisleName || '',
+ value: item.aisle || '',
+ }))
+ } catch (error) {
+ console.error('鑾峰彇宸烽亾鍒楄〃澶辫触:', error)
+ aisleTypelist = [] // 澶辫触鏃堕噸缃负绌烘暟缁�
+ }
+ }
+ // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹�
+ onMounted(() => {
+ fetchEnumData()
+ getAreaType()
+ getAisleList()
+ })
+
+ // 鏂板鐨勬煡璇㈡柟娉�
+ const handleQuery = async () => {
+ console.log('鏌ヨ鏉′欢:', queryParams.value)
+ // tableRef.value.getTableList()
+ tableRef.value.getList(queryParams.value)
+ }
+
+ // 閲嶇疆鏌ヨ鏉′欢
+ const resetQuery = () => {
+ queryForm.value = {
+ placeNo: '',
+ storageTypeNo: '',
+ placeStatus: '',
+ aisle: '',
+ areaCode: '',
+ islock: '',
+ emptyContainer: '',
+ filter: '',
+ }
+ }
/**
* @returns 琛ㄦ牸
@@ -114,6 +236,145 @@
sort={sort.value}
onConfirm={onConfirmWmsPlace}
/>
+ {/* 鏂板鐨勬煡璇㈣〃鍗� */}
+ <ElForm
+ inline
+ model={queryForm.value}
+ class={styles.queryForm}
+ label-width="80px"
+ >
+ <ElFormItem label="鍏抽敭瀛�">
+ <ElInput
+ v-model={queryForm.value.filter}
+ placeholder="璇疯緭鍏ュ叧閿瓧鎼滅储"
+ clearable
+ class={styles.formItem}
+ />
+ </ElFormItem>
+ <ElFormItem label="搴撲綅缂栫爜">
+ <ElInput
+ v-model={queryForm.value.placeNo}
+ placeholder="璇疯緭鍏ュ簱浣嶇紪鐮�"
+ clearable
+ class={styles.formItem}
+ />
+ </ElFormItem>
+ <ElFormItem label="搴撲綅绫诲瀷">
+ <ElSelect
+ v-model={queryForm.value.storageTypeNo}
+ placeholder="璇烽�夋嫨鎵樼洏绫诲瀷"
+ clearable
+ loading={enumOptions.storageTypeNo.length === 0}
+ class={styles.formItem}
+ >
+ {enumOptions.storageTypeNo.map((option) => (
+ <ElOption
+ key={option.value}
+ label={option.label}
+ value={option.value}
+ />
+ ))}
+ </ElSelect>
+ </ElFormItem>
+ <ElFormItem label="搴撲綅鐘舵��">
+ <ElSelect
+ v-model={queryForm.value.placeStatus}
+ placeholder="璇烽�夋嫨鎵樼洏鐘舵��"
+ clearable
+ loading={enumOptions.placeStatus.length === 0}
+ class={styles.formItem}
+ >
+ {enumOptions.placeStatus.map((option) => (
+ <ElOption
+ key={option.value}
+ label={option.label}
+ value={option.value}
+ />
+ ))}
+ </ElSelect>
+ </ElFormItem>
+ <ElFormItem label="搴撳尯">
+ <ElSelect
+ v-model={queryForm.value.areaCode}
+ placeholder="璇烽�夋嫨搴撳尯"
+ clearable
+ loading={areaTypelist.length === 0}
+ class={styles.formItem}
+ >
+ {areaTypelist.map((option) => (
+ <ElOption
+ key={option.value}
+ label={option.label}
+ value={option.value}
+ />
+ ))}
+ </ElSelect>
+ </ElFormItem>
+ <ElFormItem label="宸烽亾">
+ <ElSelect
+ v-model={queryForm.value.aisle}
+ placeholder="璇烽�夋嫨搴撳尯"
+ clearable
+ loading={aisleTypelist.length === 0}
+ class={styles.formItem}
+ >
+ {aisleTypelist.map((option) => (
+ <ElOption
+ key={option.value}
+ label={option.label}
+ value={option.value}
+ />
+ ))}
+ </ElSelect>
+ </ElFormItem>
+ <ElFormItem label="鏄惁閿佸畾">
+ <ElSelect
+ v-model={queryForm.value.islock}
+ placeholder="璇烽�夋嫨鏄惁閿佸畾"
+ clearable
+ loading={enumOptions.yesOrNo.length === 0}
+ class={styles.formItem}
+ >
+ {enumOptions.yesOrNo.map((option) => (
+ <ElOption
+ key={option.value}
+ label={option.label}
+ value={option.value}
+ />
+ ))}
+ </ElSelect>
+ </ElFormItem>
+ <ElFormItem label="鏄惁绌烘墭">
+ <ElSelect
+ v-model={queryForm.value.emptyContainer}
+ placeholder="璇烽�夋嫨鏄惁绌烘墭"
+ clearable
+ loading={enumOptions.yesOrNo.length === 0}
+ class={styles.formItem}
+ >
+ {enumOptions.yesOrNo.map((option) => (
+ <ElOption
+ key={option.value}
+ label={option.label}
+ value={option.value}
+ />
+ ))}
+ </ElSelect>
+ </ElFormItem>
+ <ElFormItem>
+ <IconButton type="primary" icon="search" onClick={handleQuery}>
+ 鏌ヨ
+ </IconButton>
+ <IconButton
+ style="margin-left: 10px;"
+ icon="refresh"
+ onClick={resetQuery}
+ >
+ 閲嶇疆
+ </IconButton>
+ </ElFormItem>
+ </ElForm>
+
<div class={styles.headerContent}>
<div class={styles.header}>
<IconButton
@@ -147,12 +408,12 @@
瀵煎嚭
</IconButton>
</div>
- <Search
+ {/* <Search
placeholder="璇疯緭鍏ュ叧閿瓧"
v-model={search.value}
onConfirm={onSearch}
style={{ marginTop: '-1px' }}
- />
+ /> */}
</div>
<RenderBaseTable
url="/api/v1/HIAWms/wmsPlace"
--
Gitblit v1.9.3