|
|
|
|
|
|
|
|
<el-col :span="4" class="title"> 牵头部门: </el-col> |
|
|
<el-col :span="4" class="title"> 牵头部门: </el-col> |
|
|
<el-col :span="7"> |
|
|
<el-col :span="7"> |
|
|
<treeselect |
|
|
<treeselect |
|
|
@select="changePrincipal($event, 'leader')" |
|
|
|
|
|
|
|
|
@input="changePrincipal($event, 'leader')" |
|
|
v-model="form.leaderDept" |
|
|
v-model="form.leaderDept" |
|
|
:options="formatDep" |
|
|
:options="formatDep" |
|
|
placeholder="请选择牵头部门" |
|
|
placeholder="请选择牵头部门" |
|
|
|
|
|
|
|
|
<el-col :span="4" class="title"> 其他牵头部门: </el-col> |
|
|
<el-col :span="4" class="title"> 其他牵头部门: </el-col> |
|
|
<el-col :span="7"> |
|
|
<el-col :span="7"> |
|
|
<treeselect |
|
|
<treeselect |
|
|
@select="changePrincipal($event, 'other', index)" |
|
|
|
|
|
|
|
|
@input="changePrincipal($event, 'other')" |
|
|
v-model="form.otherDept[index]" |
|
|
v-model="form.otherDept[index]" |
|
|
:options="formatDep" |
|
|
:options="formatDep" |
|
|
placeholder="请选择其他牵头部门" |
|
|
placeholder="请选择其他牵头部门" |
|
|
|
|
|
|
|
|
<el-col :span="4" class="title">配合部门: </el-col> |
|
|
<el-col :span="4" class="title">配合部门: </el-col> |
|
|
<el-col :span="7"> |
|
|
<el-col :span="7"> |
|
|
<treeselect |
|
|
<treeselect |
|
|
@select="changePrincipal($event, 'cooperate', index)" |
|
|
|
|
|
|
|
|
@input="changePrincipal($event, 'cooperate')" |
|
|
v-model="form.cooperateDept[index]" |
|
|
v-model="form.cooperateDept[index]" |
|
|
:options="formatDep" |
|
|
:options="formatDep" |
|
|
placeholder="请选择配合部门" |
|
|
placeholder="请选择配合部门" |
|
|
|
|
|
|
|
|
this.$store.dispatch("base/getPrincipalList"); |
|
|
this.$store.dispatch("base/getPrincipalList"); |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
...mapGetters(["formatDep", "principalList"]), |
|
|
|
|
|
|
|
|
...mapGetters(["formatDep", "principalList", "department"]), |
|
|
}, |
|
|
}, |
|
|
filters: { |
|
|
filters: { |
|
|
formatList(val) { |
|
|
formatList(val) { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
changePrincipal(e, type, index) { |
|
|
|
|
|
let nameId; |
|
|
|
|
|
this.department.forEach((item) => { |
|
|
|
|
|
if (item.id == e.id) { |
|
|
|
|
|
nameId = item.principal; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
changePrincipal(e, type) { |
|
|
if (type == "other") { |
|
|
if (type == "other") { |
|
|
this.$set(this.form.otherPrincipal, index, parseInt(nameId)); |
|
|
|
|
|
|
|
|
let eventId = e.id; |
|
|
|
|
|
let depts = this.form.otherDept; |
|
|
|
|
|
|
|
|
|
|
|
let nameIds = []; |
|
|
|
|
|
depts.forEach((dept) => { |
|
|
|
|
|
this.department.forEach((item) => { |
|
|
|
|
|
if (item.id == dept) { |
|
|
|
|
|
nameIds.push(parseInt(item.principal)); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
this.$set(this.form, "otherPrincipal", nameIds); |
|
|
} |
|
|
} |
|
|
if (type == "cooperate") { |
|
|
if (type == "cooperate") { |
|
|
this.$set(this.form.cooperatePrincipal, index, parseInt(nameId)); |
|
|
|
|
|
|
|
|
let eventId = e.id; |
|
|
|
|
|
let depts = this.form.cooperateDept; |
|
|
|
|
|
let nameIds = []; |
|
|
|
|
|
depts.forEach((dept) => { |
|
|
|
|
|
this.department.forEach((item) => { |
|
|
|
|
|
if (item.id == dept) { |
|
|
|
|
|
nameIds.push(parseInt(item.principal)); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
this.$set(this.form, "cooperatePrincipal", nameIds); |
|
|
} |
|
|
} |
|
|
if (type == "leader") { |
|
|
if (type == "leader") { |
|
|
this.$set(this.form, "leaderPrincipal", parseInt(nameId)); |
|
|
|
|
|
|
|
|
let nameId; |
|
|
|
|
|
let id = this.form.leaderDept; |
|
|
|
|
|
this.department.forEach((item) => { |
|
|
|
|
|
if (item.id == id) { |
|
|
|
|
|
nameId = item.principal; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
this.$set(this.form, "leaderPrincipal", nameId&&parseInt(nameId)); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
addDept(type) { |
|
|
addDept(type) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
deleteDept(index, type) { |
|
|
deleteDept(index, type) { |
|
|
console.log(index, type); |
|
|
|
|
|
if (type == "other") { |
|
|
if (type == "other") { |
|
|
this.form.otherDept.splice(index, 1); |
|
|
this.form.otherDept.splice(index, 1); |
|
|
this.form.otherPrincipal.splice(index, 1); |
|
|
this.form.otherPrincipal.splice(index, 1); |
|
|
|
|
|
|
|
|
save() { |
|
|
save() { |
|
|
this.loading=true; |
|
|
this.loading=true; |
|
|
let form = JSON.parse(JSON.stringify(this.form)); |
|
|
let form = JSON.parse(JSON.stringify(this.form)); |
|
|
console.log(form); |
|
|
|
|
|
form.cooperateDept = form.cooperateDept && form.cooperateDept.join(","); |
|
|
form.cooperateDept = form.cooperateDept && form.cooperateDept.join(","); |
|
|
form.cooperatePrincipal = |
|
|
form.cooperatePrincipal = |
|
|
form.cooperatePrincipal && form.cooperatePrincipal.join(","); |
|
|
form.cooperatePrincipal && form.cooperatePrincipal.join(","); |