index.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>
  5. 报表中心
  6. </h2>
  7. <div class="m-core">
  8. <el-collapse v-model="activeName" accordion class="formCollapse">
  9. <template slot="title">
  10. 一致性 Consistency<i class="header-icon el-icon-info"></i>
  11. </template>
  12. <el-collapse-item title="一致性 Consistency" name="1">
  13. <div>
  14. 与现实生活一致:与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念;
  15. </div>
  16. <div>
  17. 在界面中一致:所有的元素和结构需保持一致,比如:设计样式、图标和文本、元素的位置等。
  18. </div>
  19. </el-collapse-item>
  20. </el-collapse>
  21. <div class="m-wrap">
  22. <div class="title">课酬导出:</div>
  23. <el-date-picker
  24. v-model="mouth"
  25. type="month"
  26. placeholder="选择月"
  27. value-format="yyyy-MM-dd"
  28. ></el-date-picker>
  29. <!-- <el-select v-model.trim="courseScheduleType"
  30. style="marginLeft:10px"
  31. filterable
  32. clearable
  33. multiple
  34. placeholder="课程类型">
  35. <el-option v-for="(item, index) in courseArray"
  36. :key="index"
  37. :label="item.label"
  38. :value="item.value"></el-option>
  39. </el-select> -->
  40. <el-button
  41. style="margin-left: 10px"
  42. type="primary"
  43. @click="exportSalar"
  44. v-permission="'export/teacherSalary'"
  45. >导出</el-button
  46. >
  47. <el-tooltip placement="top" popper-class="mTooltip">
  48. <div slot="content">将只导出当前选择月份已结算的课程课酬。</div>
  49. <i
  50. class="el-icon-question micon el-tooltip"
  51. style="font-size: 18px; color: #f56c6c"
  52. v-permission="'export/teacherSalary'"
  53. ></i>
  54. </el-tooltip>
  55. </div>
  56. <el-divider></el-divider>
  57. <div class="m-core">
  58. <div class="m-wrap">
  59. <div class="title">乐团招生汇总:</div>
  60. <select-all
  61. v-model.trim="organIdList"
  62. class="organSelect"
  63. style="width: 100%"
  64. filterable
  65. placeholder="请选择分部"
  66. multiple
  67. clearable
  68. >
  69. <el-option
  70. v-for="(item, index) in selects.branchs"
  71. :key="index"
  72. :label="item.name"
  73. :value="item.id"
  74. ></el-option>
  75. </select-all>
  76. <el-button
  77. style="margin-left: 10px"
  78. type="primary"
  79. @click="exportMusicGroup"
  80. v-permission="'export/musicGroupRegister'"
  81. >导出</el-button
  82. >
  83. <el-tooltip placement="top" popper-class="mTooltip">
  84. <div slot="content">
  85. 请选择分部后,导出招生情况汇总表,分部可多选
  86. </div>
  87. <i
  88. class="el-icon-question micon el-tooltip"
  89. v-permission="'export/musicGroupRegister'"
  90. style="font-size: 18px; color: #f56c6c"
  91. ></i>
  92. </el-tooltip>
  93. </div>
  94. </div>
  95. <el-divider></el-divider>
  96. <div class="m-core">
  97. <div class="m-wrap">
  98. <div class="title">老师默认课酬:</div>
  99. <select-all
  100. v-model.trim="teacherDefaultSalaryOrganId"
  101. class="organSelect"
  102. style="width: 100%"
  103. filterable
  104. placeholder="请选择分部"
  105. multiple
  106. clearable
  107. >
  108. <el-option
  109. v-for="(item, index) in selects.branchs"
  110. :key="index"
  111. :label="item.name"
  112. :value="item.id"
  113. ></el-option>
  114. </select-all>
  115. <el-button
  116. style="margin-left: 10px"
  117. type="primary"
  118. @click="exportDefaultSalary"
  119. v-permission="'export/teacherDefaultSalary'"
  120. >导出</el-button
  121. >
  122. <el-tooltip placement="top" popper-class="mTooltip">
  123. <div slot="content">请选择分部后,导出老师列表及老师课酬信息</div>
  124. <i
  125. class="el-icon-question micon el-tooltip"
  126. style="font-size: 18px; color: #f56c6c"
  127. v-permission="'export/teacherDefaultSalary'"
  128. ></i>
  129. </el-tooltip>
  130. </div>
  131. </div>
  132. <el-divider></el-divider>
  133. <div class="m-core">
  134. <div class="m-wrap">
  135. <div class="title">乐团在读人数:</div>
  136. <select-all
  137. v-model.trim="musicTeamNum"
  138. class="organSelect"
  139. style="width: 100%"
  140. filterable
  141. multiple
  142. placeholder="请选择分部"
  143. clearable
  144. >
  145. <el-option
  146. v-for="(item, index) in selects.branchs"
  147. :key="index"
  148. :label="item.name"
  149. :value="item.id"
  150. ></el-option>
  151. </select-all>
  152. <el-button
  153. style="margin-left: 10px"
  154. type="primary"
  155. @click="exportMusicTeamNum"
  156. v-permission="'export/musicGroupNormalStudentNum'"
  157. >导出</el-button
  158. >
  159. <el-tooltip placement="top" popper-class="mTooltip">
  160. <div slot="content">请选择分部后,导出乐团在读人数信息</div>
  161. <i
  162. class="el-icon-question micon el-tooltip"
  163. style="font-size: 18px; color: #f56c6c"
  164. v-permission="'export/teacherDefaultSalary'"
  165. ></i>
  166. </el-tooltip>
  167. </div>
  168. </div>
  169. <el-divider></el-divider>
  170. <div class="m-core">
  171. <div class="m-wrap">
  172. <div class="title">回款统计:</div>
  173. <select-all
  174. v-model.trim="studentOrganId"
  175. class="organSelect"
  176. style="width: 100%"
  177. filterable
  178. placeholder="请选择分部"
  179. multiple
  180. clearable
  181. >
  182. <el-option
  183. v-for="(item, index) in selects.branchs"
  184. :key="index"
  185. :label="item.name"
  186. :value="item.id"
  187. ></el-option>
  188. </select-all>
  189. <el-date-picker
  190. style="margin-left: 15px"
  191. v-model="studentMonth"
  192. type="month"
  193. placeholder="选择月"
  194. value-format="yyyy-MM-dd"
  195. ></el-date-picker>
  196. <el-button
  197. style="margin-left: 10px"
  198. type="primary"
  199. @click="exportStudent"
  200. v-permission="'export/studentOrder'"
  201. >导出</el-button
  202. >
  203. <el-tooltip placement="top" popper-class="mTooltip">
  204. <div slot="content">请选择分部和月份,导出回款统计</div>
  205. <i
  206. class="el-icon-question micon el-tooltip"
  207. style="font-size: 18px; color: #f56c6c"
  208. v-permission="'export/studentOrder'"
  209. ></i>
  210. </el-tooltip>
  211. </div>
  212. </div>
  213. <el-divider></el-divider>
  214. <div class="m-core">
  215. <div class="m-wrap">
  216. <div class="title">学生考勤:</div>
  217. <select-all
  218. v-model.trim="attendanceOrganId"
  219. class="organSelect"
  220. style="width: 100%"
  221. filterable
  222. multiple
  223. placeholder="请选择分部"
  224. clearable
  225. >
  226. <el-option
  227. v-for="(item, index) in selects.branchs"
  228. :key="index"
  229. :label="item.name"
  230. :value="item.id"
  231. ></el-option>
  232. </select-all>
  233. <el-select
  234. v-model.trim="attendanceCourseType"
  235. class="organSelect"
  236. style="margin-left: 15px; width: 100%"
  237. filterable
  238. placeholder="请选择课程类型"
  239. >
  240. <el-option
  241. v-for="(item, index) in courseListType"
  242. :key="index"
  243. :label="item.label"
  244. :value="item.value"
  245. ></el-option>
  246. </el-select>
  247. <el-date-picker
  248. v-model.trim="timer"
  249. style="width: 420px; margin-left: 15px"
  250. type="daterange"
  251. value-format="yyyy-MM-dd"
  252. range-separator="至"
  253. start-placeholder="上课开始日期"
  254. end-placeholder="上课结束日期"
  255. :picker-options="{
  256. firstDayOfWeek: 1,
  257. }"
  258. ></el-date-picker>
  259. <el-button
  260. style="margin-left: 10px"
  261. type="primary"
  262. @click="exportAttendance"
  263. v-permission="'export/exportStudentAttendances'"
  264. >导出</el-button
  265. >
  266. </div>
  267. </div>
  268. <el-divider></el-divider>
  269. <div class="m-core">
  270. <div class="m-wrap">
  271. <div class="title">课程余额明细:</div>
  272. <select-all
  273. v-model.trim="AccountOrganId"
  274. class="organSelect"
  275. style="width: 100%"
  276. filterable
  277. multiple
  278. placeholder="请选择分部"
  279. clearable
  280. >
  281. <el-option
  282. v-for="(item, index) in selects.branchs"
  283. :key="index"
  284. :label="item.name"
  285. :value="item.id"
  286. ></el-option>
  287. </select-all>
  288. <el-date-picker
  289. v-model.trim="AccountTimer"
  290. style="width: 420px; margin-left: 15px"
  291. type="daterange"
  292. value-format="yyyy-MM-dd"
  293. range-separator="至"
  294. start-placeholder="开始日期"
  295. end-placeholder="结束日期"
  296. :picker-options="{
  297. firstDayOfWeek: 1,
  298. }"
  299. ></el-date-picker>
  300. <el-button
  301. style="margin-left: 10px"
  302. type="primary"
  303. @click="exportAccount"
  304. v-permission="'export/userCoursesAccount/4388'"
  305. >导出</el-button
  306. >
  307. </div>
  308. </div>
  309. <el-divider></el-divider>
  310. <div class="m-core">
  311. <div class="m-wrap">
  312. <div class="title">账户余额明细:</div>
  313. <select-all
  314. v-model.trim="AccountDetailOrganId"
  315. class="organSelect"
  316. style="width: 100%"
  317. filterable
  318. multiple
  319. placeholder="请选择分部"
  320. clearable
  321. >
  322. <el-option
  323. v-for="(item, index) in selects.branchs"
  324. :key="index"
  325. :label="item.name"
  326. :value="item.id"
  327. ></el-option>
  328. </select-all>
  329. <el-date-picker
  330. v-model.trim="AccountDetailTimer"
  331. style="width: 420px; margin-left: 15px"
  332. type="daterange"
  333. value-format="yyyy-MM-dd"
  334. range-separator="至"
  335. start-placeholder="开始日期"
  336. end-placeholder="结束日期"
  337. :picker-options="{
  338. firstDayOfWeek: 1,
  339. }"
  340. ></el-date-picker>
  341. <el-button
  342. style="margin-left: 10px"
  343. type="primary"
  344. @click="exportDetailAccount"
  345. v-permission="'export/userCashAccountDetail/4389'"
  346. >导出</el-button
  347. >
  348. </div>
  349. </div>
  350. <el-divider></el-divider>
  351. <div class="m-core">
  352. <div class="m-wrap">
  353. <div class="title">乐保订单导出:</div>
  354. <el-date-picker
  355. v-model="leBaoTimer"
  356. style="width: 420px; margin-left: 15px"
  357. type="monthrange"
  358. value-format="yyyy-MM-dd"
  359. range-separator="至"
  360. start-placeholder="开始月份"
  361. end-placeholder="结束月份"
  362. >
  363. </el-date-picker>
  364. <el-button
  365. style="margin-left: 10px"
  366. type="primary"
  367. @click="exportLeBao"
  368. v-permission="'studentInstrument/export'"
  369. >导出</el-button
  370. >
  371. <!-- <el-tooltip placement="top"
  372. popper-class="mTooltip">
  373. <div slot="content">
  374. 请选择分部和月份,导出回款统计
  375. </div>
  376. <i class="el-icon-question micon el-tooltip"
  377. style="font-size: 18px; color: #F56C6C"
  378. v-permission="'export/studentOrder'"></i>
  379. </el-tooltip> -->
  380. </div>
  381. </div>
  382. <el-divider></el-divider>
  383. <div class="m-core">
  384. <div class="m-wrap">
  385. <div class="title">团练宝学员统计:</div>
  386. <el-select
  387. v-model.trim="trainOrganId"
  388. class="organSelect"
  389. style="width: 100%"
  390. filterable
  391. placeholder="请选择分部"
  392. clearable
  393. >
  394. <el-option
  395. v-for="(item, index) in selects.branchs"
  396. :key="index"
  397. :label="item.name"
  398. :value="item.id"
  399. ></el-option>
  400. </el-select>
  401. <el-button
  402. style="margin-left: 10px"
  403. type="primary"
  404. @click="exportTrain"
  405. v-permission="'export/cloudStudyStudentTrainData'"
  406. >导出</el-button
  407. >
  408. </div>
  409. </div>
  410. <el-divider></el-divider>
  411. <div class="m-core">
  412. <div class="m-wrap">
  413. <div class="title">问卷调查:</div>
  414. <el-select
  415. v-model.trim="questionActiveType"
  416. class="organSelect"
  417. style="width: 100%"
  418. filterable
  419. placeholder="请选择导出类型"
  420. clearable
  421. >
  422. <el-option
  423. label="团练宝用户反馈"
  424. value="CLOUD_TEACHER_FEEDBACK"
  425. ></el-option>
  426. </el-select>
  427. <el-button
  428. style="margin-left: 10px"
  429. type="primary"
  430. @click="exportQuestion"
  431. v-if="$helpers.permission('questionnaireUserResult/export/report')"
  432. >导出</el-button
  433. >
  434. </div>
  435. </div>
  436. <el-divider></el-divider>
  437. <div class="m-core">
  438. <div class="m-wrap">
  439. <div class="title">VIP网管课耗导出:</div>
  440. <select-all
  441. v-model.trim="vipOrganId"
  442. class="organSelect"
  443. style="width: 100%"
  444. filterable
  445. placeholder="请选择分部"
  446. clearable
  447. >
  448. <el-option
  449. v-for="(item, index) in selects.branchs"
  450. :key="index"
  451. :label="item.name"
  452. :value="item.id"
  453. ></el-option>
  454. </select-all>
  455. <el-button
  456. style="margin-left: 10px"
  457. type="primary"
  458. @click="exportVip"
  459. v-permission="'export/studentVipPractice'"
  460. >导出</el-button
  461. >
  462. </div>
  463. </div>
  464. <el-divider></el-divider>
  465. <div class="m-core">
  466. <div class="m-wrap">
  467. <div class="title">服务指标明细导出:</div>
  468. <select-all
  469. v-model.trim="serviceOrganId"
  470. class="organSelect"
  471. style="width: 100%"
  472. filterable
  473. multiple
  474. placeholder="请选择分部"
  475. clearable
  476. >
  477. <el-option
  478. v-for="(item, index) in selects.branchs"
  479. :key="index"
  480. :label="item.name"
  481. :value="item.id"
  482. ></el-option>
  483. </select-all>
  484. <el-date-picker
  485. v-model.trim="serviceTimer"
  486. style="width: 420px; margin-left: 15px"
  487. type="daterange"
  488. value-format="yyyy-MM-dd"
  489. range-separator="至"
  490. start-placeholder="开始日期"
  491. end-placeholder="结束日期"
  492. @change="getWeekTime"
  493. :picker-options="{
  494. firstDayOfWeek: 1,
  495. }"
  496. ></el-date-picker>
  497. <el-button
  498. style="margin-left: 10px"
  499. type="primary"
  500. @click="exportDetailService"
  501. v-permission="'export/exercisesSituation'"
  502. >导出</el-button
  503. >
  504. </div>
  505. </div>
  506. <el-divider></el-divider>
  507. <div class="m-core">
  508. <div class="m-wrap">
  509. <div class="title">异常处理数据导出:</div>
  510. <el-select
  511. clearable
  512. filterable
  513. v-model="Abnormal.organId"
  514. placeholder="请选择分部"
  515. >
  516. <el-option
  517. v-for="(item, index) in selects.branchs"
  518. :key="index"
  519. :label="item.name"
  520. :value="item.id"
  521. ></el-option>
  522. </el-select>
  523. <el-button
  524. type="primary"
  525. style="margin-left: 10px"
  526. v-permission="'export/exportIndexErrData'"
  527. @click="exportAbnormal"
  528. >导出</el-button
  529. >
  530. </div>
  531. </div>
  532. </div>
  533. </div>
  534. </template>
  535. <script>
  536. import { exportTeacherSalary } from "@/api/generalSettings";
  537. import { courseType, courseListType } from "@/utils/searchArray";
  538. import { Export } from "@/utils/downLoadFile";
  539. import cleanDeep from "clean-deep";
  540. import dayjs from "dayjs";
  541. import axios from "axios";
  542. import qs from "qs";
  543. import { getToken, getTenantId } from "@/utils/auth";
  544. import load from "@/utils/loading";
  545. export default {
  546. name: "reportForm",
  547. data() {
  548. return {
  549. mouth: "",
  550. organIdList: [],
  551. teacherDefaultSalaryOrganId: "",
  552. courseArray: courseType,
  553. courseListType,
  554. courseScheduleType: [],
  555. musicTeamNum: [],
  556. studentOrganId: "",
  557. studentMonth: "",
  558. attendanceOrganId: [],
  559. attendanceCourseType: "MUSIC",
  560. timer: [],
  561. leBaoTimer: [],
  562. AccountOrganId: [],
  563. AccountTimer: [],
  564. AccountDetailOrganId: [],
  565. AccountDetailTimer: [],
  566. trainOrganId: null,
  567. questionActiveType: "CLOUD_TEACHER_FEEDBACK",
  568. vipOrganId: [],
  569. serviceOrganId: [], // 服务报表
  570. serviceTimer: [],
  571. Abnormal: {
  572. organId: null,
  573. },
  574. activeName:[]
  575. };
  576. },
  577. mounted() {
  578. this.$store.dispatch("setBranchs");
  579. },
  580. methods: {
  581. exportSalar() {
  582. if (!this.mouth) {
  583. this.$message.error("请选择导出月份");
  584. return;
  585. }
  586. // let courseTypeList = this.courseScheduleType.join(',')
  587. let url = "/api-web/export/teacherSalary";
  588. let data = { date: this.mouth };
  589. const options = {
  590. method: "POST",
  591. headers: {
  592. Authorization: getToken(),
  593. tenantId: getTenantId(),
  594. },
  595. data: qs.stringify(cleanDeep(data)),
  596. url,
  597. responseType: "blob",
  598. };
  599. this.$confirm("您确定导出课酬", "提示", {
  600. confirmButtonText: "确定",
  601. cancelButtonText: "取消",
  602. type: "warning",
  603. })
  604. .then(() => {
  605. load.startLoading();
  606. axios(options)
  607. .then((res) => {
  608. let blob = new Blob([res.data], {
  609. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  610. type: "application/vnd.ms-excel;charset=utf-8",
  611. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  612. });
  613. let text = new Response(blob).text();
  614. text.then((res) => {
  615. // 判断是否报错
  616. if (res.indexOf("code") != -1) {
  617. let json = JSON.parse(res);
  618. this.$message.error(json.msg);
  619. } else {
  620. let objectUrl = URL.createObjectURL(blob);
  621. let link = document.createElement("a");
  622. let nowTime = new Date();
  623. let ymd =
  624. nowTime.getFullYear() +
  625. "" +
  626. (nowTime.getMonth() + 1) +
  627. "" +
  628. nowTime.getDate();
  629. let fname = ymd + "课酬.xls"; //下载文件的名字
  630. link.href = objectUrl;
  631. link.setAttribute("download", fname);
  632. document.body.appendChild(link);
  633. link.click();
  634. }
  635. });
  636. load.endLoading();
  637. })
  638. .catch((error) => {
  639. this.$message.error("导出数据失败,请联系管理员");
  640. load.endLoading();
  641. });
  642. })
  643. .catch(() => {});
  644. },
  645. exportMusicGroup() {
  646. if (this.organIdList.length < 1) {
  647. this.$message.error("请至少选择一个分部");
  648. return;
  649. }
  650. let url = "/api-web/export/musicGroupRegister";
  651. let data = { organIds: this.organIdList.join(",") };
  652. const options = {
  653. method: "POST",
  654. headers: {
  655. Authorization: getToken(),
  656. tenantId: getTenantId(),
  657. },
  658. data: qs.stringify(cleanDeep(data)),
  659. url,
  660. responseType: "blob",
  661. };
  662. this.$confirm("您确定导出招生情况汇总表", "提示", {
  663. confirmButtonText: "确定",
  664. cancelButtonText: "取消",
  665. type: "warning",
  666. })
  667. .then(() => {
  668. load.startLoading();
  669. axios(options)
  670. .then((res) => {
  671. let blob = new Blob([res.data], {
  672. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  673. type: "application/vnd.ms-excel;charset=utf-8",
  674. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  675. });
  676. let text = new Response(blob).text();
  677. text.then((res) => {
  678. // 判断是否报错
  679. if (res.indexOf("code") != -1) {
  680. let json = JSON.parse(res);
  681. this.$message.error(json.msg);
  682. } else {
  683. let objectUrl = URL.createObjectURL(blob);
  684. let link = document.createElement("a");
  685. let nowTime = new Date();
  686. let ymd =
  687. nowTime.getFullYear() +
  688. "" +
  689. (nowTime.getMonth() + 1) +
  690. "" +
  691. nowTime.getDate();
  692. let fname = ymd + "招生情况汇总表.xls"; //下载文件的名字
  693. link.href = objectUrl;
  694. link.setAttribute("download", fname);
  695. document.body.appendChild(link);
  696. link.click();
  697. }
  698. });
  699. load.endLoading();
  700. })
  701. .catch((error) => {
  702. this.$message.error("导出数据失败,请联系管理员");
  703. load.endLoading();
  704. });
  705. })
  706. .catch(() => {});
  707. },
  708. exportDefaultSalary() {
  709. let organIdList = this.teacherDefaultSalaryOrganId.join(",");
  710. let url = "/api-web/export/teacherDefaultSalary";
  711. let data = { organIdList };
  712. const options = {
  713. method: "POST",
  714. headers: {
  715. Authorization: getToken(),
  716. tenantId: getTenantId(),
  717. },
  718. data: qs.stringify(cleanDeep(data)),
  719. url,
  720. responseType: "blob",
  721. };
  722. this.$confirm("您确定导出老师默认课酬表", "提示", {
  723. confirmButtonText: "确定",
  724. cancelButtonText: "取消",
  725. type: "warning",
  726. })
  727. .then(() => {
  728. load.startLoading();
  729. axios(options)
  730. .then((res) => {
  731. let blob = new Blob([res.data], {
  732. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  733. type: "application/vnd.ms-excel;charset=utf-8",
  734. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  735. });
  736. let text = new Response(blob).text();
  737. text.then((res) => {
  738. // 判断是否报错
  739. if (res.indexOf("code") != -1) {
  740. let json = JSON.parse(res);
  741. this.$message.error(json.msg);
  742. } else {
  743. let objectUrl = URL.createObjectURL(blob);
  744. let link = document.createElement("a");
  745. let nowTime = new Date();
  746. let ymd =
  747. nowTime.getFullYear() +
  748. "" +
  749. (nowTime.getMonth() + 1) +
  750. "" +
  751. nowTime.getDate();
  752. let fname = ymd + "老师默认课酬表.xls"; //下载文件的名字
  753. link.href = objectUrl;
  754. link.setAttribute("download", fname);
  755. document.body.appendChild(link);
  756. link.click();
  757. }
  758. });
  759. load.endLoading();
  760. })
  761. .catch((error) => {
  762. this.$message.error("导出数据失败,请联系管理员");
  763. load.endLoading();
  764. });
  765. })
  766. .catch(() => {});
  767. },
  768. exportMusicTeamNum() {
  769. let organIds = this.musicTeamNum.join(",");
  770. let url = "/api-web/export/musicGroupNormalStudentNum";
  771. let data = { organIds };
  772. const options = {
  773. method: "POST",
  774. headers: {
  775. Authorization: getToken(),
  776. tenantId: getTenantId(),
  777. },
  778. data: qs.stringify(cleanDeep(data)),
  779. url,
  780. responseType: "blob",
  781. };
  782. this.$confirm("您确定导出乐团在读人数", "提示", {
  783. confirmButtonText: "确定",
  784. cancelButtonText: "取消",
  785. type: "warning",
  786. })
  787. .then(() => {
  788. load.startLoading();
  789. axios(options)
  790. .then((res) => {
  791. let blob = new Blob([res.data], {
  792. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  793. type: "application/vnd.ms-excel;charset=utf-8",
  794. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  795. });
  796. let text = new Response(blob).text();
  797. text.then((res) => {
  798. // 判断是否报错
  799. if (res.indexOf("code") != -1) {
  800. let json = JSON.parse(res);
  801. this.$message.error(json.msg);
  802. } else {
  803. let objectUrl = URL.createObjectURL(blob);
  804. let link = document.createElement("a");
  805. let nowTime = new Date();
  806. let ymd =
  807. nowTime.getFullYear() +
  808. "" +
  809. (nowTime.getMonth() + 1) +
  810. "" +
  811. nowTime.getDate();
  812. let fname = ymd + "乐团在读人数.xls"; //下载文件的名字
  813. link.href = objectUrl;
  814. link.setAttribute("download", fname);
  815. document.body.appendChild(link);
  816. link.click();
  817. }
  818. });
  819. load.endLoading();
  820. })
  821. .catch((error) => {
  822. this.$message.error("导出数据失败,请联系管理员");
  823. load.endLoading();
  824. });
  825. })
  826. .catch(() => {});
  827. },
  828. exportStudent() {
  829. if (!this.studentMonth) {
  830. this.$message.error("请选择导出月份");
  831. return;
  832. }
  833. let studentOrganId = this.studentOrganId.join(",");
  834. let url = "/api-web/export/studentOrder";
  835. let data = { organIds: studentOrganId, date: this.studentMonth };
  836. const options = {
  837. method: "POST",
  838. headers: {
  839. Authorization: getToken(),
  840. tenantId: getTenantId(),
  841. },
  842. data: qs.stringify(cleanDeep(data)),
  843. url,
  844. responseType: "blob",
  845. };
  846. this.$confirm("您确定导出回款统计", "提示", {
  847. confirmButtonText: "确定",
  848. cancelButtonText: "取消",
  849. type: "warning",
  850. })
  851. .then(() => {
  852. load.startLoading();
  853. axios(options)
  854. .then((res) => {
  855. let blob = new Blob([res.data], {
  856. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  857. type: "application/vnd.ms-excel;charset=utf-8",
  858. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  859. });
  860. let text = new Response(blob).text();
  861. text.then((res) => {
  862. // 判断是否报错
  863. if (res.indexOf("code") != -1) {
  864. let json = JSON.parse(res);
  865. this.$message.error(json.msg);
  866. } else {
  867. let objectUrl = URL.createObjectURL(blob);
  868. let link = document.createElement("a");
  869. let nowTime = new Date();
  870. let ymd =
  871. nowTime.getFullYear() +
  872. "" +
  873. (nowTime.getMonth() + 1) +
  874. "" +
  875. nowTime.getDate();
  876. let fname = ymd + "回款统计.xls"; //下载文件的名字
  877. link.href = objectUrl;
  878. link.setAttribute("download", fname);
  879. document.body.appendChild(link);
  880. link.click();
  881. }
  882. });
  883. load.endLoading();
  884. })
  885. .catch((error) => {
  886. this.$message.error("导出数据失败,请联系管理员");
  887. load.endLoading();
  888. });
  889. })
  890. .catch(() => {});
  891. },
  892. exportAttendance() {
  893. let classStartDate, classEndDate;
  894. if (this.timer && this.timer.length > 0) {
  895. classStartDate = this.timer[0];
  896. classEndDate = this.timer[1];
  897. } else {
  898. classStartDate = null;
  899. classEndDate = null;
  900. }
  901. Export(
  902. this,
  903. {
  904. url: "/api-web/export/exportStudentAttendances",
  905. fileName: "学生考勤.xls",
  906. method: "post",
  907. params: qs.stringify({
  908. organId: this.attendanceOrganId.join(","),
  909. groupType: this.attendanceCourseType,
  910. classStartDate,
  911. classEndDate,
  912. }),
  913. },
  914. "您确定导出学生考勤?"
  915. );
  916. },
  917. exportTrain() {
  918. if (!this.trainOrganId) {
  919. this.$message.error("请选择分部");
  920. return;
  921. }
  922. Export(
  923. this,
  924. {
  925. url: "/api-web/export/cloudStudyStudentTrainData",
  926. fileName: "团练宝学员统计.xls",
  927. method: "post",
  928. params: qs.stringify({
  929. organId: this.trainOrganId,
  930. }),
  931. },
  932. "您确定导出团练宝学员统计?"
  933. );
  934. },
  935. exportQuestion() {
  936. Export(
  937. this,
  938. {
  939. url: "/api-web/questionnaireUserResult/export",
  940. fileName: "问卷调查.xls",
  941. method: "get",
  942. params: { activeType: this.questionActiveType },
  943. },
  944. "您确定导出问卷调查?"
  945. );
  946. },
  947. exportLeBao() {
  948. let endTime, startTime;
  949. if (this.leBaoTimer && this.leBaoTimer.length > 1) {
  950. startTime = this.leBaoTimer[0];
  951. let end = this.leBaoTimer[1];
  952. end = new Date(end);
  953. end = new Date(end.getFullYear(), end.getMonth() + 1, 0);
  954. endTime = dayjs(end).format("YYYY-MM-DD");
  955. } else {
  956. this.$message.error("请选择导出月份");
  957. return;
  958. }
  959. Export(
  960. this,
  961. {
  962. url: "/api-web/studentInstrument/export",
  963. fileName: "乐保订单.xls",
  964. method: "get",
  965. params: { startTime: startTime, endTime: endTime },
  966. },
  967. "您确定导出乐保订单?"
  968. );
  969. },
  970. exportAccount() {
  971. let endTime, startTime;
  972. if (this.AccountTimer && this.AccountTimer.length > 1) {
  973. startTime = this.AccountTimer[0];
  974. endTime = this.AccountTimer[1];
  975. } else {
  976. startTime = null;
  977. endTime = null;
  978. }
  979. Export(
  980. this,
  981. {
  982. url: "/api-web/export/userCoursesAccount",
  983. fileName: "课程余额明细.xls",
  984. method: "post",
  985. params: qs.stringify({
  986. startTime: startTime,
  987. endTime: endTime,
  988. organId: this.AccountOrganId.join(","),
  989. }),
  990. },
  991. "您确定导出课程余额明细?"
  992. );
  993. },
  994. exportDetailAccount() {
  995. let endTime, startTime;
  996. if (this.AccountDetailTimer && this.AccountDetailTimer.length > 1) {
  997. startTime = this.AccountDetailTimer[0];
  998. endTime = this.AccountDetailTimer[1];
  999. } else {
  1000. startTime = null;
  1001. endTime = null;
  1002. }
  1003. Export(
  1004. this,
  1005. {
  1006. url: "/api-web/export/userCashAccountDetail",
  1007. fileName: "账户余额明细.xls",
  1008. method: "post",
  1009. params: qs.stringify({
  1010. startTime: startTime,
  1011. endTime: endTime,
  1012. organId: this.AccountDetailOrganId.join(","),
  1013. }),
  1014. },
  1015. "您确定导出账户余额明细?"
  1016. );
  1017. },
  1018. exportVip() {
  1019. if (!this.vipOrganId.length < 0) {
  1020. this.$message.error("请选择分部");
  1021. return;
  1022. }
  1023. let data = {
  1024. organId: this.vipOrganId.join(","),
  1025. };
  1026. let url = "/api-web/export/studentVipPractice";
  1027. const options = {
  1028. method: "get",
  1029. headers: {
  1030. Authorization: getToken(),
  1031. tenantId: getTenantId(),
  1032. },
  1033. params: cleanDeep(data),
  1034. url,
  1035. responseType: "form",
  1036. };
  1037. this.$confirm("您确定导出VIP网管课耗", "提示", {
  1038. confirmButtonText: "确定",
  1039. cancelButtonText: "取消",
  1040. type: "warning",
  1041. })
  1042. .then(() => {
  1043. load.startLoading();
  1044. axios(options)
  1045. .then((res) => {
  1046. load.endLoading();
  1047. if (res.data.code == 200) {
  1048. this.$message.info(res.data.msg);
  1049. } else {
  1050. this.$message.error(res.data.msg);
  1051. }
  1052. // this.$confirm(res.data.data, "提示", {
  1053. // confirmButtonText: "确定",
  1054. // cancelButtonText: "取消",
  1055. // type: "warning",
  1056. // }).then(() => {
  1057. // }).catch(err => {
  1058. // })
  1059. })
  1060. .catch((error) => {
  1061. this.$message.error("导出数据失败,请联系管理员");
  1062. load.endLoading();
  1063. });
  1064. })
  1065. .catch(() => {});
  1066. // Export(
  1067. // this,
  1068. // {
  1069. // url: "/api-web/export/studentVipPractice",
  1070. // fileName: "vip网管课.xls",
  1071. // method: "post",
  1072. // params: qs.stringify({
  1073. // organId: this.vipOrganId.join(',')
  1074. // }),
  1075. // },
  1076. // "您确定导出vip网管课?"
  1077. // );
  1078. },
  1079. exportDetailService() {
  1080. let sunday, monday;
  1081. if (this.serviceTimer && this.serviceTimer.length > 1) {
  1082. monday = this.serviceTimer[0];
  1083. sunday = this.serviceTimer[1];
  1084. } else {
  1085. monday = null;
  1086. sunday = null;
  1087. }
  1088. Export(
  1089. this,
  1090. {
  1091. url: "/api-web/export/exercisesSituation",
  1092. fileName: "服务指标明细.xls",
  1093. method: "post",
  1094. params: qs.stringify({
  1095. monday: monday,
  1096. sunday: sunday,
  1097. organId: this.serviceOrganId.join(","),
  1098. }),
  1099. },
  1100. "您确定导出服务指标明细?"
  1101. );
  1102. },
  1103. getNowDateAndMonday(time) {
  1104. let timestamp = new Date(time.replace(/-/g, "/")).getTime();
  1105. let serverDate = new Date(time);
  1106. if (serverDate.getDay() == 0) {
  1107. timestamp -= 7 * 24 * 60 * 60 * 1000;
  1108. }
  1109. let mondayTime =
  1110. timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
  1111. let mondayData = new Date(mondayTime);
  1112. //年
  1113. let mondayY = mondayData.getFullYear();
  1114. //月
  1115. let mondayM =
  1116. mondayData.getMonth() + 1 < 10
  1117. ? "0" + (mondayData.getMonth() + 1)
  1118. : mondayData.getMonth() + 1;
  1119. //日
  1120. let mondayD =
  1121. mondayData.getDate() < 10
  1122. ? "0" + mondayData.getDate()
  1123. : mondayData.getDate();
  1124. let str = mondayY + "-" + mondayM + "-" + mondayD;
  1125. return str;
  1126. },
  1127. getNowDateAndSunday(time) {
  1128. let timestamp = new Date(time.replace(/-/g, "/")).getTime();
  1129. let serverDate = new Date(time);
  1130. let num = 7 - serverDate.getDay();
  1131. if (num == 7) {
  1132. num = 0;
  1133. }
  1134. let sundayTiem = timestamp + num * 24 * 60 * 60 * 1000;
  1135. let SundayData = new Date(sundayTiem);
  1136. //年
  1137. let tomorrowY = SundayData.getFullYear(); //月
  1138. let tomorrowM =
  1139. SundayData.getMonth() + 1 < 10
  1140. ? "0" + (SundayData.getMonth() + 1)
  1141. : SundayData.getMonth() + 1;
  1142. //日
  1143. let tomorrowD =
  1144. SundayData.getDate() < 10
  1145. ? "0" + SundayData.getDate()
  1146. : SundayData.getDate();
  1147. let str = tomorrowY + "-" + tomorrowM + "-" + tomorrowD;
  1148. return str;
  1149. },
  1150. getWeekTime(val) {
  1151. if (val && val.length > 0) {
  1152. let start = this.getNowDateAndMonday(val[0]);
  1153. let end = this.getNowDateAndSunday(val[1]);
  1154. this.serviceTimer.splice(0, 1, start);
  1155. this.serviceTimer.splice(1, 1, end);
  1156. }
  1157. },
  1158. exportAbnormal() {
  1159. let params = this.Abnormal;
  1160. Export(
  1161. this,
  1162. {
  1163. method: "post",
  1164. url: "/api-web/export/exportIndexErrData",
  1165. params: this.$helpers.qs.stringify({
  1166. ...params,
  1167. }),
  1168. },
  1169. "是否确认导出报表?"
  1170. );
  1171. },
  1172. },
  1173. // AccountDetailTimer
  1174. };
  1175. </script>
  1176. <style lang="scss" scoped>
  1177. .m-container {
  1178. .m-core {
  1179. // margin-top: 20px;
  1180. .m-wrap {
  1181. display: flex;
  1182. flex-direction: row;
  1183. justify-content: flex-start;
  1184. width: 100%;
  1185. align-items: center;
  1186. .newBand {
  1187. margin: 0 5px 0 10px;
  1188. }
  1189. .title {
  1190. width: 150px;
  1191. // height: 40px;
  1192. // line-height: 40px;
  1193. text-align: right;
  1194. color: #606266;
  1195. }
  1196. .organSelect {
  1197. width: 220px !important;
  1198. }
  1199. .el-tooltip.micon {
  1200. width: 20px;
  1201. height: 20px;
  1202. position: relative;
  1203. // top: 12px;
  1204. }
  1205. }
  1206. }
  1207. .formCollapse {
  1208. border:none;
  1209. /deep/.el-collapse-item__header{
  1210. border-bottom: none;
  1211. background-color: #F8F8F8;
  1212. }
  1213. }
  1214. }
  1215. /deep/.el-input__icon.el-icon-date {
  1216. height: 40px !important;
  1217. }
  1218. </style>