From 37467bf7d119ef9b599f1c19b869d046d730b7cb Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期日, 27 四月 2025 18:27:56 +0800
Subject: [PATCH] 修改优化   1. 波次生成修改优化    2. 出库库位查找 优化

---
 rsf-admin/src/page/orders/wave/WaveList.jsx |   44 +++++++++++++++++---------------------------
 1 files changed, 17 insertions(+), 27 deletions(-)

diff --git a/rsf-admin/src/page/orders/wave/WaveList.jsx b/rsf-admin/src/page/orders/wave/WaveList.jsx
index 73596e2..c1af1e3 100644
--- a/rsf-admin/src/page/orders/wave/WaveList.jsx
+++ b/rsf-admin/src/page/orders/wave/WaveList.jsx
@@ -48,6 +48,8 @@
 import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
 import * as Common from '@/utils/common';
 import PublicIcon from '@mui/icons-material/Public';
+import ItemToTaskModal from "./ItemToTaskModal";
+import ConfirmButton from "../../components/ConfirmButton";
 
 
 const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
@@ -60,7 +62,7 @@
     '& .column-name': {
     },
     '& .opt': {
-        width: 200
+        width: 260
     },
 }));
 
@@ -68,7 +70,6 @@
     <SearchInput source="condition" alwaysOn />,
     <DateInput label='common.time.after' source="timeStart" alwaysOn />,
     <DateInput label='common.time.before' source="timeEnd" alwaysOn />,
-
     <TextInput source="code" label="table.field.wave.code" />,
     <SelectInput source="type" label="table.field.wave.type"
         choices={[
@@ -87,7 +88,6 @@
     <NumberInput source="anfme" label="table.field.wave.anfme" />,
     <NumberInput source="qty" label="table.field.wave.qty" />,
     <NumberInput source="orderNum" label="table.field.wave.orderNum" />,
-
     <TextInput label="common.field.memo" source="memo" />,
     <SelectInput
         label="common.field.status"
@@ -103,6 +103,8 @@
 const WaveList = () => {
     const translate = useTranslate();
     const [createDialog, setCreateDialog] = useState(false);
+    const [detailDialog, setDetailDialog] = useState(false);
+    const [select, setSelectIds] = useState({});
     const [drawerVal, setDrawerVal] = useState(false);
 
     return (
@@ -130,9 +132,7 @@
             >
                 <StyledDatagrid
                     preferenceKey='wave'
-                    bulkActionButtons={
-                        <PublicTaskButton />
-                    }
+                    bulkActionButtons={false}
                     rowClick={(id, resource, record) => false}
                     expand={false}
                     expandSingle={false}
@@ -152,11 +152,17 @@
                     <BooleanField source="statusBool" label="common.field.status" sortable={false} />
                     <TextField source="memo" label="common.field.memo" sortable={false} />
                     <WrapperField cellClassName="opt" label="common.field.opt">
+                        <PublicTaskButton setSelectIds={setSelectIds} setDetailDialog={setDetailDialog} />
                         <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
                         <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                     </WrapperField>
                 </StyledDatagrid>
             </List>
+            <ItemToTaskModal
+                open={detailDialog}
+                record={select}
+                setOpen={setDetailDialog}
+            />
             <WaveCreate
                 open={createDialog}
                 setOpen={setCreateDialog}
@@ -173,32 +179,16 @@
 
 export default WaveList;
 
-const PublicTaskButton = () => {
+const PublicTaskButton = ({ setSelectIds, setDetailDialog }) => {
     const record = useRecordContext();
-    const { selectedIds, onUnselectItems } = useListContext();
     const notify = useNotify();
     const refresh = useRefresh();
     const redirect = useRedirect();
-
     const pubClick = async (event) => {
-        event.stopPropagation();
-        console.log('=========>');
-        
-        onUnselectItems();
-        const res = await request.post(`/wave/public/task`, { ids: selectedIds });
-        if (res?.data?.code === 200) {
-            notify(res.data.msg);
-            redirect("/task")
-        } else {
-            notify(res.data.msg);
-        }
-        refresh();
+        setSelectIds(record);
+        setDetailDialog(true);
     }
-
     return (
-        <Button
-            onClick={pubClick}
-            label={"toolbar.createTask"}
-            startIcon={<PublicIcon />}
-        />);
+        <ConfirmButton label={"toolbar.createTask"} startIcon={<PublicIcon />} onConfirm={pubClick} />
+    );
 }
\ No newline at end of file

--
Gitblit v1.9.1