From c46d1d8c3b9875f051a6ec3c4a1d3fa7bd32e5db Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 15 五月 2025 17:15:21 +0800
Subject: [PATCH] 新增库存管理 新增库存明细

---
 rsf-admin/src/page/orders/outStock/OutOrderList.jsx |   57 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/rsf-admin/src/page/orders/outStock/OutOrderList.jsx b/rsf-admin/src/page/orders/outStock/OutOrderList.jsx
index 58bb153..fc4bb37 100644
--- a/rsf-admin/src/page/orders/outStock/OutOrderList.jsx
+++ b/rsf-admin/src/page/orders/outStock/OutOrderList.jsx
@@ -51,11 +51,12 @@
 import DictionarySelect from "../../components/DictionarySelect";
 import ImportButton from "../../components/ImportButton";
 import DetailsIcon from '@mui/icons-material/Details';
-import CancelIcon from '@mui/icons-material/Cancel';
+import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined';
 import OutOrderCreate from "./OutOrderCreate";
 import AddIcon from '@mui/icons-material/Add';
 import OutOrderModal from "./OutOrderModal";
 import PublicIcon from '@mui/icons-material/Public';
+import SelectMatnrModal from "./SelectMatnrModal";
 
 const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
   '& .css-1vooibu-MuiSvgIcon-root': {
@@ -82,10 +83,10 @@
   <TextInput source="code" label="table.field.outStock.code" alwaysOn />,
   <TextInput source="poCode" label="table.field.outStock.poCode" />,
   <NumberInput source="poId" label="table.field.outStock.poId" />,
-  <ReferenceInput source="type" reference="dictData" filter={{ dictTypeCode: 'sys_business_type' }} label="table.field.outStock.type" alwaysOn>
+  <ReferenceInput source="type" reference="dictData" filter={{ dictTypeCode: 'sys_order_type', group: '2' }} label="table.field.outStock.type" alwaysOn>
     <AutocompleteInput label="table.field.outStock.type" optionValue="value" />
   </ReferenceInput>,
-  <ReferenceInput source="wkType" reference="dictData" filter={{ dictTypeCode: 'sys_business_type' }} label="table.field.outStock.wkType" alwaysOn>
+  <ReferenceInput source="wkType" reference="dictData" filter={{ dictTypeCode: 'sys_business_type', group: '2'}} label="table.field.outStock.wkType" alwaysOn>
     <AutocompleteInput label="table.field.outStock.wkType" optionValue="value" />
   </ReferenceInput>,
   <NumberInput source="anfme" label="table.field.outStock.anfme" />,
@@ -139,7 +140,7 @@
           <TopToolbar>
             <FilterButton />
             <CreateByOrderButton setCreateDialog={setCreateDialog} />
-            <MyCreateButton onClick={() => { setManualDialog(true) }} />
+            <MyCreateButton onClick={() => { setManualDialog(true); setmodalType(0) }} />
             <SelectColumnsButton preferenceKey='outStock' />
             <ImportButton value={'asnOrderItem'} />
             {/* <MyExportButton /> */}
@@ -151,12 +152,7 @@
           sx={{ width: '100%' }}
           preferenceKey='outStock'
           bulkActionButtons={
-            <>
-              <PublicTaskButton />
-              <MyExportButton />
-              <BulkDeleteButton mutationMode={OPERATE_MODE}
-              />
-            </>}
+            <PublicTaskButton />}
           rowClick={false}
           expandSingle={true}
           omit={['id', 'createTime', 'createBy', 'memo', 'poId', 'rleStatus$']}
@@ -178,13 +174,19 @@
           <BillStatusField cellClassName="status" source="exceStatus" label="table.field.outStock.exceStatus" />
           <TextField source="memo" label="common.field.memo" sortable={false} />
           <WrapperField cellClassName="opt" label="common.field.opt" >
+            <MyButton setCreateDialog={setManualDialog} setmodalType={setmodalType} />
             <EditButton label="toolbar.detail" icon={(<DetailsIcon />)}></EditButton>
-            {/* <MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} /> */}
-            <CancelButton></CancelButton>
+            <CancelButton />
           </WrapperField>
         </StyledDatagrid>
       </List>
-      <OutOrderCreate
+      {/* <OutOrderCreate
+        open={manualDialog}
+        setOpen={setManualDialog}
+      /> */}
+      <SelectMatnrModal
+        asnId={modalType}
+        billReload={billReload}
         open={manualDialog}
         setOpen={setManualDialog}
       />
@@ -196,8 +198,7 @@
         title='AsnOrder Detail'
         drawerVal={drawerVal}
         setDrawerVal={setDrawerVal}
-      >
-      </PageDrawer>
+      />
     </Box >
   )
 }
@@ -207,11 +208,21 @@
 const PublicTaskButton = () => {
   const record = useRecordContext();
   const { selectedIds, onUnselectItems } = useListContext();
+  const notify = useNotify();
+  const refresh = useRefresh();
+  const redirect = useRedirect();
 
-  const pubClick = (event) => {
+  const pubClick = async (event) => {
     event.stopPropagation();
     onUnselectItems();
-
+    const res = await request.post(`/outStock/generate/wave`, { ids: selectedIds });
+    if (res?.data?.code === 200) {
+      notify(res.data.msg);
+      redirect("/wave")
+    } else {
+      notify(res.data.msg);
+    }
+    refresh();
   }
 
   return (
@@ -248,29 +259,19 @@
   const refresh = useRefresh();
 
   const createByOrder = async (event) => {
-    const {selectedIds, onUnselectItems} = useListContext();
     event.stopPropagation();
     setCreateDialog(true);
-    const res = await request.post(`/outStock/generate/wave`, { ids: selectedIds });
-    if (res?.data?.code === 200) {
-      notify(res.data.msg);
-    } else {
-      notify(res.data.msg);
-    }
-
   }
 
   return (
     <Button onClick={createByOrder} label={'toolbar.asnCreate'}> <AddIcon /> </Button>
   )
-
 }
 
 const CancelButton = () => {
   const record = useRecordContext();
   const notify = useNotify();
   const refresh = useRefresh();
-
   const cancelOrder = async () => {
     const { data: { code, data, msg } } = await request.get(`/outStock/cancel/${record?.id}`);
     if (code === 200) {
@@ -282,6 +283,6 @@
   }
 
   return (
-    <ConfirmButton label={"toolbar.cancel"} startIcon={<CancelIcon />} onConfirm={cancelOrder} />
+     record?.exceStatus == 0 ? <ConfirmButton label={"toolbar.cancel"} startIcon={<CancelOutlinedIcon />  } onConfirm={cancelOrder} /> : <></>
   )
 }

--
Gitblit v1.9.1