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
e3dced3e
Commit
e3dced3e
authored
Jun 22, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理订单下单价格字段传参异常
parent
5e92b7d4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
index.tsx
...er/orderCollect/components/mergeOrderModalTable/index.tsx
+3
-2
index.ts
...s/transaction/purchaseOrder/orderCollect/effects/index.ts
+2
-1
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+5
-2
useProductTable.tsx
...tion/purchaseOrder/orderCollect/model/useProductTable.tsx
+6
-1
No files found.
src/pages/transaction/purchaseOrder/orderCollect/components/mergeOrderModalTable/index.tsx
View file @
e3dced3e
...
@@ -206,8 +206,9 @@ const MergeOrderModalTable:React.FC<MergeOrderModalTableProps> = (props) => {
...
@@ -206,8 +206,9 @@ const MergeOrderModalTable:React.FC<MergeOrderModalTableProps> = (props) => {
// 开始数量合并
// 开始数量合并
let
processOrderProductRequests
=
schemaAction
.
getFieldValue
(
"orderProductRequests"
)
let
processOrderProductRequests
=
schemaAction
.
getFieldValue
(
"orderProductRequests"
)
let
__
=
processOrderProductRequests
.
map
(
item
=>
{
console
.
log
(
processOrderProductRequests
,
'合并之前'
)
item
[
"productId"
]
=
item
.
id
let
__
=
[...
processOrderProductRequests
].
map
(
item
=>
{
item
[
"productId"
]
=
item
.
productId
||
item
.
id
if
(
item
.
id
===
currentClickRow
.
id
)
{
if
(
item
.
id
===
currentClickRow
.
id
)
{
// let count = _childSelectedRows.length > 1 ? _childSelectedRows.reduce((a, b) => a.purchaseCount + b.purchaseCount) : _childSelectedRows[0].purchaseCount
// let count = _childSelectedRows.length > 1 ? _childSelectedRows.reduce((a, b) => a.purchaseCount + b.purchaseCount) : _childSelectedRows[0].purchaseCount
// @to fix 第一次合并无法填入采购数量 新增情况下:手工模式不累加,报价单模式累加;编辑模式都累加
// @to fix 第一次合并无法填入采购数量 新增情况下:手工模式不累加,报价单模式累加;编辑模式都累加
...
...
src/pages/transaction/purchaseOrder/orderCollect/effects/index.ts
View file @
e3dced3e
...
@@ -102,11 +102,12 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
...
@@ -102,11 +102,12 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
if
(
value
&&
value
.
length
>
0
&&
!
state
.
loading
){
// 添加loading判断避免二次调用
if
(
value
&&
value
.
length
>
0
&&
!
state
.
loading
){
// 添加loading判断避免二次调用
// 请求一次并复制给支付信息
// 请求一次并复制给支付信息
const
productItem
=
value
[
0
]
const
productItem
=
value
[
0
]
console
.
log
(
productItem
,
'pitem'
)
if
(
pageStatus
===
PageStatus
.
EDIT
)
{
// 编辑下 支付信息联动实现
if
(
pageStatus
===
PageStatus
.
EDIT
)
{
// 编辑下 支付信息联动实现
}
else
if
(
pageStatus
===
PageStatus
.
ADD
&&
ctx
.
getFieldValue
(
'orderModel'
)
<
OrderModalType
.
PURCHASE_ENQUIRY_CONTRACT_ORDER
)
{
// 新增下 需要支付信息生成支付次数 // @采购合同下单无需支付信息
}
else
if
(
pageStatus
===
PageStatus
.
ADD
&&
ctx
.
getFieldValue
(
'orderModel'
)
<
OrderModalType
.
PURCHASE_ENQUIRY_CONTRACT_ORDER
)
{
// 新增下 需要支付信息生成支付次数 // @采购合同下单无需支付信息
fetchOrderApi
.
getPayInfoList
({
fetchOrderApi
.
getPayInfoList
({
productId
:
(
orderModel
===
OrderModalType
[
"HAND_ORDER"
]
||
orderModel
===
OrderModalType
[
"CHANNEL_DIRECT_MINING_ORDER"
]
||
orderModel
===
OrderModalType
[
"CHANNEL_SPOT_MANUAL_ORDER"
])
?
productItem
.
id
:
productItem
.
productId
,
productId
:
(
orderModel
===
OrderModalType
[
"HAND_ORDER"
]
||
orderModel
===
OrderModalType
[
"CHANNEL_DIRECT_MINING_ORDER"
]
||
orderModel
===
OrderModalType
[
"CHANNEL_SPOT_MANUAL_ORDER"
])
?
productItem
.
id
:
(
productItem
.
productId
||
productItem
.
id
)
,
memberId
:
productItem
?.
memberId
||
ctx
.
getFieldValue
(
'supplyMembersId'
),
memberId
:
productItem
?.
memberId
||
ctx
.
getFieldValue
(
'supplyMembersId'
),
memberRoleId
:
productItem
?.
memberRoleId
||
ctx
.
getFieldValue
(
'supplyMembersRoleId'
),
memberRoleId
:
productItem
?.
memberRoleId
||
ctx
.
getFieldValue
(
'supplyMembersRoleId'
),
orderModel
:
orderModel
,
orderModel
:
orderModel
,
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
e3dced3e
...
@@ -207,6 +207,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -207,6 +207,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
},
[])
},
[])
const
handleSubmit
=
async
(
value
)
=>
{
const
handleSubmit
=
async
(
value
)
=>
{
console
.
log
(
value
,
'value'
)
let
_orderProductRequests
=
JSON
.
parse
(
JSON
.
stringify
(
value
.
orderProductRequests
))
let
_orderProductRequests
=
JSON
.
parse
(
JSON
.
stringify
(
value
.
orderProductRequests
))
let
processEnum
=
value
[
'processEnum'
]
let
processEnum
=
value
[
'processEnum'
]
let
usingElectronicContracts
=
value
[
'usingElectronicContracts'
]
let
usingElectronicContracts
=
value
[
'usingElectronicContracts'
]
...
@@ -231,7 +232,8 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -231,7 +232,8 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
roleId
:
value
[
'supplyMembersRoleId'
],
roleId
:
value
[
'supplyMembersRoleId'
],
quotationNo
:
value
[
"quotationNo"
],
quotationNo
:
value
[
"quotationNo"
],
orderProductRequests
:
_orderProductRequests
.
map
(
v
=>
{
orderProductRequests
:
_orderProductRequests
.
map
(
v
=>
{
v
.
price
=
1
// v.price = 1
v
.
price
=
v
.
price
v
.
isMemberPrice
=
Number
(
v
.
isMemberPrice
)
v
.
isMemberPrice
=
Number
(
v
.
isMemberPrice
)
v
.
memberPrice
=
v
.
memberPrice
v
.
memberPrice
=
v
.
memberPrice
v
.
imgUrl
=
v
.
mainPic
?
v
.
mainPic
:
v
.
imgUrl
v
.
imgUrl
=
v
.
mainPic
?
v
.
mainPic
:
v
.
imgUrl
...
@@ -269,7 +271,8 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -269,7 +271,8 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
deliveryTime
:
moment
(
value
.
deliveryTime
).
valueOf
(),
deliveryTime
:
moment
(
value
.
deliveryTime
).
valueOf
(),
// 没用的字段
// 没用的字段
orderProductRequests
:
_orderProductRequests
.
map
(
v
=>
{
orderProductRequests
:
_orderProductRequests
.
map
(
v
=>
{
v
.
price
=
1
// v.price = 1
v
.
price
=
v
.
price
v
.
isMemberPrice
=
Number
(
v
.
isMemberPrice
)
||
0
v
.
isMemberPrice
=
Number
(
v
.
isMemberPrice
)
||
0
v
.
memberPrice
=
v
.
memberPrice
v
.
memberPrice
=
v
.
memberPrice
v
.
imgUrl
=
v
.
mainPic
?
v
.
mainPic
:
v
.
imgUrl
v
.
imgUrl
=
v
.
mainPic
?
v
.
mainPic
:
v
.
imgUrl
...
...
src/pages/transaction/purchaseOrder/orderCollect/model/useProductTable.tsx
View file @
e3dced3e
...
@@ -40,6 +40,10 @@ export const getUnitPriceTotal = (record) => {
...
@@ -40,6 +40,10 @@ export const getUnitPriceTotal = (record) => {
if
(
record
.
price
&&
JSON
.
stringify
(
record
.
unitPrice
)
===
"{}"
)
{
if
(
record
.
price
&&
JSON
.
stringify
(
record
.
unitPrice
)
===
"{}"
)
{
record
.
unitPrice
=
{
'0-0'
:
record
.
price
}
record
.
unitPrice
=
{
'0-0'
:
record
.
price
}
}
}
// fix 当有unitPrice字段时 没有price字段时 补全price字段
if
(
!
record
?.
price
&&
JSON
.
stringify
(
record
.
unitPrice
)
!==
"{}"
)
{
if
(
Object
.
keys
(
record
.
unitPrice
)[
0
]
===
'0-0'
)
record
.
price
=
record
.
unitPrice
[
'0-0'
]
}
let
unitPrice
=
0
let
unitPrice
=
0
Object
.
entries
(
record
.
unitPrice
).
forEach
(([
key
,
value
])
=>
{
Object
.
entries
(
record
.
unitPrice
).
forEach
(([
key
,
value
])
=>
{
const
[
min
,
max
]
=
key
.
split
(
'-'
).
map
(
v
=>
Number
(
v
))
const
[
min
,
max
]
=
key
.
split
(
'-'
).
map
(
v
=>
Number
(
v
))
...
@@ -129,7 +133,8 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
...
@@ -129,7 +133,8 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
if
(
orderModel
===
OrderModalType
[
"HAND_ORDER"
])
{
if
(
orderModel
===
OrderModalType
[
"HAND_ORDER"
])
{
return
r
.
id
return
r
.
id
}
else
{
}
else
{
return
r
.
id
?
r
.
id
:
r
.
productId
// return r.id ? r.id : r.productId
return
r
.
productId
||
r
.
id
}
}
}
}
...
...
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