From f6ac59c98451f384fb1b2e8db286c2e9f163e49d Mon Sep 17 00:00:00 2001
From: cl <1442464845@qq.com>
Date: 星期三, 15 四月 2026 16:51:53 +0800
Subject: [PATCH] 批量禁用
---
rsf-admin/src/page/basicInfo/loc/BatchModal.jsx | 121 +++++++++++++++++++++++-----------------
1 files changed, 69 insertions(+), 52 deletions(-)
diff --git a/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx b/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx
index 4a4c023..9519ddc 100644
--- a/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx
@@ -52,10 +52,10 @@
import { Add, Edit, Delete } from '@mui/icons-material';
import _ from 'lodash';
import { DataGrid } from '@mui/x-data-grid';
-import StatusSelectInput from "../../components/StatusSelectInput";
+// import StatusSelectInput from "../../components/StatusSelectInput";
-const BatchModal = ({ open, setOpen }) => {
+const BatchModal = ({ open, setOpen, fieldType }) => {
const refresh = useRefresh();
const translate = useTranslate();
@@ -66,7 +66,7 @@
"warehouseId": null,
"areaId": null,
"type": null,
- 'status': null
+ 'useStatus': null
});
const { selectedIds, onUnselectItems } = useListContext();
@@ -86,7 +86,7 @@
"areaId": null,
"type": null,
"typeIds": null,
- 'status': null
+ 'useStatus': null
})
}
@@ -113,9 +113,14 @@
}
const handleSubmit = async () => {
+ const locData = removeEmptyKeys(formData)
+ // 鎵归噺淇敼搴撲綅鐘舵��
+ // if (fieldType === 'status') {
+ // locData.useStatus = 'X'
+ // }
const parmas = {
id: selectedIds,
- loc: removeEmptyKeys(formData)
+ loc: locData
}
const res = await request.post(`/loc/modify`, parmas);
@@ -128,48 +133,48 @@
}
return (
- <Dialog open={open} maxWidth="md" fullWidth>
+ <Dialog open={open} maxWidth="xs" fullWidth>
<Form onSubmit={handleSubmit}>
<DialogCloseButton onClose={handleClose} />
<DialogTitle>{translate('toolbar.batch')}</DialogTitle>
<DialogContent sx={{ mt: 2 }}>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
<Grid container spacing={2}>
- <Grid item xs={4}>
- <ReferenceInput
- source="warehouseId"
- reference="warehouse"
- >
- <AutocompleteInput
- label="table.field.loc.warehouseId"
- optionText="name"
- onChange={(value) => handleChange(value, 'warehouseId')}
- value={formData.warehouseId}
- filterToQuery={(val) => ({ name: val })}
- />
- </ReferenceInput>
+ {fieldType === 'warehouseId' &&
+ <Grid item xs={6}>
+ <ReferenceInput
+ source="warehouseId"
+ reference="warehouse"
+ >
+ <AutocompleteInput
+ label="table.field.loc.warehouseId"
+ optionText="name"
+ value={formData.warehouseId}
+ filterToQuery={(val) => ({ name: val })}
+ />
+ </ReferenceInput>
+ </Grid>
+ }
+ {fieldType === 'areaId' &&
+ <Grid item xs={6}>
+ <ReferenceInput
+ source="areaId"
+ reference="warehouseAreas"
+ >
+ <AutocompleteInput
+ label="table.field.loc.areaId"
+ optionText="name"
+ onChange={(value) => handleChange(value, 'areaId')}
+ value={formData.areaId}
+ filterToQuery={(val) => ({ name: val })}
+ />
+ </ReferenceInput>
- </Grid>
-
- <Grid item xs={4}>
- <ReferenceInput
- source="areaId"
- reference="warehouseAreas"
- filter={{ warehouseId: formData.warehouseId }}
- >
- <AutocompleteInput
- label="table.field.loc.areaId"
- optionText="name"
- onChange={(value) => handleChange(value, 'areaId')}
- value={formData.areaId}
- filterToQuery={(val) => ({ name: val })}
- />
- </ReferenceInput>
-
- </Grid>
-
- <Grid item xs={4}>
- {/* <DictionarySelect
+ </Grid>
+ }
+ {fieldType === 'typeIds' &&
+ <Grid item xs={6}>
+ {/* <DictionarySelect
label={translate("table.field.loc.type")}
name="type"
value={formData.type}
@@ -177,19 +182,31 @@
size="small"
dictTypeCode="sys_loc_type"
/> */}
- <ReferenceArrayInput source="typeIds" reference="locType" >
- <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} />
- </ReferenceArrayInput>
- </Grid>
+ <ReferenceArrayInput source="typeIds" reference="locType" >
+ <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} />
+ </ReferenceArrayInput>
+ </Grid>
+ }
- <Grid item xs={4}>
- <StatusSelectInput
- onChange={(e) => handleChange(e.target.value, 'status')}
- defaultValue={''}
- require={false}
- />
- </Grid>
-
+ {fieldType === 'status' &&
+ <Grid item xs={6}>
+ {/* <TextField
+ label={translate('table.field.loc.useStatus')}
+ value={'X(绂佺敤)'}
+ size="small"
+ fullWidth
+ disabled
+ /> */}
+ <DictionarySelect
+ label={translate("table.field.loc.useStatus")}
+ name="useStatus"
+ value={formData.useStatus}
+ onChange={(e) => handleChange(e.target.value, 'useStatus')}
+ size="small"
+ dictTypeCode="sys_loc_use_stas"
+ />
+ </Grid>
+ }
</Grid>
</Box>
--
Gitblit v1.9.1