فهرست منبع

云教练老师统计

1
mo 2 سال پیش
والد
کامیت
5bf7c593c2
1فایلهای تغییر یافته به همراه127 افزوده شده و 148 حذف شده
  1. 127 148
      src/views/reportForm/index.vue

+ 127 - 148
src/views/reportForm/index.vue

@@ -10,9 +10,9 @@
           name="1"
           v-if="
             $helpers.permission('export/musicGroupRegister') ||
-              $helpers.permission('export/musicGroupNormalStudentNum') ||
-              $helpers.permission('export/exportStudentAttendances') ||
-              $helpers.permission('export/cloudStudyStudentTrainData')
+            $helpers.permission('export/musicGroupNormalStudentNum') ||
+            $helpers.permission('export/exportStudentAttendances') ||
+            $helpers.permission('export/cloudStudyStudentTrainData')
           "
         >
           <template slot="title">
@@ -51,9 +51,7 @@
               :flag="this.organIdList.length < 1"
             />
             <el-tooltip placement="top" popper-class="mTooltip">
-              <div slot="content">
-                请选择分部后,导出招生情况汇总表,分部可多选
-              </div>
+              <div slot="content">请选择分部后,导出招生情况汇总表,分部可多选</div>
               <i
                 class="el-icon-question micon el-tooltip"
                 v-permission="'export/musicGroupRegister'"
@@ -61,10 +59,7 @@
               ></i>
             </el-tooltip>
           </div>
-          <div
-            class="m-wrap"
-            v-permission="'export/musicGroupNormalStudentNum'"
-          >
+          <div class="m-wrap" v-permission="'export/musicGroupNormalStudentNum'">
             <div class="title">乐团在读人数:</div>
             <select-all
               v-model.trim="musicTeamNum"
@@ -139,7 +134,7 @@
               start-placeholder="上课开始日期"
               end-placeholder="上课结束日期"
               :picker-options="{
-                firstDayOfWeek: 1
+                firstDayOfWeek: 1,
               }"
             ></el-date-picker>
             <!-- <el-button
@@ -156,10 +151,7 @@
               errorMsg="请至少选择一个分部"
             />
           </div>
-          <div
-            class="m-wrap"
-            v-permission="'export/cloudStudyStudentTrainData'"
-          >
+          <div class="m-wrap" v-permission="'export/cloudStudyStudentTrainData'">
             <div class="title">云教练学员统计:</div>
             <el-select
               v-model.trim="trainOrganId"
@@ -185,7 +177,7 @@
               start-placeholder="开始日期"
               end-placeholder="结束日期"
               :picker-options="{
-                firstDayOfWeek: 1
+                firstDayOfWeek: 1,
               }"
             ></el-date-picker>
             <!-- <el-button
@@ -206,10 +198,7 @@
           <!-- 老师使用云教练数据
  -->
 
-          <div
-            class="m-wrap"
-            v-permission="'export/teacherCloudTrainingList'"
-          >
+          <div class="m-wrap" v-permission="'export/teacherCloudTrainingList'">
             <div class="title">老师使用云教练数据:</div>
             <select-all
               v-model.trim="trainTeacherOrganId"
@@ -219,14 +208,12 @@
               multiple
               placeholder="请选择分部"
               clearable
-
             >
               <el-option
                 v-for="(item, index) in selects.branchs"
                 :key="index"
                 :label="item.name"
                 :value="item.id"
-
               ></el-option>
             </select-all>
             <el-date-picker
@@ -237,17 +224,22 @@
               range-separator="至"
               start-placeholder="开始日期"
               end-placeholder="结束日期"
-              :picker-options="{
-                firstDayOfWeek: 1
-              }"
+              :picker-options="pickerOptions"
             ></el-date-picker>
-            <el-button
+            <!-- <el-button
               style="margin-left: 10px"
               type="primary"
               @click="exportTeacherTrain"
               >导出</el-button
-            >
-
+            > -->
+            <ExportChiose
+              style="margin-left: 10px"
+              ExportEnum="EXPORT_TEACHER_CLOUD_COURSE_REPORT"
+              :exportData="exportTeacherTrain"
+              fileName="老师使用云教练数据"
+              errorMsg="请选择分部"
+              :flag="!this.trainTeacherOrganId"
+            />
           </div>
           <!--  -->
         </el-collapse-item>
