|
|
@@ -20,7 +20,28 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
|
|
|
+ <el-form-item label="企微员工昵称" prop="qwUserName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.qwUserName"
|
|
|
+ placeholder="请输入企微员工昵称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keydown.enter.native="handleQueryEnter"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="企微员工部门" prop="deptName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.deptName"
|
|
|
+ placeholder="请输入企微员工部门"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keydown.enter.native="handleQueryEnter"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item>
|
|
|
+ <el-button type="danger" icon="el-icon-circle-check" size="mini" @click="handleAddAllQwDept">快捷添加企微部门员工</el-button>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">刷新/重置</el-button>
|
|
|
</el-form-item>
|
|
|
@@ -39,18 +60,64 @@
|
|
|
<el-button type="warning" icon="el-icon-search" @click="confirmSelect">确定选择</el-button>
|
|
|
</div>
|
|
|
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="handlePaginationChange"
|
|
|
- />
|
|
|
+ <el-dialog title="快捷部门选择" :visible.sync="handleAddAllQwDeptOpen" width="700px" append-to-body >
|
|
|
+
|
|
|
+ <el-form :model="queryParamsDept" ref="queryFormDept" :inline="true" v-show="showSearch" label-width="100px" @submit.prevent="handleQueryDept">
|
|
|
+
|
|
|
+ <el-form-item label="部门昵称" prop="deptName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParamsDept.deptName"
|
|
|
+ placeholder="请输入部门昵称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryDept">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQueryDept">刷新/重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-table border v-loading="loading" :data="deptList" @selection-change="handleSelectionChangeDept">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="部门id" align="center" prop="id" width="160"/>
|
|
|
+ <el-table-column label="部门编号" align="center" prop="deptId" width="160"/>
|
|
|
+ <el-table-column label="部门名称" align="center" prop="deptName" width="150"/>
|
|
|
+ <el-table-column label="操作" align="center" width="100px" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ style="color: blue;"
|
|
|
+ @click="handleChangeDept(scope.row)"
|
|
|
+ v-hasPermi="['qw:sop:remove']"
|
|
|
+ >选择此部门
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <div style="margin-top: 30px;display: flex;justify-content: center">
|
|
|
+ <el-button type="warning" icon="el-icon-search" @click="confirmSelectDept">确定选择</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="totalDept>0"
|
|
|
+ :total="totalDept"
|
|
|
+ :page.sync="queryParamsDept.pageNum"
|
|
|
+ :limit.sync="queryParamsDept.pageSize"
|
|
|
+ @pagination="getDeptList"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { listUser, getUser, delUser, addUser, updateUser, exportUser } from "@/api/qw/user";
|
|
|
+import {listQwDept} from "../../../api/qw/qwDept";
|
|
|
+import {getQwUserByDept} from "../../../api/qw/user";
|
|
|
|
|
|
|
|
|
export default {
|
|
|
@@ -65,6 +132,7 @@ export default {
|
|
|
exportLoading: false,
|
|
|
// 选中数组
|
|
|
selectUsers: [],
|
|
|
+ selectDeptList: [],
|
|
|
// 非单个禁用
|
|
|
single: true,
|
|
|
// 非多个禁用
|
|
|
@@ -73,6 +141,7 @@ export default {
|
|
|
showSearch: true,
|
|
|
// 总条数
|
|
|
total: 0,
|
|
|
+ totalDept: 0,
|
|
|
// 企微用户表格数据
|
|
|
userList: [],
|
|
|
// 弹出层标题
|
|
|
@@ -87,8 +156,18 @@ export default {
|
|
|
companyId: null,
|
|
|
companyUserId: null,
|
|
|
corpId: null,
|
|
|
- nickName: null
|
|
|
+ nickName: null,
|
|
|
+ deptName: null,
|
|
|
+ qwUserName: null
|
|
|
},
|
|
|
+ queryParamsDept:{
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ corpId:null,
|
|
|
+ deptName:null,
|
|
|
+ },
|
|
|
+ handleAddAllQwDeptOpen:false,
|
|
|
+ deptList:null,
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
|
|
|
@@ -151,6 +230,23 @@ export default {
|
|
|
this.$emit("selectUserList",this.selectUsers);
|
|
|
this.resetSelect();
|
|
|
},
|
|
|
+
|
|
|
+ confirmSelectDept(){
|
|
|
+
|
|
|
+ getQwUserByDept({ deptIds: this.selectDeptList,corpId:row.corpId}).then(response => {
|
|
|
+ // 合并responseIds到selectUsers并去重
|
|
|
+ this.selectUsers=response.data
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.handleAddAllQwDeptOpen=false;
|
|
|
+ this.$emit("selectUserList",this.selectUsers);
|
|
|
+ this.resetSelect();
|
|
|
+ }, 200);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
//重置选择
|
|
|
resetSelect(){
|
|
|
this.$refs.userList.clearSelection();
|
|
|
@@ -164,7 +260,9 @@ export default {
|
|
|
companyId: null,
|
|
|
companyUserId: null,
|
|
|
corpId: null,
|
|
|
- nickName: null
|
|
|
+ nickName: null,
|
|
|
+ deptName: null,
|
|
|
+ qwUserName:null
|
|
|
},
|
|
|
this.getList();
|
|
|
},
|
|
|
@@ -173,6 +271,27 @@ export default {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ handleQueryDept() {
|
|
|
+ this.queryParamsDept.pageNum = 1;
|
|
|
+ this.getDeptList();
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ handleAddAllQwDept(){
|
|
|
+
|
|
|
+ this.getDeptList()
|
|
|
+ this.handleAddAllQwDeptOpen = true;
|
|
|
+ },
|
|
|
+
|
|
|
+ getDeptList(){
|
|
|
+ this.queryParamsDept.corpId=this.queryParams.corpId;
|
|
|
+ listQwDept(this.queryParamsDept).then(res=>{
|
|
|
+ this.deptList=res.rows;
|
|
|
+ this.totalDept = res.total;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
handleQueryEnter(event){
|
|
|
// 确保事件对象存在
|
|
|
if (event && event.preventDefault) {
|
|
|
@@ -185,6 +304,38 @@ export default {
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQueryDept() {
|
|
|
+ this.resetForm("queryFormDept");
|
|
|
+ this.handleQueryDept();
|
|
|
+ },
|
|
|
+
|
|
|
+ handleChangeDept(row){
|
|
|
+
|
|
|
+ getQwUserByDept({ deptIds: [row.deptId],corpId:row.corpId}).then(response => {
|
|
|
+
|
|
|
+ // 合并responseIds到selectUsers并去重
|
|
|
+ this.selectUsers=response.data
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.handleAddAllQwDeptOpen=false;
|
|
|
+ this.$emit("selectUserList",this.selectUsers);
|
|
|
+ this.resetSelect();
|
|
|
+ }, 200);
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSelectionChangeDept(selection){
|
|
|
+
|
|
|
+ // 合并选中项
|
|
|
+ this.selectDeptList =selection.map(item => item.deptId)
|
|
|
+
|
|
|
+ // 更新 single 和 multiple
|
|
|
+ this.single = this.selectDeptList.length !== 1;
|
|
|
+ this.multiple = !this.selectDeptList.length;
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|