dedsudiyu 1 年之前
父節點
當前提交
fc2dab8dd9

+ 19 - 1
src/api/commonality/permission.js

@@ -242,7 +242,7 @@ export function systemUserResetPasswd(data) {
 }
 
 
-/*                      自定义用户查询
+/*                      自定义用户查询-不带分页
 * userType              0.系统用户 1.教职工 2.学生  (必传)
 * userName              用户名
 * mobile                手机号
@@ -260,6 +260,24 @@ export function systemUserSelect(data) {
   })
 }
 
+/*                      自定义用户查询-带分页
+* userType              0.系统用户 1.教职工 2.学生  (必传)
+* userName              用户名
+* mobile                手机号
+* cardNum               卡号
+* account               账号
+* userIds               指定用户IDS
+* selectedUserIds       过滤用户IDS
+* pageSize              不传默认返回10条
+*/
+export function systemUserSelectByPage(data) {
+  return request({
+    url: '/system/user/selectByPage',
+    method: 'post',
+    data: data
+  })
+}
+
 /*                自定义获取专业/班级下拉列表
 * type            1.专业 2.班级 (必传)
 * referId         父类ID(院系ID,专业ID)

+ 25 - 0
src/assets/styles/commonality.scss

@@ -262,6 +262,31 @@
     margin-left:-20px;
   }
 }
+.table-null-img-20{
+  .el-table__empty-text{
+    background-size: 20%!important;
+  }
+}
+.table-null-img-30{
+  .el-table__empty-text{
+    background-size: 30%!important;;
+  }
+}
+.table-null-img-40{
+  .el-table__empty-text{
+    background-size: 40%!important;;
+  }
+}
+.table-null-img-50{
+  .el-table__empty-text{
+    background-size: 50%!important;;
+  }
+}
+.table-null-img-60{
+  .el-table__empty-text{
+    background-size: 60%!important;;
+  }
+}
 //表格滚动条样式
 .el-table__body-wrapper::-webkit-scrollbar{
   width: 8px;     /*高宽分别对应横竖滚动条的尺寸*/

+ 5 - 0
src/views/integratedManagement/personnelManage/researchGroupManage/addPage.vue

@@ -169,6 +169,7 @@
 
     },
     methods:{
+      //初始化
       dataInitialization(){
         if(this.propsData.id){
           this.systemTopicDetail();
@@ -259,6 +260,10 @@
           }
         }
       },
+      //接受选中人员
+      setUserList(list){
+        this.$set(this.addForm,'memberList',list);
+      },
     },
   }
 </script>

+ 49 - 15
src/views/integratedManagement/personnelManage/researchGroupManage/userDialog.vue

@@ -46,7 +46,8 @@
             </el-form>
           </div>
           <div class="page-content-box">
-            <el-table class="table-box" border :data="leftDataList" @selection-change="userChangeLeft" :row-key="getRowKeys">
+            <el-table class="table-box table-null-img-20" border :data="leftDataList"  ref="leftTable"
+                      @selection-change="userChangeLeft" :row-key="getRowKeys">
               <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
               <el-table-column label="姓名" prop="userName"  show-overflow-tooltip/>
               <el-table-column label="联系电话" prop="mobile" width="150" show-overflow-tooltip/>
@@ -108,7 +109,8 @@
             </el-form>
           </div>
           <div class="page-content-box">
-            <el-table class="table-box" border :data="rightDataList" @selection-change="userChangeRight" :row-key="getRowKeys">
+            <el-table class="table-box table-null-img-20" border :data="rightDataList" ref="rightTable"
+                      @selection-change="userChangeRight" :row-key="getRowKeys">
               <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
               <el-table-column label="姓名" prop="userName"  show-overflow-tooltip/>
               <el-table-column label="联系电话" prop="mobile" width="150" show-overflow-tooltip/>
@@ -135,7 +137,7 @@
 </template>
 
 <script>
-  import { systemUserSelect,getDeptDropList } from "@/api/commonality/permission";
+  import { systemUserSelectByPage,getDeptDropList } from "@/api/commonality/permission";
   export default {
     name: 'addDialog',
     props:{
@@ -151,11 +153,9 @@
           pageSize:20,
           searchValue:'',
           deptId:'',
-          userType:'',
+          userType:'3',
         },
-        leftDataList:[
-          {userId:'1',name:'名称',phone:'电话',section:'部门1'}
-        ],
+        leftDataList:[],
         leftTotal:0,
         leftCheckNum:0,
         leftMaxUserNum:0,
@@ -168,9 +168,7 @@
           deptId:'',
           userType:'',
         },
-        rightDataList:[
-          {userId:'12',name:'名称',phone:'电话',section:'部门1'}
-        ],
+        rightDataList:[],
         rightTotal:0,
         rightCheckNum:0,
         rightMaxUserNum:0,
@@ -201,11 +199,34 @@
       },
       //新增用户
       userAdd(){
-        this.userList.push()
+        let self = this;
+        if(self.leftCheckUserIds[0]){
+          for(let i=0;i<self.leftCheckUserIds.length;i++){
+            self.userList.push(self.leftCheckUserIds[i])
+          }
+          this.$refs.leftTable.clearSelection()
+          this.$refs.rightTable.clearSelection()
+          this.leftGetList();
+          this.rightGetList();
+        }
       },
       //删除用户
       userDel(){
-
+        let self = this;
+        if(self.rightCheckUserIds[0]){
+          for(let i=0;i<self.rightCheckUserIds.length;i++){
+            for(let o=0;o<self.userList.length;o++){
+              if(self.rightCheckUserIds[i] == self.userList[o]){
+                self.userList.splice(o,1)
+                o--
+              }
+            }
+          }
+          this.$refs.leftTable.clearSelection()
+          this.$refs.rightTable.clearSelection()
+          this.leftGetList();
+          this.rightGetList();
+        }
       },
       //开启
       userDialogOpen(){
@@ -221,7 +242,16 @@
       },
       //提交
       dialogSubmit(){
-
+        let obj =  {
+          "account":"QW1",
+          "userId":"111",
+          "userName":"学生1",
+          "userPhone":"1555555",
+          "userType":2,
+          "deptId":"999",
+          "deptName":"部门1"
+        }
+        this.$parent.setUserList(this.userList)
       },
       //左侧查询相关
       leftHandleQuery(){
@@ -241,7 +271,9 @@
       leftGetList(){
         let obj = JSON.parse(JSON.stringify(this.leftQueryParams))
         obj.excludeUserIds = this.userList;
-        systemUserSelect(obj).then(response => {
+        systemUserSelectByPage(obj).then(response => {
+          this.$set(this,'leftCheckNum',0);
+          this.$set(this,'leftCheckUserIds',[]);
           this.$set(this,'leftDataList',response.data);
           // this.$set(this,'leftTotal',response.data.total);
         });
@@ -268,7 +300,9 @@
       rightGetList(){
         let obj = JSON.parse(JSON.stringify(this.rightQueryParams))
         obj.userIds = this.userList;
-        systemUserSelect(obj).then(response => {
+        systemUserSelectByPage(obj).then(response => {
+          this.$set(this,'rightCheckNum',0);
+          this.$set(this,'rightCheckUserIds',[]);
           this.$set(this,'rightDataList',response.data);
           // this.$set(this,'rightTotal',response.data.total);
         });