Commit 82b4e9e0 by YuleiLan

fix: 审批退回无法编辑。

parent d4c4af3a
......@@ -66,10 +66,10 @@
width="50"
>
<template slot="header">
<i style="font-size: 25px; color: #409EFF;cursor:pointer;" class="el-icon-circle-plus" @click="addCol(item)" />
<i style="font-size: 25px; color: #409EFF;cursor:pointer;" class="el-icon-circle-plus" @click="addSubformCol(item)" />
</template>
<template slot-scope="scope">
<i style="font-size: 25px; color: red" class="el-icon-remove" @click="delCol(item, scope.$index)" />
<i style="font-size: 25px; color: red" class="el-icon-remove" @click="delSubformCol(item, scope.$index)" />
</template>
</el-table-column>
......@@ -160,17 +160,23 @@ export default {
mounted() {
},
methods: {
addCol(item) {
addSubformCol(item) {
var subformFields = {}
for (var c of item.columns) {
for (var l of c.list) {
subformFields[l.model] = ""
if (l.options !== null && l.options !== undefined) {
subformFields[l.model] = l.options.defaultValue !== undefined && l.options.defaultValue !== null ? l.options.defaultValue: ""
} else {
subformFields[l.model] = ""
}
}
}
this.models[item.model].push(subformFields)
this.models.status = 1
},
delCol(item, index) {
delSubformCol(item, index) {
this.models[item.model].splice(index, 1)
this.models.status = -1
},
generateModle(genList) {
for (let i = 0; i < genList.length; i++) {
......
......@@ -338,29 +338,31 @@ export default {
data() {
return {
widgetLabelWidth: '',
dataModel: this.subformIndex===undefined?this.models[this.widget.model]:this.models[this.subformModel][this.subformIndex][this.widget.model],
dataModel: this.subformIndex===undefined?
this.models[this.widget.model]:
this.models[this.subformModel][this.subformIndex][this.widget.model],
tableData: []
}
},
watch: {
dataModel: {
deep: true,
handler(val) {
if (val !== undefined) {
handler(newValue) {
if (newValue !== undefined && newValue !== null) {
if (this.subformIndex !== undefined) {
this.models[this.subformModel][this.subformIndex][this.widget.model] = val
this.models[this.subformModel][this.subformIndex][this.widget.model] = newValue
this.$emit('update:models', {
...this.models,
[this.subformModel]: this.models[this.subformModel]
})
this.$emit('input-change', val, this.widget.model, this.subformIndex)
// this.$emit('input-change', val, this.widget.model, this.subformIndex)
} else {
this.models[this.widget.model] = val
this.models[this.widget.model] = newValue
this.$emit('update:models', {
...this.models,
[this.widget.model]: val
[this.widget.model]: newValue
})
this.$emit('input-change', val, this.widget.model)
// this.$emit('input-change', val, this.widget.model)
}
}
}
......@@ -368,11 +370,14 @@ export default {
models: {
deep: true,
handler(val) {
if (this.subformIndex === undefined) {
this.dataModel = val[this.widget.model]
} else {
this.dataModel = val[this.subformModel][this.subformIndex][this.widget.model]
if (val.status === undefined && val.status === null) {
if (this.subformIndex === undefined) {
this.dataModel = val[this.widget.model]
} else {
this.dataModel = val[this.subformModel][this.subformIndex][this.widget.model]
}
}
delete this.models.status
}
}
},
......
......@@ -240,11 +240,20 @@ export default {
this.nodeStepList.push(this.processStructureValue.nodes[i])
}
}
// 如果回退到初始节点则可编辑。
if (this.activeIndex === 0 && this.currentNode.clazz === 'start') {
this.currentNode.writeTpls = []
for (var tplTmp of this.processStructureValue.tpls) {
this.currentNode.writeTpls.push(tplTmp.form_structure.id)
}
}
this.getAlertMessage()
})
},
submitAction(item) {
var promiseList = []
this.tpls = []
for (var tpl of this.processStructureValue.tpls) {
this.tpls.push({
tplDataId: tpl.id,
......
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 sign in to comment