| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
- <el-form-item label="销售公司" prop="companyId">
- <el-select v-model="queryParams.companyId" placeholder="销售公司" size="small">
- <el-option
- v-for="dict in companyList"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="员工昵称" prop="nickName">
- <el-input
- v-model="queryParams.nickName"
- placeholder="请输入员工昵称"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item>
- <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>
- </el-form>
- <el-table v-loading="loading" :data="userList" ref="userList" border>
- <el-table-column label="归属销售公司" align="center" prop="companyName" />
- <el-table-column label="企微员工账号" align="center" prop="qwUserId" />
- <el-table-column label="员工昵称" align="center" prop="qwUserName" />
- <el-table-column label="员工部门" align="center" prop="departmentName" />
- <el-table-column label="员工昵称" align="center" prop="nickName"/>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" >
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleSelectionChange(scope.row)"
- >选择此人</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="handlePaginationChange"
- />
- </div>
- </template>
- <script>
- import { companyQwUserlist, listUser } from '@/api/qw/user'
- import { getCompanyListByCorId } from '@/api/company/company'
- export default {
- name: "companyTransferQwUserSelect",
- data() {
- return {
- // 遮罩层
- loading: false,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 企微用户表格数据
- userList: [],
- companyList: [],
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- companyId: null,
- corpId: null,
- nickName: null
- },
- };
- },
- methods: {
- load(corpId, companyId) {
- getCompanyListByCorId(corpId).then(response => {
- this.companyList = response.data.filter(item => item.dictValue !== companyId)
- if (!Array.isArray(this.companyList) || this.companyList.length === 0) {
- this.userList = []
- return
- }
- this.queryParams.corpId = corpId;
- this.queryParams.companyId = this.companyList[0].dictValue;
- this.handleQuery();
- })
- },
- /** 查询企微用户列表 */
- getList() {
- this.loading = true;
- companyQwUserlist(this.queryParams).then(response => {
- this.userList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- handlePaginationChange(row) {
- this.queryParams.pageNum = row.page;
- this.queryParams.pageSize = row.limit;
- this.getList();
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- if (!Array.isArray(this.companyList) || this.companyList.length === 0) {
- this.userList = []
- return
- }
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- if (!Array.isArray(this.companyList) || this.companyList.length === 0) {
- return
- }
- this.queryParams.companyId = this.companyList[0].dictValue;
- this.handleQuery();
- },
- // 选中数据
- handleSelectionChange(selection) {
- this.$emit("selectUser",selection);
- },
- }
- };
- </script>
|