|
|
@@ -217,7 +217,7 @@ |
|
|
|
<el-table-column label="责任领导" align="center" width="180"> |
|
|
|
<template slot-scope="{ row }"> |
|
|
|
<treeselect |
|
|
|
:disabled="true" |
|
|
|
:disabled="true" |
|
|
|
v-if="row.edit || row.add" |
|
|
|
:multiple="true" |
|
|
|
v-model="form.leaderPrincipal" |
|
|
@@ -372,6 +372,7 @@ export default { |
|
|
|
allLoading: false, |
|
|
|
tableLoading: false, |
|
|
|
form: {}, |
|
|
|
reducing: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
@@ -431,28 +432,37 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
change(type, index) { |
|
|
|
if (type == "add") { |
|
|
|
this.form = {}; |
|
|
|
let data = this.data; |
|
|
|
data[map[this.type]].push({ add: true }); |
|
|
|
} |
|
|
|
if (type == "edit") { |
|
|
|
console.log(this.formatDep, this.principalList); |
|
|
|
let form = JSON.parse(JSON.stringify(this.data[map[this.type]][index])); |
|
|
|
form.leaderDept = form.leaderDept |
|
|
|
.split(",") |
|
|
|
.map((item) => parseInt(item)); |
|
|
|
form.cooperateDept = form.cooperateDept |
|
|
|
.split(",") |
|
|
|
.map((item) => parseInt(item)); |
|
|
|
form.leaderPrincipal = form.leaderPrincipal |
|
|
|
.split(",") |
|
|
|
.map((item) => parseInt(item)); |
|
|
|
form.cooperatePrincipal = form.cooperatePrincipal |
|
|
|
.split(",") |
|
|
|
.map((item) => parseInt(item)); |
|
|
|
this.form = form; |
|
|
|
this.$set(this.data[map[this.type]][index], "edit", true); |
|
|
|
if (!this.reducing) { |
|
|
|
if (type == "add") { |
|
|
|
this.form = {}; |
|
|
|
let data = this.data; |
|
|
|
data[map[this.type]].push({ add: true }); |
|
|
|
} |
|
|
|
if (type == "edit") { |
|
|
|
let form = JSON.parse( |
|
|
|
JSON.stringify(this.data[map[this.type]][index]) |
|
|
|
); |
|
|
|
form.leaderDept = form.leaderDept |
|
|
|
.split(",") |
|
|
|
.map((item) => parseInt(item)); |
|
|
|
form.cooperateDept = form.cooperateDept |
|
|
|
.split(",") |
|
|
|
.map((item) => parseInt(item)); |
|
|
|
form.leaderPrincipal = form.leaderPrincipal |
|
|
|
.split(",") |
|
|
|
.map((item) => parseInt(item)); |
|
|
|
form.cooperatePrincipal = form.cooperatePrincipal |
|
|
|
.split(",") |
|
|
|
.map((item) => parseInt(item)); |
|
|
|
this.form = form; |
|
|
|
this.$set(this.data[map[this.type]][index], "edit", true); |
|
|
|
} |
|
|
|
this.reducing=true |
|
|
|
}else{ |
|
|
|
this.$message({ |
|
|
|
type:"warning", |
|
|
|
message:"请先完成当前操作" |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
close() { |
|
|
@@ -481,6 +491,7 @@ export default { |
|
|
|
this.$message.error("修改小项内容失败"); |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
this.reducing=false |
|
|
|
this.allLoading = false; |
|
|
|
this.form = {}; |
|
|
|
}); |
|
|
@@ -518,6 +529,7 @@ export default { |
|
|
|
.finally(() => { |
|
|
|
this.allLoading = false; |
|
|
|
this.form = {}; |
|
|
|
this.reducing=false |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |