From 253e5ad5ec600ea04cc8636dacec1afd895e08fc Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 13 六月 2025 13:21:21 +0800
Subject: [PATCH] 出库顺序优化 代码优化

---
 rsf-admin/src/page/orders/outStock/OutOrderList.jsx |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/rsf-admin/src/page/orders/outStock/OutOrderList.jsx b/rsf-admin/src/page/orders/outStock/OutOrderList.jsx
index e9906a6..955b074 100644
--- a/rsf-admin/src/page/orders/outStock/OutOrderList.jsx
+++ b/rsf-admin/src/page/orders/outStock/OutOrderList.jsx
@@ -5,6 +5,7 @@
   DatagridConfigurable,
   SearchInput,
   TopToolbar,
+  Toolbar,
   SelectColumnsButton,
   EditButton,
   FilterButton,
@@ -36,6 +37,7 @@
   Button,
   useRedirect,
   useUnselectAll,
+  useRecordSelection,
 } from 'react-admin';
 import { Box, Typography, Card, Stack, Drawer } from '@mui/material';
 import { styled } from '@mui/material/styles';
@@ -56,6 +58,7 @@
 import AddTaskIcon from '@mui/icons-material/AddTask';
 import PageEditDrawer from "../../components/PageEditDrawer";
 import OutStockPublic from "./OutStockPublic";
+import OutOrderPreview from "./OutOrderPreview";
 
 const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
   '& .css-1vooibu-MuiSvgIcon-root': {
@@ -113,6 +116,7 @@
   const translate = useTranslate();
   const [createDialog, setCreateDialog] = useState(false);
   const [manualDialog, setManualDialog] = useState(false);
+  const [preview, setPreview] = useState(false);
   const [drawerVal, setDrawerVal] = useState(false);
   const [modalType, setmodalType] = useState(0);
   const [select, setSelect] = useState(0);
@@ -140,8 +144,7 @@
             <CreateByOrderButton setCreateDialog={setCreateDialog} />
             <MyCreateButton onClick={() => { setManualDialog(true); setmodalType(0) }} />
             <SelectColumnsButton preferenceKey='outStock' />
-            <ImportButton value={'outStock'} />
-            {/* <MyExportButton /> */}
+            <ImportButton value={'outStockItem'} />
           </TopToolbar>
         )}
         perPage={DEFAULT_PAGE_SIZE}
@@ -191,13 +194,16 @@
       <OutOrderModal
         open={createDialog}
         setOpen={setCreateDialog}
+        preview={preview} 
+        setPreview={setPreview}
       />
+      <OutOrderPreview open={preview} setOpen={setPreview} />
       <PageEditDrawer
         title={"toolbar.publicWorking"}
         drawerVal={drawerVal}
         setDrawerVal={setDrawerVal}
       >
-        <OutStockPublic record={select} />
+        <OutStockPublic record={select} open={drawerVal} setOpen={setDrawerVal} />
       </PageEditDrawer>
     </Box >
   )
@@ -257,7 +263,6 @@
   const record = useRecordContext();
   const notify = useNotify();
   const refresh = useRefresh();
-
   const createByOrder = async (event) => {
     event.stopPropagation();
     setCreateDialog(true);
@@ -298,6 +303,6 @@
   }
 
   return (
-    <ConfirmButton label={"toolbar.publicWorking"} startIcon={<AddTaskIcon />} onConfirm={taskEvent} size={"small"} />
+    record.workQty < record.anfme ? <Button label={"toolbar.publicWorking"} startIcon={<AddTaskIcon />} onClick={taskEvent} size={"small"} /> : <></>
   )
 }

--
Gitblit v1.9.1