@@ -255,16 +247,16 @@
           name="2"
           v-if="
             $helpers.permission('export/teacherDefaultSalary') ||
-              $helpers.permission('export/studentOrder') ||
-              $helpers.permission('studentInstrument/export') ||
-              $helpers.permission('export/studentVipPractice') ||
-              $helpers.permission('export/exercisesSituation') ||
-              $helpers.permission('export/exportIndexErrData') ||
-              $helpers.permission('export/exportMusicGroupCourseList') ||
-              $helpers.permission('export/EXPORT_INDEX_HISTORY_ERR_DATA') ||
-              $helpers.permission('export/EXPORT_STUDENT_SUBCOURSE') ||
-              $helpers.permission('export/EXPORT_TRAINING_STATISTICS') ||
-              $helpers.permission('export/EXPORT_OPERATING_VISIT_STATISTICS')
+            $helpers.permission('export/studentOrder') ||
+            $helpers.permission('studentInstrument/export') ||
+            $helpers.permission('export/studentVipPractice') ||
+            $helpers.permission('export/exercisesSituation') ||
+            $helpers.permission('export/exportIndexErrData') ||
+            $helpers.permission('export/exportMusicGroupCourseList') ||
+            $helpers.permission('export/EXPORT_INDEX_HISTORY_ERR_DATA') ||
+            $helpers.permission('export/EXPORT_STUDENT_SUBCOURSE') ||
+            $helpers.permission('export/EXPORT_TRAINING_STATISTICS') ||
+            $helpers.permission('export/EXPORT_OPERATING_VISIT_STATISTICS')
           "
         >
           <template slot="title">
@@ -488,7 +480,7 @@
               start-placeholder="开始日期"
               end-placeholder="结束日期"
               :picker-options="{
-                firstDayOfWeek: 1
+                firstDayOfWeek: 1,
               }"
             ></el-date-picker>
             <!-- <el-button
@@ -568,10 +560,7 @@
             />
           </div> -->
 
-          <div
-            class="m-wrap"
-            v-permission="'export/STUDENT_MUSIC_THEORY_COURSE_INFO'"
-          >
+          <div class="m-wrap" v-permission="'export/STUDENT_MUSIC_THEORY_COURSE_INFO'">
             <div class="title">乐理课学员课程导出:</div>
             <select-all
               v-model.trim="musicStudentCourseOrganId"
@@ -601,10 +590,7 @@
             />
           </div>
 
-          <div
-            class="m-wrap"
-            v-permission="'export/exportMusicGroupCourseList'"
-          >
+          <div class="m-wrap" v-permission="'export/exportMusicGroupCourseList'">
             <div class="title">乐团数据导出:</div>
             <select-all
               v-model.trim="teamOrganId"
@@ -632,13 +618,10 @@
               end-placeholder="结束日期"
               @change="getWeekTime"
               :picker-options="{
-                firstDayOfWeek: 1
+                firstDayOfWeek: 1,
               }"
             ></el-date-picker>
-            <el-button
-              style="margin-left: 10px"
-              type="primary"
-              @click="exportMusicGroup"
+            <el-button style="margin-left: 10px" type="primary" @click="exportMusicGroup"
               >导出</el-button
             >
             <!-- <ExportChiose
@@ -706,7 +689,7 @@
               end-placeholder="结束日期"
               @change="getStudentWeekTime"
               :picker-options="{
-                firstDayOfWeek: 1
+                firstDayOfWeek: 1,
               }"
             ></el-date-picker>
             <ExportChiose
@@ -720,10 +703,7 @@
           </div>
 
           <!--  -->
-          <div
-            class="m-wrap"
-            v-permission="'export/EXPORT_TRAINING_STATISTICS'"
-          >
+          <div class="m-wrap" v-permission="'export/EXPORT_TRAINING_STATISTICS'">
             <div class="title">训练统计导出:</div>
             <select-all
               v-model.trim="trainingOrganId"
@@ -750,7 +730,7 @@
               start-placeholder="开始日期"
               end-placeholder="结束日期"
               :picker-options="{
-                firstDayOfWeek: 1
+                firstDayOfWeek: 1,
               }"
             ></el-date-picker>
             <!-- @change="getStudentWeekTime" -->
@@ -764,10 +744,7 @@
             />
           </div>
           <!-- 回访统计导出 -->
