Browse Source

批量操作人员列表

natasha 1 year ago
parent
commit
e3e2d9dbbd

+ 21 - 2
src/store/global.js

@@ -18,8 +18,27 @@ export default {
             .catch(() => {
             .catch(() => {
 
 
             });
             });
-        Vue.prototype.$orgTypeAll = typeListAll
-        Vue.prototype.$orgType = typeList
+        Vue.prototype.$studyTypeAll = typeListAll
+        Vue.prototype.$studyType = typeList
+        let MethodNames = "/OrgServer/DictManager/GetOrgTypeList";
+        let typeListAlls = [{
+            type: -1,
+            type_name: '全部'
+        }]
+        let typeLists = []
+        await getLogin(MethodNames, {})
+            .then((res) => {
+                if (res.status === 1) {
+                    typeListAlls = typeListAlls.concat(res.type_list)
+                    typeLists = res.type_list
+                }
+            })
+            .catch(() => {
+
+            });
+        Vue.prototype.$orgTypeAll = typeListAlls
+        Vue.prototype.$orgType = typeLists
+
         Vue.prototype.$checkStatusList = [{
         Vue.prototype.$checkStatusList = [{
                 value: -1,
                 value: -1,
                 label: '全部'
                 label: '全部'

+ 1 - 1
src/views/content_manage/course_manage/CreateRecorded.vue

@@ -73,7 +73,7 @@
                     <el-form-item label="学段" prop="study">
                     <el-form-item label="学段" prop="study">
                         <el-select v-model="organizeForm.study" placeholder="请选择">
                         <el-select v-model="organizeForm.study" placeholder="请选择">
                             <el-option
                             <el-option
-                                v-for="item in $orgType"
+                                v-for="item in $studyType"
                                 :key="item.study_phase"
                                 :key="item.study_phase"
                                 :label="item.study_phase_name"
                                 :label="item.study_phase_name"
                                 :value="item.study_phase">
                                 :value="item.study_phase">

+ 1 - 1
src/views/content_manage/course_manage/RecordedCourse.vue

@@ -36,7 +36,7 @@
                         <label>学段</label>
                         <label>学段</label>
                         <el-select v-model="searchStudy" @change="getList" placeholder="请选择">
                         <el-select v-model="searchStudy" @change="getList" placeholder="请选择">
                             <el-option
                             <el-option
-                                v-for="item in $orgTypeAll"
+                                v-for="item in $studyTypeAll"
                                 :key="item.study_phase"
                                 :key="item.study_phase"
                                 :label="item.study_phase_name"
                                 :label="item.study_phase_name"
                                 :value="item.study_phase">
                                 :value="item.study_phase">

+ 3 - 3
src/views/organize_manage/CreateOrganize.vue

@@ -38,9 +38,9 @@
                         <el-select v-model="organizeForm.orgType" placeholder="请选择">
                         <el-select v-model="organizeForm.orgType" placeholder="请选择">
                             <el-option
                             <el-option
                                 v-for="item in $orgType"
                                 v-for="item in $orgType"
-                                :key="item.study_phase"
-                                :label="item.study_phase_name"
-                                :value="item.study_phase">
+                                :key="item.type"
+                                :label="item.type_name"
+                                :value="item.type">
                             </el-option>
                             </el-option>
                         </el-select>
                         </el-select>
                     </el-form-item>
                     </el-form-item>

+ 27 - 19
src/views/organize_manage/PersonList.vue

@@ -61,13 +61,13 @@
                         </div>
                         </div>
                     </div>
                     </div>
                     <div class="search-right" v-if="tabsIndex===0">
                     <div class="search-right" v-if="tabsIndex===0">
-                        <el-button class="gray-btn" size="small">开启选中用户</el-button>
-                        <el-button class="pink-btn" size="small">停用选中用户</el-button>
+                        <el-button class="gray-btn" size="small" @click="handleUp('','up',multipleSelection)">开启选中用户</el-button>
+                        <el-button class="pink-btn" size="small" @click="handleUp('','down',multipleSelection)">停用选中用户</el-button>
                         <el-button class="red-btn" size="small">删除选中用户</el-button>
                         <el-button class="red-btn" size="small">删除选中用户</el-button>
                     </div>
                     </div>
                     <div class="search-right" v-if="tabsIndex===1">
                     <div class="search-right" v-if="tabsIndex===1">
-                        <el-button class="gray-btn" size="small">同意选中用户</el-button>
-                        <el-button class="pink-btn" size="small">拒绝选中用户</el-button>
+                        <el-button class="gray-btn" size="small" @click="handleAudit('','up',multipleSelection)">同意选中用户</el-button>
+                        <el-button class="pink-btn" size="small" @click="handleAudit('','down',multipleSelection)">拒绝选中用户</el-button>
                     </div>
                     </div>
                 </div>
                 </div>
                 <template v-if="tabsIndex===0">
                 <template v-if="tabsIndex===0">
@@ -153,7 +153,7 @@
                                     编辑
                                     编辑
                                 </el-button>
                                 </el-button>
                                 <el-button
                                 <el-button
-                                    @click.native.prevent="handleUp(scope.row, scope.$index)"
+                                    @click.native.prevent="handleUp(scope.row, 'up')"
                                     type="text"
                                     type="text"
                                     size="small"
                                     size="small"
                                     class="primary-btn"
                                     class="primary-btn"
@@ -161,7 +161,7 @@
                                     开启
                                     开启
                                 </el-button>
                                 </el-button>
                                 <el-button
                                 <el-button
-                                    @click.native.prevent="handleUp(scope.row, scope.$index)"
+                                    @click.native.prevent="handleUp(scope.row, 'down')"
                                     type="text"
                                     type="text"
                                     size="small"
                                     size="small"
                                     class="red-btn"
                                     class="red-btn"
@@ -255,7 +255,7 @@
                             label="状态"
                             label="状态"
                             width="116" >
                             width="116" >
                             <template slot-scope="scope">
                             <template slot-scope="scope">
-                                <div class="status-box">
+                                <div class="status-box" v-if="auditStatusList[scope.row.audit_status]">
                                     <span :style="{background:auditStatusList[scope.row.audit_status].bg}"></span>
                                     <span :style="{background:auditStatusList[scope.row.audit_status].bg}"></span>
                                     <b :style="{color:auditStatusList[scope.row.audit_status].color}">{{auditStatusList[scope.row.audit_status].text}}</b>
                                     <b :style="{color:auditStatusList[scope.row.audit_status].color}">{{auditStatusList[scope.row.audit_status].text}}</b>
                                 </div>
                                 </div>
@@ -274,14 +274,14 @@
                                     查看
                                     查看
                                 </el-button>
                                 </el-button>
                                 <el-button
                                 <el-button
-                                    @click.native.prevent="handleAudit(scope.row)"
+                                    @click.native.prevent="handleAudit(scope.row,'up')"
                                     type="text"
                                     type="text"
                                     size="small"
                                     size="small"
                                     class="primary-btn">
                                     class="primary-btn">
                                     同意
                                     同意
                                 </el-button>
                                 </el-button>
                                 <el-button
                                 <el-button
-                                    @click.native.prevent="handleAudit(scope.row)"
+                                    @click.native.prevent="handleAudit(scope.row,'down')"
                                     type="text"
                                     type="text"
                                     size="small"
                                     size="small"
                                     class="red-btn"
                                     class="red-btn"
@@ -626,15 +626,18 @@ export default {
 
 
     },
     },
     // 停用 启用
     // 停用 启用
-    handleUp(row) {
+    handleUp(row,type,arr) {
+      if(!row&&arr.length===0){
+        return false
+      }
       let Mname = "/OrgServer/Manager/PersonManager/EnablePerson";
       let Mname = "/OrgServer/Manager/PersonManager/EnablePerson";
       let data = {
       let data = {
-        id_list: [row.id]
+        id_list: arr?arr:[row.id]
       };
       };
-      if (row.status === 0) {
+      if (type==='up') {
         // 下架状态
         // 下架状态
         data.is_enable = "true";
         data.is_enable = "true";
-      } else if (row.status === 1) {
+      } else if (type==='down') {
         data.is_enable = "false";
         data.is_enable = "false";
       }
       }
       getLogin(Mname, data).then(res => {
       getLogin(Mname, data).then(res => {
@@ -643,15 +646,18 @@ export default {
       });
       });
     },
     },
     // 通过 拒绝
     // 通过 拒绝
-    handleAudit(row) {
+    handleAudit(row,type,arr) {
+      if(!row&&arr.length===0){
+        return false
+      }
       let Mname = "/OrgServer/Manager/PersonManager/AuditPerson";
       let Mname = "/OrgServer/Manager/PersonManager/AuditPerson";
       let data = {
       let data = {
-        id_list: [row.id]
+        id_list: arr?arr:[row.id]
       };
       };
-      if (row.audit_status === 2) {
+      if (type==='up') {
         // 下架状态
         // 下架状态
         data.is_pass = "true";
         data.is_pass = "true";
-      } else if (row.audit_status === 0) {
+      } else if (type==='down') {
         data.is_pass = "false";
         data.is_pass = "false";
       }
       }
       getLogin(Mname, data).then(res => {
       getLogin(Mname, data).then(res => {
@@ -698,8 +704,10 @@ export default {
     },
     },
     // 复选框
     // 复选框
     handleSelectionChange(val) {
     handleSelectionChange(val) {
-        console.log(val)
-        this.multipleSelection = val;
+        this.multipleSelection = []
+        val.forEach(item => {
+            this.multipleSelection.push(item.id)
+        });
     },
     },
     handleChangeTabs(value){
     handleChangeTabs(value){
         this.tabsIndex = value
         this.tabsIndex = value

+ 3 - 3
src/views/organize_manage/index.vue

@@ -26,9 +26,9 @@
                         <el-select v-model="searchType" @change="getList" placeholder="请选择">
                         <el-select v-model="searchType" @change="getList" placeholder="请选择">
                             <el-option
                             <el-option
                                 v-for="item in $orgTypeAll"
                                 v-for="item in $orgTypeAll"
-                                :key="item.study_phase"
-                                :label="item.study_phase_name"
-                                :value="item.study_phase">
+                                :key="item.type"
+                                :label="item.type_name"
+                                :value="item.type">
                             </el-option>
                             </el-option>
                         </el-select>
                         </el-select>
                     </div>
                     </div>