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 |  118 +++++++++++++++++++++++++----------------------------------
 1 files changed, 50 insertions(+), 68 deletions(-)

diff --git a/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx b/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx
index c8c7fcb..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
@@ -66,13 +77,14 @@
                         <Grid container rowSpacing={2} columnSpacing={2}>
                             <Grid item xs={6} display="flex" gap={1}>
                                 <ReferenceInput
-                                    source="warehouseId$"
+                                    source="warehouseId"
                                     reference="warehouse"
                                 >
                                     <AutocompleteInput
                                         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,39 +112,18 @@
                                 />
                             </Grid>
                             <Grid item xs={6} display="flex" gap={1}>
-                                <TextInput
-                                    label="table.field.loc.type"
+                                {/* <AutocompleteInput
+                                    choices={dicts}
                                     source="type"
+                                    optionText="label"
+                                    label="table.field.loc.type"
+                                    optionValue="value"
                                     parse={v => v}
-                                    validate={required()}
-                                />
-                            </Grid>
-                            <Grid item xs={6} display="flex" gap={1}>
-                                <TextInput
-                                    label="table.field.loc.name"
-                                    source="name"
-                                    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
@@ -141,16 +133,30 @@
                                 />
                             </Grid>
                             <Grid item xs={6} display="flex" gap={1}>
-                                <TextInput
-                                    label="table.field.loc.size"
-                                    source="size"
-                                    parse={v => v}
+                                <NumberInput
+                                    label="table.field.loc.length"
+                                    source="length"
+                                    validate={required()}
+                                />
+                            </Grid>
+                            <Grid item xs={6} display="flex" gap={1}>
+                                <NumberInput
+                                    label="table.field.loc.width"
+                                    source="width"
+                                    validate={required()}
+                                />
+                            </Grid>
+                            <Grid item xs={6} display="flex" gap={1}>
+                                <NumberInput
+                                    label="table.field.loc.height"
+                                    source="height"
+                                    validate={required()}
                                 />
                             </Grid>
                             <Grid item xs={6} display="flex" gap={1}>
                                 <NumberInput
                                     label="table.field.loc.row"
-                                    source="lrow"
+                                    source="row"
                                     validate={required()}
                                 />
                             </Grid>
@@ -169,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