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
3a94c508
Commit
3a94c508
authored
Nov 17, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善售后维修相关
parent
d66023ca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
9 deletions
+44
-9
index.tsx
...plication/repairPrSubmit/components/GoodsDrawer/index.tsx
+2
-3
useBusinessEffects.ts
...ubmit/components/RepairForm/effects/useBusinessEffects.ts
+26
-1
index.tsx
...pplication/repairPrSubmit/components/RepairForm/index.tsx
+5
-4
index.ts
...tion/repairPrSubmit/components/RepairForm/schema/index.ts
+10
-0
useBusinessEffects.ts
.../bills/components/BillsForm/effects/useBusinessEffects.ts
+1
-1
No files found.
src/pages/afterService/repairApplication/repairPrSubmit/components/GoodsDrawer/index.tsx
View file @
3a94c508
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-1
6 16:22:36
* @LastEditTime: 2020-11-1
7 10:52:12
* @Description: 维修商品抽屉组件
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
...
...
@@ -422,7 +422,6 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
};
handleAfterVisibleChange
=
visible
=>
{
console
.
log
(
'visible'
,
visible
)
if
(
!
visible
)
{
this
.
handleClose
();
}
...
...
@@ -452,7 +451,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
<
Drawer
title=
"选择维修商品"
width=
{
1200
}
//
onClose={this.handleClose}
onClose=
{
this
.
handleClose
}
afterVisibleChange=
{
this
.
handleAfterVisibleChange
}
visible=
{
visible
}
footer=
{
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/effects/useBusinessEffects.ts
View file @
3a94c508
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-
03 18:50:2
8
* @LastEditTime: 2020-11-
17 10:32:4
8
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
...
...
@@ -38,4 +38,28 @@ export const useBusinessEffects = (context, actions) => {
}
=
actions
;
const
linkage
=
useLinkageUtils
();
// 校验维修数量
onFieldInputChange$
(
'repairGoodsList.*.repairCount'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
}
=
fieldState
;
// 已维修数量
const
repairedCountValue
=
getFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`repairGoodsList.
${
$1
}
.repairedCount`
}),
state
=>
state
.
value
,
);
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`repairGoodsList.
${
$1
}
.repairCount`
}),
state
=>
{
if
(
+
value
>
repairedCountValue
)
{
state
.
errors
=
'填写值已超过最大可维修数量,请重新填写'
;
}
else
{
state
.
errors
=
''
;
}
}
);
});
}
\ No newline at end of file
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/index.tsx
View file @
3a94c508
...
...
@@ -269,7 +269,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
category
:
item
.
category
,
brand
:
item
.
unitName
,
unit
:
item
.
costPrice
,
repairCount
:
''
,
purchaseCount
:
item
.
purchaseCount
,
repairedCount
:
item
.
repairCount
||
item
.
purchaseCount
||
0
,
// 已维修数量
repairReason
:
''
,
};
value
.
push
(
atom
);
...
...
@@ -299,10 +300,10 @@ const RepairForm: React.FC<BillsFormProps> = ({
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
!
id
?
'新建
单据
'
:
'新建
维修申请单
'
:
isEdit
?
'编辑
单据
'
:
'查看
单据
'
'编辑
维修申请单
'
:
'查看
维修申请单
'
}
extra=
{
(
isEdit
||
!
id
)
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/schema/index.ts
View file @
3a94c508
...
...
@@ -308,6 +308,16 @@ export const addBillSchema: ISchema = {
type
:
'string'
,
display
:
false
,
},
// 采购数量
purchaseCount
:
{
type
:
'string'
,
visible
:
false
,
},
// 已维修数量
repairedCount
:
{
type
:
'string'
,
visible
:
false
,
},
},
}
},
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/effects/useBusinessEffects.ts
View file @
3a94c508
...
...
@@ -505,7 +505,7 @@ export const useBusinessEffects = (context, actions) => {
return
;
}
if
(
value
>
current
.
purchaseCount
)
{
if
(
+
value
>
current
.
purchaseCount
)
{
Modal
.
confirm
({
title
:
'提示'
,
content
:
'单据数量已超过商品数量'
,
...
...
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