| | |
| | | SelectInput, |
| | | NumberInput, |
| | | Button, |
| | | useListContext, |
| | | useRedirect, |
| | | EditButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack, Drawer } from '@mui/material'; |
| | |
| | | import CancelIcon from '@mui/icons-material/Cancel'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import TaskPanel from "./TaskPanel"; |
| | | import MyField from "../components/MyField"; |
| | | import PublicIcon from '@mui/icons-material/Public'; |
| | | import ConfirmButton from "../components/ConfirmButton"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, AUTO_RUN_CHECK_ORDERS } from '@/config/setting'; |
| | | import PlayArrowOutlinedIcon from '@mui/icons-material/PlayArrowOutlined'; |
| | | import PauseIcon from '@mui/icons-material/Pause'; |
| | | import PauseCircleOutlineIcon from '@mui/icons-material/PauseCircleOutline'; |
| | | import * as Common from '@/utils/common'; |
| | | import ColorizeOutlinedIcon from '@mui/icons-material/ColorizeOutlined'; |
| | | import GradingOutlinedIcon from '@mui/icons-material/GradingOutlined'; |
| | | |
| | |
| | | width: 248 |
| | | }, |
| | | '& .MuiTableCell-root': { |
| | | whiteSpace: 'nowrap', |
| | | overflow: 'visible', |
| | | textOverflow: 'unset' |
| | | whiteSpace: 'nowrap', |
| | | overflow: 'visible', |
| | | textOverflow: 'unset' |
| | | } |
| | | |
| | | })); |
| | |
| | | const refresh = useRefresh(); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [autoExce, setAutoExce] = useState(false); |
| | | const [menuPubExce, setMenuPubExce] = useState(false); |
| | | const dict = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_warehouse_type')) || []; |
| | | |
| | | useEffect(() => { |
| | |
| | | sort={{ field: "sort", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <BulkAutoStartButton autoExce={autoExce} setAutoExce={setAutoExce}/> |
| | | <BulkAutoStartButton autoExce={autoExce} setAutoExce={setAutoExce} /> |
| | | <BulkAutoPauseButton autoExce={autoExce} setAutoExce={setAutoExce} /> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='task' /> |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='task' |
| | | bulkActionButtons={false} |
| | | bulkActionButtons={<PublicTaskButton menuPubExce={menuPubExce} setMenuPubExce={setMenuPubExce} />} |
| | | rowClick={false} |
| | | expand={<TaskPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy$', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status','warehType$']} |
| | | omit={['id', 'createTime', 'createBy$', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status', 'warehType$']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="taskCode" label="table.field.task.taskCode" /> |
| | |
| | | |
| | | export default TaskList; |
| | | |
| | | |
| | | const PublicTaskButton = ({ menuPubExce, setMenuPubExce }) => { |
| | | const record = useRecordContext(); |
| | | const { selectedIds, onUnselectItems } = useListContext(); |
| | | const notify = useNotify(); |
| | | const redirect = useRedirect(); |
| | | const pubClick = async () => { |
| | | onUnselectItems(); |
| | | const { data: { code, data, msg } } = await request.post(`task/menual/exce/` + selectedIds); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh(); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Button |
| | | onClick={pubClick} |
| | | label={"toolbar.publicWorking"} |
| | | startIcon={<PublicIcon />} |
| | | /> |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * 盘点 |
| | | * @returns te |
| | |
| | | |
| | | return (record?.taskStatus == 199 && record?.taskType == 107 ? <ConfirmButton label={"toolbar.check"} startIcon={<GradingOutlinedIcon />} onConfirm={checkClick} /> : <></>) |
| | | } |
| | | |
| | | |
| | | /**自动下发任务**/ |
| | | const BulkAutoStartButton = ({ autoExce, setAutoExce }) => { |
| | |
| | | } |
| | | } |
| | | return ( |
| | | autoExce ? <Button label="toolbar.pause" onClick={pauseClick} startIcon={<PauseIcon />} /> : <></> |
| | | autoExce ? <Button label="toolbar.pausePub" onClick={pauseClick} startIcon={<PauseIcon />} /> : <></> |
| | | ) |
| | | } |
| | | |