From 20b61979b0709ea86752332c04b46add0f8f48f7 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 13 八月 2025 12:06:54 +0800
Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop

---
 rsf-admin/src/page/basicInfo/loc/LocList.jsx |  171 ++++++++++++++++++++++++++++++--------------------------
 1 files changed, 91 insertions(+), 80 deletions(-)

diff --git a/rsf-admin/src/page/basicInfo/loc/LocList.jsx b/rsf-admin/src/page/basicInfo/loc/LocList.jsx
index f2a1915..732f9a8 100644
--- a/rsf-admin/src/page/basicInfo/loc/LocList.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/LocList.jsx
@@ -35,26 +35,26 @@
     Button,
     useList,
 } from 'react-admin';
+import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
 import { Box, Typography, Card, Stack } from '@mui/material';
-import { styled } from '@mui/material/styles';
-import LocCreate from "./LocCreate";
-import BindModal from "./BindModal";
-import EmptyData from "../../components/EmptyData";
-import DynamicField from "../../components/DynamicField";
 import MyCreateButton from "../../components/MyCreateButton";
 import MyExportButton from '../../components/MyExportButton';
+import DashboardIcon from '@mui/icons-material/Dashboard';
+import DynamicField from "../../components/DynamicField";
+import DiscountIcon from '@mui/icons-material/Discount';
+import PageDrawer from "../../components/PageDrawer";
+import EmptyData from "../../components/EmptyData";
+import EditIcon from '@mui/icons-material/Edit';
+import LinkIcon from '@mui/icons-material/Link';
+import { styled } from '@mui/material/styles';
+import SubzoneModal from './SubzoneModal';
+import LocListAside from "./LocListAside";
 import InitButton from './InitButton';
 import BatchModal from './BatchModal';
-import SubzoneModal from './SubzoneModal';
-import PageDrawer from "../../components/PageDrawer";
-import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
-import DashboardIcon from '@mui/icons-material/Dashboard';
-import EditIcon from '@mui/icons-material/Edit';
 import request from '@/utils/request';
-import DiscountIcon from '@mui/icons-material/Discount';
-import LinkIcon from '@mui/icons-material/Link';
+import LocCreate from "./LocCreate";
+import BindModal from "./BindModal";
 import InitModal from "./InitModal";
-import LocListAside from "./LocListAside";
 
 const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
     '& .css-1vooibu-MuiSvgIcon-root': {
@@ -83,66 +83,76 @@
     },
 }));
 
-const filters = [
-    <SearchInput source="condition" alwaysOn />,
-    <ReferenceInput
-        source="warehouseId"
-        label="table.field.loc.warehouseId"
-        reference="warehouse"
-    >
-        <AutocompleteInput
-            label="table.field.loc.warehouseId"
-            optionText="name"
-            filterToQuery={(val) => ({ name: val })}
-        />
-    </ReferenceInput>,
-    <ReferenceInput
-        source="areaId"
-        label="table.field.loc.areaId"
-        reference="warehouseAreas"
-    >
-        <AutocompleteInput
-            label="table.field.loc.areaId"
-            optionText="name"
-            filterToQuery={(val) => ({ name: val })}
-        />
-    </ReferenceInput>,
-    <TextInput source="code" label="table.field.loc.code" />,
-    <TextInput source="type" label="table.field.loc.type" />,
-    <TextInput source="name" label="table.field.loc.name" />,
-    <NumberInput source="flagLogic" label="table.field.loc.flagLogic" />,
-    <TextInput source="fucAtrrs" label="table.field.loc.fucAtrrs" />,
-    <TextInput source="barcode" label="table.field.loc.barcode" />,
-    <TextInput source="unit" label="table.field.loc.unit" />,
-    <TextInput source="size" label="table.field.loc.size" />,
-    <NumberInput source="row" label="table.field.loc.row" />,
-    <NumberInput source="col" label="table.field.loc.col" />,
-    <NumberInput source="lev" label="table.field.loc.lev" />,
-    <NumberInput source="channel" label="table.field.loc.channel" />,
-    <NumberInput source="maxParts" label="table.field.loc.maxParts" />,
-    <NumberInput source="maxPack" label="table.field.loc.maxPack" />,
-    <NumberInput source="flagLabelMange" label="table.field.loc.flagLabelMange" />,
-    <TextInput source="locAttrs" label="table.field.loc.locAttrs" />,
-
-    <TextInput label="common.field.memo" source="memo" />,
-    <SelectInput
-        label="common.field.status"
-        source="status"
-        choices={[
-            { id: '1', name: 'common.enums.statusTrue' },
-            { id: '0', name: 'common.enums.statusFalse' },
-        ]}
-        resettable
-    />,
-]
-
 const LocList = () => {
-    const translate = useTranslate();
-    const notify = useNotify();
-    const refresh = useRefresh();
+    const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_use_stas')) || [];
     const [createDialog, setCreateDialog] = useState(false);
-    const [drawerVal, setDrawerVal] = useState(false);
     const [initDialog, setInitDialog] = useState(false);
+    const [drawerVal, setDrawerVal] = useState(false);
+    const translate = useTranslate();
+    const refresh = useRefresh();
+    const notify = useNotify();
+
+    const filters = [
+        <SearchInput source="condition" alwaysOn />,
+        <ReferenceInput
+            source="warehouseId"
+            label="table.field.loc.warehouseId"
+            reference="warehouse"
+        >
+            <AutocompleteInput
+                label="table.field.loc.warehouseId"
+                optionText="name"
+                filterToQuery={(val) => ({ name: val })}
+            />
+        </ReferenceInput>,
+        <ReferenceInput
+            source="areaId"
+            label="table.field.loc.areaId"
+            reference="warehouseAreas"
+        >
+            <AutocompleteInput
+                label="table.field.loc.areaId"
+                optionText="name"
+                filterToQuery={(val) => ({ name: val })}
+            />
+        </ReferenceInput>,
+        <AutocompleteInput
+            choices={dicts}
+            optionText="label"
+            label="table.field.loc.useStatus"
+            source="useStatus"
+            optionValue="value"
+            parse={v => v}
+            alwaysOn
+        />,
+        <TextInput source="code" label="table.field.loc.code" />,
+        <TextInput source="type" label="table.field.loc.type" />,
+        <TextInput source="name" label="table.field.loc.name" />,
+        <NumberInput source="flagLogic" label="table.field.loc.flagLogic" />,
+        <TextInput source="fucAtrrs" label="table.field.loc.fucAtrrs" />,
+        <TextInput source="barcode" label="table.field.loc.barcode" />,
+        <TextInput source="unit" label="table.field.loc.unit" />,
+        <TextInput source="size" label="table.field.loc.size" />,
+        <NumberInput source="row" label="table.field.loc.row" />,
+        <NumberInput source="col" label="table.field.loc.col" />,
+        <NumberInput source="lev" label="table.field.loc.lev" />,
+        <NumberInput source="channel" label="table.field.loc.channel" />,
+        <NumberInput source="maxParts" label="table.field.loc.maxParts" />,
+        <NumberInput source="maxPack" label="table.field.loc.maxPack" />,
+        <NumberInput source="flagLabelMange" label="table.field.loc.flagLabelMange" />,
+        <TextInput source="locAttrs" label="table.field.loc.locAttrs" />,
+
+        <TextInput label="common.field.memo" source="memo" />,
+        <SelectInput
+            label="common.field.status"
+            source="status"
+            choices={[
+                { id: '1', name: 'common.enums.statusTrue' },
+                { id: '0', name: 'common.enums.statusFalse' },
+            ]}
+            resettable
+        />,
+    ]
 
     return (
         <Box display="flex">
@@ -183,7 +193,7 @@
                     }
                     onClick={() => { }} />}
                 filters={filters}
