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
5567421d
Commit
5567421d
authored
Feb 01, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
parent
0bfec93f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
30 deletions
+51
-30
index.tsx
...pages/transaction/components/orderDetailSection/index.tsx
+0
-0
index.tsx
src/pages/transaction/components/orderPayTabs/index.tsx
+1
-2
index.ts
...ages/transaction/purchaseOrder/orderCollect/apis/index.ts
+6
-0
index.tsx
...er/orderCollect/components/mergeOrderModalTable/index.tsx
+1
-1
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+32
-25
useProductTable.tsx
...tion/purchaseOrder/orderCollect/model/useProductTable.tsx
+11
-2
No files found.
src/pages/transaction/components/orderDetailSection/index.tsx
View file @
5567421d
src/pages/transaction/components/orderPayTabs/index.tsx
View file @
5567421d
...
@@ -7,7 +7,6 @@ import StatusColors from '../StatusColors'
...
@@ -7,7 +7,6 @@ import StatusColors from '../StatusColors'
import
moment
from
'moment'
import
moment
from
'moment'
import
{
PayOutWorkState
}
from
'@/constants'
import
{
PayOutWorkState
}
from
'@/constants'
import
OverflowText
from
'@/components/OverflowText'
import
OverflowText
from
'@/components/OverflowText'
import
{
isTemplateExpression
}
from
'typescript'
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
/**
/**
...
@@ -59,7 +58,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
...
@@ -59,7 +58,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
{
dataSource
.
payPrice
||
0
}
{
dataSource
.
payPrice
||
0
}
{
{
dataSource
.
refundPrice
&&
dataSource
.
refundPrice
&&
<
Tooltip
title=
{
`本次实际支付金额(¥${data.payPrice
-data.refundPrice})=本次订单待支付金额(¥${data.pay
Price})-售后待退款金额(¥${data.refundPrice})`
}
>
<
Tooltip
title=
{
`本次实际支付金额(¥${data.payPrice
})=本次订单待支付金额(¥${data.payPrice+data.refund
Price})-售后待退款金额(¥${data.refundPrice})`
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
Tooltip
>
}
}
...
...
src/pages/transaction/purchaseOrder/orderCollect/apis/index.ts
View file @
5567421d
...
@@ -71,4 +71,10 @@ export const fetchOrderApi = {
...
@@ -71,4 +71,10 @@ export const fetchOrderApi = {
return
data
return
data
},
},
// 获取合并订单列表
async
getMergeOrderList
(
params
)
{
const
{
data
}
=
await
PublicApi
.
getOrderMergeOrderList
(
params
)
return
data
},
}
}
src/pages/transaction/purchaseOrder/orderCollect/components/mergeOrderModalTable/index.tsx
View file @
5567421d
...
@@ -40,7 +40,7 @@ const MergeOrderModalTable:React.FC<MergeOrderModalTableProps> = (props) => {
...
@@ -40,7 +40,7 @@ const MergeOrderModalTable:React.FC<MergeOrderModalTableProps> = (props) => {
visible=
{
visible
}
visible=
{
visible
}
confirm=
{
handleConfirm
}
confirm=
{
handleConfirm
}
cancel=
{
()
=>
setVisible
(
false
)
}
cancel=
{
()
=>
setVisible
(
false
)
}
fetchTableData=
{
(
params
)
=>
fetchOrderApi
.
get
QuotationList
(
params
)
}
fetchTableData=
{
(
params
)
=>
fetchOrderApi
.
get
MergeOrderList
(
params
)
}
rowSelection=
{
rowSelection
}
rowSelection=
{
rowSelection
}
modalType=
'MergeOrderByDefault'
modalType=
'MergeOrderByDefault'
tableProps=
{
{
tableProps=
{
{
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
5567421d
...
@@ -33,6 +33,7 @@ import AuditProcess from '@/components/AuditProcess'
...
@@ -33,6 +33,7 @@ import AuditProcess from '@/components/AuditProcess'
import
styles
from
'./index.less'
import
styles
from
'./index.less'
import
SimpleElectronModal
from
'./components/simpleElectronModal'
import
SimpleElectronModal
from
'./components/simpleElectronModal'
import
{
fetchOrderApi
}
from
'./apis'
import
{
fetchOrderApi
}
from
'./apis'
import
MergeOrderModalTable
from
'./components/mergeOrderModalTable'
export
interface
PurchaseOrderDetailProps
{}
export
interface
PurchaseOrderDetailProps
{}
...
@@ -126,6 +127,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -126,6 +127,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const
inquiryRef
=
useRef
<
any
>
({})
const
inquiryRef
=
useRef
<
any
>
({})
const
demandRef
=
useRef
<
any
>
({})
const
demandRef
=
useRef
<
any
>
({})
const
contractRef
=
useRef
<
any
>
({})
const
contractRef
=
useRef
<
any
>
({})
const
mergeRef
=
useRef
<
any
>
({})
const
[
formLoading
,
setFormLoading
]
=
useState
(
false
)
const
[
formLoading
,
setFormLoading
]
=
useState
(
false
)
const
[
btnLoading
,
setBtnLoading
]
=
useState
(
false
)
const
[
btnLoading
,
setBtnLoading
]
=
useState
(
false
)
const
update
=
useUpdate
()
const
update
=
useUpdate
()
...
@@ -154,7 +156,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -154,7 +156,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
addSchemaAction
.
getFieldValue
(
'supplyMembersRoleId'
),
addSchemaAction
.
getFieldValue
(
'supplyMembersRoleId'
),
pageStatus
===
PageStatus
.
ADD
?
addSchemaAction
.
getFieldValue
(
'orderProductRequests'
)
:
initFormValue
.
orderProductRequests
pageStatus
===
PageStatus
.
ADD
?
addSchemaAction
.
getFieldValue
(
'orderProductRequests'
)
:
initFormValue
.
orderProductRequests
)
)
const
{
productAddButton
,
productRef
,
productColumns
,
productComponents
,
...
sectionProps
}
=
useProductTable
(
addSchemaAction
)
const
{
productAddButton
,
productRef
,
productColumns
,
productComponents
,
...
sectionProps
}
=
useProductTable
(
addSchemaAction
,
mergeRef
)
let
timerSignature
=
null
let
timerSignature
=
null
// 页面进入时, 当前所处的下单模式
// 页面进入时, 当前所处的下单模式
...
@@ -542,31 +544,33 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -542,31 +544,33 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// 商品信息的改动 驱动支付信息变化
// 商品信息的改动 驱动支付信息变化
useProductTableChangeForPay
(
ctx
,
update
)
useProductTableChangeForPay
(
ctx
,
update
)
//编辑 地址和发票信息变动 触发订单更新
//
编辑 地址和发票信息变动 触发订单更新
useOrderUpdateChangeOther
(
ctx
)
useOrderUpdateChangeOther
(
ctx
)
// address初始下只有id change后为object
// $('onFieldValueChange', 'NO_SUBMIT_TABS.*.*.*(theInvoiceId, needTheInvoice, deliveryAddresId)').subscribe(state =>
{
// 合并订单模式下 只选择供应会员 出现选择商品按钮
// const
{
value
,
path
}
=
state
$
(
'onFieldValueChange'
,
'supplyMembersName'
).
subscribe
(
state
=>
{
// if(pageStatus === PageStatus.EDIT)
{
const
quotationOrderValue
=
ctx
.
getFieldValue
(
'quotationNo'
)
// if(state?.dataSource?.length && state.loading)
{
const
modelType
=
ctx
.
getFieldValue
(
'orderModel'
)
// ctx.submit((values) =>
{
if
(
state
.
value
&&
!
quotationOrderValue
&&
modelType
===
9
)
{
// console.log(value, path)
addSchemaAction
.
setFieldState
(
'orderProductRequests'
,
productState
=>
{
// if(values)
{
productState
.
props
[
"x-component-props"
]
=
{
// PublicApi.postOrderProcurementOrderUpdate(
{
...
productState
.
props
[
"x-component-props"
],
// ...values,
prefix
:
productAddButton
,
// deliveryTime: moment(values.deliveryTime).valueOf(),
}
// theInvoiceId: value.id,
})
// needTheInvoice: Number(values.needTheInvoice),
}
// deliveryAddresId: path.indexOf("deliveryAddresId") !== -1 ? ( value?.id ? value.id : value ) : values.deliveryAddresId,
})
// id,
$
(
'onFieldValueChange'
,
'quotationNo'
).
subscribe
(
state
=>
{
//
},
{
ctlType
:
"none"
})
const
modelType
=
ctx
.
getFieldValue
(
'orderModel'
)
//
}
if
(
state
.
value
&&
modelType
===
9
)
{
//
})
addSchemaAction
.
setFieldState
(
'orderProductRequests'
,
productState
=>
{
//
}
else
{
productState
.
props
[
"x-component-props"
]
=
{
// ctx.setFieldState(path, _state => _state.loading = true)
...
productState
.
props
[
"x-component-props"
],
//
}
prefix
:
""
,
//
}
}
//
})
})
}
})
}
}
}
}
expressionScope=
{
{
expressionScope=
{
{
...
@@ -598,6 +602,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -598,6 +602,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
{
/* 简单流程签合同弹窗 */
}
{
/* 简单流程签合同弹窗 */
}
<
SimpleElectronModal
currentRef=
{
contractRef
}
schemaAction=
{
addSchemaAction
}
/>
<
SimpleElectronModal
currentRef=
{
contractRef
}
schemaAction=
{
addSchemaAction
}
/>
{
/* 选择待合并订单弹窗 */
}
<
MergeOrderModalTable
currentRef=
{
mergeRef
}
schemaAction=
{
addSchemaAction
}
/>
</
ReadyAddOrderDetailContext
.
Provider
>
</
ReadyAddOrderDetailContext
.
Provider
>
</
PageHeaderWrapper
>
</
PageHeaderWrapper
>
)
)
...
...
src/pages/transaction/purchaseOrder/orderCollect/model/useProductTable.tsx
View file @
5567421d
...
@@ -53,7 +53,12 @@ export const getUnitPriceTotal = (record) => {
...
@@ -53,7 +53,12 @@ export const getUnitPriceTotal = (record) => {
return
Number
((
unitPrice
*
purchaseCount
).
toFixed
(
2
))
return
Number
((
unitPrice
*
purchaseCount
).
toFixed
(
2
))
}
}
}
}
export
const
useProductTable
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
)
=>
{
/**
* @param ctx schemaAction
* @param mergeRef 操作合并订单的ref
*/
export
const
useProductTable
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
mergeRef
:
any
)
=>
{
const
productRef
=
useRef
<
any
>
({})
const
productRef
=
useRef
<
any
>
({})
const
{
visible
,
setVisible
,
rowSelection
,
rowSelectionCtl
}
=
useModalTable
({
type
:
'checkbox'
})
const
{
visible
,
setVisible
,
rowSelection
,
rowSelectionCtl
}
=
useModalTable
({
type
:
'checkbox'
})
const
{
pageStatus
}
=
usePageStatus
()
const
{
pageStatus
}
=
usePageStatus
()
...
@@ -84,9 +89,13 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
...
@@ -84,9 +89,13 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const
[
productColumns
,
setProductColumns
]
=
useState
(()
=>
{
const
[
productColumns
,
setProductColumns
]
=
useState
(()
=>
{
if
(
pageStatus
===
PageStatus
.
ADD
)
{
if
(
pageStatus
===
PageStatus
.
ADD
)
{
productInfoColumns
[
productInfoColumns
.
length
-
1
].
render
=
(
text
,
record
)
=>
{
productInfoColumns
[
productInfoColumns
.
length
-
1
].
render
=
(
text
,
record
)
=>
{
const
orderModel
=
ctx
.
getFieldValue
(
'orderModel'
)
return
<>
return
<>
{
// 合并下单
orderModel
===
9
&&
<
Button
type=
'link'
onClick=
{
()
=>
mergeRef
.
current
.
setVisible
(
true
)
}
>
选择合并订单
</
Button
>
}
<
Button
type=
'link'
onClick=
{
()
=>
handleDelete
(
record
)
}
>
删除
</
Button
>
<
Button
type=
'link'
onClick=
{
()
=>
handleDelete
(
record
)
}
>
删除
</
Button
>
{
/* <Button type='link'>选择合并订单</Button> */
}
</>
</>
}
}
}
else
{
}
else
{
...
...
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