From 0d42706148e164656334d3dbd284daf4f2bf1b30 Mon Sep 17 00:00:00 2001 From: verou <857149855@qq.com> Date: 星期四, 03 四月 2025 16:59:27 +0800 Subject: [PATCH] feat:收货单完成 --- rsf-admin/src/page/asnOrder/AsnOrderList.jsx | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) diff --git a/rsf-admin/src/page/asnOrder/AsnOrderList.jsx b/rsf-admin/src/page/asnOrder/AsnOrderList.jsx index 70af9af..ad77e8f 100644 --- a/rsf-admin/src/page/asnOrder/AsnOrderList.jsx +++ b/rsf-admin/src/page/asnOrder/AsnOrderList.jsx @@ -48,6 +48,7 @@ import ConstructionIcon from "@mui/icons-material/Construction"; import FileDownloadIcon from '@mui/icons-material/FileDownload'; import EditIcon from '@mui/icons-material/Edit'; +import TaskIcon from '@mui/icons-material/Task'; import request from '@/utils/request'; @@ -101,6 +102,7 @@ const [createDialog, setCreateDialog] = useState(false); const [drawerVal, setDrawerVal] = useState(false); const [modalType, setmodalType] = useState(0); + const [billReload, setBillReload] = useState(null); const navigate = useNavigate(); const assign = (record) => { @@ -138,7 +140,7 @@ preferenceKey='asnOrder' bulkActionButtons={<> <InspectionsButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} rowClick={() => false} - expand={<AsnOrderPanel />} + expand={<AsnOrderPanel setBillReload={setBillReload} />} expandSingle={true} omit={['id', 'createTime', 'createBy', 'memo', 'poId']} > @@ -179,6 +181,7 @@ > </Button> */} <InspectionButton /> + <CompleteButton /> <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> </WrapperField> </StyledDatagrid> @@ -187,6 +190,7 @@ open={createDialog} setOpen={setCreateDialog} asnId={modalType} + billReload={billReload} /> <PageDrawer title='AsnOrder Detail' @@ -278,3 +282,26 @@ </Button> ) } + +const CompleteButton = () => { + const record = useRecordContext(); + const notify = useNotify(); + const refresh = useRefresh(); + const requestComplete = async () => { + const { data: { code, data, msg } } = await request.post(`/asnOrder/complete/${record.id}`); + + if (code === 200) { + notify(msg); + refresh() + } else { + notify(msg); + } + } + + + return ( + <Button onClick={requestComplete} label={"toolbar.complete"} color="success"> + <TaskIcon /> + </Button> + ) +} -- Gitblit v1.9.1