From 4496b9019ba423dd1c51c719bcc0a5938d90fff9 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期二, 22 四月 2025 17:33:18 +0800 Subject: [PATCH] #修改优化 1. DO单明细编码优化 2. DO单明细新增优化 3. 出库单新增单据增加新单据功能 --- rsf-admin/src/page/orders/outStock/OutOrderModal.jsx | 167 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 167 insertions(+), 0 deletions(-) diff --git a/rsf-admin/src/page/orders/outStock/OutOrderModal.jsx b/rsf-admin/src/page/orders/outStock/OutOrderModal.jsx new file mode 100644 index 0000000..d793c99 --- /dev/null +++ b/rsf-admin/src/page/orders/outStock/OutOrderModal.jsx @@ -0,0 +1,167 @@ +import { Dialog, DialogActions, DialogContent, DialogTitle, Box } from "@mui/material"; +import React, { useState, useRef, useEffect, useMemo } from "react"; +import { + List, + DatagridConfigurable, + SearchInput, + TopToolbar, + Button, + SelectColumnsButton, + EditButton, + FilterButton, + CreateButton, + ExportButton, + BulkDeleteButton, + WrapperField, + Toolbar, + useRecordContext, + useTranslate, + useNotify, + useListContext, + FunctionField, + TextField, + NumberField, + DateField, + BooleanField, + ReferenceField, + TextInput, + DateTimeInput, + DateInput, + SelectInput, + NumberInput, + ReferenceInput, + ReferenceArrayInput, + AutocompleteInput, + DeleteButton, +} from 'react-admin'; +import DialogCloseButton from "../../components/DialogCloseButton"; +import { styled } from '@mui/material/styles'; +import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; +const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ + '& .css-1vooibu-MuiSvgIcon-root': { + height: '.9em' + }, + '& .RaDatagrid-row': { + cursor: 'auto' + }, + '& .column-name': { + }, + '& .opt': { + width: 220 + }, + '& .wkType': { + width: 110 + }, + '& .status': { + width: 90 + }, +})); +const filters = [ + <SearchInput source="condition" alwaysOn />, + <DateInput label='common.time.after' source="timeStart" />, + <DateInput label='common.time.before' source="timeEnd" />, + <TextInput source="code" label="table.field.delivery.code" />, + <TextInput source="platId" label="table.field.delivery.platId" />, + <TextInput source="type" label="table.field.delivery.type" />, + <TextInput source="wkType" label="table.field.delivery.wkType" />, + <TextInput source="source" label="table.field.delivery.source" />, + <SelectInput + label="common.field.status" + source="status" + choices={[ + { id: '1', name: 'common.enums.statusTrue' }, + { id: '0', name: 'common.enums.statusFalse' }, + ]} + resettable + />, +] + +const OutOrderModal = (props) => { + const { open, setOpen, record } = props; + const translate = useTranslate(); + const [drawerVal, setDrawerVal] = useState(false); + + const handleClose = (event, reason) => { + if (reason !== "backdropClick") { + setOpen(false); + } + }; + return ( + <Dialog + open={open} + onClose={handleClose} + aria-labelledby="form-dialog-title" + aria-hidden + fullWidth + disableRestoreFocus + maxWidth="lg" + > + <DialogTitle id="form-dialog-title" sx={{ + position: 'sticky', + top: 0, + backgroundColor: 'background.paper', + zIndex: 1000 + }}> + {translate('create.title')} + <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> + <DialogCloseButton onClose={handleClose} /> + </Box> + </DialogTitle> + <DialogContent> + <List + resource="deliveryItem" + storeKey='selectDelivery' + sx={{ + flexGrow: 1, + transition: (theme) => + theme.transitions.create(['all'], { + duration: theme.transitions.duration.enteringScreen, + }), + marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, + }} + title={"menu.delivery"} + empty={false} + sort={{ field: "create_time", order: "desc" }} + actions={( + <TopToolbar> + <></> + </TopToolbar> + )} + perPage={DEFAULT_PAGE_SIZE} + > + <StyledDatagrid + preferenceKey='deliveryItem' + bulkActionButtons={() => <></>} + rowClick={(id, resource, record) => false} + expand={false} + expandSingle={true} + omit={['id', 'createTime', 'createBy', 'memo', 'workQty', 'startTime', 'endTime', 'updateBy', 'createTime']} + > + <NumberField source="id" /> + <TextField source="matnrCode" label="table.field.deliveryItem.matnrCode" /> + <TextField source="matnrName" label="table.field.deliveryItem.matnrName" /> + <TextField source="unit" label="table.field.deliveryItem.unit" /> + <NumberField source="anfme" label="table.field.deliveryItem.anfme" /> + <TextField source="splrName" label="table.field.deliveryItem.splrName" /> + <TextField source="splrBatch" label="table.field.deliveryItem.splrBatch" /> + <TextField source="updateBy$" label="common.field.updateBy" /> + <DateField source="updateTime" label="common.field.updateTime" showTime /> + <TextField source="createBy$" label="common.field.createBy" /> + <DateField source="createTime" label="common.field.createTime" showTime /> + <BooleanField source="statusBool" label="common.field.status" sortable={false} /> + <TextField source="memo" label="common.field.memo" sortable={false} /> + </StyledDatagrid> + </List> + </DialogContent> + <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> + {/* <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }} > + <Button disabled={disabled} onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}> + {translate('toolbar.confirm')} + </Button> + </Toolbar> */} + </DialogActions> + </Dialog> + ) +} + +export default OutOrderModal; -- Gitblit v1.9.1