From ff18a8c103f1db8be2fcb22d69de3c32f745ff1d Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期六, 10 五月 2025 17:04:41 +0800 Subject: [PATCH] 质检信息修改 快速质检功能修改 --- rsf-admin/src/page/orders/asnOrder/AsnOrderItemList.jsx | 2 rsf-admin/src/page/orders/qlyInspect/InspectModal.jsx | 34 +------- rsf-admin/src/i18n/zh.js | 11 +- rsf-admin/src/page/orders/qlyInspect/QlyInspectList.jsx | 4 - rsf-admin/src/i18n/en.js | 5 + rsf-admin/.env | 2 rsf-admin/src/page/orders/qlyInspect/QlyInspectEdit.jsx | 11 -- rsf-admin/src/page/orders/qlyInspect/QlyIsptItemList.jsx | 112 ++++++++++++++++++++------- 8 files changed, 101 insertions(+), 80 deletions(-) diff --git a/rsf-admin/.env b/rsf-admin/.env index a3c69b2..a0bb09f 100644 --- a/rsf-admin/.env +++ b/rsf-admin/.env @@ -1,3 +1,3 @@ -VITE_BASE_IP=127.0.0.1 +VITE_BASE_IP=192.168.4.50 # VITE_BASE_IP=47.76.147.249 VITE_BASE_PORT=8080 diff --git a/rsf-admin/src/i18n/en.js b/rsf-admin/src/i18n/en.js index 792b9ea..56e1ae1 100644 --- a/rsf-admin/src/i18n/en.js +++ b/rsf-admin/src/i18n/en.js @@ -79,7 +79,9 @@ inputPlaceholder: 'Use commas to separate', resend: 'RESEND', selected: 'selected', - batch: 'batch' + batch: 'batch', + batchSafe: 'Bulk Safe', + batchDef: 'Bulk Def', }, msg: { confirm: { @@ -471,6 +473,7 @@ rcptQty: "rcptQty", dlyQty: "dlyQty", disQty: "disQty", + anfme: 'anfme', safeQty: "safeQty", picPath: "picPath", trackCode: "trackCode", diff --git a/rsf-admin/src/i18n/zh.js b/rsf-admin/src/i18n/zh.js index a7becd9..df68657 100644 --- a/rsf-admin/src/i18n/zh.js +++ b/rsf-admin/src/i18n/zh.js @@ -79,7 +79,9 @@ stockError: '娌℃湁搴撳瓨', resend: '閲嶅彂', selected: '椤归�変腑', - batch: '鎵归噺缂栬緫' + batch: '鎵归噺缂栬緫', + batchSafe: '鎵归噺鍚堟牸', + batchDef: '鎵归噺涓嶅悎鏍�', }, msg: { confirm: { @@ -471,15 +473,16 @@ matnrCode: "鐗╂枡缂栧彿", maktx: "鐗╂枡鍚嶇О", label: "鏍囩", - splrName: "渚涘簲鍟嗗悕绉�", - splrBatch: "渚涘簲鍟嗘壒娆�", + splrName: "渚涘簲鍟�", + splrBatch: "鎵规", stockBatch: "搴撳瓨鎵规", isptResult: '璐ㄦ缁撹', isptStatus: '璐ㄦ鐘舵��', - rcptQty: "鏀惰揣鏁伴噺", + rcptQty: "鍙鏁伴噺", dlyQty: "閫佽揣鏁伴噺", disQty: "涓嶅悎鏁伴噺", safeQty: "鍚堟牸鏁伴噺", + anfme: '鏁伴噺', picPath: "鍥剧墖璺緞", trackCode: "鏉″舰鐮�", }, diff --git a/rsf-admin/src/page/orders/asnOrder/AsnOrderItemList.jsx b/rsf-admin/src/page/orders/asnOrder/AsnOrderItemList.jsx index 1d0e843..71ff6c4 100644 --- a/rsf-admin/src/page/orders/asnOrder/AsnOrderItemList.jsx +++ b/rsf-admin/src/page/orders/asnOrder/AsnOrderItemList.jsx @@ -41,6 +41,8 @@ import { styled } from '@mui/material/styles'; import AsnOrderItemCreate from "./AsnOrderItemCreate"; import PageDrawer from "../../components/PageDrawer"; +import DialogCloseButton from "../../components/DialogCloseButton"; + import request from '@/utils/request'; import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; import AsnOrderItemEdit from "./AsnOrderItemEdit"; diff --git a/rsf-admin/src/page/orders/qlyInspect/InspectModal.jsx b/rsf-admin/src/page/orders/qlyInspect/InspectModal.jsx index 2faa6ce..627a035 100644 --- a/rsf-admin/src/page/orders/qlyInspect/InspectModal.jsx +++ b/rsf-admin/src/page/orders/qlyInspect/InspectModal.jsx @@ -149,33 +149,15 @@ backgroundColor: 'background.paper', zIndex: 1000 }}> - 鎵ц璐ㄦ <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> <DialogCloseButton onClose={handleClose} /> </Box> </DialogTitle> <DialogContent sx={{ mt: 2 }}> - {/* <Box component="form" onSubmit={handleSubmit} sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}> - <Grid container spacing={2}> - <Grid item md={4}> - <TextField - label={translate('table.field.asnOrder.code')} - name="code" - value={formData.code} - onChange={handleChange} - size="small" - /> - </Grid> - </Grid> - </Box> */} <Box sx={{ mt: 2 }}> - {/* <Stack direction="row" spacing={2}> - <Button variant="contained" onClick={handleSearch}>鎼滅储</Button> - </Stack> */} - <Stack direction="row" spacing={2}> - <Button variant="contained" onClick={batchQualified}>鎵归噺鍚堟牸</Button> - <Button variant="contained" color="error" onClick={batchUnQualified}>鎵归噺涓嶅悎鏍�</Button> + <Button variant="contained" onClick={batchQualified}>{translate('common.action.batchSafe')} </Button> + <Button variant="contained" color="error" onClick={batchUnQualified}>{translate('common.action.batchDef')} </Button> </Stack> </Box> <Box sx={{ mt: 2, height: 400, width: '100%' }}> @@ -188,7 +170,7 @@ </Box> </DialogContent> <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> - <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}> + <Box sx={{ width: '100%', display: 'flex', justifyContent: 'end' }}> <Button onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}> {translate('toolbar.confirm')} </Button> @@ -210,16 +192,14 @@ }; - - const [columns, setColumns] = useState([ // { field: 'id', headerName: 'ID', width: 100 }, - { field: 'maktx', headerName: translate('table.field.qlyIsptItem.maktx'), width: 300 }, { field: 'matnrCode', headerName: translate('table.field.qlyIsptItem.matnrCode') }, + { field: 'maktx', headerName: translate('table.field.qlyIsptItem.maktx'), width: 300 }, { field: 'splrName', headerName: translate('table.field.qlyIsptItem.splrName') }, { field: 'splrBatch', headerName: translate('table.field.qlyIsptItem.splrBatch') }, - { field: 'stockBatch', headerName: translate('table.field.qlyIsptItem.stockBatch') }, - { field: 'dlyQty', headerName: translate('table.field.qlyIsptItem.dlyQty') }, + // { field: 'stockBatch', headerName: translate('table.field.qlyIsptItem.stockBatch') }, + // { field: 'dlyQty', headerName: translate('table.field.qlyIsptItem.dlyQty') }, { field: 'rcptQty', headerName: translate('table.field.qlyIsptItem.rcptQty') }, { field: 'safeQty', headerName: translate('table.field.qlyIsptItem.safeQty'), editable: true, type: 'number', @@ -245,8 +225,6 @@ field: 'isptResult', headerName: translate('table.field.qlyIsptItem.isptResult'), width: 150, type: 'singleSelect', editable: true, valueOptions: [{ value: '1', label: '鍚堟牸' }, { value: '2', label: '涓嶅悎鏍�' }, { value: '3', label: '寰呭畾' }, { value: '4', label: '閮ㄥ垎鍚堟牸' }], }, - - ]) const processRowUpdate = (newRow, oldRow) => { diff --git a/rsf-admin/src/page/orders/qlyInspect/QlyInspectEdit.jsx b/rsf-admin/src/page/orders/qlyInspect/QlyInspectEdit.jsx index d33d9d9..830683e 100644 --- a/rsf-admin/src/page/orders/qlyInspect/QlyInspectEdit.jsx +++ b/rsf-admin/src/page/orders/qlyInspect/QlyInspectEdit.jsx @@ -102,17 +102,6 @@ </Stack> <Stack direction='row' gap={2}> <NumberInput - label="table.field.qlyInspect.safeQty" - source="safeQty" - readOnly - /> - <NumberInput - label="table.field.qlyInspect.dlyQty" - source="dlyQty" - readOnly - - /> - <NumberInput label="table.field.qlyInspect.rcptQty" source="rcptQty" readOnly diff --git a/rsf-admin/src/page/orders/qlyInspect/QlyInspectList.jsx b/rsf-admin/src/page/orders/qlyInspect/QlyInspectList.jsx index 215bfbe..a2667dc 100644 --- a/rsf-admin/src/page/orders/qlyInspect/QlyInspectList.jsx +++ b/rsf-admin/src/page/orders/qlyInspect/QlyInspectList.jsx @@ -137,9 +137,6 @@ <TextField source="wkType$" label="table.field.qlyInspect.wkType" /> <NumberField source="asnId" label="table.field.qlyInspect.asnId" /> <NumberField source="asnCode" label="table.field.qlyInspect.asnCode" /> - <NumberField source="safeQty" label="table.field.qlyInspect.safeQty" /> - <NumberField source="dlyQty" label="table.field.qlyInspect.dlyQty" /> - <NumberField source="rcptQty" label="table.field.qlyInspect.rcptQty" /> <NumberField source="isptQty" label="table.field.qlyInspect.isptQty" /> <TextField source="updateBy$" label="common.field.updateBy" /> <DateField source="updateTime" label="common.field.updateTime" showTime /> @@ -231,7 +228,6 @@ notify(msg); } } - return ( <Button onClick={requestClose} label={"toolbar.close"}> diff --git a/rsf-admin/src/page/orders/qlyInspect/QlyIsptItemList.jsx b/rsf-admin/src/page/orders/qlyInspect/QlyIsptItemList.jsx index 6f5ffc2..fd1be19 100644 --- a/rsf-admin/src/page/orders/qlyInspect/QlyIsptItemList.jsx +++ b/rsf-admin/src/page/orders/qlyInspect/QlyIsptItemList.jsx @@ -32,15 +32,17 @@ AutocompleteInput, DeleteButton, useGetOne, + useRefresh, useGetRecordId, } from 'react-admin'; -import { Box, Typography, Card, Stack } from '@mui/material'; +import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material'; import { styled } from '@mui/material/styles'; import QlyIsptItemCreate from "./QlyIsptItemCreate"; import EmptyData from "../../components/EmptyData"; import MyCreateButton from "../../components/MyCreateButton"; import MyExportButton from '../../components/MyExportButton'; import PageDrawer from "../../components/PageDrawer"; +import request from '@/utils/request'; import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ @@ -89,13 +91,13 @@ const [drawerVal, setDrawerVal] = useState(false); const isptId = useGetRecordId(); const { data: dicts, isPending, error } = useGetOne('qlyInspect', { id: isptId }); - if (dicts == null) {return} + if (dicts == null) { return } return ( <Box display="flex"> <List - resource="qlyIsptItem" - filter={{ispectId: isptId}} + resource="qlyIsptItem" + filter={{ ispectId: isptId }} sx={{ flexGrow: 1, transition: (theme) => @@ -117,33 +119,7 @@ )} perPage={DEFAULT_ITEM_PAGE_SIZE} > - <StyledDatagrid - preferenceKey='qlyIsptItem' - bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} - rowClick={false} - omit={['id', 'createTime', 'createBy', 'memo', 'label', 'stockBatch','picPath', 'ispectId']} - > - <NumberField source="id" /> - <NumberField source="ispectId" label="table.field.qlyIsptItem.ispectId" /> - <TextField source="matnrCode" label="table.field.qlyIsptItem.matnrCode" /> - <TextField source="maktx" label="table.field.qlyIsptItem.maktx" /> - <TextField source="label" label="table.field.qlyIsptItem.label" /> - <TextField source="splrBatch" label="table.field.qlyIsptItem.splrBatch" /> - <TextField source="stockBatch" label="table.field.qlyIsptItem.stockBatch" /> - <NumberField source="rcptQty" label="table.field.qlyIsptItem.rcptQty" /> - <NumberField source="dlyQty" label="table.field.qlyIsptItem.dlyQty" /> - <NumberField source="disQty" label="table.field.qlyIsptItem.disQty" /> - <NumberField source="safeQty" label="table.field.qlyIsptItem.safeQty" /> - <TextField source="splrName" label="table.field.qlyIsptItem.splrName" /> - <NumberField source="isptResult$" label="table.field.qlyIsptItem.isptResult" /> - <TextField source="picPath" label="table.field.qlyIsptItem.picPath" /> - <TextField source="updateBy$" label="common.field.updateBy" /> - <DateField source="updateTime" label="common.field.updateTime" showTime /> - <TextField source="createBy$" label="common.field.createBy" /> - <DateField source="createTime" label="common.field.createTime" showTime /> - <BooleanField source="statusBool" label="common.field.status" sortable={false} /> - <TextField source="memo" label="common.field.memo" sortable={false} /> - </StyledDatagrid> + <DynamicFields /> </List> <QlyIsptItemCreate open={createDialog} @@ -161,3 +137,77 @@ } export default QlyIsptItemList; + + + +const DynamicFields = (props) => { + const translate = useTranslate(); + const notify = useNotify(); + const [columns, setColumns] = useState([]); + const { isLoading } = useListContext(); + const refresh = useRefresh(); + useEffect(() => { + getDynamicFields(); + }, []); + + const getDynamicFields = async () => { + const { data: { code, data, msg }, } = await request.get("/fields/enable/list"); + if (code == 200) { + const arr = [ + <NumberField source="id" />, + <NumberField source="ispectId" label="table.field.qlyIsptItem.ispectId" />, + <TextField source="matnrCode" label="table.field.qlyIsptItem.matnrCode" />, + <TextField source="maktx" label="table.field.qlyIsptItem.maktx" />, + <TextField source="label" label="table.field.qlyIsptItem.label" />, + <TextField source="splrBatch" label="table.field.qlyIsptItem.splrBatch" />, + <TextField source="stockBatch" label="table.field.qlyIsptItem.stockBatch" />, + <NumberField source="rcptQty" label="table.field.qlyIsptItem.rcptQty" />, + <NumberField source="dlyQty" label="table.field.qlyIsptItem.dlyQty" />, + <NumberField source="anfme" label="table.field.qlyIsptItem.anfme" />, + <TextField source="splrName" label="table.field.qlyIsptItem.splrName" />, + <NumberField source="isptResult$" label="table.field.qlyIsptItem.isptResult" />, + ] + const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />) + const lastArr = [ + <DateField source="updateTime" label="common.field.updateTime" showTime />, + <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> + <TextField source="nickname" /> + </ReferenceField>, + <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> + <TextField source="nickname" /> + </ReferenceField>, + <DateField source="createTime" label="common.field.createTime" showTime />, + <TextField source="memo" label="common.field.memo" sortable={false} />, + ] + setColumns([...arr, ...fields, ...lastArr]); + } else { + notify(msg); + } + } + + return ( + <Box sx={{ position: 'relative', minHeight: "60vh", }}> + {isLoading && ( + <LinearProgress + sx={{ + height: "2px", + position: 'absolute', + top: 0, + left: 0, + right: 0, + }} + /> + )} + {columns.length > 0 && + <StyledDatagrid + preferenceKey='qlyIsptItem' + bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} + rowClick={false} + omit={['id', 'createTime', 'createBy', 'memo', 'dlyQty', 'label', 'stockBatch', 'picPath', 'ispectId', 'statusBool']} + + > + {columns.map((column) => column)} + </StyledDatagrid>} + </Box> + ) +} \ No newline at end of file -- Gitblit v1.9.1