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
916310ce
Commit
916310ce
authored
Jan 07, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复对应单据出现同一种商品下拉框id类同的问题
parent
cf92bf95
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
9 deletions
+22
-9
useBusinessEffects.ts
.../bills/components/BillsForm/effects/useBusinessEffects.ts
+19
-8
fetchBillList.ts
...ckSellStorage/bills/components/BillsForm/fetchBillList.ts
+3
-1
No files found.
src/pages/transaction/stockSellStorage/bills/components/BillsForm/effects/useBusinessEffects.ts
View file @
916310ce
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-0
6 16:18:59
* @LastEditTime: 2021-01-0
7 10:21:44
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
...
...
@@ -346,7 +346,7 @@ export const useBusinessEffects = (context, actions) => {
if
(
res
.
code
===
1000
)
{
const
goodOptions
=
res
.
data
.
map
(
item
=>
({
label
:
item
.
productName
,
value
:
item
.
productI
d
,
value
:
item
.
i
d
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
res
.
data
);
...
...
@@ -359,6 +359,9 @@ export const useBusinessEffects = (context, actions) => {
// 加工入库单
case
DOC_TYPE_PROCESS_RECEIPT
:
{
// 设置配送方式相关字段数据
setFieldValue
(
'transport'
,
DELIVERY_TYPE
[
first
.
deliveryType
]);
setFieldValue
(
'deliveryType'
,
first
.
deliveryType
);
// 从加工单详情获取 商品 数据
PublicApi
.
getEnhanceSupplierToBeAddStorageDetails
({
id
:
first
.
id
,
...
...
@@ -372,7 +375,7 @@ export const useBusinessEffects = (context, actions) => {
}
=
res
.
data
;
const
goodOptions
=
details
.
map
(
item
=>
({
label
:
`
${
item
.
productName
}${
item
.
orderNo
?
'---'
+
item
.
orderNo
:
''
}
`
,
value
:
item
.
productI
d
,
value
:
item
.
i
d
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
details
.
map
(
item
=>
({
...
...
@@ -390,6 +393,9 @@ export const useBusinessEffects = (context, actions) => {
// 加工发货单
case
DOC_TYPE_PROCESS_INVOICE
:
{
// 设置配送方式相关字段数据
setFieldValue
(
'transport'
,
DELIVERY_TYPE
[
first
.
deliveryType
]);
setFieldValue
(
'deliveryType'
,
first
.
deliveryType
);
// 从加工单详情获取 商品 数据
PublicApi
.
getEnhanceProcessToBeAddDeliveryDetails
({
id
:
first
.
id
,
...
...
@@ -402,7 +408,7 @@ export const useBusinessEffects = (context, actions) => {
}
=
res
.
data
;
const
goodOptions
=
details
.
map
(
item
=>
({
label
:
`
${
item
.
productName
}${
item
.
orderNo
?
'---订单号:'
+
item
.
orderNo
:
''
}
`
,
value
:
item
.
productI
d
,
value
:
item
.
i
d
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
details
);
...
...
@@ -438,12 +444,13 @@ export const useBusinessEffects = (context, actions) => {
}
=
res
.
data
;
const
goodOptions
=
data
.
map
(
item
=>
({
label
:
`
${
item
.
productName
}
---订单号:
${
item
.
orderNo
}
`
,
value
:
item
.
product
Id
,
value
:
item
.
orderRecord
Id
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
data
.
map
(
item
=>
({
...
item
,
price
:
item
.
purchasePrice
,
// 与采购入库单、销售发货单统一
id
:
item
.
orderRecordId
,
})));
FormPath
.
setIn
(
state
,
'props.enum'
,
goodOptions
);
});
...
...
@@ -473,12 +480,13 @@ export const useBusinessEffects = (context, actions) => {
}
=
res
.
data
;
const
goodOptions
=
data
.
map
(
item
=>
({
label
:
`
${
item
.
productName
}
---订单号:
${
item
.
orderNo
}
`
,
value
:
item
.
product
Id
,
value
:
item
.
orderRecord
Id
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
data
.
map
(
item
=>
({
...
item
,
price
:
item
.
purchasePrice
,
// 与采购入库单、销售发货单统一
id
:
item
.
orderRecordId
,
})));
FormPath
.
setIn
(
state
,
'props.enum'
,
goodOptions
);
});
...
...
@@ -515,9 +523,12 @@ export const useBusinessEffects = (context, actions) => {
// 关联明细 商品下拉框 联动商品ID、单价
onFieldInputChange$
(
'invoicesDetailsRequests.*.product'
).
subscribe
(
fieldState
=>
{
const
{
name
,
originAsyncData
,
value
}
=
fieldState
;
const
current
=
originAsyncData
.
find
(
item
=>
item
.
productI
d
===
value
);
const
current
=
originAsyncData
.
find
(
item
=>
item
.
i
d
===
value
);
const
invoicesTypeIdVal
=
getFieldValue
(
'invoicesTypeId'
);
console
.
log
(
'value'
,
value
)
console
.
log
(
'current'
,
current
)
// 取消选择
if
(
!
value
)
{
setFieldState
(
...
...
@@ -773,7 +784,7 @@ export const useBusinessEffects = (context, actions) => {
}),
state
=>
state
.
value
,
);
const
current
=
originAsyncData
?
originAsyncData
.
find
(
item
=>
item
.
productI
d
===
goodId
)
:
null
;
const
current
=
originAsyncData
?
originAsyncData
.
find
(
item
=>
item
.
i
d
===
goodId
)
:
null
;
if
(
!
current
)
{
return
;
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/fetchBillList.ts
View file @
916310ce
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-12-22 17:57:26
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-12-23 11:24:44
* @LastEditTime: 202
1-01-07 10:15:47
* @Description: 获取 单据列表 弹窗数据接口相关
*/
import
{
PublicApi
}
from
'@/services/api'
;
...
...
@@ -62,6 +62,7 @@ export const getMachiningWarehousingList = async (params: any) => {
fullAddress
:
item
.
receiveAddress
||
''
,
receiverName
:
item
.
receiveUserName
||
''
,
phone
:
item
.
receiveUserTel
||
''
,
orderNo
:
item
.
noticeNo
,
})),
total
:
res
.
data
.
totalCount
,
};
...
...
@@ -85,6 +86,7 @@ export const getMachiningDeliveryList = async (params: any) => {
fullAddress
:
item
.
receiveAddress
||
''
,
receiverName
:
item
.
receiveUserName
||
''
,
phone
:
item
.
receiveUserTel
||
''
,
orderNo
:
item
.
noticeNo
,
})),
total
:
res
.
data
.
totalCount
,
};
...
...
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