Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
| | |
| | | batchMix: 'batchFiexed', |
| | | batchWarehouse: 'batchWarehouse', |
| | | batchStockLevel: "batchStockLevel", |
| | | batchWarehouseAreas: "batchWarehouseAreas", |
| | | batchLocType: "batchLocType", |
| | | }, |
| | | }; |
| | | |
| | |
| | | batchStockLevel: "批量ABC分类", |
| | | batchValidWarn: "批量预警", |
| | | batchFlagCheck: "批量免检", |
| | | batchWarehouseAreas: "批量库区", |
| | | batchLocType: "批量库位类型", |
| | | }, |
| | | }; |
| | | |
| | |
| | | const inspection = () => { }; |
| | | |
| | | const print = () => { |
| | | const imageUrls = ['https://www.baidu.com/img/flexible/logo/pc/result@2.png',] |
| | | const iframe = document.createElement('iframe'); |
| | | iframe.style.display = 'none'; |
| | | document.body.appendChild(iframe); |
| | | // const imageUrls = ['https://www.baidu.com/img/flexible/logo/pc/result@2.png',] |
| | | // const iframe = document.createElement('iframe'); |
| | | // iframe.style.display = 'none'; |
| | | // document.body.appendChild(iframe); |
| | | |
| | | const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; |
| | | iframeDoc.open(); |
| | | iframeDoc.write('<html><head><title>Print Images</title></head><body>'); |
| | | // const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; |
| | | // iframeDoc.open(); |
| | | // iframeDoc.write('<html><head><title>Print Images</title></head><body>'); |
| | | |
| | | // 将图片插入到 iframe 中 |
| | | imageUrls.forEach((imageUrl) => { |
| | | iframeDoc.write(`<img src="${imageUrl}" style="margin: 10px;">`); |
| | | }); |
| | | // // 将图片插入到 iframe 中 |
| | | // imageUrls.forEach((imageUrl) => { |
| | | // iframeDoc.write(`<img src="${imageUrl}" style="margin: 10px;">`); |
| | | // }); |
| | | |
| | | iframeDoc.write('</body></html>'); |
| | | iframeDoc.close(); |
| | | // iframeDoc.write('</body></html>'); |
| | | // iframeDoc.close(); |
| | | |
| | | // 等待图片加载完成后触发打印 |
| | | iframe.contentWindow.onload = () => { |
| | | iframe.contentWindow.print(); |
| | | // 打印完成后移除 iframe |
| | | document.body.removeChild(iframe); |
| | | }; |
| | | // // 等待图片加载完成后触发打印 |
| | | // iframe.contentWindow.onload = () => { |
| | | // iframe.contentWindow.print(); |
| | | // // 打印完成后移除 iframe |
| | | // document.body.removeChild(iframe); |
| | | // }; |
| | | }; |
| | | |
| | | |
| | |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | |
| | | const BatchModal = ({ open, setOpen }) => { |
| | | const BatchModal = ({ open, setOpen, fieldType }) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | | |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Dialog open={open} maxWidth="md" fullWidth> |
| | | <Dialog open={open} maxWidth="xs" fullWidth> |
| | | <Form onSubmit={handleSubmit}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | <DialogTitle>{translate('toolbar.batch')}</DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={4}> |
| | | {fieldType === 'warehouseId' && |
| | | <Grid item xs={6}> |
| | | <ReferenceInput |
| | | source="warehouseId" |
| | | reference="warehouse" |
| | |
| | | <AutocompleteInput |
| | | label="table.field.loc.warehouseId" |
| | | optionText="name" |
| | | onChange={(value) => handleChange(value, 'warehouseId')} |
| | | value={formData.warehouseId} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | } |
| | | {fieldType === 'areaId' && |
| | | <Grid item xs={6}> |
| | | <ReferenceInput |
| | | source="areaId" |
| | | reference="warehouseAreas" |
| | | filter={{ warehouseId: formData.warehouseId }} |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.areaId" |
| | |
| | | </ReferenceInput> |
| | | |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | } |
| | | {fieldType === 'typeIds' && |
| | | <Grid item xs={6}> |
| | | {/* <DictionarySelect |
| | | label={translate("table.field.loc.type")} |
| | | name="type" |
| | |
| | | <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} /> |
| | | </ReferenceArrayInput> |
| | | </Grid> |
| | | } |
| | | |
| | | <Grid item xs={4}> |
| | | {fieldType === 'status' && |
| | | <Grid item xs={6}> |
| | | <StatusSelectInput |
| | | onChange={(e) => handleChange(e.target.value, 'status')} |
| | | defaultValue={''} |
| | | require={false} |
| | | /> |
| | | </Grid> |
| | | |
| | | } |
| | | </Grid> |
| | | |
| | | </Box> |
| | |
| | | source="warehouseId" |
| | | label="table.field.loc.warehouseId" |
| | | reference="warehouse" |
| | | alwaysOn |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.warehouseId" |
| | |
| | | source="areaId" |
| | | label="table.field.loc.areaId" |
| | | reference="warehouseAreas" |
| | | alwaysOn |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.areaId" |
| | |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | aside={<LocListAside />} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='loc' |
| | | align="left" |
| | | bulkActionButtons={ |
| | | <> |
| | | <BatchButton /> |
| | | <BatchWateButton /> |
| | | <BatchAreasButton /> |
| | | <BatchLocTypeButton /> |
| | | <BatchStatusButton /> |
| | | <BindButton /> |
| | | <SubzoneButton /> |
| | | <BulkDeleteButton /> |
| | |
| | | ) |
| | | } |
| | | |
| | | const BatchButton = () => { |
| | | const BatchWateButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batch"}> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchWarehouse"}> |
| | | <EditIcon /> |
| | | </Button> |
| | | |
| | | <BatchModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | fieldType={'warehouseId'} |
| | | /> |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | const BatchAreasButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchWarehouseAreas"}> |
| | | <EditIcon /> |
| | | </Button> |
| | | |
| | | <BatchModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | fieldType={'areaId'} |
| | | /> |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | const BatchLocTypeButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchLocType"}> |
| | | <EditIcon /> |
| | | </Button> |
| | | |
| | | <BatchModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | fieldType={'typeIds'} |
| | | /> |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | const BatchStatusButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchStatus"}> |
| | | <EditIcon /> |
| | | </Button> |
| | | |
| | | <BatchModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | fieldType={'status'} |
| | | /> |
| | | </> |
| | | |
| | |
| | | |
| | | } |
| | | const handleNodeSelect = (event, nodeId) => { |
| | | console.log(nodeId); |
| | | // setFilters({ groupId: nodeId }); |
| | | const row = apiRef.current.getItem(nodeId); |
| | | console.log(row); |
| | | |
| | | if (row.type === 'warehouseId') { |
| | | // setFilters({ warehouseId: row.id ,areaId:''}); |
| | | } else if (row.type === 'areaId') { |
| | | // setFilters({ areaId: row.id ,warehouseId:''}); |
| | | } |
| | | |
| | | }; |
| | | const handleSearch = (e) => { |
| | | setCondition(e.target.value) |
| | |
| | | |
| | | <RichTreeView |
| | | expansionTrigger="iconContainer" |
| | | checkboxSelection |
| | | multiSelect |
| | | // checkboxSelection |
| | | // multiSelect |
| | | items={matnrTree} |
| | | apiRef={apiRef} |
| | | getItemId={(item) => item.id} |
| | |
| | | |
| | | <RichTreeView |
| | | expansionTrigger="iconContainer" |
| | | checkboxSelection |
| | | multiSelect |
| | | items={locTree} |
| | | apiRef={apiRef} |
| | | selectedItems={selectedItems} |
| | | getItemId={(item) => item.id} |
| | | getItemLabel={(item) => item.name} |
| | | defaultExpandedItems={['grid']} |
| | | onSelectedItemsChange={handleSelectedItemsChange} |
| | | onItemSelectionToggle={handleItemSelectionToggle} |
| | | onItemClick={handleNodeSelect} |
| | | onItemSelectionToggle={handleItemSelectionToggle} |
| | | // checkboxSelection |
| | | // multiSelect |
| | | selectedItems={selectedItems} |
| | | onSelectedItemsChange={handleSelectedItemsChange} |
| | | /> |
| | | |
| | | <BindLocModal |
| | |
| | | <Grid key={item.id} item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label={item.fieldsAlise} |
| | | source={`extendFields.[${item.fields}]`} |
| | | source={item.fields} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | |
| | | <Grid key={item.id} item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label={item.fieldsAlise} |
| | | source={`extendFields.[${item.fields}]`} |
| | | source={item.fields} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | |
| | | const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />) |
| | | const opt = <WrapperField key="opt" cellClassName="fixed" className="fixed" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <EnableButton /> |
| | | <PrintButton /> |
| | | </WrapperField> |
| | | setColumns([...arr, ...fields, opt]); |
| | | |
| | |
| | | <BatchStatusButton /> |
| | | <BatchLevelButton /> |
| | | <BindButton /> |
| | | <PrintButton /> |
| | | <BatchPrintButton /> |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | </>} |
| | | rowClick={(id, resource, record) => false} |
| | |
| | | ) |
| | | } |
| | | |
| | | const PrintButton = () => { |
| | | const BatchPrintButton = () => { |
| | | const record = useRecordContext(); |
| | | const { resource, selectedIds } = useListContext(); |
| | | const notify = useNotify(); |
| | |
| | | ) |
| | | } |
| | | |
| | | const PrintButton = () => { |
| | | const record = useRecordContext(); |
| | | |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
| | | <Button color="secondary" onClick={() => setCreateDialog(true)} label={"toolbar.print"}> |
| | | <PrintIcon /> |
| | | </Button> |
| | | |
| | | <PrintModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | rows={[record]} |
| | | /> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | const BindButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | |
| | | overflow: 'hidden', |
| | | fontSize: 'small', |
| | | tableLayout: 'fixed', |
| | | width: '280px', |
| | | width: '520px', |
| | | borderCollapse: 'collapse', |
| | | borderSpacing: 0, |
| | | margin: '0 auto', |