Przeglądaj źródła

提交创建项目的搜索

Lijy 2 lat temu
rodzic
commit
9f2ad3eb2f

+ 38 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -1034,6 +1034,12 @@
         <!-- 按部门选择人员 -->
         <el-dialog :title="$t('selectingParticipants')"  v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
             <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
+            <div v-if="user.userNameNeedTranslate == '1'">
+                <el-input placeholder="请输入内容" v-model.trim="wxFilterText" class="input-with-select">
+                    <el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
+                </el-input>
+            </div>
+            
             <div class="tree" style="height:400px">
                 <el-scrollbar style="height:100%">
                     <el-input
@@ -1328,7 +1334,8 @@ a {
                     children: 'children',
                     label: 'label'
                 },
-
+                
+                wxFilterText: '',
                 filterName:null,
                 chooseParticipVisible: false,
                 projectBaseCostData:[],
@@ -2647,6 +2654,7 @@ a {
                 this.chosenMembCount = this.participator.length;
                 this.chooseParticipVisible = true;
                 this.filterText = ''
+                this.wxFilterText = ''
             },
             onTreeItemChange() {
                 var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
@@ -2730,6 +2738,8 @@ a {
                         //设置员工到部门下面
                         this.setUserToDept(list);
                         this.deptMembData = list;
+                        console.log(this.deptMembData, '看看数据')
+                        
                         //用于筛选过滤
                         this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
                     } else {
@@ -2746,6 +2756,33 @@ a {
                     });
                 });
             },
+            // 企业微信搜索
+            echartDepartment() {
+                console.log('我点击了搜索')
+                this.http.post("/department/listAllMemb", {
+                    keyword: this.wxFilterText,
+                    cursor: ''
+                },
+                res => {
+                    if (res.code == "ok") {
+                        var list = res.data.data;
+                        this.setUserToDept(list);
+                        this.deptMembData = list;
+                        console.log(this.deptMembData, '数据也')
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
             
             setUserToDept(list) {
                 for (var i in list) {