Commit 6ca4886f authored by wangxl's avatar wangxl

222222

parent 6e842e19
......@@ -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')
},
......
......@@ -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)
......
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