verou
2025-03-21 b8c980574e7868281624a244df93299e1aaa8596
fix:仓库和库区联动
11个文件已修改
132 ■■■■ 已修改文件
rsf-admin/.env 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/pnpm-lock.yaml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/BatchModal.jsx 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/InitModal.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/LocCreate.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/LocEdit.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/BatchModal.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/warehouseAreas/WarehouseAreasCreate.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/.env
@@ -1,3 +1,3 @@
VITE_BASE_IP=192.168.4.24
# VITE_BASE_IP=47.76.147.249
# VITE_BASE_IP=192.168.4.24
VITE_BASE_IP=47.76.147.249
VITE_BASE_PORT=8080
rsf-admin/package.json
@@ -37,6 +37,7 @@
    "react-router": "^6.22.0",
    "react-router-dom": "^6.26.1",
    "react-syntax-highlighter": "^15.5.0",
    "react-to-print": "^3.0.5",
    "three": "^0.155.0",
    "tweedle.js": "^2.1.0"
  },
rsf-admin/pnpm-lock.yaml
@@ -89,6 +89,9 @@
      react-syntax-highlighter:
        specifier: ^15.5.0
        version: 15.6.1(react@18.3.1)
      react-to-print:
        specifier: ^3.0.5
        version: 3.0.5(react@18.3.1)
      three:
        specifier: ^0.155.0
        version: 0.155.0
@@ -2244,6 +2247,11 @@
    resolution: {integrity: sha512-OqJ2/vL7lEeV5zTJyG7kmARppUjiB9h9udl4qHQjjgEos66z00Ia0OckwYfRxCSFrW8RJIBnsBwQsHZbVPspqg==}
    peerDependencies:
      react: '>= 0.14.0'
  react-to-print@3.0.5:
    resolution: {integrity: sha512-Z15MwMOzYCHWi26CZeFNwflAg7Nr8uWD6FTj+EkfIOjYyjr0MXGbI0c7rF4Fgrbj3XG9hFndb1ourxpPz2RAiA==}
    peerDependencies:
      react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ~19
  react-transition-group@4.4.5:
    resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==}
@@ -4921,6 +4929,10 @@
      react: 18.3.1
      refractor: 3.6.0
  react-to-print@3.0.5(react@18.3.1):
    dependencies:
      react: 18.3.1
  react-transition-group@4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
    dependencies:
      '@babel/runtime': 7.26.9
rsf-admin/src/page/basicInfo/loc/BatchModal.jsx
@@ -19,6 +19,7 @@
    useCreateController,
    useListContext,
    useRefresh,
    SelectArrayInput
} from 'react-admin';
import {
    Dialog,
@@ -38,7 +39,8 @@
    TableCell,
    Tooltip,
    IconButton,
    styled
    styled,
} from '@mui/material';
@@ -53,7 +55,6 @@
import StatusSelectInput from "../../components/StatusSelectInput";
const InitModal = ({ open, setOpen }) => {
    const refresh = useRefresh();
    const translate = useTranslate();
@@ -62,6 +63,7 @@
    const notify = useNotify();
    const [formData, setFormData] = useState({
        "warehouseId": null,
        "areaId": null,
        "type": null,
        'status': null
@@ -80,8 +82,10 @@
    const reset = () => {
        setFormData({
            "warehouseId": null,
            "areaId": null,
            "type": null,
            "typeIds": null,
            'status': null
        })
    }
@@ -95,6 +99,7 @@
            ...prevData,
            [name]: value
        }));
        refresh()
    };
    const removeEmptyKeys = (obj) => {
@@ -132,8 +137,25 @@
                        <Grid container spacing={2}>
                            <Grid item xs={4}>
                                <ReferenceInput
                                    source="warehouseId"
                                    reference="warehouse"
                                >
                                    <AutocompleteInput
                                        label="table.field.loc.warehouseId"
                                        optionText="name"
                                        onChange={(value) => handleChange(value, 'warehouseId')}
                                        value={formData.warehouseId}
                                        filterToQuery={(val) => ({ name: val })}
                                    />
                                </ReferenceInput>
                            </Grid>
                            <Grid item xs={4}>
                                <ReferenceInput
                                    source="areaId"
                                    reference="warehouseAreas"
                                    filter={{ warehouseId: formData.warehouseId }}
                                >
                                    <AutocompleteInput
                                        label="table.field.loc.areaId"
@@ -147,14 +169,17 @@
                            </Grid>
                            <Grid item xs={4}>
                                <DictionarySelect
                                {/* <DictionarySelect
                                    label={translate("table.field.loc.type")}
                                    name="type"
                                    value={formData.type}
                                    onChange={(e) => handleChange(e.target.value, 'type')}
                                    size="small"
                                    dictTypeCode="sys_loc_type"
                                />
                                /> */}
                                <ReferenceArrayInput source="typeIds" reference="locType" >
                                    <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} />
                                </ReferenceArrayInput>
                            </Grid>
                            <Grid item xs={4}>
