mo преди 4 години
родител
ревизия
6afd06eb44
променени са 2 файла, в които са добавени 211 реда и са изтрити 158 реда
  1. 1 1
      src/router/notKeepAliveList.js
  2. 210 157
      src/views/settlementManager/settlementList.vue

+ 1 - 1
src/router/notKeepAliveList.js

@@ -48,7 +48,7 @@ export default [
   '/operateManager/stuRecodeManager',// 学生考勤
   '/operateManager/operateStudent', // 运营指标
   '/operateManager/serverIndexList', // 服务指标
-  '/operateManager/stuRecodeManager',
+  '/operateManager/settlementList', // 结转奖励
   '/insideSetting/entryActivities', // 时间充值活动
   '/insideSetting/entryOperation',
   '/insideSetting/helpContent', // 帮助中心

+ 210 - 157
src/views/settlementManager/settlementList.vue

@@ -2,114 +2,163 @@
 <template>
   <div class="m-container">
     <h2>
-      <div class="squrt"></div>结转奖励
+      <div class="squrt"></div>
+      结转奖励
     </h2>
     <div class="m-core">
-      <el-form :inline="true"
-               :model="searchForm">
+      <save-form
+        :inline="true"
+        @submit="search"
+        @reset="onReSet"
+        :model="searchForm"
+      >
         <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"
+            clearable
+            placeholder="课程组编号&名字"
+          ></el-input>
         </el-form-item>
         <el-form-item>
-          <el-select placeholder="请选择分部"
-                     v-model="searchForm.organId"
-                     clearable>
-            <el-option v-for="(item,index) in organList"
-                       :label="item.name"
-                       :value="item.id"
-                       :key="index"></el-option>
+          <el-select
+            placeholder="请选择分部"
+            v-model="searchForm.organId"
+            filterable
+            clearable
+          >
+            <el-option
+              v-for="(item, index) in selects.branchs"
+              :label="item.name"
+              :value="item.id"
+              :key="index"
+            ></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>
+          <remote-search
+            :commit="'setTeachers'"
+            v-model="searchForm.teacherId"
+          />
         </el-form-item>
         <el-form-item>
-          <el-select placeholder="转结状态"
-                     v-model="searchForm.settlementStatus"
-                     clearable>
-            <el-option label="已结算"
-                       value="1"></el-option>
-            <el-option label="未结算"
-                       value="0"></el-option>
+          <el-select
+            placeholder="转结状态"
+            v-model="searchForm.settlementStatus"
+            clearable
+          >
+            <el-option label="已结算" value="1"></el-option>
+            <el-option label="未结算" value="0"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-date-picker v-model.trim="searchForm.date"
-                          style="width:410px;"
-                          type="daterange"
-                          value-format="yyyy-MM-dd"
-                          :picker-options="{
-        firstDayOfWeek: 1
-    }"
-                          range-separator="至"
-                          start-placeholder="结转开始日期"
-                          end-placeholder="结转结束日期"></el-date-picker>
+          <el-date-picker
+            v-model.trim="searchForm.date"
+            style="width: 410px"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            :picker-options="{
+              firstDayOfWeek: 1,
+            }"
+            range-separator="至"
+            start-placeholder="结转开始日期"
+            end-placeholder="结转结束日期"
+          ></el-date-picker>
         </el-form-item>
         <el-form-item>
-          <el-button type="danger"
-                     @click="search">搜索</el-button>
-          <el-button @click="onReSet"
-                     type="primary">重置</el-button>
-          <el-button @click="onExport"
-                     type="primary"
-                     v-permission="'export/teacherCourseReward'"
-                     style=" background: #14928a; border:1px solid #14928a;">导出</el-button>
+          <el-button type="danger" native-type="submit">搜索</el-button>
+          <el-button @click="onReSet" native-type="reset" type="primary"
+            >重置</el-button
+          >
+          <el-button
+            @click="onExport"
+            type="primary"
+            v-permission="'export/teacherCourseReward'"
+            style="background: #14928a; border: 1px solid #14928a"
+            >导出</el-button
+          >
         </el-form-item>
-      </el-form>
+      </save-form>
       <div class="tableWrap">
-        <el-table style="width: 100%"
-                  :header-cell-style="{background:'#EDEEF0',color:'#444'}"
-                  :data="tableList">
-          <el-table-column align="center"
-                           prop="musicGroupId"
-                           label="课程组编号"></el-table-column>
-          <el-table-column align="center"
-                           prop="courseGroupName"
-                           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"
-                           label="结转状态">
+        <el-table
+          style="width: 100%"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+          :data="tableList"
+        >
+          <el-table-column
+            align="center"
+            prop="musicGroupId"
+            label="课程组编号"
+          >
+             <template slot-scope="scope">
+              <div>
+                <copy-text>{{ scope.row.musicGroupId }}</copy-text>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="courseGroupName"
+            label="课程组名称"
+          >
+            <template slot-scope="scope">
+              <div>
+                <copy-text>{{ scope.row.courseGroupName }}</copy-text>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="organName"
+            label="分部"
+          >
+            <template slot-scope="scope">
+              <div>
+                <copy-text>{{ scope.row.organName }}</copy-text>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="teacherName"
+            label="指导老师"
+          >
+             <template slot-scope="scope">
+              <div>
+                <copy-text>{{ scope.row.teacherName }}</copy-text>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="结转状态">
             <template slot-scope="scope">
-              <div>{{ scope.row.settlementStatus?'已结算':'未结算'}}</div>
+              <div>{{ scope.row.settlementStatus ? "已结算" : "未结算" }}</div>
             </template>
           </el-table-column>
-          <el-table-column align="center"
-                           label="结转金额">
+          <el-table-column align="center" label="结转金额">
             <template slot-scope="scope">