-          <div
-            class="m-wrap"
-            v-permission="'export/EXPORT_OPERATING_VISIT_STATISTICS'"
-          >
+          <div class="m-wrap" v-permission="'export/EXPORT_OPERATING_VISIT_STATISTICS'">
             <div class="title">回访统计导出:</div>
             <el-date-picker
               v-model="visitmouth"
@@ -838,7 +815,7 @@
               end-placeholder="结束日期"
               :clearable="false"
               :picker-options="{
-                firstDayOfWeek: 1
+                firstDayOfWeek: 1,
               }"
             ></el-date-picker>
             <!-- @change="getStudentWeekTime" -->
@@ -856,17 +833,14 @@
           name="3"
           v-if="
             $helpers.permission('export/teacherSalary') ||
-              $helpers.permission('export/userCoursesAccount/4388') ||
-              $helpers.permission('export/userCashAccountDetail/4389')
+            $helpers.permission('export/userCoursesAccount/4388') ||
+            $helpers.permission('export/userCashAccountDetail/4389')
           "
         >
           <template slot="title">
             <p class="wrapTitle">财务数据</p>
           </template>
-          <div
-            class="m-wrap"
-            v-permission="'export/EXPORT_OPERATING_REPORT_NEW'"
-          >
+          <div class="m-wrap" v-permission="'export/EXPORT_OPERATING_REPORT_NEW'">
             <div class="title">经营报表导出:</div>
             <el-date-picker
               v-model="operatingMouth"
@@ -979,7 +953,7 @@
               start-placeholder="开始日期"
               end-placeholder="结束日期"
               :picker-options="{
-                firstDayOfWeek: 1
+                firstDayOfWeek: 1,
               }"
             ></el-date-picker>
             <!-- <el-button
@@ -996,10 +970,7 @@
               errorMsg="请选择月份"
             />
           </div>
-          <div
-            class="m-wrap"
-            v-permission="'export/userCashAccountDetail/4389'"
-          >
+          <div class="m-wrap" v-permission="'export/userCashAccountDetail/4389'">
             <div class="title">账户余额明细:</div>
             <select-all
               v-model.trim="AccountDetailOrganId"
@@ -1026,7 +997,7 @@
               start-placeholder="开始日期"
               end-placeholder="结束日期"
               :picker-options="{
-                firstDayOfWeek: 1
+                firstDayOfWeek: 1,
               }"
             ></el-date-picker>
             <!-- <el-button
