From 4d9a35462803c7392dedca8d95fe21ff3d949466 Mon Sep 17 00:00:00 2001
From: “dzb” <2632970487@qq.com>
Date: 星期一, 03 十月 2022 08:42:36 +0800
Subject: [PATCH] 用户、角色、部门,新增批量操作,案件池详情展示、以及调度

---
 src/views/systemSetting/baseSetting/user/components/main/index.vue |  141 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 112 insertions(+), 29 deletions(-)

diff --git a/src/views/systemSetting/baseSetting/user/components/main/index.vue b/src/views/systemSetting/baseSetting/user/components/main/index.vue
index cfc5c00..cdf66b5 100644
--- a/src/views/systemSetting/baseSetting/user/components/main/index.vue
+++ b/src/views/systemSetting/baseSetting/user/components/main/index.vue
@@ -4,7 +4,8 @@
             <!-- 鏁版嵁灞曠ず -->
             <el-table ref="multipleTable"
                 :header-cell-style="{background:'#06122c','font-size':'12px',color:'#4b9bb7','font-weight':'650','line-height':'45px'}"
-                :data="tableData" style="width: 100%" :row-class-name="tableRowClassName" @selection-change="tableChange">
+                :data="tableData" style="width: 100%" :row-class-name="tableRowClassName"
+                @selection-change="tableChange">
                 <el-table-column type="selection" min-width="5">
                 </el-table-column>
                 <el-table-column label="鐢ㄦ埛ID" min-width="4">
@@ -69,8 +70,8 @@
                     </div>
                     <div class="funsItem">
                         <el-select v-model="myIdx" placeholder="鎵归噺鎿嶄綔" @change="selectChange">
-                            <el-option v-for="item in options" :key="item.value" :label="item.label"
-                                :value="item.value" :disabled="item.disabled">
+                            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"
+                                :disabled="item.disabled">
                             </el-option>
                         </el-select>
                     </div>
@@ -91,7 +92,7 @@
 import MyPwd from '../password'
 export default {
     components: {
-        updateUser,MyPwd
+        updateUser, MyPwd
     },
     data() {
         return {
@@ -111,44 +112,118 @@
             },
             all: false,
             unsame: false,
-            myIdx:0,
-            options:[
+            myIdx: 0,
+            preMyIdx: 0,
+            options: [
                 {
-                    value:0,
-                    label:'鎵归噺鎿嶄綔',
-                    disabled:true,
+                    value: 0,
+                    label: '鎵归噺鎿嶄綔',
+                    disabled: true,
                 },
                 {
-                    value:1,
-                    label:'鎵归噺鍚敤',
+                    value: 1,
+                    label: '鎵归噺鍚敤',
                 },
                 {
-                    value:2,
-                    label:'鎵归噺绂佺敤',
+                    value: 2,
+                    label: '鎵归噺绂佺敤',
                 },
                 {
-                    value:3,
-                    label:'鎵归噺鍒犻櫎',
+                    value: 3,
+                    label: '鎵归噺鍒犻櫎',
                 }
             ],
-            tempList:[]
+            tempList: []
         }
     },
     created() {
         this.getUserList();
     },
     methods: {
-        selectChange(list){
-            console.log(list);
+        async selectChange(list) {
             console.log(this.tempList);
+            if (this.tempList.length !== 0) {
+                this.preMyIdx = list;
+                if (list === 3) {
+                    await this.mulDelte(this.tempList);
+                } else if (list === 2) {
+                    await this.mulUpdateStatus(this.tempList,0);
+                } else {
+                    await this.mulUpdateStatus(this.tempList,1);
+                }
+                this.myIdx = 0;
+            } else {
+                this.myIdx = this.preMyIdx;
+                this.$message({
+                    type: 'warning',
+                    message: '鎮ㄨ繕娌¢�変腑浠讳綍鏁版嵁',
+                })
+            }
         },
-        tableChange(list){
-            this.tempList = list;
-            if(list.length===this.tableData.length){
+        tableChange(list) {
+            this.tempList = [];
+            list.forEach(item => {
+                this.tempList.push(item.id);
+            })
+            if (list.length === this.tableData.length) {
                 this.all = true;
-            }else{
+            } else {
                 this.all = false
             }
+        },
+        // 鎵归噺鍒犻櫎鐢ㄦ埛淇℃伅
+        mulDelte(idArr) {
+            console.log(idArr);
+            this.$confirm("鎮ㄧ‘瀹氳杩涜鎵归噺鍒犻櫎鐢ㄦ埛鍚�?")
+                .then(_ => {
+                    this.$axios({
+                        method: 'post',
+                        url: 'sccg/admin/deleteBatch?ids=' + idArr,
+                    })
+                        .then(res => {
+                            if (res.code === 200) {
+                                this.$message({
+                                    type: 'success',
+                                    message: '鍒犻櫎鐢ㄦ埛淇℃伅鎴愬姛',
+                                })
+                                this.getUserList();
+                            } else {
+                                this.$message({
+                                    type: 'error',
+                                    message: res.message
+                                })
+                            }
+                            console.log(res);
+                        })
+                })
+                .catch(err => { console.log(err) })
+        },
+        // 鎵归噺淇敼璐﹀彿
+        mulUpdateStatus(idArr,flag) {
+            console.log(flag);
+            this.$confirm( flag === 1 ? "鎮ㄧ‘瀹氳杩涜鎵归噺鍚敤鐢ㄦ埛鍚�?" :'鎮ㄧ‘瀹氳杩涜鎵归噺绂佺敤鐢ㄦ埛鍚�?' ) 
+                .then(_ => {
+                    this.$axios({
+                        method: 'post',
+                        url: 'sccg/admin/updateStatusBatch?ids=' + idArr + '&status='+flag,
+                    })
+                        .then(res => {
+                            if (res.code === 200) {
+                                this.$message({
+                                    type: 'success',
+                                    message: '鏇存敼鐢ㄦ埛鐘舵�佹垚鍔�',
+                                })
+                                this.getUserList();
+                            } else {
+                                this.$message({
+                                    type: 'error',
+                                    message: res.message
+                                })
+                            }
+                            console.log(res);
+                        })
+                })
+                .catch(err => { console.log(err) })
         },
         changeTime({ createTime }) {
             return helper(createTime);
@@ -300,8 +375,10 @@
         justify-content: space-between;
         align-items: center;
         padding: 0 20px;
+
         .funs {
             display: flex;
+
             .funsItem {
                 line-height: 28px;
                 display: flex;
@@ -310,25 +387,30 @@
                 border-radius: 4px;
                 font-size: 12px;
                 margin-left: 10px;
-                .el-checkbox{
+
+                .el-checkbox {
                     width: 80px;
                     padding: 0 10px;
                 }
-                .el-select{
+
+                .el-select {
                     width: 120px;
                 }
-                &::v-deep .el-input__inner{
+
+                &::v-deep .el-input__inner {
                     border: none;
                     background-color: #09152f;
                 }
-                &:hover{
+
+                &:hover {
                     border: 1px solid #4b9bb7;
                 }
-                &:hover .el-checkbox{
+
+                &:hover .el-checkbox {
                     color: #4b9bb7;
                 }
             }
-            
+
         }
 
         .pagination {
@@ -345,7 +427,8 @@
                     background-color: #071f39;
                     color: #4b9bb7;
                 }
-                &::v-deep .active{
+
+                &::v-deep .active {
                     background-color: #409eff;
                     color: #fff;
                 }

--
Gitblit v1.8.0