| | |
| | | fields: 'Extend Fields', |
| | | fieldsItem: 'Extend Fields Items', |
| | | warehouseAreasItem: 'WarehouseAreasItem', |
| | | endBay: "endBay", |
| | | endLev: "endLev", |
| | | endRow: "endRow", |
| | | locType: "locType", |
| | | startBay: "startBay", |
| | | startLev: "startLev", |
| | | startRow: "startRow", |
| | | }, |
| | | table: { |
| | | field: { |
| | |
| | | inspection: "Inspection", |
| | | creatcode: "creatcode", |
| | | print: "print", |
| | | enable: 'enable', |
| | | unenable: 'unenable', |
| | | locInit: 'loc init' |
| | | }, |
| | | }; |
| | | |
| | |
| | | warehouseId: "仓库", |
| | | areaId: "库区", |
| | | code: "编码", |
| | | type: "类型", |
| | | type: "库位类型", |
| | | name: "名称", |
| | | flagLogic: "虚拟库位", |
| | | fucAtrrs: "功能属性", |
| | |
| | | maxPack: "最大包装数", |
| | | flagLabelMange: "标签管理", |
| | | locAttrs: "属性", |
| | | endBay: "终止列", |
| | | endLev: "终止层", |
| | | endRow: "终止排", |
| | | locType: "宽窄类型", |
| | | startBay: "起始列", |
| | | startLev: "起始层", |
| | | startRow: "起始排", |
| | | }, |
| | | |
| | | container: { |
| | |
| | | inspection: "报检", |
| | | creatcode: "生成条码", |
| | | print: "打印", |
| | | enable: '启用', |
| | | unenable: '禁用', |
| | | locInit: ' 库位初始化' |
| | | }, |
| | | }; |
| | | |
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, |
| | | useRefresh, |
| | | Button |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import InitModal from "./InitModal"; |
| | | import LocPanel from "./LocPanel"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import BatchButton from '../../components/BatchButton'; |
| | | 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 DashboardIcon from '@mui/icons-material/Dashboard'; |
| | | import request from '@/utils/request'; |
| | | import CabinIcon from '@mui/icons-material/Cabin'; |
| | | |
| | | const InitButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | // console.log(record) |
| | | |
| | | return (<> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.locInit"}> |
| | | <CabinIcon /> |
| | | </Button> |
| | | <InitModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | export default InitButton; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | CreateBase, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SaveButton, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | Toolbar, |
| | | required, |
| | | useDataProvider, |
| | | useNotify, |
| | | Form, |
| | | useCreateController, |
| | | useListContext, |
| | | useRefresh, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | | DialogActions, |
| | | DialogContent, |
| | | DialogTitle, |
| | | Grid, |
| | | TextField, |
| | | Box, |
| | | Button, |
| | | Paper, |
| | | TableContainer, |
| | | Table, |
| | | TableHead, |
| | | TableBody, |
| | | TableRow, |
| | | TableCell, |
| | | Tooltip, |
| | | IconButton, |
| | | styled |
| | | |
| | | |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import { useForm, Controller, useWatch, FormProvider, useFormContext } from "react-hook-form"; |
| | | import SaveIcon from '@mui/icons-material/Save'; |
| | | import request from '@/utils/request'; |
| | | import { Add, Edit, Delete } from '@mui/icons-material'; |
| | | import _ from 'lodash'; |
| | | import { DataGrid } from '@mui/x-data-grid'; |
| | | |
| | | |
| | | |
| | | |
| | | const InitModal = ({ open, setOpen }) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | | |
| | | |
| | | const notify = useNotify(); |
| | | |
| | | const [formData, setFormData] = useState({ |
| | | "areaId": "", |
| | | "endBay": "", |
| | | "endLev": "", |
| | | "endRow": "", |
| | | "locType": "", |
| | | "startBay": "", |
| | | "startLev": "", |
| | | "startRow": "", |
| | | "type": "" |
| | | }); |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | |
| | | const handleReset = (e) => { |
| | | e.preventDefault(); |
| | | }; |
| | | |
| | | const handleChange = (e) => { |
| | | const { name, value } = e.target; |
| | | setFormData((prevData) => ({ |
| | | ...prevData, |
| | | [name]: value |
| | | })); |
| | | }; |
| | | |
| | | const handleSubmit = async () => { |
| | | const res = await request.post(`/loc/init`, formData); |
| | | if (res?.data?.code === 200) { |
| | | setOpen(false); |
| | | refresh(); |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | } |
| | | |
| | | |
| | | return ( |
| | | <Dialog open={open} maxWidth="md" fullWidth> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | <DialogTitle>{translate('toolbar.locInit')}</DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Box component="form" sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={4}> |
| | | <TextField |
| | | label={translate("table.field.loc.areaId")} |
| | | name="wkType" |
| | | value={formData.areaId} |
| | | onChange={handleChange} |
| | | variant="outlined" |
| | | size="small" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <TextField |
| | | label={translate("table.field.loc.locType")} |
| | | name="wkType" |
| | | value={formData.locType} |
| | | onChange={handleChange} |
| | | variant="outlined" |
| | | size="small" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <TextField |
| | | label={translate("table.field.loc.type")} |
| | | name="wkType" |
| | | value={formData.type} |
| | | onChange={handleChange} |
| | | variant="outlined" |
| | | size="small" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <TextField |
| | | label={translate("table.field.loc.startBay")} |
| | | name="type" |
| | | value={formData.startBay} |
| | | onChange={handleChange} |
| | | variant="outlined" |
| | | size="small" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <TextField |
| | | label={translate("table.field.loc.startLev")} |
| | | name="wkType" |
| | | value={formData.startLev} |
| | | onChange={handleChange} |
| | | variant="outlined" |
| | | size="small" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <TextField |
| | | label={translate("table.field.loc.startRow")} |
| | | name="wkType" |
| | | value={formData.startRow} |
| | | onChange={handleChange} |
| | | variant="outlined" |
| | | size="small" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <TextField |
| | | label={translate("table.field.loc.endBay")} |
| | | name="wkType" |
| | | value={formData.endBay} |
| | | onChange={handleChange} |
| | | variant="outlined" |
| | | size="small" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <TextField |
| | | label={translate("table.field.loc.endLev")} |
| | | name="wkType" |
| | | value={formData.endLev} |
| | | onChange={handleChange} |
| | | variant="outlined" |
| | | size="small" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <TextField |
| | | label={translate("table.field.loc.endRow")} |
| | | name="wkType" |
| | | value={formData.endRow} |
| | | onChange={handleChange} |
| | | variant="outlined" |
| | | size="small" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | | |
| | | </Grid> |
| | | </Box> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}> |
| | | <Button onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}> |
| | | 确认 |
| | | </Button> |
| | | </Box> |
| | | </DialogActions> |
| | | </Dialog> |
| | | ); |
| | | } |
| | | |
| | | export default InitModal; |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useRefresh, |
| | | Button |
| | | } 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 InitButton from './InitButton'; |
| | | 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 DashboardIcon from '@mui/icons-material/Dashboard'; |
| | | import request from '@/utils/request'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <InitButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='loc' /> |
| | | <MyExportButton /> |
| | |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} |
| | | <EnableButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | |
| | | } |
| | | |
| | | export default LocList; |
| | | |
| | | const EnableButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const enable = async () => { |
| | | const res = await request.post('/loc/update', { |
| | | ...record, |
| | | status: +!record.status |
| | | }); |
| | | if (res?.data?.code === 200) { |
| | | refresh() |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | } |
| | | return ( |
| | | record.status === 1 ? |
| | | (<Button onClick={enable} label={"toolbar.unenable"}> |
| | | <DashboardIcon /> |
| | | </Button>) : (<Button onClick={enable} label={"toolbar.enable"}> |
| | | <DashboardIcon /> |
| | | </Button>) |
| | | |
| | | ) |
| | | } |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useRefresh, |
| | | Button |
| | | |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack, LinearProgress, Tooltip } from '@mui/material'; |
| | |
| | | import ImportButton from "../../components/ImportButton"; |
| | | import MatListAside from './MatnrListAside'; |
| | | import { display, height } from "@mui/system"; |
| | | import DashboardIcon from '@mui/icons-material/Dashboard'; |
| | | import request from '@/utils/request'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | omit={['id', 'shipperId', 'platCode', 'spec', 'model', 'weight', 'color', 'size', 'describle' |
| | | , 'nromNum', 'unit', 'purchaseUnit', 'stockUnit', 'stockLeval', 'isLabelMange', 'safeQty' |
| | | , 'minQty', 'maxQty', 'stagn', 'valid', 'validWarn', 'flagCheck', 'updateTime', 'updateBy' |
| | | , 'createTime', 'createBy', 'memo']} |
| | | , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId', 'stockLevel', 'isLabelMange']} |
| | | > |
| | | <NumberField source="id" /> |
| | | |
| | |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} |
| | | <EnableButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </Box> |
| | |
| | | |
| | | MatnrList.Context = React.createContext() |
| | | |
| | | export default MatnrList; |
| | | export default MatnrList; |
| | | |
| | | const EnableButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const enable = async () => { |
| | | const res = await request.post('/loc/update', { |
| | | ...record, |
| | | status: +!record.status |
| | | }); |
| | | if (res?.data?.code === 200) { |
| | | refresh() |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | } |
| | | return ( |
| | | record.status === 1 ? |
| | | (<Button onClick={enable} label={"toolbar.unenable"}> |
| | | <DashboardIcon /> |
| | | </Button>) : (<Button onClick={enable} label={"toolbar.enable"}> |
| | | <DashboardIcon /> |
| | | </Button>) |
| | | |
| | | ) |
| | | } |
| | |
| | | import UploadIcon from '@mui/icons-material/Upload'; |
| | | import EditIcon from '@mui/icons-material/Edit'; |
| | | import { useState } from 'react'; |
| | | import { Button } from 'react-admin'; |
| | | import ImportModal from './ImportModal'; |
| | | import { Button, useListContext } from 'react-admin'; |
| | | import BatchModal from './BatchModal'; |
| | | |
| | | const ImportButton = (props) => { |
| | | const [modalOpen, setModalOpen] = useState(false); |
| | | |
| | | const { selectedIds } = useListContext(); |
| | | console.log(selectedIds) |
| | | const handleOpenModal = () => { |
| | | setModalOpen(true); |
| | | }; |
| | |
| | | return ( |
| | | <> |
| | | <Button |
| | | startIcon={<UploadIcon />} |
| | | label="common.action.import.title" |
| | | startIcon={<EditIcon />} |
| | | label="common.action.batch" |
| | | onClick={handleOpenModal} |
| | | /> |
| | | |
| | | <ImportModal open={modalOpen} onClose={handleCloseModal} {...props} /> |
| | | <BatchModal open={modalOpen} onClose={handleCloseModal} {...props} /> |
| | | </> |
| | | ); |
| | | }; |
New file |
| | |
| | | import { useEffect, useState, createContext, useContext } from 'react'; |
| | | import { Box, CircularProgress, Stack, Typography } from '@mui/material'; |
| | | import Alert from '@mui/material/Alert'; |
| | | import Dialog from '@mui/material/Dialog'; |
| | | import DialogActions from '@mui/material/DialogActions'; |
| | | import DialogContent from '@mui/material/DialogContent'; |
| | | import DialogTitle from '@mui/material/DialogTitle'; |
| | | import MuiLink from '@mui/material/Link'; |
| | | import { |
| | | Button, |
| | | FileField, |
| | | FileInput, |
| | | Form, |
| | | Toolbar, |
| | | useRefresh, |
| | | useTranslate, |
| | | useNotify |
| | | } from 'react-admin'; |
| | | import { Link } from 'react-router-dom'; |
| | | import DialogCloseButton from './DialogCloseButton'; |
| | | import { usePapaParse } from './usePapaParse'; |
| | | import MatnrList from '../basicInfo/matnr/MatnrList'; |
| | | import request from '@/utils/request' |
| | | import SaveIcon from '@mui/icons-material/Save'; |
| | | |
| | | const ImportModal = ({ open, onClose, importTemp, useCodeImport, onceBatch = 10, value, parmas = {} }) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | | |
| | | |
| | | const notify = useNotify(); |
| | | |
| | | |
| | | |
| | | const handleClose = () => { |
| | | onClose(); |
| | | }; |
| | | |
| | | const handleReset = (e) => { |
| | | e.preventDefault(); |
| | | }; |
| | | |
| | | const handleSubmit = () => { |
| | | }; |
| | | |
| | | |
| | | return ( |
| | | <Dialog open={open} maxWidth="md" fullWidth> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | <DialogTitle>{translate('common.action.batch')}</DialogTitle> |
| | | <DialogContent> |
| | | <div>1</div> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}> |
| | | <Button onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}> |
| | | 确认 |
| | | </Button> |
| | | </Box> |
| | | </DialogActions> |
| | | </Dialog> |
| | | ); |
| | | } |
| | | |
| | | export default ImportModal; |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="uuid" label="table.field.warehouseAreas.uuid" />, |
| | | <TextInput source="name" label="table.field.warehouseAreas.name" />, |
| | |
| | | <SelectInput source="flagMinus" label="table.field.warehouseAreas.flagMinus" |
| | | choices={[ |
| | | { id: 0, name: '否' }, |
| | | { id: 1, name: '是' }, |
| | | { id: 1, name: '是' }, |
| | | ]} |
| | | />, |
| | | <SelectInput source="flagLabelMange" label="table.field.warehouseAreas.flagLabelMange" |
| | | choices={[ |
| | | { id: 0, name: ' 否' }, |
| | | { id: 1, name: ' 是' }, |
| | | { id: 1, name: ' 是' }, |
| | | ]} |
| | | />, |
| | | <SelectInput source="flagMix" label="table.field.warehouseAreas.flagMix" |
| | | choices={[ |
| | | { id: 0, name: '否' }, |
| | | { id: 1, name: '是' }, |
| | | { id: 1, name: '是' }, |
| | | ]} |
| | | />, |
| | | |
| | |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.warehouseAreas"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <NumberInput source="areaId" label="table.field.warehouseAreasItem.areaId" />, |
| | | <TextInput source="areaName" label="table.field.warehouseAreasItem.areaName" />, |
| | |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.warehouseAreasItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |