From d54f1f6379ee80692e6762b89c3d1eef386fefa4 Mon Sep 17 00:00:00 2001
From: verou <857149855@qq.com>
Date: 星期四, 20 三月 2025 17:07:55 +0800
Subject: [PATCH] fix:批量修改
---
rsf-admin/src/page/basicInfo/matnr/BatchModal.jsx | 2
rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx | 2
rsf-admin/package.json | 2
rsf-admin/src/page/asnOrder/AsnWareModal.jsx | 2
rsf-admin/src/i18n/zh.js | 1
rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx | 30 +++++++++
rsf-admin/pnpm-lock.yaml | 27 +++++++++
rsf-admin/src/i18n/en.js | 1
rsf-admin/src/App.jsx | 10 +--
rsf-admin/src/page/asnOrder/AsnOrderModal.jsx | 2
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx | 89 +++++++++++++++++++++++++++++
11 files changed, 156 insertions(+), 12 deletions(-)
diff --git a/rsf-admin/package.json b/rsf-admin/package.json
index 69d4315..18c05b2 100644
--- a/rsf-admin/package.json
+++ b/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",
diff --git a/rsf-admin/pnpm-lock.yaml b/rsf-admin/pnpm-lock.yaml
index 7551cb5..c99442f 100644
--- a/rsf-admin/pnpm-lock.yaml
+++ b/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
diff --git a/rsf-admin/src/App.jsx b/rsf-admin/src/App.jsx
index 328a4b6..9efadba 100644
--- a/rsf-admin/src/App.jsx
+++ b/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;
\ No newline at end of file
diff --git a/rsf-admin/src/i18n/en.js b/rsf-admin/src/i18n/en.js
index 179b968..72fc56e 100644
--- a/rsf-admin/src/i18n/en.js
+++ b/rsf-admin/src/i18n/en.js
@@ -624,6 +624,7 @@
unenable: 'unenable',
locInit: 'loc init',
batch: 'batch',
+ confirm: 'confirm',
},
};
diff --git a/rsf-admin/src/i18n/zh.js b/rsf-admin/src/i18n/zh.js
index d529ca9..3a328f8 100644
--- a/rsf-admin/src/i18n/zh.js
+++ b/rsf-admin/src/i18n/zh.js
@@ -626,6 +626,7 @@
unenable: '绂佺敤',
locInit: '聽搴撲綅鍒濆鍖�',
batch: '鎵归噺鎿嶄綔',
+ confirm: '纭',
},
};
diff --git a/rsf-admin/src/page/asnOrder/AsnOrderModal.jsx b/rsf-admin/src/page/asnOrder/AsnOrderModal.jsx
index 01da591..57035a4 100644
--- a/rsf-admin/src/page/asnOrder/AsnOrderModal.jsx
+++ b/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>
diff --git a/rsf-admin/src/page/asnOrder/AsnWareModal.jsx b/rsf-admin/src/page/asnOrder/AsnWareModal.jsx
index a3d58ce..41750a4 100644
--- a/rsf-admin/src/page/asnOrder/AsnWareModal.jsx
+++ b/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>
diff --git a/rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx b/rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx
index d249f05..0c55a6a 100644
--- a/rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx
+++ b/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" />,
diff --git a/rsf-admin/src/page/basicInfo/matnr/BatchModal.jsx b/rsf-admin/src/page/basicInfo/matnr/BatchModal.jsx
index 24f97f7..9a461af 100644
--- a/rsf-admin/src/page/basicInfo/matnr/BatchModal.jsx
+++ b/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>
diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
index 4ad39a5..ba9be18 100644
--- a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
+++ b/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}
+ />
+ </>
+
+ )
}
\ No newline at end of file
diff --git a/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx b/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
new file mode 100644
index 0000000..46c4d0d
--- /dev/null
+++ b/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
@@ -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;
\ No newline at end of file
--
Gitblit v1.9.1