|
|
@@ -34,7 +34,7 @@
|
|
|
@click="newGroupViewBackCli(true, groupView)"><van-icon name="arrow-left" />返回</div>
|
|
|
<div class="treeBox_tree">
|
|
|
<el-tree ref="tree" v-model="treeVal" show-checkbox node-key="id" :data="personnelTree" :props="defaultProps"
|
|
|
- :filter-node-method="filterNode">
|
|
|
+ :filter-node-method="filterNode" @check-change="handleCheckChange">
|
|
|
<span class="custom-tree-node" slot-scope="{ node }">
|
|
|
<span>
|
|
|
{{ node.label }}
|
|
|
@@ -100,6 +100,17 @@ export default {
|
|
|
type: Boolean,
|
|
|
default:()=> true,
|
|
|
},
|
|
|
+ //仅在加班页面调用时使用
|
|
|
+ IsOverTime:{
|
|
|
+ type: Boolean,
|
|
|
+ default:()=> false,
|
|
|
+ },
|
|
|
+ deptIdTree: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
components: {},
|
|
|
data() {
|
|
|
@@ -141,11 +152,16 @@ export default {
|
|
|
} else if (this.groupView == 2) {
|
|
|
this.groupVal = newPpeopleListId
|
|
|
} else if (this.groupView == 3) {
|
|
|
- // tree 额外处理
|
|
|
- console.log('tree 额外处理')
|
|
|
+ this.groupVal = newPpeopleListId
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.groupVal)
|
|
|
+ console.log("====================" + this.groupView)
|
|
|
+ if (this.groupView == 3 && this.IsOverTime) {
|
|
|
+ let newDeptIdTree = JSON.parse(JSON.stringify(this.deptIdTree))
|
|
|
+ this.setUserToDept(newDeptIdTree)
|
|
|
+ this.personnelTree = JSON.parse(JSON.stringify(newDeptIdTree))
|
|
|
+ }
|
|
|
if (this.peopleList.length <= 0) {
|
|
|
this.getPeople()
|
|
|
}
|
|
|
@@ -168,6 +184,9 @@ export default {
|
|
|
if (!value) return true;
|
|
|
return data.label.indexOf(value) !== -1;
|
|
|
},
|
|
|
+ handleCheckChange() {
|
|
|
+ this.treeVal = this.$refs.tree.getCheckedKeys()
|
|
|
+ },
|
|
|
newGroupViewBackCli(flg, i) {
|
|
|
this.newGroupViewBack = flg
|
|
|
if(this.type != 1) {
|
|
|
@@ -215,7 +234,12 @@ export default {
|
|
|
this.setUserToDept(res.data)
|
|
|
this.personnelTree = list
|
|
|
this.newPersonnelTree = JSON.parse(JSON.stringify(list))
|
|
|
- console.log(this.personnelTree)
|
|
|
+
|
|
|
+ if (this.IsOverTime) {
|
|
|
+ let newDeptIdTree = JSON.parse(JSON.stringify(this.deptIdTree))
|
|
|
+ this.setUserToDept(newDeptIdTree)
|
|
|
+ this.personnelTree = JSON.parse(JSON.stringify(newDeptIdTree))
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$toast.clear();
|
|
|
this.$toast.fail(res.msg);
|
|
|
@@ -243,6 +267,8 @@ export default {
|
|
|
// 单选和复选点击确定触发的事件
|
|
|
handClick() {
|
|
|
let arr = this.groupView == 1 ? [this.radioVal] : this.groupVal
|
|
|
+ arr = this.groupView == 3 ? this.treeVal : arr
|
|
|
+ console.log(arr)
|
|
|
let newArr = this.personnelList.filter(item => {
|
|
|
return arr.includes(item.id)
|
|
|
})
|
|
|
@@ -250,6 +276,7 @@ export default {
|
|
|
// return
|
|
|
this.loadingBtn = true
|
|
|
this.$emit('ChooseSomeoneChanhe', newArr)
|
|
|
+ this.loadingBtn = false
|
|
|
},
|
|
|
treeHandClick() {
|
|
|
if(this.newGroupView == 3) {
|