Commit 01dad1c5 by lanyulei Committed by GitHub

Merge pull request #40 from lanyulei/dev

fix: 审批退回无法编辑。
parents d4c4af3a 82b4e9e0
...@@ -66,10 +66,10 @@ ...@@ -66,10 +66,10 @@
width="50" width="50"
> >
<template slot="header"> <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>
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
...@@ -160,17 +160,23 @@ export default { ...@@ -160,17 +160,23 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
addCol(item) { addSubformCol(item) {
var subformFields = {} var subformFields = {}
for (var c of item.columns) { for (var c of item.columns) {
for (var l of c.list) { for (var l of c.list) {
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] = "" subformFields[l.model] = ""
} }
} }
}
this.models[item.model].push(subformFields) 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[item.model].splice(index, 1)
this.models.status = -1
}, },
generateModle(genList) { generateModle(genList) {
for (let i = 0; i < genList.length; i++) { for (let i = 0; i < genList.length; i++) {
......
...@@ -338,29 +338,31 @@ export default { ...@@ -338,29 +338,31 @@ export default {
data() { data() {
return { return {
widgetLabelWidth: '', 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: [] tableData: []
} }
}, },
watch: { watch: {
dataModel: { dataModel: {
deep: true, deep: true,
handler(val) { handler(newValue) {
if (val !== undefined) { if (newValue !== undefined && newValue !== null) {
if (this.subformIndex !== undefined) { 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.$emit('update:models', {
...this.models, ...this.models,
[this.subformModel]: this.models[this.subformModel] [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 { } else {
this.models[this.widget.model] = val this.models[this.widget.model] = newValue
this.$emit('update:models', { this.$emit('update:models', {
...this.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,12 +370,15 @@ export default { ...@@ -368,12 +370,15 @@ export default {
models: { models: {
deep: true, deep: true,
handler(val) { handler(val) {
if (val.status === undefined && val.status === null) {
if (this.subformIndex === undefined) { if (this.subformIndex === undefined) {
this.dataModel = val[this.widget.model] this.dataModel = val[this.widget.model]
} else { } else {
this.dataModel = val[this.subformModel][this.subformIndex][this.widget.model] this.dataModel = val[this.subformModel][this.subformIndex][this.widget.model]
} }
} }
delete this.models.status
}
} }
}, },
created() { created() {
......
...@@ -240,11 +240,20 @@ export default { ...@@ -240,11 +240,20 @@ export default {
this.nodeStepList.push(this.processStructureValue.nodes[i]) 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() this.getAlertMessage()
}) })
}, },
submitAction(item) { submitAction(item) {
var promiseList = [] var promiseList = []
this.tpls = []
for (var tpl of this.processStructureValue.tpls) { for (var tpl of this.processStructureValue.tpls) {
this.tpls.push({ this.tpls.push({
tplDataId: tpl.id, 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