Browse Source

04/16 18:17

11
Xiao_Mo 5 years ago
parent
commit
fa2e53e02c

+ 12 - 0
src/api/operateManager.js

@@ -0,0 +1,12 @@
+import request from '@/utils/request'
+import qs from 'qs'
+let api = '/api-web'
+
+// 列表
+export function getOperatingStudents(data) {
+    return request({
+        url: api + '/studentManage/getOperatingStudents',
+        method: 'GET',
+        params: data
+    })
+}

+ 210 - 9
src/views/operateManager/operateStudent.vue

@@ -7,16 +7,105 @@
     <div class="m-core">
     <div class="m-core">
       <el-form :inline="true" :model="searchForm">
       <el-form :inline="true" :model="searchForm">
         <el-form-item>
         <el-form-item>
-          <el-input v-model.trim="searchForm.search" @keyup.enter.native="search" placeholder></el-input>
+          <el-input
+            v-model.trim="searchForm.search"
+            @keyup.enter.native="search"
+            placeholder="学生姓名 编号"
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="organId">
+          <el-select
+            class="multiple"
+            v-model.trim="searchForm.organId"
+            filterable
+            clearable
+            placeholder="请选择分部"
+          >
+            <el-option
+              v-for="(item,index) in organList"
+              :key="index"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select placeholder="老师姓名" v-model="searchForm.teacherId" clearable filterable>
+            <el-option
+              v-for="(item,index) in teacherList"
+              :label="item.realName"
+              :value="item.id"
+              :key="index"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select placeholder="参与运营指标" v-model="searchForm.operatingTag" clearable>
+            <el-option label="是" value="1"></el-option>
+            <el-option label="否" value="0"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select placeholder="有线上vip课" v-model="searchForm.hasVip" clearable>
+            <el-option label="是" value="1"></el-option>
+            <el-option label="否" value="0"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select placeholder="参与免费网管课" v-model="searchForm.hasFreePractice" clearable>
+            <el-option label="是" value="1"></el-option>
+            <el-option label="否" value="0"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select placeholder="有付费网管课" v-model="searchForm.hasBuyPractice" clearable>
+            <el-option label="是" value="1"></el-option>
+            <el-option label="否" value="0"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="danger" @click="search">搜索</el-button>
+          <el-button @click="onReSet" type="primary">重置</el-button>
+          <!-- export/isSettlementCourseSalarys -->
+          <el-button
+            @click="onExport"
+            type="primary"
+            v-permission="'export/operatingStudents'"
+            style=" background: #14928a; border:1px solid #14928a;"
+          >导出</el-button>
         </el-form-item>
         </el-form-item>
       </el-form>
       </el-form>
+
       <div class="tableWrap">
       <div class="tableWrap">
         <el-table
         <el-table
           style="width: 100%"
           style="width: 100%"
           :header-cell-style="{background:'#EDEEF0',color:'#444'}"
           :header-cell-style="{background:'#EDEEF0',color:'#444'}"
           :data="tableList"
           :data="tableList"
         >
         >
-          <el-table-column align="center" prop="studentId" label="分部"></el-table-column>
+          <el-table-column align="center" prop="studentId" label="学员编号"></el-table-column>
+          <el-table-column align="center" prop="studentName" label="学员姓名"></el-table-column>
+          <el-table-column align="center" prop="organName" label="所属分部"></el-table-column>
+          <el-table-column align="center" prop="teacherName" label="指导老师"></el-table-column>
+           <el-table-column align="center" prop="operatingTag" label="参与运营指标">
+               <template slot-scope="scope">
+              <div>{{scope.row.operatingTag?'是':'否'}}</div>
+            </template>
+           </el-table-column>
+             <el-table-column align="center" prop="vipTimes" label="有线上vip课">
+               <template slot-scope="scope">
+              <div>{{scope.row.vipTimes?'是':'否'}}</div>
+            </template>
+           </el-table-column>
+             <el-table-column align="center" prop="freePracticeTimes" label="参与免费网管课">
+               <template slot-scope="scope">
+              <div>{{scope.row.freePracticeTimes?'是':'否'}}</div>
+            </template>
+           </el-table-column>
+                <el-table-column align="center" prop="buyPracticeTimes" label="有付费网管课">
+               <template slot-scope="scope">
+              <div>{{scope.row.buyPracticeTimes?'是':'否'}}</div>
+            </template>
+           </el-table-column>
         </el-table>
         </el-table>
         <pagination
         <pagination
           :total="rules.total"
           :total="rules.total"
