lex-xin пре 5 година
родитељ
комит
9c287d47df

+ 23 - 11
src/views/businessManager/orderManager/income.vue

@@ -151,6 +151,7 @@ import { orderStatus, dealStatus } from '@/utils/searchArray'
 import axios from 'axios'
 import qs from 'qs'
 import { getToken } from '@/utils/auth'
+import load from '@/utils/loading'
 export default {
   components: { pagination },
   name: 'income',
@@ -231,23 +232,34 @@ export default {
           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 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()
+            
+            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(() => {})
       },

+ 22 - 11
src/views/businessManager/orderManager/incomeOne.vue

@@ -164,6 +164,7 @@ import qs from 'qs'
 import {
   getToken
 } from '@/utils/auth'
+import load from '@/utils/loading'
 export default {
   components: {
     pagination
@@ -246,23 +247,33 @@ export default {
         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 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()
+          
+          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(() => { })
     },

+ 23 - 11
src/views/reportForm/index.vue

@@ -24,6 +24,7 @@ import axios from 'axios'
 import {
   getToken
 } from '@/utils/auth'
+import load from '@/utils/loading'
 import qs from 'qs'
 export default {
   name: "reportForm",
@@ -55,22 +56,33 @@ export default {
         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 objectUrl = URL.createObjectURL(blob)
-          let link = document.createElement("a")
-          let nowTime = new Date()
-          let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate()
-          let fname =  ymd + '课酬' //下载文件的名字
-          link.href = objectUrl
-          link.setAttribute("download", fname)
-          document.body.appendChild(link)
-          link.click()
+          
+          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()
+              let fname =  ymd + '课酬' //下载文件的名字
+              link.href = objectUrl
+              link.setAttribute("download", fname)
+              document.body.appendChild(link)
+              link.click()
+            }
+          })
+          load.endLoading();
         })
       }).catch(() => { })
   }
@@ -87,7 +99,7 @@ export default {
     width: 100%;
     // align-items: center;
     .newBand {
-      margin: 0 5px 0 50px;
+      margin: 0 5px 0 10px;
     }
     .el-tooltip.micon {
       width: 20px;

+ 20 - 17
src/views/studentManager/studentList.vue

@@ -402,13 +402,6 @@ export default {
     },
     downLoadStudent () {
       let url = '/api-web/export/studentHasCourse'
-      // organId: null,
-      //   search: null,
-      //   studentName: null,
-      //   isActive: null,
-      //   hasCourse: null,
-      //   isMake:null,
-      //   hasPracticeCourse:null
       let searchForm = this.searchForm
       let data = {
         organId: searchForm.organId ? searchForm.organId : null,
@@ -440,16 +433,26 @@ export default {
             type: 'application/vnd.ms-excel;charset=utf-8'
             // word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
           })
-          let objectUrl = URL.createObjectURL(blob)
-          let link = document.createElement("a")
-          let nowTime = new Date()
-          let ymd = nowTime.getFullYear() + (nowTime.getMonth() + 1) + nowTime.getDate()
-          let fname = `导出学员名单` + ymd //下载文件的名字
-          link.href = objectUrl
-          link.setAttribute("download", fname)
-          document.body.appendChild(link)
-          link.click()
-           load.endLoading();
+          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()
+              let fname = `导出学员名单` + ymd //下载文件的名字
+              link.href = objectUrl
+              link.setAttribute("download", fname)
+              document.body.appendChild(link)
+              link.click()
+            }
+          })
+          
+          load.endLoading();
         })
       }).catch(() => { })
 

+ 34 - 15
src/views/teamBuild/signupList.vue

@@ -389,6 +389,7 @@ import { vaildStudentUrl, vaildTeacherUrl } from '@/utils/validate'
 import QRCode from 'qrcodejs2'
 import axios from 'axios'
 import { getToken } from '@/utils/auth'
+import load from '@/utils/loading'
 import qs from 'qs'
 export default {
   name: 'signupList',
@@ -657,22 +658,40 @@ export default {
         url,
         responseType: 'blob'
       }
-      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
+      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 = this.$route.query.id + '-' + ymd //下载文件的名字
+              link.href = objectUrl
+              link.setAttribute("download", fname)
+              document.body.appendChild(link)
+              link.click()
+            }
+          })
+          load.endLoading();
         })
