Merge branch 'front' into devlop
| | |
| | | "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", |
| | |
| | | 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) |
| | |
| | | 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) |
| | |
| | | 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'} |
| | |
| | | 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==} |
| | | |
| | |
| | | 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==} |
| | |
| | | dependencies: |
| | | argparse: 2.0.1 |
| | | |
| | | jsbarcode@3.11.6: {} |
| | | |
| | | jsesc@3.1.0: {} |
| | | |
| | | json-buffer@3.0.1: {} |
| | |
| | | - 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) |
| | |
| | | - 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 |
| | |
| | | } 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: "简体中文" }, |
| | |
| | | </StoreContextProvider> |
| | | ); |
| | | |
| | | export default AppWrapper; |
| | | export default AppWrapper; |
| | |
| | | warehouseAreas: 'WarehouseAreas', |
| | | loc: 'Loc', |
| | | locType: 'LocType', |
| | | locArea: 'locArea', |
| | | container: 'Container', |
| | | contract: 'Contract', |
| | | qlyInspect: 'QlyInspect', |
| | |
| | | unenable: 'unenable', |
| | | locInit: 'loc init', |
| | | batch: 'batch', |
| | | confirm: 'confirm', |
| | | }, |
| | | }; |
| | | |
| | |
| | | warehouseAreas: '仓库库区', |
| | | loc: '基础库位', |
| | | locType: '库位类型', |
| | | locArea: '逻辑分区', |
| | | container: '容器管理', |
| | | contract: '合同信息', |
| | | qlyInspect: '质检信息', |
| | |
| | | unenable: '禁用', |
| | | locInit: ' 库位初始化', |
| | | batch: '批量操作', |
| | | confirm: '确认', |
| | | }, |
| | | }; |
| | | |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | |
| | | 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" />, |
| | |
| | | <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 { 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': { |
| | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const { isLoading } = useListContext(); |
| | | const [dynamicFields, setDynamicFields] = useState([]); |
| | | |
| | | const [columns, setColumns] = useState([]); |
| | | const refresh = useRefresh(); |
| | | const { refetch } = useListContext(); |
| | | |
| | |
| | | data: { code, data, msg }, |
| | | } = await request.get("/fields/enable/list"); |
| | | if (code === 200) { |
| | | setDynamicFields(data); |
| | | refresh(); |
| | | const arr = [ |
| | | <NumberField key="id" source="id" />, |
| | | <TooltipField key="name" source="name" label="table.field.matnr.name" cellClassName="name" />, |
| | | <TextField key="code" source="code" label="table.field.matnr.code" />, |
| | | <TextField key="shipperId$" source="shipperId$" label="table.field.matnr.shipperId" />, |
| | | <ReferenceField key="groupId" source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField>, |
| | | <TextField key="platCode" source="platCode" label="table.field.matnr.platCode" />, |
| | | <TextField key="spec" source="spec" label="table.field.matnr.spec" />, |
| | | <TextField key="model" source="model" label="table.field.matnr.model" />, |
| | | <NumberField key="weight" source="weight" label="table.field.matnr.weight" />, |
| | | <TextField key="describle" source="describle" label="table.field.matnr.describle" />, |
| | | <NumberField key="nromNum" source="nromNum" label="table.field.matnr.nromNum" />, |
| | | <TextField key="unit" source="unit" label="table.field.matnr.unit" />, |
| | | <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} />, |
| | | <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" />, |
| | | <NumberField key="stagn" source="stagn" label="table.field.matnr.stagn" />, |
| | | <NumberField key="valid" source="valid" label="table.field.matnr.valid" />, |
| | | <NumberField key="validWarn" source="validWarn" label="table.field.matnr.validWarn" />, |
| | | <NumberField key="flagCheck" source="flagCheck" label="table.field.matnr.flagCheck" />, |
| | | <ReferenceField key="updateBy" source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField>, |
| | | <DateField key="updateTime" source="updateTime" label="common.field.updateTime" showTime />, |
| | | <ReferenceField key="createBy" source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField>, |
| | | <DateField key="createTime" source="createTime" label="common.field.createTime" showTime />, |
| | | <BooleanField key="statusBool" source="statusBool" label="common.field.status" sortable={false} />, |
| | | <TextField key="memo" source="memo" label="common.field.memo" sortable={false} />, |
| | | ] |
| | | const fields = data.map(el => <TextField key={el.fields} source={el.fields} label={el.fieldsAlise} />) |
| | | const opt = <WrapperField key="opt" cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <EnableButton /> |
| | | </WrapperField> |
| | | setColumns([...arr, ...fields, opt]); |
| | | |
| | | } else { |
| | | notify(msg); |
| | | } |
| | |
| | | notify('请求出错'); |
| | | } |
| | | }; |
| | | |
| | | const columns = [ |
| | | <NumberField key="id" source="id" />, |
| | | <TooltipField key="name" source="name" label="table.field.matnr.name" cellClassName="name" />, |
| | | <TextField key="code" source="code" label="table.field.matnr.code" />, |
| | | <TextField key="shipperId$" source="shipperId$" label="table.field.matnr.shipperId" />, |
| | | <ReferenceField key="groupId" source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField>, |
| | | <TextField key="platCode" source="platCode" label="table.field.matnr.platCode" />, |
| | | <TextField key="spec" source="spec" label="table.field.matnr.spec" />, |
| | | <TextField key="model" source="model" label="table.field.matnr.model" />, |
| | | <NumberField key="weight" source="weight" label="table.field.matnr.weight" />, |
| | | <TextField key="describle" source="describle" label="table.field.matnr.describle" />, |
| | | <NumberField key="nromNum" source="nromNum" label="table.field.matnr.nromNum" />, |
| | | <TextField key="unit" source="unit" label="table.field.matnr.unit" />, |
| | | <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} />, |
| | | <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" />, |
| | | <NumberField key="stagn" source="stagn" label="table.field.matnr.stagn" />, |
| | | <NumberField key="valid" source="valid" label="table.field.matnr.valid" />, |
| | | <NumberField key="validWarn" source="validWarn" label="table.field.matnr.validWarn" />, |
| | | <NumberField key="flagCheck" source="flagCheck" label="table.field.matnr.flagCheck" />, |
| | | <ReferenceField key="updateBy" source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField>, |
| | | <DateField key="updateTime" source="updateTime" label="common.field.updateTime" showTime />, |
| | | <ReferenceField key="createBy" source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField>, |
| | | <DateField key="createTime" source="createTime" label="common.field.createTime" showTime />, |
| | | <BooleanField key="statusBool" source="statusBool" label="common.field.status" sortable={false} />, |
| | | <TextField key="memo" source="memo" label="common.field.memo" sortable={false} />, |
| | | <WrapperField key="opt" cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <EnableButton /> |
| | | </WrapperField> |
| | | ]; |
| | | |
| | | return ( |
| | | <Box sx={{ position: 'relative', minHeight: "60vh", }}> |
| | |
| | | /> |
| | | )} |
| | | |
| | | <StyledDatagrid |
| | | preferenceKey='matnr' |
| | | bulkActionButtons={<> <BatchButton /><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' |
| | | , 'minQty', 'maxQty', 'stagn', 'valid', 'validWarn', 'flagCheck', 'updateTime', 'updateBy' |
| | | , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId', 'stockLevel', 'isLabelMange']} |
| | | > |
| | | {columns.map((column) => column)} |
| | | </StyledDatagrid> |
| | | {columns.length > 0 && |
| | | <StyledDatagrid |
| | | preferenceKey='matnr' |
| | | 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' |
| | | , 'minQty', 'maxQty', 'stagn', 'valid', 'validWarn', 'flagCheck', 'updateTime', 'updateBy' |
| | | , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId', 'stockLevel', 'isLabelMange']} |
| | | > |
| | | {columns.map((column) => column)} |
| | | </StyledDatagrid>} |
| | | </Box> |
| | | ); |
| | | } |
| | |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | 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} |
| | | /> |
| | | </> |
| | | |
| | | ) |
| | | } |
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 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; |
| | |
| | | const [proxyVal, setProxyVal] = React.useState(''); |
| | | |
| | | const record = useRecordContext() |
| | | const val = value || record[source]; |
| | | const val = value || record?.[source]; |
| | | |
| | | useEffect(() => { |
| | | const http = async (resource) => { |
| | |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="wareId" |
| | | source="warehouseId" |
| | | reference="warehouse" |
| | | > |
| | | <AutocompleteInput |
| | |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <ReferenceInput |
| | | source="wareId" |
| | | source="warehouseId" |
| | | reference="warehouse" |
| | | > |
| | | <AutocompleteInput |