From 23dbf6d954141c2e6c589248a409f308dbc138f0 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 14 五月 2025 09:13:40 +0800
Subject: [PATCH] #Agv入库
---
rsf-admin/src/page/orders/wave/WaveList.jsx | 45 ++++++++++++++++++---------------------------
1 files changed, 18 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..eec93fe 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,17 @@
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 />}
- />);
+ record?.exceStatus == 0 ? <ConfirmButton label={"toolbar.createTask"} startIcon={<PublicIcon /> } onConfirm={pubClick} size='small' /> : <></>
+ );
}
\ No newline at end of file
--
Gitblit v1.9.1