|
@@ -1251,9 +1251,12 @@
|
|
|
<!-- 按部门选择人员 -->
|
|
|
<el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
<el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
|
|
|
+ <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
|
|
|
+ <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
|
|
|
+ </el-input>
|
|
|
<div class="tree" style="height:400px">
|
|
|
<el-scrollbar style="height:100%">
|
|
|
- <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
|
|
|
+ <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
|
|
|
ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
|
|
|
highlight-current :filter-node-method="filterNode">
|
|
|
<span class="custom-tree-node" slot-scope="{ node }">
|
|
@@ -1268,6 +1271,7 @@
|
|
|
<span v-if="user.userNameNeedTranslate != '1'">
|
|
|
{{ node.label }}
|
|
|
</span>
|
|
|
+ <!-- {{ node.label }} -->
|
|
|
</span>
|
|
|
</el-tree>
|
|
|
</el-scrollbar>
|
|
@@ -2207,6 +2211,10 @@
|
|
|
weekIndex: 1,
|
|
|
weekParentData: {},
|
|
|
deptIdForNoReport:[],
|
|
|
+
|
|
|
+ nameAearch: '', // 企业微信姓名搜索
|
|
|
+ deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
|
|
|
+ deptMembDataLoading: false
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -4622,6 +4630,8 @@
|
|
|
}
|
|
|
this.setUserToDept(noAllData);
|
|
|
this.deptMembData = noAllData;
|
|
|
+ this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
|
|
|
+ console.log(this.deptMembData, '代填人员数据')
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -7610,6 +7620,70 @@
|
|
|
this.getDepartment();
|
|
|
this.getRecentlyProject()
|
|
|
},
|
|
|
+ // 待填日报姓名搜索
|
|
|
+ nameAearchSeek(flg) {
|
|
|
+ if(!this.nameAearch) {
|
|
|
+ this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(flg) {
|
|
|
+ this.enterpriseWechatgetUser()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleThreeData(userList) {
|
|
|
+ console.log(userList, '人员数据')
|
|
|
+ let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
|
|
|
+ this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
|
|
|
+ },
|
|
|
+ // 过滤树节点
|
|
|
+ filterTreeNodes(treeData, filterKeywords) {
|
|
|
+ return treeData.filter((node) => {
|
|
|
+ if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
|
|
|
+ if (node.children && node.children.length > 0) {
|
|
|
+ node.children = this.filterTreeNodes(node.children, filterKeywords);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (node.children && node.children.length > 0) {
|
|
|
+ node.children = this.filterTreeNodes(node.children, filterKeywords);
|
|
|
+ return node.children.length > 0;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 企业微信获取人员
|
|
|
+ enterpriseWechatgetUser() {
|
|
|
+ this.deptMembDataLoading = true
|
|
|
+ this.http.post('/user/getEmployeeList',{
|
|
|
+ departmentId: -1,
|
|
|
+ pageIndex: 1,
|
|
|
+ pageSize: 100,
|
|
|
+ keyword: this.nameAearch,
|
|
|
+ status: '',
|
|
|
+ roleId: '',
|
|
|
+ cursor: '',
|
|
|
+ onlyDirect: '',
|
|
|
+ matchingType: ''
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.deptMembDataLoading = false
|
|
|
+ const userListName = res.data.records.map(item => item.name)
|
|
|
+ this.handleThreeData(userListName)
|
|
|
+ }else{
|
|
|
+ this.deptMembDataLoading = false
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },err => {
|
|
|
+ this.deptMembDataLoading = false
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 自定义事件
|
|
|
selectCal(obj) {
|
|
|
console.log(obj, '传数据来源')
|