From 1f5173508a63509985b27d94660f6ad251d18e6e Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 26 三月 2025 12:32:23 +0800
Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
---
rsf-admin/src/page/asnOrder/AsnOrderList.jsx | 38 +++---
rsf-admin/src/page/basicInfo/loc/BatchModal.jsx | 98 ++++++++++---------
rsf-admin/src/page/basicInfo/loc/LocListAside.jsx | 11 +
rsf-admin/src/i18n/zh.js | 2
rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx | 29 +++++
rsf-admin/src/i18n/en.js | 2
rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx | 2
rsf-admin/src/page/basicInfo/loc/LocList.jsx | 86 +++++++++++++++-
rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx | 2
rsf-admin/src/page/basicInfo/locAreaMat/LocAreaMatPanel.jsx | 14 +-
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx | 2
11 files changed, 197 insertions(+), 89 deletions(-)
diff --git a/rsf-admin/src/i18n/en.js b/rsf-admin/src/i18n/en.js
index e767188..6876c34 100644
--- a/rsf-admin/src/i18n/en.js
+++ b/rsf-admin/src/i18n/en.js
@@ -653,6 +653,8 @@
batchMix: 'batchFiexed',
batchWarehouse: 'batchWarehouse',
batchStockLevel: "batchStockLevel",
+ batchWarehouseAreas: "batchWarehouseAreas",
+ batchLocType: "batchLocType",
},
};
diff --git a/rsf-admin/src/i18n/zh.js b/rsf-admin/src/i18n/zh.js
index 446f610..4684a76 100644
--- a/rsf-admin/src/i18n/zh.js
+++ b/rsf-admin/src/i18n/zh.js
@@ -657,6 +657,8 @@
batchStockLevel: "鎵归噺ABC鍒嗙被",
batchValidWarn: "鎵归噺棰勮",
batchFlagCheck: "鎵归噺鍏嶆",
+ batchWarehouseAreas: "鎵归噺搴撳尯",
+ batchLocType: "鎵归噺搴撲綅绫诲瀷",
},
};
diff --git a/rsf-admin/src/page/asnOrder/AsnOrderList.jsx b/rsf-admin/src/page/asnOrder/AsnOrderList.jsx
index 095bde5..39e22a4 100644
--- a/rsf-admin/src/page/asnOrder/AsnOrderList.jsx
+++ b/rsf-admin/src/page/asnOrder/AsnOrderList.jsx
@@ -111,29 +111,29 @@
const inspection = () => { };
const print = () => {
- const imageUrls = ['https://www.baidu.com/img/flexible/logo/pc/result@2.png',]
- const iframe = document.createElement('iframe');
- iframe.style.display = 'none';
- document.body.appendChild(iframe);
+ // const imageUrls = ['https://www.baidu.com/img/flexible/logo/pc/result@2.png',]
+ // const iframe = document.createElement('iframe');
+ // iframe.style.display = 'none';
+ // document.body.appendChild(iframe);
- const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
- iframeDoc.open();
- iframeDoc.write('<html><head><title>Print Images</title></head><body>');
+ // const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
+ // iframeDoc.open();
+ // iframeDoc.write('<html><head><title>Print Images</title></head><body>');
- // 灏嗗浘鐗囨彃鍏ュ埌 iframe 涓�
- imageUrls.forEach((imageUrl) => {
- iframeDoc.write(`<img src="${imageUrl}" style="margin: 10px;">`);
- });
+ // // 灏嗗浘鐗囨彃鍏ュ埌 iframe 涓�
+ // imageUrls.forEach((imageUrl) => {
+ // iframeDoc.write(`<img src="${imageUrl}" style="margin: 10px;">`);
+ // });
- iframeDoc.write('</body></html>');
- iframeDoc.close();
+ // iframeDoc.write('</body></html>');
+ // iframeDoc.close();
- // 绛夊緟鍥剧墖鍔犺浇瀹屾垚鍚庤Е鍙戞墦鍗�
- iframe.contentWindow.onload = () => {
- iframe.contentWindow.print();
- // 鎵撳嵃瀹屾垚鍚庣Щ闄� iframe
- document.body.removeChild(iframe);
- };
+ // // 绛夊緟鍥剧墖鍔犺浇瀹屾垚鍚庤Е鍙戞墦鍗�
+ // iframe.contentWindow.onload = () => {
+ // iframe.contentWindow.print();
+ // // 鎵撳嵃瀹屾垚鍚庣Щ闄� iframe
+ // document.body.removeChild(iframe);
+ // };
};
diff --git a/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx b/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx
index 4a4c023..64cc36a 100644
--- a/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/BatchModal.jsx
@@ -55,7 +55,7 @@
import StatusSelectInput from "../../components/StatusSelectInput";
-const BatchModal = ({ open, setOpen }) => {
+const BatchModal = ({ open, setOpen, fieldType }) => {
const refresh = useRefresh();
const translate = useTranslate();
@@ -128,48 +128,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 +177,21 @@
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}>
+ <StatusSelectInput
+ onChange={(e) => handleChange(e.target.value, 'status')}
+ defaultValue={''}
+ require={false}
+ />
+ </Grid>
+ }
</Grid>
</Box>
diff --git a/rsf-admin/src/page/basicInfo/loc/LocList.jsx b/rsf-admin/src/page/basicInfo/loc/LocList.jsx
index af7f744..9af0d60 100644
--- a/rsf-admin/src/page/basicInfo/loc/LocList.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/LocList.jsx
@@ -85,7 +85,6 @@
source="warehouseId"
label="table.field.loc.warehouseId"
reference="warehouse"
- alwaysOn
>
<AutocompleteInput
label="table.field.loc.warehouseId"
@@ -97,7 +96,6 @@
source="areaId"
label="table.field.loc.areaId"
reference="warehouseAreas"
- alwaysOn
>
<AutocompleteInput
label="table.field.loc.areaId"
@@ -194,14 +192,16 @@
</TopToolbar>
)}
perPage={DEFAULT_PAGE_SIZE}
- aside={<LocListAside />}
>
<StyledDatagrid
preferenceKey='loc'
align="left"
bulkActionButtons={
<>
- <BatchButton />
+ <BatchWateButton />
+ <BatchAreasButton />
+ <BatchLocTypeButton />
+ <BatchStatusButton />
<BindButton />
<SubzoneButton />
<BulkDeleteButton />
@@ -298,7 +298,7 @@
)
}
-const BatchButton = () => {
+const BatchWateButton = () => {
const record = useRecordContext();
const notify = useNotify();
const refresh = useRefresh();
@@ -306,16 +306,88 @@
const [createDialog, setCreateDialog] = useState(false);
-
return (
<>
- <Button onClick={() => setCreateDialog(true)} label={"toolbar.batch"}>
+ <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchWarehouse"}>
<EditIcon />
</Button>
<BatchModal
open={createDialog}
setOpen={setCreateDialog}
+ fieldType={'warehouseId'}
+ />
+ </>
+
+ )
+}
+
+const BatchAreasButton = () => {
+ const record = useRecordContext();
+ const notify = useNotify();
+ const refresh = useRefresh();
+
+
+ const [createDialog, setCreateDialog] = useState(false);
+
+ return (
+ <>
+ <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchWarehouseAreas"}>
+ <EditIcon />
+ </Button>
+
+ <BatchModal
+ open={createDialog}
+ setOpen={setCreateDialog}
+ fieldType={'areaId'}
+ />
+ </>
+
+ )
+}
+
+const BatchLocTypeButton = () => {
+ const record = useRecordContext();
+ const notify = useNotify();
+ const refresh = useRefresh();
+
+
+ const [createDialog, setCreateDialog] = useState(false);
+
+ return (
+ <>
+ <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchLocType"}>
+ <EditIcon />
+ </Button>
+
+ <BatchModal
+ open={createDialog}
+ setOpen={setCreateDialog}
+ fieldType={'typeIds'}
+ />
+ </>
+
+ )
+}
+
+const BatchStatusButton = () => {
+ const record = useRecordContext();
+ const notify = useNotify();
+ const refresh = useRefresh();
+
+
+ const [createDialog, setCreateDialog] = useState(false);
+
+ return (
+ <>
+ <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchStatus"}>
+ <EditIcon />
+ </Button>
+
+ <BatchModal
+ open={createDialog}
+ setOpen={setCreateDialog}
+ fieldType={'status'}
/>
</>
diff --git a/rsf-admin/src/page/basicInfo/loc/LocListAside.jsx b/rsf-admin/src/page/basicInfo/loc/LocListAside.jsx
index 72a68da..7ccba16 100644
--- a/rsf-admin/src/page/basicInfo/loc/LocListAside.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/LocListAside.jsx
@@ -62,8 +62,15 @@
}
const handleNodeSelect = (event, nodeId) => {
- console.log(nodeId);
- // setFilters({ groupId: nodeId });
+ const row = apiRef.current.getItem(nodeId);
+ console.log(row);
+
+ if (row.type === 'warehouseId') {
+ // setFilters({ warehouseId: row.id ,areaId:''});
+ } else if (row.type === 'areaId') {
+ // setFilters({ areaId: row.id ,warehouseId:''});
+ }
+
};
const handleSearch = (e) => {
setCondition(e.target.value)
diff --git a/rsf-admin/src/page/basicInfo/locAreaMat/LocAreaMatPanel.jsx b/rsf-admin/src/page/basicInfo/locAreaMat/LocAreaMatPanel.jsx
index 330640d..bb5207e 100644
--- a/rsf-admin/src/page/basicInfo/locAreaMat/LocAreaMatPanel.jsx
+++ b/rsf-admin/src/page/basicInfo/locAreaMat/LocAreaMatPanel.jsx
@@ -252,8 +252,8 @@
<RichTreeView
expansionTrigger="iconContainer"
- checkboxSelection
- multiSelect
+ // checkboxSelection
+ // multiSelect
items={matnrTree}
apiRef={apiRef}
getItemId={(item) => item.id}
@@ -388,17 +388,17 @@
<RichTreeView
expansionTrigger="iconContainer"
- checkboxSelection
- multiSelect
items={locTree}
apiRef={apiRef}
- selectedItems={selectedItems}
getItemId={(item) => item.id}
getItemLabel={(item) => item.name}
defaultExpandedItems={['grid']}
- onSelectedItemsChange={handleSelectedItemsChange}
- onItemSelectionToggle={handleItemSelectionToggle}
onItemClick={handleNodeSelect}
+ onItemSelectionToggle={handleItemSelectionToggle}
+ // checkboxSelection
+ // multiSelect
+ selectedItems={selectedItems}
+ onSelectedItemsChange={handleSelectedItemsChange}
/>
<BindLocModal
diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx
index 0d5ff70..a203630 100644
--- a/rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx
+++ b/rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx
@@ -285,7 +285,7 @@
<Grid key={item.id} item xs={6} display="flex" gap={1}>
<TextInput
label={item.fieldsAlise}
- source={`extendFields.[${item.fields}]`}
+ source={item.fields}
validate={required()}
/>
</Grid>
diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx
index 003de96..c0d582a 100644
--- a/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx
+++ b/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx
@@ -268,7 +268,7 @@
<Grid key={item.id} item xs={6} display="flex" gap={1}>
<TextInput
label={item.fieldsAlise}
- source={`extendFields.[${item.fields}]`}
+ source={item.fields}
validate={required()}
/>
</Grid>
diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
index 2a7d658..438bd7e 100644
--- a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
+++ b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
@@ -211,7 +211,7 @@
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]);
@@ -247,7 +247,7 @@
<BatchStatusButton />
<BatchLevelButton />
<BindButton />
- <PrintButton />
+ <BatchPrintButton />
<BulkDeleteButton mutationMode={OPERATE_MODE} />
</>}
rowClick={(id, resource, record) => false}
@@ -461,7 +461,7 @@
)
}
-const PrintButton = () => {
+const BatchPrintButton = () => {
const record = useRecordContext();
const { resource, selectedIds } = useListContext();
const notify = useNotify();
@@ -484,6 +484,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]}
+ />
+ </>
+ )
+}
+
const BindButton = () => {
const record = useRecordContext();
const notify = useNotify();
diff --git a/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx b/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
index f618577..feaa543 100644
--- a/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
+++ b/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
@@ -241,7 +241,7 @@
overflow: 'hidden',
fontSize: 'small',
tableLayout: 'fixed',
- width: '280px',
+ width: '520px',
borderCollapse: 'collapse',
borderSpacing: 0,
margin: '0 auto',
--
Gitblit v1.9.1