소스 검색

修改系统管理-员工管理-查或绑定企微多选人并提交

Guos 1 주 전
부모
커밋
ed4f82b0e5
3개의 변경된 파일249개의 추가작업 그리고 46개의 파일을 삭제
  1. 4 9
      src/views/company/companyUser/index.vue
  2. 61 37
      src/views/company/components/selectQwUser.vue
  3. 184 0
      src/views/company/components/selectQwUserOlder.vue

+ 4 - 9
src/views/company/companyUser/index.vue

@@ -2,7 +2,7 @@
   <div class="app-container">
     <el-row :gutter="20">
       <!--部门数据-->
-      <el-col :span="4" :xs="24">
+      <el-col :span="2" :xs="24">
         <div class="head-container">
           <el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" style="margin-bottom: 20px" />
         </div>
@@ -11,7 +11,7 @@
         </div>
       </el-col>
       <!--用户数据-->
-      <el-col :span="20" :xs="24">
+      <el-col :span="22" :xs="24">
         <el-form  :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
           <el-form-item label="员工后台昵称" prop="nickName">
             <el-input v-model="queryParams.nickName" placeholder="请输入员工后台昵称" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
@@ -240,14 +240,13 @@
         <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
       </el-col>
     </el-row>
+<!--当点击查或换绑微信时候弹出此框-->
     <el-dialog title="绑定企微账号"  :visible.sync="qwOpen" width="800px" append-to-body >
-
       <el-form ref="form" :model="form"  label-width="80px" >
         <el-form-item label="查询"  prop="companyUserId">
           <el-button type="primary" icon="el-icon-search"  @click="selectQwUser()"  size="mini">搜索账号</el-button>
         </el-form-item>
         <el-form-item label="企微账号"  prop="companyUserId">
-
           <el-tag
             style="margin-left: 5px"
             size="medium"
@@ -260,15 +259,14 @@
             </span>
           </el-tag>
         </el-form-item>
-
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="qwSubmitForm">绑 定</el-button>
         <el-button @click="qwCancel">取 消</el-button>
       </div>
     </el-dialog>
-    <el-dialog title="选择企微主体" :visible.sync="synOpen" width="800px" append-to-body>
 
+    <el-dialog title="选择企微主体" :visible.sync="synOpen" width="800px" append-to-body>
       <el-form   label-width="80px">
         <el-form-item label="企微公司" prop="corpId">
           <el-select v-model="synform.corpId" placeholder="企微公司"  >
@@ -280,8 +278,6 @@
             />
           </el-select>
         </el-form-item>
-
-
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="synSubmitForm">确 定</el-button>
@@ -290,7 +286,6 @@
     </el-dialog>
 
     <el-dialog title="选择企微主体" :visible.sync="synNameOpen" width="800px" append-to-body>
-
       <el-form   label-width="80px">
         <el-form-item label="企微公司" prop="corpId">
           <el-select v-model="synNameform.corpId" placeholder="企微公司"  >

+ 61 - 37
src/views/company/components/selectQwUser.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <!-- 现有表单内容保持不变 -->
       <el-form-item label="企微主体" prop="corpId">
         <el-select v-model="queryParams.corpId" placeholder="企微主体" size="small" @change="updateCorpId()">
           <el-option
@@ -36,27 +37,32 @@
       </el-form-item>
     </el-form>
 
-    <el-table  height="500" border v-loading="loading" :data="customerList" ref="customerList" >
-       <el-table-column label="企微昵称" align="center" prop="qwUserName" />
+    <el-table
+      height="500"
+      border
+      v-loading="loading"
+      :data="customerList"
+      ref="customerList"
+      @selection-change="handleSelectionChange"
+    >
+      <!-- 添加多选列 -->
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="企微昵称" align="center" prop="qwUserName" />
       <el-table-column label="企微账号" align="center" prop="qwUserId" />
       <el-table-column label="企微所属部门" align="center" prop="departmentName" />
-	  <el-table-column label="状态" align="center" prop="status" >
-	    <template slot-scope="scope">
-	      <dict-tag :options="qwStatusOptions" :value="scope.row.status"/>
-	    </template>
-	   </el-table-column>
-      <el-table-column label="企微主体" align="center" prop="corpName" />
-      <el-table-column label="操作"   align="center" fixed="right" width="100px" class-name="small-padding fixed-width">
+      <el-table-column label="状态" align="center" prop="status" >
         <template slot-scope="scope">
-          <el-button
-            size="medium"
-            type="primary"
-            plain
-            @click="handleBind(scope.row)"
-          >选择</el-button>
+          <dict-tag :options="qwStatusOptions" :value="scope.row.status"/>
         </template>
       </el-table-column>
+      <el-table-column label="企微主体" align="center" prop="corpName" />
     </el-table>
