From 65a30e30a0df5d92bdf5290a636db56ca79b9562 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期五, 21 三月 2025 13:09:31 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/basicInfo/locArea/LocAreaEdit.jsx | 18 + rsf-admin/src/page/basicInfo/loc/BatchModal.jsx | 6 rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx | 4 rsf-admin/src/page/basicInfo/loc/SubzoneModal.jsx | 167 +++++++++++++++++++++++ rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx | 2 rsf-admin/src/page/basicInfo/loc/LocList.jsx | 27 +++ rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx | 2 rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx | 70 +++++++++ rsf-admin/src/page/basicInfo/loc/InitModal.jsx | 2 rsf-admin/src/page/basicInfo/loc/LocCreate.jsx | 24 +++ rsf-admin/src/page/basicInfo/locArea/LocAreaCreate.jsx | 16 + rsf-admin/src/i18n/zh.js | 4 rsf-admin/src/page/basicInfo/loc/LocEdit.jsx | 10 + rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx | 4 rsf-admin/src/i18n/en.js | 4 rsf-server/src/main/resources/application-dev.yml | 2 16 files changed, 334 insertions(+), 28 deletions(-) diff --git a/rsf-admin/src/i18n/en.js b/rsf-admin/src/i18n/en.js index dad32ca..cb54b18 100644 --- a/rsf-admin/src/i18n/en.js +++ b/rsf-admin/src/i18n/en.js @@ -354,7 +354,8 @@ maxPack: "MaxPack", flagLabelMange: "FlagLabelMange", locAttrs: "LocAttrs", - useStatus: 'useStatus' + useStatus: 'useStatus', + locAreaId: 'locAreaId' }, locType: { uuid: "uuid", @@ -626,6 +627,7 @@ locInit: 'loc init', batch: 'batch', confirm: 'confirm', + subzone: 'subzone' }, }; diff --git a/rsf-admin/src/i18n/zh.js b/rsf-admin/src/i18n/zh.js index f2ae4ea..f94b280 100644 --- a/rsf-admin/src/i18n/zh.js +++ b/rsf-admin/src/i18n/zh.js @@ -355,7 +355,8 @@ startBay: "璧峰鍒�", startLev: "璧峰灞�", startRow: "璧峰鎺�", - useStatus: '搴撲綅鐘舵��' + useStatus: '搴撲綅鐘舵��', + locAreaId: '閫昏緫鍒嗗尯' }, locType: { name: "搴撲綅绫诲瀷", @@ -628,6 +629,7 @@ locInit: '聽搴撲綅鍒濆鍖�', batch: '鎵归噺鎿嶄綔', confirm: '纭', + subzone: '缁戝畾鍒嗗尯' }, }; diff --git a/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx b/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx index 92b5fe3..4a4c023 100644 --- a/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx +++ b/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx @@ -55,7 +55,7 @@ import StatusSelectInput from "../../components/StatusSelectInput"; -const InitModal = ({ open, setOpen }) => { +const BatchModal = ({ open, setOpen }) => { const refresh = useRefresh(); const translate = useTranslate(); @@ -197,7 +197,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> @@ -206,4 +206,4 @@ ); } -export default InitModal; \ No newline at end of file +export default BatchModal; \ No newline at end of file diff --git a/rsf-admin/src/page/basicInfo/loc/InitModal.jsx b/rsf-admin/src/page/basicInfo/loc/InitModal.jsx index eab60e8..a677559 100644 --- a/rsf-admin/src/page/basicInfo/loc/InitModal.jsx +++ b/rsf-admin/src/page/basicInfo/loc/InitModal.jsx @@ -224,7 +224,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/loc/LocCreate.jsx b/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx index 9b368c1..3f63d03 100644 --- a/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx +++ b/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx @@ -32,6 +32,7 @@ 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; @@ -264,8 +265,27 @@ 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}> diff --git a/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx b/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx index 89ad805..b1b1ed5 100644 --- a/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx +++ b/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx @@ -31,6 +31,7 @@ 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(); @@ -172,7 +173,14 @@ 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> diff --git a/rsf-admin/src/page/basicInfo/loc/LocList.jsx b/rsf-admin/src/page/basicInfo/loc/LocList.jsx index e369620..dda2264 100644 --- a/rsf-admin/src/page/basicInfo/loc/LocList.jsx +++ b/rsf-admin/src/page/basicInfo/loc/LocList.jsx @@ -45,6 +45,7 @@ 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'; @@ -52,7 +53,7 @@ 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': { @@ -142,6 +143,7 @@ bulkActionButtons={ <> <BatchButton /> + <SubzoneButton /> <BulkDeleteButton /> </> } @@ -252,4 +254,27 @@ </> ) +} + +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} + /> + </> + + ) } \ No newline at end of file diff --git a/rsf-admin/src/page/basicInfo/loc/SubzoneModal.jsx b/rsf-admin/src/page/basicInfo/loc/SubzoneModal.jsx new file mode 100644 index 0000000..b67aa82 --- /dev/null +++ b/rsf-admin/src/page/basicInfo/loc/SubzoneModal.jsx @@ -0,0 +1,167 @@ +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; \ No newline at end of file diff --git a/rsf-admin/src/page/basicInfo/locArea/LocAreaCreate.jsx b/rsf-admin/src/page/basicInfo/locArea/LocAreaCreate.jsx index 98c6dc2..38ac67a 100644 --- a/rsf-admin/src/page/basicInfo/locArea/LocAreaCreate.jsx +++ b/rsf-admin/src/page/basicInfo/locArea/LocAreaCreate.jsx @@ -100,12 +100,18 @@ /> </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" @@ -116,7 +122,7 @@ filterToQuery={(val) => ({ warehouseId: val })} /> </ReferenceInput> - </Grid> + </Grid> */} <Grid item xs={6} display="flex" gap={1}> <StatusSelectInput /> diff --git a/rsf-admin/src/page/basicInfo/locArea/LocAreaEdit.jsx b/rsf-admin/src/page/basicInfo/locArea/LocAreaEdit.jsx index d1bef1a..afd0a4c 100644 --- a/rsf-admin/src/page/basicInfo/locArea/LocAreaEdit.jsx +++ b/rsf-admin/src/page/basicInfo/locArea/LocAreaEdit.jsx @@ -79,12 +79,20 @@ /> </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" @@ -96,7 +104,7 @@ filterToQuery={(val) => ({ warehouseId: val })} /> </ReferenceInput> - </Stack> + </Stack> */} </Grid> <Grid item xs={12} md={4}> diff --git a/rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx b/rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx index 0c55a6a..ff1f348 100644 --- a/rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx +++ b/rsf-admin/src/page/basicInfo/locArea/LocAreaList.jsx @@ -123,9 +123,9 @@ <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" /> diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx index 80240de..04b4d48 100644 --- a/rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx +++ b/rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx @@ -274,7 +274,7 @@ <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: ' 鏄�' }, diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx index 96274af..8cb7351 100644 --- a/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx +++ b/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx @@ -255,7 +255,7 @@ <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: ' 鏄�' }, diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx index 98e6a0c..3140810 100644 --- a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx +++ b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx @@ -186,7 +186,7 @@ <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" />, @@ -246,7 +246,7 @@ 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>} diff --git a/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx b/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx index 4bb496e..a0095c1 100644 --- a/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx +++ b/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx @@ -99,7 +99,75 @@ <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> diff --git a/rsf-server/src/main/resources/application-dev.yml b/rsf-server/src/main/resources/application-dev.yml index 3f84f94..294179e 100644 --- a/rsf-server/src/main/resources/application-dev.yml +++ b/rsf-server/src/main/resources/application-dev.yml @@ -12,7 +12,7 @@ matching-strategy: ANT_PATH_MATCHER datasource: driver-class-name: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.4.24:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + url: jdbc:mysql://127.0.0.1:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai username: root # url: jdbc:mysql://47.76.147.249:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai # username: rsf -- Gitblit v1.9.1