From cc2984eeb289b54cfa193dde558417c46f309e8f Mon Sep 17 00:00:00 2001
From: DESKTOP-LMJ82IJ\Eno <creaycat@gmail.com>
Date: 星期日, 13 四月 2025 19:32:38 +0800
Subject: [PATCH] #修改 1. 采购单界面优化及修改

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

diff --git a/rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx b/rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx
index 5b30be7..5fd0003 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,15 +114,17 @@
             >
                 <StyledDatagrid
                     preferenceKey='locType'
-                    bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />}
+                    bulkActionButtons={<>
+                        <BindButton />
+                        <BulkDeleteButton />
+                    </>}
                     rowClick={(id, resource, record) => false}
-                    expand={() => <LocTypePanel />}
-                    expandSingle={true}
                     omit={['id', 'createTime', 'createBy', 'memo']}
                 >
                     <NumberField source="id" />
                     {/* <TextField source="uuid" label="table.field.locType.uuid" /> */}
                     <TextField source="name" label="table.field.locType.name" />
+                    <TextField source="code" label="table.field.locType.code" />
                     <TextField source="regex" label="table.field.locType.regex" />
 
                     <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}>
@@ -151,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