Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
yn-science-front
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
徐俊
yn-science-front
Commits
6ca4886f
Commit
6ca4886f
authored
Dec 17, 2024
by
wangxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
222222
parent
6e842e19
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
161 additions
and
107 deletions
+161
-107
index.js
src/api/index.js
+3
-0
projectCreate.vue
src/views/report/project/components/edit/projectCreate.vue
+21
-30
projectEdit.vue
src/views/report/project/components/edit/projectEdit.vue
+137
-77
No files found.
src/api/index.js
View file @
6ca4886f
...
...
@@ -417,6 +417,9 @@ export default {
save
(
params
)
{
return
fetch
(
`/v1/science-admin/com-project/save`
,
params
,
'post'
,
'json'
)
},
saveByStep
(
params
)
{
return
fetch
(
`/v1/science-admin/com-project/saveByStep`
,
params
,
'post'
,
'json'
)
},
updateUnit
(
params
)
{
return
fetch
(
`/v1/science-admin/com-project/updateUnit`
,
params
,
'post'
,
'json'
)
},
...
...
src/views/report/project/components/edit/projectCreate.vue
View file @
6ca4886f
...
...
@@ -4,18 +4,17 @@
<a-spin
:spinning=
"loading"
style=
"width: 100%;height: 100%;"
>
<div
class=
"page-steps"
>
<a-steps
size=
"small"
:current=
"current"
>
<a-step
:status=
"item.status"
v-for=
"(item,index) in
completeStatus"
:key=
"index+'completeStatus
'"
:title=
"item.title"
/>
<a-step
:status=
"item.status"
v-for=
"(item,index) in
stepsArray"
:key=
"index+'stepsArray
'"
:title=
"item.title"
/>
</a-steps>
</div>
<div
class=
"page-content"
>
<project-edit
v-model=
"value"
@
close=
"closeWindow"
@
load=
"onLoad"
:showStatus
.
sync=
"showStatus"
ref=
"projCreate"
v-if=
"projType"
></project-edit>
<project-edit-key
v-model=
"value"
@
close=
"closeWindow"
@
load=
"onLoad"
:showStatus
.
sync=
"showStatus"
ref=
"projCreate"
v-else
></project-edit-key>
<project-edit
v-model=
"value"
@
close=
"closeWindow"
@
load=
"onLoad"
@
next=
"changeSteps"
:stepsArray
.
sync=
"stepsArray"
ref=
"projCreate"
></project-edit>
</div>
<div
class=
"page-footer"
>
<a-button
v-if=
"currSteps > 0"
style=
"margin-left: 40px"
type=
"primary"
@
click=
"prev"
>
上一步
</a-button>
<a-button
style=
"margin-left: 40px"
type=
"primary"
@
click=
"save"
>
保 存
</a-button>
<a-button
v-if=
"currSteps
<
completeStatus
.
length
-
1
"
style=
"margin-left: 40px"
type=
"primary"
@
click=
"next"
>
下一步
</a-button>
<a-button
v-if=
"currSteps ==
completeStatus
.length - 1"
style=
"margin-left: 40px"
type=
"primary"
@
click=
"submit"
>
完成填写
</a-button>
<a-button
v-if=
"currSteps
<
stepsArray
.
length
-
1
"
style=
"margin-left: 40px"
type=
"primary"
@
click=
"next"
>
下一步
</a-button>
<a-button
v-if=
"currSteps ==
stepsArray
.length - 1"
style=
"margin-left: 40px"
type=
"primary"
@
click=
"submit"
>
完成填写
</a-button>
</div>
</a-spin>
</div>
...
...
@@ -36,15 +35,14 @@ export default {
projType
:
getType
()
==
"1"
,
current
:
10
,
currSteps
:
0
,
completeStatus
:
[
{
status
:
"
"
,
title
:
'基本信息'
},
{
status
:
"
"
,
title
:
'项目组成员及单位'
},
{
status
:
"
"
,
title
:
'经费预算及设备明细'
},
{
status
:
"
"
,
title
:
'阶段目标及课题设置'
},
{
status
:
"
"
,
title
:
'绩效指标'
},
{
status
:
"
"
,
title
:
'附件'
}
stepsArray
:
[
{
status
:
"
process"
,
title
:
'基本信息'
,
showStatus
:
true
},
{
status
:
"
wait"
,
title
:
'项目组成员及单位'
,
showStatus
:
false
},
{
status
:
"
wait"
,
title
:
'经费预算及设备明细'
,
showStatus
:
false
},
{
status
:
"
wait"
,
title
:
'阶段目标及课题设置'
,
showStatus
:
false
},
{
status
:
"
wait"
,
title
:
'绩效指标'
,
showStatus
:
false
},
{
status
:
"
wait"
,
title
:
'附件'
,
showStatus
:
false
}
],
showStatus
:
[
true
,
false
,
false
,
false
,
false
,
false
],
stepStyle
:
{
marginBottom
:
'60px'
,
boxShadow
:
'0px -1px 0 0 #e8e8e8 inset'
,
...
...
@@ -66,35 +64,28 @@ export default {
debugger
this
.
currSteps
=
e
this
.
changeSteps
(
this
.
currSteps
)
console
.
log
(
this
.
currSteps
,
'stepsChange'
)
},
next
()
{
this
.
currSteps
++
;
this
.
changeSteps
(
this
.
currSteps
)
console
.
log
(
this
.
currSteps
,
'next'
)
this
.
$refs
.
projCreate
.
submit
(
this
.
currSteps
,
true
)
},
prev
()
{
this
.
currSteps
--
;
this
.
changeSteps
(
this
.
currSteps
)
console
.
log
(
this
.
currSteps
,
'prev'
)
},
changeSteps
(
e
)
{
var
clone
=
[].
concat
(
this
.
completeStatus
)
clone
[
e
].
status
=
"process"
this
.
completeStatus
=
clone
this
.
changeShowStatus
(
e
)
},
changeShowStatus
(
e
)
{
var
clone
=
[
false
,
false
,
false
,
false
,
false
,
false
]
clone
[
e
]
=
true
;
this
.
showStatus
=
clone
console
.
log
(
this
.
showStatus
)
this
.
currSteps
=
e
var
clone
=
[].
concat
(
this
.
stepsArray
)
clone
.
forEach
(
e
=>
{
e
.
showStatus
=
false
})
clone
[
e
].
showStatus
=
true
;
this
.
stepsArray
=
clone
},
save
()
{
this
.
$refs
.
projCreate
.
save
()
this
.
$refs
.
projCreate
.
save
(
this
.
currSteps
)
},
submit
()
{
this
.
$refs
.
projCreate
.
submit
()
this
.
$refs
.
projCreate
.
submit
(
this
.
currSteps
,
false
)
},
closeWindow
(
value
)
{
this
.
$emit
(
'close'
,
value
)
...
...
src/views/report/project/components/edit/projectEdit.vue
View file @
6ca4886f
<
template
>
<div>
<a-form-model
ref=
"form"
:model=
"formData"
:rules=
"rules"
style=
"border-top: 0px"
class=
"from-table font-line-space"
>
<div
v-if=
"s
howStatus[0]
"
>
<div
v-if=
"s
tepsArray[0].showStatus
"
>
<a-row>
<a-col
:span=
"24"
style=
"border-top: 0px;text-align: center;"
>
<div
class=
"main-title"
>
...
...
@@ -350,20 +350,6 @@
</a-form-model-item>
</a-col>
</a-row>
<a-row
type=
"flex"
>
<a-col
:span=
"4"
class=
"bg-gray"
>
<div
class=
"special-middle"
>
<div
class=
"required"
>
申请经费(万元)
</div>
</div>
</a-col>
<a-col
:span=
"20"
>
<a-form-model-item
prop=
"govFunding"
>
<!--
<a-input-number
v-model=
"formData.govFunding"
@
change=
"govFundingChange"
:min=
"0"
:step=
"0.01"
style=
"width: 100px"
/>
-->
{{
formData
.
govFunding
}}
<span>
万元
</span>
</a-form-model-item>
</a-col>
</a-row>
<a-row
type=
"flex"
>
<a-col
:span=
"4"
class=
"bg-gray"
>
<div
class=
"special-middle"
>
...
...
@@ -512,7 +498,7 @@
</a-col>
</a-row>
</div>
<div
v-if=
"s
howStatus[1]
"
>
<div
v-if=
"s
tepsArray[1].showStatus
"
>
<a-row>
<a-col
:span=
"24"
style=
"border-top: 0px"
>
<div
class=
"main-title"
>
...
...
@@ -532,7 +518,7 @@
<!-- 项目主要参与单位及分工 -->
<participate-units-edit
:participateUnits
.
sync=
"formData.participateUnits"
/>
</div>
<div
v-if=
"s
howStatus[2]
"
>
<div
v-if=
"s
tepsArray[2].showStatus
"
>
<!-- 经费预算 -->
<budget-edit
:budget
.
sync=
"formData.budget"
@
save=
"budgetSave"
/>
<a-row
type=
"flex"
>
...
...
@@ -572,13 +558,13 @@
<!-- 项目承担单位研究资金支出预算明细表 -->
<unit-payment-edit
:unitPayment
.
sync=
"formData.unitPayment"
/>
</div>
<div
v-if=
"s
howStatus[3]
"
>
<div
v-if=
"s
tepsArray[3].showStatus
"
>
<!-- 项目安排及阶段目标 -->
<proj-stage-goals-edit
:stageGoals
.
sync=
"formData.stageGoals"
/>
<!-- 项目课题设置 -->
<project-sub-edit
:projectSubList
.
sync=
"formData.projectSubList"
/>
</div>
<div
v-if=
"s
howStatus[4]
"
>
<div
v-if=
"s
tepsArray[4].showStatus
"
>
<a-row
type=
"flex"
>
<a-col
:span=
"24"
style=
"text-align: center;"
>
<div
class=
"special-middle"
>
...
...
@@ -589,7 +575,7 @@
<!-- 项目绩效指标 -->
<project-kpi-edit
:projectKPI
.
sync=
"formData.projectKPI"
/>
</div>
<div
v-if=
"s
howStatus[5]
"
>
<div
v-if=
"s
tepsArray[5].showStatus
"
>
<!-- 附件 -->
<file-edit
:fileList
.
sync=
"formData.fileList"
/>
</div>
...
...
@@ -677,19 +663,19 @@ export default {
return
null
}
},
s
howStatus
:
{
s
tepsArray
:
{
type
:
Array
,
default
()
{
return
[
true
,
false
,
false
,
false
,
false
,
false
]
return
[]
}
},
},
created
()
{
console
.
log
(
this
.
showStatus
)
this
.
getProject
()
},
data
()
{
return
{
completeStatus
:
"0,0,0,0,0,0"
,
overseasShow
:
false
,
formData
:
{
id
:
null
,
...
...
@@ -761,8 +747,8 @@ export default {
remark
:
[{
required
:
true
,
message
:
'请填写附注说明'
,
trigger
:
'blur'
},],
startDate
:
{
required
:
true
,
message
:
'请选择项日开始时间'
,
trigger
:
'change'
},
endDate
:
{
required
:
true
,
message
:
'请选择项目结束时间'
,
trigger
:
'change'
},
totalFunding
:
[{
required
:
true
,
message
:
'请填写项目总经费'
,
trigger
:
'blur'
},],
govFunding
:
[{
required
:
true
,
message
:
'请填写申请科技经费'
,
trigger
:
'blur'
},],
//
totalFunding: [{ required: true, message: '请填写项目总经费', trigger: 'blur' },],
//
govFunding: [{ required: true, message: '请填写申请科技经费', trigger: 'blur' },],
projAbstract
:
[{
required
:
true
,
message
:
'请填写项目摘要'
,
trigger
:
'blur'
},],
projKeywords
:
[{
required
:
true
,
message
:
'请填写关键词'
,
trigger
:
'blur'
},],
researchContent
:
{
required
:
true
,
message
:
'请填写项目实施目标'
,
trigger
:
'blur'
},
...
...
@@ -782,12 +768,72 @@ export default {
},
methods
:
{
moment
,
save
(
step
)
{
var
obj
=
this
.
getObj
(
step
)
obj
.
step
=
step
if
(
this
.
checkInfo
(
step
))
{
this
.
$emit
(
'load'
,
true
)
let
pars
=
isEmptyParams
(
obj
)
let
par
=
{
...
pars
}
this
.
$api
.
project
.
saveByStep
(
par
).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
this
.
formData
.
id
=
data
this
.
$message
.
success
(
'保存成功!'
)
this
.
$emit
(
'close'
,
'save'
)
}
this
.
$emit
(
'load'
,
false
)
}).
catch
(()
=>
{
this
.
$emit
(
'load'
,
false
)
})
}
},
submit
(
step
,
next
)
{
if
(
this
.
checkInfo
(
step
))
{
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
this
.
$emit
(
'load'
,
true
)
var
obj
=
this
.
getObj
(
step
)
obj
.
step
=
step
let
state
=
obj
.
projState
if
(
state
!=
30
)
obj
.
projState
=
10
let
pars
=
isEmptyParams
(
obj
)
let
par
=
{
...
pars
}
this
.
$api
.
project
.
saveByStep
(
par
).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
this
.
formData
.
id
=
data
if
(
next
)
{
this
.
$emit
(
'close'
,
'save'
)
this
.
$emit
(
'next'
,
step
+
1
)
var
arr
=
this
.
completeStatus
.
split
(
','
);
arr
[
step
]
=
"1"
;
this
.
completeStatus
=
arr
.
toString
()
this
.
formData
.
completeStatus
=
this
.
completeStatus
this
.
getCompleteStatus
(
step
+
1
,
this
.
completeStatus
)
}
else
{
this
.
$message
.
success
(
'成功!'
)
this
.
$emit
(
'close'
,
'submit'
)
}
}
this
.
$emit
(
'load'
,
false
)
}).
catch
(()
=>
{
this
.
$emit
(
'load'
,
false
)
})
}
else
{
this
.
$message
.
error
(
'信息未填写完全!'
)
return
false
}
})
}
},
getProject
()
{
this
.
$emit
(
'load'
,
true
)
if
(
!!
this
.
value
)
{
this
.
$api
.
project
.
getProjectInfoById
({
id
:
this
.
value
}).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
this
.
formData
=
data
console
.
log
(
data
)
this
.
getCompleteStatus
(
0
,
data
.
completeStatus
)
this
.
loadList
()
}
else
this
.
$emit
(
'close'
,
'error'
)
...
...
@@ -800,6 +846,7 @@ export default {
this
.
$api
.
project
.
getNewProject
({
projType
:
getType
()
}).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
this
.
formData
=
data
this
.
getCompleteStatus
(
0
,
data
.
completeStatus
)
this
.
loadList
()
}
else
this
.
$emit
(
'close'
,
'error'
)
...
...
@@ -810,12 +857,24 @@ export default {
})
}
},
getCompleteStatus
(
step
,
completeStatus
)
{
var
arr
=
completeStatus
.
split
(
','
)
if
(
!!
arr
&&
arr
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
if
(
arr
[
i
]
==
"1"
)
{
this
.
stepsArray
[
i
].
status
=
"finish"
}
}
this
.
stepsArray
[
step
].
status
=
"process"
}
},
loadList
()
{
if
(
!!!
this
.
formData
.
cooperativeUnits
||
this
.
formData
.
cooperativeUnits
.
length
==
0
)
this
.
formData
.
cooperativeUnits
=
[
{
...
Cooperative
},
{
...
Cooperative
}
]
this
.
formData
.
cooperativeUnits
=
[]
if
(
!!!
this
.
formData
.
participateUnits
||
this
.
formData
.
participateUnits
.
length
==
0
)
this
.
formData
.
participateUnits
=
[
{
...
ParticipateUnit
},
{
...
ParticipateUnit
}]
this
.
formData
.
participateUnits
=
[
]
//{ ...Cooperative }, { ...Cooperative }
if
(
!!!
this
.
formData
.
members
||
this
.
formData
.
members
.
length
==
0
)
this
.
formData
.
members
=
[]
...
...
@@ -848,60 +907,61 @@ export default {
this
.
formData
.
managerDept
=
this
.
formData
.
projectKPI
.
managerDept
this
.
formData
.
projAttribute
=
this
.
formData
.
projectKPI
.
projAttribute
},
save
()
{
this
.
processProjectYearTarget
()
if
(
this
.
checkProjName
())
{
this
.
$emit
(
'load'
,
true
)
let
pars
=
isEmptyParams
(
this
.
formData
)
let
par
=
{
...
pars
}
this
.
$api
.
project
.
save
(
par
).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
this
.
formData
.
id
=
data
this
.
$message
.
success
(
'保存成功!'
)
this
.
$emit
(
'close'
,
'save'
)
}
this
.
$emit
(
'load'
,
false
)
}).
catch
(()
=>
{
this
.
$emit
(
'load'
,
false
)
})
}
},
submit
()
{
this
.
processProjectYearTarget
()
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
formData
.
members
.
length
==
0
)
{
this
.
$message
.
error
(
'至少添加一位项目组成员!'
)
return
false
}
else
{
this
.
$emit
(
'load'
,
true
)
let
state
=
this
.
formData
.
projState
if
(
state
!=
30
)
this
.
formData
.
projState
=
10
let
pars
=
isEmptyParams
(
this
.
formData
)
let
par
=
{
...
pars
}
this
.
$api
.
project
.
save
(
par
).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
this
.
formData
.
id
=
data
this
.
$message
.
success
(
'成功!'
)
this
.
$emit
(
'close'
,
'submit'
)
}
this
.
$emit
(
'load'
,
false
)
}).
catch
(()
=>
{
this
.
$emit
(
'load'
,
false
)
})
getObj
(
step
)
{
var
obj
=
null
switch
(
step
)
{
case
0
:
{
obj
=
{
id
:
null
,
reportYear
:
null
,
batch
:
null
,
projState
:
null
,
appPersonId
:
null
,
appUnitId
:
null
,
projType
:
null
,
jobTime
:
null
,
address
:
null
,
mainResearchAreas
:
null
,
unitLinkName
:
null
,
unitLinkMobile
:
null
,
unitLinkEmail
:
null
,
unitLinkFax
:
null
,
projName
:
null
,
knowledgeId
:
null
,
startDate
:
null
,
endDate
:
null
,
remark
:
null
,
projClass
:
null
,
subjectScope
:
null
,
projAbstract
:
null
,
projKeywords
:
null
,
totalFunding
:
null
,
govFunding
:
null
,
unitFunding
:
null
,
selfFunding
:
null
,
researchContent
:
null
,
technologyTarget
:
null
,
economyTarget
:
null
,
achievementTarget
:
null
,
technologyReportsTarget
:
null
,
otherTarget
:
null
,
fileId
:
null
,
downloadId
:
null
,
completeStatus
:
null
,
step
:
null
}
}
else
{
this
.
$message
.
error
(
'项目信息未填写完全!'
)
return
false
break
;
}
case
1
:
obj
=
{
id
:
null
,
members
:
[],
participateUnits
:
[],
completeStatus
:
null
,
step
:
null
}
break
;
case
2
:
obj
=
{
id
:
null
,
budget
:
[],
fundPlan
:
[],
deviceList
:
[],
manufactureList
:
[],
unitPayment
:
[],
completeStatus
:
null
,
step
:
null
}
break
;
case
3
:
obj
=
{
id
:
null
,
stageGoals
:
[],
projectSubList
:
[],
completeStatus
:
null
,
step
:
null
}
break
;
case
4
:
obj
=
{
id
:
null
,
projectKPI
:
null
,
completeStatus
:
null
,
step
:
null
}
break
;
case
5
:
obj
=
{
id
:
null
,
fileList
:
[],
projState
:
null
,
completeStatus
:
null
,
step
:
null
}
break
;
}
Object
.
keys
(
obj
).
forEach
(
key
=>
{
obj
[
key
]
=
this
.
formData
[
key
];
})
return
obj
},
checkProjName
()
{
if
(
this
.
formData
.
projName
==
""
||
this
.
formData
.
projName
==
null
)
{
alert
(
'项目名称不能为空'
)
return
false
}
else
{
checkInfo
(
step
)
{
if
(
step
==
0
)
{
if
(
this
.
formData
.
projName
==
""
||
this
.
formData
.
projName
==
null
)
{
alert
(
'项目名称不能为空'
)
return
false
}
else
return
true
}
else
if
(
step
==
1
)
{
if
(
!!!
this
.
formData
.
members
||
this
.
formData
.
members
.
length
==
0
)
{
this
.
$message
.
error
(
'至少添加一位项目组成员!'
)
return
false
}
else
return
true
}
else
if
(
step
==
2
)
{
return
true
}
else
if
(
step
==
3
)
{
return
true
}
else
if
(
step
==
4
)
{
return
true
}
else
if
(
step
==
5
)
{
return
true
}
},
...
...
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