| | |
| | | import ExitToAppIcon from '@mui/icons-material/ExitToApp'; |
| | | import ImportButton from "../../components/ImportButton"; |
| | | import DetailsIcon from '@mui/icons-material/Details'; |
| | | |
| | | import CancelIcon from '@mui/icons-material/Cancel'; |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <TextInput source="code" label="table.field.asnOrder.code" />, |
| | | <TextInput source="poCode" label="table.field.asnOrder.poCode" />, |
| | | <NumberInput source="poId" label="table.field.asnOrder.poId" />, |
| | | <TextInput source="type" label="table.field.asnOrder.type" />, |
| | | <ReferenceInput source="wkType" reference="dictData" filter={{ dictTypeCode: 'sys_business_type' }} label="table.field.asnOrder.wkType"> |
| | | <AutocompleteInput label="table.field.asnOrder.wkType" optionValue="value" /> |
| | | <TextInput source="code" label="table.field.outStock.code" alwaysOn />, |
| | | <TextInput source="poCode" label="table.field.outStock.poCode" />, |
| | | <NumberInput source="poId" label="table.field.outStock.poId" />, |
| | | <ReferenceInput source="type" reference="dictData" filter={{ dictTypeCode: 'sys_business_type' }} label="table.field.outStock.type" alwaysOn> |
| | | <AutocompleteInput label="table.field.outStock.type" optionValue="value" /> |
| | | </ReferenceInput>, |
| | | <NumberInput source="anfme" label="table.field.asnOrder.anfme" />, |
| | | <NumberInput source="qty" label="table.field.asnOrder.qty" />, |
| | | <TextInput source="logisNo" label="table.field.asnOrder.logisNo" />, |
| | | <DateInput source="arrTime" label="table.field.asnOrder.arrTime" />, |
| | | <SelectInput source="rleStatus" label="table.field.asnOrder.rleStatus" |
| | | <ReferenceInput source="wkType" reference="dictData" filter={{ dictTypeCode: 'sys_business_type' }} label="table.field.outStock.wkType" alwaysOn> |
| | | <AutocompleteInput label="table.field.outStock.wkType" optionValue="value" /> |
| | | </ReferenceInput>, |
| | | <NumberInput source="anfme" label="table.field.outStock.anfme" />, |
| | | <NumberInput source="qty" label="table.field.outStock.qty" />, |
| | | <TextInput source="logisNo" label="table.field.outStock.logisNo" />, |
| | | <DateInput source="arrTime" label="table.field.outStock.arrTime" />, |
| | | <SelectInput source="rleStatus" label="table.field.outStock.rleStatus" |
| | | choices={[ |
| | | { id: 0, name: ' 正常' }, |
| | | { id: 1, name: ' 已释放' }, |
| | |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <DictionarySelect |
| | | label='table.field.asnOrder.exceStatus' |
| | | label='table.field.outStock.exceStatus' |
| | | name="exceStatus" |
| | | dictTypeCode="sys_asn_exce_status" |
| | | alwaysOn |
| | |
| | | title={"menu.outStock"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true); setmodalType(0) }} />} |
| | | filters={filters} |
| | | filter={{deleted: 0, type: 'out'}} |
| | | filter={{ deleted: 0, type: 'out' }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true); setmodalType(0) }} /> |
| | | <SelectColumnsButton preferenceKey='outStock' /> |
| | | <ImportButton value={'asnOrderItem'} /> |
| | | <ImportButton value={'asnOrderItem'} /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | |
| | | <WrapperField cellClassName="opt" label="common.field.opt" > |
| | | <EditButton label="toolbar.detail" icon={(<DetailsIcon />)}></EditButton> |
| | | <MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} /> |
| | | <CancelButton></CancelButton> |
| | | {/* <CompleteButton /> */} |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | |
| | | ) |
| | | } |
| | | |
| | | const CancelButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | const cancelOrder = async () => { |
| | | const { data: { code, data, msg } } = await request.post(`/outStock/cancel/${record.id}`); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh() |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <ConfirmButton label={"toolbar.cancel"} startIcon={<CancelIcon />} onConfirm={cancelOrder} /> |
| | | ) |
| | | } |
| | | |
| | | const CloseButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const requestClose = async () => { |
| | | const { data: { code, data, msg } } = await request.post(`/asnOrder/close/${record.id}`); |
| | | const { data: { code, data, msg } } = await request.post(`/outStock/close/${record.id}`); |
| | | |
| | | if (code === 200) { |
| | | notify(msg); |