verou
2025-03-20 d54f1f6379ee80692e6762b89c3d1eef386fefa4
fix:批量修改
10个文件已修改
1个文件已添加
168 ■■■■■ 已修改文件
rsf-admin/package.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/pnpm-lock.yaml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/App.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/i18n/en.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/i18n/zh.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/asnOrder/AsnOrderModal.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/asnOrder/AsnWareModal.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/BatchModal.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/package.json
@@ -27,9 +27,11 @@
    "pixi.js": "^7.4.0",
    "prop-types": "^15.8.1",
    "ra-i18n-polyglot": "^5.6.2",
    "ra-language-chinese": "^2.0.10",
    "ra-language-english": "^5.6.2",
    "react": "^18.3.0",
    "react-admin": "^5.6.3",
    "react-barcode": "^1.6.1",
    "react-dom": "^18.3.0",
    "react-hook-form": "^7.53.0",
    "react-router": "^6.22.0",
rsf-admin/pnpm-lock.yaml
@@ -59,6 +59,9 @@
      ra-i18n-polyglot:
        specifier: ^5.6.2
        version: 5.6.2(react-dom@18.3.1(react@18.3.1))(react-hook-form@7.54.2(react@18.3.1))(react-router-dom@6.30.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router@6.30.0(react@18.3.1))(react@18.3.1)
      ra-language-chinese:
        specifier: ^2.0.10
        version: 2.0.10
      ra-language-english:
        specifier: ^5.6.2
        version: 5.6.2(react-dom@18.3.1(react@18.3.1))(react-hook-form@7.54.2(react@18.3.1))(react-router-dom@6.30.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router@6.30.0(react@18.3.1))(react@18.3.1)
@@ -68,6 +71,9 @@
      react-admin:
        specifier: ^5.6.3
        version: 5.6.3(@mui/utils@6.4.6(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0)(react@18.3.1)
      react-barcode:
        specifier: ^1.6.1
        version: 1.6.1(react@18.3.1)
      react-dom:
        specifier: ^18.3.0
        version: 18.3.1(react@18.3.1)
@@ -1832,6 +1838,9 @@
    resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
    hasBin: true
  jsbarcode@3.11.6:
    resolution: {integrity: sha512-G5TKGyKY1zJo0ZQKFM1IIMfy0nF2rs92BLlCz+cU4/TazIc4ZH+X1GYeDRt7TKjrYqmPfTjwTBkU/QnQlsYiuA==}
  jsesc@3.1.0:
    resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==}
    engines: {node: '>=6'}
@@ -2125,6 +2134,9 @@
  ra-i18n-polyglot@5.6.3:
    resolution: {integrity: sha512-tuzq//7wVA6+A1gsQB+WXhVCNS622YdkHDGNEFjp9sXezFhNdeak1zh7vWGuny6ssrbiWn2ItgjEGgw9dItYRQ==}
  ra-language-chinese@2.0.10:
    resolution: {integrity: sha512-k+X6XdkBEZnmpKIJZj9Lb77Lj8LCmterilJTj2ovp3i8/H/dLo9IujASfjFypjHnVUpN7Y63LT19kgPrS6+row==}
  ra-language-english@5.6.2:
    resolution: {integrity: sha512-afLZFHNnk3JEZUhZQSSv2nk4Rg69NiUiRiFuMnnImjWFKxICBN8Z1hKJhUauXrZdtyZslXl7nGYhVsuqxTOuQg==}
@@ -2153,6 +2165,11 @@
    peerDependencies:
      react: ^18.0.0 || ^19.0.0
      react-dom: ^18.0.0 || ^19.0.0
  react-barcode@1.6.1:
    resolution: {integrity: sha512-pc4ftnO5syHa/UjCruEeRsomlhoxKSugIgTA8T4dH0fvc89UMHL+/1Sp25IAphqG44pJkE5hMXhv89iS09jQyw==}
    peerDependencies:
      react: 16 - 19
  react-dom@18.3.1:
    resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==}
@@ -4420,6 +4437,8 @@
    dependencies:
      argparse: 2.0.1
  jsbarcode@3.11.6: {}
  jsesc@3.1.0: {}
  json-buffer@3.0.1: {}
@@ -4759,6 +4778,8 @@
      - react-router
      - react-router-dom
  ra-language-chinese@2.0.10: {}
  ra-language-english@5.6.2(react-dom@18.3.1(react@18.3.1))(react-hook-form@7.54.2(react@18.3.1))(react-router-dom@6.30.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router@6.30.0(react@18.3.1))(react@18.3.1):
    dependencies:
      ra-core: 5.6.2(react-dom@18.3.1(react@18.3.1))(react-hook-form@7.54.2(react@18.3.1))(react-router-dom@6.30.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router@6.30.0(react@18.3.1))(react@18.3.1)
