From 4496b9019ba423dd1c51c719bcc0a5938d90fff9 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 22 四月 2025 17:33:18 +0800
Subject: [PATCH] #修改优化  1. DO单明细编码优化  2. DO单明细新增优化  3. 出库单新增单据增加新单据功能

---
 rsf-admin/src/page/orders/outStock/OutOrderEdit.jsx |  150 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 150 insertions(+), 0 deletions(-)

diff --git a/rsf-admin/src/page/orders/outStock/OutOrderEdit.jsx b/rsf-admin/src/page/orders/outStock/OutOrderEdit.jsx
new file mode 100644
index 0000000..3c223c2
--- /dev/null
+++ b/rsf-admin/src/page/orders/outStock/OutOrderEdit.jsx
@@ -0,0 +1,150 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import {
+    Edit,
+    SimpleForm,
+    useTranslate,
+    TextInput,
+    DateInput,
+    SelectInput,
+    AutocompleteInput,
+    SaveButton,
+    Toolbar,
+    required,
+    DeleteButton,
+} from 'react-admin';
+import { useWatch, useFormContext } from "react-hook-form";
+import { Stack, Grid, Box, Typography } from '@mui/material';
+import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting';
+import EditBaseAside from "../../components/EditBaseAside";
+import CustomerTopToolBar from "../../components/EditTopToolBar";
+import OutOrderItemList from "./OutOrderItemList";
+
+const FormToolbar = () => {
+    const { getValues } = useFormContext();
+
+    return (
+        <Toolbar sx={{ justifyContent: 'end' }}>
+            <></>
+            {/* <SaveButton />
+            <DeleteButton mutationMode="optimistic" /> */}
+        </Toolbar>
+    )
+}
+
+const OutOrderEdit = () => {
+    const translate = useTranslate();
+    const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_order_type')) || [];
+    const business = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || [];
+
+    return (
+        <>
+            <Edit
+                redirect="list"
+                mutationMode={EDIT_MODE}
+                actions={<CustomerTopToolBar />}
+                aside={<EditBaseAside />}
+            >
+                <SimpleForm
+                    shouldUnregister
+                    warnWhenUnsavedChanges
+                    toolbar={<FormToolbar />}
+                    mode="onTouched"
+                    defaultValues={{}}
+                >
+                    <Grid container width={{ xs: '100%', xl: '100%' }} rowSpacing={3} columnSpacing={3}
+                        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',
+                            }
+                        }}
+                    >
+                        <Grid item xs={24} md={12} >
+                            <Typography variant="h6" gutterBottom>
+                                {translate('common.edit.title.main')}
+                            </Typography>
+                            <Stack direction='row' gap={2}>
+                                <TextInput
+                                    label="table.field.outStock.code"
+                                    source="code"
+                                    readOnly
+                                    parse={v => v}
+                                />
+                                <TextInput
+                                    label="table.field.outStock.poCode"
+                                    source="poCode"
+                                    readOnly
+                                    parse={v => v}
+                                />
+                                <AutocompleteInput
+                                    choices={dicts}
+                                    optionText="label"
+                                    label="table.field.outStock.type"
+                                    source="type"
+                                    optionValue="value"
+                                    parse={v => v}
+                                    readOnly
+                                />
+                                <AutocompleteInput
+                                    choices={business}
+                                    optionText="label"
+                                    label="table.field.outStock.wkType"
+                                    source="wkType"
+                                    optionValue="value"
+                                    parse={v => v}
+                                    readOnly
+                                />
+                            </Stack>
+                            <Stack direction='row' gap={2}>
+                                <TextInput
+                                    label="table.field.outStock.logisNo"
+                                    source="logisNo"
+                                    readOnly
+                                    parse={v => v}
+                                />
+                                <TextInput
+                                    label="table.field.outStock.anfme"
+                                    source="anfme"
+                                    readOnly
+                                    parse={v => v}
+                                />
+                                <TextInput
+                                    label="table.field.outStock.qty"
+                                    source="qty"
+                                    readOnly
+                                    parse={v => v}
+                                />
+                                <DateInput
+                                    label="table.field.outStock.arrTime"
+                                    source="arrTime"
+                                    readOnly
+                                />
+                                <SelectInput
+                                    label="table.field.outStock.rleStatus"
+                                    source="rleStatus"
+                                    readOnly
+                                    choices={[
+                                        { id: 0, name: ' 姝e父' },
+                                        { id: 1, name: ' 宸查噴鏀�' },
+                                    ]}
+                                    validate={required()}
+                                />
+                            </Stack>
+                        </Grid>
+                    </Grid>
+                </SimpleForm>
+            </Edit >
+            <OutOrderItemList />
+        </>
+    )
+}
+
+export default OutOrderEdit;

--
Gitblit v1.9.1