Browse Source

05/29 12:16

11
mo 5 năm trước cách đây
mục cha
commit
7e7cc71e6e

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/index.html


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-24e8c65d.52ad47f3.js


+ 2 - 3
package.json

@@ -6,8 +6,7 @@
   "license": "MIT",
   "scripts": {
     "dev": "vue-cli-service serve",
-    "build:prod": "vue-cli-service build",
-    "build:stage": "vue-cli-service build --mode staging",
+    "build": "vue-cli-service build",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src",
     "test:unit": "jest --clearCache && vue-cli-service test:unit",
@@ -75,4 +74,4 @@
     "> 1%",
     "last 2 versions"
   ]
-}
+}

+ 66 - 1
src/views/recodeManager/recodeList.vue

@@ -76,6 +76,13 @@
           <el-button @click="onReSet"
                      type="primary">重置</el-button>
         </el-form-item>
+        <el-form-item>
+          <!-- <div class="newBand" @click="onExport">导出</div> -->
+          <el-button @click="onExport"
+                     type="primary"
+                     v-permission="'export/queryTeacherAttendances'"
+                     style="background-color: #14928a; border: 1px solid #14928a;">导出</el-button>
+        </el-form-item>
       </el-form>
       <div class="tableWrap">
         <el-table style="width: 100%"
@@ -141,7 +148,7 @@
             </template>
           </el-table-column>
           <el-table-column align="center"
-                           label="签状态">
+                           label="签退状态">
             <template slot-scope="scope">
               <div>
                 {{scope.row.signOutStatus | attendanceOutType}}
@@ -167,6 +174,7 @@ import axios from "axios";
 import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
+import qs from 'qs'
 import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
 import { queryTeacherAttendances } from "@/api/recodeManager";
 import { courseType } from '@/utils/searchArray'
@@ -258,6 +266,63 @@ export default {
       this.courseTime = [nowTime, nowTime];
       this.$refs['searchForm'].resetFields();
       this.search()
+    },
+    onExport () {
+      let obj = { page: this.rules.page, rows: this.rules.limit }
+      Object.assign(obj, this.searchForm)
+      if (this.courseTime && this.courseTime.length > 0) {
+        obj.courseStartDate = this.courseTime[0]
+        obj.courseEndDate = this.courseTime[1]
+      } else {
+        this.$message.error('请选择搜索时间')
+        return
+      }
+      let url = "/api-web/export/queryTeacherAttendances";
+      const options = {
+        method: "POST",
+        headers: {
+          Authorization: getToken()
+        },
+        params: obj,
+        url,
+        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 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();
+          });
+        }).catch(() => { });
     }
   }
 };

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác