From a0c27ec444c85326efe3bacf3205dfecbd66451d Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 22 四月 2025 09:28:39 +0800
Subject: [PATCH] #新增 1. 新增出库单明细  2. 编码规则bug修改

---
 rsf-admin/src/page/system/serialRule/SerialRuleEdit.jsx |  160 ++++++++++++++++++++++++++---------------------------
 1 files changed, 78 insertions(+), 82 deletions(-)

diff --git a/rsf-admin/src/page/system/serialRule/SerialRuleEdit.jsx b/rsf-admin/src/page/system/serialRule/SerialRuleEdit.jsx
index 4440c43..e950bb9 100644
--- a/rsf-admin/src/page/system/serialRule/SerialRuleEdit.jsx
+++ b/rsf-admin/src/page/system/serialRule/SerialRuleEdit.jsx
@@ -28,12 +28,13 @@
 import CustomerTopToolBar from "../../components/EditTopToolBar";
 import MemoInput from "../../components/MemoInput";
 import StatusSelectInput from "../../components/StatusSelectInput";
+import SerialRuleItemList from "./SerialRuleItemList";
 
 const FormToolbar = () => {
     const { getValues } = useFormContext();
 
     return (
-        <Toolbar sx={{ justifyContent: 'space-between' }}>
+        <Toolbar sx={{ justifyContent: 'end' }}>
             <SaveButton />
             <DeleteButton mutationMode="optimistic" />
         </Toolbar>
@@ -42,91 +43,86 @@
 
 const SerialRuleEdit = () => {
     const translate = useTranslate();
+    const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_task_reset_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}>
-                            <TextInput
-                                label="table.field.serialRule.code"
-                                source="code"
-                                parse={v => v}
-                                autoFocus
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <TextInput
-                                label="table.field.serialRule.name"
-                                source="name"
-                                parse={v => v}
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <TextInput
-                                label="table.field.serialRule.delimit"
-                                source="delimit"
-                                parse={v => v}
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <TextInput
-                                label="table.field.serialRule.reset"
-                                source="reset"
-                                parse={v => v}
-                                validate={required()}
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <TextInput
-                                label="table.field.serialRule.resetDep"
-                                source="resetDep"
-                                parse={v => v}
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <TextInput
-                                label="table.field.serialRule.currValue"
-                                source="currValue"
-                                parse={v => v}
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <TextInput
-                                label="table.field.serialRule.lastCode"
-                                source="lastCode"
-                                parse={v => v}
-                            />
-                        </Stack>
-
+                <SimpleForm
+                    shouldUnregister
+                    warnWhenUnsavedChanges
+                    toolbar={<FormToolbar />}
+                    mode="onTouched"
+                    defaultValues={{}}
+                // validate={(values) => { }}
+                >
+                    <Grid container width={{ xs: '100%', xl: '90%' }} rowSpacing={3} columnSpacing={3}>
+                        <Grid item xs={16} md={10}>
+                            <Typography variant="h6" gutterBottom>
+                                {translate('common.edit.title.main')}
+                            </Typography>
+                            <Stack direction='row' gap={2}>
+                                <TextInput
+                                    label="table.field.serialRule.code"
+                                    source="code"
+                                    parse={v => v}
+                                    readOnly
+                                />
+                                <TextInput
+                                    label="table.field.serialRule.name"
+                                    source="name"
+                                    parse={v => v}
+                                />
+                                <TextInput
+                                    label="table.field.serialRule.delimit"
+                                    source="delimit"
+                                    parse={v => v}
+                                />
+                            </Stack>
+                            <Stack direction='row' gap={2}>
+                                <AutocompleteInput
+                                    choices={dicts}
+                                    optionText="label"
+                                    label="table.field.serialRule.reset"
+                                    source="reset"
+                                    optionValue="value"
+                                    parse={v => v}
+                                    validate={[required()]} />
+                                <TextInput
+                                    label="table.field.serialRule.resetDep"
+                                    source="resetDep"
+                                    parse={v => v}
+                                />
+                                <TextInput
+                                    label="table.field.serialRule.currValue"
+                                    source="currValue"
+                                    parse={v => v}
+                                />
+                                <TextInput
+                                    label="table.field.serialRule.lastCode"
+                                    source="lastCode"
+                                    parse={v => v}
+                                />
+                            </Stack>
+                        </Grid>
+                        <Grid item xs={8} md={2}>
+                            <Typography variant="h6" gutterBottom>
+                                {translate('common.edit.title.common')}
+                            </Typography>
+                            <StatusSelectInput />
+                            <Box mt="2em" />
+                            <MemoInput />
+                        </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 >
+            <SerialRuleItemList></SerialRuleItemList>
+        </>
     )
 }
 

--
Gitblit v1.9.1