| | |
| | | import ConfirmButton from "../components/ConfirmButton"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import ColorizeOutlinedIcon from '@mui/icons-material/ColorizeOutlined'; |
| | | import GradingOutlinedIcon from '@mui/icons-material/GradingOutlined'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | {/* <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" onClick={(e) => e.stopPropagation()} > |
| | | <EditButton label="toolbar.detail"/> |
| | | <EditButton label="toolbar.detail" /> |
| | | <DoneButton sx={{ padding: '1px', fontSize: '.75rem' }} ></DoneButton> |
| | | <CancelButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | <SetTopButton sx={{ padding: '1px', fontSize: '.75rem' }} ></SetTopButton> |
| | | <CheckButton /> |
| | | <PickButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | |
| | | } |
| | | |
| | | export default TaskList; |
| | | |
| | | |
| | | const CheckButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | const checkClick = async () => { |
| | | const { data: { code, data, msg } } = await request.post(`/task/check/` + record.id); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh(); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return (record?.taskStatus == 198 && record?.taskType == 107 ? <ConfirmButton label={"toolbar.check"} startIcon={<GradingOutlinedIcon />} onConfirm={checkClick} /> : <></>) |
| | | } |
| | | |
| | | /** |
| | | * 拣料出库 |
| | | * @returns |
| | | */ |
| | | const PickButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | const pickClick = async () => { |
| | | const { data: { code, data, msg } } = await request.post(`/task/pick/` + record.id); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh(); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | record?.taskStatus == 199 && record?.taskType == 103 ? <ConfirmButton label={"toolbar.pick"} startIcon={<ColorizeOutlinedIcon />} onConfirm={pickClick} /> : <></> |
| | | ) |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | return ( |
| | | record?.taskStatus < 98 ? (<ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskAltIcon />} onConfirm={clickComplete} />) : (<></>) |
| | | ((record?.taskStatus < 98) || (record?.taskType >= 101 && record?.taskStatus < 198)) ? (<ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskAltIcon />} onConfirm={clickComplete} />) : (<></>) |
| | | ) |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | return ( |
| | | record.taskStatus === 1 ? |
| | | (record.taskStatus == 1 || record.taskStatus < 101) && (record.taskType == 1 || record.taskType == 101 || record.taskType == 10 || record.taskType == 104) ? |
| | | <Button |
| | | onClick={clickCancel} |
| | | label="toolbar.cancel"> |