This commit is contained in:
zhutianqi
2021-07-01 18:22:02 +08:00
parent 4c39fe0000
commit 6f5401258c
@@ -86,8 +86,7 @@
<el-card> <el-card>
<h4>责任对接人</h4> <h4>责任对接人</h4>
<div style="margin-top: 10px;width: 300px;"> <div style="margin-top: 10px;width: 300px;">
<el-input v-model="user2" placeholder="选择责任人"> <el-input v-model="user2" placeholder="选择责任人" @click.native="choiceZRR">
</el-input> </el-input>
</div> </div>
</el-card> </el-card>
@@ -161,7 +160,24 @@
@submit="handleSubmit" @submit="handleSubmit"
> >
</ProcessFooter> </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> </div>
</template> </template>
@@ -174,6 +190,13 @@ export default {
name: "bzdyStep1", name: "bzdyStep1",
data() { data() {
return { return {
defaultProps: {
children: 'children',
label: 'name'
},
treeData: [], // 人员数据
modalshowflag: false, // drawer开关
drawerTitle: '', //drawer标题
textarea: '', // 意见 textarea: '', // 意见
title: '', // 新增编辑抽屉标题 title: '', // 新增编辑抽屉标题
ListModel: false, // 新增编辑抽屉开关 ListModel: false, // 新增编辑抽屉开关
@@ -204,6 +227,22 @@ export default {
ProcessTitle ProcessTitle
}, },
methods: { 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() { closeDrawer() {
this.ListModel = false this.ListModel = false
}, },
@@ -226,6 +265,7 @@ export default {
} }
}, },
mounted () { mounted () {
this.getTree()
} }
} }
</script> </script>