-                sort={{ field: "create_time", order: "desc" }}
+                sort={{ field: "'row'" }}
                 actions={(
                     <TopToolbar>
                         <FilterButton />
@@ -211,18 +221,19 @@
                         </>
                     }
                     rowClick={() => false}
-                    omit={['id', 'createTime', 'createBy', 'memo', 'updateTime', 'updateBy']}
+                    omit={['id', 'createTime', 'createBy', 'memo', 'updateTime', 'updateBy', 'length', 'width', 'height', 'statusBool', 'updateBy$', 'createBy$']}
                 >
                     <NumberField source="id" />
+                    <TextField source="code" label="table.field.loc.code" />
                     <NumberField source="warehouseId$" label="table.field.loc.warehouseId" />
                     <NumberField source="areaId$" label="table.field.loc.areaId" />
-                    <TextField source="code" label="table.field.loc.code" />
                     <TextField source="typeIds$" label="table.field.loc.type" cellClassName="type" />
                     {/* <TextField source="name" label="table.field.loc.name" /> */}
                     {/* <NumberField source="flagLogic" label="table.field.loc.flagLogic" />
                     <TextField source="fucAtrrs" label="table.field.loc.fucAtrrs" />
-                    <TextField source="barcode" label="table.field.loc.barcode" /> */}
+                    */}
                     {/* <TextField source="unit" label="table.field.loc.unit" /> */}
+                    <TextField source="barcode" label="table.field.loc.barcode" />
                     <TextField source="length" label="table.field.loc.length" />
                     <TextField source="width" label="table.field.loc.width" />
                     <TextField source="height" label="table.field.loc.height" />
@@ -236,9 +247,9 @@
                     <NumberField source="flagLabelMange" label="table.field.loc.flagLabelMange" />
                     <TextField source="locAttrs" label="table.field.loc.locAttrs" /> */}
                     <TextField source="useStatus$" label="table.field.loc.useStatus" />
-                    <TextField source="updateBy$" label="common.field.updateBy"  />
+                    <TextField source="updateBy$" label="common.field.updateBy" />
                     <DateField source="updateTime" label="common.field.updateTime" showTime align="left" />
-                    <TextField source="createBy$" label="common.field.createBy"  />
+                    <TextField source="createBy$" label="common.field.createBy" />
                     <DateField source="createTime" label="common.field.createTime" showTime align="left" />
                     <BooleanField source="statusBool" label="common.field.status" sortable={false} align="left" />
                     <TextField source="memo" label="common.field.memo" sortable={false} />
@@ -250,8 +261,8 @@
 
                 </StyledDatagrid>
                 <InitModal
-                open={initDialog}
-                setOpen={setInitDialog}
+                    open={initDialog}
+                    setOpen={setInitDialog}
                 />
             </List>
             <LocCreate
@@ -264,8 +275,8 @@
                 setDrawerVal={setDrawerVal}
             >
             </PageDrawer>
-            
-            
+
+
         </Box>
     )
 }

--
Gitblit v1.9.1