From b042540b20c3b7d377b2ab33a97f9de4d498c7ae Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期一, 31 三月 2025 12:42:25 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/qlyInspect/QlyInspectPanel.jsx | 177 +++++++++++++++---------- rsf-admin/src/page/qlyInspect/QlyInspectCreate.jsx | 8 + rsf-admin/src/page/qlyInspect/QlyInspectList.jsx | 95 ++++++++++++ rsf-admin/src/i18n/zh.js | 37 +++-- rsf-admin/src/page/qlyIsptItem/QlyIsptItemList.jsx | 2 rsf-admin/src/i18n/en.js | 5 rsf-admin/.env | 3 rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx | 8 + rsf-admin/src/page/asnOrder/AsnOrderModal.jsx | 83 +++++------ 9 files changed, 277 insertions(+), 141 deletions(-) diff --git a/rsf-admin/.env b/rsf-admin/.env new file mode 100644 index 0000000..a8ce658 --- /dev/null +++ b/rsf-admin/.env @@ -0,0 +1,3 @@ +VITE_BASE_IP=192.168.4.24 +# 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 8f45034..7e0e0da 100644 --- a/rsf-admin/src/i18n/en.js +++ b/rsf-admin/src/i18n/en.js @@ -134,6 +134,7 @@ container: 'Container', contract: 'Contract', qlyInspect: 'QlyInspect', + qlyIsptItem: '璐ㄦ淇℃伅鏄庣粏', dictType: 'DictType', dictData: 'DictData', companys: 'Companys', @@ -409,6 +410,7 @@ projectName: "ProjectName", }, qlyInspect: { + asnItemId: "asnItemId", code: "code", wkType: "wkType", safeQty: "safeQty", @@ -754,6 +756,9 @@ batchWarehouseAreas: "batchWarehouseAreas", batchLocType: "batchLocType", batchPrint: "batch print", + quality: "quality", + complete: "complete", + close: "close", }, }; diff --git a/rsf-admin/src/i18n/zh.js b/rsf-admin/src/i18n/zh.js index ea8aac8..52ad769 100644 --- a/rsf-admin/src/i18n/zh.js +++ b/rsf-admin/src/i18n/zh.js @@ -134,6 +134,7 @@ container: '瀹瑰櫒绠$悊', contract: '鍚堝悓淇℃伅', qlyInspect: '璐ㄦ淇℃伅', + qlyIsptItem: '璐ㄦ淇℃伅鏄庣粏', dictType: '鏁版嵁瀛楀吀', dictData: '瀛楀吀鏁版嵁闆�', companys: '寰�鏉ヤ紒涓�', @@ -417,26 +418,27 @@ projectName: "椤圭洰鍚嶇О", }, qlyInspect: { + asnItemId: "閫氱煡鍗曟槑缁咺D", code: "缂栫爜", - wkType: "wkType", + wkType: "涓氬姟绫诲瀷", safeQty: "鍚堟牸鏁伴噺", - dlyQty: "dlyQty", - rcptQty: "rcptQty", - isptQty: "isptQty", + dlyQty: "閫佽揣鏁伴噺", + rcptQty: "鏀惰揣鏁伴噺 ", + isptQty: "璐ㄦ鏁伴噺", }, qlyIsptItem: { - ispectId: "ispectId", - matnrCode: "matnrCode", - maktx: "maktx", - label: "label", - splrName: "splrName", - splrBatch: "splrBatch", - stockBatch: "stockBatch", - rcptQty: "rcptQty", - dlyQty: "dlyQty", - disQty: "disQty", - safeQty: "safeQty", - picPath: "picPath", + ispectId: "涓诲崟ID", + matnrCode: "缂栧彿", + maktx: "鐗╂枡鍚嶇О", + label: "鏍囩", + splrName: "渚涘簲鍟嗗悕绉�", + splrBatch: "渚涘簲鍟嗘壒娆�", + stockBatch: "搴撳瓨鎵规", + rcptQty: "鏀惰揣鏁伴噺", + dlyQty: "閫佽揣鏁伴噺", + disQty: "涓嶅悎鏁伴噺", + safeQty: "鍚堟牸鏁伴噺", + picPath: "鍥剧墖璺緞", }, dictType: { code: "瀛楀吀缂栫爜", @@ -767,6 +769,9 @@ batchWarehouseAreas: "鎵归噺搴撳尯", batchLocType: "鎵归噺搴撲綅绫诲瀷", batchPrint: "鎵归噺鎵撳嵃", + quality: "璐ㄦ", + complete: "瀹屾垚", + close: "鍏抽棴", }, }; diff --git a/rsf-admin/src/page/asnOrder/AsnOrderModal.jsx b/rsf-admin/src/page/asnOrder/AsnOrderModal.jsx index e75c230..4b48363 100644 --- a/rsf-admin/src/page/asnOrder/AsnOrderModal.jsx +++ b/rsf-admin/src/page/asnOrder/AsnOrderModal.jsx @@ -256,37 +256,18 @@ const [columns, setColumns] = useState([ { - field: 'matnrId', - headerName: translate('table.field.asnOrderItem.matnrId'), - minWidth: 100, - flex: 1, - editable: false, - }, - { field: 'maktx', headerName: translate('table.field.asnOrderItem.maktx'), minWidth: 100, flex: 1, - editable: true, + editable: false, }, { field: 'maktxCode', headerName: translate('table.field.asnOrderItem.maktxCode'), minWidth: 100, flex: 1, - editable: true, - }, - { - field: 'poDetlId', - headerName: translate('table.field.asnOrderItem.poDetlId'), - minWidth: 100, - flex: 1, - }, - { - field: 'poDetlCode', - headerName: translate('table.field.asnOrderItem.poDetlCode'), - minWidth: 100, - flex: 1, + editable: false, }, { field: 'anfme', @@ -294,27 +275,6 @@ minWidth: 100, flex: 1, editable: true, - }, - { - field: 'stockUnit', - headerName: translate('table.field.asnOrderItem.stockUnit'), - minWidth: 100, - flex: 1, - editable: false, - }, - // { - // field: 'purQty', - // headerName: translate('table.field.asnOrderItem.purQty'), - // minWidth: 100, - // flex: 1, - // editable: true, - // }, - { - field: 'purUnit', - headerName: translate('table.field.asnOrderItem.purUnit'), - minWidth: 100, - flex: 1, - editable: false, }, { field: 'splrCode', @@ -337,6 +297,41 @@ flex: 1, editable: true, }, + { + field: 'poDetlId', + headerName: translate('table.field.asnOrderItem.poDetlId'), + minWidth: 100, + flex: 1, + }, + { + field: 'poDetlCode', + headerName: translate('table.field.asnOrderItem.poDetlCode'), + minWidth: 100, + flex: 1, + }, + + { + field: 'stockUnit', + headerName: translate('table.field.asnOrderItem.stockUnit'), + minWidth: 100, + flex: 1, + editable: false, + }, + // { + // field: 'purQty', + // headerName: translate('table.field.asnOrderItem.purQty'), + // minWidth: 100, + // flex: 1, + // editable: true, + // }, + { + field: 'purUnit', + headerName: translate('table.field.asnOrderItem.purUnit'), + minWidth: 100, + flex: 1, + editable: false, + }, + ]) @@ -378,7 +373,7 @@ headerName: el.fieldsAlise, minWidth: 100, flex: 1, - editable: true + editable: false })) setColumns([...columns, ...cols, action]) } else { @@ -410,8 +405,6 @@ setSelectedRows(ids) }; - - return ( <div style={{ height: 400, width: '100%' }}> diff --git a/rsf-admin/src/page/qlyInspect/QlyInspectCreate.jsx b/rsf-admin/src/page/qlyInspect/QlyInspectCreate.jsx index dca01a0..06cffe7 100644 --- a/rsf-admin/src/page/qlyInspect/QlyInspectCreate.jsx +++ b/rsf-admin/src/page/qlyInspect/QlyInspectCreate.jsx @@ -85,11 +85,17 @@ <DialogContent sx={{ mt: 2 }}> <Grid container rowSpacing={2} columnSpacing={2}> <Grid item xs={6} display="flex" gap={1}> + <NumberInput + label="table.field.qlyInspect.asnItemId" + source="asnItemId" + autoFocus + /> + </Grid> + <Grid item xs={6} display="flex" gap={1}> <TextInput label="table.field.qlyInspect.code" source="code" parse={v => v} - autoFocus validate={required()} /> </Grid> diff --git a/rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx b/rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx index 2b4e951..895ebc6 100644 --- a/rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx +++ b/rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx @@ -64,11 +64,17 @@ {translate('common.edit.title.main')} </Typography> <Stack direction='row' gap={2}> + <NumberInput + label="table.field.qlyInspect.asnItemId" + source="asnItemId" + autoFocus + /> + </Stack> + <Stack direction='row' gap={2}> <TextInput label="table.field.qlyInspect.code" source="code" parse={v => v} - autoFocus validate={required()} /> </Stack> diff --git a/rsf-admin/src/page/qlyInspect/QlyInspectList.jsx b/rsf-admin/src/page/qlyInspect/QlyInspectList.jsx index a23f223..3bc69b4 100644 --- a/rsf-admin/src/page/qlyInspect/QlyInspectList.jsx +++ b/rsf-admin/src/page/qlyInspect/QlyInspectList.jsx @@ -31,6 +31,8 @@ ReferenceArrayInput, AutocompleteInput, DeleteButton, + Button, + useRefresh, } from 'react-admin'; import { Box, Typography, Card, Stack } from '@mui/material'; import { styled } from '@mui/material/styles'; @@ -43,6 +45,10 @@ import MyField from "../components/MyField"; import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; import * as Common from '@/utils/common'; +import ConstructionIcon from "@mui/icons-material/Construction"; +import CloseIcon from "@mui/icons-material/Close"; +import TaskIcon from '@mui/icons-material/Task'; +import request from '@/utils/request'; const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ '& .css-1vooibu-MuiSvgIcon-root': { @@ -60,9 +66,8 @@ const filters = [ <SearchInput source="condition" alwaysOn />, - <DateInput label='common.time.after' source="timeStart" alwaysOn />, - <DateInput label='common.time.before' source="timeEnd" alwaysOn />, + <NumberInput source="asnItemId" label="table.field.qlyInspect.asnItemId" />, <TextInput source="code" label="table.field.qlyInspect.code" />, <TextInput source="wkType" label="table.field.qlyInspect.wkType" />, <NumberInput source="safeQty" label="table.field.qlyInspect.safeQty" />, @@ -106,7 +111,6 @@ actions={( <TopToolbar> <FilterButton /> - <MyCreateButton onClick={() => { setCreateDialog(true) }} /> <SelectColumnsButton preferenceKey='qlyInspect' /> <MyExportButton /> </TopToolbar> @@ -115,11 +119,14 @@ > <StyledDatagrid preferenceKey='qlyInspect' - bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} + bulkActionButtons={<BulkDeleteButton mutationMode={OPERATE_MODE} />} rowClick={(id, resource, record) => false} + expand={() => <QlyInspectPanel />} + expandSingle={true} omit={['id', 'createTime', 'createBy', 'memo']} > <NumberField source="id" /> + <NumberField source="asnItemId$" label="table.field.qlyInspect.asnItemId" /> <TextField source="code" label="table.field.qlyInspect.code" /> <TextField source="wkType" label="table.field.qlyInspect.wkType" /> <NumberField source="safeQty" label="table.field.qlyInspect.safeQty" /> @@ -138,8 +145,10 @@ <BooleanField source="statusBool" label="common.field.status" sortable={false} /> <TextField source="memo" label="common.field.memo" sortable={false} /> <WrapperField cellClassName="opt" label="common.field.opt"> - <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> - <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> + {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} + <InspectionButton /> + <CompleteButton /> + <CloseButton /> </WrapperField> </StyledDatagrid> </List> @@ -158,3 +167,77 @@ } export default QlyInspectList; + +const InspectionButton = () => { + const record = useRecordContext(); + const notify = useNotify(); + const refresh = useRefresh(); + const inspection = () => { + // requestInspect([record]) + }; + + // const requestInspect = async (rows) => { + // const { data: { code, data, msg } } = await request.post(`/asnOrder/inspect`, rows); + + // if (code === 200) { + // notify(msg); + // refresh() + // } else { + // notify(msg); + // } + // } + + + return ( + <Button onClick={inspection} label={"toolbar.quality"}> + <ConstructionIcon /> + </Button> + ) +} + +const CompleteButton = () => { + const record = useRecordContext(); + const notify = useNotify(); + const refresh = useRefresh(); + const requestComplete = async () => { + const { data: { code, data, msg } } = await request.post(`/qlyInspect/update`, { ...record, code: '222222' }); + + if (code === 200) { + notify(msg); + refresh() + } else { + notify(msg); + } + } + + + return ( + <Button onClick={requestComplete} label={"toolbar.complete"}> + <TaskIcon /> + </Button> + ) +} + +const CloseButton = () => { + const record = useRecordContext(); + const notify = useNotify(); + const refresh = useRefresh(); + + const requestClose = async () => { + const { data: { code, data, msg } } = await request.post(`/qlyInspect/update`, { ...record, code: '222222' }); + + if (code === 200) { + notify(msg); + refresh() + } else { + notify(msg); + } + } + + + return ( + <Button onClick={requestClose} label={"toolbar.close"}> + <CloseIcon /> + </Button> + ) +} diff --git a/rsf-admin/src/page/qlyInspect/QlyInspectPanel.jsx b/rsf-admin/src/page/qlyInspect/QlyInspectPanel.jsx index a66c697..8f56bfa 100644 --- a/rsf-admin/src/page/qlyInspect/QlyInspectPanel.jsx +++ b/rsf-admin/src/page/qlyInspect/QlyInspectPanel.jsx @@ -1,86 +1,123 @@ import React, { useState, useRef, useEffect, useMemo } from "react"; -import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material'; +import { Box, Card, CardContent, Grid, Typography, Button, TextField, Tooltip, Paper, TableContainer, Table, TableBody, TableCell, TableHead, TableRow } from '@mui/material'; import { useTranslate, useRecordContext, + useNotify, + useRefresh, + useListContext, } from 'react-admin'; import PanelTypography from "../components/PanelTypography"; import * as Common from '@/utils/common' +import { styled } from "@mui/material/styles"; +import request from '@/utils/request'; +import debounce from 'lodash/debounce'; +import { DataGrid } from '@mui/x-data-grid'; const QlyInspectPanel = () => { const record = useRecordContext(); if (!record) return null; const translate = useTranslate(); - return ( - <> - <Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}> - <CardContent> - <Grid container spacing={2}> - <Grid item xs={12} sx={{ display: 'flex', justifyContent: 'space-between' }}> - <Typography variant="h6" gutterBottom align="left" sx={{ - maxWidth: { xs: '100px', sm: '180px', md: '260px', lg: '360px' }, - whiteSpace: 'nowrap', - overflow: 'hidden', - textOverflow: 'ellipsis', - }}> - {Common.camelToPascalWithSpaces(translate('table.field.qlyInspect.id'))}: {record.id} - </Typography> - {/* inherit, primary, secondary, textPrimary, textSecondary, error */} - <Typography variant="h6" gutterBottom align="right" > - ID: {record.id} - </Typography> - </Grid> - </Grid> - <Grid container spacing={2}> - <Grid item xs={12} container alignContent="flex-end"> - <Typography variant="caption" color="textSecondary" sx={{ wordWrap: 'break-word', wordBreak: 'break-all' }}> - {Common.camelToPascalWithSpaces(translate('common.field.memo'))}:{record.memo} - </Typography> - </Grid> - </Grid> - <Box height={20}> </Box> - <Grid container spacing={2}> - <Grid item xs={6}> - <PanelTypography - title="table.field.qlyInspect.code" - property={record.code} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.qlyInspect.wkType" - property={record.wkType} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.qlyInspect.safeQty" - property={record.safeQty} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.qlyInspect.dlyQty" - property={record.dlyQty} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.qlyInspect.rcptQty" - property={record.rcptQty} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.qlyInspect.isptQty" - property={record.isptQty} - /> - </Grid> + const notify = useNotify(); + const [rows, setRows] = useState([]); + const [maktx, setMaktx] = useState(''); + const ispectId = record.id; - </Grid> - </CardContent> - </Card > - </> + useEffect(() => { + debouncedHttp({ maktx }); + }, [ispectId, maktx]); + + + const http = async (parmas) => { + const res = await request.post('/qlyIsptItem/page', { ...parmas, ispectId }); + if (res?.data?.code === 200) { + setRows(res.data.data.records) + } else { + notify(res.data.msg); + } + } + + const debouncedHttp = useMemo(() => debounce(http, 300), []); + + const columns = [ + { + field: 'ispectId', + headerName: translate('table.field.qlyIsptItem.ispectId') + }, + { + field: 'matnrCode', + headerName: translate('table.field.qlyIsptItem.matnrCode') + }, + { + field: 'maktx', + headerName: translate('table.field.qlyIsptItem.maktx') + }, + { + field: 'label', + headerName: translate('table.field.qlyIsptItem.label') + }, + { + 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: 'rcptQty', + headerName: translate('table.field.qlyIsptItem.rcptQty') + }, + { + field: 'dlyQty', + headerName: translate('table.field.qlyIsptItem.dlyQty') + }, + { + field: 'disQty', + headerName: translate('table.field.qlyIsptItem.disQty') + }, + { + field: 'safeQty', + headerName: translate('table.field.qlyIsptItem.safeQty') + }, + { + field: 'picPath', + headerName: translate('table.field.qlyIsptItem.picPath') + } + ]; + + const maktxChange = (value) => { + setMaktx(value) + } + + return ( + <Box sx={{ + position: 'relative', + padding: '5px 10px' + }}> + + <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px', alignItems: 'center' }}> + <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="鎼滅储鐗╂枡" variant="outlined" sx={{ width: '300px' }} /> + + <div style={{ display: 'flex', gap: '10px' }}> + </div> + </div> + + + <DataGrid + size="small" + rows={rows} + columns={columns} + disableRowSelectionOnClick + disableColumnMenu={true} + disableColumnSorting + disableMultipleColumnsSorting + /> + </Box > ); }; diff --git a/rsf-admin/src/page/qlyIsptItem/QlyIsptItemList.jsx b/rsf-admin/src/page/qlyIsptItem/QlyIsptItemList.jsx index b53c5c3..daf901c 100644 --- a/rsf-admin/src/page/qlyIsptItem/QlyIsptItemList.jsx +++ b/rsf-admin/src/page/qlyIsptItem/QlyIsptItemList.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 />, <NumberInput source="ispectId" label="table.field.qlyIsptItem.ispectId" />, <TextInput source="matnrCode" label="table.field.qlyIsptItem.matnrCode" />, -- Gitblit v1.9.1