| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231 |
- <template>
- <div class="m-container">
- <h2>
- <div class="squrt"></div>
- 报表中心
- </h2>
- <div class="m-core">
- <el-collapse v-model="activeName" accordion class="formCollapse">
- <template slot="title">
- 一致性 Consistency<i class="header-icon el-icon-info"></i>
- </template>
- <el-collapse-item title="一致性 Consistency" name="1">
- <div>
- 与现实生活一致:与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念;
- </div>
- <div>
- 在界面中一致:所有的元素和结构需保持一致,比如:设计样式、图标和文本、元素的位置等。
- </div>
- </el-collapse-item>
- </el-collapse>
- <div class="m-wrap">
- <div class="title">课酬导出:</div>
- <el-date-picker
- v-model="mouth"
- type="month"
- placeholder="选择月"
- value-format="yyyy-MM-dd"
- ></el-date-picker>
- <!-- <el-select v-model.trim="courseScheduleType"
- style="marginLeft:10px"
- filterable
- clearable
- multiple
- placeholder="课程类型">
- <el-option v-for="(item, index) in courseArray"
- :key="index"
- :label="item.label"
- :value="item.value"></el-option>
- </el-select> -->
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportSalar"
- v-permission="'export/teacherSalary'"
- >导出</el-button
- >
- <el-tooltip placement="top" popper-class="mTooltip">
- <div slot="content">将只导出当前选择月份已结算的课程课酬。</div>
- <i
- class="el-icon-question micon el-tooltip"
- style="font-size: 18px; color: #f56c6c"
- v-permission="'export/teacherSalary'"
- ></i>
- </el-tooltip>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">乐团招生汇总:</div>
- <select-all
- v-model.trim="organIdList"
- class="organSelect"
- style="width: 100%"
- filterable
- placeholder="请选择分部"
- multiple
- clearable
- >
- <el-option
- v-for="(item, index) in selects.branchs"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </select-all>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportMusicGroup"
- v-permission="'export/musicGroupRegister'"
- >导出</el-button
- >
- <el-tooltip placement="top" popper-class="mTooltip">
- <div slot="content">
- 请选择分部后,导出招生情况汇总表,分部可多选
- </div>
- <i
- class="el-icon-question micon el-tooltip"
- v-permission="'export/musicGroupRegister'"
- style="font-size: 18px; color: #f56c6c"
- ></i>
- </el-tooltip>
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">老师默认课酬:</div>
- <select-all
- v-model.trim="teacherDefaultSalaryOrganId"
- class="organSelect"
- style="width: 100%"
- filterable
- placeholder="请选择分部"
- multiple
- clearable
- >
- <el-option
- v-for="(item, index) in selects.branchs"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </select-all>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportDefaultSalary"
- v-permission="'export/teacherDefaultSalary'"
- >导出</el-button
- >
- <el-tooltip placement="top" popper-class="mTooltip">
- <div slot="content">请选择分部后,导出老师列表及老师课酬信息</div>
- <i
- class="el-icon-question micon el-tooltip"
- style="font-size: 18px; color: #f56c6c"
- v-permission="'export/teacherDefaultSalary'"
- ></i>
- </el-tooltip>
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">乐团在读人数:</div>
- <select-all
- v-model.trim="musicTeamNum"
- class="organSelect"
- style="width: 100%"
- filterable
- 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-button
- style="margin-left: 10px"
- type="primary"
- @click="exportMusicTeamNum"
- v-permission="'export/musicGroupNormalStudentNum'"
- >导出</el-button
- >
- <el-tooltip placement="top" popper-class="mTooltip">
- <div slot="content">请选择分部后,导出乐团在读人数信息</div>
- <i
- class="el-icon-question micon el-tooltip"
- style="font-size: 18px; color: #f56c6c"
- v-permission="'export/teacherDefaultSalary'"
- ></i>
- </el-tooltip>
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">回款统计:</div>
- <select-all
- v-model.trim="studentOrganId"
- class="organSelect"
- style="width: 100%"
- filterable
- placeholder="请选择分部"
- multiple
- 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
- style="margin-left: 15px"
- v-model="studentMonth"
- type="month"
- placeholder="选择月"
- value-format="yyyy-MM-dd"
- ></el-date-picker>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportStudent"
- v-permission="'export/studentOrder'"
- >导出</el-button
- >
- <el-tooltip placement="top" popper-class="mTooltip">
- <div slot="content">请选择分部和月份,导出回款统计</div>
- <i
- class="el-icon-question micon el-tooltip"
- style="font-size: 18px; color: #f56c6c"
- v-permission="'export/studentOrder'"
- ></i>
- </el-tooltip>
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">学生考勤:</div>
- <select-all
- v-model.trim="attendanceOrganId"
- class="organSelect"
- style="width: 100%"
- filterable
- 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-select
- v-model.trim="attendanceCourseType"
- class="organSelect"
- style="margin-left: 15px; width: 100%"
- filterable
- placeholder="请选择课程类型"
- >
- <el-option
- v-for="(item, index) in courseListType"
- :key="index"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- <el-date-picker
- v-model.trim="timer"
- style="width: 420px; margin-left: 15px"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="上课开始日期"
- end-placeholder="上课结束日期"
- :picker-options="{
- firstDayOfWeek: 1,
- }"
- ></el-date-picker>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportAttendance"
- v-permission="'export/exportStudentAttendances'"
- >导出</el-button
- >
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">课程余额明细:</div>
- <select-all
- v-model.trim="AccountOrganId"
- class="organSelect"
- style="width: 100%"
- filterable
- 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
- v-model.trim="AccountTimer"
- style="width: 420px; margin-left: 15px"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :picker-options="{
- firstDayOfWeek: 1,
- }"
- ></el-date-picker>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportAccount"
- v-permission="'export/userCoursesAccount/4388'"
- >导出</el-button
- >
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">账户余额明细:</div>
- <select-all
- v-model.trim="AccountDetailOrganId"
- class="organSelect"
- style="width: 100%"
- filterable
- 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
- v-model.trim="AccountDetailTimer"
- style="width: 420px; margin-left: 15px"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :picker-options="{
- firstDayOfWeek: 1,
- }"
- ></el-date-picker>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportDetailAccount"
- v-permission="'export/userCashAccountDetail/4389'"
- >导出</el-button
- >
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">乐保订单导出:</div>
- <el-date-picker
- v-model="leBaoTimer"
- style="width: 420px; margin-left: 15px"
- type="monthrange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始月份"
- end-placeholder="结束月份"
- >
- </el-date-picker>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportLeBao"
- v-permission="'studentInstrument/export'"
- >导出</el-button
- >
- <!-- <el-tooltip placement="top"
- popper-class="mTooltip">
- <div slot="content">
- 请选择分部和月份,导出回款统计
- </div>
- <i class="el-icon-question micon el-tooltip"
- style="font-size: 18px; color: #F56C6C"
- v-permission="'export/studentOrder'"></i>
- </el-tooltip> -->
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">团练宝学员统计:</div>
- <el-select
- v-model.trim="trainOrganId"
- class="organSelect"
- style="width: 100%"
- filterable
- placeholder="请选择分部"
- clearable
- >
- <el-option
- v-for="(item, index) in selects.branchs"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportTrain"
- v-permission="'export/cloudStudyStudentTrainData'"
- >导出</el-button
- >
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">问卷调查:</div>
- <el-select
- v-model.trim="questionActiveType"
- class="organSelect"
- style="width: 100%"
- filterable
- placeholder="请选择导出类型"
- clearable
- >
- <el-option
- label="团练宝用户反馈"
- value="CLOUD_TEACHER_FEEDBACK"
- ></el-option>
- </el-select>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportQuestion"
- v-if="$helpers.permission('questionnaireUserResult/export/report')"
- >导出</el-button
- >
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">VIP网管课耗导出:</div>
- <select-all
- v-model.trim="vipOrganId"
- class="organSelect"
- style="width: 100%"
- filterable
- placeholder="请选择分部"
- clearable
- >
- <el-option
- v-for="(item, index) in selects.branchs"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </select-all>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportVip"
- v-permission="'export/studentVipPractice'"
- >导出</el-button
- >
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">服务指标明细导出:</div>
- <select-all
- v-model.trim="serviceOrganId"
- class="organSelect"
- style="width: 100%"
- filterable
- 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
- v-model.trim="serviceTimer"
- style="width: 420px; margin-left: 15px"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- @change="getWeekTime"
- :picker-options="{
- firstDayOfWeek: 1,
- }"
- ></el-date-picker>
- <el-button
- style="margin-left: 10px"
- type="primary"
- @click="exportDetailService"
- v-permission="'export/exercisesSituation'"
- >导出</el-button
- >
- </div>
- </div>
- <el-divider></el-divider>
- <div class="m-core">
- <div class="m-wrap">
- <div class="title">异常处理数据导出:</div>
- <el-select
- clearable
- filterable
- v-model="Abnormal.organId"
- placeholder="请选择分部"
- >
- <el-option
- v-for="(item, index) in selects.branchs"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- <el-button
- type="primary"
- style="margin-left: 10px"
- v-permission="'export/exportIndexErrData'"
- @click="exportAbnormal"
- >导出</el-button
- >
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { exportTeacherSalary } from "@/api/generalSettings";
- import { courseType, courseListType } from "@/utils/searchArray";
- import { Export } from "@/utils/downLoadFile";
- import cleanDeep from "clean-deep";
- import dayjs from "dayjs";
- import axios from "axios";
- import qs from "qs";
- import { getToken, getTenantId } from "@/utils/auth";
- import load from "@/utils/loading";
- export default {
- name: "reportForm",
- data() {
- return {
- mouth: "",
- organIdList: [],
- teacherDefaultSalaryOrganId: "",
- courseArray: courseType,
- courseListType,
- courseScheduleType: [],
- musicTeamNum: [],
- studentOrganId: "",
- studentMonth: "",
- attendanceOrganId: [],
- attendanceCourseType: "MUSIC",
- timer: [],
- leBaoTimer: [],
- AccountOrganId: [],
- AccountTimer: [],
- AccountDetailOrganId: [],
- AccountDetailTimer: [],
- trainOrganId: null,
- questionActiveType: "CLOUD_TEACHER_FEEDBACK",
- vipOrganId: [],
- serviceOrganId: [], // 服务报表
- serviceTimer: [],
- Abnormal: {
- organId: null,
- },
- activeName:[]
- };
- },
- mounted() {
- this.$store.dispatch("setBranchs");
- },
- methods: {
- exportSalar() {
- if (!this.mouth) {
- this.$message.error("请选择导出月份");
- return;
- }
- // let courseTypeList = this.courseScheduleType.join(',')
- let url = "/api-web/export/teacherSalary";
- let data = { date: this.mouth };
- const options = {
- method: "POST",
- headers: {
- Authorization: getToken(),
- tenantId: getTenantId(),
- },
- data: qs.stringify(cleanDeep(data)),
- 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 nowTime = new Date();
- let ymd =
- nowTime.getFullYear() +
- "" +
- (nowTime.getMonth() + 1) +
- "" +
- nowTime.getDate();
- let fname = ymd + "课酬.xls"; //下载文件的名字
- link.href = objectUrl;
- link.setAttribute("download", fname);
- document.body.appendChild(link);
- link.click();
- }
- });
- load.endLoading();
- })
- .catch((error) => {
- this.$message.error("导出数据失败,请联系管理员");
- load.endLoading();
- });
- })
- .catch(() => {});
- },
- exportMusicGroup() {
- if (this.organIdList.length < 1) {
- this.$message.error("请至少选择一个分部");
- return;
- }
- let url = "/api-web/export/musicGroupRegister";
- let data = { organIds: this.organIdList.join(",") };
- const options = {
- method: "POST",
- headers: {
- Authorization: getToken(),
- tenantId: getTenantId(),
- },
- data: qs.stringify(cleanDeep(data)),
- 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 nowTime = new Date();
- let ymd =
- nowTime.getFullYear() +
- "" +
- (nowTime.getMonth() + 1) +
- "" +
- nowTime.getDate();
- let fname = ymd + "招生情况汇总表.xls"; //下载文件的名字
- link.href = objectUrl;
- link.setAttribute("download", fname);
- document.body.appendChild(link);
- link.click();
- }
- });
- load.endLoading();
- })
- .catch((error) => {
- this.$message.error("导出数据失败,请联系管理员");
- load.endLoading();
- });
- })
- .catch(() => {});
- },
- exportDefaultSalary() {
- let organIdList = this.teacherDefaultSalaryOrganId.join(",");
- let url = "/api-web/export/teacherDefaultSalary";
- let data = { organIdList };
- const options = {
- method: "POST",
- headers: {
- Authorization: getToken(),
- tenantId: getTenantId(),
- },
- data: qs.stringify(cleanDeep(data)),
- 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 nowTime = new Date();
- let ymd =
- nowTime.getFullYear() +
- "" +
- (nowTime.getMonth() + 1) +
- "" +
- nowTime.getDate();
- let fname = ymd + "老师默认课酬表.xls"; //下载文件的名字
- link.href = objectUrl;
- link.setAttribute("download", fname);
- document.body.appendChild(link);
- link.click();
- }
- });
- load.endLoading();
- })
- .catch((error) => {
- this.$message.error("导出数据失败,请联系管理员");
- load.endLoading();
- });
- })
- .catch(() => {});
- },
- exportMusicTeamNum() {
- let organIds = this.musicTeamNum.join(",");
- let url = "/api-web/export/musicGroupNormalStudentNum";
- let data = { organIds };
- const options = {
- method: "POST",
- headers: {
- Authorization: getToken(),
- tenantId: getTenantId(),
- },
- data: qs.stringify(cleanDeep(data)),
- 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 nowTime = new Date();
- let ymd =
- nowTime.getFullYear() +
- "" +
- (nowTime.getMonth() + 1) +
- "" +
- nowTime.getDate();
- let fname = ymd + "乐团在读人数.xls"; //下载文件的名字
- link.href = objectUrl;
- link.setAttribute("download", fname);
- document.body.appendChild(link);
- link.click();
- }
- });
- load.endLoading();
- })
- .catch((error) => {
- this.$message.error("导出数据失败,请联系管理员");
- load.endLoading();
- });
- })
- .catch(() => {});
- },
- exportStudent() {
- if (!this.studentMonth) {
- this.$message.error("请选择导出月份");
- return;
- }
- let studentOrganId = this.studentOrganId.join(",");
- let url = "/api-web/export/studentOrder";
- let data = { organIds: studentOrganId, date: this.studentMonth };
- const options = {
- method: "POST",
- headers: {
- Authorization: getToken(),
- tenantId: getTenantId(),
- },
- data: qs.stringify(cleanDeep(data)),
- 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 nowTime = new Date();
- let ymd =
- nowTime.getFullYear() +
- "" +
- (nowTime.getMonth() + 1) +
- "" +
- nowTime.getDate();
- let fname = ymd + "回款统计.xls"; //下载文件的名字
- link.href = objectUrl;
- link.setAttribute("download", fname);
- document.body.appendChild(link);
- link.click();
- }
- });
- load.endLoading();
- })
- .catch((error) => {
- this.$message.error("导出数据失败,请联系管理员");
- load.endLoading();
- });
- })
- .catch(() => {});
- },
- exportAttendance() {
- let classStartDate, classEndDate;
- if (this.timer && this.timer.length > 0) {
- classStartDate = this.timer[0];
- classEndDate = this.timer[1];
- } else {
- classStartDate = null;
- classEndDate = null;
- }
- Export(
- this,
- {
- url: "/api-web/export/exportStudentAttendances",
- fileName: "学生考勤.xls",
- method: "post",
- params: qs.stringify({
- organId: this.attendanceOrganId.join(","),
- groupType: this.attendanceCourseType,
- classStartDate,
- classEndDate,
- }),
- },
- "您确定导出学生考勤?"
- );
- },
- exportTrain() {
- if (!this.trainOrganId) {
- this.$message.error("请选择分部");
- return;
- }
- Export(
- this,
- {
- url: "/api-web/export/cloudStudyStudentTrainData",
- fileName: "团练宝学员统计.xls",
- method: "post",
- params: qs.stringify({
- organId: this.trainOrganId,
- }),
- },
- "您确定导出团练宝学员统计?"
- );
- },
- exportQuestion() {
- Export(
- this,
- {
- url: "/api-web/questionnaireUserResult/export",
- fileName: "问卷调查.xls",
- method: "get",
- params: { activeType: this.questionActiveType },
- },
- "您确定导出问卷调查?"
- );
- },
- exportLeBao() {
- let endTime, startTime;
- if (this.leBaoTimer && this.leBaoTimer.length > 1) {
- startTime = this.leBaoTimer[0];
- let end = this.leBaoTimer[1];
- end = new Date(end);
- end = new Date(end.getFullYear(), end.getMonth() + 1, 0);
- endTime = dayjs(end).format("YYYY-MM-DD");
- } else {
- this.$message.error("请选择导出月份");
- return;
- }
- Export(
- this,
- {
- url: "/api-web/studentInstrument/export",
- fileName: "乐保订单.xls",
- method: "get",
- params: { startTime: startTime, endTime: endTime },
- },
- "您确定导出乐保订单?"
- );
- },
- exportAccount() {
- let endTime, startTime;
- if (this.AccountTimer && this.AccountTimer.length > 1) {
- startTime = this.AccountTimer[0];
- endTime = this.AccountTimer[1];
- } else {
- startTime = null;
- endTime = null;
- }
- Export(
- this,
- {
- url: "/api-web/export/userCoursesAccount",
- fileName: "课程余额明细.xls",
- method: "post",
- params: qs.stringify({
- startTime: startTime,
- endTime: endTime,
- organId: this.AccountOrganId.join(","),
- }),
- },
- "您确定导出课程余额明细?"
- );
- },
- exportDetailAccount() {
- let endTime, startTime;
- if (this.AccountDetailTimer && this.AccountDetailTimer.length > 1) {
- startTime = this.AccountDetailTimer[0];
- endTime = this.AccountDetailTimer[1];
- } else {
- startTime = null;
- endTime = null;
- }
- Export(
- this,
- {
- url: "/api-web/export/userCashAccountDetail",
- fileName: "账户余额明细.xls",
- method: "post",
- params: qs.stringify({
- startTime: startTime,
- endTime: endTime,
- organId: this.AccountDetailOrganId.join(","),
- }),
- },
- "您确定导出账户余额明细?"
- );
- },
- exportVip() {
- if (!this.vipOrganId.length < 0) {
- this.$message.error("请选择分部");
- return;
- }
- let data = {
- organId: this.vipOrganId.join(","),
- };
- let url = "/api-web/export/studentVipPractice";
- const options = {
- method: "get",
- headers: {
- Authorization: getToken(),
- tenantId: getTenantId(),
- },
- params: cleanDeep(data),
- url,
- responseType: "form",
- };
- this.$confirm("您确定导出VIP网管课耗", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- load.startLoading();
- axios(options)
- .then((res) => {
- load.endLoading();
- if (res.data.code == 200) {
- this.$message.info(res.data.msg);
- } else {
- this.$message.error(res.data.msg);
- }
- // this.$confirm(res.data.data, "提示", {
- // confirmButtonText: "确定",
- // cancelButtonText: "取消",
- // type: "warning",
- // }).then(() => {
- // }).catch(err => {
- // })
- })
- .catch((error) => {
- this.$message.error("导出数据失败,请联系管理员");
- load.endLoading();
- });
- })
- .catch(() => {});
- // Export(
- // this,
- // {
- // url: "/api-web/export/studentVipPractice",
- // fileName: "vip网管课.xls",
- // method: "post",
- // params: qs.stringify({
- // organId: this.vipOrganId.join(',')
- // }),
- // },
- // "您确定导出vip网管课?"
- // );
- },
- exportDetailService() {
- let sunday, monday;
- if (this.serviceTimer && this.serviceTimer.length > 1) {
- monday = this.serviceTimer[0];
- sunday = this.serviceTimer[1];
- } else {
- monday = null;
- sunday = null;
- }
- Export(
- this,
- {
- url: "/api-web/export/exercisesSituation",
- fileName: "服务指标明细.xls",
- method: "post",
- params: qs.stringify({
- monday: monday,
- sunday: sunday,
- organId: this.serviceOrganId.join(","),
- }),
- },
- "您确定导出服务指标明细?"
- );
- },
- getNowDateAndMonday(time) {
- let timestamp = new Date(time.replace(/-/g, "/")).getTime();
- let serverDate = new Date(time);
- if (serverDate.getDay() == 0) {
- timestamp -= 7 * 24 * 60 * 60 * 1000;
- }
- let mondayTime =
- timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
- let mondayData = new Date(mondayTime);
- //年
- let mondayY = mondayData.getFullYear();
- //月
- let mondayM =
- mondayData.getMonth() + 1 < 10
- ? "0" + (mondayData.getMonth() + 1)
- : mondayData.getMonth() + 1;
- //日
- let mondayD =
- mondayData.getDate() < 10
- ? "0" + mondayData.getDate()
- : mondayData.getDate();
- let str = mondayY + "-" + mondayM + "-" + mondayD;
- return str;
- },
- getNowDateAndSunday(time) {
- let timestamp = new Date(time.replace(/-/g, "/")).getTime();
- let serverDate = new Date(time);
- let num = 7 - serverDate.getDay();
- if (num == 7) {
- num = 0;
- }
- let sundayTiem = timestamp + num * 24 * 60 * 60 * 1000;
- let SundayData = new Date(sundayTiem);
- //年
- let tomorrowY = SundayData.getFullYear(); //月
- let tomorrowM =
- SundayData.getMonth() + 1 < 10
- ? "0" + (SundayData.getMonth() + 1)
- : SundayData.getMonth() + 1;
- //日
- let tomorrowD =
- SundayData.getDate() < 10
- ? "0" + SundayData.getDate()
- : SundayData.getDate();
- let str = tomorrowY + "-" + tomorrowM + "-" + tomorrowD;
- return str;
- },
- getWeekTime(val) {
- if (val && val.length > 0) {
- let start = this.getNowDateAndMonday(val[0]);
- let end = this.getNowDateAndSunday(val[1]);
- this.serviceTimer.splice(0, 1, start);
- this.serviceTimer.splice(1, 1, end);
- }
- },
- exportAbnormal() {
- let params = this.Abnormal;
- Export(
- this,
- {
- method: "post",
- url: "/api-web/export/exportIndexErrData",
- params: this.$helpers.qs.stringify({
- ...params,
- }),
- },
- "是否确认导出报表?"
- );
- },
- },
- // AccountDetailTimer
- };
- </script>
- <style lang="scss" scoped>
- .m-container {
- .m-core {
- // margin-top: 20px;
- .m-wrap {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- width: 100%;
- align-items: center;
- .newBand {
- margin: 0 5px 0 10px;
- }
- .title {
- width: 150px;
- // height: 40px;
- // line-height: 40px;
- text-align: right;
- color: #606266;
- }
- .organSelect {
- width: 220px !important;
- }
- .el-tooltip.micon {
- width: 20px;
- height: 20px;
- position: relative;
- // top: 12px;
- }
- }
- }
- .formCollapse {
- border:none;
- /deep/.el-collapse-item__header{
- border-bottom: none;
- background-color: #F8F8F8;
- }
- }
- }
- /deep/.el-input__icon.el-icon-date {
- height: 40px !important;
- }
- </style>
|