+
+    <div style="margin-top: 10px; text-align: right;">
+      <el-button type="primary" @click="handleBatchBind">确定</el-button>
+      <el-button @click="cancelSelect">取消</el-button>
+    </div>
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -64,8 +70,6 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
-
-
   </div>
 </template>
 
@@ -80,7 +84,7 @@ export default {
       // 遮罩层
       loading: true,
       myQwCompanyList:[],
-	  qwStatusOptions:[],
+      qwStatusOptions:[],
       // 显示搜索条件
       showSearch: true,
       // 总条数
@@ -100,29 +104,29 @@ export default {
         qwUserName: null,
       },
       // 表单参数
-      form: {
-      },
+      form: {},
       // 表单校验
-      rules: {
-      },
+      rules: {},
+      // 多选数据
+      selectedUsers: []
     };
   },
   created() {
-	  this.getDicts("sys_qw_user_status").then(response => {
-	        this.qwStatusOptions = response.data;
-	  });
+    this.getDicts("sys_qw_user_status").then(response => {
+      this.qwStatusOptions = response.data;
+    });
     getMyQwCompanyList().then(response => {
-           this.myQwCompanyList = response.data;
-           if(this.myQwCompanyList!=null){
-             this.queryParams.corpId=this.myQwCompanyList[0].dictValue
-             this.getList();
-           }
+      this.myQwCompanyList = response.data;
+      if(this.myQwCompanyList!=null){
+        this.queryParams.corpId=this.myQwCompanyList[0].dictValue
+        this.getList();
+      }
     });
   },
   methods: {
     updateCorpId(){
-           this.getList();
-     },
+      this.getList();
+    },
     /** 查询客户列表 */
     getList() {
       this.loading = true;
@@ -134,13 +138,34 @@ export default {
       });
     },
 
-    //绑定选择
-    handleBind(row){
+    // 多选处理
+    handleSelectionChange(selection) {
+      this.selectedUsers = selection;
+    },
+
+    // 批量绑定选择
+    handleBatchBind() {
+      if (this.selectedUsers.length === 0) {
+        this.$message.warning("请至少选择一个用户");
+        return;
+      }
+
+      // 发送所有选中的用户数据
+      this.selectedUsers.forEach(user => {
+        this.$emit("bindQwUser", user);
+      });
 
-      this.$emit("bindQwUser",row)
+      // 清空选择
       this.resetQuery();
       this.$refs.customerList.clearSelection();
     },
+
+    // 取消选择
+    cancelSelect() {
+      this.$refs.customerList.clearSelection();
+      this.selectedUsers = [];
+    },
+
     // 取消按钮
     cancel() {
       this.open = false;
@@ -149,7 +174,6 @@ export default {
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
-
       this.getList();
     },
     /** 重置按钮操作 */
@@ -158,10 +182,10 @@ export default {
       this.queryParams.corpId= this.myQwCompanyList[0].dictValue;
       this.handleQuery();
     },
-
   }
 };
 </script>
