| | |
| | | import DictionarySelect from "../../components/DictionarySelect"; |
| | | import ExitToAppIcon from '@mui/icons-material/ExitToApp'; |
| | | import ImportButton from "../../components/ImportButton"; |
| | | |
| | | import PrintOutlinedIcon from '@mui/icons-material/PrintOutlined'; |
| | | import OrderPrintPreview from "./OrderPrintPreview"; |
| | | import CreateNewFolderOutlinedIcon from '@mui/icons-material/CreateNewFolderOutlined'; |
| | | import AsnCreateByPoModal from "./AsnCreateByPoModal"; |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [modalType, setmodalType] = useState(0); |
| | | const [select, setSelect] = useState(0); |
| | | const [poCreate, setPoCreate] = useState(false); |
| | | const [printOrder, setPrintOrder] = useState(false); |
| | | const [select, setSelect] = useState({}); |
| | | const invoiceRef = useRef(); |
| | | const billReload = useRef(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | |
| | | title={"menu.asnOrder"} |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{ deleted: 0 }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true); setmodalType(0) }} /> |
| | | <CreateByPoButton setPoCreate={setPoCreate}/> |
| | | <SelectColumnsButton preferenceKey='asnOrder' /> |
| | | <ImportButton value={'asnOrderItem'} /> |
| | | <MyExportButton /> |
| | |
| | | <InspectionsButton /> |
| | | <MyExportButton /> |
| | | {/* <BtnBulkExport></BtnBulkExport> */} |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} |
| | | /> |
| | | </>} |
| | | rowClick={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poId', 'rleStatus$']} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'logisNo', 'poId', 'rleStatus$']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.asnOrder.code" /> |
| | |
| | | <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" /> */} |
| | | <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" /> |
| | | <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> |
| | | {/* <TextField source="ntyStatus$" label="table.field.asnOrder.ntyStatus" /> */} |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | |
| | | <MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} /> |
| | | <InspectionButton /> |
| | | <CompleteButton /> |
| | | <ODeleteButton /> |
| | | <ODeleteButton /> |
| | | <PrintButton setPrintOrder={setPrintOrder} setSelect={setSelect} /> |
| | | {/* <CloseButton /> */} |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | |
| | | setOpen={setCreateDialog} |
| | | asnId={modalType} |
| | | billReload={billReload} |
| | | /> |
| | | <OrderPrintPreview |
| | | open={printOrder} |
| | | setOpen={setPrintOrder} |
| | | record={select} |
| | | /> |
| | | <AsnCreateByPoModal |
| | | open={poCreate} |
| | | setOpen={setPoCreate} |
| | | /> |
| | | <PageDrawer |
| | | title='AsnOrder Detail' |
| | |
| | | } |
| | | export default AsnOrderList; |
| | | |
| | | //按PO单新建 |
| | | const CreateByPoButton = ({setPoCreate}) => { |
| | | const record = useRecordContext(); |
| | | |
| | | const createEvent = (event) => { |
| | | event.stopPropagation(); |
| | | setPoCreate(true) |
| | | } |
| | | return ( |
| | | <Button label={"toolbar.poCreate"} onClick={createEvent}> |
| | | <CreateNewFolderOutlinedIcon /> |
| | | </Button> |
| | | ) |
| | | } |
| | | |
| | | |
| | | //打印按钮 |
| | | const PrintButton = ({ setPrintOrder, setSelect }) => { |
| | | const record = useRecordContext(); |
| | | const printOrder = (event) => { |
| | | event.stopPropagation(); |
| | | setPrintOrder(true) |
| | | setSelect(record) |
| | | } |
| | | |
| | | return ( |
| | | <Button label={"toolbar.print"} onClick={printOrder}> |
| | | <PrintOutlinedIcon /> |
| | | </Button> |
| | | ) |
| | | } |
| | | |
| | | |
| | | const ODeleteButton = () => { |
| | | const record = useRecordContext(); |
| | | return ( |
| | | record.exceStatus === 0 ? <DeleteButton mutationMode="pessimistic"/> : <></> |
| | | record.exceStatus === 0 ? <DeleteButton mutationMode="pessimistic" /> : <></> |
| | | ) |
| | | |
| | | } |
| | |
| | | }; |
| | | return ( |
| | | record.exceStatus === 1 || record.exceStatus === 0 ? |
| | | <Button |
| | | color="primary" |
| | | startIcon={<EditIcon />} |
| | | onClick={(btn) => handleEditClick(btn)} |
| | | sx={{ ml: 1 }} |
| | | label={'ra.action.edit'} |
| | | > |
| | | </Button> |
| | | : <></> |
| | | <Button |
| | | color="primary" |
| | | startIcon={<EditIcon />} |
| | | onClick={(btn) => handleEditClick(btn)} |
| | | sx={{ ml: 1 }} |
| | | label={'ra.action.edit'} |
| | | > |
| | | </Button> |
| | | : <></> |
| | | ) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | return ( |
| | | <ConfirmButton label={"toolbar.inspection"} color="secondary" startIcon={<ConstructionIcon />} onConfirm={inspection} /> |
| | | <ConfirmButton label={"toolbar.inspection"} color="secondary" startIcon={<ConstructionIcon />} onConfirm={inspection} /> |
| | | ) |
| | | } |
| | | |
| | |
| | | // 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} /> : <></> |
| | | record.exceStatus === 1 ? <ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskIcon />} onConfirm={requestComplete} /> : <></> |
| | | ) |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | return ( |
| | | <ConfirmButton label={"toolbar.close"} color="error" startIcon={<CloseIcon />} onConfirm={requestClose} /> |
| | | <ConfirmButton label={"toolbar.close"} color="error" startIcon={<CloseIcon />} onConfirm={requestClose} /> |
| | | ) |
| | | } |