-        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 = this.$route.query.id + '-' + ymd //下载文件的名字
-        link.href = objectUrl
-        link.setAttribute("download", fname)
-        document.body.appendChild(link)
-        link.click()
-      })
+      }).catch(() => { })
     },
     onGoHome () { // 确认开团
       // 判断是否有学生缴费

+ 47 - 22
src/views/teamDetail/components/baseInfo.vue

@@ -95,6 +95,7 @@ import qs from 'qs'
 import {
   getToken
 } from '@/utils/auth'
+import load from '@/utils/loading'
 export default {
   name: "tbaseInfo",
   props: ['teamid'],
@@ -179,23 +180,35 @@ export default {
         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 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 = this.$route.query.id + '-' + ymd + '发放清单' //下载文件的名字
-          link.href = objectUrl
-          link.setAttribute("download", fname)
-          document.body.appendChild(link)
-          link.click()
+          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 = this.$route.query.id + '-' + ymd + '发放清单' //下载文件的名字
+              link.href = objectUrl
+              link.setAttribute("download", fname)
+              document.body.appendChild(link)
+              link.click()
+            }
+          })
+          load.endLoading();
+          
         })
       }).catch(() => { })
 
@@ -219,23 +232,35 @@ export default {
         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 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 = this.$route.query.id + '-' + ymd + '分发清单' //下载文件的名字
-          link.href = objectUrl
-          link.setAttribute("download", fname)
-          document.body.appendChild(link)
-          link.click()
+          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 = this.$route.query.id + '-' + ymd + '分发清单' //下载文件的名字
+              link.href = objectUrl
+              link.setAttribute("download", fname)
+              document.body.appendChild(link)
+              link.click()
+            }
+          })
+          load.endLoading();
+          
         })
       }).catch(() => { })
     }

+ 20 - 8
src/views/teamDetail/teamCourseList.vue

@@ -256,6 +256,7 @@ import gpsLoction from "./componentCourse/gpsLocation";
 import studentWork from "./componentCourse/studentWork";
 import axios from "axios";
 import { getToken } from "@/utils/auth";
+import load from '@/utils/loading'
 let nowTime = new Date();
 nowTime =
   nowTime.getFullYear() +
@@ -369,20 +370,31 @@ export default {
         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 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();
-          });
+            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(() => {});
     },

+ 42 - 18
src/views/teamDetail/teamDetailedList.vue

@@ -79,6 +79,7 @@ import { verifyMusicalList } from '@/api/orderManager'
 import axios from 'axios'
 import qs from 'qs'
 import { getToken } from '@/utils/auth'
+import load from '@/utils/loading'
 export default {
   data () {
     return {
@@ -145,21 +146,33 @@ export default {
         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 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 = this.$route.query.id + '-' + ymd + '发放清单' //下载文件的名字
-          link.href = objectUrl
-          link.setAttribute("download", fname)
-          document.body.appendChild(link)
-          link.click()
+          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 = this.$route.query.id + '-' + ymd + '发放清单' //下载文件的名字
+              link.href = objectUrl
+              link.setAttribute("download", fname)
+              document.body.appendChild(link)
+              link.click()
+            }
+          })
+          load.endLoading();
+          
         })
       }).catch(() => { })
     },
@@ -182,21 +195,32 @@ export default {
         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 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 = this.$route.query.id + '-' + ymd + '分发清单' //下载文件的名字
-          link.href = objectUrl
-          link.setAttribute("download", fname)
-          document.body.appendChild(link)
-          link.click()
+          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 = this.$route.query.id + '-' + ymd + '分发清单' //下载文件的名字
+              link.href = objectUrl
+              link.setAttribute("download", fname)
+              document.body.appendChild(link)
+              link.click()
+            }
+          })
+          load.endLoading();
         })
       }).catch(() => { })
     }

+ 21 - 9
src/views/vipClass/vipList.vue

@@ -196,6 +196,7 @@ import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
 import store from "@/store";
 import axios from "axios";
 import { getToken } from "@/utils/auth";
+import load from '@/utils/loading'
 export default {
   components: { pagination },
   name: "vipList",
@@ -360,22 +361,33 @@ export default {
         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 objectUrl = URL.createObjectURL(blob);
-            let link = document.createElement("a");
-            let fname = "VIP列表" + new Date().getTime(); //下载文件的名字
-            link.href = objectUrl;
-            link.setAttribute("download", fname);
-            document.body.appendChild(link);
-            link.click();
+            
+            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 = "VIP列表" + new Date().getTime(); //下载文件的名字
+                link.href = objectUrl;
+                link.setAttribute("download", fname);
+                document.body.appendChild(link);
+                link.click();
+              }
+            })
+            load.endLoading();
           });
-        })
-        .catch(() => {});
+        }).catch(() => {});
     },
     // 修改vip
     resetVip(id) {