From c5bee307ac9ab10b524bbccce2fde3190723f467 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 09 五月 2025 19:06:09 +0800
Subject: [PATCH] no message
---
rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx | 39 +++++++++++++++++++++++++++++++++------
1 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx b/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx
index 88563f3..0125c45 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,8 @@
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 billReload = useRef();
const notify = useNotify();
const refresh = useRefresh();
@@ -132,7 +135,6 @@
title={"menu.asnOrder"}
empty={false}
filters={filters}
- filter={{ deleted: 0 }}
sort={{ field: "create_time", order: "desc" }}
actions={(
<TopToolbar>
@@ -168,7 +170,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 +185,8 @@
<MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} />
<InspectionButton />
<CompleteButton />
- <DeleteButton mutationMode="pessimistic" />
+ <ODeleteButton />
+ <PrintButton setPrintOrder={setPrintOrder} setSelect={setSelect}/>
{/* <CloseButton /> */}
</WrapperField>
</StyledDatagrid>
@@ -193,6 +196,11 @@
setOpen={setCreateDialog}
asnId={modalType}
billReload={billReload}
+ />
+ <OrderPrintPreview
+ open={printOrder}
+ setOpen={setPrintOrder}
+ record={select}
/>
<PageDrawer
title='AsnOrder Detail'
@@ -205,11 +213,28 @@
}
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 /> : <></>
+ record.exceStatus === 0 ? <DeleteButton mutationMode="pessimistic"/> : <></>
)
}
@@ -224,6 +249,7 @@
};
return (
+ record.exceStatus === 1 || record.exceStatus === 0 ?
<Button
color="primary"
startIcon={<EditIcon />}
@@ -232,6 +258,7 @@
label={'ra.action.edit'}
>
</Button>
+ : <></>
)
}
--
Gitblit v1.9.1