Merge branch 'front' into devlop
| | |
| | | maxPack: "MaxPack", |
| | | flagLabelMange: "FlagLabelMange", |
| | | locAttrs: "LocAttrs", |
| | | useStatus: 'useStatus' |
| | | useStatus: 'useStatus', |
| | | locAreaId: 'locAreaId' |
| | | }, |
| | | locType: { |
| | | uuid: "uuid", |
| | |
| | | locInit: 'loc init', |
| | | batch: 'batch', |
| | | confirm: 'confirm', |
| | | subzone: 'subzone' |
| | | }, |
| | | }; |
| | | |
| | |
| | | startBay: "起始列", |
| | | startLev: "起始层", |
| | | startRow: "起始排", |
| | | useStatus: '库位状态' |
| | | useStatus: '库位状态', |
| | | locAreaId: '逻辑分区' |
| | | }, |
| | | locType: { |
| | | name: "库位类型", |
| | |
| | | locInit: ' 库位初始化', |
| | | batch: '批量操作', |
| | | confirm: '确认', |
| | | subzone: '绑定分区' |
| | | }, |
| | | }; |
| | | |
| | |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | |
| | | const InitModal = ({ open, setOpen }) => { |
| | | const BatchModal = ({ open, setOpen }) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | | |
| | |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}> |
| | | <Button type="submit" variant="contained" startIcon={<SaveIcon />}> |
| | | 确认 |
| | | {translate('toolbar.confirm')} |
| | | </Button> |
| | | </Box> |
| | | </DialogActions> |
| | |
| | | ); |
| | | } |
| | | |
| | | export default InitModal; |
| | | export default BatchModal; |
| | |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}> |
| | | <Button type="submit" variant="contained" startIcon={<SaveIcon />}> |
| | | 确认 |
| | | {translate('toolbar.confirm')} |
| | | </Button> |
| | | </Box> |
| | | </DialogActions> |
| | |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import request from '@/utils/request'; |
| | | import DictionarySelect from "../../components/DictionarySelect"; |
| | | |
| | | const LocCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | |
| | | validate={required()} |
| | | /> |
| | | </Grid> */} |
| | | |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <DictionarySelect |
| | | label={translate("table.field.loc.useStatus")} |
| | | name="useStatus" |
| | | size="small" |
| | | dictTypeCode="sys_loc_use_stas" |
| | | /> |
| | | {/* <ReferenceInput |
| | | source="useStatus" |
| | | reference="dictData" |
| | | filter={{ dictTypeCode: 'sys_loc_use_stas' }} |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.useStatus" |
| | | optionText="label" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | validate={[required()]} |
| | | /> |
| | | </ReferenceInput> */} |
| | | </Grid> |
| | | |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import request from '@/utils/request'; |
| | | import DictionarySelect from "../../components/DictionarySelect"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <DictionarySelect |
| | | label={translate("table.field.loc.useStatus")} |
| | | name="useStatus" |
| | | size="small" |
| | | dictTypeCode="sys_loc_use_stas" |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | </Grid> |
| | |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import InitButton from './InitButton'; |
| | | import BatchModal from './BatchModal'; |
| | | import SubzoneModal from './SubzoneModal'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import MyField from "../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | |
| | | import DashboardIcon from '@mui/icons-material/Dashboard'; |
| | | import EditIcon from '@mui/icons-material/Edit'; |
| | | import request from '@/utils/request'; |
| | | |
| | | import DiscountIcon from '@mui/icons-material/Discount'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | bulkActionButtons={ |
| | | <> |
| | | <BatchButton /> |
| | | <SubzoneButton /> |
| | | <BulkDeleteButton /> |
| | | </> |
| | | } |
| | |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | const SubzoneButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.subzone"}> |
| | | <DiscountIcon /> |
| | | </Button> |
| | | |
| | | <SubzoneModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | </> |
| | | |
| | | ) |
| | | } |
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, |
| | | SelectArrayInput |
| | | } 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 DictionarySelect from "../../components/DictionarySelect"; |
| | | 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'; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | |
| | | const SubzoneModal = ({ open, setOpen }) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | | |
| | | |
| | | const notify = useNotify(); |
| | | |
| | | const [formData, setFormData] = useState({ |
| | | "warehouseId": null, |
| | | "areaId": null, |
| | | "type": null, |
| | | 'status': null |
| | | }); |
| | | |
| | | const { selectedIds, onUnselectItems } = useListContext(); |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | reset() |
| | | refresh(); |
| | | onUnselectItems() |
| | | } |
| | | }; |
| | | |
| | | const reset = () => { |
| | | setFormData({ |
| | | "locAreaId": null |
| | | }) |
| | | } |
| | | |
| | | const handleReset = (e) => { |
| | | e.preventDefault(); |
| | | }; |
| | | |
| | | const handleChange = (value, name) => { |
| | | setFormData((prevData) => ({ |
| | | ...prevData, |
| | | [name]: value |
| | | })); |
| | | refresh() |
| | | }; |
| | | |
| | | const removeEmptyKeys = (obj) => { |
| | | return _.pickBy(obj, (value) => { |
| | | if (_.isObject(value)) { |
| | | const newObj = removeEmptyKeys(value); |
| | | return !_.isEmpty(newObj); |
| | | } |
| | | return !_.isNil(value) && (_.isNumber(value) ? value !== 0 : !_.isEmpty(value)); |
| | | }); |
| | | } |
| | | |
| | | const handleSubmit = async () => { |
| | | const parmas = { |
| | | id: selectedIds, |
| | | ...removeEmptyKeys(formData) |
| | | } |
| | | |
| | | const res = await request.post(`/loc/batch/area`, parmas); |
| | | if (res?.data?.code === 200) { |
| | | handleClose() |
| | | |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Dialog open={open} maxWidth="md" fullWidth> |
| | | <Form onSubmit={handleSubmit}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | <DialogTitle>{translate('toolbar.subzone')}</DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={4}> |
| | | <ReferenceInput |
| | | source="locAreaId" |
| | | reference="locArea" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.locAreaId" |
| | | optionText="name" |
| | | onChange={(value) => handleChange(value, 'locAreaId')} |
| | | value={formData.locAreaId} |
| | | validate={required()} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | |
| | | </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 type="submit" variant="contained" startIcon={<SaveIcon />}> |
| | | {translate('toolbar.confirm')} |
| | | </Button> |
| | | </Box> |
| | | </DialogActions> |
| | | </Form> |
| | | </Dialog> |
| | | ); |
| | | } |
| | | |
| | | export default SubzoneModal; |
| | |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.locArea.areaId" |
| | | <ReferenceInput |
| | | source="areaId" |
| | | /> |
| | | reference="warehouseAreas" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.locArea.areaId" |
| | | optionText="name" |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | {/* <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="locId" |
| | | reference="loc" |
| | |
| | | filterToQuery={(val) => ({ warehouseId: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | </Grid> */} |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <StatusSelectInput /> |
| | |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.locArea.areaId" |
| | | <ReferenceInput |
| | | source="areaId" |
| | | /> |
| | | reference="warehouseAreas" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.locArea.areaId" |
| | | optionText="name" |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | |
| | | |
| | | {/* <Stack direction='row' gap={2}> |
| | | <ReferenceInput |
| | | source="locId" |
| | | reference="loc" |
| | |
| | | filterToQuery={(val) => ({ warehouseId: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Stack> |
| | | </Stack> */} |
| | | |
| | | </Grid> |
| | | <Grid item xs={12} md={4}> |
| | |
| | | <TextField source="name" label="table.field.locArea.name" /> |
| | | <TextField source="code" label="table.field.locArea.code" /> |
| | | <NumberField source="areaId" label="table.field.locArea.areaId" /> |
| | | <ReferenceField source="locId" label="table.field.locArea.locId" reference="loc" link={false} sortable={false}> |
| | | {/* <ReferenceField source="locId" label="table.field.locArea.locId" reference="loc" link={false} sortable={false}> |
| | | <TextField source="warehouseId" /> |
| | | </ReferenceField> |
| | | </ReferenceField> */} |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <SelectInput |
| | | label="table.field.matnr.isLabelMange" |
| | | source="isLabelMange" |
| | | source="flagLabelMange" |
| | | choices={[ |
| | | { id: 0, name: ' 否' }, |
| | | { id: 1, name: ' 是' }, |
| | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <SelectInput |
| | | label="table.field.matnr.isLabelMange" |
| | | source="isLabelMange" |
| | | source="flagLabelMange" |
| | | choices={[ |
| | | { id: 0, name: ' 否' }, |
| | | { id: 1, name: ' 是' }, |
| | |
| | | <TextField key="purchaseUnit" source="purchaseUnit" label="table.field.matnr.purUnit" />, |
| | | <TextField key="stockUnit" source="stockUnit" label="table.field.matnr.stockUnit" />, |
| | | <TextField key="stockLeval$" source="stockLeval$" label="table.field.matnr.stockLevel" sortable={false} />, |
| | | <TextField key="isLabelMange$" source="isLabelMange$" label="table.field.matnr.isLabelMange" sortable={false} />, |
| | | <TextField key="flagLabelMange$" source="flagLabelMange$" label="table.field.matnr.isLabelMange" sortable={false} />, |
| | | <NumberField key="safeQty" source="safeQty" label="table.field.matnr.safeQty" />, |
| | | <NumberField key="minQty" source="minQty" label="table.field.matnr.minQty" />, |
| | | <NumberField key="maxQty" source="maxQty" label="table.field.matnr.maxQty" />, |
| | |
| | | omit={['id', 'shipperId', 'platCode', 'spec', 'model', 'weight', 'color', 'describle' |
| | | , 'nromNum', 'unit', 'purchaseUnit', 'stockUnit', 'stockLeval', 'isLabelMange', 'safeQty' |
| | | , 'minQty', 'maxQty', 'stagn', 'valid', 'validWarn', 'flagCheck', 'updateTime', 'updateBy' |
| | | , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId', 'stockLevel', 'isLabelMange']} |
| | | , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId', 'stockLevel']} |
| | | > |
| | | {columns.map((column) => column)} |
| | | </StyledDatagrid>} |
| | |
| | | |
| | | <Box> |
| | | <div ref={contentRef}> |
| | | 11 |
| | | <table |
| | | className="contain" |
| | | style={{ |
| | | overflow: 'hidden', |
| | | fontSize: 'small', |
| | | tableLayout: 'fixed', |
| | | width: '280px', |
| | | borderCollapse: 'collapse', // 合并边框 |
| | | border: '1px solid black' // 设置表格整体边框 |
| | | }} |
| | | > |
| | | <tbody> |
| | | <tr style={{ height: '74px' }}> |
| | | <td |
| | | align="center" |
| | | colSpan={3} |
| | | style={{ border: '1px solid black' }} // 设置单元格边框 |
| | | > |
| | | 商品编码 |
| | | </td> |
| | | <td |
| | | align="center" |
| | | className="barcode" |
| | | colSpan={9} |
| | | style={{ border: '1px solid black' }} |
| | | > |
| | | {/* <img className="template-code" src={barcodeUrl} style={{ width: '90%' }} alt="Barcode" /> */} |
| | | <div style={{ letterSpacing: '2px', marginTop: '1px', textAlign: 'center' }}> |
| | | <span>{'matnr'}</span> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr style={{ height: '74px' }}> |
| | | <td |
| | | align="center" |
| | | colSpan={3} |
| | | style={{ border: '1px solid black' }} |
| | | > |
| | | 商品 |
| | | </td> |
| | | <td |
| | | align="center" |
| | | colSpan={5} |
| | | style={{ |
| | | overflow: 'hidden', |
| | | whiteSpace: 'nowrap', |
| | | textOverflow: 'ellipsis', |
| | | border: '1px solid black' |
| | | }} |
| | | > |
| | | {'maktx'} |
| | | </td> |
| | | <td |
| | | align="center" |
| | | colSpan={2} |
| | | style={{ border: '1px solid black' }} |
| | | > |
| | | 备注 |
| | | </td> |
| | | <td |
| | | align="center" |
| | | colSpan={2} |
| | | style={{ border: '1px solid black' }} |
| | | > |
| | | {'memo'} |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </Box> |
| | | </DialogContent> |