7个文件已添加
31 文件已重命名
1 文件已复制
4个文件已删除
24个文件已修改
| | |
| | | batch: 'batch', |
| | | confirm: 'confirm', |
| | | cancel: "cancel", |
| | | selectSite: 'Select Site', |
| | | top: "top", |
| | | resort: "sort", |
| | | subzone: 'subzone', |
| | |
| | | matnrId: "物料标识", |
| | | maktx: "物料名称", |
| | | matnrCode: "物料编码", |
| | | anfme: "数量", |
| | | anfme: "计划收货数量", |
| | | stockUnit: "库存单位", |
| | | purQty: "计划收货数量", |
| | | purQty: "采购数量", |
| | | purUnit: "采购单位", |
| | | qty: "已完成数量", |
| | | splrBatch: "供应商批次", |
| | |
| | | matnrId: "物料标识", |
| | | matnrCode: "物料编码", |
| | | maktx: "物料", |
| | | anfme: "数量", |
| | | anfme: "计划数量", |
| | | purQty: "采购数量", |
| | | purUnit: "采购单位", |
| | | qty: "已完成数量", |
| | |
| | | name: "名称", |
| | | wcsCode: "wcs站点编号", |
| | | label: "站点标签", |
| | | device: "设备类型", |
| | | device: "立库类型", |
| | | deviceCode: "设备编号", |
| | | deviceSite: "设备站点", |
| | | flagInit: "是否初始化", |
| | |
| | | siteInit: '站点初始化', |
| | | batch: '批量操作', |
| | | confirm: '确认', |
| | | selectSite: '选择站点', |
| | | cancel: "取消", |
| | | top: "置顶", |
| | | resort: "排序", |
| | |
| | | const IconComponent = getIconComponent(iconStr); |
| | | if (IconComponent) { |
| | | return <IconComponent />; |
| | | } else { |
| | | return <KeyboardArrowDownIcon /> |
| | | } |
| | | }; |
| | | |
| | |
| | | const SubMenu = (props) => { |
| | | const { handleToggle, isOpen, name, icon, children, dense } = props; |
| | | const translate = useTranslate(); |
| | | |
| | | const [sidebarIsOpen] = useSidebarState(); |
| | | |
| | | const header = ( |
| | | <MenuItem dense={dense} onClick={handleToggle} sx={{ display: 'flex', alignItems: 'center' }}> |
| | | <ListItemIcon sx={{ minWidth: 40, color: 'text.secondary', display: 'flex', alignItems: 'center' }}> |
| | | {/* {isOpen ? <ExpandMore /> : icon} */} |
| | | {isOpen ? <KeyboardArrowDownIcon /> : <KeyboardArrowRightIcon />} |
| | | {icon ? icon : isOpen ? <KeyboardArrowDownIcon /> : <KeyboardArrowRightIcon />} |
| | | </ListItemIcon> |
| | | <Typography variant="inherit" color="textSecondary" sx={{ ml: 1, display: 'flex', alignItems: 'center' }}> |
| | | {translate(name)} |
| | |
| | | import loc from './basicInfo/loc'; |
| | | import container from './container'; |
| | | import contract from './contract'; |
| | | import qlyInspect from './qlyInspect'; |
| | | import qlyInspect from './orders/qlyInspect'; |
| | | import dictType from './system/dicts/dictType'; |
| | | import companys from './basicInfo/companys'; |
| | | import locType from './basicInfo/locType'; |
| | |
| | | import fields from './fields'; |
| | | import fieldsItem from './fieldsItem'; |
| | | import warehouseAreasItem from './warehouseAreasItem'; |
| | | import deviceSite from './basicInfo//deviceSite'; |
| | | import deviceSite from './basicInfo/deviceSite'; |
| | | import waitPakin from './waitPakin'; |
| | | import waitPakinItem from './waitPakinItem'; |
| | | import waitPakinLog from './waitPakinLog'; |
| | | import asnOrderLog from './orders/asnOrderLog'; |
| | | import waitPakinLog from './histories/waitPakinLog'; |
| | | import asnOrderLog from './histories/asnOrderLog'; |
| | | import task from './task'; |
| | | import taskLog from './taskLog'; |
| | | import taskLog from './histories/taskLog'; |
| | | |
| | | const ResourceContent = (node) => { |
| | | switch (node.component) { |
| | |
| | | return contract; |
| | | case 'qlyInspect': |
| | | return qlyInspect; |
| | | case 'qlyIsptItem': |
| | | return qlyIsptItem; |
| | | case 'dictType': |
| | | return dictType; |
| | | case 'companys': |
| | |
| | | return whMat; |
| | | case 'asnOrder': |
| | | return asnOrder; |
| | | case 'asnOrderItem': |
| | | return asnOrderItem; |
| | | case 'asnOrderLog': |
| | | return asnOrderLog; |
| | | case 'purchase': |
| | |
| | | return deviceSite; |
| | | case 'waitPakin': |
| | | return waitPakin; |
| | | case 'waitPakinItem': |
| | | return waitPakinItem; |
| | | case 'waitPakinLog': |
| | | return waitPakinLog; |
| | | case 'task': |
File was renamed from rsf-admin/src/page/taskLog/TaskItemLogList.jsx |
| | |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
File was renamed from rsf-admin/src/page/taskLog/TaskLogCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const TaskLogCreate = (props) => { |
| | | const { open, setOpen } = props; |
File was renamed from rsf-admin/src/page/taskLog/TaskLogEdit.jsx |
| | |
| | | import { Stack, Grid, Box, Typography, Card } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import TaskItemLogList from "./TaskItemLogList"; |
| | | |
| | | const FormToolbar = () => { |
File was renamed from rsf-admin/src/page/taskLog/TaskLogList.jsx |
| | |
| | | import { styled } from '@mui/material/styles'; |
| | | import TaskLogCreate from "./TaskLogCreate"; |
| | | import TaskLogPanel from "./TaskLogPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import MyField from "../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | |
File was renamed from rsf-admin/src/page/taskLog/TaskLogPanel.jsx |
| | |
| | | useTranslate, |
| | | useRecordContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../components/PanelTypography"; |
| | | import PanelTypography from "../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | |
| | | const TaskLogPanel = () => { |
File was renamed from rsf-admin/src/page/waitPakinLog/WaitPakinItemLogList.jsx |
| | |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import { styled } from '@mui/material/styles'; import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import MyField from "../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | |
File was renamed from rsf-admin/src/page/waitPakinLog/WaitPakinLogCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const WaitPakinLogCreate = (props) => { |
| | | const { open, setOpen } = props; |
File was renamed from rsf-admin/src/page/waitPakinLog/WaitPakinLogEdit.jsx |
| | |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import WaitPakinItemLogList from "./WaitPakinItemLogList"; |
| | | |
| | | const FormToolbar = () => { |
File was renamed from rsf-admin/src/page/waitPakinLog/WaitPakinLogList.jsx |
| | |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | |
File was renamed from rsf-admin/src/page/waitPakinLog/WaitPakinLogPanel.jsx |
| | |
| | | useRefresh, |
| | | useListContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../components/PanelTypography"; |
| | | import PanelTypography from "../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | import { styled } from "@mui/material/styles"; |
| | | import request from '@/utils/request'; |
| | |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid container width={{ xs: '100%', xl: '100%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={24} md={12}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrder.logisNo" |
| | | source="logisNo" |
| | | parse={v => v} |
| | | /> |
| | | <DateInput |
| | | label="table.field.asnOrder.arrTime" |
| | | source="arrTime" |
| | | /> |
| | | <SelectInput |
| | | label="table.field.asnOrder.rleStatus" |
| | | source="rleStatus" |
| | | choices={[ |
| | | { id: 0, name: ' 正常' }, |
| | | { id: 1, name: ' 已释放' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrder.logisNo" |
| | | source="logisNo" |
| | | parse={v => v} |
| | | /> |
| | | <DateInput |
| | | label="table.field.asnOrder.arrTime" |
| | | source="arrTime" |
| | | /> |
| | | <SelectInput |
| | | label="table.field.asnOrder.rleStatus" |
| | | source="rleStatus" |
| | | choices={[ |
| | | { id: 0, name: ' 正常' }, |
| | | { id: 1, name: ' 已释放' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |
| | | </Grid> |
| | | </SimpleForm> |
| | | </Edit > |
| | | <AsnOrderItemList /> |
| | |
| | | if (data == null || data == undefined) { return } |
| | | |
| | | return ( |
| | | <EditBase |
| | | id={record?.id} |
| | | resource="asnOrderItem" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" |
| | | > |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | > |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | {translate('update.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <EditBase |
| | | id={record?.id} |
| | | resource="asnOrderItem" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | > |
| | | {translate('update.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Form |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | |
| | | </Toolbar> |
| | | </DialogActions> |
| | | </Form> |
| | | </DialogContent> |
| | | </Dialog> |
| | | </EditBase > |
| | | </EditBase > |
| | | </DialogContent> |
| | | </Dialog> |
| | | ) |
| | | } |
| | | |
| | |
| | | <TextInput source="splrCode" label="table.field.asnOrderItem.splrCode" />, |
| | | <TextInput source="splrName" label="table.field.asnOrderItem.splrName" />, |
| | | <TextInput source="qrcode" label="table.field.asnOrderItem.qrcode" />, |
| | | <TextInput source="barcode" label="table.field.asnOrderItem.barcode" />, |
| | | <TextInput source="trackCode" label="table.field.asnOrderItem.barcode" />, |
| | | <TextInput source="packName" label="table.field.asnOrderItem.packName" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [select, setSelect] = useState({}); |
| | | const asnId = useGetRecordId(); |
| | | const { data: dicts, isPending, error } = useGetOne('asnOrder', { id: asnId }); const creatCode = () => { }; |
| | | const { data: dicts, isPending, error } = useGetOne('asnOrder', { id: asnId }); |
| | | |
| | | return ( |
| | | <> |
| | |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <Button onClick={creatCode} label={"toolbar.creatcode"}> |
| | | {/* <Button onClick={creatCode} label={"toolbar.creatcode"}> |
| | | <QrCodeIcon /> |
| | | </Button> |
| | | </Button> */} |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='asnOrderItem' /> |
| | |
| | | <TextField source="splrCode" label="table.field.asnOrderItem.splrCode" /> |
| | | <TextField source="splrName" label="table.field.asnOrderItem.splrName" /> |
| | | <TextField source="qrcode" label="table.field.asnOrderItem.qrcode" /> |
| | | <TextField source="barcode" label="table.field.asnOrderItem.barcode" /> |
| | | <TextField source="trackCode" label="table.field.asnOrderItem.barcode" /> |
| | | <TextField source="packName" label="table.field.asnOrderItem.packName" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 320 |
| | | width: 180 |
| | | }, |
| | | '& .status': { |
| | | width: 100 |
| | | width: 90 |
| | | }, |
| | | })); |
| | | |
| | |
| | | bulkActionButtons={<> <InspectionsButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} |
| | | rowClick={() => 'edit'} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poId']} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poId', 'rleStatus$']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.asnOrder.code" /> |
| | |
| | | {/* {asnId !== '' && <ConfirmButton label={'删除'} variant="outlined" color="error" onConfirm={handleDelete} />} */} |
| | | <ConfirmButton label={'删除'} variant="outlined" color="error" onConfirm={handleDeleteItem} /> |
| | | </Stack> |
| | | |
| | | </Box> |
| | | |
| | | <Box sx={{ mt: 2 }}> |
| | | <AsnOrderModalTable tabelData={tabelData} setTableData={setTableData} asnId={asnId} selectedRows={selectedRows} setSelectedRows={setSelectedRows} tableRef={tableRef}></AsnOrderModalTable> |
| | | </Box> |
| | |
| | | }, |
| | | { |
| | | field: 'anfme', |
| | | headerName: translate('table.field.asnOrderItem.purQty'), |
| | | headerName: translate('table.field.asnOrderItem.anfme'), |
| | | type: 'number', |
| | | minWidth: 100, |
| | | flex: 1, |
File was renamed from rsf-admin/src/page/waitPakinItem/WaitPakinItemCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const WaitPakinItemCreate = (props) => { |
| | | const PurchaseCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | |
| | | const translate = useTranslate(); |
| | |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.waitPakinItem.pakinId" |
| | | source="pakinId" |
| | | {/* <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.purchase.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | </Grid> */} |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.waitPakinItem.maktx" |
| | | source="maktx" |
| | | label="table.field.purchase.type" |
| | | source="type" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.waitPakinItem.matnrId" |
| | | source="matnrId" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.waitPakinItem.matnrCode" |
| | | source="matnrCode" |
| | | label="table.field.purchase.source" |
| | | source="source" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <DateInput |
| | | label="table.field.purchase.preArr" |
| | | source="preArr" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.waitPakinItem.anfme" |
| | | label="table.field.purchase.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.waitPakinItem.workQty" |
| | | source="workQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.waitPakinItem.unit" |
| | | source="unit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.waitPakinItem.fieldsIndex" |
| | | source="fieldsIndex" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.waitPakinItem.qty" |
| | | label="table.field.purchase.qty" |
| | | source="qty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.purchase.workQty" |
| | | source="workQty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.waitPakinItem.batch" |
| | | source="batch" |
| | | label="table.field.purchase.channel" |
| | | source="channel" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.purchase.platCode" |
| | | source="platCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <DateInput |
| | | label="table.field.purchase.startTime" |
| | | source="startTime" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <DateInput |
| | | label="table.field.purchase.endTime" |
| | | source="endTime" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.purchase.project" |
| | | source="project" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | |
| | | ) |
| | | } |
| | | |
| | | export default WaitPakinItemCreate; |
| | | export default PurchaseCreate; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Edit, |
| | | SimpleForm, |
| | | FormDataConsumer, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | Labeled, |
| | | NumberField, |
| | | required, |
| | | useRecordContext, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import PurchaseItemList from "./PurchaseItemList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const PurchaseEdit = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <> |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={18} md={10}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | {/* <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.purchase.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> */} |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.purchase.type" |
| | | source="type$" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchase.source" |
| | | source="source" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | <DateInput |
| | | label="table.field.purchase.preArr" |
| | | source="preArr" |
| | | /> |
| | | <NumberInput |
| | | label="table.field.purchase.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.purchase.qty" |
| | | source="qty" |
| | | validate={required()} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.purchase.workQty" |
| | | source="workQty" |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchase.channel" |
| | | source="channel" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchase.platCode" |
| | | source="platCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.purchase.startTime" |
| | | source="startTime" |
| | | /> |
| | | <DateInput |
| | | label="table.field.purchase.endTime" |
| | | source="endTime" |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchase.project" |
| | | source="project" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | <Grid item xs={6} md={2}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <StatusSelectInput /> |
| | | <Box mt="2em" /> |
| | | <MemoInput /> |
| | | </Grid> |
| | | </Grid> |
| | | </SimpleForm> |
| | | </Edit > |
| | | <PurchaseItemList /> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default PurchaseEdit; |
copy from rsf-admin/src/page/qlyInspect/QlyIsptItemCreate.jsx
copy to rsf-admin/src/page/orders/purchase/PurchaseItemCreate.jsx
File was copied from rsf-admin/src/page/qlyInspect/QlyIsptItemCreate.jsx |
| | |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SaveButton, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | Toolbar, |
| | | required, |
| | | useDataProvider, |
| | | useNotify, |
| | | Form, |
| | | useCreateController, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const QlyIsptItemCreate = (props) => { |
| | | const { open, setOpen, record } = props; |
| | | const PurchaseItemCreate = (props) => { |
| | | const { open, setOpen, row } = props; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | |
| | | <> |
| | | <CreateBase |
| | | record={{}} |
| | | resource="qlyIsptItem" |
| | | transform={(data) => { |
| | | return data; |
| | | }} |
| | |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.ispectId" |
| | | source="ispectId" |
| | | readOnly |
| | | defaultValue={record?.id} |
| | | label="table.field.purchaseItem.purchaseId" |
| | | source="purchaseId" |
| | | defaultValue={row.poId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.matnrCode" |
| | | label="table.field.purchaseItem.platItemId" |
| | | source="platItemId" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.purchaseItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.maktx" |
| | | source="maktx" |
| | | label="table.field.purchaseItem.matnrName" |
| | | source="matnrName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.label" |
| | | source="label" |
| | | label="table.field.purchaseItem.unit" |
| | | source="unit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.qty" |
| | | source="qty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.nromQty" |
| | | source="nromQty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.asnQty" |
| | | source="asnQty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.printQty" |
| | | source="printQty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.splrName" |
| | | label="table.field.purchaseItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.splrBatch" |
| | | label="table.field.purchaseItem.splrCode" |
| | | source="splrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.purchaseItem.splrBatch" |
| | | source="splrBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.stockBatch" |
| | | source="stockBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.rcptQty" |
| | | source="rcptQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.dlyQty" |
| | | source="dlyQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.disQty" |
| | | source="disQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.safeQty" |
| | | source="safeQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.picPath" |
| | | source="picPath" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <StatusSelectInput /> |
| | | </Grid> |
| | |
| | | ) |
| | | } |
| | | |
| | | export default QlyIsptItemCreate; |
| | | export default PurchaseItemCreate; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Edit, |
| | | SimpleForm, |
| | | FormDataConsumer, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | Labeled, |
| | | NumberField, |
| | | required, |
| | | useGetOne, |
| | | useRecordContext, |
| | | DeleteButton, |
| | | Form, |
| | | EditBase, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography, Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const PurchaseItemEdit = (props) => { |
| | | const { open, setOpen, record } = props; |
| | | const translate = useTranslate(); |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | const { data, isPending, } = useGetOne('purchaseItem', { id: record?.id }); |
| | | if (data == null || data == undefined) { return } |
| | | |
| | | return ( |
| | | <> |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" |
| | | > |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | > |
| | | {translate('update.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <EditBase |
| | | resource="purchaseItem" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | > |
| | | <Form |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | |
| | | <Grid container width={{ xs: '100%', xl: '100%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={12} md={8} gap={2}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.purchaseId" |
| | | source="purchaseId" |
| | | defaultValue={record?.id} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchaseItem.platItemId" |
| | | source="platItemId" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchaseItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.purchaseItem.matnrName" |
| | | source="matnrName" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchaseItem.unit" |
| | | source="unit" |
| | | parse={v => v} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.qty" |
| | | source="qty" |
| | | validate={required()} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.nromQty" |
| | | source="nromQty" |
| | | validate={required()} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.asnQty" |
| | | source="asnQty" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.purchaseItem.printQty" |
| | | source="printQty" |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchaseItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchaseItem.splrCode" |
| | | source="splrCode" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchaseItem.splrBatch" |
| | | source="splrBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | <Grid item xs={12} md={4} > |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <StatusSelectInput /> |
| | | <Box mt="2em" /> |
| | | <MemoInput /> |
| | | </Grid> |
| | | </Grid> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'end' }} > |
| | | <SaveButton type="button" mutationOptions={{ |
| | | onSuccess: () => { |
| | | setOpen(false) |
| | | } |
| | | }} /> |
| | | </Toolbar> |
| | | </DialogActions> |
| | | </Form> |
| | | </EditBase > |
| | | </Dialog> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default PurchaseItemEdit; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useTranslate, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | TextInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | Button, |
| | | useGetOne |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import PurchaseItemCreate from "./PurchaseItemCreate"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import PurchaseItemEdit from "./PurchaseItemEdit"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <NumberInput source="purchaseId" label="table.field.purchaseItem.purchaseId" />, |
| | | <TextInput source="platItemId" label="table.field.purchaseItem.platItemId" />, |
| | | <TextInput source="matnrCode" label="table.field.purchaseItem.matnrCode" />, |
| | | <TextInput source="matnrName" label="table.field.purchaseItem.matnrName" />, |
| | | <TextInput source="unit" label="table.field.purchaseItem.unit" />, |
| | | <NumberInput source="anfme" label="table.field.purchaseItem.anfme" />, |
| | | <NumberInput source="qty" label="table.field.purchaseItem.qty" />, |
| | | <NumberInput source="nromQty" label="table.field.purchaseItem.nromQty" />, |
| | | <NumberInput source="asnQty" label="table.field.purchaseItem.asnQty" />, |
| | | <NumberInput source="printQty" label="table.field.purchaseItem.printQty" />, |
| | | <TextInput source="splrName" label="table.field.purchaseItem.splrName" />, |
| | | <TextInput source="splrCode" label="table.field.purchaseItem.splrCode" />, |
| | | <TextInput source="splrBatch" label="table.field.purchaseItem.splrBatch" />, |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | |
| | | const PurchaseItemList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [editDialog, setEditDialog] = useState(false); |
| | | const [select, setSelect] = useState({}); |
| | | const poId = useGetRecordId(); |
| | | const { data: purchase, isPending, error } = useGetOne('purchase', { id: poId }); |
| | | |
| | | return ( |
| | | <> |
| | | <Box display="flex"> |
| | | <List |
| | | resource="purchaseItem" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.purchaseItem"} |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{ purchaseId: poId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='purchaseItem' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='purchaseItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => { |
| | | setSelect(record) |
| | | setEditDialog(true) |
| | | }} |
| | | omit={['id', 'createTime', 'purchaseId', 'platItemId', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="purchaseId" label="table.field.purchaseItem.purchaseId" /> |
| | | <TextField source="platItemId" label="table.field.purchaseItem.platItemId" /> |
| | | <TextField source="matnrCode" label="table.field.purchaseItem.matnrCode" /> |
| | | <TextField source="matnrName" label="table.field.purchaseItem.matnrName" /> |
| | | <TextField source="unit" label="table.field.purchaseItem.unit" /> |
| | | <NumberField source="anfme" label="table.field.purchaseItem.anfme" /> |
| | | <NumberField source="qty" label="table.field.purchaseItem.qty" /> |
| | | <NumberField source="nromQty" label="table.field.purchaseItem.nromQty" /> |
| | | <NumberField source="asnQty" label="table.field.purchaseItem.asnQty" /> |
| | | <NumberField source="printQty" label="table.field.purchaseItem.printQty" /> |
| | | <TextField source="splrName" label="table.field.purchaseItem.splrName" /> |
| | | <TextField source="splrCode" label="table.field.purchaseItem.splrCode" /> |
| | | <TextField source="splrBatch" label="table.field.purchaseItem.splrBatch" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" reference="user" /> |
| | | <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} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <Button label="ra.action.edit" onClick={(id, resource, record) => { |
| | | setEditDialog(true) |
| | | setSelect(record) |
| | | }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PurchaseItemEdit |
| | | open={editDialog} |
| | | setOpen={setEditDialog} |
| | | record={select} |
| | | /> |
| | | <PurchaseItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | row={{ poId }} |
| | | /> |
| | | <PageDrawer |
| | | title='PurchaseItem Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box></> |
| | | ) |
| | | } |
| | | |
| | | export default PurchaseItemList; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import PurchaseCreate from "./PurchaseCreate"; |
| | | import PurchasePanel from "./PurchasePanel"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import MyField from "../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <TextInput source="code" label="table.field.purchase.code" />, |
| | | <TextInput source="type" label="table.field.purchase.type" />, |
| | | <TextInput source="source" label="table.field.purchase.source" />, |
| | | <DateInput source="preArr" label="table.field.purchase.preArr" />, |
| | | <NumberInput source="anfme" label="table.field.purchase.anfme" />, |
| | | <NumberInput source="qty" label="table.field.purchase.qty" />, |
| | | <NumberInput source="workQty" label="table.field.purchase.workQty" />, |
| | | <TextInput source="channel" label="table.field.purchase.channel" />, |
| | | <TextInput source="platCode" label="table.field.purchase.platCode" />, |
| | | <DateInput source="startTime" label="table.field.purchase.startTime" />, |
| | | <DateInput source="endTime" label="table.field.purchase.endTime" />, |
| | | <TextInput source="project" label="table.field.purchase.project" />, |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | |
| | | const PurchaseList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | const navigate = useNavigate(); |
| | | const assign = (record) => { |
| | | navigate(`/purchaseItem?poId=${record.id}`); |
| | | }; |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.purchase"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='purchase' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='purchase' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={'edit'} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'preArr', 'channel','startTime','workQty', 'endTime']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.purchase.code" /> |
| | | <TextField source="type$" label="table.field.purchase.type" /> |
| | | <TextField source="source" label="table.field.purchase.source" /> |
| | | <DateField source="preArr" label="table.field.purchase.preArr" showTime /> |
| | | <NumberField source="anfme" label="table.field.purchase.anfme" /> |
| | | <NumberField source="qty" label="table.field.purchase.qty" /> |
| | | <NumberField source="workQty" label="table.field.purchase.workQty" /> |
| | | <TextField source="channel" label="table.field.purchase.channel" /> |
| | | <TextField source="platCode" label="table.field.purchase.platCode" /> |
| | | <DateField source="startTime" label="table.field.purchase.startTime" showTime /> |
| | | <DateField source="endTime" label="table.field.purchase.endTime" showTime /> |
| | | <TextField source="project" label="table.field.purchase.project" /> |
| | | <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} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PurchaseCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='Purchase Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default PurchaseList; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { Box, Card, CardContent, Grid, Typography, Tooltip, Paper, TableContainer, Table, TableBody, TableCell, TableHead, TableRow } from '@mui/material'; |
| | | import { |
| | | useTranslate, |
| | | useRecordContext, |
| | | useNotify |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | import { styled } from "@mui/material/styles"; |
| | | import request from '@/utils/request'; |
| | | const PurchasePanel = () => { |
| | | const record = useRecordContext(); |
| | | if (!record) return null; |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const [rows, setRows] = useState([]); |
| | | const poId = record.id; |
| | | |
| | | useEffect(() => { |
| | | http(); |
| | | }, [poId]); |
| | | |
| | | const http = async () => { |
| | | const res = await request.post('/purchaseItem/page', { purchaseId: poId }); |
| | | if (res?.data?.code === 200) { |
| | | setRows(res.data.data.records) |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | } |
| | | |
| | | const StyledTable = styled(TableRow)(({ theme }) => ({ |
| | | "& .MuiButtonBase-root.": { |
| | | padding: "0px 0px", |
| | | }, |
| | | })); |
| | | |
| | | const StyledTableRow = styled(TableRow)(({ theme }) => ({ |
| | | "& .MuiButtonBase-root.": { |
| | | padding: "0px 0px", |
| | | }, |
| | | })); |
| | | |
| | | const StyledTableCell = styled(TableCell)(({ theme }) => ({ |
| | | "& .MuiButtonBase-root": { |
| | | padding: "0px 0px", |
| | | }, |
| | | overflow: "hidden", |
| | | textOverflow: "ellipsis", |
| | | whiteSpace: "nowrap", |
| | | maxWidth: 600, |
| | | })); |
| | | |
| | | const columns = [ |
| | | { |
| | | id: 'purchaseId', |
| | | label: 'table.field.purchaseItem.purchaseId', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'platItemId', |
| | | label: 'table.field.purchaseItem.platItemId', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'matnrCode', |
| | | label: 'table.field.purchaseItem.matnrCode', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'matnrName', |
| | | label: 'table.field.purchaseItem.matnrName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'unit', |
| | | label: 'table.field.purchaseItem.unit', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'anfme', |
| | | label: 'table.field.purchaseItem.anfme', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'qty', |
| | | label: 'table.field.purchaseItem.qty', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'nromQty', |
| | | label: 'table.field.purchaseItem.nromQty', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'asnQty', |
| | | label: 'table.field.purchaseItem.asnQty', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'printQty', |
| | | label: 'table.field.purchaseItem.printQty', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'splrName', |
| | | label: 'table.field.purchaseItem.splrName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'splrCode', |
| | | label: 'table.field.purchaseItem.splrCode', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'splrBatch', |
| | | label: 'table.field.purchaseItem.splrBatch', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | id: 'statusBool', |
| | | label: 'common.field.status', |
| | | minWidth: 100, |
| | | formatter: (value) => value ? 'Yes' : 'No' |
| | | }, |
| | | { |
| | | id: 'memo', |
| | | label: 'common.field.memo', |
| | | minWidth: 100 |
| | | } |
| | | ]; |
| | | |
| | | |
| | | return ( |
| | | |
| | | <Box sx={{ |
| | | position: 'relative', |
| | | padding: '5px 10px' |
| | | }}> |
| | | <TableContainer component={Paper} > |
| | | <Table size="small" > |
| | | <TableHead> |
| | | <StyledTableRow key={'head'}> |
| | | {columns.map((column, idx) => { |
| | | const value = column.label; |
| | | return ( |
| | | <> |
| | | <StyledTableCell |
| | | key={column.id} |
| | | align={column.align || "left"} |
| | | // style={{ paddingLeft: idx === 0 && (depth * 16 + 16) }} |
| | | > |
| | | {column.format ? column.format(value) : translate(value)} |
| | | </StyledTableCell> |
| | | </> |
| | | ); |
| | | |
| | | })} |
| | | </StyledTableRow> |
| | | </TableHead> |
| | | |
| | | <TableBody> |
| | | {rows.map((row) => ( |
| | | <StyledTableRow key={row.id || Math.random()}> |
| | | {columns.map((column) => ( |
| | | <StyledTableCell key={column.id} > |
| | | {row[column.id]} |
| | | </StyledTableCell> |
| | | ))} |
| | | </StyledTableRow> |
| | | ))} |
| | | |
| | | </TableBody> |
| | | </Table> |
| | | </TableContainer> |
| | | </Box> |
| | | |
| | | ); |
| | | }; |
| | | |
| | | export default PurchasePanel; |
File was renamed from rsf-admin/src/page/waitPakinItem/index.jsx |
| | |
| | | ShowGuesser, |
| | | } from "react-admin"; |
| | | |
| | | import WaitPakinItemList from "./WaitPakinItemList"; |
| | | import WaitPakinItemEdit from "./WaitPakinItemEdit"; |
| | | import PurchaseList from "./PurchaseList"; |
| | | import PurchaseEdit from "./PurchaseEdit"; |
| | | |
| | | export default { |
| | | list: WaitPakinItemList, |
| | | edit: WaitPakinItemEdit, |
| | | list: PurchaseList, |
| | | edit: PurchaseEdit, |
| | | show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.id}` |
File was renamed from rsf-admin/src/page/qlyInspect/AsnSelModal.jsx |
| | |
| | | Radio, |
| | | FormControlLabel, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import ConfirmButton from "../components/ConfirmButton"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import ConfirmButton from "../../components/ConfirmButton"; |
| | | import { useTranslate, useNotify, useRefresh } from 'react-admin'; |
| | | import request from '@/utils/request'; |
| | | import { DataGrid, useGridApiRef } from '@mui/x-data-grid'; |
File was renamed from rsf-admin/src/page/qlyInspect/InspectModal.jsx |
| | |
| | | Radio, |
| | | FormControlLabel, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import ConfirmButton from "../components/ConfirmButton"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import ConfirmButton from "../../components/ConfirmButton"; |
| | | import { useTranslate, useNotify, useRefresh } from 'react-admin'; |
| | | import request from '@/utils/request'; |
| | | import { DataGrid, useGridApiRef } from '@mui/x-data-grid'; |
File was renamed from rsf-admin/src/page/qlyInspect/QlyInspectCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const QlyInspectCreate = (props) => { |
| | | const { open, setOpen } = props; |
File was renamed from rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx |
| | |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import QlyIsptItemList from "./QlyIsptItemList"; |
| | | |
| | | const FormToolbar = () => { |
File was renamed from rsf-admin/src/page/qlyInspect/QlyInspectList.jsx |
| | |
| | | import { styled } from '@mui/material/styles'; |
| | | import QlyInspectCreate from "./QlyInspectCreate"; |
| | | import QlyInspectPanel from "./QlyInspectPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import MyField from "../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import ConstructionIcon from "@mui/icons-material/Construction"; |
| | |
| | | |
| | | const QlyInspectList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [opCreateDialog, setOpCreateDialog] = useState(false); |
| | | |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='qlyInspect' |
| | | bulkActionButtons={<BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick='edit' |
| | | rowClick={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'asnId', 'statusBool']} |
| | | > |
| | |
| | | <NumberField source="dlyQty" label="table.field.qlyInspect.dlyQty" /> |
| | | <NumberField source="rcptQty" label="table.field.qlyInspect.rcptQty" /> |
| | | <NumberField source="isptQty" label="table.field.qlyInspect.isptQty" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <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} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} |
| | | <EditButton /> |
| | | <InspectionButton /> |
| | | <CompleteButton /> |
| | | <CloseButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <QlyInspectCreate |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | {/* <QlyInspectCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | /> */} |
| | | <QlyInspectOpCreate |
| | | open={opCreateDialog} |
| | | setOpen={setOpCreateDialog} |
| | |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | </Box > |
| | | ) |
| | | } |
| | | |
| | |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [opCreateDialog, setOpCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
| | |
| | | |
| | | |
| | | return ( |
| | | <Button onClick={requestComplete} label={"toolbar.complete"}> |
| | | <Button onClick={requestComplete} label={"toolbar.complete"} mutationMode={OPERATE_MODE}> |
| | | <TaskIcon /> |
| | | </Button> |
| | | ) |
File was renamed from rsf-admin/src/page/qlyInspect/QlyInspectOpCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const QlyInspectOpCreate = (props) => { |
| | | const { open, setOpen } = props; |
File was renamed from rsf-admin/src/page/qlyInspect/QlyInspectPanel.jsx |
| | |
| | | useRefresh, |
| | | useListContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../components/PanelTypography"; |
| | | import PanelTypography from "../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | import { styled } from "@mui/material/styles"; |
| | | import request from '@/utils/request'; |
File was renamed from rsf-admin/src/page/qlyInspect/QlyIsptItemCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const QlyIsptItemCreate = (props) => { |
| | | const { open, setOpen, record } = props; |
File was renamed from rsf-admin/src/page/qlyInspect/QlyIsptItemEdit.jsx |
| | |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
File was renamed from rsf-admin/src/page/qlyInspect/QlyIsptItemList.jsx |
| | |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import QlyIsptItemCreate from "./QlyIsptItemCreate"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='taskItem' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | rowClick={false} |
| | | // expand={() => <TaskItemPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'taskId', 'orderId', 'orderItemId', 'matnrId']} |
| | |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | </> |
| | | } |
| | | rowClick={'edit'} |
| | | rowClick={false} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status', 'sort']} |
| | |
| | | <TextField source="expDesc" label="table.field.task.expDesc" /> |
| | | <NumberField source="sort" label="table.field.task.sort" /> |
| | | <TextField source="expCode" label="table.field.task.expCode" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy"/> |
| | | <TextField source="createBy$" label="common.field.createBy"/> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | {/* <BooleanField source="statusBool" label="common.field.status" sortable={false} /> */} |
| | |
| | | */ |
| | | const DoneButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const clickComplete = () => { |
| | | console.log('------->'); |
| | | completeTask([record]) |
| | | }; |
| | | //完成任务 |
| | | const completeTask = async (row) => { } |
| | | const completeTask = async (row) => { |
| | | const { data: { code, data, msg } } = await request.post(`task/complete/` + row.id); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh(); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | return ( |
| | | <Button |
| | | onClick={clickComplete} |
| | |
| | | cancleTask(record) |
| | | }; |
| | | //取消任务 |
| | | const cancleTask = async (row) => { |
| | | const cancleTask = async (row) => { |
| | | console.log(row); |
| | | const { data: { code, data, msg } } = await request.post(`/task/remove/` + row.id); |
| | | if (code === 200) { |
| | |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | } |
| | | return ( |
| | | <Button |
| | | onClick={clickTop} |
New file |
| | |
| | | import { Dialog, DialogTitle, Box, DialogActions, DialogContent } from "@mui/material"; |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback, Form } from "react"; |
| | | import { styled } from '@mui/material/styles'; |
| | | import { FilterButton, TopToolbar, Toolbar, useTranslate, SaveButton, List, SelectInput, NumberField, WrapperField, EditButton, DeleteButton, TextField, DateField, TextInput, BooleanField, NumberInput, ReferenceField, SearchInput, SelectColumnsButton, DatagridConfigurable, Button } from "react-admin"; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <NumberInput source="type" label="table.field.deviceSite.type" />, |
| | | <TextInput source="site" label="table.field.deviceSite.site" />, |
| | | <TextInput source="name" label="table.field.deviceSite.name" />, |
| | | <TextInput source="wcsCode" label="table.field.deviceSite.wcsCode" />, |
| | | <TextInput source="label" label="table.field.deviceSite.label" />, |
| | | <TextInput source="device" label="table.field.deviceSite.device" />, |
| | | <TextInput source="deviceCode" label="table.field.deviceSite.deviceCode" />, |
| | | <TextInput source="deviceSite" label="table.field.deviceSite.deviceSite" />, |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | /> |
| | | ] |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | })); |
| | | |
| | | const SelectSiteModel = (props) => { |
| | | const { open, setOpen, record } = props; |
| | | const translate = useTranslate(); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | |
| | | return ( |
| | | <Box> |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" |
| | | > |
| | | <DialogTitle> |
| | | {translate('toolbar.selectSite')} |
| | | </DialogTitle> |
| | | <DialogContent> |
| | | <List |
| | | resource='deviceSite' |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.deviceSite"} |
| | | empty={false} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='deviceSite' /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='deviceSite' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'updateBy$', 'createBy$', 'createTime', 'updateTime']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="name" label="table.field.deviceSite.name" /> |
| | | <NumberField source="type$" label="table.field.deviceSite.type" /> |
| | | <TextField source="site" label="table.field.deviceSite.site" /> |
| | | <TextField source="wcsCode" label="table.field.deviceSite.wcsCode" /> |
| | | <TextField source="label" label="table.field.deviceSite.label" /> |
| | | <TextField source="device$" label="table.field.deviceSite.device" /> |
| | | <TextField source="deviceCode" label="table.field.deviceSite.deviceCode" /> |
| | | <TextField source="deviceSite" label="table.field.deviceSite.deviceSite" /> |
| | | <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> |
| | | </Dialog> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default SelectSiteModel; |
| | |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import WaitPakinItem from "../waitPakinItem"; |
| | | import WaitPakinItemList from "../waitPakinItem/WaitPakinItemList"; |
| | | import WaitPakinItemList from "./WaitPakinItemList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import WaitPakinItemCreate from "./WaitPakinItemCreate"; |
| | | import WaitPakinItemPanel from "./WaitPakinItemPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <NumberInput source="pakinId" label="table.field.waitPakinItem.pakinId" />, |
| | | <TextInput source="maktx" label="table.field.waitPakinItem.maktx" />, |
| | | <NumberInput source="matnrId" label="table.field.waitPakinItem.matnrId" />, |
| | |
| | | <TextInput source="fieldsIndex" label="table.field.waitPakinItem.fieldsIndex" />, |
| | | <NumberInput source="qty" label="table.field.waitPakinItem.qty" />, |
| | | <TextInput source="batch" label="table.field.waitPakinItem.batch" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | const WaitPakinItemList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const pakinId = useGetRecordId(); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="waitPakinItem" |
| | | filter={{pakinId: pakinId}} |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakinItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | omit={['id', 'pakinId', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="pakinId" label="table.field.waitPakinItem.pakinId" /> |
| | |
| | | <TextField source="fieldsIndex" label="table.field.waitPakinItem.fieldsIndex" /> |
| | | <NumberField source="qty" label="table.field.waitPakinItem.qty" /> |
| | | <TextField source="batch" label="table.field.waitPakinItem.batch" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <TextField source="flagDefect" 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} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <WaitPakinItemCreate |
| | |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import WaitPakinCreate from "./WaitPakinCreate"; |
| | | import WaitPakinPanel from "./WaitPakinPanel"; |
| | | import ConfirmButton from "../components/ConfirmButton"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import AddIcon from '@mui/icons-material/Add'; |
| | | import request from '@/utils/request'; |
| | | import TaskIcon from '@mui/icons-material/Task'; |
| | | import { width } from "@mui/system"; |
| | | import SelectSiteModel from "./SelectSiteModel"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .column-statusBool': { |
| | | width: 90 |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | width: 180 |
| | | }, |
| | | })); |
| | | |
| | |
| | | const WaitPakinList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [siteDialog, setSiteDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | return ( |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakin' |
| | | bulkActionButtons={<> <CreateTaskButton /> <BulkDeleteButton mutationMode={OPERATE_MODE} /></>} |
| | | bulkActionButtons={<Box> <Button label="ra.action.edit" onClick={()=>{ |
| | | setSiteDialog(true) |
| | | }} /> <BulkDeleteButton mutationMode={OPERATE_MODE} /></Box>} |
| | | rowClick='edit' |
| | | expand={false} |
| | | expandSingle={true} |
| | |
| | | <NumberField source="anfme" label="table.field.waitPakin.anfme" /> |
| | | <TextField source="ioStatus$" label="table.field.waitPakin.ioStatus" sortable={false} /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <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} /> |
| | |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <SelectSiteModel open={siteDialog} setOpen={setSiteDialog}/> |
| | | <WaitPakinCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | |
| | | |
| | | const CreateTaskButton = () => { |
| | | const record = useRecordContext(); |
| | | const [siteDialog, setSiteDialog] = useState(false); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const { selectedIds, onUnselectItems, data } = useListContext(); |
| | | const createTask = async () => { |
| | | const rows = data.filter((item) => selectedIds.includes(item.id)) || []; |
| | | const res = await request.post(`/waitPakin/merge`, rows); |
| | | if (res?.data?.code === 200) { |
| | | refresh() |
| | | notify(res.data.msg); |
| | | |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | const createTask = () => { |
| | | // const rows = data.filter((item) => selectedIds.includes(item.id)) || []; |
| | | // const res = await request.post(`/waitPakin/merge`, rows); |
| | | // if (res?.data?.code === 200) { |
| | | // refresh(); |
| | | // notify(res.data.msg); |
| | | // } else { |
| | | // notify(res.data.msg); |
| | | // } |
| | | console.log('-------->'); |
| | | setSiteDialog(true) |
| | | |
| | | } |
| | | |
| | | // return ( |
| | | // <ConfirmButton label={"toolbar.createTask"} startIcon={<TaskIcon />} onConfirm={createTask} /> |
| | | // ) |
| | | return ( |
| | | <> |
| | | <Button onClick={() => createTask()} label={"toolbar.createTask"}> |
| | | <AddIcon /> |
| | | </Button> |
| | | |
| | | |
| | | </> |
| | | |
| | | ) |
| | | } |
| | |
| | | @ApiModelProperty("图片路径") |
| | | private String picPath; |
| | | @ApiModelProperty("质检结果") |
| | | private String isptResult; |
| | | private Short isptResult; |
| | | @ApiModelProperty("备注") |
| | | private String memo; |
| | | } |
| | |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptStatus; |
| | | import com.vincent.rsf.server.manager.mapper.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.system.constant.CodeRes; |
| | |
| | | if (Objects.isNull(params.getIsptCode())) { |
| | | throw new CoolException("质检单不能为空"); |
| | | } |
| | | QlyInspect inspect = qlyInspectMapper.selectOne(new LambdaQueryWrapper<QlyInspect>().eq(QlyInspect::getCode, params.getIsptCode())); |
| | | List<Short> asList = Arrays.asList(QlyIsptStatus.QLY_ISPT_STAS_DONE.val, QlyIsptStatus.QLY_ISPT_STAS_CLOSE.val); |
| | | QlyInspect inspect = qlyInspectMapper.selectOne(new LambdaQueryWrapper<QlyInspect>() |
| | | .notIn(QlyInspect::getIsptStatus, asList) |
| | | .eq(QlyInspect::getCode, params.getIsptCode())); |
| | | if (Objects.isNull(inspect)) { |
| | | throw new CoolException("质检单据不存在!!"); |
| | | } |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:update')") |
| | | @ApiOperation("取消任务") |
| | | @PostMapping("/task/cancel/{id}") |
| | | public R cancelTask(@PathVariable String id) { |
| | | if (Objects.isNull(id)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:update')") |
| | | @ApiOperation("任务出库置顶") |
| | | @PostMapping("/task/top/{id}") |
| | | public R setTop(@PathVariable String id) { |
| | |
| | | private String asnCode; |
| | | |
| | | @ApiModelProperty("质检状态") |
| | | private String isptStatus; |
| | | private Short isptStatus; |
| | | |
| | | @ApiModelProperty("质检结果") |
| | | private Short isptResult; |
| | |
| | | private String picPath; |
| | | |
| | | @ApiModelProperty("质检结论") |
| | | private String isptResult; |
| | | private Short isptResult; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
New file |
| | |
| | | package com.vincent.rsf.server.manager.enums; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title QlyIsptResult |
| | | * @description |
| | | * @create 2025/4/14 09:42 |
| | | */ |
| | | public enum QlyIsptResult { |
| | | //质检结果 |
| | | QLY_ISPT_RESULT_EXCELLENT("1", "合格"), |
| | | QLY_ISPT_RESULT_DEFECT("2", "不合格"), |
| | | QLY_ISPT_RESULT_PENDING("3", "待定"), |
| | | QLY_ISPT_RESULT_SECTION("4", "部分合格"), |
| | | QLY_ISPT_RESULT_HOLD("0", "其它") |
| | | ; |
| | | |
| | | QlyIsptResult(String val, String desc) { |
| | | this.val = Short.parseShort(val); |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public Short val; |
| | | public String desc; |
| | | } |
| | |
| | | ; |
| | | |
| | | QlyIsptStatus(String val, String desc) { |
| | | this.val = val; |
| | | this.val = Short.parseShort(val); |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String val; |
| | | public Short val; |
| | | public String desc; |
| | | } |
| | |
| | | AsnOrderItem asnOrderItem = JSONObject.parseObject(JSONObject.toJSONString(params), AsnOrderItem.class); |
| | | if (StringUtils.isBlank(asnOrderItem.getTrackCode())) { |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_LABEL_CODE, asnOrderItem); |
| | | asnOrderItem.setTrackCode(ruleCode); |
| | | asnOrderItem.setTrackCode(ruleCode).setBarcode(ruleCode);; |
| | | } |
| | | if (Objects.isNull(asnOrderItem.getAnfme()) || Double.compare(asnOrderItem.getAnfme(), 0.0) <= 0) { |
| | | throw new CoolException("计划收货数不能为空!!"); |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.IsptItemsParams; |
| | | import com.vincent.rsf.server.manager.controller.params.QlyInspectAndItem; |
| | | import com.vincent.rsf.server.manager.entity.QlyInspect; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptResult; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptStatus; |
| | | import com.vincent.rsf.server.manager.mapper.QlyIsptItemMapper; |
| | | import com.vincent.rsf.server.manager.entity.QlyIsptItem; |
| | | import com.vincent.rsf.server.manager.service.QlyInspectService; |
| | |
| | | } |
| | | List<QlyIsptItem> isptItem = params.getIsptItem(); |
| | | List<Long> list = isptItem.stream().map(QlyIsptItem::getId).collect(Collectors.toList()); |
| | | if (params.getType().equals("2") || params.getType().equals("1")) { |
| | | if (Short.parseShort(params.getType()) == QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val || Short.parseShort(params.getType()) == QlyIsptResult.QLY_ISPT_RESULT_DEFECT.val) { |
| | | //1:合格, 2:不合格, 0: 其它(默认) |
| | | isptItem.forEach(item -> { |
| | | if (params.getType().equals("1")) { |
| | | if (Short.parseShort(params.getType()) == QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val) { |
| | | //TODO 先捡后收为送货数量,先收后捡为收货数量 |
| | | item.setSafeQty(item.getDlyQty()); |
| | | item.setDisQty(0.0); |
| | |
| | | } |
| | | if (!this.update(new LambdaUpdateWrapper<QlyIsptItem>() |
| | | .set(QlyIsptItem::getSafeQty, item.getSafeQty()) |
| | | .set(QlyIsptItem::getIsptResult, params.getType()) |
| | | .set(QlyIsptItem::getIsptResult, Short.parseShort(params.getType())) |
| | | .set(QlyIsptItem::getDisQty, item.getDisQty()) |
| | | .in(QlyIsptItem::getId, item.getId()))) { |
| | | throw new CoolException("修改失败!!"); |
| | |
| | | throw new CoolException("明细修改失败"); |
| | | } |
| | | } |
| | | |
| | | List<QlyIsptItem> isptItems = this.list(new LambdaQueryWrapper<QlyIsptItem>().in(QlyIsptItem::getId, list)); |
| | | if (isptItems.isEmpty()) { |
| | | throw new CoolException("数据错误:明细不存在!!"); |
| | |
| | | QlyInspect inspect = qlyInspectService.getById(key); |
| | | List<QlyIsptItem> items = listMap.get(key); |
| | | Double safeQty = items.stream().mapToDouble(QlyIsptItem::getSafeQty).sum(); |
| | | Double dlyQty = items.stream().mapToDouble(QlyIsptItem::getDlyQty).sum(); |
| | | Double disQty = items.stream().mapToDouble(QlyIsptItem::getDisQty).sum(); |
| | | Double qlyQty = safeQty + disQty; |
| | | //安全数量,质检数量 |
| | | inspect.setSafeQty(safeQty) |
| | | .setIsptQty(qlyQty); |
| | | if (Double.compare(disQty, 0) > 0) { |
| | | inspect.setIsptResult(Short.parseShort("4")); |
| | | inspect.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_SECTION.val); |
| | | } |
| | | if (Double.compare(safeQty, dlyQty) == 0) { |
| | | inspect.setIsptStatus("1"); |
| | | inspect.setIsptResult(Short.parseShort("1")); |
| | | if (Double.compare(safeQty, inspect.getDlyQty()) == 0) { |
| | | inspect.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | inspect.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val); |
| | | } |
| | | if (!qlyInspectService.updateById(inspect)) { |
| | | throw new CoolException("质检数量修改失败!!"); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public WaitPakin mergeItems(WaitPakinParam waitPakin, Long userId) { |
| | | if (waitPakin.getItems().isEmpty()) { |
| | | if (Objects.isNull(waitPakin.getItems()) || waitPakin.getItems().isEmpty()) { |
| | | throw new CoolException("参数错误:物料跟踪码为空!"); |
| | | } |
| | | if (StringUtils.isBlank(waitPakin.getBarcode())) { |