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
003fdf2a
Commit
003fdf2a
authored
Nov 09, 2020
by
Bill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of 10.0.0.22:lingxi/lingxi-business-paltform into dev
parents
fa7887ca
d6cf1e3d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
13 deletions
+78
-13
index.tsx
src/components/AuditProcess/index.tsx
+15
-3
index.tsx
...payandSettle/creditManage/components/DetailInfo/index.tsx
+5
-3
index.tsx
...pages/transaction/components/orderDetailSection/index.tsx
+17
-3
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+18
-4
index.tsx
src/utils/index.tsx
+23
-0
No files found.
src/components/AuditProcess/index.tsx
View file @
003fdf2a
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-15 17:48:36
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-
09-15 17:49:54
* @LastEditTime: 2020-
11-06 18:47:46
* @Description: 内外部流转记录组件
*/
import
React
from
'react'
;
...
...
@@ -16,8 +16,18 @@ import styles from './index.less';
interface
AuditProcessProp
{
outerVerifyCurrent
?:
number
;
innerVerifyCurrent
?:
number
;
outerVerifySteps
?:
{
step
:
number
,
stepName
:
string
,
roleName
:
string
}[];
innerVerifySteps
?:
{
step
:
number
,
stepName
:
string
,
roleName
:
string
}[];
outerVerifySteps
?:
{
step
:
number
,
stepName
:
string
,
roleName
:
string
,
status
:
'wait'
|
'process'
|
'finish'
|
'error'
,
}[];
innerVerifySteps
?:
{
step
:
number
,
stepName
:
string
,
roleName
:
string
,
status
:
'wait'
|
'process'
|
'finish'
|
'error'
,
}[];
customTitleKey
?:
string
customKey
?:
string
};
...
...
@@ -39,6 +49,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
key=
{
customKey
?
item
[
customKey
]
:
item
.
step
}
title=
{
customTitleKey
?
item
[
customTitleKey
]
:
item
.
stepName
}
description=
{
item
.
roleName
}
status=
{
item
.
status
}
/>
))
}
</
Steps
>
...
...
@@ -50,6 +61,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
key=
{
customKey
?
item
[
customKey
]
:
item
.
step
}
title=
{
customTitleKey
?
item
[
customTitleKey
]
:
item
.
stepName
}
description=
{
item
.
roleName
}
status=
{
item
.
status
}
/>
))
}
</
Steps
>
...
...
src/pages/payandSettle/creditManage/components/DetailInfo/index.tsx
View file @
003fdf2a
...
...
@@ -14,7 +14,7 @@ import {
CREDIT_OUTER_STATUS
,
CREDIT_STATUS
,
CREDIT_INNER_STATUS_UNCOMMITTED
,
}
from
'@/constants'
;
import
{
normalizeFiledata
,
FileData
}
from
'@/utils'
;
import
{
normalizeFiledata
,
FileData
,
findLastIndexFlowState
,
normalizeFlowData
}
from
'@/utils'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
StatusTag
from
'@/components/StatusTag'
;
...
...
@@ -192,20 +192,22 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
step
:
item
.
step
,
stepName
:
item
.
taskName
,
roleName
:
item
.
roleName
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
outerVerifyCurrent=
{
quotaInfo
&&
quotaInfo
.
outerTaskList
?
quotaInfo
.
outerTaskList
.
findIndex
(
item
=>
item
.
isExecute
===
0
)
:
0
}
outerVerifyCurrent=
{
findLastIndexFlowState
(
quotaInfo
?.
outerTaskList
)
}
innerVerifySteps=
{
quotaInfo
&&
quotaInfo
.
innerTaskList
?
quotaInfo
.
innerTaskList
.
map
(
item
=>
({
step
:
item
.
step
,
stepName
:
item
.
taskName
,
roleName
:
item
.
roleName
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
innerVerifyCurrent=
{
quotaInfo
&&
quotaInfo
.
innerTaskList
?
quotaInfo
.
innerTaskList
.
findIndex
(
item
=>
item
.
isExecute
===
0
)
:
0
}
innerVerifyCurrent=
{
findLastIndexFlowState
(
quotaInfo
?.
innerTaskList
)
}
/>
</
div
>
...
...
src/pages/transaction/components/orderDetailSection/index.tsx
View file @
003fdf2a
import
React
from
'react'
import
AuditProcess
from
'@/components/AuditProcess'
import
{
findLastIndexFlowState
}
from
'
../../_public/order
/utils'
import
{
findLastIndexFlowState
}
from
'
@
/utils'
import
OrderProductTable
from
'../../components/orderProductTable'
import
SaleOrderProductTable
from
'../../components/saleOrderProductTable'
import
OrderPayTabs
from
'../../components/orderPayTabs'
...
...
@@ -22,8 +22,22 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext, type
customKey=
'state'
outerVerifyCurrent=
{
findLastIndexFlowState
(
formContext
.
data
.
externalWorkflowFlowRecordLogResponses
)
}
innerVerifyCurrent=
{
findLastIndexFlowState
(
formContext
.
data
.
interiorWorkflowFlowRecordLogResponses
)
}
outerVerifySteps=
{
formContext
.
data
.
externalWorkflowFlowRecordLogResponses
||
[]
}
innerVerifySteps=
{
formContext
.
data
.
interiorWorkflowFlowRecordLogResponses
||
[]
}
outerVerifySteps=
{
formContext
.
data
.
externalWorkflowFlowRecordLogResponses
?
formContext
.
data
.
externalWorkflowFlowRecordLogResponses
.
map
(
item
=>
({
...
item
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
innerVerifySteps=
{
formContext
.
data
.
interiorWorkflowFlowRecordLogResponses
?
formContext
.
data
.
interiorWorkflowFlowRecordLogResponses
.
map
(
item
=>
({
...
item
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
></
AuditProcess
>
{
type
===
'saleOrder'
?
<
SaleOrderProductTable
/>
:
<
OrderProductTable
editable
/>
}
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
003fdf2a
...
...
@@ -24,8 +24,8 @@ import { useProductTable } from './model/useProductTable'
import
styled
from
'styled-components'
import
{
useUpdate
}
from
'@umijs/hooks'
import
{
PublicApi
}
from
'@/services/api'
import
{
formatTimeString
,
omit
}
from
'@/utils'
import
{
changeRouterTitleByStatus
,
findLastIndexFlowState
}
from
'../../_public/order/utils'
import
{
formatTimeString
,
omit
,
findLastIndexFlowState
}
from
'@/utils'
import
{
changeRouterTitleByStatus
}
from
'../../_public/order/utils'
import
{
ReadyAddOrderDetailContext
}
from
'../context'
import
AuditProcess
from
'@/components/AuditProcess'
...
...
@@ -293,8 +293,22 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
customKey=
'state'
outerVerifyCurrent=
{
findLastIndexFlowState
(
initFormValue
.
externalWorkflowFlowRecordLogResponses
)
}
innerVerifyCurrent=
{
findLastIndexFlowState
(
initFormValue
.
interiorWorkflowFlowRecordLogResponses
)
}
outerVerifySteps=
{
initFormValue
.
externalWorkflowFlowRecordLogResponses
}
innerVerifySteps=
{
initFormValue
.
interiorWorkflowFlowRecordLogResponses
}
outerVerifySteps=
{
initFormValue
.
externalWorkflowFlowRecordLogResponses
?
initFormValue
.
externalWorkflowFlowRecordLogResponses
.
map
(
item
=>
({
...
item
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
innerVerifySteps=
{
initFormValue
.
interiorWorkflowFlowRecordLogResponses
?
initFormValue
.
interiorWorkflowFlowRecordLogResponses
.
map
(
item
=>
({
...
item
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
></
AuditProcess
>
}
<
Card
className=
''
style=
{
{
marginTop
:
24
}
}
>
<
NiceForm
...
...
src/utils/index.tsx
View file @
003fdf2a
...
...
@@ -513,6 +513,29 @@ export const coverColFiltersItem = (
}
};
/**
* 找到最后一个可用的工作流状态的索引
* @param {array} data 数据
* @param {string} customKey 自定义 key
*/
export
const
findLastIndexFlowState
=
(
data
:
any
[],
customKey
=
'isExecute'
):
number
=>
{
let
index
=
0
;
if
(
!
Array
.
isArray
(
data
))
{
return
index
;
}
// 循环数据,找到状态值,一直覆盖
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
!
Boolean
(
data
[
i
][
customKey
]))
{
index
=
i
-
1
;
}
// 循环到最后如果 index 还是为 0 的话,说明工作流全部跑完了,此时 index 为 data.length - 1
if
(
i
===
data
.
length
-
1
&&
index
===
0
)
{
index
=
data
.
length
-
1
;
}
}
return
index
;
};
export
default
{
isArray
,
isObject
,
...
...
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