Commit 6ca4886f authored by wangxl's avatar wangxl

222222

parent 6e842e19
...@@ -417,6 +417,9 @@ export default { ...@@ -417,6 +417,9 @@ export default {
save (params) { save (params) {
return fetch(`/v1/science-admin/com-project/save`, params, 'post', 'json') 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) { updateUnit (params) {
return fetch(`/v1/science-admin/com-project/updateUnit`, params, 'post', 'json') return fetch(`/v1/science-admin/com-project/updateUnit`, params, 'post', 'json')
}, },
......
...@@ -4,18 +4,17 @@ ...@@ -4,18 +4,17 @@
<a-spin :spinning="loading" style="width: 100%;height: 100%;"> <a-spin :spinning="loading" style="width: 100%;height: 100%;">
<div class="page-steps"> <div class="page-steps">
<a-steps size="small" :current="current"> <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> </a-steps>
</div> </div>
<div class="page-content"> <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 v-model="value" @close="closeWindow" @load="onLoad" @next="changeSteps" :stepsArray.sync="stepsArray" ref="projCreate"></project-edit>
<project-edit-key v-model="value" @close="closeWindow" @load="onLoad" :showStatus.sync="showStatus" ref="projCreate" v-else></project-edit-key>
</div> </div>
<div class="page-footer"> <div class="page-footer">
<a-button v-if="currSteps > 0" style="margin-left: 40px" type="primary" @click="prev">上一步</a-button> <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 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 < stepsArray.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="submit">完成填写</a-button>
</div> </div>
</a-spin> </a-spin>
</div> </div>
...@@ -36,15 +35,14 @@ export default { ...@@ -36,15 +35,14 @@ export default {
projType: getType() == "1", projType: getType() == "1",
current: 10, current: 10,
currSteps: 0, currSteps: 0,
completeStatus: [ stepsArray: [
{ status: "", title: '基本信息' }, { status: "process", title: '基本信息', showStatus: true },
{ status: "", title: '项目组成员及单位' }, { status: "wait", title: '项目组成员及单位', showStatus: false },
{ status: "", title: '经费预算及设备明细' }, { status: "wait", title: '经费预算及设备明细', showStatus: false },
{ status: "", title: '阶段目标及课题设置' }, { status: "wait", title: '阶段目标及课题设置', showStatus: false },
{ status: "", title: '绩效指标' }, { status: "wait", title: '绩效指标', showStatus: false },
{ status: "", title: '附件' } { status: "wait", title: '附件', showStatus: false }
], ],
showStatus: [true, false, false, false, false, false],
stepStyle: { stepStyle: {
marginBottom: '60px', marginBottom: '60px',
boxShadow: '0px -1px 0 0 #e8e8e8 inset', boxShadow: '0px -1px 0 0 #e8e8e8 inset',
...@@ -66,35 +64,28 @@ export default { ...@@ -66,35 +64,28 @@ export default {
debugger debugger
this.currSteps = e this.currSteps = e
this.changeSteps(this.currSteps) this.changeSteps(this.currSteps)
console.log(this.currSteps, 'stepsChange')
}, },
next () { next () {
this.currSteps++; this.$refs.projCreate.submit(this.currSteps, true)
this.changeSteps(this.currSteps)
console.log(this.currSteps, 'next')
}, },
prev () { prev () {
this.currSteps--; this.currSteps--;
this.changeSteps(this.currSteps) this.changeSteps(this.currSteps)
console.log(this.currSteps, 'prev')
}, },
changeSteps (e) { changeSteps (e) {
var clone = [].concat(this.completeStatus) this.currSteps = e
clone[e].status = "process" var clone = [].concat(this.stepsArray)
this.completeStatus = clone clone.forEach(e => {
this.changeShowStatus(e) e.showStatus = false
}, })
changeShowStatus (e) { clone[e].showStatus = true;
var clone = [false, false, false, false, false, false] this.stepsArray = clone
clone[e] = true;
this.showStatus = clone
console.log(this.showStatus)
}, },
save () { save () {
this.$refs.projCreate.save() this.$refs.projCreate.save(this.currSteps)
}, },
submit () { submit () {
this.$refs.projCreate.submit() this.$refs.projCreate.submit(this.currSteps, false)
}, },
closeWindow (value) { closeWindow (value) {
this.$emit('close', value) this.$emit('close', value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment