From c731084698d89c12c23180f57598d521abb97a23 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期一, 12 五月 2025 14:15:32 +0800 Subject: [PATCH] 质检功能优化 --- rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx | 49 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 43 insertions(+), 6 deletions(-) diff --git a/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx b/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx index 19c2d3f..063790b 100644 --- a/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx +++ b/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx @@ -56,6 +56,8 @@ import DictionarySelect from "../../components/DictionarySelect"; import ExitToAppIcon from '@mui/icons-material/ExitToApp'; import ImportButton from "../../components/ImportButton"; +import PrintOutlinedIcon from '@mui/icons-material/PrintOutlined'; +import OrderPrintPreview from "./OrderPrintPreview"; const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ '& .css-1vooibu-MuiSvgIcon-root': { @@ -112,7 +114,9 @@ const [createDialog, setCreateDialog] = useState(false); const [drawerVal, setDrawerVal] = useState(false); const [modalType, setmodalType] = useState(0); - const [select, setSelect] = useState(0); + const [printOrder, setPrintOrder] = useState(false); + const [select, setSelect] = useState({}); + const invoiceRef = useRef(); const billReload = useRef(); const notify = useNotify(); const refresh = useRefresh(); @@ -132,7 +136,6 @@ title={"menu.asnOrder"} empty={false} filters={filters} - filter={{ deleted: 0 }} sort={{ field: "create_time", order: "desc" }} actions={( <TopToolbar> @@ -168,7 +171,7 @@ <TextField cellClassName="wkType" source="wkType$" label="table.field.asnOrder.wkType" /> <NumberField source="anfme" label="table.field.asnOrder.anfme" /> <NumberField source="qty" label="table.field.asnOrder.qty" /> - <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> + {/* <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> */} <DateField source="arrTime" label="table.field.asnOrder.arrTime" showTime /> <TextField source="rleStatus$" label="table.field.asnOrder.rleStatus" sortable={false} /> <TextField source="ntyStatus$" label="table.field.asnOrder.ntyStatus" /> @@ -183,7 +186,8 @@ <MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} /> <InspectionButton /> <CompleteButton /> - <DeleteButton mutationMode="pessimistic" /> + <ODeleteButton /> + <PrintButton setPrintOrder={setPrintOrder} setSelect={setSelect}/> {/* <CloseButton /> */} </WrapperField> </StyledDatagrid> @@ -193,6 +197,11 @@ setOpen={setCreateDialog} asnId={modalType} billReload={billReload} + /> + <OrderPrintPreview + open={printOrder} + setOpen={setPrintOrder} + record={select} /> <PageDrawer title='AsnOrder Detail' @@ -205,6 +214,32 @@ } export default AsnOrderList; + +//鎵撳嵃鎸夐挳 +const PrintButton = ({setPrintOrder, setSelect}) => { + const record = useRecordContext(); + const printOrder = (event) => { + event.stopPropagation(); + setPrintOrder(true) + setSelect(record) + } + + return ( + <Button label={"toolbar.print"} onClick={printOrder}> + <PrintOutlinedIcon /> + </Button> + ) +} + + +const ODeleteButton = () => { + const record = useRecordContext(); + return ( + record.exceStatus === 0 ? <DeleteButton mutationMode="pessimistic"/> : <></> + ) + +} + const MyButton = ({ setCreateDialog, setmodalType }) => { const record = useRecordContext(); const handleEditClick = (btn) => { @@ -215,6 +250,7 @@ }; return ( + record.exceStatus === 1 || record.exceStatus === 0 ? <Button color="primary" startIcon={<EditIcon />} @@ -223,6 +259,7 @@ label={'ra.action.edit'} > </Button> + : <></> ) } @@ -247,7 +284,7 @@ } return ( - <ConfirmButton label={"toolbar.inspection"} color="secondary" startIcon={<ConstructionIcon />} onConfirm={inspection} /> + <ConfirmButton label={"toolbar.inspection"} color="secondary" startIcon={<ConstructionIcon />} onConfirm={inspection} /> ) } @@ -351,7 +388,7 @@ // record.exceStatus === 1 && (record.anfme === record.qty ? <Button onClick={requestComplete} label={"toolbar.complete"} color="secondary"> // <TaskIcon /> // </Button> : ) - <ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskIcon />} onConfirm={requestComplete} /> + record.exceStatus === 1 ? <ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskIcon />} onConfirm={requestComplete} /> : <></> ) -- Gitblit v1.9.1