From cb2339b2f1530132659c8c320cfdd91ee7f68c61 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 31 七月 2025 12:47:28 +0800
Subject: [PATCH] 调拔单功能优化 库位编辑更新不生效问题修复

---
 rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx |   35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx b/rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx
index 45a4e4d..2fed32b 100644
--- a/rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx
+++ b/rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx
@@ -31,6 +31,9 @@
     ReferenceArrayInput,
     AutocompleteInput,
     DeleteButton,
+    useRefresh,
+    Button,
+    useList
 } from 'react-admin';
 import { Box, Typography, Card, Stack } from '@mui/material';
 import { styled } from '@mui/material/styles';
@@ -42,6 +45,8 @@
 import PageDrawer from "../../components/PageDrawer";
 import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
 import * as Common from '@/utils/common';
+import BindModal from "./BindModal";
+import LinkIcon from '@mui/icons-material/Link';
 
 const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
     '& .css-1vooibu-MuiSvgIcon-root': {
@@ -109,9 +114,12 @@
             >
                 <StyledDatagrid
                     preferenceKey='locType'
-                    bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />}
+                    bulkActionButtons={<>
+                        <BindButton />
+                        <BulkDeleteButton />
+                    </>}
                     rowClick={(id, resource, record) => false}
-                    omit={['id', 'createTime', 'createBy', 'memo']}
+                    omit={['id', 'createTime', 'createBy', 'memo','statusBool','updateBy']}
                 >
                     <NumberField source="id" />
                     {/* <TextField source="uuid" label="table.field.locType.uuid" /> */}
@@ -150,3 +158,26 @@
 }
 
 export default LocTypeList;
+
+const BindButton = () => {
+    const record = useRecordContext();
+    const notify = useNotify();
+    const refresh = useRefresh();
+
+
+    const [createDialog, setCreateDialog] = useState(false);
+
+    return (
+        <>
+            <Button onClick={() => setCreateDialog(true)} label={"toolbar.bindmatnr"}>
+                <LinkIcon />
+            </Button>
+
+            <BindModal
+                open={createDialog}
+                setOpen={setCreateDialog}
+            />
+        </>
+
+    )
+}

--
Gitblit v1.9.1