This commit is contained in:
zhutianqi
2021-07-01 18:22:02 +08:00
parent 4c39fe0000
commit 6f5401258c
@@ -86,8 +86,7 @@
<el-card>
<h4>责任对接人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="user2" placeholder="选择责任人">
<el-input v-model="user2" placeholder="选择责任人" @click.native="choiceZRR">
</el-input>
</div>
</el-card>
@@ -161,7 +160,24 @@
@submit="handleSubmit"
>
</ProcessFooter>
<el-drawer
:title="drawerTitle"
:visible.sync="modalshowflag"
:wrapperClosable="false"
size="800px">
<el-tree
node-key="id"
class="filter-tree"
:data="treeData"
:props="defaultProps"
highlight-current
check-strictly
@check="drawerCheck"
default-expand-all
show-checkbox
ref="tree">
</el-tree>
</el-drawer>
</div>
</template>
@@ -174,6 +190,13 @@ export default {
name: "bzdyStep1",
data() {
return {
defaultProps: {
children: 'children',
label: 'name'
},
treeData: [], // 人员数据
modalshowflag: false, // drawer开关
drawerTitle: '', //drawer标题
textarea: '', // 意见
title: '', // 新增编辑抽屉标题
ListModel: false, // 新增编辑抽屉开关
@@ -204,6 +227,22 @@ export default {
ProcessTitle
},
methods: {
drawerCheck (data) {
var getlist = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
if(getlist.length == 1) {
}else {
this.$refs.tree.setCheckedKeys([data.id]);
}
},
choiceZRR () {
this.drawerTitle = '选择责任人'
this.modalshowflag = true
},
getTree () {
this.$http.get('SarInstitution/institution/institutionAndUser', {}, {}, res=> {
this.treeData = res.data
})
},
closeDrawer() {
this.ListModel = false
},
@@ -226,6 +265,7 @@ export default {
}
},
mounted () {
this.getTree()
}
}
</script>