strudentPayInfo.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851
  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" title="学生列表"
  388. width="600">
  389. <el-table :data="studentList"
  390. class="studenTable"
  391. ref="singleTable"
  392. highlight-current-row
  393. @current-change="handleCurrentChange">
  394. <!-- <el-table-column type="selection"
  395. width="55">
  396. </el-table-column> -->
  397. <el-table-column
  398. property="userId"
  399. align="center"
  400. label="学员编号"
  401. ></el-table-column>
  402. <el-table-column
  403. property="name"
  404. align="center"
  405. label="学员姓名"
  406. ></el-table-column>
  407. <el-table-column
  408. property="phone"
  409. align="center"
  410. label="手机号"
  411. ></el-table-column>
  412. </el-table>
  413. <div slot="footer" class="dialog-footer">
  414. <el-button @click="cancleAdd">取 消</el-button>
  415. <el-button type="primary" @click="submitAddStudent">确 定</el-button>
  416. </div>
  417. </el-dialog>
  418. <el-dialog width="700px" title="查看缴费详情" :visible.sync="detailVisible">
  419. <studentPayDetail :msgList="msgList" :titleForm="titleForm" />
  420. </el-dialog>
  421. </div>
  422. </template>
  423. <script>
  424. import axios from "axios";
  425. import { getToken } from "@/utils/auth";
  426. import pagination from "@/components/Pagination/index";
  427. import load from "@/utils/loading";
  428. import cleanDeep from "clean-deep";
  429. import qs from "qs";
  430. import { courseType } from "@/utils/searchArray";
  431. import { paymentPatternType } from "@/constant";
  432. import studentPayDetail from "../modals/studentPayDetail";
  433. import {
  434. findSound,
  435. getmusicGroupPaymentCalenderDetail,
  436. openMusicGroupPaymentCalenderDetailPayment,
  437. resetMusicGroupPaymentCalenderDetail,
  438. getMusicGroupPaymentCalenderDetail,
  439. queryCanAddStudent,
  440. addMusicGroupPaymentCalenderStudent,
  441. delMusicGroupPaymentCalenderStudent,
  442. } from "@/api/buildTeam";
  443. export default {
  444. components: { pagination, studentPayDetail },
  445. data() {
  446. return {
  447. searchForm: {
  448. search: null,
  449. subjectId: null,
  450. paymentStatus: null,
  451. musicGroupStatus: null,
  452. },
  453. teacherList: [],
  454. soundList: [],
  455. tableList: [{ studentId: 111 }],
  456. rules: {
  457. // 分页规则
  458. limit: 10, // 限制显示条数
  459. page: 1, // 当前页
  460. total: 0, // 总条数
  461. page_size: [10, 20, 40, 50], // 选择限制显示条数
  462. },
  463. payVisible: false,
  464. resetPayVisible: false,
  465. studentVisible: false,
  466. chioseStudent: null,
  467. studentList: [],
  468. pickerOptions: {
  469. disabledDate(time) {
  470. return time.getTime() + 86400000 <= new Date().getTime();
  471. },
  472. },
  473. payForm: {
  474. startDate: null,
  475. },
  476. resetPayForm: {
  477. momey: null,
  478. },
  479. activeChiose: [],
  480. id: null,
  481. ids: null,
  482. info: {
  483. paymentStatus: null,
  484. startPaymentDate: null,
  485. deadlinePaymentDate: null,
  486. expectNum: null,
  487. actualNum: null,
  488. sumActualAmount: null,
  489. },
  490. msgList: [],
  491. detailVisible: false,
  492. titleForm: {
  493. paymentType: "",
  494. musicGroupOrganizationCourseSettingId: "",
  495. paymentPattern: "",
  496. paymentValidStartDate: "",
  497. paymentValidEndDate: "",
  498. calenderSettingsName: "",
  499. },
  500. };
  501. },
  502. //生命周期 - 创建完成(可以访问当前this实例)
  503. created() {},
  504. //生命周期 - 挂载完成(可以访问DOM元素)
  505. mounted() {
  506. // 获取声部
  507. this.teamid = this.$route.query.id;
  508. findSound({ musicGroupId: this.teamid }).then((res) => {
  509. if (res.code == 200) {
  510. this.soundList = res.data;
  511. }
  512. });
  513. // 获取分部
  514. this.init();
  515. },
  516. activated() {
  517. this.teamid = this.$route.query.id;
  518. findSound({ musicGroupId: this.teamid }).then((res) => {
  519. if (res.code == 200) {
  520. this.soundList = res.data;
  521. }
  522. });
  523. this.init();
  524. },
  525. methods: {
  526. init() {
  527. this.getList();
  528. },
  529. getList() {
  530. this.id = this.$route.query.paymentId;
  531. // 获取缴费状态
  532. getMusicGroupPaymentCalenderDetail({ id: this.id }).then((res) => {
  533. if (res.code == 200) {
  534. this.info = {
  535. paymentStatus: res.data.calender.status,
  536. startPaymentDate: res.data.calender.startPaymentDate,
  537. deadlinePaymentDate: res.data.calender.deadlinePaymentDate,
  538. expectNum: res.data.calender.expectNum,
  539. actualNum: res.data.calender.actualNum,
  540. sumActualAmount: res.data.sumActualAmount,
  541. };
  542. this.titleForm = {
  543. paymentType: res.data.calender.paymentType,
  544. musicGroupOrganizationCourseSettingId:
  545. res.data.calenderSettingsName,
  546. paymentPattern:
  547. paymentPatternType[res.data.calender.paymentPattern],
  548. paymentValidStartDate: res.data.calender.paymentValidStartDate,
  549. paymentValidEndDate: res.data.calender.paymentValidEndDate,
  550. calenderSettingsName: res.data.calenderSettingsName,
  551. };
  552. this.msgList = res.data.musicGroupPaymentCalenderCourseSettings;
  553. }
  554. });
  555. this.searchForm.id = this.id;
  556. this.searchForm.page = this.rules.page;
  557. this.searchForm.rows = this.rules.limit;
  558. getmusicGroupPaymentCalenderDetail(this.searchForm).then((payment) => {
  559. if (payment.code == 200) {
  560. this.rules.total = payment.data.total;
  561. this.tableList = payment.data.rows;
  562. }
  563. });
  564. },
  565. search() {
  566. this.rules.page = 1;
  567. this.getList();
  568. },
  569. onReSet() {
  570. this.searchForm = {
  571. search: null,
  572. subjectId: null,
  573. paymentStatus: null,
  574. };
  575. this.search();
  576. },
  577. checkSelect(val) {
  578. return val.paymentStatus == "NON_PAYMENT";
  579. },
  580. resetPay() {
  581. // this.activeRow = row;
  582. if (this.activeChiose.length < 1) {
  583. this.$message.error("请至少选择一名学员");
  584. return;
  585. }
  586. let ids = this.activeChiose.map((item) => {
  587. return item.id;
  588. });
  589. this.ids = ids.join(",");
  590. this.resetPayVisible = true;
  591. },
  592. // resetTime () {
  593. // this.payVisible = true;
  594. // },
  595. goBack() {
  596. let query = this.$route.query;
  597. if (query.type == "resetTeam" || query.type == 'look') {
  598. this.$store.dispatch("delVisitedViews", this.$route);
  599. this.$router.push({
  600. path: "/business/resetTeaming",
  601. query: { ...this.$route.query },
  602. });
  603. }
  604. },
  605. handleSelectionChange(val) {
  606. this.activeChiose = val;
  607. console.log(val);
  608. },
  609. startPay() {
  610. if (this.activeChiose.length < 1) {
  611. this.$message.error("请至少选择一名学员");
  612. return;
  613. }
  614. // console.log(this.activeChiose)
  615. let ids = this.activeChiose.map((item) => {
  616. return item.id;
  617. });
  618. ids = ids.join(",");
  619. // console.log(ids)
  620. openMusicGroupPaymentCalenderDetailPayment({ ids }).then((res) => {
  621. if (res.code == 200) {
  622. this.$message.success(res.msg);
  623. this.getList();
  624. }
  625. });
  626. },
  627. submitReset() {
  628. let obj = {};
  629. obj.expectAmount = this.resetPayForm.momey;
  630. obj.ids = this.ids;
  631. resetMusicGroupPaymentCalenderDetail(obj).then((res) => {
  632. if (res.code == 200) {
  633. this.$message.success("修改成功");
  634. this.resetPayVisible = false;
  635. this.getList();
  636. }
  637. });
  638. },
  639. addStudentBtn() {
  640. console.log(
  641. "musicGroupId:",
  642. this.teamid,
  643. "musicGroupPaymentCalenderId:",
  644. this.id
  645. );
  646. // 获取无缴费学员
  647. queryCanAddStudent({
  648. musicGroupId: this.teamid,
  649. musicGroupPaymentCalenderId: this.id,
  650. }).then((res) => {
  651. if (res.code == 200) {
  652. this.studentList = res.data;
  653. this.studentVisible = true;
  654. }
  655. });
  656. },
  657. delStudentBtn() {
  658. if (this.activeChiose.length < 1) {
  659. this.$message.error("请至少选择一名学员");
  660. return;
  661. }
  662. this.$confirm(`是否删除此学员`, "提示", {
  663. confirmButtonText: "确定",
  664. cancelButtonText: "取消",
  665. type: "warning",
  666. })
  667. .then(() => {
  668. let musicGroupPaymentCalenderDetailIds = this.activeChiose
  669. .map((stu) => {
  670. return stu.id;
  671. })
  672. .join(",");
  673. delMusicGroupPaymentCalenderStudent({
  674. musicGroupPaymentCalenderDetailIds,
  675. }).then((res) => {
  676. if (res.code == 200) {
  677. this.$message.success(`删除成功`);
  678. this.$set(this.rules, "page", 1);
  679. this.getList();
  680. }
  681. });
  682. })
  683. .catch(() => {});
  684. },
  685. handleCurrentChange(val) {
  686. this.chioseStudent = val;
  687. },
  688. submitAddStudent() {
  689. if (!this.chioseStudent) {
  690. this.$message.error("请选择学员");
  691. return;
  692. }
  693. addMusicGroupPaymentCalenderStudent({
  694. musicGroupPaymentCalenderId: this.id,
  695. userId: this.chioseStudent.userId,
  696. }).then((res) => {
  697. if (res.code == 200) {
  698. this.$message.success("添加成功");
  699. this.studentVisible = false;
  700. this.getList();
  701. }
  702. });
  703. },
  704. onMusicGroupPaymentCalenderDetail() {
  705. let searchForm = this.searchForm;
  706. // 报表导出
  707. let url = "/api-web/export/musicGroupPaymentCalenderDetail";
  708. let data = {
  709. id: this.$route.query.paymentId,
  710. musicGroupId: this.$route.query.id,
  711. };
  712. const options = {
  713. method: "POST",
  714. headers: {
  715. Authorization: getToken(),
  716. },
  717. data: qs.stringify(cleanDeep(data)),
  718. url,
  719. responseType: "blob",
  720. };
  721. this.$confirm("您确定导出缴费记录", "提示", {
  722. confirmButtonText: "确定",
  723. cancelButtonText: "取消",
  724. type: "warning",
  725. })
  726. .then(() => {
  727. load.startLoading();
  728. axios(options)
  729. .then((res) => {
  730. let blob = new Blob([res.data], {
  731. type: "application/vnd.ms-excel;charset=utf-8",
  732. });
  733. let text = new Response(blob).text();
  734. text.then((res) => {
  735. // 判断是否报错
  736. if (res.indexOf("code") != -1) {
  737. let json = JSON.parse(res);
  738. this.$message.error(json.msg);
  739. } else {
  740. let objectUrl = URL.createObjectURL(blob);
  741. let link = document.createElement("a");
  742. let fname = "缴费导出" + new Date().getTime() + ".xls"; //下载文件的名字
  743. link.href = objectUrl;
  744. link.setAttribute("download", fname);
  745. document.body.appendChild(link);
  746. link.click();
  747. }
  748. });
  749. load.endLoading();
  750. })
  751. .catch((error) => {
  752. this.$message.error("导出数据失败,请联系管理员");
  753. load.endLoading();
  754. });
  755. })
  756. .catch(() => {});
  757. },
  758. cancleAdd(row) {
  759. this.$refs.singleTable.setCurrentRow(row);
  760. this.studentVisible = false;
  761. },
  762. },
  763. watch: {
  764. payVisible(val) {
  765. if (!val) {
  766. this.payForm = {
  767. startDate: null,
  768. };
  769. this.$refs["payForm"].resetFields();
  770. }
  771. },
  772. resetPayVisible(val) {
  773. if (!val) {
  774. this.resetPayForm = {
  775. momey: null,
  776. };
  777. }
  778. },
  779. },
  780. };
  781. </script>
  782. <style lang='scss' scoped>
  783. .studenTable {
  784. height: 300px;
  785. overflow: auto;
  786. }
  787. .infoMsg {
  788. margin: 30px 0;
  789. display: flex;
  790. flex-direction: row;
  791. justify-content: flex-start;
  792. text-align: center;
  793. .title {
  794. color: #999;
  795. font-size: 14px;
  796. line-height: 30px;
  797. min-width: 100px;
  798. }
  799. .status {
  800. font-size: 20px;
  801. }
  802. .left {
  803. width: 200px;
  804. display: flex;
  805. flex-direction: column;
  806. justify-content: center;
  807. height: 60px;
  808. margin-right: 200px;
  809. }
  810. .right {
  811. text-align: center;
  812. height: 60px;
  813. line-height: 30px;
  814. display: flex;
  815. flex-direction: row;
  816. justify-content: flex-start;
  817. .expectBox {
  818. width: 220px;
  819. border-right: 1px solid #ccc;
  820. &:nth-last-child(1) {
  821. border-right: none !important;
  822. }
  823. }
  824. .expectBox.first {
  825. width: 300px;
  826. }
  827. }
  828. }
  829. .wrap {
  830. display: flex;
  831. flex-direction: row;
  832. justify-content: flex-start;
  833. div {
  834. margin-right: 20px;
  835. }
  836. }
  837. .inputStyle {
  838. width: 180px;
  839. }
  840. </style>