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
linweijiong
jinfa-platform
Commits
3013c3bf
Commit
3013c3bf
authored
Jan 06, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加内部单据处理逻辑
parent
72e12dba
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
6 deletions
+33
-6
useBusinessEffects.ts
.../bills/components/BillsForm/effects/useBusinessEffects.ts
+20
-3
index.tsx
...ion/stockSellStorage/bills/components/BillsForm/index.tsx
+0
-0
index.ts
...ockSellStorage/bills/components/BillsForm/schema/index.ts
+11
-2
formEffectUtils.ts
src/utils/formEffectUtils.ts
+2
-1
No files found.
src/pages/transaction/stockSellStorage/bills/components/BillsForm/effects/useBusinessEffects.ts
View file @
3013c3bf
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-0
4 11:22:36
* @LastEditTime: 2021-01-0
6 16:18:59
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
...
...
@@ -257,6 +257,7 @@ export const useBusinessEffects = (context, actions) => {
break
;
}
// 其他的走内部单据
default
:
{
freeEnumItem
(
newEnum
,
'value'
,
DEPENDENT_DOC_INTERNAL
);
break
;
...
...
@@ -285,6 +286,7 @@ export const useBusinessEffects = (context, actions) => {
if
(
current
)
{
linkage
.
value
(
'invoicesTypeCode'
,
current
.
number
);
linkage
.
value
(
'direction'
,
current
.
direction
);
}
linkage
.
componentProps
(
'orderNo'
,
params
);
});
...
...
@@ -515,7 +517,6 @@ export const useBusinessEffects = (context, actions) => {
const
{
name
,
originAsyncData
,
value
}
=
fieldState
;
const
current
=
originAsyncData
.
find
(
item
=>
item
.
productId
===
value
);
const
invoicesTypeIdVal
=
getFieldValue
(
'invoicesTypeId'
);
const
relevanceInvoicesVal
=
getFieldValue
(
'relevanceInvoices'
);
// 取消选择
if
(
!
value
)
{
...
...
@@ -760,7 +761,6 @@ export const useBusinessEffects = (context, actions) => {
onFieldInputChange$
(
'invoicesDetailsRequests.*.productCount'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
}
=
fieldState
;
const
invoicesTypeIdVal
=
getFieldValue
(
'invoicesTypeId'
);
const
relevanceInvoicesVal
=
getFieldValue
(
'relevanceInvoices'
);
const
originAsyncData
=
getFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.product`
...
...
@@ -876,4 +876,20 @@ export const useBusinessEffects = (context, actions) => {
}
);
});
// 对应单据改变
onFieldValueChange$
(
'relevanceInvoices'
).
subscribe
(
fieldState
=>
{
const
{
value
}
=
fieldState
;
// 对应单据等于内部单据
// formily 的 bug,设置了 display 为 false,该列还是会展示在页面中
// 所以把title设置
if
(
value
===
DEPENDENT_DOC_INTERNAL
)
{
linkage
.
display
(
'*(orderNo,memberName,address,transport)'
,
false
);
linkage
.
display
(
'invoicesDetailsRequests.*.*(product,productId,price,amount)'
,
false
);
}
else
{
linkage
.
display
(
'*(orderNo,memberName,address,transport)'
);
linkage
.
display
(
'invoicesDetailsRequests.*.*(product,productId,price,amount)'
);
}
});
}
\ No newline at end of file
src/pages/transaction/stockSellStorage/bills/components/BillsForm/index.tsx
View file @
3013c3bf
This diff is collapsed.
Click to expand it.
src/pages/transaction/stockSellStorage/bills/components/BillsForm/schema/index.ts
View file @
3013c3bf
...
...
@@ -379,12 +379,17 @@ export const addBillSchema: ISchema = {
},
// 会员id,可以是采购会员id、销售会员id
membersId
:
{
type
:
'
boolean
'
,
type
:
'
string
'
,
display
:
false
,
},
// 会员角色id,可以是采购会员角色id、销售会员角色id
membersRoleId
:
{
type
:
'boolean'
,
type
:
'string'
,
display
:
false
,
},
// 单据类型方向
direction
:
{
type
:
'string'
,
display
:
false
,
},
},
...
...
@@ -481,16 +486,19 @@ export const addBillSchema: ISchema = {
message
:
'请选择商品'
,
},
],
display
:
true
,
},
productId
:
{
type
:
'string'
,
title
:
'商品ID'
,
'x-component'
:
'Text'
,
display
:
true
,
},
price
:
{
type
:
'string'
,
title
:
'单价'
,
'x-component'
:
'Text'
,
display
:
true
,
},
productCount
:
{
type
:
'string'
,
...
...
@@ -513,6 +521,7 @@ export const addBillSchema: ISchema = {
type
:
'string'
,
title
:
'金额'
,
'x-component'
:
'Text'
,
display
:
true
,
},
// 额外的数据,用于收集不需要展示的数据
extraData
:
{
...
...
src/utils/formEffectUtils.ts
View file @
3013c3bf
...
...
@@ -19,6 +19,7 @@ export const useLinkageUtils = () => {
loading
:
linkage
(
'loading'
,
true
),
loaded
:
linkage
(
'loading'
,
false
),
value
:
linkage
(
'value'
),
componentProps
:
linkage
(
'props.x-component-props'
,
{})
componentProps
:
linkage
(
'props.x-component-props'
,
{}),
display
:
linkage
(
'display'
,
true
),
}
}
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