@@ -1103,7 +1074,7 @@ import load from "@/utils/loading";
 export default {
   name: "reportForm",
   components: {
-    ExportChiose
+    ExportChiose,
   },
   data() {
     return {
@@ -1130,7 +1101,7 @@ export default {
       serviceOrganId: [], // 服务报表
       serviceTimer: [],
       Abnormal: {
-        organIds: []
+        organIds: [],
       },
       activeName: ["1", "2", "3", "4"],
       vipStudentCourseOrganId: [],
@@ -1148,14 +1119,17 @@ export default {
       cloudTimer: [],
       yunOrganId: [],
       yunTimer: [
-        dayjs()
-          .set("date", 1)
-          .format("YYYY-MM-DD"),
-        dayjs().format("YYYY-MM-DD")
+        dayjs().set("date", 1).format("YYYY-MM-DD"),
+        dayjs().format("YYYY-MM-DD"),
       ],
-      trainTeacherOrganId:[],
-trainTeacherTimer:[]
-
+      trainTeacherOrganId: [],
+      trainTeacherTimer: [],
+      pickerOptions: {
+        firstDayOfWeek: 1,
+        disabledDate(time) {
+          return time.getTime() + 86400000 > new Date().getTime();
+        },
+      },
     };
   },
   mounted() {
@@ -1247,29 +1221,29 @@ trainTeacherTimer:[]
         method: "POST",
         headers: {
           Authorization: getToken(),
-          tenantId: getTenantId()
+          tenantId: getTenantId(),
         },
         data: qs.stringify(cleanDeep(data)),
         url,
-        responseType: "blob"
+        responseType: "blob",
       };
       this.$confirm("您确定导出招生情况汇总表", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
           load.startLoading();
           axios(options)
-            .then(res => {
+            .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"
+                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 => {
+              text.then((res) => {
                 // 判断是否报错
                 if (res.indexOf("code") != -1) {
                   let json = JSON.parse(res);
@@ -1302,7 +1276,7 @@ trainTeacherTimer:[]
               });
               load.endLoading();
             })
-            .catch(error => {
+            .catch((error) => {
               this.$message.error("导出数据失败,请联系管理员");
               load.endLoading();
             });
@@ -1388,29 +1362,29 @@ trainTeacherTimer:[]
         method: "POST",
         headers: {
           Authorization: getToken(),
-          tenantId: getTenantId()
+          tenantId: getTenantId(),
         },
         data: qs.stringify(cleanDeep(data)),
         url,
-        responseType: "blob"
+        responseType: "blob",
       };
       this.$confirm("您确定导出乐团在读人数", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
           load.startLoading();
           axios(options)
-            .then(res => {
+            .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"
+                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 => {
+              text.then((res) => {
                 // 判断是否报错
                 if (res.indexOf("code") != -1) {
                   let json = JSON.parse(res);
@@ -1443,7 +1417,7 @@ trainTeacherTimer:[]
               });
               load.endLoading();
             })
-            .catch(error => {
+            .catch((error) => {
               this.$message.error("导出数据失败,请联系管理员");
               load.endLoading();
             });
@@ -1583,35 +1557,12 @@ trainTeacherTimer:[]
           url: "/api-web/questionnaireUserResult/export",
           fileName: "问卷调查.xls",
           method: "get",
-          params: { activeType: this.questionActiveType }
+          params: { activeType: this.questionActiveType },
         },
         "您确定导出问卷调查?"
       );
     },
 
-    exportTeacherTrain(){
-      if(this.trainTeacherTimer.length<1){
-        this.$message.error('请选择时间段')
-        return
-      }
-
-      if(  this.trainTeacherOrganId.length <1){
-        this.$message.error('请选择分部')
-        return
-      }
-      let startTime =this.trainTeacherTimer[0] || null;
-      let endTime = this.trainTeacherTimer[1] || null
-      Export(
-        this,
-        {
-          url: "/api-web/export/teacherCloudTrainingList",
-          fileName: "老师使用云教练数据.xls",
-          method: "post",
-          params: qs.stringify( { organIdList:this.trainTeacherOrganId.join(','),startTime, endTime})
-        },
-        "您确定导出老师使用云教练数据?"
-      );
-    },
     // exportLeBao() {
     //   let endTime, startTime;
     //   if (this.leBaoTimer && this.leBaoTimer.length > 1) {
@@ -1784,8 +1735,7 @@ trainTeacherTimer:[]
       if (serverDate.getDay() == 0) {
         timestamp -= 7 * 24 * 60 * 60 * 1000;
       }
-      let mondayTime =
-        timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
+      let mondayTime = timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
 
       let mondayData = new Date(mondayTime);
       //年
@@ -1797,9 +1747,7 @@ trainTeacherTimer:[]
           : mondayData.getMonth() + 1;
       //日
       let mondayD =
-        mondayData.getDate() < 10
-          ? "0" + mondayData.getDate()
-          : mondayData.getDate();
+        mondayData.getDate() < 10 ? "0" + mondayData.getDate() : mondayData.getDate();
 
       let str = mondayY + "-" + mondayM + "-" + mondayD;
       return str;
@@ -1822,9 +1770,7 @@ trainTeacherTimer:[]
           : SundayData.getMonth() + 1;
       //日
       let tomorrowD =
-        SundayData.getDate() < 10
-          ? "0" + SundayData.getDate()
-          : SundayData.getDate();
+        SundayData.getDate() < 10 ? "0" + SundayData.getDate() : SundayData.getDate();
       let str = tomorrowY + "-" + tomorrowM + "-" + tomorrowD;
       return str;
     },
@@ -1875,7 +1821,7 @@ trainTeacherTimer:[]
     exportMusicGroup() {
       let params = {
         ...getTimes(this.teamTimer, ["startTime", "endTime"]),
-        organId: this.teamOrganId.join(",")
+        organId: this.teamOrganId.join(","),
       };
 
       Export(
@@ -1884,14 +1830,47 @@ trainTeacherTimer:[]
           method: "post",
           url: "/api-web/export/exportMusicGroupCourseList",
           params: this.$helpers.qs.stringify({
-            ...params
-          })
+            ...params,
+          }),
         },
         "是否确认导出报表?"
       );
-    }
+    },
   },
   computed: {
+    exportTeacherTrain() {
+      // if (this.trainTeacherTimer.length < 1) {
+      //   this.$message.error("请选择时间段");
+      //   return;
+      // }
+
+      // if (this.trainTeacherOrganId.length < 1) {
+      //   this.$message.error("请选择分部");
+      //   return;
+      // }
+      let startTime = this.trainTeacherTimer[0] || null;
+      let endTime = this.trainTeacherTimer[1] || null;
+      // Export(
+      //   this,
+      //   {
+      //     url: "/api-web/export/teacherCloudTrainingList",
+      //     fileName: "老师使用云教练数据.xls",
+      //     method: "post",
+      //     params: qs.stringify({
+      //       organIdList: this.trainTeacherOrganId.join(","),
+      //       startTime,
+      //       endTime,
+      //     }),
+      //   },
+      //   "您确定导出老师使用云教练数据?"
+      // );
+      let obj = {
+        organId: this.trainTeacherOrganId.join(","),
+        startTime,
+        endTime,
+      };
+      return obj;
+    },
     exportAttendance() {
       let classStartDate, classEndDate;
       if (this.timer && this.timer.length > 0) {
@@ -1905,7 +1884,7 @@ trainTeacherTimer:[]
         organId: this.attendanceOrganId.join(","),
         groupType: this.attendanceCourseType,
         classStartDate,
-        classEndDate
+        classEndDate,
       };
     },
     exportTrain() {
@@ -1921,7 +1900,7 @@ trainTeacherTimer:[]
       let obj = {
         organId: this.trainOrganId,
         cloudTeacherTrainStartDate,
-        cloudTeacherTrainEndDate
+        cloudTeacherTrainEndDate,
       };
       console.log(obj, "exportTrain");
       return obj;
@@ -1953,19 +1932,19 @@ trainTeacherTimer:[]
       //   return;
       // }
       let data = {
-        organId: this.vipOrganId.join(",")
+        organId: this.vipOrganId.join(","),
       };
       return data;
     },
     exportVipStudent() {
       let data = {
-        organId: this.VipStudentOrganId.join(",")
+        organId: this.VipStudentOrganId.join(","),
       };
       return data;
     },
     exportActive() {
       let data = {
-        organId: this.activeOrganId.join(",")
+        organId: this.activeOrganId.join(","),
       };
       return data;
     },
@@ -1982,7 +1961,7 @@ trainTeacherTimer:[]
       return {
         monday,
         sunday,
-        organId: this.studentServerOrganId.join(",")
+        organId: this.studentServerOrganId.join(","),
       };
     },
 
@@ -1998,13 +1977,13 @@ trainTeacherTimer:[]
       return {
         monday: monday,
         sunday: sunday,
-        organId: this.serviceOrganId.join(",")
+        organId: this.serviceOrganId.join(","),
       };
     },
     exportAbnormal() {
       console.log(this.Abnormal);
       return {
-        organIds: this.Abnormal.organIds.join(",")
+        organIds: this.Abnormal.organIds.join(","),
       };
     },
     exportSalar() {
@@ -2037,7 +2016,7 @@ trainTeacherTimer:[]
       return {
         startTime: startTime,
         endTime: endTime,
-        organId: this.AccountOrganId.join(",")
+        organId: this.AccountOrganId.join(","),
       };
     },
 
@@ -2053,7 +2032,7 @@ trainTeacherTimer:[]
       return {
         startDate: startTime,
         endDate: endTime,
-        organId: this.trainingOrganId.join(",")
+        organId: this.trainingOrganId.join(","),
       };
     },
     exporyun() {
@@ -2068,7 +2047,7 @@ trainTeacherTimer:[]
       return {
         startDate: startTime,
         endDate: endTime,
-        organId: this.yunOrganId.join(",")
+        organId: this.yunOrganId.join(","),
       };
     },
     exportDetailAccount() {
@@ -2083,10 +2062,10 @@ trainTeacherTimer:[]
       return {
         startTime: startTime,
         endTime: endTime,
-        organId: this.AccountDetailOrganId.join(",")
+        organId: this.AccountDetailOrganId.join(","),
       };
-    }
-  }
+    },
+  },
   // AccountDetailTimer
 };
 </script>