From 11bff3e93067768199bab9bfff37e8eae17d8d92 Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周一, 05 5月 2025 16:33:45 +0800
Subject: [PATCH] 库存信息页面

---
 HIAWms/web/src/widgets/WmsStoreInfo/Views/Pages/WmsArea/WmsArea.tsx |  168 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 165 insertions(+), 3 deletions(-)

diff --git a/HIAWms/web/src/widgets/WmsStoreInfo/Views/Pages/WmsArea/WmsArea.tsx b/HIAWms/web/src/widgets/WmsStoreInfo/Views/Pages/WmsArea/WmsArea.tsx
index 7f74561..0ff3d54 100644
--- a/HIAWms/web/src/widgets/WmsStoreInfo/Views/Pages/WmsArea/WmsArea.tsx
+++ b/HIAWms/web/src/widgets/WmsStoreInfo/Views/Pages/WmsArea/WmsArea.tsx
@@ -1,4 +1,4 @@
-import { defineComponent } from 'vue'
+import { computed, defineComponent, onMounted, reactive, ref } from 'vue'
 import type { Ref } from 'vue'
 import BaseTable from '@/components/Table/Table'
 import styles from './WmsArea.module.scss'
@@ -9,6 +9,11 @@
 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,
+  getStoreDataList,
+} from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer'
 
 interface RenderTableType {
   url?: string
@@ -46,6 +51,74 @@
       onSuccess,
       onBeforeUpload,
     } = useWmsArea(props, ctx)
+
+    // 鏂板鐨勬煡璇㈡潯浠�
+    const queryForm = ref({
+      areaNo: '',
+      areaName: '',
+      areaType: '',
+      areaStatus: '',
+      filter: '',
+    })
+
+    const queryParams = computed(() => ({
+      ...queryForm.value,
+      areaType: queryForm.value.areaType || '', // 澶勭悊涓嬫媺
+      areaStatus: queryForm.value.areaStatus || '',
+    }))
+
+    // 鍔ㄦ�佹灇涓鹃�夐」
+    const enumOptions = reactive({
+      areaType: [] as Array<{ label: string; value: any }>,
+      areaStatus: [] as Array<{ label: string; value: any }>,
+    })
+
+    // 鑾峰彇鏋氫妇鏁版嵁
+    const fetchEnumData = async () => {
+      try {
+        // 鑾峰彇鐗╂枡绫诲瀷鏋氫妇
+        const areaTypeData = await getWmsEnumData({
+          EnumName: 'AreaTypeEnum',
+        })
+        enumOptions.areaType = areaTypeData.map((item) => ({
+          label: item.description,
+          value: item.value,
+        }))
+
+        // 鑾峰彇閲囪喘绫诲瀷鏋氫妇
+        const areaStatusData = await getWmsEnumData({
+          EnumName: 'AreaStatusEnum',
+        })
+        enumOptions.areaStatus = areaStatusData.map((item) => ({
+          label: item.description,
+          value: item.value,
+        }))
+      } catch (error) {
+        console.error('鑾峰彇鏋氫妇鏁版嵁澶辫触:', error)
+      }
+    }
+
+    // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹�
+    onMounted(() => {
+      fetchEnumData()
+    })
+
+    // 鏂板鐨勬煡璇㈡柟娉�
+    const handleQuery = async () => {
+      // tableRef.value.getTableList()
+      tableRef.value.getList(queryParams.value)
+    }
+
+    // 閲嶇疆鏌ヨ鏉′欢
+    const resetQuery = () => {
+      queryForm.value = {
+        areaNo: '',
+        areaName: '',
+        areaType: '',
+        areaStatus: '',
+        filter: '',
+      }
+    }
 
     /**
      * @returns 琛ㄦ牸
@@ -114,6 +187,95 @@
             sort={sort.value}
             onConfirm={onConfirmWmsArea}
           />
+          {/* 鏂板鐨勬煡璇㈣〃鍗� */}
+          <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.areaNo}
+                placeholder="璇疯緭鍏ュ簱鍖虹紪鐮�"
+                clearable
+                class={styles.formItem}
+              />
+            </ElFormItem>
+            <ElFormItem label="搴撳尯鍚嶇О">
+              <ElInput
+                v-model={queryForm.value.areaName}
+                placeholder="璇疯緭鍏ュ簱鍖哄悕绉�"
+                clearable
+                class={styles.formItem}
+              />
+            </ElFormItem>
+            <ElFormItem label="搴撲綅绫诲瀷">
+              <ElSelect
+                v-model={queryForm.value.areaType}
+                placeholder="璇烽�夋嫨鎵樼洏绫诲瀷"
+                clearable
+                loading={enumOptions.areaType.length === 0}
+                class={styles.formItem}
+              >
+                {enumOptions.areaType.map((option) => (
+                  <ElOption
+                    key={option.value}
+                    label={option.label}
+                    value={option.value}
+                  />
+                ))}
+              </ElSelect>
+            </ElFormItem>
+            <ElFormItem label="搴撳尯鐘舵��">
+              <ElSelect
+                v-model={queryForm.value.areaStatus}
+                placeholder="璇烽�夋嫨鎵樼洏鐘舵��"
+                clearable
+                loading={enumOptions.areaStatus.length === 0}
+                class={styles.formItem}
+              >
+                {enumOptions.areaStatus.map((option) => (
+                  <ElOption
+                    key={option.value}
+                    label={option.label}
+                    value={option.value}
+                  />
+                ))}
+              </ElSelect>
+            </ElFormItem>
+            {/* <ElFormItem label="鏃ユ湡鑼冨洿">
+              <ElDatePicker
+                v-model={queryForm.value.dateRange}
+                type="daterange"
+                range-separator="鑷�"
+                start-placeholder="寮�濮嬫棩鏈�"
+                end-placeholder="缁撴潫鏃ユ湡"
+                value-format="YYYY-MM-DD"
+              />
+            </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 +309,12 @@
                 瀵煎嚭
               </IconButton>
             </div>
-            <Search
+            {/* <Search
               placeholder="璇疯緭鍏ュ叧閿瓧"
               v-model={search.value}
               onConfirm={onSearch}
               style={{ marginTop: '-1px' }}
-            />
+            /> */}
           </div>
           <RenderBaseTable
             url="/api/v1/HIAWms/wmsArea"

--
Gitblit v1.9.3