@@ -4827,6 +4848,12 @@
      - react-is
      - supports-color
  react-barcode@1.6.1(react@18.3.1):
    dependencies:
      jsbarcode: 3.11.6
      prop-types: 15.8.1
      react: 18.3.1
  react-dom@18.3.1(react@18.3.1):
    dependencies:
      loose-envify: 1.4.0
rsf-admin/src/App.jsx
@@ -29,18 +29,16 @@
} from "./config/setting";
import ResourceContent from "./page/ResourceContent";
import { getSystemInfo, getSystemDicts, tenants } from "@/api/auth";
import chineseMessages from 'ra-language-chinese';
const i18nProvider = polyglotI18nProvider(
  (locale) => {
    if (locale === "en") {
      return import("./i18n/en").then((messages) => messages.default);
    }
    // fallback
    return zhMessages;
    return { ...chineseMessages, ...zhMessages };
  },
  // default
  // 'en',
  resolveBrowserLocale("zh", { fullLocale: true }),
  "zh",
  [
    { locale: "en", name: "English" },
    { locale: "zh", name: "简体中文" },
@@ -111,4 +109,4 @@
  </StoreContextProvider>
);
export default AppWrapper;
export default AppWrapper;
rsf-admin/src/i18n/en.js
@@ -624,6 +624,7 @@
        unenable: 'unenable',
        locInit: 'loc init',
        batch: 'batch',
        confirm: 'confirm',
    },
};
rsf-admin/src/i18n/zh.js
@@ -626,6 +626,7 @@
        unenable: '禁用',
        locInit: ' 库位初始化',
        batch: '批量操作',
        confirm: '确认',
    },
};
rsf-admin/src/page/asnOrder/AsnOrderModal.jsx
@@ -216,7 +216,7 @@
                <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
                    <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }}  >
                        <Button onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}>
                            确认
                            {translate('toolbar.confirm')}
                        </Button>
                    </Toolbar>
                </DialogActions>
rsf-admin/src/page/asnOrder/AsnWareModal.jsx
@@ -144,7 +144,7 @@
            <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 />}>
                        确认
                        {translate('toolbar.confirm')}
                    </Button>
                </Box>
            </DialogActions>
rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx
@@ -60,8 +60,6 @@
const filters = [
    <SearchInput source="condition" alwaysOn />,
    <DateInput label='common.time.after' source="timeStart" alwaysOn />,
    <DateInput label='common.time.before' source="timeEnd" alwaysOn />,
    <TextInput source="name" label="table.field.locArea.name" />,
    <TextInput source="code" label="table.field.locArea.code" />,
rsf-admin/src/page/basicInfo/matnr/BatchModal.jsx
@@ -140,7 +140,7 @@
                <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>
rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
@@ -51,8 +51,10 @@
import { display, height, width } from "@mui/system";
import DashboardIcon from '@mui/icons-material/Dashboard';
import EditIcon from '@mui/icons-material/Edit';
import PrintIcon from '@mui/icons-material/Print';
import request from '@/utils/request';
import BatchModal from './BatchModal';
import PrintModal from './PrintModal';
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -235,7 +237,11 @@
            {columns.length > 0 &&
                <StyledDatagrid
                    preferenceKey='matnr'
                    bulkActionButtons={<> <BatchButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>}
                    bulkActionButtons={<>
                        <BatchButton />
                        <PrintButton />
                        <BulkDeleteButton mutationMode={OPERATE_MODE} />
                    </>}
                    rowClick={(id, resource, record) => false}
                    omit={['id', 'shipperId', 'platCode', 'spec', 'model', 'weight', 'color', 'describle'
                        , 'nromNum', 'unit', 'purchaseUnit', 'stockUnit', 'stockLeval', 'isLabelMange', 'safeQty'
@@ -350,4 +356,26 @@
        </>
    )
}
const PrintButton = () => {
    const record = useRecordContext();
    const notify = useNotify();
    const refresh = useRefresh();
    const [createDialog, setCreateDialog] = useState(false);
    return (
        <>
            <Button color="secondary" onClick={() => setCreateDialog(true)} label={"toolbar.print"}>
                <PrintIcon />
            </Button>
            <PrintModal
                open={createDialog}
                setOpen={setCreateDialog}
            />
        </>
    )
}
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
New file
@@ -0,0 +1,89 @@
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 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 InitModal = ({ open, setOpen }) => {
    const refresh = useRefresh();
    const translate = useTranslate();
    const notify = useNotify();
    const handleClose = (event, reason) => {
        if (reason !== "backdropClick") {
            setOpen(false);
        }
    };
    return (
        <Dialog open={open} maxWidth="sm" fullWidth>
            <DialogCloseButton onClose={handleClose} />
            <DialogTitle>{translate('toolbar.print')}</DialogTitle>
            <DialogContent sx={{ mt: 2 }}>
                1
            </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 />}>
                        {translate('toolbar.confirm')}
                    </Button>
                </Box>
            </DialogActions>
        </Dialog>
    );
}
export default InitModal;