From 53eb9e72f7fff791c2d1f7a768441035b57ca7b1 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 25 三月 2025 11:23:55 +0800
Subject: [PATCH] Merge branch 'front' into devlop

---
 rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx |   64 +++++++++++++++++++++++++++++---
 1 files changed, 58 insertions(+), 6 deletions(-)

diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
index 98e6a0c..9bf7cfc 100644
--- a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
+++ b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
@@ -54,7 +54,10 @@
 import PrintIcon from '@mui/icons-material/Print';
 import request from '@/utils/request';
 import BatchModal from './BatchModal';
+import BatchGropuModal from './BatchGropuModal';
 import PrintModal from './PrintModal';
+import LinkIcon from '@mui/icons-material/Link';
+import BindModal from './BindModal';
 
 const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
     '& .css-1vooibu-MuiSvgIcon-root': {
@@ -84,10 +87,11 @@
         overflow: 'hidden',
         textOverflow: 'ellipsis',
         display: 'block',
-        width: '100px',
+        width: '200px',
     },
     '& .RaDatagrid-table': {
-        width: '100%'
+        width: '100%',
+        position: 'relative',
     }
 }));
 
@@ -156,7 +160,6 @@
 
     const [columns, setColumns] = useState([]);
     const refresh = useRefresh();
-    const { refetch } = useListContext();
 
     useEffect(() => {
         getDynamicFields();
@@ -186,7 +189,7 @@
                     <TextField key="purchaseUnit" source="purchaseUnit" label="table.field.matnr.purUnit" />,
                     <TextField key="stockUnit" source="stockUnit" label="table.field.matnr.stockUnit" />,
                     <TextField key="stockLeval$" source="stockLeval$" label="table.field.matnr.stockLevel" sortable={false} />,
-                    <TextField key="isLabelMange$" source="isLabelMange$" label="table.field.matnr.isLabelMange" sortable={false} />,
+                    <TextField key="flagLabelMange$" source="flagLabelMange$" label="table.field.matnr.isLabelMange" sortable={false} />,
                     <NumberField key="safeQty" source="safeQty" label="table.field.matnr.safeQty" />,
                     <NumberField key="minQty" source="minQty" label="table.field.matnr.minQty" />,
                     <NumberField key="maxQty" source="maxQty" label="table.field.matnr.maxQty" />,
@@ -206,7 +209,7 @@
                     <TextField key="memo" source="memo" label="common.field.memo" sortable={false} />,
                 ]
                 const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />)
-                const opt = <WrapperField key="opt" cellClassName="opt" label="common.field.opt">
+                const opt = <WrapperField key="opt" cellClassName="fixed" className="fixed" label="common.field.opt">
                     <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
                     <EnableButton />
                 </WrapperField>
@@ -238,7 +241,9 @@
                 <StyledDatagrid
                     preferenceKey='matnr'
                     bulkActionButtons={<>
+                        <BatchGroupButton />
                         <BatchButton />
+                        <BindButton />
                         <PrintButton />
                         <BulkDeleteButton mutationMode={OPERATE_MODE} />
                     </>}
@@ -246,7 +251,7 @@
                     omit={['id', 'shipperId', 'platCode', 'spec', 'model', 'weight', 'color', 'describle'
                         , 'nromNum', 'unit', 'purchaseUnit', 'stockUnit', 'stockLeval', 'isLabelMange', 'safeQty'
                         , 'minQty', 'maxQty', 'stagn', 'valid', 'validWarn', 'flagCheck', 'updateTime', 'updateBy'
-                        , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId', 'stockLevel', 'isLabelMange']}
+                        , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId', 'stockLevel']}
                 >
                     {columns.map((column) => column)}
                 </StyledDatagrid>}
@@ -358,8 +363,32 @@
     )
 }
 
+const BatchGroupButton = () => {
+    const record = useRecordContext();
+    const notify = useNotify();
+    const refresh = useRefresh();
+
+
+    const [createDialog, setCreateDialog] = useState(false);
+
+    return (
+        <>
+            <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchMatnrGropu"}>
+                <EditIcon />
+            </Button>
+
+            <BatchGropuModal
+                open={createDialog}
+                setOpen={setCreateDialog}
+            />
+        </>
+
+    )
+}
+
 const PrintButton = () => {
     const record = useRecordContext();
+    const { resource, selectedIds } = useListContext();
     const notify = useNotify();
     const refresh = useRefresh();
 
@@ -374,6 +403,29 @@
             <PrintModal
                 open={createDialog}
                 setOpen={setCreateDialog}
+                rows={selectedIds}
+            />
+        </>
+    )
+}
+
+const BindButton = () => {
+    const record = useRecordContext();
+    const notify = useNotify();
+    const refresh = useRefresh();
+
+
+    const [createDialog, setCreateDialog] = useState(false);
+
+    return (
+        <>
+            <Button onClick={() => setCreateDialog(true)} label={"toolbar.bindloc"}>
+                <LinkIcon />
+            </Button>
+
+            <BindModal
+                open={createDialog}
+                setOpen={setCreateDialog}
             />
         </>
 

--
Gitblit v1.9.1