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
63c41d6f
Commit
63c41d6f
authored
Aug 11, 2021
by
alwayOnlie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
a35473d9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
210 additions
and
54 deletions
+210
-54
index.tsx
src/pages/contract/components/examine/index.tsx
+55
-2
FormList.tsx
src/pages/contract/manage/add/components/FormList.tsx
+1
-1
TableList.tsx
src/pages/contract/manage/details/components/TableList.tsx
+147
-0
index.tsx
src/pages/contract/manage/details/index.tsx
+7
-51
No files found.
src/pages/contract/components/examine/index.tsx
View file @
63c41d6f
import
React
,
{
useState
}
from
'react'
;
import
{
Button
,
Input
,
Form
,
Radio
,
message
,
Modal
}
from
'antd'
import
React
,
{
ReactNode
,
useState
}
from
'react'
;
import
{
Button
,
Input
,
Form
,
Radio
,
message
,
Modal
,
Upload
,
Row
,
Col
,
}
from
'antd'
const
{
TextArea
}
=
Input
import
{
PublicApi
}
from
'@/services/api'
;
import
{
IAntdSchemaFormProps
}
from
'@formily/antd'
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
export
interface
Iprops
extends
IAntdSchemaFormProps
{
/* 显示隐藏 */
...
...
@@ -17,6 +18,7 @@ export interface Iprops extends IAntdSchemaFormProps {
agreeText
?:
string
,
/* 不同意 */
disagree
?:
string
,
}
/* 合同审核组建 */
const
Examine
:
React
.
FC
<
Iprops
>
=
({
...
...
@@ -26,8 +28,10 @@ const Examine: React.FC<Iprops> = ({
type
,
agreeText
,
disagree
,
})
=>
{
const
[
isPass
,
setIsAllMember
]
=
useState
(
1
)
const
[
state
,
setstate
]
=
useState
<
any
>
(
false
);
/* 设置选中值 */
const
handleIsAllMemberChange
=
(
v
:
any
)
=>
{
setIsAllMember
(
v
.
target
.
value
)
...
...
@@ -121,6 +125,53 @@ const Examine: React.FC<Iprops> = ({
console
.
log
(
'确认'
)
}
}
const
uploadProps
=
{
name
:
'file'
,
action
:
'/api/file/file/upload/prefix'
,
data
:
{
fileType
:
1
,
prefix
:
''
,
},
onChange
(
info
)
{
if
(
info
.
file
.
response
)
{
const
{
code
}
=
info
.
file
.
response
;
console
.
log
(
code
);
message
.
info
(
'上传成功'
);
console
.
log
(
info
.
file
)
setstate
(
true
);
}
;
if
(
info
.
file
.
status
!==
'uploading'
)
{
}
if
(
info
.
file
.
status
===
'done'
)
{
}
else
if
(
info
.
file
.
status
===
'error'
)
{
message
.
error
(
`
${
info
.
file
.
name
}
上传失败`
);
}
},
beforeUpload
(
file
)
{
if
(
file
.
size
/
1024
/
1024
>
20
)
{
message
.
warning
(
'附件大小超过20M'
);
return
Promise
.
reject
();
}
},
}
const
uploadNode
=
()
=>
{
return
(
<
div
>
<
p
style=
{
{
paddingTop
:
10
,
paddingBottom
:
10
,
}
}
>
纸质合同(乙方已盖章签字)
</
p
>
<
Row
style=
{
{
marginBottom
:
30
,
}
}
>
<
Col
>
<
Upload
{
...
uploadProps
}
>
<
Button
icon=
{
<
UploadOutlined
/>
}
>
上传附件
</
Button
>
</
Upload
>
</
Col
>
</
Row
>
</
div
>
)
}
return
(
<
div
>
<
Modal
footer=
{
null
}
title=
"提交审核"
visible=
{
ExamineFlag
}
onCancel=
{
()
=>
fetchData
(
'onCancel'
)
}
>
...
...
@@ -131,6 +182,7 @@ const Examine: React.FC<Iprops> = ({
onFinish=
{
onFinish
}
onFinishFailed=
{
onFinishFailed
}
>
{
type
===
'Signacontract'
?
uploadNode
()
:
null
}
<
Form
.
Item
name=
"isPass"
label=
""
rules=
{
[{
required
:
true
,
message
:
'请选择通过方式'
}]
}
initialValue=
{
isPass
}
>
<
Radio
.
Group
onChange=
{
handleIsAllMemberChange
}
>
<
Radio
value=
{
1
}
>
{
agreeText
}
</
Radio
>
...
...
@@ -154,5 +206,6 @@ const Examine: React.FC<Iprops> = ({
Examine
.
defaultProps
=
{
agreeText
:
"通过"
,
disagree
:
"不通过"
,
uploadNode
:
null
}
export
default
Examine
;
src/pages/contract/manage/add/components/FormList.tsx
View file @
63c41d6f
...
...
@@ -126,7 +126,7 @@ const FormList = (props: any) => {
id
:
_filterArr
(
sourceType
,
item
,
[
''
,
'goodsId'
,
'categoryId'
,
'ids'
]),
},
brand
:
{
name
:
_filter
(
sourceType
,
item
,
[
''
,
'brand'
,
'
category
Name'
,
'brand'
])
name
:
_filter
(
sourceType
,
item
,
[
''
,
'brand'
,
'
brand
Name'
,
'brand'
])
},
// 品牌
unitName
:
_filter
(
sourceType
,
item
,
[
''
,
'unit'
,
'unitName'
,
'unitPrice'
]),
//单位
purchaseCount
:
_filter
(
sourceType
,
item
,
[
''
,
'purchaseCount'
,
'count'
,
'purchaseCount'
]),
// 数量
...
...
src/pages/contract/manage/details/components/TableList.tsx
0 → 100644
View file @
63c41d6f
import
{
Table
,
}
from
'antd'
;
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
PublicApi
}
from
'@/services/api'
;
export
interface
Iprops
extends
IAntdSchemaFormProps
{
contractId
:
any
,
listIndex
:
any
}
const
TableList
:
React
.
FC
<
Iprops
>
=
({
contractId
,
listIndex
})
=>
{
const
[
index
,
setIndex
]
=
useState
(
1
)
/* 外部 */
const
[
ListData
,
setListData
]
=
useState
<
any
>
([])
// 外部数据
const
[
page
,
setPage
]
=
useState
(
1
);
// 当前页
const
[
size
,
setSize
]
=
useState
(
10
);
// 页大小
const
[
total
,
setTotal
]
=
useState
(
0
);
// 外部总条数
/* 内部 */
const
[
List
,
setList
]
=
useState
<
any
>
([]);
// 内部数据
const
[
innerpage
,
setinnerPage
]
=
useState
(
1
);
// 当前页
const
[
innersize
,
setinnerSize
]
=
useState
(
10
);
// 页大小
const
[
innertotal
,
setinnerTotal
]
=
useState
(
0
);
// 内部总条数
const
[
listLoading
,
setListLoading
]
=
useState
(
false
);
/* 流转列表 */
const
CirculationList
:
any
=
[
{
title
:
'序号'
,
dataIndex
:
'name'
,
align
:
'center'
,
render
:
(
_
,
record
,
index
)
=>
index
+
1
,
},
{
title
:
'操作角色'
,
dataIndex
:
'roleName'
,
align
:
'center'
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'operate'
,
align
:
'center'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
align
:
'center'
,
},
{
title
:
'审核意见'
,
dataIndex
:
'opinion'
,
align
:
'center'
,
},
]
/* 内部 */
const
fetchDataListcolumns
:
any
=
[
{
title
:
'操作人'
,
dataIndex
:
'name'
,
align
:
'center'
,
render
:
(
_
,
record
,
index
)
=>
index
+
1
,
},
{
title
:
'部门'
,
dataIndex
:
'department'
,
align
:
'center'
,
},
{
title
:
'职位'
,
dataIndex
:
'jobTitle'
,
align
:
'center'
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'operate'
,
align
:
'center'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
align
:
'center'
,
},
{
title
:
'审核意见'
,
dataIndex
:
'opinion'
,
align
:
'center'
,
},
]
/*分页 */
const
handlePaginationChange
=
(
current
:
number
,
pageSize
:
number
)
=>
{
let
data
=
{
current
,
pageSize
}
if
(
index
===
1
)
{
PageOuterRecordList
(
data
)
}
else
{
InnerRecordList
(
data
);
}
};
/* 外部 */
const
PageOuterRecordList
=
(
data
)
=>
{
PublicApi
.
getContractManagePageOuterRecordList
({
contractId
,
...
data
}).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
code
===
1000
)
{
setListData
(
res
.
data
.
data
)
setTotal
(
res
.
data
.
totalCount
)
}
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
/* 内部 */
const
InnerRecordList
=
(
innerData
)
=>
{
PublicApi
.
getContractManagePageInnerRecordList
({
contractId
,
...
innerData
}).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
code
===
1000
)
{
setList
(
res
.
data
.
data
)
setTotal
(
res
.
data
.
totalCount
)
}
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
useEffect
(()
=>
{
setIndex
(
listIndex
)
},
[
listIndex
])
useEffect
(()
=>
{
if
(
contractId
)
{
const
data
=
{
pageSize
:
size
,
current
:
page
,
}
PageOuterRecordList
(
data
)
const
innerData
=
{
pageSize
:
innersize
,
current
:
innerpage
,
}
InnerRecordList
(
innerData
);
}
},
[
contractId
])
return
(
<>
{
index
==
1
?
<
Table
columns=
{
CirculationList
}
rowKey=
'id'
loading=
{
listLoading
}
dataSource=
{
ListData
}
pagination=
{
{
pageSize
:
size
,
total
,
onChange
:
handlePaginationChange
}
}
style=
{
{
width
:
"100%"
}
}
/>
:
<
Table
columns=
{
fetchDataListcolumns
}
rowKey=
'id'
loading=
{
listLoading
}
dataSource=
{
List
}
pagination=
{
{
pageSize
:
size
,
total
:
innertotal
,
onChange
:
handlePaginationChange
}
}
style=
{
{
width
:
"100%"
}
}
/>
}
</>
)
}
export
default
TableList
src/pages/contract/manage/details/index.tsx
View file @
63c41d6f
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
StandardTable
}
from
'god'
;
import
{
Anchor
,
Radio
,
Steps
,
Table
,
Space
,
Typography
,
Button
}
from
'antd'
;
import
{
Anchor
,
Radio
,
Steps
,
Table
,
Space
,
Typography
,
Button
,
message
}
from
'antd'
;
import
style
from
'./index.less'
;
import
{
ArrowLeftOutlined
}
from
'@ant-design/icons'
;
import
{
history
}
from
'umi'
;
...
...
@@ -8,6 +8,7 @@ import { PublicApi } from '@/services/api';
import
ExamineFrom
from
'../../components/examine'
import
Basic
from
'../../components/detailCard/basic'
import
PaymentCard
from
'../../components/detailCard/PaymentCard'
import
TableList
from
'./components/TableList'
import
{
FileWordFilled
}
from
'@ant-design/icons'
...
...
@@ -43,6 +44,7 @@ const Details = (props: any) => {
* @param contractText 合同文档
*/
const
[
StepList
,
setStepList
]
=
useState
<
any
>
([]);
const
[
outerTaskStepList
,
setouterTaskStepList
]
=
useState
<
any
>
([])
const
[
innerTaskStepList
,
setinnerTaskStepList
]
=
useState
<
any
>
([]);
const
[
currentBatch
,
setCurrentBatch
]
=
useState
(
'1'
);
...
...
@@ -139,31 +141,10 @@ const Details = (props: any) => {
setStepList
(
StepList
)
return
;
}
else
{
setTimeout
(()
=>
{
setlistIndex
(
e
.
target
.
value
)
},
100
);
setTimeout
(()
=>
{
ref
.
current
.
reload
();
},
300
);
setlistIndex
(
e
.
target
.
value
)
}
};
/* 流转记录内部 */
const
fetchData
=
(
params
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
fn
;
fn
=
listIndex
==
'1'
?
PublicApi
.
getContractManagePageOuterRecordList
:
PublicApi
.
getContractManagePageInnerRecordList
;
fn
({
...
params
,
contractId
:
contractId
}).
then
(
res
=>
{
console
.
log
(
res
.
data
,
listIndex
)
resolve
(
res
.
data
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
})
}
/*查询合同详情-分页查询合同采购物料*/
const
columns
:
any
=
[
{
...
...
@@ -304,25 +285,7 @@ const Details = (props: any) => {
</
div
>
)
/* 流转列表 */
const
CirculationList
:
any
=
[
{
title
:
'序号'
,
dataIndex
:
'name'
,
align
:
'center'
,
render
:
(
_
,
record
,
index
)
=>
index
+
1
,
},
{
title
:
'操作角色'
,
dataIndex
:
'roleName'
,
align
:
'center'
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'operate'
,
align
:
'center'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
align
:
'center'
,
},
{
title
:
'审核意见'
,
dataIndex
:
'opinion'
,
align
:
'center'
,
},
]
/* 内部 */
const
fetchDataListcolumns
:
any
=
[
{
title
:
'操作人'
,
dataIndex
:
'name'
,
align
:
'center'
,
render
:
(
_
,
record
,
index
)
=>
index
+
1
,
},
{
title
:
'部门'
,
dataIndex
:
'department'
,
align
:
'center'
,
},
{
title
:
'职位'
,
dataIndex
:
'jobTitle'
,
align
:
'center'
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'operate'
,
align
:
'center'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
align
:
'center'
,
},
{
title
:
'审核意见'
,
dataIndex
:
'opinion'
,
align
:
'center'
,
},
]
/* 提交审核的回调 */
const
getfetchData
=
(
data
)
=>
{
console
.
log
(
data
)
...
...
@@ -345,8 +308,8 @@ const Details = (props: any) => {
}
else
{
setIsModalVisible
(
!
Visible
)
}
}
return
(
<
div
className=
{
style
.
anchorWrap
}
>
<
Anchor
...
...
@@ -497,14 +460,7 @@ const Details = (props: any) => {
</
div
>
</
div
>
<
div
className=
'ant-card-body'
>
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
,
}
}
currentRef=
{
ref
}
columns=
{
listIndex
===
'1'
?
CirculationList
:
fetchDataListcolumns
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
/>
<
TableList
contractId=
{
contractId
}
listIndex=
{
listIndex
}
/>
</
div
>
</
div
>
</
div
>
...
...
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