Commit a563c0e8 authored by wangxl's avatar wangxl

4444

parent 6ca4886f
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</a-steps> </a-steps>
</div> </div>
<div class="page-content"> <div class="page-content">
<project-edit v-model="value" @close="closeWindow" @load="onLoad" @next="changeSteps" :stepsArray.sync="stepsArray" ref="projCreate"></project-edit> <project-edit v-model="value" @close="closeWindow" @load="onLoad" @onStepChange="onStepChange" :completeStatus.sync=completeStatus :stepsArray.sync="stepsArray" ref="projCreate"></project-edit>
</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>
...@@ -47,6 +47,7 @@ export default { ...@@ -47,6 +47,7 @@ export default {
marginBottom: '60px', marginBottom: '60px',
boxShadow: '0px -1px 0 0 #e8e8e8 inset', boxShadow: '0px -1px 0 0 #e8e8e8 inset',
}, },
completeStatus: "0,0,0,0,0,0"
} }
}, },
props: { props: {
...@@ -72,6 +73,10 @@ export default { ...@@ -72,6 +73,10 @@ export default {
this.currSteps--; this.currSteps--;
this.changeSteps(this.currSteps) this.changeSteps(this.currSteps)
}, },
onStepChange (e) {
this.completeStatus = e.state
this.changeSteps(e.step)
},
changeSteps (e) { changeSteps (e) {
this.currSteps = e this.currSteps = e
var clone = [].concat(this.stepsArray) var clone = [].concat(this.stepsArray)
...@@ -80,6 +85,20 @@ export default { ...@@ -80,6 +85,20 @@ export default {
}) })
clone[e].showStatus = true; clone[e].showStatus = true;
this.stepsArray = clone this.stepsArray = clone
this.getCompleteStatus(e, this.completeStatus)
},
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"
} else {
this.stepsArray[i].status = "wait"
}
}
this.stepsArray[step].status = "process"
}
}, },
save () { save () {
this.$refs.projCreate.save(this.currSteps) this.$refs.projCreate.save(this.currSteps)
......
...@@ -669,13 +669,18 @@ export default { ...@@ -669,13 +669,18 @@ export default {
return [] return []
} }
}, },
completeStatus: {
type: String,
default () {
return "0,0,0,0,0,0"
}
},
}, },
created () { created () {
this.getProject() this.getProject()
}, },
data () { data () {
return { return {
completeStatus: "0,0,0,0,0,0",
overseasShow: false, overseasShow: false,
formData: { formData: {
id: null, id: null,
...@@ -804,12 +809,10 @@ export default { ...@@ -804,12 +809,10 @@ export default {
this.formData.id = data this.formData.id = data
if (next) { if (next) {
this.$emit('close', 'save') this.$emit('close', 'save')
this.$emit('next', step + 1)
var arr = this.completeStatus.split(','); var arr = this.completeStatus.split(',');
arr[step] = "1"; arr[step] = "1";
this.completeStatus = arr.toString() this.formData.completeStatus = arr.toString()
this.formData.completeStatus = this.completeStatus this.$emit('onStepChange', { step: step + 1, state: arr.toString() })
this.getCompleteStatus(step + 1, this.completeStatus)
} else { } else {
this.$message.success('成功!') this.$message.success('成功!')
this.$emit('close', 'submit') this.$emit('close', 'submit')
...@@ -833,7 +836,7 @@ export default { ...@@ -833,7 +836,7 @@ export default {
if (data) { if (data) {
this.formData = data this.formData = data
console.log(data) console.log(data)
this.getCompleteStatus(0, data.completeStatus) this.$emit('onStepChange', { step: 0, state: data.completeStatus })
this.loadList() this.loadList()
} else } else
this.$emit('close', 'error') this.$emit('close', 'error')
...@@ -846,7 +849,7 @@ export default { ...@@ -846,7 +849,7 @@ export default {
this.$api.project.getNewProject({ projType: getType() }).then(({ data = {} }) => { this.$api.project.getNewProject({ projType: getType() }).then(({ data = {} }) => {
if (data) { if (data) {
this.formData = data this.formData = data
this.getCompleteStatus(0, data.completeStatus) this.$emit('onStepChange', { step: 0, state: data.completeStatus })
this.loadList() this.loadList()
} else } else
this.$emit('close', 'error') this.$emit('close', 'error')
......
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