From b31c46000e83273cc9a27686dc0aef7bece2b027 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 06 八月 2025 14:06:59 +0800
Subject: [PATCH] 库存调整功能优化
---
rsf-admin/src/page/orders/transfer/TransferEdit.jsx | 54 +++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/rsf-admin/src/page/orders/transfer/TransferEdit.jsx b/rsf-admin/src/page/orders/transfer/TransferEdit.jsx
index fedacf5..a12c97d 100644
--- a/rsf-admin/src/page/orders/transfer/TransferEdit.jsx
+++ b/rsf-admin/src/page/orders/transfer/TransferEdit.jsx
@@ -20,21 +20,22 @@
useRecordContext,
DeleteButton,
} from "react-admin";
-import { useWatch, useFormContext } from "react-hook-form";
-import { Stack, Grid, Box, Typography } from "@mui/material";
-import * as Common from "@/utils/common.js";
+
import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from "@/config/setting.js";
-import EditBaseAside from "../../components/EditBaseAside.jsx";
-import CustomerTopToolBar from "../../components/EditTopToolBar.jsx";
-import MemoInput from "../../components/MemoInput.jsx";
import StatusSelectInput from "../../components/StatusSelectInput.jsx";
+import CustomerTopToolBar from "../../components/EditTopToolBar.jsx";
+import EditBaseAside from "../../components/EditBaseAside.jsx";
+import { Stack, Grid, Box, Typography } from "@mui/material";
+import { useWatch, useFormContext } from "react-hook-form";
+import MemoInput from "../../components/MemoInput.jsx";
import TransferItemList from "./TransferItemList.jsx";
+import * as Common from "@/utils/common.js";
const FormToolbar = () => {
const { getValues } = useFormContext();
return (
- <Toolbar sx={{ justifyContent: "space-between" }}>
+ <Toolbar sx={{ justifyContent: "flex-end" }}>
<SaveButton />
<DeleteButton mutationMode="optimistic" />
</Toolbar>
@@ -53,20 +54,34 @@
aside={<EditBaseAside />}
>
<SimpleForm
+ sx={{
+ "& .MuiFormLabel-root.MuiInputLabel-root.Mui-disabled": {
+ bgcolor: 'white',
+ WebkitTextFillColor: "rgba(0, 0, 0)"
+ },
+
+ "& .MuiInputBase-input.MuiFilledInput-input.Mui-disabled": {
+ bgcolor: 'white',
+ WebkitTextFillColor: "rgba(0, 0, 0)"
+ },
+
+ "& .MuiFilledInput-root.MuiInputBase-sizeSmall": {
+ bgcolor: 'white',
+ }
+ }}
shouldUnregister
warnWhenUnsavedChanges
- toolbar={<FormToolbar />}
+ toolbar={false}
mode="onTouched"
defaultValues={{}}
- // validate={(values) => { }}
>
<Grid
container
- width={{ xs: "100%", xl: "80%" }}
+ width={{ xs: "100%", xl: "90%", }}
rowSpacing={3}
columnSpacing={3}
>
- <Grid item xs={12} md={8}>
+ <Grid item xs={24} md={16}>
<Typography variant="h6" gutterBottom>
{translate("common.edit.title.main")}
</Typography>
@@ -76,13 +91,13 @@
source="code"
parse={(v) => v}
autoFocus
+ readOnly
/>
- </Stack>
- <Stack direction="row" gap={2}>
- <NumberInput label="table.field.transfer.type" source="type" />
+ <TextInput label="table.field.transfer.type" source="type$" readOnly/>
<SelectInput
label="table.field.transfer.source"
source="source"
+ readOnly
choices={[
{ id: 1, name: "ERP绯荤粺" },
{ id: 2, name: "WMS绯荤粺鐢熸垚" },
@@ -92,7 +107,8 @@
/>
<SelectInput
label="table.field.transfer.exceStatus"
- source="exceStatus"
+ source="exceStatus$"
+ readOnly
choices={[
{ id: 0, name: "鏈墽琛�" },
{ id: 1, name: "鎵ц涓�" },
@@ -104,19 +120,23 @@
<NumberInput
label="table.field.transfer.orgWareId"
source="orgWareId"
+ readOnly
/>
<TextInput
label="table.field.transfer.orgWareName"
source="orgWareName"
+ readOnly
parse={(v) => v}
/>
<NumberInput
label="table.field.transfer.tarWareId"
source="tarWareId"
+ readOnly
/>
<TextInput
label="table.field.transfer.tarWareName"
source="tarWareName"
+ readOnly
parse={(v) => v}
/>
</Stack>
@@ -124,19 +144,23 @@
<NumberInput
label="table.field.transfer.orgAreaId"
source="orgAreaId"
+ readOnly
/>
<TextInput
label="table.field.transfer.orgAreaName"
source="orgAreaName"
+ readOnly
parse={(v) => v}
/>
<NumberInput
label="table.field.transfer.tarAreaId"
source="tarAreaId"
+ readOnly
/>
<TextInput
label="table.field.transfer.tarAreaName"
source="tarAreaName"
+ readOnly
parse={(v) => v}
/>
</Stack>
--
Gitblit v1.9.1