From c8fde8647b48e7c7d9b3beb6e8c39459f07c9eb2 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 08 五月 2025 14:55:46 +0800
Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop

---
 rsf-admin/src/page/waitPakin/WaitPakinList.jsx |   37 ++++++++++++++++++++++++++-----------
 1 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/rsf-admin/src/page/waitPakin/WaitPakinList.jsx b/rsf-admin/src/page/waitPakin/WaitPakinList.jsx
index c306d20..82dfe95 100644
--- a/rsf-admin/src/page/waitPakin/WaitPakinList.jsx
+++ b/rsf-admin/src/page/waitPakin/WaitPakinList.jsx
@@ -58,15 +58,13 @@
         width: 90
     },
     '& .opt': {
-        width: 180
+        width: 210
     },
 }));
 
 const filters = [
     <SearchInput source="condition" alwaysOn />,
     <TextInput source="code" label="table.field.waitPakin.code" />,
-    <NumberInput source="ansId" label="table.field.waitPakin.ansId" />,
-    <TextInput source="asnCode" label="table.field.waitPakin.asnCode" />,
     <TextInput source="barcode" label="table.field.waitPakin.barcode" />,
     <NumberInput source="anfme" label="table.field.waitPakin.anfme" />,
     <SelectInput source="ioStatus" label="table.field.waitPakin.ioStatus"
@@ -95,7 +93,7 @@
     const [drawerVal, setDrawerVal] = useState(false);
 
     const CreateTaskButton = () => {
-        const record = useRecordContext();
+        const record = useRecordContext();        
         const notify = useNotify();
         const refresh = useRefresh();
         const { selectedIds, onUnselectItems, data } = useListContext();
@@ -103,6 +101,7 @@
         const createTask = () => {
             setSiteDialog(true)
             setSource(rows)
+            onUnselectItems()
             refresh()
         }
 
@@ -115,10 +114,25 @@
         )
     }
 
-    const BulkActionButtons = () => {
+    const CreateTaskRowButton = () => {
+        const record = useRecordContext();        
+        const refresh = useRefresh();
 
+        const createTask = (event) => {
+            event.stopPropagation();
+            setSiteDialog(true)
+            setSource([record])
+            refresh()
+        }
+    
+        return (
+            <>
+                <Button onClick={(event) => createTask(event)} label={"toolbar.createTask"}>
+                    <AddIcon />
+                </Button>
+            </>
+        )
     }
-
 
     return (
         <Box display="flex">
@@ -133,7 +147,7 @@
                     marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
                 }}
                 title={"menu.waitPakin"}
-                empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
+                empty={false}
                 filters={filters}
                 sort={{ field: "create_time", order: "desc" }}
                 actions={(
@@ -150,15 +164,13 @@
                     bulkActionButtons={
                         <>
                             <CreateTaskButton />
-                            <BulkDeleteButton mutationMode={OPERATE_MODE} />
+                            {/* <BulkDeleteButton mutationMode={OPERATE_MODE} /> */}
                         </>}
                     rowClick='edit'
                     omit={['id', 'createTime', 'createBy', 'memo']}
                 >
                     <NumberField source="id" />
                     <TextField source="code" label="table.field.waitPakin.code" />
-                    {/* <NumberField source="ansId" label="table.field.waitPakin.ansId" /> */}
-                    {/* <TextField source="asnCode" label="table.field.waitPakin.asnCode" /> */}
                     <TextField source="barcode" label="table.field.waitPakin.barcode" />
                     <NumberField source="anfme" label="table.field.waitPakin.anfme" />
                     <TextField source="ioStatus$" label="table.field.waitPakin.ioStatus" sortable={false} />
@@ -169,7 +181,8 @@
                     <TextField source="memo" label="common.field.memo" sortable={false} />
                     <WrapperField cellClassName="opt" label="common.field.opt">
                         <EditButton label="toolbar.detail" sx={{ padding: '1px', fontSize: '.75rem' }} />
-                        {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */}
+                        <CreateTaskRowButton />
+                        <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                     </WrapperField>
                 </StyledDatagrid>
             </List>
@@ -191,3 +204,5 @@
 export default WaitPakinList;
 
 
+
+

--
Gitblit v1.9.1