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
陈智峰
jinfa-platform
Commits
a1cb76ba
Commit
a1cb76ba
authored
Jan 07, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:处理采购下单首次选择数据后多次调用获取交易规则和合同签章接口,处理首次编辑订单支付渠道显示异常
parent
e3b33a96
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
122 deletions
+136
-122
index.tsx
src/pages/transaction/components/orderProductTable/index.tsx
+1
-1
index.tsx
...eOrder/orderCollect/components/payInfoTableCell/index.tsx
+17
-2
index.ts
...s/transaction/purchaseOrder/orderCollect/effects/index.ts
+2
-2
usePaymentInfo.tsx
...ction/purchaseOrder/orderCollect/model/usePaymentInfo.tsx
+0
-1
useSelfTable.tsx
...on/purchaseOrder/readyReceiveOrder/model/useSelfTable.tsx
+116
-116
No files found.
src/pages/transaction/components/orderProductTable/index.tsx
View file @
a1cb76ba
...
...
@@ -314,7 +314,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
dataIndex
:
'memberPrice'
,
align
:
'center'
,
key
:
'memberPrice'
,
render
:
(
text
,
record
)
=>
record
.
isMemberPrice
?
(
text
*
100
+
'%'
)
:
null
render
:
(
text
,
record
)
=>
record
.
isMemberPrice
?
(
text
*
100
00
/
100
+
'%'
)
:
null
},
{
title
:
creditsCommodity
?
'兑换数量'
:
'采购数量'
,
...
...
src/pages/transaction/purchaseOrder/orderCollect/components/payInfoTableCell/index.tsx
View file @
a1cb76ba
import
React
,
{
useState
,
useRef
,
useContext
,
useEffect
}
from
'react'
import
{
Form
,
Input
,
Select
}
from
'antd'
;
import
{
history
}
from
'umi'
import
styles
from
"../../index.less"
export
interface
PayInfoCellProps
{
title
:
React
.
ReactNode
;
...
...
@@ -65,6 +67,19 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
})
=>
{
const
formItemRef
=
useRef
<
any
>
();
const
{
form
,
childOptions
,
setChildOptions
,
originOptions
}
=
useContext
(
EditableContext
);
// fix: 没有childOptions 导致第一次进入编辑页面无法显示支付渠道
let
_childOptions
=
null
;
if
(
history
.
location
.
query
?.
id
&&
title
===
"支付渠道"
)
{
let
payList
=
originOptions
.
filter
(
item
=>
item
.
payType
===
record
.
payWay
)
||
[]
if
(
payList
.
length
)
{
_childOptions
=
payList
[
0
].
payList
.
map
(
_item
=>
({
label
:
_item
.
way
,
value
:
_item
.
wayId
,
}))
}
}
const
save
=
async
e
=>
{
try
{
const
values
=
await
form
.
validateFields
();
...
...
@@ -106,7 +121,7 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
return
<
Select
ref=
{
formItemRef
}
onChange=
{
save
}
options=
{
childOptions
}
options=
{
childOptions
.
length
?
childOptions
:
_childOptions
}
{
...
rest
}
id=
{
formId
}
/>
...
...
@@ -139,7 +154,7 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
);
}
return
<
td
{
...
restProps
}
>
{
childNode
}
</
td
>;
return
<
td
{
...
restProps
}
style=
{
{
height
:
90
}
}
>
{
childNode
}
</
td
>;
}
PayInfoCell
.
defaultProps
=
{}
...
...
src/pages/transaction/purchaseOrder/orderCollect/effects/index.ts
View file @
a1cb76ba
...
...
@@ -217,7 +217,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
// 查询商品对应的工作流 获取电子合同
FormEffectHooks
.
onFieldValueChange$
(
'orderProductRequests'
).
subscribe
(
state
=>
{
if
(
state
.
value
?.
length
)
{
if
(
state
.
value
?.
length
&&
state
.
loading
)
{
useElectronicContract
(
ctx
)
}
})
...
...
@@ -278,7 +278,7 @@ export const useElectronicContract = (ctx: ISchemaFormActions | ISchemaFormAsync
ctx
.
setFieldState
(
"usingElectronicContracts"
,
state
=>
{
state
.
props
[
"x-component-props"
].
contract
=
{
contractTemplateId
:
data
[
'electronicContractId'
],
...
_data
,
}
})
ctx
.
setFieldValue
(
"electronicContractName"
,
_data
.
contractName
)
ctx
.
setFieldValue
(
"electronicContractName"
,
_data
?
.
contractName
)
})
}
})
...
...
src/pages/transaction/purchaseOrder/orderCollect/model/usePaymentInfo.tsx
View file @
a1cb76ba
...
...
@@ -3,7 +3,6 @@ import { PayInfoCell, EditableRow } from '../components/payInfoTableCell'
import
{
ISchemaFormActions
,
ISchemaFormAsyncActions
}
from
'@formily/antd'
import
{
useEffect
,
useState
,
useRef
,
useContext
}
from
'react'
import
{
PublicApi
}
from
'@/services/api'
import
{
orderCombination
}
from
'@/pages/transaction/saleOrder/readyApprovedOrder/constant'
export
const
usePaymentInfo
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
memberId
:
any
,
memberRoleId
:
any
,
orderProducts
:
any
):
any
=>
{
const
paywayData
=
useRef
<
any
>
({})
...
...
src/pages/transaction/purchaseOrder/readyReceiveOrder/model/useSelfTable.tsx
View file @
a1cb76ba
import
React
,
{
useRef
}
from
'react'
import
{
history
,
Link
}
from
'umi'
import
{
Button
,
Row
,
Col
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
import
EyePreview
from
'@/components/EyePreview'
import
{
formatTimeString
}
from
'@/utils'
import
{
ORDER_TYPE
,
PurchaseOrderInsideWorkState
,
SaleOrderInsideWorkState
}
from
'@/constants'
import
StatusColors
from
'@/pages/transaction/components/StatusColors'
import
{
FieldTimeOutlined
}
from
'@ant-design/icons'
import
{
Chart
,
Interval
,
Axis
,
Tooltip
,
Coordinate
,
Legend
,
View
,
Annotation
,
}
from
'bizcharts'
;
import
DataSet
from
"@antv/data-set"
;
// 业务hooks
export
const
useSelfTable
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
customOrderColumns
:
any
[]
=
[
{
title
:
'订单号'
,
align
:
'center'
,
dataIndex
:
'orderNo'
,
key
:
'orderNo'
,
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
(
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/purchaseOrder/readyReceiveOrder/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
)
}
},
{
title
:
'订单摘要/下单时间'
,
align
:
'center'
,
dataIndex
:
'orderThe'
,
key
:
'orderThe'
,
render
:
(
text
,
record
)
=>
<>
<
div
>
{
text
}
</
div
>
<
div
><
FieldTimeOutlined
/>
{
formatTimeString
(
record
.
createTime
)
}
</
div
>
</>,
width
:
200
},
{
title
:
'采购会员'
,
align
:
'left'
,
dataIndex
:
'supplyMembersName'
,
key
:
'supplyMembersName'
,
},
{
title
:
'总金额'
,
align
:
'center'
,
dataIndex
:
'sumPrice'
,
key
:
'sumPrice'
,
render
:
text
=>
'¥'
+
text
},
{
title
:
'收货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`第
${
text
}
次`
:
''
},
// @todo 收货单号跳转
{
title
:
'入库单号'
,
align
:
'center'
,
dataIndex
:
'invoiceNumber'
,
key
:
'invoiceNumber'
,
render
:
(
t
,
r
)
=>
r
.
orderDeliveryDetailsId
?
<
Link
to=
{
`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${r.orderDeliveryDetailsId}&preview=1`
}
>
{
t
}
</
Link
>
:
<
a
href=
{
`https://www.kuaidi100.com/chaxun?nu=${t}`
}
target=
"blank"
>
{
t
}
</
a
>
},
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'type'
,
key
:
'type'
,
render
:
(
text
)
=>
ORDER_TYPE
[
text
]
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'externalState'
,
key
:
'externalState'
,
render
:
text
=>
<
StatusColors
status=
{
text
}
type=
'out'
/>
},
{
title
:
'内部状态'
,
align
:
'center'
,
dataIndex
:
'interiorState'
,
key
:
'interiorState'
,
render
:
(
text
)
=>
<
StatusColors
status=
{
text
}
type=
'inside'
/>
},
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
/* 支付结果确认到账= 待审核状态 */
}
{
(
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
CONFIRM_RECEIPT
||
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
HAND_RECEIPT_ORDER
)
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认收货
</
Button
>
}
</>
}
]
const
handleConfirm
=
async
(
record
)
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/purchaseOrder/readyReceiveOrder/detail?id=
${
record
.
id
}
&orderDeliveryDetailsId=
${
record
.
orderDeliveryDetailsId
}
`
);
}
return
{
columns
:
customOrderColumns
}
}
import
React
,
{
useRef
}
from
'react'
import
{
history
,
Link
}
from
'umi'
import
{
Button
,
Row
,
Col
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
import
EyePreview
from
'@/components/EyePreview'
import
{
formatTimeString
}
from
'@/utils'
import
{
ORDER_TYPE
,
PurchaseOrderInsideWorkState
,
SaleOrderInsideWorkState
}
from
'@/constants'
import
StatusColors
from
'@/pages/transaction/components/StatusColors'
import
{
FieldTimeOutlined
}
from
'@ant-design/icons'
import
{
Chart
,
Interval
,
Axis
,
Tooltip
,
Coordinate
,
Legend
,
View
,
Annotation
,
}
from
'bizcharts'
;
import
DataSet
from
"@antv/data-set"
;
// 业务hooks
export
const
useSelfTable
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
customOrderColumns
:
any
[]
=
[
{
title
:
'订单号'
,
align
:
'center'
,
dataIndex
:
'orderNo'
,
key
:
'orderNo'
,
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
(
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/purchaseOrder/readyReceiveOrder/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
)
}
},
{
title
:
'订单摘要/下单时间'
,
align
:
'center'
,
dataIndex
:
'orderThe'
,
key
:
'orderThe'
,
render
:
(
text
,
record
)
=>
<>
<
div
>
{
text
}
</
div
>
<
div
><
FieldTimeOutlined
/>
{
formatTimeString
(
record
.
createTime
)
}
</
div
>
</>,
width
:
200
},
{
title
:
'采购会员'
,
align
:
'left'
,
dataIndex
:
'supplyMembersName'
,
key
:
'supplyMembersName'
,
},
{
title
:
'总金额'
,
align
:
'center'
,
dataIndex
:
'sumPrice'
,
key
:
'sumPrice'
,
render
:
(
t
,
r
)
=>
r
.
type
===
7
||
r
.
type
===
8
?
t
:
'¥'
+
t
},
{
title
:
'收货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`第
${
text
}
次`
:
''
},
// @todo 收货单号跳转
{
title
:
'入库单号'
,
align
:
'center'
,
dataIndex
:
'invoiceNumber'
,
key
:
'invoiceNumber'
,
render
:
(
t
,
r
)
=>
r
.
orderDeliveryDetailsId
?
<
Link
to=
{
`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${r.orderDeliveryDetailsId}&preview=1`
}
>
{
t
}
</
Link
>
:
<
a
href=
{
`https://www.kuaidi100.com/chaxun?nu=${t}`
}
target=
"blank"
>
{
t
}
</
a
>
},
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'type'
,
key
:
'type'
,
render
:
(
text
)
=>
ORDER_TYPE
[
text
]
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'externalState'
,
key
:
'externalState'
,
render
:
text
=>
<
StatusColors
status=
{
text
}
type=
'out'
/>
},
{
title
:
'内部状态'
,
align
:
'center'
,
dataIndex
:
'interiorState'
,
key
:
'interiorState'
,
render
:
(
text
)
=>
<
StatusColors
status=
{
text
}
type=
'inside'
/>
},
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
/* 支付结果确认到账= 待审核状态 */
}
{
(
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
CONFIRM_RECEIPT
||
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
HAND_RECEIPT_ORDER
)
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认收货
</
Button
>
}
</>
}
]
const
handleConfirm
=
async
(
record
)
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/purchaseOrder/readyReceiveOrder/detail?id=
${
record
.
id
}
&orderDeliveryDetailsId=
${
record
.
orderDeliveryDetailsId
}
`
);
}
return
{
columns
:
customOrderColumns
}
}
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