+
 <style>
   .el-tag + .el-tag {
     margin-left: 10px;

+ 184 - 0
src/views/company/components/selectQwUserOlder.vue

@@ -0,0 +1,184 @@
+<!--<template>-->
+<!--  <div class="app-container">-->
+<!--    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">-->
+<!--      <el-form-item label="企微主体" prop="corpId">-->
+<!--        <el-select v-model="queryParams.corpId" placeholder="企微主体" size="small" @change="updateCorpId()">-->
+<!--          <el-option-->
+<!--            v-for="dict in myQwCompanyList"-->
+<!--            :key="dict.dictValue"-->
+<!--            :label="dict.dictLabel"-->
+<!--            :value="dict.dictValue"-->
+<!--          />-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+<!--      <el-form-item label="企微账号" prop="qwUserId">-->
+<!--        <el-input-->
+<!--          v-model="queryParams.qwUserId"-->
+<!--          placeholder="请输入企微账号"-->
+<!--          clearable-->
+<!--          size="small"-->
+<!--          @keyup.enter.native="handleQuery"-->
+<!--        />-->
+<!--      </el-form-item>-->
+
+<!--      <el-form-item label="企微昵称" prop="qwUserName">-->
+<!--        <el-input-->
+<!--          v-model="queryParams.qwUserName"-->
+<!--          placeholder="请输入企微昵称"-->
+<!--          clearable-->
+<!--          size="small"-->
+<!--          @keyup.enter.native="handleQuery"-->
+<!--        />-->
+<!--      </el-form-item>-->
+<!--      <el-form-item>-->
+<!--        <el-button type="cyan" 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  height="500" border v-loading="loading" :data="customerList" ref="customerList" >-->
+<!--       <el-table-column label="企微昵称" align="center" prop="qwUserName" />-->
+<!--      <el-table-column label="企微账号" align="center" prop="qwUserId" />-->
+<!--      <el-table-column label="企微所属部门" align="center" prop="departmentName" />-->
+<!--	  <el-table-column label="状态" align="center" prop="status" >-->
+<!--	    <template slot-scope="scope">-->
+<!--	      <dict-tag :options="qwStatusOptions" :value="scope.row.status"/>-->
+<!--	    </template>-->
+<!--	   </el-table-column>-->
+<!--      <el-table-column label="企微主体" align="center" prop="corpName" />-->
+<!--      <el-table-column label="操作"   align="center" fixed="right" width="100px" class-name="small-padding fixed-width">-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-button-->
+<!--            size="medium"-->
+<!--            type="primary"-->
+<!--            plain-->
+<!--            @click="handleBind(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="getList"-->
+<!--    />-->
+
+
+<!--  </div>-->
+<!--</template>-->
+
+<!--<script>-->
+<!--import { userList,listUser, getUser, delUser, addUser, updateUser, exportUser, updateUserWeclome,getMyQwCompanyList,getMyQwUserList,relieveFastGptRoleById,staffListUser } from '@/api/qw/user'-->
+
+<!--export default {-->
+<!--  name: "miniCustomer",-->
+<!--  components: {},-->
+<!--  data() {-->
+<!--    return {-->
+<!--      // 遮罩层-->
+<!--      loading: true,-->
+<!--      myQwCompanyList:[],-->
+<!--	  qwStatusOptions:[],-->
+<!--      // 显示搜索条件-->
+<!--      showSearch: true,-->
+<!--      // 总条数-->
+<!--      total: 0,-->
+<!--      // 员工表格数据-->
+<!--      customerList: [],-->
+<!--      // 弹出层标题-->
+<!--      title: "",-->
+<!--      // 是否显示弹出层-->
+<!--      open: false,-->
+<!--      // 查询参数-->
+<!--      queryParams: {-->
+<!--        pageNum: 1,-->
+<!--        pageSize: 10,-->
+<!--        qwUserId: null,-->
+<!--        corpId: null,-->
+<!--        qwUserName: null,-->
+<!--      },-->
+<!--      // 表单参数-->
+<!--      form: {-->
+<!--      },-->
+<!--      // 表单校验-->
+<!--      rules: {-->
+<!--      },-->
+<!--    };-->
+<!--  },-->
+<!--  created() {-->
+<!--	  this.getDicts("sys_qw_user_status").then(response => {-->
+<!--	        this.qwStatusOptions = response.data;-->
+<!--	  });-->
+<!--    getMyQwCompanyList().then(response => {-->
+<!--           this.myQwCompanyList = response.data;-->
+<!--           if(this.myQwCompanyList!=null){-->
+<!--             this.queryParams.corpId=this.myQwCompanyList[0].dictValue-->
+<!--             this.getList();-->
+<!--           }-->
+<!--    });-->
+<!--  },-->
+<!--  methods: {-->
+<!--    updateCorpId(){-->
+<!--           this.getList();-->
+<!--     },-->
+<!--    /** 查询客户列表 */-->
+<!--    getList() {-->
+<!--      this.loading = true;-->
+
+<!--      userList(this.queryParams).then(response => {-->
+<!--        this.customerList = response.rows;-->
+<!--        this.total = response.total;-->
+<!--        this.loading = false;-->
+<!--      });-->
+<!--    },-->
+
+<!--    //绑定选择-->
+<!--    handleBind(row){-->
+
+<!--      this.$emit("bindQwUser",row)-->
+<!--      this.resetQuery();-->
+<!--      this.$refs.customerList.clearSelection();-->
+<!--    },-->
+<!--    // 取消按钮-->
+<!--    cancel() {-->
+<!--      this.open = false;-->
+<!--      this.reset();-->
+<!--    },-->
+<!--    /** 搜索按钮操作 */-->
+<!--    handleQuery() {-->
+<!--      this.queryParams.pageNum = 1;-->
+
+<!--      this.getList();-->
+<!--    },-->
+<!--    /** 重置按钮操作 */-->
+<!--    resetQuery() {-->
+<!--      this.resetForm("queryForm");-->
+<!--      this.queryParams.corpId= this.myQwCompanyList[0].dictValue;-->
+<!--      this.handleQuery();-->
+<!--    },-->
+
+<!--  }-->
+<!--};-->
+<!--</script>-->
+<!--<style>-->
+<!--  .el-tag + .el-tag {-->
+<!--    margin-left: 10px;-->
+<!--  }-->
+<!--  .button-new-tag {-->
+<!--    margin-left: 10px;-->
+<!--    height: 32px;-->
+<!--    line-height: 30px;-->
+<!--    padding-top: 0;-->
+<!--    padding-bottom: 0;-->
+<!--  }-->
+<!--  .input-new-tag {-->
+<!--    width: 90px;-->
+<!--    margin-left: 10px;-->
+<!--    vertical-align: bottom;-->
+<!--  }-->
+<!--  .el-dialog__wrapper{-->
+<!--    z-index: 100000;-->
+<!--  }-->
+<!--</style>-->