rsf-admin/src/page/basicInfo/loc/InitModal.jsx
@@ -19,6 +19,7 @@
    useCreateController,
    useListContext,
    useRefresh,
    SelectArrayInput
} from 'react-admin';
import {
    Dialog,
@@ -70,7 +71,8 @@
        "startBay": undefined,
        "startLev": undefined,
        "startRow": undefined,
        "type": ""
        "type": "",
        "typeIds": undefined,
    });
    const handleClose = (event, reason) => {
@@ -138,15 +140,9 @@
                            </Grid>
                            <Grid item xs={4}>
                                <DictionarySelect
                                    label={translate("table.field.loc.type")}
                                    name="type"
                                    value={formData.type}
                                    onChange={(e) => handleChange(e.target.value, 'type')}
                                    size="small"
                                    validate={[required()]}
                                    dictTypeCode="sys_loc_type"
                                />
                                <ReferenceArrayInput source="typeIds" reference="locType" >
                                    <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} />
                                </ReferenceArrayInput>
                            </Grid>
                            <Grid item xs={4}>
rsf-admin/src/page/basicInfo/loc/LocCreate.jsx
@@ -54,7 +54,11 @@
        notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } });
    };
    const [warehouseId, setWrehouseId] = useState();
    const warehouseChange = (val) => {
        setWrehouseId(val)
    }
    return (
@@ -98,6 +102,7 @@
                                            label="table.field.loc.warehouseId"
                                            optionText="name"
                                            validate={[required()]}
                                            onChange={warehouseChange}
                                            filterToQuery={(val) => ({ name: val })}
                                        />
                                    </ReferenceInput>
@@ -106,6 +111,7 @@
                                    <ReferenceInput
                                        source="areaId"
                                        reference="warehouseAreas"
                                        filter={{ warehouseId }}
                                    >
                                        <AutocompleteInput
                                            label="table.field.loc.areaId"
rsf-admin/src/page/basicInfo/loc/LocEdit.jsx
@@ -46,7 +46,11 @@
const LocEdit = () => {
    const translate = useTranslate();
    const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || [];
    const [warehouseId, setWrehouseId] = useState();
    const warehouseChange = (val) => {
        setWrehouseId(val)
    }
    return (
        <Edit
@@ -78,6 +82,7 @@
                                        label="table.field.loc.warehouseId"
                                        optionText="name"
                                        validate={[required()]}
                                        onChange={warehouseChange}
                                        filterToQuery={(val) => ({ name: val })}
                                    />
                                </ReferenceInput>
@@ -86,6 +91,7 @@
                                <ReferenceInput
                                    source="areaId"
                                    reference="warehouseAreas"
                                    filter={{ warehouseId }}
                                >
                                    <AutocompleteInput
                                        label="table.field.loc.areaId"
rsf-admin/src/page/basicInfo/matnr/BatchModal.jsx
@@ -52,8 +52,6 @@
import { DataGrid } from '@mui/x-data-grid';
import StatusSelectInput from "../../components/StatusSelectInput";
const InitModal = ({ open, setOpen }) => {
    const refresh = useRefresh();
    const translate = useTranslate();
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
@@ -29,11 +29,11 @@
    TextField,
    Box,
    Button,
    Paper,
    TableContainer,
    Table,
    TableHead,
    TableBody,
    Radio,
    RadioGroup,
    FormControlLabel,
    FormControl,
    FormLabel,
    TableRow,
    TableCell,
    Tooltip,
@@ -52,15 +52,14 @@
import { DataGrid } from '@mui/x-data-grid';
import StatusSelectInput from "../../components/StatusSelectInput";
import { useReactToPrint } from "react-to-print";
const InitModal = ({ open, setOpen }) => {
    const refresh = useRefresh();
    const translate = useTranslate();
    const notify = useNotify();
    const contentRef = useRef(null);
    const reactToPrintFn = useReactToPrint({ contentRef });
    const handleClose = (event, reason) => {
        if (reason !== "backdropClick") {
@@ -68,16 +67,43 @@
        }
    };
    const [value, setValue] = useState('temp1');
    const handleChange = (event) => {
        setValue(event.target.value);
    };
    const handlePrint = () => {
        // handleClose()
        reactToPrintFn()
    };
    return (
        <Dialog open={open} maxWidth="sm" fullWidth>
            <DialogCloseButton onClose={handleClose} />
            <DialogTitle>{translate('toolbar.print')}</DialogTitle>
            <DialogContent sx={{ mt: 2 }}>
                1
            <DialogContent >
                <FormControl >
                    <RadioGroup
                        row
                        aria-labelledby="demo-controlled-radio-buttons-group"
                        name="controlled-radio-buttons-group"
                        value={value}
                        onChange={handleChange}
                        size="small"
                        sx={{ justifyContent: 'center' }}
                    >
                        <FormControlLabel value="temp1" control={<Radio />} label="模板1" size="small" />
                    </RadioGroup>
                </FormControl>
                <Box>
                    <div ref={contentRef}>11</div>
                </Box>
            </DialogContent>
            <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
                <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}>
                    <Button onClick={handleClose} variant="contained" startIcon={<SaveIcon />}>
                    <Button onClick={handlePrint} variant="contained" startIcon={<SaveIcon />}>
                        {translate('toolbar.confirm')}
                    </Button>
                </Box>
rsf-admin/src/page/warehouseAreas/WarehouseAreasCreate.jsx
@@ -124,6 +124,7 @@
                    <AutocompleteInput
                      label="table.field.warehouseAreas.wareId"
                      optionText="name"
                      validate={[required()]}
                      filterToQuery={(val) => ({ name: val })}
                    />
                  </ReferenceInput>
rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx
@@ -96,6 +96,7 @@
                                <AutocompleteInput
                                    label="table.field.warehouseAreas.wareId"
                                    optionText="name"
                                    validate={[required()]}
                                    filterToQuery={(val) => ({ name: val })}
                                />
                            </ReferenceInput>