-              <div>{{ scope.row.expectRewardAmount | moneyFormat}}元</div>
+              <div>{{ scope.row.expectRewardAmount | moneyFormat }}元</div>
             </template>
           </el-table-column>
-          <el-table-column align="center"
-                           label="结转日期">
+          <el-table-column align="center" label="结转日期">
             <template slot-scope="scope">
-              <div>{{ scope.row.settlementDate | formatTimer}}</div>
+              <div>{{ scope.row.settlementDate | formatTimer }}</div>
             </template>
           </el-table-column>
-          <el-table-column align="center"
-                           prop="memo"
-                           width="500"
-                           label="备注"></el-table-column>
+          <el-table-column
+            align="center"
+            prop="memo"
+            width="500"
+            label="备注"
+          ></el-table-column>
         </el-table>
-        <pagination :total="rules.total"
-                    :page.sync="rules.page"
-                    :limit.sync="rules.limit"
-                    :page-sizes="rules.page_size"
-                    @pagination="getList" />
+        <pagination
+          sync
+          :total.sync="rules.total"
+          :page.sync="rules.page"
+          :limit.sync="rules.limit"
+          :page-sizes="rules.page_size"
+          @pagination="getList"
+        />
       </div>
     </div>
   </div>
@@ -117,7 +166,7 @@
 
 <script>
 import axios from "axios";
-import qs from 'qs'
+import qs from "qs";
 import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
@@ -125,7 +174,7 @@ import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
 import { teacherCourseReward } from "@/api/operateManager";
 export default {
   components: { pagination },
-  data () {
+  data() {
     return {
       searchForm: {
         search: null,
@@ -142,63 +191,65 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
-      }
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
-  created () { },
+  created() {},
   //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted () {
-    getTeacher().then(res => {
-      if (res.code == 200) {
-        this.teacherList = res.data;
-      }
-    });
-    getEmployeeOrgan().then(res => {
-      if (res.code == 200) {
-        this.organList = res.data;
-      }
-    });
+  mounted() {
+    // getTeacher().then(res => {
+    //   if (res.code == 200) {
+    //     this.teacherList = res.data;
+    //   }
+    // });
+    // getEmployeeOrgan().then(res => {
+    //   if (res.code == 200) {
+    //     this.organList = res.data;
+    //   }
+    // });
     // 获取分部
+    this.$store.dispatch("setBranchs");
     this.init();
   },
-  activated () {
+  activated() {
     this.init();
   },
   methods: {
-    init () {
+    init() {
       this.getList();
     },
-    getList () {
+    getList() {
       this.searchForm.page = this.rules.page;
       this.searchForm.rows = this.rules.limit;
       if (this.searchForm.date && this.searchForm.date.length > 0) {
-        this.searchForm.startTime = this.searchForm.date[0]
-        this.searchForm.endTime = this.searchForm.date[1]
+        this.searchForm.startTime = this.searchForm.date[0];
+        this.searchForm.endTime = this.searchForm.date[1];
       } else {
-        this.searchForm.startTime = null
+        this.searchForm.startTime = null;
         this.searchForm.endTime = null;
       }
 
       let obj = JSON.parse(JSON.stringify(this.searchForm));
       obj.date = null;
-      teacherCourseReward(obj).then(res => {
+      teacherCourseReward(obj).then((res) => {
         if (res.code == 200) {
           this.tableList = res.data.rows;
           this.rules.total = res.data.total;
         }
       });
     },
-    onExport () {
+    onExport() {
       let url = "/api-web/export/teacherCourseReward";
       this.searchForm.page = this.rules.page;
       this.searchForm.rows = this.rules.limit;
       if (this.searchForm.date && this.searchForm.date.length > 0) {
-        this.searchForm.startTime = this.searchForm.date[0]
-        this.searchForm.endTime = this.searchForm.date[1]
-      } {
-        this.searchForm.startTime = null
+        this.searchForm.startTime = this.searchForm.date[0];
+        this.searchForm.endTime = this.searchForm.date[1];
+      }
+      {
+        this.searchForm.startTime = null;
         this.searchForm.endTime = null;
       }
       let obj = JSON.parse(JSON.stringify(this.searchForm));
@@ -206,66 +257,68 @@ export default {
       const options = {
         method: "POST",
         headers: {
-          Authorization: getToken()
+          Authorization: getToken(),
         },
         data: qs.stringify(obj),
         url,
-        responseType: "blob"
+        responseType: "blob",
       };
       this.$confirm("您确定导出报表", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        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 = "报表导出" + new Date().getTime(); //下载文件的名字
-                link.href = objectUrl;
-                link.setAttribute("download", fname);
-                document.body.appendChild(link);
-                link.click();
-              }
-            })
+          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 = "报表导出" + new Date().getTime(); //下载文件的名字
+                  link.href = objectUrl;
+                  link.setAttribute("download", fname);
+                  document.body.appendChild(link);
+                  link.click();
+                }
+              });
 
-            load.endLoading();
-          }).catch(error => {
-            this.$message.error('导出数据失败,请联系管理员');
-            load.endLoading();
-          });
+              load.endLoading();
+            })
+            .catch((error) => {
+              this.$message.error("导出数据失败,请联系管理员");
+              load.endLoading();
+            });
         })
-        .catch(() => { });
+        .catch(() => {});
     },
-    search () {
+    search() {
       this.rules.page = 1;
       this.getList();
     },
-    onReSet () {
+    onReSet() {
       this.searchForm = {
         search: null,
         organId: null,
@@ -274,9 +327,9 @@ export default {
         date: [],
       };
       this.search();
-    }
-  }
+    },
+  },
 };
 </script>
 <style lang='scss' scoped>
-</style>
+</style>