Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
shenshaokai
jinfa-platform
Commits
2992a995
Commit
2992a995
authored
Aug 09, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 添加退货发货数量校验
parent
40fd6227
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
index.tsx
.../returnPrDeliver/components/ReturnDeliverDrawer/index.tsx
+23
-4
verify.tsx
...afterService/returnApplication/returnPrDeliver/verify.tsx
+2
-2
No files found.
src/pages/afterService/returnApplication/returnPrDeliver/components/ReturnDeliverDrawer/index.tsx
View file @
2992a995
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-07 15:11:54
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-0
7 20:14:24
* @LastEditTime: 2021-08-0
9 14:12:50
* @Description: 退货发货处理抽屉
*/
import
React
from
'react'
;
...
...
@@ -13,6 +13,7 @@ import {
import
{
createAsyncFormActions
,
FormEffectHooks
,
FormPath
,
}
from
'@formily/antd'
;
import
{
ArrayTable
}
from
'@formily/antd-components'
;
import
{
PublicApi
}
from
'@/services/api'
;
...
...
@@ -182,16 +183,34 @@ const ReturnDeliverDrawer: React.FC<IProps> = (props) => {
components=
{
{
ArrayTable
,
}
}
effects=
{
(
$
,
{
setFieldValue
})
=>
{
effects=
{
(
$
,
{
setFieldValue
,
getFieldValue
,
setFieldState
})
=>
{
useAsyncSelect
(
'logisticsName'
,
fetchLogisticsCompany
,
[
'label'
,
'value'
]);
onFieldInputChange$
(
'logisticsName'
).
subscribe
(
state
=>
{
onFieldInputChange$
(
'logisticsName'
).
subscribe
(
(
state
)
=>
{
const
{
originAsyncData
,
value
}
=
state
;
const
current
=
originAsyncData
.
find
(
item
=>
item
.
value
===
value
);
const
current
=
originAsyncData
.
find
(
(
item
)
=>
item
.
value
===
value
);
if
(
current
)
{
setFieldValue
(
'logisticsNameTxt'
,
current
.
label
);
}
});
onFieldInputChange$
(
'productList.*.count'
).
subscribe
((
fieldState
)
=>
{
const
{
value
,
name
}
=
fieldState
;
const
noDeliveryCountValue
=
getFieldValue
(
'noDeliveryCount'
);
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`productList.${$1}.count`
}),
state
=>
{
if
(
+
value
>
+
noDeliveryCountValue
)
{
state
.
errors
=
[
'填写值已超过未退货发货数量,请重新填写'
];
}
else
{
state
.
errors
=
[];
}
}
);
});
}
}
actions=
{
formActions
}
schema=
{
schema
}
...
...
src/pages/afterService/returnApplication/returnPrDeliver/verify.tsx
View file @
2992a995
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-0
7 19:20:26
* @LastEditTime: 2021-08-0
9 13:43:24
* @Description: 退货发货
*/
import
React
,
{
useState
}
from
'react'
;
...
...
@@ -77,7 +77,7 @@ const ReturnPrDeliverVerify: React.FC = () => {
<
ReturnDeliverDrawer
value=
{
{
productList
:
info
?.
goodsDetailList
,
productList
:
info
?.
goodsDetailList
.
filter
((
item
)
=>
item
.
noDeliveryCount
>
0
)
,
}
}
visible=
{
visible
}
onClose=
{
()
=>
handleVisibleDrawer
(
false
)
}
...
...
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