From 7f26038db785f902097422bfeaccfd52767fc7e1 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 03 四月 2025 09:42:49 +0800
Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop

---
 rsf-admin/src/page/basicInfo/loc/LocEdit.jsx |  101 +++++++++++++++-----------------------------------
 1 files changed, 31 insertions(+), 70 deletions(-)

diff --git a/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx b/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx
index 3ea6793..5b1182e 100644
--- a/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx
@@ -10,6 +10,7 @@
     DateInput,
     SelectInput,
     ReferenceInput,
+    SelectArrayInput,
     ReferenceArrayInput,
     AutocompleteInput,
     SaveButton,
@@ -19,6 +20,7 @@
     required,
     useRecordContext,
     DeleteButton,
+    useNotify,
 } from 'react-admin';
 import { useWatch, useFormContext } from "react-hook-form";
 import { Stack, Grid, Box, Typography } from '@mui/material';
@@ -28,6 +30,8 @@
 import CustomerTopToolBar from "../../components/EditTopToolBar";
 import MemoInput from "../../components/MemoInput";
 import StatusSelectInput from "../../components/StatusSelectInput";
+import request from '@/utils/request';
+import DictionarySelect from "../../components/DictionarySelect";
 
 const FormToolbar = () => {
     const { getValues } = useFormContext();
@@ -42,6 +46,12 @@
 
 const LocEdit = () => {
     const translate = useTranslate();
+    const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || [];
+    const [warehouseId, setWrehouseId] = useState();
+
+    const warehouseChange = (val) => {
+        setWrehouseId(val)
+    }
 
     return (
         <Edit
@@ -49,6 +59,7 @@
             mutationMode={EDIT_MODE}
             actions={<CustomerTopToolBar />}
             aside={<EditBaseAside />}
+            title={"menu.loc"}
         >
             <SimpleForm
                 shouldUnregister
@@ -73,6 +84,7 @@
                                         label="table.field.loc.warehouseId"
                                         optionText="name"
                                         validate={[required()]}
+                                        onChange={warehouseChange}
                                         filterToQuery={(val) => ({ name: val })}
                                     />
                                 </ReferenceInput>
@@ -81,6 +93,7 @@
                                 <ReferenceInput
                                     source="areaId"
                                     reference="warehouseAreas"
+                                    filter={{ warehouseId }}
                                 >
                                     <AutocompleteInput
                                         label="table.field.loc.areaId"
@@ -99,46 +112,18 @@
                                 />
                             </Grid>
                             <Grid item xs={6} display="flex" gap={1}>
-                                <ReferenceInput
+                                {/* <AutocompleteInput
+                                    choices={dicts}
                                     source="type"
-                                    reference="dictData"
-                                    filter={{ dictTypeCode: 'sys_loc_type' }}
-                                >
-                                    <AutocompleteInput
-                                        label="table.field.loc.type"
-                                        optionText="label"
-                                        optionValue="value"
-                                        parse={v => v}
-                                        validate={[required()]}
-                                    />
-                                </ReferenceInput>
-                            </Grid>
-                            <Grid item xs={6} display="flex" gap={1}>
-                                <TextInput
-                                    label="table.field.loc.name"
-                                    source="name"
+                                    optionText="label"
+                                    label="table.field.loc.type"
+                                    optionValue="value"
                                     parse={v => v}
-                                />
-                            </Grid>
-                            <Grid item xs={6} display="flex" gap={1}>
-                                <NumberInput
-                                    label="table.field.loc.flagLogic"
-                                    source="flagLogic"
-                                />
-                            </Grid>
-                            <Grid item xs={6} display="flex" gap={1}>
-                                <TextInput
-                                    label="table.field.loc.fucAtrrs"
-                                    source="fucAtrrs"
-                                    parse={v => v}
-                                />
-                            </Grid>
-                            <Grid item xs={6} display="flex" gap={1}>
-                                <TextInput
-                                    label="table.field.loc.barcode"
-                                    source="barcode"
-                                    parse={v => v}
-                                />
+                                    validate={[required()]}
+                                /> */}
+                                <ReferenceArrayInput source="typeIds" reference="locType" >
+                                    <SelectArrayInput label="table.field.loc.type" validate={[required()]} />
+                                </ReferenceArrayInput>
                             </Grid>
                             <Grid item xs={6} display="flex" gap={1}>
                                 <TextInput
@@ -171,7 +156,7 @@
                             <Grid item xs={6} display="flex" gap={1}>
                                 <NumberInput
                                     label="table.field.loc.row"
-                                    source="lrow"
+                                    source="row"
                                     validate={required()}
                                 />
                             </Grid>
@@ -190,40 +175,16 @@
                                 />
                             </Grid>
                             <Grid item xs={6} display="flex" gap={1}>
-                                <NumberInput
-                                    label="table.field.loc.channel"
-                                    source="channel"
-                                    validate={required()}
+                                <DictionarySelect
+                                    label={translate("table.field.loc.useStatus")}
+                                    name="useStatus"
+                                    validate={[required()]}
+                                    size="small"
+                                    dictTypeCode="sys_loc_use_stas"
                                 />
                             </Grid>
-                            <Grid item xs={6} display="flex" gap={1}>
-                                <NumberInput
-                                    label="table.field.loc.maxParts"
-                                    source="maxParts"
-                                />
-                            </Grid>
-                            <Grid item xs={6} display="flex" gap={1}>
-                                <NumberInput
-                                    label="table.field.loc.maxPack"
-                                    source="maxPack"
-                                />
-                            </Grid>
-                            <Grid item xs={6} display="flex" gap={1}>
-                                <NumberInput
-                                    label="table.field.loc.flagLabelMange"
-                                    source="flagLabelMange"
-                                />
-                            </Grid>
-                            <Grid item xs={6} display="flex" gap={1}>
-                                <TextInput
-                                    label="table.field.loc.locAttrs"
-                                    source="locAttrs"
-                                    parse={v => v}
-                                    validate={required()}
-                                />
-                            </Grid>
-                        </Grid>
 
+                        </Grid>
                     </Grid>
                     <Grid item xs={12} md={2}>
                         <Typography variant="h6" gutterBottom>

--
Gitblit v1.9.1