From a1221fcaa6d7712a63f922e60393d959d1a1d386 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 17 四月 2025 16:08:43 +0800
Subject: [PATCH] #优化:收货通知单编辑优化
---
rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx | 126 ++++++++++++++++++++++++++++++++++++++---
1 files changed, 116 insertions(+), 10 deletions(-)
diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
index 9bf7cfc..f1aae39 100644
--- a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
+++ b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
@@ -97,7 +97,6 @@
const filters = [
<SearchInput source="condition" alwaysOn />,
-
<TextInput source="name" label="table.field.matnr.name" alwaysOn />,
<TextInput source="code" label="table.field.matnr.code" alwaysOn />,
<ReferenceInput source="shipperId$" label="table.field.matnr.shipperId" reference="shipper">
@@ -196,7 +195,7 @@
<NumberField key="stagn" source="stagn" label="table.field.matnr.stagn" />,
<NumberField key="valid" source="valid" label="table.field.matnr.valid" />,
<NumberField key="validWarn" source="validWarn" label="table.field.matnr.validWarn" />,
- <NumberField key="flagCheck" source="flagCheck" label="table.field.matnr.flagCheck" />,
+ <BooleanField key="flagCheck" source="flagCheck" label="table.field.matnr.flagCheck" sortable={false} />,
<ReferenceField key="updateBy" source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}>
<TextField source="nickname" />
</ReferenceField>,
@@ -211,10 +210,20 @@
const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />)
const opt = <WrapperField key="opt" cellClassName="fixed" className="fixed" label="common.field.opt">
<EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
- <EnableButton />
+ <PrintButton />
</WrapperField>
setColumns([...arr, ...fields, opt]);
-
+
+ //filters娣诲姞杩囨护瀛楁
+ data.map(el => {
+ var i =0;
+ filters.map((item) =>{
+ if(item.key === el.fields){
+ i = 1;
+ }
+ })
+ i===0 && filters.push(<TextInput key={el.fields} source={el.fields} label={el.fieldsAlise} />)
+ })
} else {
notify(msg);
}
@@ -242,9 +251,12 @@
preferenceKey='matnr'
bulkActionButtons={<>
<BatchGroupButton />
- <BatchButton />
+ <BatchWarnButton />
+ <BatchFlagButton />
+ <BatchStatusButton />
+ <BatchLevelButton />
<BindButton />
- <PrintButton />
+ <BatchPrintButton />
<BulkDeleteButton mutationMode={OPERATE_MODE} />
</>}
rowClick={(id, resource, record) => false}
@@ -262,7 +274,6 @@
const MatnrList = () => {
const translate = useTranslate();
-
const [createDialog, setCreateDialog] = useState(false);
const [drawerVal, setDrawerVal] = useState(false);
const notify = useNotify();
@@ -340,7 +351,7 @@
)
}
-const BatchButton = () => {
+const BatchStatusButton = () => {
const record = useRecordContext();
const notify = useNotify();
const refresh = useRefresh();
@@ -350,13 +361,85 @@
return (
<>
- <Button onClick={() => setCreateDialog(true)} label={"toolbar.batch"}>
+ <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchStatus"}>
<EditIcon />
</Button>
<BatchModal
open={createDialog}
setOpen={setCreateDialog}
+ fieldType={'status'}
+ />
+ </>
+
+ )
+}
+const BatchLevelButton = () => {
+ const record = useRecordContext();
+ const notify = useNotify();
+ const refresh = useRefresh();
+
+
+ const [createDialog, setCreateDialog] = useState(false);
+
+ return (
+ <>
+ <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchStockLevel"}>
+ <EditIcon />
+ </Button>
+
+ <BatchModal
+ open={createDialog}
+ setOpen={setCreateDialog}
+ fieldType={'stockLevel'}
+ />
+ </>
+
+ )
+}
+
+const BatchWarnButton = () => {
+ const record = useRecordContext();
+ const notify = useNotify();
+ const refresh = useRefresh();
+
+
+ const [createDialog, setCreateDialog] = useState(false);
+
+ return (
+ <>
+ <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchValidWarn"}>
+ <EditIcon />
+ </Button>
+
+ <BatchModal
+ open={createDialog}
+ setOpen={setCreateDialog}
+ fieldType={'validWarn'}
+ />
+ </>
+
+ )
+}
+
+const BatchFlagButton = () => {
+ const record = useRecordContext();
+ const notify = useNotify();
+ const refresh = useRefresh();
+
+
+ const [createDialog, setCreateDialog] = useState(false);
+
+ return (
+ <>
+ <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchFlagCheck"}>
+ <EditIcon />
+ </Button>
+
+ <BatchModal
+ open={createDialog}
+ setOpen={setCreateDialog}
+ fieldType={'flagCheck'}
/>
</>
@@ -386,7 +469,7 @@
)
}
-const PrintButton = () => {
+const BatchPrintButton = () => {
const record = useRecordContext();
const { resource, selectedIds } = useListContext();
const notify = useNotify();
@@ -409,6 +492,29 @@
)
}
+const PrintButton = () => {
+ const record = useRecordContext();
+
+ const notify = useNotify();
+ const refresh = useRefresh();
+
+ const [createDialog, setCreateDialog] = useState(false);
+
+ return (
+ <>
+ <Button color="secondary" onClick={() => setCreateDialog(true)} label={"toolbar.print"}>
+ <PrintIcon />
+ </Button>
+
+ <PrintModal
+ open={createDialog}
+ setOpen={setCreateDialog}
+ rows={[record.id]}
+ />
+ </>
+ )
+}
+
const BindButton = () => {
const record = useRecordContext();
const notify = useNotify();
--
Gitblit v1.9.1