From cc2984eeb289b54cfa193dde558417c46f309e8f Mon Sep 17 00:00:00 2001
From: DESKTOP-LMJ82IJ\Eno <creaycat@gmail.com>
Date: 星期日, 13 四月 2025 19:32:38 +0800
Subject: [PATCH] #修改 1. 采购单界面优化及修改

---
 rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx |  149 ++++++++++++++++++++++++-------------------------
 1 files changed, 73 insertions(+), 76 deletions(-)

diff --git a/rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx b/rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx
index 895ebc6..d44da31 100644
--- a/rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx
+++ b/rsf-admin/src/page/qlyInspect/QlyInspectEdit.jsx
@@ -28,12 +28,13 @@
 import CustomerTopToolBar from "../components/EditTopToolBar";
 import MemoInput from "../components/MemoInput";
 import StatusSelectInput from "../components/StatusSelectInput";
+import QlyIsptItemList from "./QlyIsptItemList";
 
 const FormToolbar = () => {
     const { getValues } = useFormContext();
 
     return (
-        <Toolbar sx={{ justifyContent: 'space-between' }}>
+        <Toolbar sx={{ justifyContent: 'end' }}>
             <SaveButton />
             <DeleteButton mutationMode="optimistic" />
         </Toolbar>
@@ -42,86 +43,82 @@
 
 const QlyInspectEdit = () => {
     const translate = useTranslate();
+    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={{}}
-            // validate={(values) => { }}
+        <>
+            <Edit
+                redirect="list"
+                mutationMode={EDIT_MODE}
+                actions={<CustomerTopToolBar />}
+                aside={<EditBaseAside />}
             >
-                <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}>
-                    <Grid item xs={12} md={8}>
-                        <Typography variant="h6" gutterBottom>
-                            {translate('common.edit.title.main')}
-                        </Typography>
-                        <Stack direction='row' gap={2}>
-                            <NumberInput
-                                label="table.field.qlyInspect.asnItemId"
-                                source="asnItemId"
-                                autoFocus
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <TextInput
-                                label="table.field.qlyInspect.code"
-                                source="code"
-                                parse={v => v}
-                                validate={required()}
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <TextInput
-                                label="table.field.qlyInspect.wkType"
-                                source="wkType"
-                                parse={v => v}
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <NumberInput
-                                label="table.field.qlyInspect.safeQty"
-                                source="safeQty"
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <NumberInput
-                                label="table.field.qlyInspect.dlyQty"
-                                source="dlyQty"
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <NumberInput
-                                label="table.field.qlyInspect.rcptQty"
-                                source="rcptQty"
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <NumberInput
-                                label="table.field.qlyInspect.isptQty"
-                                source="isptQty"
-                            />
-                        </Stack>
+                <SimpleForm
+                    shouldUnregister
+                    warnWhenUnsavedChanges
+                    toolbar={<FormToolbar />}
+                    mode="onTouched"
+                    defaultValues={{}}
+                >
+                    <Grid container width={{ xs: '100%', xl: '100%' }}>
+                        <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.qlyInspect.asnCode"
+                                    source="asnCode"
+                                    readOnly
+                                />
+                                <TextInput
+                                    label="table.field.qlyInspect.code"
+                                    source="code"
+                                    parse={v => v}
+                                    readOnly
+                                    validate={required()}
+                                />
+                                <AutocompleteInput
+                                    choices={business}
+                                    optionText="label"
+                                    label="table.field.asnOrder.wkType"
+                                    source="wkType"
+                                    readOnly
+                                    optionValue="value"
+                                    parse={v => v}
+                                />
+                            </Stack>
+                            <Stack direction='row' gap={2}>
+                                <NumberInput
+                                    label="table.field.qlyInspect.safeQty"
+                                    source="safeQty"
+                                    readOnly
+                                />
+                                <NumberInput
+                                    label="table.field.qlyInspect.dlyQty"
+                                    source="dlyQty"
+                                    readOnly
 
+                                />
+                                <NumberInput
+                                    label="table.field.qlyInspect.rcptQty"
+                                    source="rcptQty"
+                                    readOnly
+
+                                />
+                                <NumberInput
+                                    label="table.field.qlyInspect.isptQty"
+                                    source="isptQty"
+                                    readOnly
+
+                                />
+                            </Stack>
+                        </Grid>
                     </Grid>
-                    <Grid item xs={12} md={4}>
-                        <Typography variant="h6" gutterBottom>
-                            {translate('common.edit.title.common')}
-                        </Typography>
-                        <StatusSelectInput />
-                        <Box mt="2em" />
-                        <MemoInput />
-                    </Grid>
-                </Grid>
-            </SimpleForm>
-        </Edit >
+                </SimpleForm>
+            </Edit >
+            <QlyIsptItemList />
+        </>
     )
 }
 

--
Gitblit v1.9.1