From 2dbe2c8b830a3b006b1536c7dac48b5f8c24e00d Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期一, 28 四月 2025 16:53:07 +0800 Subject: [PATCH] #wms端生成任务优化 --- rsf-admin/src/page/waitPakin/WaitPakinList.jsx | 97 +++++++++++++++++++++--------------------------- 1 files changed, 43 insertions(+), 54 deletions(-) diff --git a/rsf-admin/src/page/waitPakin/WaitPakinList.jsx b/rsf-admin/src/page/waitPakin/WaitPakinList.jsx index 11405c2..c593b01 100644 --- a/rsf-admin/src/page/waitPakin/WaitPakinList.jsx +++ b/rsf-admin/src/page/waitPakin/WaitPakinList.jsx @@ -37,16 +37,13 @@ import { Box, Typography, Card, Stack } from '@mui/material'; import { styled } from '@mui/material/styles'; import WaitPakinCreate from "./WaitPakinCreate"; -import WaitPakinPanel from "./WaitPakinPanel"; +import ConfirmButton from "../components/ConfirmButton"; import EmptyData from "../components/EmptyData"; -import MyCreateButton from "../components/MyCreateButton"; import MyExportButton from '../components/MyExportButton'; import PageDrawer from "../components/PageDrawer"; -import MyField from "../components/MyField"; import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; -import * as Common from '@/utils/common'; import AddIcon from '@mui/icons-material/Add'; -import request from '@/utils/request'; +import SelectSiteModel from "./SelectSiteModel"; const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ '& .css-1vooibu-MuiSvgIcon-root': { @@ -57,17 +54,17 @@ }, '& .column-name': { }, + '& .column-statusBool': { + width: 90 + }, '& .opt': { - width: 200 + width: 180 }, })); const filters = [ <SearchInput source="condition" alwaysOn />, - <TextInput source="code" label="table.field.waitPakin.code" />, - <NumberInput source="ansId" label="table.field.waitPakin.ansId" />, - <TextInput source="asnCode" label="table.field.waitPakin.asnCode" />, <TextInput source="barcode" label="table.field.waitPakin.barcode" />, <NumberInput source="anfme" label="table.field.waitPakin.anfme" />, <SelectInput source="ioStatus" label="table.field.waitPakin.ioStatus" @@ -76,7 +73,6 @@ { id: 1, name: ' 鍏ュ簱涓�' }, ]} />, - <TextInput label="common.field.memo" source="memo" />, <SelectInput label="common.field.status" @@ -91,13 +87,39 @@ const WaitPakinList = () => { const translate = useTranslate(); - const [createDialog, setCreateDialog] = useState(false); + const [siteDialog, setSiteDialog] = useState(false); + const [source, setSource] = useState(false); const [drawerVal, setDrawerVal] = useState(false); + const CreateTaskButton = () => { + const record = useRecordContext(); + const notify = useNotify(); + const refresh = useRefresh(); + const { selectedIds, onUnselectItems, data } = useListContext(); + const rows = data.filter(map => selectedIds.includes(map.id)); + const createTask = () => { + setSiteDialog(true) + setSource(rows) + refresh() + } + + return ( + <> + <Button onClick={() => createTask()} label={"toolbar.createTask"}> + <AddIcon /> + </Button> + </> + ) + } + + const BulkActionButtons = () => { + + } return ( <Box display="flex"> <List + resource="waitPakin" sx={{ flexGrow: 1, transition: (theme) => @@ -113,7 +135,6 @@ actions={( <TopToolbar> <FilterButton /> - {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} <SelectColumnsButton preferenceKey='waitPakin' /> <MyExportButton /> </TopToolbar> @@ -122,36 +143,31 @@ > <StyledDatagrid preferenceKey='waitPakin' - bulkActionButtons={<> <CreateTaskButton /> <BulkDeleteButton mutationMode={OPERATE_MODE} /></>} - rowClick={(id, resource, record) => false} - expand={() => <WaitPakinPanel />} - expandSingle={true} + bulkActionButtons={ + <> + <CreateTaskButton /> + <BulkDeleteButton mutationMode={OPERATE_MODE} /> + </>} + rowClick='edit' omit={['id', 'createTime', 'createBy', 'memo']} > <NumberField source="id" /> <TextField source="code" label="table.field.waitPakin.code" /> - {/* <NumberField source="ansId" label="table.field.waitPakin.ansId" /> */} - {/* <TextField source="asnCode" label="table.field.waitPakin.asnCode" /> */} <TextField source="barcode" label="table.field.waitPakin.barcode" /> <NumberField source="anfme" label="table.field.waitPakin.anfme" /> <TextField source="ioStatus$" label="table.field.waitPakin.ioStatus" sortable={false} /> - - <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> - <TextField source="nickname" /> - </ReferenceField> + <TextField source="updateBy$" label="common.field.updateBy" /> <DateField source="updateTime" label="common.field.updateTime" showTime /> - <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> - <TextField source="nickname" /> - </ReferenceField> <DateField source="createTime" label="common.field.createTime" showTime /> <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"> - {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} - <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> + <EditButton label="toolbar.detail" sx={{ padding: '1px', fontSize: '.75rem' }} /> + {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} </WrapperField> </StyledDatagrid> </List> + <SelectSiteModel open={siteDialog} setOpen={setSiteDialog} source={source} /> <WaitPakinCreate open={createDialog} setOpen={setCreateDialog} @@ -168,31 +184,4 @@ export default WaitPakinList; -const CreateTaskButton = () => { - const record = useRecordContext(); - const notify = useNotify(); - const refresh = useRefresh(); - const { selectedIds, onUnselectItems, data } = useListContext(); - const createTask = async () => { - const rows = data.filter((item) => selectedIds.includes(item.id)) || []; - const res = await request.post(`/waitPakin/merge`, rows); - if (res?.data?.code === 200) { - refresh() - notify(res.data.msg); - } else { - notify(res.data.msg); - } - } - - return ( - <> - <Button onClick={() => createTask()} label={"toolbar.createTask"}> - <AddIcon /> - </Button> - - - </> - - ) -} -- Gitblit v1.9.1