| | |
| | | import GradingOutlinedIcon from '@mui/icons-material/GradingOutlined'; |
| | | import StickyDataTable from "@/page/components/StickyDataTable"; |
| | | import useTableLayout from '@/utils/useTableLayout'; |
| | | import AccountTreeOutlinedIcon from '@mui/icons-material/AccountTreeOutlined'; |
| | | import FlowStepInstanceModal from './FlowStepInstanceModal'; |
| | | |
| | | const TaskList = (props) => { |
| | | const translate = useTranslate(); |
| | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [autoExce, setAutoExce] = useState(false); |
| | | const dict = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_warehouse_type')) || []; |
| | | |
| | | // state for FlowStepInstanceModal |
| | | const [flowStepModalOpen, setFlowStepModalOpen] = useState(false); |
| | | const [currentTaskRecord, setCurrentTaskRecord] = useState(null); |
| | | |
| | | useEffect(() => { |
| | | getConfig() |
| | |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <TableItems drawerVal={drawerVal} /> |
| | | <TableItems |
| | | drawerVal={drawerVal} |
| | | onOpenFlowStep={(record) => { |
| | | setCurrentTaskRecord(record); |
| | | setFlowStepModalOpen(true); |
| | | }} |
| | | /> |
| | | </List> |
| | | <PageDrawer |
| | | title='Task Detail' |
| | |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | <FlowStepInstanceModal |
| | | open={flowStepModalOpen} |
| | | setOpen={setFlowStepModalOpen} |
| | | record={currentTaskRecord} |
| | | /> |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | export default TaskList; |
| | | |
| | | |
| | | const TableItems = ({ drawerVal }) => { |
| | | const TableItems = ({ drawerVal, onOpenFlowStep }) => { |
| | | const omittedFields = ['id', 'createTime', 'createBy$', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status', 'warehType$', 'orderType', 'order_type', 'orderType$']; |
| | | const { boxMaxWidth, boxMaxHeight } = useTableLayout(drawerVal); |
| | | return ( |
| | |
| | | <CheckButton /> |
| | | <PickButton /> |
| | | <SetTopButton /> |
| | | <FlowStepButton onClick={onOpenFlowStep} /> |
| | | </WrapperField> |
| | | </StickyDataTable> |
| | | </Box> |
| | |
| | | } |
| | | |
| | | |
| | | const FlowStepButton = ({ onClick }) => { |
| | | const record = useRecordContext(); |
| | | return ( |
| | | <Button |
| | | label="toolbar.flowStep" |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | onClick(record); |
| | | }} |
| | | > |
| | | <AccountTreeOutlinedIcon /> |
| | | </Button> |
| | | ) |
| | | } |
| | | |
| | | /** |
| | | * 盘点 |
| | | * @returns te |