From b4b4211b29a262812478b79e3d2c3b4df835cf52 Mon Sep 17 00:00:00 2001 From: verou <857149855@qq.com> Date: 星期五, 28 三月 2025 10:00:06 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/asnOrder/AsnOrderPanel.jsx | 230 ++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 152 insertions(+), 78 deletions(-) diff --git a/rsf-admin/src/page/asnOrder/AsnOrderPanel.jsx b/rsf-admin/src/page/asnOrder/AsnOrderPanel.jsx index c005f6e..5d1eeb6 100644 --- a/rsf-admin/src/page/asnOrder/AsnOrderPanel.jsx +++ b/rsf-admin/src/page/asnOrder/AsnOrderPanel.jsx @@ -1,93 +1,167 @@ 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 } 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 AsnOrderPanel = () => { const record = useRecordContext(); if (!record) return null; const translate = useTranslate(); + const notify = useNotify(); + const [rows, setRows] = useState([]); + const [maktx, setMaktx] = useState(''); + const asnId = record.id; + + useEffect(() => { + debouncedHttp({ maktx }); + }, [asnId, maktx]); + + + const http = async (parmas) => { + const res = await request.post('/asnOrderItem/page', { ...parmas, asnId }); + if (res?.data?.code === 200) { + setRows(res.data.data.records) + } else { + notify(res.data.msg); + } + } + + const debouncedHttp = useMemo(() => debounce(http, 300), []); + + const StyledTableRow = styled(TableRow)(({ theme }) => ({ + "& .MuiButtonBase-root.": { + padding: "0px 0px", + }, + })); + + const StyledTableCell = styled(TableCell)(({ theme }) => ({ + "& .MuiButtonBase-root": { + padding: "0px 0px", + }, + overflow: "hidden", + textOverflow: "ellipsis", + whiteSpace: "nowrap", + maxWidth: 600, + })); + + const columns = [ + { + field: 'asnId', + headerName: translate('table.field.asnOrderItem.asnId') + }, + { + field: 'asnCode', + headerName: translate('table.field.asnOrderItem.asnCode') + }, + { + field: 'poDetlId', + headerName: translate('table.field.asnOrderItem.poDetlId') + }, + { + field: 'poDetlCode', + headerName: translate('table.field.asnOrderItem.poDetlCode') + }, + { + field: 'matnrId', + headerName: translate('table.field.asnOrderItem.matnrId') + }, + { + field: 'maktx', + headerName: translate('table.field.asnOrderItem.maktx') + }, + { + field: 'anfme', + headerName: translate('table.field.asnOrderItem.anfme') + }, + { + field: 'stockUnit', + headerName: translate('table.field.asnOrderItem.stockUnit') + }, + { + field: 'purQty', + headerName: translate('table.field.asnOrderItem.purQty') + }, + { + field: 'purUnit', + headerName: translate('table.field.asnOrderItem.purUnit') + }, + { + field: 'qty', + headerName: translate('table.field.asnOrderItem.qty') + }, + { + field: 'splrCode', + headerName: translate('table.field.asnOrderItem.splrCode') + }, + { + field: 'splrName', + headerName: translate('table.field.asnOrderItem.splrName') + }, + { + field: 'barcode', + headerName: translate('table.field.asnOrderItem.barcode') + }, + { + field: 'packName', + headerName: translate('table.field.asnOrderItem.packName') + }] + + const [selectedRows, setSelectedRows] = useState([]); + + const handleSelectionChange = (ids) => { + setSelectedRows(ids) + + }; + const maktxChange = (value) => { + setMaktx(value) + } + + const wakbarcode = () => { + + } + + const wakprint = () => { + + } + + return ( - <> - <Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}> - <CardContent> - <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.asnOrder.code" - property={record.code} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.asnOrder.poCode" - property={record.poCode} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.asnOrder.poId" - property={record.poId} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.asnOrder.type" - property={record.type} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.asnOrder.wkType" - property={record.wkType} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.asnOrder.anfme" - property={record.anfme} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.asnOrder.qty" - property={record.qty} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.asnOrder.logisNo" - property={record.logisNo} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.asnOrder.arrTime" - property={record.arrTime$} - /> - </Grid> - <Grid item xs={6}> - <PanelTypography - title="table.field.asnOrder.rleStatus" - property={record.rleStatus$} - /> - </Grid> - </Grid> - </CardContent> - </Card > - </> + <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' }}> + <Button variant="contained" onClick={wakbarcode}>鐢熸垚鏉$爜</Button> + <Button variant="contained" onClick={wakprint}>鎵撳嵃</Button> + </div> + </div> + + + <DataGrid + size="small" + rows={rows} + columns={columns} + checkboxSelection + onRowSelectionModelChange={handleSelectionChange} + selectionModel={selectedRows} + disableColumnMenu={true} + disableColumnSorting + disableMultipleColumnsSorting + /> + </Box > + ); }; -- Gitblit v1.9.1