@@ -36,13 +125,19 @@ import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
 import load from "@/utils/loading";
 import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
 import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
-
+import { getOperatingStudents } from "@/api/operateManager";
 export default {
 export default {
   components: { pagination },
   components: { pagination },
   data() {
   data() {
     return {
     return {
       searchForm: {
       searchForm: {
-        search: null
+        search: null,
+        organId: null,
+        teacherId: null,
+        hasBuyPractice: null,
+        hasFreePractice: null,
+        hasVip: null,
+        operatingTag: null
       },
       },
       teacherList: [],
       teacherList: [],
       tableList: [],
       tableList: [],
@@ -58,14 +153,16 @@ export default {
   },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
   created() {},
-  //生命周期 - 挂载完成(可以访问DOM元素)
+  activated() {
+    this.init();
+  },
   mounted() {
   mounted() {
-       getTeacher().then(res => {
+    getTeacher().then(res => {
       if (res.code == 200) {
       if (res.code == 200) {
         this.teacherList = res.data;
         this.teacherList = res.data;
       }
       }
     });
     });
-      getEmployeeOrgan().then(res => {
+    getEmployeeOrgan().then(res => {
       if (res.code == 200) {
       if (res.code == 200) {
         this.organList = res.data;
         this.organList = res.data;
       }
       }
@@ -74,8 +171,112 @@ export default {
     this.init();
     this.init();
   },
   },
   methods: {
   methods: {
-    init() {},
-    getList() {}
+    init() {
+      this.getList();
+    },
+    getList() {
+      let obj = this.getDate();
+      getOperatingStudents(obj).then(res => {
+        if (res.code == 200) {
+          this.tableList = res.data.rows;
+          this.rules.total = res.data.total;
+        }
+      });
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm = {
+        search: null,
+        organId: null,
+        teacherId: null,
+        hasBuyPractice: null,
+        hasFreePractice: null,
+        hasVip: null,
+        operatingTag: null
+      };
+      this.search();
+    },
+    onExport() {
+      let url = "/api-web/export/operatingStudents";
+      let obj = this.getDate();
+      const options = {
+        method: "get",
+        headers: {
+          Authorization: getToken()
+        },
+        url,
+        params: obj,
+        responseType: "blob"
+      };
+
+      this.$confirm("您确定导出列表?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          load.startLoading();
+          axios(options)
+            .then(res => {
+              let blob = new Blob([res.data], {
+                // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8',
+                type: "application/vnd.ms-excel;charset=utf-8"
+                // word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
+              });
+              let text = new Response(blob).text();
+              text.then(res => {
+                // 判断是否报错
+                if (res.indexOf("code") != -1) {
+                  let json = JSON.parse(res);
+                  this.$message.error(json.msg);
+                } else {
+                  let objectUrl = URL.createObjectURL(blob);
+                  let link = document.createElement("a");
+                  let nowTime = new Date();
+                  let ymd =
+                    nowTime.getFullYear() +
+                    "" +
+                    (nowTime.getMonth() + 1) +
+                    "" +
+                    nowTime.getDate() +
+                    "" +
+                    nowTime.getHours() +
+                    "" +
+                    nowTime.getMinutes();
+                  let fname = ymd + "学员列表(运营)";
+                  link.href = objectUrl;
+                  link.setAttribute("download", fname);
+                  document.body.appendChild(link);
+                  link.click();
+                }
+              });
+
+              load.endLoading();
+            })
+            .catch(error => {
+              this.$message.error("导出数据失败,请连接管理员");
+              load.endLoading();
+            });
+        })
+        .catch(() => {});
+    },
+    getDate() {
+      let obj = {
+        search: this.searchForm.search || null,
+        organId: this.searchForm.organId || null,
+        teacherId: this.searchForm.teacherId || null,
+        hasBuyPractice: this.searchForm.hasBuyPractice || null,
+        hasFreePractice: this.searchForm.hasFreePractice || null,
+        hasVip: this.searchForm.hasVip || null,
+        operatingTag: this.searchForm.operatingTag || null,
+        page: this.rules.page,
+        rows: this.rules.limit
+      };
+      return obj;
+    }
   }
   }
 };
 };
 </script>
 </script>

+ 78 - 49
src/views/workBenchManager/classFeesIsOk.vue

@@ -12,7 +12,7 @@
         class="newBand"
         class="newBand"
       >开启课酬确认</div>
       >开启课酬确认</div>
       <div
       <div
-       v-if="isOpen == 1"
+        v-if="isOpen == 1"
         @click="closeSalary"
         @click="closeSalary"
         v-permission="'courseScheduleTeacherSalary/closeSalaryConfirm'"
         v-permission="'courseScheduleTeacherSalary/closeSalaryConfirm'"
         class="newBand"
         class="newBand"
@@ -115,7 +115,7 @@
         >
         >
           <el-table-column align="center" prop="organName" label="分部"></el-table-column>
           <el-table-column align="center" prop="organName" label="分部"></el-table-column>
           <el-table-column align="center" prop="groupType" width="100" label="课程组类型">
           <el-table-column align="center" prop="groupType" width="100" label="课程组类型">
-                <template slot-scope="scope">{{scope.row.groupType | coursesType}}</template>
+            <template slot-scope="scope">{{scope.row.groupType | coursesType}}</template>
           </el-table-column>
           </el-table-column>
           <el-table-column align="center" prop="courseScheduleId" label="课程编号"></el-table-column>
           <el-table-column align="center" prop="courseScheduleId" label="课程编号"></el-table-column>
           <el-table-column align="center" prop="courseScheduleId" width="150" label="时间">
           <el-table-column align="center" prop="courseScheduleId" width="150" label="时间">
@@ -161,7 +161,7 @@
           <el-table-column align="center" prop="memo" label="备注" width="150" fixed="right"></el-table-column>
           <el-table-column align="center" prop="memo" label="备注" width="150" fixed="right"></el-table-column>
           <el-table-column align="center" label="操作" fixed="right">
           <el-table-column align="center" label="操作" fixed="right">
             <template slot-scope="scope">
             <template slot-scope="scope">
-              <el-button type="text">课酬调整</el-button>
+              <el-button type="text" @click="resetSalary(scope.row)">课酬调整</el-button>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
         </el-table>
         </el-table>
@@ -174,12 +174,23 @@
         />
         />
       </div>
       </div>
     </div>
     </div>
-    <el-dialog
-      title="课酬调整"
-      :visible.sync="dialogVisible"
-      width="width"
-     >
-      <div></div>
+    <el-dialog title="课酬调整" :visible.sync="dialogVisible" width="400px">
+      <div>
+        <el-form ref="visibleForm" :model="visibleForm" :inline="true">
+          <el-form-item label="应发">
+            <el-input v-model="visibleForm.expectSalary"></el-input>
+          </el-form-item>
+          <el-form-item label="扣款">
+            <el-input v-model="visibleForm.reduceSalary"></el-input>
+          </el-form-item>
+          <el-form-item label="实发">
+            <el-input v-model="visibleForm.actualSalary" disabled></el-input>
+          </el-form-item>
+          <el-form-item label="实发">
+            <el-input type="textarea"  :rows="5" v-model="visibleForm.memo" ></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
       <div slot="footer">
       <div slot="footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
         <el-button @click="dialogVisible = false">取 消</el-button>
         <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
         <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
@@ -194,7 +205,11 @@ import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
 import load from "@/utils/loading";
 import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
 import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
-import { findIsSettlementCourseSalarys,openSalaryConfirm,closeSalaryConfirm } from "@/api/journal";
+import {
+  findIsSettlementCourseSalarys,
+  openSalaryConfirm,
+  closeSalaryConfirm
+} from "@/api/journal";
 import { courseType } from "@/utils/searchArray";
 import { courseType } from "@/utils/searchArray";
 export default {
 export default {
   components: { pagination },
   components: { pagination },
@@ -210,8 +225,15 @@ export default {
         month: null,
         month: null,
         confirmStatus: null
         confirmStatus: null
       },
       },
-      dialogVisible:true,
+      dialogVisible: false,
+      visibleForm: {
+        expectSalary: null,
+        reduceSalary: null,
+        actualSalary: null,
+        courseScheduleId: null
+      },
       isOpen: null,
       isOpen: null,
+      activeRow: null,
       teacherList: [],
       teacherList: [],
       tableList: [],
       tableList: [],
       organList: [],
       organList: [],
@@ -273,7 +295,7 @@ export default {
       this.getList();
       this.getList();
     },
     },
     onReSet() {
     onReSet() {
-        this.searchForm= {
+      this.searchForm = {
         search: null,
         search: null,
         organIdList: null,
         organIdList: null,
         groupType: null,
         groupType: null,
@@ -282,8 +304,8 @@ export default {
         signOutStatus: null,
         signOutStatus: null,
         month: null,
         month: null,
         confirmStatus: null
         confirmStatus: null
-      }
-      this.search()
+      };
+      this.search();
     },
     },
     getDate() {
     getDate() {
       let obj = {
       let obj = {
@@ -300,49 +322,47 @@ export default {
       };
       };
       return obj;
       return obj;
     },
     },
-    openSalary(){
-        let  now = new Date();
-       let month = new Date(
-          Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
-        )
-          .toISOString()
-          .slice(0, 7);
-          this.$confirm("您确定开启课酬确认?", "提示", {
+    openSalary() {
+      let now = new Date();
+      let month = new Date(
+        Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
+      )
+        .toISOString()
+        .slice(0, 7);
+      this.$confirm("您确定开启课酬确认?", "提示", {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         cancelButtonText: "取消",
         type: "warning"
         type: "warning"
-      }).then(()=>{
-         openSalaryConfirm({month}).then(res=>{
-        if(res.code == 200){
-          this.$message.success('开启成功')
-          this.getList()
-        }
-      })
-      })
-     
+      }).then(() => {
+        openSalaryConfirm({ month }).then(res => {
+          if (res.code == 200) {
+            this.$message.success("开启成功");
+            this.getList();
+          }
+        });
+      });
     },
     },
-    closeSalary(){
-        let  now = new Date();
-       let month = new Date(
-          Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
-        )
-          .toISOString()
-          .slice(0, 7);
-        this.$confirm("您确定关闭课酬确认?", "提示", {
+    closeSalary() {
+      let now = new Date();
+      let month = new Date(
+        Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
+      )
+        .toISOString()
+        .slice(0, 7);
+      this.$confirm("您确定关闭课酬确认?", "提示", {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         cancelButtonText: "取消",
         type: "warning"
         type: "warning"
-      }).then(()=>{
-         closeSalaryConfirm({month}).then(res=>{
-        if(res.code == 200){
-          this.$message.success('关闭成功')
-          this.getList()
-        }
-      })
-      })
-     
+      }).then(() => {
+        closeSalaryConfirm({ month }).then(res => {
+          if (res.code == 200) {
+            this.$message.success("关闭成功");
+            this.getList();
+          }
+        });
+      });
     },
     },
-      onExport() {
+    onExport() {
       let url = "/api-web/export/isSettlementCourseSalarys";
       let url = "/api-web/export/isSettlementCourseSalarys";
       let obj = this.getDate();
       let obj = this.getDate();
       const options = {
       const options = {
@@ -406,6 +426,15 @@ export default {
         })
         })
         .catch(() => {});
         .catch(() => {});
     },
     },
+    resetSalary(row) {
+      this.visibleForm = {
+        expectSalary: row.expectSalary,
+        reduceSalary: row.reduceSalary,
+        actualSalary: row.actualSalary,
+        courseScheduleId: row.courseScheduleId
+      };
+      this.dialogVisible = true;
+    }
   },
   },
   filters: {
   filters: {
     confirmFilter(val) {
     confirmFilter(val) {