From 646bfdde5c37f0b0d479bbcbc7503bc8482e67d6 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期一, 30 六月 2025 16:41:00 +0800
Subject: [PATCH] 可针对单个波次进行暂停,开始, 主单添加进度条
---
rsf-admin/src/page/orders/wave/WaveItemList.jsx | 31 +++++++++++--------------------
1 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/rsf-admin/src/page/orders/wave/WaveItemList.jsx b/rsf-admin/src/page/orders/wave/WaveItemList.jsx
index 7dfda50..b9649a9 100644
--- a/rsf-admin/src/page/orders/wave/WaveItemList.jsx
+++ b/rsf-admin/src/page/orders/wave/WaveItemList.jsx
@@ -6,37 +6,26 @@
SearchInput,
TopToolbar,
SelectColumnsButton,
- EditButton,
FilterButton,
- CreateButton,
- ExportButton,
- BulkDeleteButton,
WrapperField,
useRecordContext,
useTranslate,
useNotify,
useListContext,
- FunctionField,
TextField,
NumberField,
DateField,
- BooleanField,
- ReferenceField,
TextInput,
- DateTimeInput,
DateInput,
SelectInput,
NumberInput,
- ReferenceInput,
- ReferenceArrayInput,
- AutocompleteInput,
- DeleteButton,
useGetRecordId,
Button,
useRefresh,
} from 'react-admin';
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
import PauseCircleOutlineIcon from '@mui/icons-material/PauseCircleOutline';
+import StopCircleOutlinedIcon from '@mui/icons-material/StopCircleOutlined';
import PlayArrowOutlinedIcon from '@mui/icons-material/PlayArrowOutlined';
import { Box, Typography, Card, Stack } from '@mui/material';
import ContentCreate from '@mui/icons-material/Create';
@@ -150,7 +139,7 @@
<TextField source="memo" label="common.field.memo" sortable={false} />
<TextField source="exceStatus$" label="table.field.waveItem.exceStatus" />
<WrapperField cellClassName="opt" label="common.field.opt">
- <BulkPauseButton />
+ <PauseButton />
<ContinueButton />
</WrapperField>
</StyledDatagrid>
@@ -209,36 +198,38 @@
)
}
-const BulkPauseButton = () => {
- const { data, selectedIds, onUnselectItems } = useListContext();
+const PauseButton = () => {
const notify = useNotify()
+ const refresh = useRefresh();
const record = useRecordContext();
const pauseClick = async () => {
- const { data: { code, data, msg } } = await request.post('/waveItem/pause/pub', { wave: waveId, waveItem: selectedIds });
+ const { data: { code, data, msg } } = await request.post('/waveItem/pause/pub/' + record?.id);
if (code === 200) {
notify(msg);
} else {
notify(msg);
}
+ refresh()
}
return (
- record?.exceStatus == 1 ? <Button label="toolbar.pause" onClick={pauseClick} startIcon={<PauseCircleOutlineIcon />} /> : <></>
+ record?.exceStatus == 1 ? <Button label="toolbar.pause" onClick={pauseClick} startIcon={<StopCircleOutlinedIcon />} /> : <></>
)
}
const ContinueButton = () => {
- const { data, selectedIds, onUnselectItems } = useListContext();
const notify = useNotify()
+ const refresh = useRefresh();
const record = useRecordContext();
const continueClick = async () => {
- const { data: { code, data, msg } } = await request.post('/waveItem/continue/pub', { wave: waveId, waveItem: selectedIds });
+ const { data: { code, data, msg } } = await request.post('/waveItem/continue/pub/' + record?.id);
if (code === 200) {
notify(msg);
} else {
notify(msg);
}
+ refresh()
}
return (
- record?.exceStatus == 4 ? <Button label="toolbar.continuePub" onClick={continueClick} startIcon={<PauseCircleOutlineIcon />} /> : <></>
+ record?.exceStatus == 2 ? <Button label="toolbar.continuePub" onClick={continueClick} startIcon={<PauseCircleOutlineIcon />} /> : <></>
)
}
\ No newline at end of file
--
Gitblit v1.9.1