Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
merchant-manage-ui
Commits
d8f84003
Commit
d8f84003
authored
Nov 16, 2022
by
李腾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加多包裹物流限制
parent
1cea40f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
index.jsx
...ingDeliveryOrder/components/MultiLogisticsModal/index.jsx
+12
-5
No files found.
src/pages/orderManage/pendingDeliveryOrder/components/MultiLogisticsModal/index.jsx
View file @
d8f84003
...
@@ -6,7 +6,7 @@ import { apiDeliveriesAdd, apiDeliveriesEdit } from '../../service';
...
@@ -6,7 +6,7 @@ import { apiDeliveriesAdd, apiDeliveriesEdit } from '../../service';
import
styles
from
'
./index.less
'
;
import
styles
from
'
./index.less
'
;
const
FormComponent
=
(
props
,
ref
)
=>
{
const
FormComponent
=
(
props
,
ref
)
=>
{
const
{
record
=
{},
companys
=
[]
}
=
props
;
const
{
record
=
{},
companys
=
[]
,
minPackageCount
=
1
,
maxPackageCount
=
10
}
=
props
;
const
{
mchOrderSkuVoList
,
packageList
}
=
record
;
const
{
mchOrderSkuVoList
,
packageList
}
=
record
;
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
[
addPackageList
,
setAddPackageList
]
=
useState
({
const
[
addPackageList
,
setAddPackageList
]
=
useState
({
...
@@ -151,7 +151,9 @@ const FormComponent = (props, ref) => {
...
@@ -151,7 +151,9 @@ const FormComponent = (props, ref) => {
<
div
className=
{
styles
.
operation
}
>
<
div
className=
{
styles
.
operation
}
>
<
PlusCircleOutlined
<
PlusCircleOutlined
style=
{
{
color
:
fields
.
length
>=
maxPackageCount
?
'
#ccc
'
:
''
}
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
if
(
fields
.
length
>=
maxPackageCount
)
return
;
const
currentPackageList
=
form
.
getFieldValue
(
'
packageList
'
);
const
currentPackageList
=
form
.
getFieldValue
(
'
packageList
'
);
form
.
setFieldsValue
({
form
.
setFieldsValue
({
packageList
:
[...
currentPackageList
,
addPackageList
],
packageList
:
[...
currentPackageList
,
addPackageList
],
...
@@ -159,8 +161,9 @@ const FormComponent = (props, ref) => {
...
@@ -159,8 +161,9 @@ const FormComponent = (props, ref) => {
}
}
}
}
/>
/>
<
MinusCircleOutlined
<
MinusCircleOutlined
style=
{
{
color
:
fields
.
length
<=
minPackageCount
?
'
#ccc
'
:
''
}
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
if
(
fields
.
length
<=
1
)
return
;
if
(
fields
.
length
<=
minPackageCount
)
return
;
remove
(
fields
[
fields
.
length
-
1
].
name
);
remove
(
fields
[
fields
.
length
-
1
].
name
);
}
}
}
}
/>
/>
...
@@ -288,10 +291,14 @@ const UpdateStatusModal = (props, ref) => {
...
@@ -288,10 +291,14 @@ const UpdateStatusModal = (props, ref) => {
onOk
,
onOk
,
};
};
const
formProps
=
{
record
,
companys
,
minPackageCount
:
oldPackageList
?.
length
||
1
,
};
return
renderModal
?
(
return
renderModal
?
(
<
Modal
{
...
modalProps
}
>
<
Modal
{
...
modalProps
}
>
{
record
?
<
FormWarpper
ref=
{
formRef
}
{
...
formProps
}
/>
:
''
}
</
Modal
>
{
record
?
<
FormWarpper
ref=
{
formRef
}
record=
{
record
}
companys=
{
companys
}
/>
:
''
}
</
Modal
>
)
:
(
)
:
(
''
''
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment