From 4523802a2f7037c2133331a504cea171c91ccb88 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 10 四月 2025 17:45:58 +0800
Subject: [PATCH] #修改 1. 字典界面优化修改
---
rsf-admin/src/page/qlyInspect/QlyInspectList.jsx | 82 +++++++++++++++++++++++++++++------------
1 files changed, 58 insertions(+), 24 deletions(-)
diff --git a/rsf-admin/src/page/qlyInspect/QlyInspectList.jsx b/rsf-admin/src/page/qlyInspect/QlyInspectList.jsx
index 3bc69b4..46b4912 100644
--- a/rsf-admin/src/page/qlyInspect/QlyInspectList.jsx
+++ b/rsf-admin/src/page/qlyInspect/QlyInspectList.jsx
@@ -48,7 +48,10 @@
import ConstructionIcon from "@mui/icons-material/Construction";
import CloseIcon from "@mui/icons-material/Close";
import TaskIcon from '@mui/icons-material/Task';
+import AddIcon from '@mui/icons-material/Add';
import request from '@/utils/request';
+import AsnSelModal from "./AsnSelModal";
+import InspectModal from "./InspectModal";
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
'& .css-1vooibu-MuiSvgIcon-root': {
@@ -67,7 +70,6 @@
const filters = [
<SearchInput source="condition" 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" />,
@@ -105,11 +107,18 @@
marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
}}
title={"menu.qlyInspect"}
- empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
+ empty={<EmptyData
+ children={
+ <Box sx={{ gap: 2, display: 'flex' }}>
+ <AsnCreatButton isInit={true} />
+ </Box>
+ }
+ onClick={() => { }} />}
filters={filters}
sort={{ field: "create_time", order: "desc" }}
actions={(
<TopToolbar>
+ <AsnCreatButton />
<FilterButton />
<SelectColumnsButton preferenceKey='qlyInspect' />
<MyExportButton />
@@ -123,12 +132,14 @@
rowClick={(id, resource, record) => false}
expand={() => <QlyInspectPanel />}
expandSingle={true}
- omit={['id', 'createTime', 'createBy', 'memo']}
+ omit={['id', 'createTime', 'createBy', 'memo', 'asnId', 'statusBool']}
>
<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" />
+ <TextField source="isptStatus$" label="table.field.qlyInspect.isptStatus" />
+ <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" />
@@ -162,6 +173,8 @@
setDrawerVal={setDrawerVal}
>
</PageDrawer>
+
+
</Box>
)
}
@@ -172,26 +185,21 @@
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);
- // }
- // }
+ const [createDialog, setCreateDialog] = useState(false);
return (
- <Button onClick={inspection} label={"toolbar.quality"}>
- <ConstructionIcon />
- </Button>
+ <>
+ <Button onClick={() => setCreateDialog(true)} label={"toolbar.quality"}>
+ <ConstructionIcon />
+ </Button>
+
+ <InspectModal
+ open={createDialog}
+ setOpen={setCreateDialog}
+ ispectId={record.id}
+ />
+ </>
)
}
@@ -200,7 +208,7 @@
const notify = useNotify();
const refresh = useRefresh();
const requestComplete = async () => {
- const { data: { code, data, msg } } = await request.post(`/qlyInspect/update`, { ...record, code: '222222' });
+ const { data: { code, data, msg } } = await request.post(`/qlyInspect/update`, { ...record, isptStatus: '1' });
if (code === 200) {
notify(msg);
@@ -224,7 +232,7 @@
const refresh = useRefresh();
const requestClose = async () => {
- const { data: { code, data, msg } } = await request.post(`/qlyInspect/update`, { ...record, code: '222222' });
+ const { data: { code, data, msg } } = await request.post(`/qlyInspect/update`, { ...record, isptStatus: '3' });
if (code === 200) {
notify(msg);
@@ -241,3 +249,29 @@
</Button>
)
}
+
+const AsnCreatButton = ({ isInit }) => {
+ const record = useRecordContext();
+ const notify = useNotify();
+ const refresh = useRefresh();
+ const [createDialog, setCreateDialog] = useState(false);
+
+ return (
+ <>
+ {
+ isInit ? <Button onClick={() => setCreateDialog(true)} label={"toolbar.asnCreate"} variant="contained"
+ color="primary">
+ <AddIcon />
+ </Button> : <Button onClick={() => setCreateDialog(true)} label={"toolbar.asnCreate"} >
+ <AddIcon />
+ </Button>
+ }
+
+
+ <AsnSelModal
+ open={createDialog}
+ setOpen={setCreateDialog}
+ />
+ </>
+ )
+}
--
Gitblit v1.9.1