Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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-admin
Commits
cba29509
Commit
cba29509
authored
Nov 26, 2022
by
陈智峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 合同协同
parent
3c12f58a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
276 additions
and
0 deletions
+276
-0
systemManageRoute.ts
config/routes/refactorRoutes/systemManageRoute.ts
+26
-0
add.tsx
src/pages/systemManage/contractCoordinationProcess/add.tsx
+18
-0
index.tsx
...ctCoordinationProcess/components/AddEditContent/index.tsx
+120
-0
edit.tsx
src/pages/systemManage/contractCoordinationProcess/edit.tsx
+22
-0
index.tsx
src/pages/systemManage/contractCoordinationProcess/index.tsx
+68
-0
view.tsx
src/pages/systemManage/contractCoordinationProcess/view.tsx
+22
-0
No files found.
config/routes/refactorRoutes/systemManageRoute.ts
View file @
cba29509
...
@@ -140,6 +140,32 @@ const router = {
...
@@ -140,6 +140,32 @@ const router = {
hideInMenu
:
true
,
hideInMenu
:
true
,
component
:
'@/pages/systemManage/contractManagementProcess/view'
,
component
:
'@/pages/systemManage/contractManagementProcess/view'
,
},
},
// 合同协同流程
{
path
:
'/system/ruleSettingManager/contractCoordinationProcess'
,
name
:
'合同协同流程规则配置'
,
component
:
'@/pages/systemManage/contractCoordinationProcess'
,
},
{
path
:
'/system/ruleSettingManager/contractCoordinationProcess/add'
,
name
:
'新增合同协同流程规则'
,
hideInMenu
:
true
,
component
:
'@/pages/systemManage/contractCoordinationProcess/add'
,
},
{
path
:
'/system/ruleSettingManager/contractCoordinationProcess/edit'
,
name
:
'编辑合同协同流程规则'
,
hideInMenu
:
true
,
component
:
'@/pages/systemManage/contractCoordinationProcess/edit'
,
},
{
path
:
'/system/ruleSettingManager/contractCoordinationProcess/view'
,
name
:
'合同管理协同规则详情'
,
hideInMenu
:
true
,
component
:
'@/pages/systemManage/contractCoordinationProcess/view'
,
},
{
{
path
:
'/system/ruleSettingManager/payStrategyList'
,
path
:
'/system/ruleSettingManager/payStrategyList'
,
...
...
src/pages/systemManage/contractCoordinationProcess/add.tsx
0 → 100644
View file @
cba29509
/**
* 系统管理 - 平台规则 - 新增合同管理流程规则
* @author: Crayon
*/
import
React
from
'react'
import
AddEditContent
from
'./components/AddEditContent'
const
Add
:
React
.
FC
=
()
=>
{
return
(
<
AddEditContent
type=
'add'
title=
'新增合同管理流程规则'
/>
)
}
export
default
Add
src/pages/systemManage/contractCoordinationProcess/components/AddEditContent/index.tsx
0 → 100644
View file @
cba29509
import
React
,
{
useRef
,
useEffect
,
useState
}
from
'react'
;
import
{
Form
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
ContentLayout
from
'@/components/ContentLayout'
;
import
ProcessEngLayout
from
'@/pages/systemManage/components/ProcessEng'
;
import
ProcessSelectLayout
from
'@/pages/systemManage/components/ProcessSelect'
;
import
ApplyMemberLayout
from
'@/pages/systemManage/components/ApplyMember'
;
import
{
getMemberManageAllProviderPage
}
from
'@/services/MemberV2Api'
;
import
{
}
from
'@/services/ContractV2Api'
;
import
{
VISIT_TYPE
}
from
'@/constants'
;
import
{
getContractCoordinationPlatformProcessMemberPage
,
postContractCoordinationPlatformProcessSave
,
postContractCoordinationPlatformProcessUpdate
,
getContractCoordinationPlatformProcessGet
,
getContractCoordinationPlatformProcessBaseList
,
postContractCoordinationPlatformProcessSaveDefault
}
from
'@/services/ContractV2Api'
;
type
PropsType
=
{
type
:
'add'
|
'edit'
|
'view'
id
?:
string
;
btnCode
?:
string
;
title
?:
string
|
React
.
ReactNode
}
const
AddEditContent
:
React
.
FC
<
PropsType
>
=
({
id
:
processId
,
title
,
type
})
=>
{
const
[
form
]
=
Form
.
useForm
();
// 流程规则是否为默认,以默认的情况初始化
const
[
isDefault
,
setIsDefault
]
=
useState
<
boolean
>
(
true
)
// 编辑情况下且流程规则为默认才视为修改默认
const
isEditDefault
=
!!
(
type
===
VISIT_TYPE
.
EDIT
&&
isDefault
)
const
ref
=
useRef
<
any
>
()
const
processSelectRef
=
useRef
<
any
>
()
const
handleSubmit
=
(
setLoading
:
Function
,
handleLeave
:
Function
)
=>
{
form
.
validateFields
().
then
(
values
=>
{
setLoading
?.(
true
)
if
(
isEditDefault
)
{
const
params
=
{
processId
:
values
.
baseProcessId
,
}
postContractCoordinationPlatformProcessSaveDefault
(
params
).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
setLoading
?.(
false
)
return
}
handleLeave
?.(
false
)
history
.
goBack
()
})
}
else
{
const
params
=
{
processId
,
...
values
,
allMembers
:
values
.
allMembers
===
1
?
true
:
false
,
members
:
values
.
allMembers
===
2
?
values
.
members
?.
map
(
_item
=>
{
return
{
memberId
:
_item
.
memberId
,
roleId
:
_item
.
roleId
,
}
})
:
undefined
}
const
fetchApi
=
processId
?
postContractCoordinationPlatformProcessUpdate
:
postContractCoordinationPlatformProcessSave
fetchApi
({
...
params
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
setLoading
?.(
false
)
return
}
handleLeave
?.(
false
)
history
.
goBack
()
})
}
})
}
const
getDetail
=
async
()
=>
{
if
(
processId
)
{
Promise
.
all
([
getContractCoordinationPlatformProcessMemberPage
({
processId
}
as
any
),
getContractCoordinationPlatformProcessGet
({
processId
})]).
then
(
resArr
=>
{
if
(
resArr
.
every
(
item
=>
item
&&
item
.
code
===
1000
))
{
const
members
=
resArr
[
0
]?.
data
?.
map
(
_item
=>
({
...
_item
,
mrId
:
`
${
_item
.
memberId
}
_
${
_item
.
roleId
}
`
}))
const
detail
=
resArr
[
1
]?.
data
form
.
setFieldsValue
({
name
:
detail
?.
name
,
baseProcessId
:
detail
?.
baseProcessId
,
allMembers
:
detail
?.
allMembers
?
1
:
2
,
members
,
})
console
.
log
(
'resArr[1]'
,
resArr
[
1
])
setIsDefault
(
detail
?.
isDefault
===
1
)
processSelectRef
.
current
?.
getDataSource
(
detail
?.
isDefault
===
1
?
{
processType
:
detail
?.
baseProcess
?.
processType
}
:
{})
ref
?.
current
?.
setProgress
()
}
})
}
else
{
processSelectRef
.
current
?.
getDataSource
()
}
}
useEffect
(()
=>
{
getDetail
()
},
[])
return
(
<
ContentLayout
ref=
{
ref
}
form=
{
form
}
title=
{
title
}
type=
{
type
}
onSubmit=
{
handleSubmit
}
>
<
ProcessEngLayout
disabled=
{
type
===
VISIT_TYPE
.
VIEW
||
isEditDefault
}
/>
<
ProcessSelectLayout
ref=
{
processSelectRef
}
disabled=
{
type
===
VISIT_TYPE
.
VIEW
}
fetchApi=
{
getContractCoordinationPlatformProcessBaseList
}
/>
<
ApplyMemberLayout
disabled=
{
type
===
VISIT_TYPE
.
VIEW
||
isEditDefault
}
fetchMemberApi=
{
getMemberManageAllProviderPage
}
/>
</
ContentLayout
>
)
}
export
default
AddEditContent
src/pages/systemManage/contractCoordinationProcess/edit.tsx
0 → 100644
View file @
cba29509
/**
* 系统管理 - 平台规则 - 修改合同管理流程规则
* @author: Crayon
*/
import
React
from
'react'
import
{
useLocation
}
from
'umi'
import
AddEditContent
from
'./components/AddEditContent'
const
Edit
:
React
.
FC
=
()
=>
{
const
location
:
any
=
useLocation
()
const
{
id
}
=
location
.
query
return
(
<
AddEditContent
type=
'edit'
id=
{
id
}
title=
'修改合同管理流程规则'
/>
)
}
export
default
Edit
src/pages/systemManage/contractCoordinationProcess/index.tsx
0 → 100644
View file @
cba29509
import
React
,
{
useRef
}
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
Space
}
from
'antd'
;
import
TableLayout
from
'@/components/TableLayout'
;
import
PopconfirmBtn
from
'@/components/PopconfirmBtn'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
_createTime
,
_id
,
_isDefault
,
_name
,
_operation
,
_processName
,
_status
}
from
'../constant/columns'
;
import
{
schema
}
from
'../constant/schema'
;
import
{
controllerBtns
}
from
'../constant/utils'
;
import
{
getContractCoordinationPlatformProcessDelete
,
getContractCoordinationPlatformProcessPage
,
postContractCoordinationPlatformProcessStatusUpdate
}
from
'@/services/ContractV2Api'
;
const
ProcessList
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
()
const
columns
:
ColumnType
<
any
>
[]
=
[
_id
,
_name
(
`/system/ruleSettingManager/contractCoordinationProcess/view?id=`
),
_processName
,
_createTime
(),
_isDefault
,
_status
(({
processId
},
status
:
number
)
=>
{
postContractCoordinationPlatformProcessStatusUpdate
({
processId
,
status
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
()
}
})
}),
{
...
_operation
,
render
:
(
_text
,
record
)
=>
(
<
Space
size=
{
16
}
>
<
a
onClick=
{
()
=>
{
history
.
push
(
`/system/ruleSettingManager/contractCoordinationProcess/view?id=${record.processId}`
)
}
}
>
查看
</
a
>
{
!!
(
!
record
.
status
||
record
.
isDefault
===
1
)
&&
(
<>
<
a
onClick=
{
()
=>
{
history
.
push
(
`/system/ruleSettingManager/contractCoordinationProcess/edit?id=${record.processId}`
)
}
}
>
修改
</
a
>
{
record
.
isDefault
!==
1
&&
(
<
PopconfirmBtn
onConfirm=
{
()
=>
{
getContractCoordinationPlatformProcessDelete
({
processId
:
record
.
processId
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
()
}
})
}
}
>
删除
</
PopconfirmBtn
>
)
}
</>
)
}
</
Space
>
)
}
]
return
(
<
TableLayout
reload=
{
ref
}
columns=
{
columns
}
fetch=
{
getContractCoordinationPlatformProcessPage
}
schema=
{
schema
}
controllerBtns=
{
controllerBtns
(
'/system/ruleSettingManager/contractCoordinationProcess/add'
)
}
/>
)
}
export
default
ProcessList
;
src/pages/systemManage/contractCoordinationProcess/view.tsx
0 → 100644
View file @
cba29509
/**
* 系统管理 - 平台规则 - 查看合同管理流程规则
* @author: Crayon
*/
import
React
from
'react'
import
{
useLocation
}
from
'umi'
import
AddEditContent
from
'./components/AddEditContent'
const
View
:
React
.
FC
=
()
=>
{
const
location
:
any
=
useLocation
()
const
{
id
}
=
location
.
query
return
(
<
AddEditContent
type=
'view'
id=
{
id
}
title=
'查看合同管理流程规则'
/>
)
}
export
default
View
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