strudentPayInfo.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <el-page-header @back="goBack" content="学员缴费记录"> </el-page-header>
  5. <!-- this.info = {
  6. paymentStatus: res.data.calender.paymentStatus,
  7. startPaymentDate: res.data.calender.startPaymentDate,
  8. deadlinePaymentDate: res.data.calender.deadlinePaymentDate,
  9. expectNum: res.data.calender.expectNum,
  10. actualNum: res.data.calender.actualNum,
  11. sumActualAmount: res.data.sumActualAmount
  12. } -->
  13. <statistic :span="4" :col="5">
  14. <statistic-item>
  15. <span>状态</span>
  16. <span>
  17. <p
  18. class="status"
  19. style="color: #ff6a6a"
  20. v-if="info.paymentStatus == 'OPEN'"
  21. >
  22. {{ "已开启" }}
  23. </p>
  24. <p
  25. class="status"
  26. style="color: #ff6a6a"
  27. v-if="info.paymentStatus == 'NO'"
  28. >
  29. {{ "未开始" }}
  30. </p>
  31. <p
  32. class="status"
  33. style="color: #5ccdb8"
  34. v-if="info.paymentStatus == 'OVER'"
  35. >
  36. {{ "已结束" }}
  37. </p>
  38. </span>
  39. </statistic-item>
  40. <statistic-item>
  41. <span>预计缴费日期</span>
  42. <span style="font-size: 16px"
  43. >{{ info.startPaymentDate | formatTimer }} ~
  44. {{ info.deadlinePaymentDate | formatTimer }}</span
  45. >
  46. </statistic-item>
  47. <statistic-item>
  48. <span>预计缴费人数</span>
  49. <span>{{ info.expectNum ? info.expectNum : 0 }}</span>
  50. </statistic-item>
  51. <statistic-item>
  52. <span>实际缴费人数</span>
  53. <span>{{ info.actualNum ? info.actualNum : 0 }}</span>
  54. </statistic-item>
  55. <statistic-item>
  56. <span>收款金额</span>
  57. <span>{{ info.sumActualAmount ? info.sumActualAmount : 0 }}</span>
  58. </statistic-item>
  59. </statistic>
  60. <!-- <div class="infoMsg">
  61. <div class="left">
  62. <p class="title">状态</p>
  63. <p class="status"
  64. style="color: #ff6a6a"
  65. v-if="info.paymentStatus == 'OPEN'">
  66. {{ "已开启" }}
  67. </p>
  68. <p class="status"
  69. style="color: #ff6a6a"
  70. v-if="info.paymentStatus == 'NO'">
  71. {{ "未开始" }}
  72. </p>
  73. <p class="status"
  74. style="color: #5ccdb8"
  75. v-if="info.paymentStatus == 'OVER'">
  76. {{ "已结束" }}
  77. </p>
  78. </div>
  79. <div class="right">
  80. <div class="expectBox first">
  81. <p class="title">预计缴费日期</p>
  82. <p class="status">
  83. {{ info.startPaymentDate | formatTimer }}~{{
  84. info.deadlinePaymentDate | formatTimer
  85. }}
  86. </p>
  87. </div>
  88. <div class="expectBox">
  89. <p class="title">预计缴费人数</p>
  90. <p class="status">{{ info.expectNum ? info.expectNum : 0 }}</p>
  91. </div>
  92. <div class="expectBox">
  93. <p class="title">实际缴费人数</p>
  94. <p class="status">{{ info.actualNum ? info.actualNum : 0 }}</p>
  95. </div>
  96. <div class="expectBox">
  97. <p class="title">收款金额</p>
  98. <p class="status">
  99. {{ info.sumActualAmount ? info.sumActualAmount : 0 }}
  100. </p>
  101. </div>
  102. </div>
  103. </div> -->
  104. <div class="m-core">
  105. <save-form
  106. save-key="strudent-pay-info"
  107. :inline="true"
  108. :model.sync="searchForm"
  109. @submit="search"
  110. @reset="onReSet"
  111. >
  112. <el-form-item>
  113. <el-input
  114. v-model.trim="searchForm.search"
  115. @keyup.enter.native="search"
  116. placeholder="学员编号,手机号"
  117. ></el-input>
  118. </el-form-item>
  119. <el-form-item>
  120. <el-select
  121. v-model.trim="searchForm.subjectId"
  122. style="width: 180px"
  123. clearable
  124. filterable
  125. placeholder="请选择声部"
  126. >
  127. <el-option
  128. v-for="(item, index) in soundList"
  129. :key="index"
  130. :label="item.name"
  131. :value="item.id"
  132. ></el-option>
  133. </el-select>
  134. </el-form-item>
  135. <el-form-item>
  136. <el-select
  137. v-model.trim="searchForm.paymentStatus"
  138. style="width: 180px"
  139. clearable
  140. filterable
  141. placeholder="请选择状态"
  142. >
  143. <el-option label="未缴费" value="NON_PAYMENT"></el-option>
  144. <el-option label="缴费中" value="PROCESSING"></el-option>
  145. <el-option label="已缴费" value="PAID_COMPLETED"></el-option>
  146. </el-select>
  147. </el-form-item>
  148. <el-form-item>
  149. <el-select
  150. v-model.trim="searchForm.musicGroupStatus"
  151. style="width: 180px"
  152. clearable
  153. filterable
  154. placeholder="请选择学员状态"
  155. >
  156. <el-option label="在读" value="NORMAL"></el-option>
  157. <el-option label="退团" value="QUIT"></el-option>
  158. <el-option label="休学" value="QUIT_SCHOOL"></el-option>
  159. <el-option label="报名" value="APPLY"></el-option>
  160. </el-select>
  161. </el-form-item>
  162. <el-form-item>
  163. <el-button native-type="suubmit" type="danger">搜索</el-button>
  164. <el-button native-type="reset" type="primary">重置</el-button>
  165. </el-form-item>
  166. </save-form>
  167. <!-- NO: '未开启缴费',
  168. OPEN: '开启缴费',
  169. OVER: '缴费已结束', -->
  170. <div class="wrap">
  171. <div class="newBand" @click="detailVisible = true">缴费详情</div>
  172. <div
  173. class="newBand"
  174. @click="resetPay"
  175. v-permission="'musicGroupPaymentCalenderDetail/updateExpectAmount'"
  176. >
  177. 修改缴费金额
  178. </div>
  179. <div
  180. class="newBand"
  181. @click="startPay"
  182. v-if="info.paymentStatus != 'OPEN'"
  183. v-permission="'musicGroupPaymentCalenderDetail/openPayment'"
  184. >
  185. 开启缴费
  186. </div>
  187. <!-- <div
  188. class="newBand"
  189. @click="addStudentBtn"
  190. v-if="info.paymentStatus != 'OVER'"
  191. v-permission="'musicGroupPaymentCalenderDetail/add'"
  192. >
  193. 新增学员
  194. </div> -->
  195. <div
  196. class="newBand"
  197. @click="delStudentBtn"
  198. v-if="titleForm.paymentType != 'SPAN_GROUP_CLASS_ADJUST'"
  199. v-permission="'musicGroupPaymentCalenderDetail/batchDel'"
  200. >
  201. 删除学员
  202. </div>
  203. <div
  204. class="newBand"
  205. v-permission="'export/musicGroupPaymentCalenderDetail'"
  206. @click="onMusicGroupPaymentCalenderDetail"
  207. >
  208. 缴费记录导出
  209. </div>
  210. </div>
  211. <div class="tableWrap">
  212. <el-table
  213. style="width: 100%"
  214. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  215. :data="tableList"
  216. @selection-change="handleSelectionChange"
  217. >
  218. <el-table-column
  219. type="selection"
  220. :selectable="checkSelect"
  221. width="55"
  222. >
  223. </el-table-column>
  224. <el-table-column
  225. align="center"
  226. prop="userId"
  227. label="学员编号"
  228. ></el-table-column>
  229. <el-table-column align="center" prop="studentId" label="学员姓名">
  230. <template slot-scope="scope">
  231. <div v-if="scope.row.sysUser">
  232. {{ scope.row.sysUser.username }}
  233. </div>
  234. </template>
  235. </el-table-column>
  236. <el-table-column align="center" label="学员声部">
  237. <template slot-scope="scope">
  238. <div v-if="scope.row.studentRegistration">
  239. {{ scope.row.studentRegistration.subjectName }}
  240. </div>
  241. </template>
  242. </el-table-column>
  243. <el-table-column align="center" label="学员状态">
  244. <template slot-scope="scope">
  245. <div v-if="scope.row.studentRegistration">
  246. {{
  247. scope.row.studentRegistration.musicGroupStatus
  248. | studentTeamStatus
  249. }}
  250. </div>
  251. </template>
  252. </el-table-column>
  253. <el-table-column align="center" prop="studentId" label="手机号">
  254. <template slot-scope="scope">
  255. <div v-if="scope.row.sysUser">
  256. {{ scope.row.sysUser.phone }}
  257. </div>
  258. </template>
  259. </el-table-column>
  260. <el-table-column
  261. align="center"
  262. prop="expectAmount"
  263. label="预计缴费金额"
  264. ></el-table-column>
  265. <el-table-column align="center" label="缴费开始日期">
  266. <template slot-scope="scope">
  267. <div>
  268. {{ scope.row.startPaymentDateMgpc | formatTimer }}
  269. </div>
  270. </template>
  271. </el-table-column>
  272. <el-table-column align="center" label="缴费截止日期">
  273. <template slot-scope="scope">
  274. <div>
  275. {{ scope.row.deadlinePaymentDateMgpc | formatTimer }}
  276. </div>
  277. </template>
  278. </el-table-column>
  279. <el-table-column align="center" label="是否开启缴费">
  280. <template slot-scope="scope">
  281. <div>
  282. {{ scope.row.open ? "是" : "否" }}
  283. </div>
  284. </template>
  285. </el-table-column>
  286. <el-table-column align="center" label="缴费状态">
  287. <template slot-scope="scope">
  288. <div>
  289. {{ scope.row.paymentStatus | paymentStatusDetall }}
  290. </div>
  291. </template>
  292. </el-table-column>
  293. <el-table-column align="center" prop="studentId" label="支付时间">
  294. <template slot-scope="scope">
  295. <div>
  296. {{ scope.row.payTime | dateForMinFormat }}
  297. </div>
  298. </template>
  299. </el-table-column>
  300. <!-- <el-table-column align="center"
  301. width="200px"
  302. label="操作">
  303. <template slot-scope="scope">
  304. <div>
  305. <el-button type="text"
  306. :disabled="!checkSelect(scope.row)"
  307. @click="resetPay(scope.row)">修改金额</el-button>
  308. <el-button type="text"
  309. :disabled="!checkSelect(scope.row)"
  310. @click="startPay(scope.row)">开启缴费</el-button>
  311. </div>
  312. </template>
  313. </el-table-column> -->
  314. </el-table>
  315. <pagination
  316. sync
  317. saveKey="strudent-pay-info"
  318. :total.sync="rules.total"
  319. :page.sync="rules.page"
  320. :limit.sync="rules.limit"
  321. :page-sizes="rules.page_size"
  322. @pagination="getList"
  323. />
  324. </div>
  325. </div>
  326. <!-- <el-dialog :visible.sync="payVisible"
  327. width="500px"
  328. title="修改缴费时间">
  329. <el-form :model="payForm"
  330. ref='payForm'>
  331. <el-form-item label="缴费开始日期"
  332. :rules="[{ required: true, message: '请设置缴费开始日期',trigger: 'blur'}]"
  333. prop="startDate">
  334. <el-date-picker v-model.trim="payForm.startDate"
  335. type="date"
  336. :picker-options="pickerOptions"
  337. value-format="yyyy-MM-dd"
  338. placeholder="开始日期"></el-date-picker>
  339. </el-form-item>
  340. </el-form>
  341. <div slot="footer"
  342. class="dialog-footer">
  343. <el-button @click="payVisible = false">取 消</el-button>
  344. <el-button type="primary"
  345. @click="">确 定</el-button>
  346. </div>
  347. </el-dialog> -->
  348. <el-dialog
  349. :visible.sync="resetPayVisible"
  350. width="500px"
  351. title="修改缴费金额"
  352. >
  353. <el-form
  354. :model="resetPayForm"
  355. :inline="true"
  356. label-width="120px"
  357. label-position="right"
  358. ref="resetPayForm"
  359. @submit.native.prevent
  360. >
  361. <!-- <el-form-item label="学员姓名"
  362. :rules="[{ required: true, message: '学员姓名',trigger: 'blur'}]"
  363. prop="startDate">
  364. <el-input disabled
  365. value="张三"></el-input>
  366. </el-form-item> -->
  367. <el-form-item
  368. label="预计缴费金额"
  369. :rules="[
  370. { required: true, message: '请输入预计缴费金额', trigger: 'blur' },
  371. {
  372. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  373. message: '请输入正确的金额',
  374. trigger: 'blur',
  375. },
  376. ]"
  377. prop="momey"
  378. >
  379. <el-input v-model="resetPayForm.momey"></el-input>
  380. </el-form-item>
  381. </el-form>
  382. <div slot="footer" class="dialog-footer">
  383. <el-button @click="resetPayVisible = false">取 消</el-button>
  384. <el-button type="primary" @click="submitReset">确 定</el-button>
  385. </div>
  386. </el-dialog>
  387. <el-dialog :visible.sync="studentVisible" width="600" title="学生列表">
  388. <el-table
  389. :data="studentList"
  390. class="studenTable"
  391. ref="singleTable"
  392. highlight-current-row
  393. @current-change="handleCurrentChange"
  394. >
  395. <!-- <el-table-column type="selection"
  396. width="55">
  397. </el-table-column> -->
  398. <el-table-column
  399. property="userId"
  400. align="center"
  401. label="学员编号"
  402. ></el-table-column>
  403. <el-table-column
  404. property="name"
  405. align="center"
  406. label="学员姓名"
  407. ></el-table-column>
  408. <el-table-column
  409. property="phone"
  410. align="center"
  411. label="手机号"
  412. ></el-table-column>
  413. </el-table>
  414. <div slot="footer" class="dialog-footer">
  415. <el-button @click="cancleAdd">取 消</el-button>
  416. <el-button type="primary" @click="submitAddStudent">确 定</el-button>
  417. </div>
  418. </el-dialog>
  419. <el-dialog width="700px" title="查看缴费详情" :visible.sync="detailVisible">
  420. <studentPayDetail :msgList="msgList" :titleForm="titleForm" />
  421. </el-dialog>
  422. </div>
  423. </template>
  424. <script>
  425. import axios from "axios";
  426. import { getToken } from "@/utils/auth";
  427. import pagination from "@/components/Pagination/index";
  428. import load from "@/utils/loading";
  429. import cleanDeep from "clean-deep";
  430. import qs from "qs";
  431. import { courseType } from "@/utils/searchArray";
  432. import { paymentPatternType } from "@/constant";
  433. import studentPayDetail from "../modals/studentPayDetail";
  434. import {
  435. findSound,
  436. getmusicGroupPaymentCalenderDetail,
  437. openMusicGroupPaymentCalenderDetailPayment,
  438. resetMusicGroupPaymentCalenderDetail,
  439. getMusicGroupPaymentCalenderDetail,
  440. queryCanAddStudent,
  441. addMusicGroupPaymentCalenderStudent,
  442. delMusicGroupPaymentCalenderStudent,
  443. } from "@/api/buildTeam";
  444. export default {
  445. components: { pagination, studentPayDetail },
  446. data() {
  447. return {
  448. searchForm: {
  449. search: null,
  450. subjectId: null,
  451. paymentStatus: null,
  452. musicGroupStatus: null,
  453. },
  454. teacherList: [],
  455. soundList: [],
  456. tableList: [{ studentId: 111 }],
  457. rules: {
  458. // 分页规则
  459. limit: 10, // 限制显示条数
  460. page: 1, // 当前页
  461. total: 0, // 总条数
  462. page_size: [10, 20, 40, 50], // 选择限制显示条数
  463. },
  464. payVisible: false,
  465. resetPayVisible: false,
  466. studentVisible: false,
  467. chioseStudent: null,
  468. studentList: [],
  469. pickerOptions: {
  470. disabledDate(time) {
  471. return time.getTime() + 86400000 <= new Date().getTime();
  472. },
  473. },
  474. payForm: {
  475. startDate: null,
  476. },
  477. resetPayForm: {
  478. momey: null,
  479. },
  480. activeChiose: [],
  481. id: null,
  482. ids: null,
  483. info: {
  484. paymentStatus: null,
  485. startPaymentDate: null,
  486. deadlinePaymentDate: null,
  487. expectNum: null,
  488. actualNum: null,
  489. sumActualAmount: null,
  490. },
  491. msgList: [],
  492. detailVisible: false,
  493. titleForm: {
  494. paymentType: "",
  495. musicGroupOrganizationCourseSettingId: "",
  496. paymentPattern: "",
  497. paymentValidStartDate: "",
  498. paymentValidEndDate: "",
  499. calenderSettingsName: "",
  500. },
  501. };
  502. },
  503. //生命周期 - 创建完成(可以访问当前this实例)
  504. created() {},
  505. //生命周期 - 挂载完成(可以访问DOM元素)
  506. mounted() {
  507. // 获取声部
  508. this.teamid = this.$route.query.id;
  509. findSound({ musicGroupId: this.teamid }).then((res) => {
  510. if (res.code == 200) {
  511. this.soundList = res.data;
  512. }
  513. });
  514. // 获取分部
  515. this.init();
  516. },
  517. activated() {
  518. this.teamid = this.$route.query.id;
  519. findSound({ musicGroupId: this.teamid }).then((res) => {
  520. if (res.code == 200) {
  521. this.soundList = res.data;
  522. }
  523. });
  524. this.init();
  525. },
  526. methods: {
  527. init() {
  528. this.getList();
  529. },
  530. getList() {
  531. this.id = this.$route.query.paymentId;
  532. // 获取缴费状态
  533. getMusicGroupPaymentCalenderDetail({ id: this.id }).then((res) => {
  534. if (res.code == 200) {
  535. this.info = {
  536. paymentStatus: res.data.calender.status,
  537. startPaymentDate: res.data.calender.startPaymentDate,
  538. deadlinePaymentDate: res.data.calender.deadlinePaymentDate,
  539. expectNum: res.data.calender.expectNum,
  540. actualNum: res.data.calender.actualNum,
  541. sumActualAmount: res.data.sumActualAmount,
  542. };
  543. this.titleForm = {
  544. paymentType: res.data.calender.paymentType,
  545. musicGroupOrganizationCourseSettingId:
  546. res.data.calenderSettingsName,
  547. paymentPattern:
  548. paymentPatternType[res.data.calender.paymentPattern],
  549. paymentValidStartDate: res.data.calender.paymentValidStartDate,
  550. paymentValidEndDate: res.data.calender.paymentValidEndDate,
  551. calenderSettingsName: res.data.calenderSettingsName,
  552. };
  553. this.msgList = res.data.musicGroupPaymentCalenderCourseSettings;
  554. }
  555. });
  556. this.searchForm.id = this.id;
  557. this.searchForm.page = this.rules.page;
  558. this.searchForm.rows = this.rules.limit;
  559. getmusicGroupPaymentCalenderDetail(this.searchForm).then((payment) => {
  560. if (payment.code == 200) {
  561. this.rules.total = payment.data.total;
  562. this.tableList = payment.data.rows;
  563. }
  564. });
  565. },
  566. search() {
  567. this.rules.page = 1;
  568. this.getList();
  569. },
  570. onReSet() {
  571. this.searchForm = {
  572. search: null,
  573. subjectId: null,
  574. paymentStatus: null,
  575. };
  576. this.search();
  577. },
  578. checkSelect(val) {
  579. return val.paymentStatus == "NON_PAYMENT";
  580. },
  581. resetPay() {
  582. // this.activeRow = row;
  583. if (this.activeChiose.length < 1) {
  584. this.$message.error("请至少选择一名学员");
  585. return;
  586. }
  587. let ids = this.activeChiose.map((item) => {
  588. return item.id;
  589. });
  590. this.ids = ids.join(",");
  591. this.resetPayVisible = true;
  592. },
  593. // resetTime () {
  594. // this.payVisible = true;
  595. // },
  596. goBack() {
  597. let query = this.$route.query;
  598. if (query.type == "resetTeam") {
  599. this.$store.dispatch("delVisitedViews", this.$route);
  600. this.$router.push({
  601. path: "/business/resetTeaming",
  602. query: { ...this.$route.query },
  603. });
  604. }
  605. if(query.type == "look"){
  606. this.$store.dispatch("delVisitedViews", this.$route);
  607. this.$router.push({
  608. path: "/business/teamLookBase",
  609. query: { ...this.$route.query },
  610. });
  611. }
  612. },
  613. handleSelectionChange(val) {
  614. this.activeChiose = val;
  615. console.log(val);
  616. },
  617. startPay() {
  618. if (this.activeChiose.length < 1) {
  619. this.$message.error("请至少选择一名学员");
  620. return;
  621. }
  622. // console.log(this.activeChiose)
  623. let ids = this.activeChiose.map((item) => {
  624. return item.id;
  625. });
  626. ids = ids.join(",");
  627. // console.log(ids)
  628. openMusicGroupPaymentCalenderDetailPayment({ ids }).then((res) => {
  629. if (res.code == 200) {
  630. this.$message.success(res.msg);
  631. this.getList();
  632. }
  633. });
  634. },
  635. submitReset() {
  636. let obj = {};
  637. obj.expectAmount = this.resetPayForm.momey;
  638. obj.ids = this.ids;
  639. resetMusicGroupPaymentCalenderDetail(obj).then((res) => {
  640. if (res.code == 200) {
  641. this.$message.success("修改成功");
  642. this.resetPayVisible = false;
  643. this.getList();
  644. }
  645. });
  646. },
  647. addStudentBtn() {
  648. console.log(
  649. "musicGroupId:",
  650. this.teamid,
  651. "musicGroupPaymentCalenderId:",
  652. this.id
  653. );
  654. // 获取无缴费学员
  655. queryCanAddStudent({
  656. musicGroupId: this.teamid,
  657. musicGroupPaymentCalenderId: this.id,
  658. }).then((res) => {
  659. if (res.code == 200) {
  660. this.studentList = res.data;
  661. this.studentVisible = true;
  662. }
  663. });
  664. },
  665. delStudentBtn() {
  666. if (this.activeChiose.length < 1) {
  667. this.$message.error("请至少选择一名学员");
  668. return;
  669. }
  670. this.$confirm(`是否删除此学员`, "提示", {
  671. confirmButtonText: "确定",
  672. cancelButtonText: "取消",
  673. type: "warning",
  674. })
  675. .then(() => {
  676. let musicGroupPaymentCalenderDetailIds = this.activeChiose
  677. .map((stu) => {
  678. return stu.id;
  679. })
  680. .join(",");
  681. delMusicGroupPaymentCalenderStudent({
  682. musicGroupPaymentCalenderDetailIds,
  683. }).then((res) => {
  684. if (res.code == 200) {
  685. this.$message.success(`删除成功`);
  686. this.$set(this.rules, "page", 1);
  687. this.getList();
  688. }
  689. });
  690. })
  691. .catch(() => {});
  692. },
  693. handleCurrentChange(val) {
  694. this.chioseStudent = val;
  695. },
  696. submitAddStudent() {
  697. if (!this.chioseStudent) {
  698. this.$message.error("请选择学员");
  699. return;
  700. }
  701. addMusicGroupPaymentCalenderStudent({
  702. musicGroupPaymentCalenderId: this.id,
  703. userId: this.chioseStudent.userId,
  704. }).then((res) => {
  705. if (res.code == 200) {
  706. this.$message.success("添加成功");
  707. this.studentVisible = false;
  708. this.getList();
  709. }
  710. });
  711. },
  712. onMusicGroupPaymentCalenderDetail() {
  713. let searchForm = this.searchForm;
  714. // 报表导出
  715. let url = "/api-web/export/musicGroupPaymentCalenderDetail";
  716. let data = {
  717. id: this.$route.query.paymentId,
  718. musicGroupId: this.$route.query.id,
  719. };
  720. const options = {
  721. method: "POST",
  722. headers: {
  723. Authorization: getToken(),
  724. },
  725. data: qs.stringify(cleanDeep(data)),
  726. url,
  727. responseType: "blob",
  728. };
  729. this.$confirm("您确定导出缴费记录", "提示", {
  730. confirmButtonText: "确定",
  731. cancelButtonText: "取消",
  732. type: "warning",
  733. })
  734. .then(() => {
  735. load.startLoading();
  736. axios(options)
  737. .then((res) => {
  738. let blob = new Blob([res.data], {
  739. type: "application/vnd.ms-excel;charset=utf-8",
  740. });
  741. let text = new Response(blob).text();
  742. text.then((res) => {
  743. // 判断是否报错
  744. if (res.indexOf("code") != -1) {
  745. let json = JSON.parse(res);
  746. this.$message.error(json.msg);
  747. } else {
  748. let objectUrl = URL.createObjectURL(blob);
  749. let link = document.createElement("a");
  750. let fname = "缴费导出" + new Date().getTime() + ".xls"; //下载文件的名字
  751. link.href = objectUrl;
  752. link.setAttribute("download", fname);
  753. document.body.appendChild(link);
  754. link.click();
  755. }
  756. });
  757. load.endLoading();
  758. })
  759. .catch((error) => {
  760. this.$message.error("导出数据失败,请联系管理员");
  761. load.endLoading();
  762. });
  763. })
  764. .catch(() => {});
  765. },
  766. cancleAdd(row) {
  767. this.$refs.singleTable.setCurrentRow(row);
  768. this.studentVisible = false;
  769. },
  770. },
  771. watch: {
  772. payVisible(val) {
  773. if (!val) {
  774. this.payForm = {
  775. startDate: null,
  776. };
  777. this.$refs["payForm"].resetFields();
  778. }
  779. },
  780. resetPayVisible(val) {
  781. if (!val) {
  782. this.resetPayForm = {
  783. momey: null,
  784. };
  785. }
  786. },
  787. },
  788. };
  789. </script>
  790. <style lang='scss' scoped>
  791. .studenTable {
  792. height: 300px;
  793. overflow: auto;
  794. }
  795. .infoMsg {
  796. margin: 30px 0;
  797. display: flex;
  798. flex-direction: row;
  799. justify-content: flex-start;
  800. text-align: center;
  801. .title {
  802. color: #999;
  803. font-size: 14px;
  804. line-height: 30px;
  805. min-width: 100px;
  806. }
  807. .status {
  808. font-size: 20px;
  809. }
  810. .left {
  811. width: 200px;
  812. display: flex;
  813. flex-direction: column;
  814. justify-content: center;
  815. height: 60px;
  816. margin-right: 200px;
  817. }
  818. .right {
  819. text-align: center;
  820. height: 60px;
  821. line-height: 30px;
  822. display: flex;
  823. flex-direction: row;
  824. justify-content: flex-start;
  825. .expectBox {
  826. width: 220px;
  827. border-right: 1px solid #ccc;
  828. &:nth-last-child(1) {
  829. border-right: none !important;
  830. }
  831. }
  832. .expectBox.first {
  833. width: 300px;
  834. }
  835. }
  836. }
  837. .wrap {
  838. display: flex;
  839. flex-direction: row;
  840. justify-content: flex-start;
  841. div {
  842. margin-right: 20px;
  843. }
  844. }
  845. .inputStyle {
  846. width: 180px;
  847. }
  848. </style>