| | |
| | | title={"menu.asnOrder"} |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{deleted: 0}} |
| | | filter={{ deleted: 0 }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | |
| | | <TextField cellClassName="wkType" source="wkType$" label="table.field.asnOrder.wkType" /> |
| | | <NumberField source="anfme" label="table.field.asnOrder.anfme" /> |
| | | <NumberField source="qty" label="table.field.asnOrder.qty" /> |
| | | <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> |
| | | {/* <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> */} |
| | | <DateField source="arrTime" label="table.field.asnOrder.arrTime" showTime /> |
| | | <TextField source="rleStatus$" label="table.field.asnOrder.rleStatus" sortable={false} /> |
| | | <TextField source="ntyStatus$" label="table.field.asnOrder.ntyStatus" /> |
| | |
| | | <MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} /> |
| | | <InspectionButton /> |
| | | <CompleteButton /> |
| | | <CloseButton /> |
| | | <ODeleteButton /> |
| | | {/* <CloseButton /> */} |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | |
| | | } |
| | | export default AsnOrderList; |
| | | |
| | | const ODeleteButton = () => { |
| | | const record = useRecordContext(); |
| | | return ( |
| | | record.exceStatus === 0 ? <DeleteButton mutationMode="pessimistic"/> : <></> |
| | | ) |
| | | |
| | | } |
| | | |
| | | const MyButton = ({ setCreateDialog, setmodalType }) => { |
| | | const record = useRecordContext(); |
| | | const handleEditClick = (btn) => { |
| | |
| | | |
| | | }; |
| | | return ( |
| | | record.exceStatus === 1 || record.exceStatus === 0 ? |
| | | <Button |
| | | color="primary" |
| | | startIcon={<EditIcon />} |
| | |
| | | label={'ra.action.edit'} |
| | | > |
| | | </Button> |
| | | : <></> |
| | | ) |
| | | } |
| | | |
| | | //报检 |
| | | const InspectionButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | return ( |
| | | <Button onClick={inspection} label={"toolbar.inspection"}> |
| | | <ConstructionIcon /> |
| | | </Button> |
| | | <ConfirmButton label={"toolbar.inspection"} color="secondary" startIcon={<ConstructionIcon />} onConfirm={inspection} /> |
| | | ) |
| | | } |
| | | |
| | |
| | | ) |
| | | } |
| | | |
| | | //完成单据 |
| | | const CompleteButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | |
| | | } |
| | | |
| | | return ( |
| | | record.exceStatus === 1 && (record.anfme === record.qty ? <Button onClick={requestComplete} label={"toolbar.complete"} color="success"> |
| | | <TaskIcon /> |
| | | </Button> : <ConfirmButton label={"toolbar.complete"} color="success" data={'当前收货数量小于计划数量,是否确认完成'} startIcon={<TaskIcon />} onConfirm={requestComplete} />) |
| | | |
| | | // record.exceStatus === 1 && (record.anfme === record.qty ? <Button onClick={requestComplete} label={"toolbar.complete"} color="secondary"> |
| | | // <TaskIcon /> |
| | | // </Button> : ) |
| | | record.exceStatus === 1 ? <ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskIcon />} onConfirm={requestComplete} /> : <></> |
| | | ) |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | return ( |
| | | <ConfirmButton label={"toolbar.close"} color="error" data={'确认是否关闭?'} startIcon={<CloseIcon />} onConfirm={requestClose} /> |
| | | <ConfirmButton label={"toolbar.close"} color="error" startIcon={<CloseIcon />} onConfirm={requestClose} /> |
| | | ) |
| | | } |