From 5a93080a9568aca5118007eb9941db036faf0ebe Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周日, 04 5月 2025 17:10:54 +0800
Subject: [PATCH] 222
---
HIAWms/web/src/widgets/WmsContainer/Views/Pages/WmsContainer/WmsContainer.tsx | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 153 insertions(+), 2 deletions(-)
diff --git a/HIAWms/web/src/widgets/WmsContainer/Views/Pages/WmsContainer/WmsContainer.tsx b/HIAWms/web/src/widgets/WmsContainer/Views/Pages/WmsContainer/WmsContainer.tsx
index 8bf069e..62624bf 100644
--- a/HIAWms/web/src/widgets/WmsContainer/Views/Pages/WmsContainer/WmsContainer.tsx
+++ b/HIAWms/web/src/widgets/WmsContainer/Views/Pages/WmsContainer/WmsContainer.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 './WmsContainer.module.scss'
@@ -9,6 +9,8 @@
import { columns } from './Config'
import TdButton from '@/components/TdButton/TdButton'
import { vPermission } from '@/libs/Permission/Permission'
+import { getWmsEnumData } from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer'
+import { ElForm, ElFormItem, ElInput, ElOption, ElSelect } from 'element-plus'
interface RenderTableType {
url?: string
@@ -47,6 +49,73 @@
onBeforeUpload,
} = useWmsContainer(props, ctx)
+ // 鏂板鐨勬煡璇㈡潯浠�
+ const queryForm = ref({
+ containerNo: '',
+ containerType: '',
+ containerStatus: '',
+ filter: '',
+ })
+
+ const queryParams = computed(() => ({
+ ...queryForm.value,
+ containerType: queryForm.value.containerType || '', // 澶勭悊涓嬫媺
+ containerStatus: queryForm.value.containerStatus || '',
+ }))
+
+ // 鍔ㄦ�佹灇涓鹃�夐」
+ const enumOptions = reactive({
+ containerType: [] as Array<{ label: string; value: any }>,
+ containerStatus: [] as Array<{ label: string; value: any }>,
+ })
+
+ // 鑾峰彇鏋氫妇鏁版嵁
+ const fetchEnumData = async () => {
+ try {
+ // 鑾峰彇鐗╂枡绫诲瀷鏋氫妇
+ const containerTypeData = await getWmsEnumData({
+ EnumName: 'ContainerTypeEnum',
+ })
+ enumOptions.containerType = containerTypeData.map((item) => ({
+ label: item.description,
+ value: item.value,
+ }))
+
+ // 鑾峰彇閲囪喘绫诲瀷鏋氫妇
+ const containerStatusData = await getWmsEnumData({
+ EnumName: 'ContainerStatusEnum',
+ })
+ enumOptions.containerStatus = containerStatusData.map((item) => ({
+ label: item.description,
+ value: item.value,
+ }))
+ } catch (error) {
+ console.error('鑾峰彇鏋氫妇鏁版嵁澶辫触:', error)
+ }
+ }
+
+ // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹�
+ onMounted(() => {
+ fetchEnumData()
+ })
+
+ // 鏂板鐨勬煡璇㈡柟娉�
+ const handleQuery = async () => {
+ console.log('鏌ヨ鏉′欢:', queryParams.value)
+ // tableRef.value.getTableList()
+ tableRef.value.getList(queryParams.value)
+ }
+
+ // 閲嶇疆鏌ヨ鏉′欢
+ const resetQuery = () => {
+ queryForm.value = {
+ containerNo: '',
+ containerType: '',
+ containerStatus: '',
+ filter: '',
+ }
+ }
+
/**
* @returns 琛ㄦ牸
*/
@@ -60,7 +129,7 @@
params,
autoHeight,
} = props
-
+ console.log(dataSource.value)
return (
<div
class={{
@@ -114,6 +183,88 @@
sort={sort.value}
onConfirm={onConfirmWmsContainer}
/>
+
+ {/* 鏂板鐨勬煡璇㈣〃鍗� */}
+ <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.containerNo}
+ placeholder="璇疯緭鍏ユ墭鐩樼紪鐮�"
+ clearable
+ class={styles.formItem}
+ />
+ </ElFormItem>
+ <ElFormItem label="鐗╂枡绫诲瀷">
+ <ElSelect
+ v-model={queryForm.value.containerType}
+ placeholder="璇烽�夋嫨鎵樼洏绫诲瀷"
+ clearable
+ loading={enumOptions.containerType.length === 0}
+ class={styles.formItem}
+ >
+ {enumOptions.containerType.map((option) => (
+ <ElOption
+ key={option.value}
+ label={option.label}
+ value={option.value}
+ />
+ ))}
+ </ElSelect>
+ </ElFormItem>
+ <ElFormItem label="鎵樼洏鐘舵��">
+ <ElSelect
+ v-model={queryForm.value.containerStatus}
+ placeholder="璇烽�夋嫨鎵樼洏鐘舵��"
+ clearable
+ loading={enumOptions.containerStatus.length === 0}
+ class={styles.formItem}
+ >
+ {enumOptions.containerStatus.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
--
Gitblit v1.9.3