strudentPayInfo.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906
  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="payRemind"
  190. v-permission="'musicGroupPaymentCalenderDetail/sendWaitRenewMessage'"
  191. >
  192. 缴费提醒
  193. </div>
  194. <!-- <div
  195. class="newBand"
  196. @click="addStudentBtn"
  197. v-if="info.paymentStatus != 'OVER'"
  198. v-permission="'musicGroupPaymentCalenderDetail/add'"
  199. >
  200. 新增学员
  201. </div> -->
  202. <div
  203. class="newBand"
  204. @click="delStudentBtn"
  205. v-if="titleForm.paymentType != 'SPAN_GROUP_CLASS_ADJUST'"
  206. v-permission="'musicGroupPaymentCalenderDetail/batchDel'"
  207. >
  208. 删除学员
  209. </div>
  210. <div
  211. class="newBand"
  212. v-permission="'export/musicGroupPaymentCalenderDetail'"
  213. @click="onMusicGroupPaymentCalenderDetail"
  214. >
  215. 缴费记录导出
  216. </div>
  217. </div>
  218. <div class="tableWrap">
  219. <el-table
  220. style="width: 100%"
  221. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  222. :data="tableList"
  223. @selection-change="handleSelectionChange"
  224. >
  225. <el-table-column
  226. type="selection"
  227. :selectable="checkSelect"
  228. width="55"
  229. >
  230. </el-table-column>
  231. <el-table-column
  232. align="center"
  233. prop="userId"
  234. label="学员编号"
  235. ></el-table-column>
  236. <el-table-column align="center" prop="studentId" label="学员姓名">
  237. <template slot-scope="scope">
  238. <div v-if="scope.row.sysUser">
  239. {{ scope.row.sysUser.username }}
  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. {{ scope.row.studentRegistration.subjectName }}
  247. </div>
  248. </template>
  249. </el-table-column>
  250. <el-table-column align="center" label="学员状态">
  251. <template slot-scope="scope">
  252. <div v-if="scope.row.studentRegistration">
  253. {{
  254. scope.row.studentRegistration.musicGroupStatus
  255. | studentTeamStatus
  256. }}
  257. </div>
  258. </template>
  259. </el-table-column>
  260. <el-table-column align="center" prop="studentId" label="手机号">
  261. <template slot-scope="scope">
  262. <div v-if="scope.row.sysUser">
  263. {{ scope.row.sysUser.phone }}
  264. </div>
  265. </template>
  266. </el-table-column>
  267. <el-table-column
  268. align="center"
  269. prop="expectAmount"
  270. label="预计缴费金额"
  271. ></el-table-column>
  272. <el-table-column align="center" label="缴费开始日期">
  273. <template slot-scope="scope">
  274. <div>
  275. {{ scope.row.startPaymentDateMgpc | 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.deadlinePaymentDateMgpc | formatTimer }}
  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.open ? "是" : "否" }}
  290. </div>
  291. </template>
  292. </el-table-column>
  293. <el-table-column align="center" label="缴费状态">
  294. <template slot-scope="scope">
  295. <div>
  296. {{ scope.row.paymentStatus | paymentStatusDetall }}
  297. </div>
  298. </template>
  299. </el-table-column>
  300. <el-table-column align="center" prop="studentId" label="支付时间">
  301. <template slot-scope="scope">
  302. <div>
  303. {{ scope.row.payTime | dateForMinFormat }}
  304. </div>
  305. </template>
  306. </el-table-column>
  307. <!-- <el-table-column align="center"
  308. width="200px"
  309. label="操作">
  310. <template slot-scope="scope">
  311. <div>
  312. <el-button type="text"
  313. :disabled="!checkSelect(scope.row)"
  314. @click="resetPay(scope.row)">修改金额</el-button>
  315. <el-button type="text"
  316. :disabled="!checkSelect(scope.row)"
  317. @click="startPay(scope.row)">开启缴费</el-button>
  318. </div>
  319. </template>
  320. </el-table-column> -->
  321. </el-table>
  322. <pagination
  323. sync
  324. saveKey="strudent-pay-info"
  325. :total.sync="rules.total"
  326. :page.sync="rules.page"
  327. :limit.sync="rules.limit"
  328. :page-sizes="rules.page_size"
  329. @pagination="getList"
  330. />
  331. </div>
  332. </div>
  333. <!-- <el-dialog :visible.sync="payVisible"
  334. width="500px"
  335. title="修改缴费时间">
  336. <el-form :model="payForm"
  337. ref='payForm'>
  338. <el-form-item label="缴费开始日期"
  339. :rules="[{ required: true, message: '请设置缴费开始日期',trigger: 'blur'}]"
  340. prop="startDate">
  341. <el-date-picker v-model.trim="payForm.startDate"
  342. type="date"
  343. :picker-options="pickerOptions"
  344. value-format="yyyy-MM-dd"
  345. placeholder="开始日期"></el-date-picker>
  346. </el-form-item>
  347. </el-form>
  348. <div slot="footer"
  349. class="dialog-footer">
  350. <el-button @click="payVisible = false">取 消</el-button>
  351. <el-button type="primary"
  352. @click="">确 定</el-button>
  353. </div>
  354. </el-dialog> -->
  355. <el-dialog
  356. :visible.sync="resetPayVisible"
  357. width="500px"
  358. title="修改缴费金额"
  359. >
  360. <el-form
  361. :model="resetPayForm"
  362. :inline="true"
  363. label-width="120px"
  364. label-position="right"
  365. ref="resetPayForm"
  366. @submit.native.prevent
  367. >
  368. <!-- <el-form-item label="学员姓名"
  369. :rules="[{ required: true, message: '学员姓名',trigger: 'blur'}]"
  370. prop="startDate">
  371. <el-input disabled
  372. value="张三"></el-input>
  373. </el-form-item> -->
  374. <el-form-item
  375. label="预计缴费金额"
  376. :rules="[
  377. { required: true, message: '请输入预计缴费金额', trigger: 'blur' },
  378. {
  379. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  380. message: '请输入正确的金额',
  381. trigger: 'blur',
  382. },
  383. ]"
  384. prop="momey"
  385. >
  386. <el-input v-model="resetPayForm.momey"></el-input>
  387. </el-form-item>
  388. </el-form>
  389. <div slot="footer" class="dialog-footer">
  390. <el-button @click="resetPayVisible = false">取 消</el-button>
  391. <el-button type="primary" @click="submitReset">确 定</el-button>
  392. </div>
  393. </el-dialog>
  394. <el-dialog :visible.sync="studentVisible" title="学生列表"
  395. width="600">
  396. <el-table :data="studentList"
  397. class="studenTable"
  398. ref="singleTable"
  399. highlight-current-row
  400. @current-change="handleCurrentChange">
  401. <!-- <el-table-column type="selection"
  402. width="55">
  403. </el-table-column> -->
  404. <el-table-column
  405. property="userId"
  406. align="center"
  407. label="学员编号"
  408. ></el-table-column>
  409. <el-table-column
  410. property="name"
  411. align="center"
  412. label="学员姓名"
  413. ></el-table-column>
  414. <el-table-column
  415. property="phone"
  416. align="center"
  417. label="手机号"
  418. ></el-table-column>
  419. </el-table>
  420. <div slot="footer" class="dialog-footer">
  421. <el-button @click="cancleAdd">取 消</el-button>
  422. <el-button type="primary" @click="submitAddStudent">确 定</el-button>
  423. </div>
  424. </el-dialog>
  425. <el-dialog width="700px" title="查看缴费详情" :visible.sync="detailVisible">
  426. <studentPayDetail :msgList="msgList" :titleForm="titleForm" />
  427. </el-dialog>
  428. </div>
  429. </template>
  430. <script>
  431. import axios from "axios";
  432. import { getToken } from "@/utils/auth";
  433. import pagination from "@/components/Pagination/index";
  434. import load from "@/utils/loading";
  435. import cleanDeep from "clean-deep";
  436. import qs from "qs";
  437. import { courseType } from "@/utils/searchArray";
  438. import { paymentPatternType } from "@/constant";
  439. import studentPayDetail from "../modals/studentPayDetail";
  440. import {
  441. findSound,
  442. getmusicGroupPaymentCalenderDetail,
  443. openMusicGroupPaymentCalenderDetailPayment,
  444. resetMusicGroupPaymentCalenderDetail,
  445. getMusicGroupPaymentCalenderDetail,
  446. queryCanAddStudent,
  447. addMusicGroupPaymentCalenderStudent,
  448. delMusicGroupPaymentCalenderStudent,
  449. sendWaitRenewMessage
  450. } from "@/api/buildTeam";
  451. export default {
  452. components: { pagination, studentPayDetail },
  453. data() {
  454. return {
  455. searchForm: {
  456. search: null,
  457. subjectId: null,
  458. paymentStatus: null,
  459. musicGroupStatus: null,
  460. },
  461. teacherList: [],
  462. soundList: [],
  463. tableList: [{ studentId: 111 }],
  464. rules: {
  465. // 分页规则
  466. limit: 10, // 限制显示条数
  467. page: 1, // 当前页
  468. total: 0, // 总条数
  469. page_size: [10, 20, 40, 50], // 选择限制显示条数
  470. },
  471. payVisible: false,
  472. resetPayVisible: false,
  473. studentVisible: false,
  474. chioseStudent: null,
  475. studentList: [],
  476. pickerOptions: {
  477. disabledDate(time) {
  478. return time.getTime() + 86400000 <= new Date().getTime();
  479. },
  480. },
  481. payForm: {
  482. startDate: null,
  483. },
  484. resetPayForm: {
  485. momey: null,
  486. },
  487. activeChiose: [],
  488. id: null,
  489. ids: null,
  490. info: {
  491. paymentStatus: null,
  492. startPaymentDate: null,
  493. deadlinePaymentDate: null,
  494. expectNum: null,
  495. actualNum: null,
  496. sumActualAmount: null,
  497. },
  498. msgList: [],
  499. detailVisible: false,
  500. titleForm: {
  501. paymentType: "",
  502. musicGroupOrganizationCourseSettingId: "",
  503. paymentPattern: "",
  504. paymentValidStartDate: "",
  505. paymentValidEndDate: "",
  506. calenderSettingsName: "",
  507. },
  508. };
  509. },
  510. //生命周期 - 创建完成(可以访问当前this实例)
  511. created() {},
  512. //生命周期 - 挂载完成(可以访问DOM元素)
  513. mounted() {
  514. // 获取声部
  515. this.teamid = this.$route.query.id;
  516. findSound({ musicGroupId: this.teamid }).then((res) => {
  517. if (res.code == 200) {
  518. this.soundList = res.data;
  519. }
  520. });
  521. // 获取分部
  522. this.init();
  523. },
  524. activated() {
  525. this.teamid = this.$route.query.id;
  526. findSound({ musicGroupId: this.teamid }).then((res) => {
  527. if (res.code == 200) {
  528. this.soundList = res.data;
  529. }
  530. });
  531. this.init();
  532. },
  533. methods: {
  534. init() {
  535. this.getList();
  536. },
  537. getList() {
  538. this.id = this.$route.query.paymentId;
  539. // 获取缴费状态
  540. getMusicGroupPaymentCalenderDetail({ id: this.id }).then((res) => {
  541. if (res.code == 200) {
  542. this.info = {
  543. paymentStatus: res.data.calender.status,
  544. startPaymentDate: res.data.calender.startPaymentDate,
  545. deadlinePaymentDate: res.data.calender.deadlinePaymentDate,
  546. expectNum: res.data.calender.expectNum,
  547. actualNum: res.data.calender.actualNum,
  548. sumActualAmount: res.data.sumActualAmount,
  549. };
  550. this.titleForm = {
  551. paymentType: res.data.calender.paymentType,
  552. musicGroupOrganizationCourseSettingId:
  553. res.data.calenderSettingsName,
  554. paymentPattern:
  555. paymentPatternType[res.data.calender.paymentPattern],
  556. paymentValidStartDate: res.data.calender.paymentValidStartDate,
  557. paymentValidEndDate: res.data.calender.paymentValidEndDate,
  558. calenderSettingsName: res.data.calenderSettingsName,
  559. };
  560. this.msgList = res.data.musicGroupPaymentCalenderCourseSettings;
  561. }
  562. });
  563. this.searchForm.id = this.id;
  564. this.searchForm.page = this.rules.page;
  565. this.searchForm.rows = this.rules.limit;
  566. getmusicGroupPaymentCalenderDetail(this.searchForm).then((payment) => {
  567. if (payment.code == 200) {
  568. this.rules.total = payment.data.total;
  569. this.tableList = payment.data.rows;
  570. }
  571. });
  572. },
  573. search() {
  574. this.rules.page = 1;
  575. this.getList();
  576. },
  577. onReSet() {
  578. this.searchForm = {
  579. search: null,
  580. subjectId: null,
  581. paymentStatus: null,
  582. };
  583. this.search();
  584. },
  585. checkSelect(val) {
  586. return val.paymentStatus == "NON_PAYMENT";
  587. },
  588. resetPay() {
  589. // this.activeRow = row;
  590. if (this.activeChiose.length < 1) {
  591. this.$message.error("请至少选择一名学员");
  592. return;
  593. }
  594. let ids = this.activeChiose.map((item) => {
  595. return item.id;
  596. });
  597. this.ids = ids.join(",");
  598. this.resetPayVisible = true;
  599. },
  600. // resetTime () {
  601. // this.payVisible = true;
  602. // },
  603. goBack() {
  604. let query = this.$route.query;
  605. if (query.type == "resetTeam") {
  606. this.$store.dispatch("delVisitedViews", this.$route);
  607. this.$router.push({
  608. path: "/business/resetTeaming",
  609. query: { ...this.$route.query },
  610. });
  611. } else if (query.type == "look") {
  612. this.$store.dispatch("delVisitedViews", this.$route);
  613. this.$router.push({
  614. path: "/business/teamLookBase",
  615. query: { ...this.$route.query },
  616. });
  617. }else if(query.type == 'PRE_BUILD_FEE'){
  618. this.$store.dispatch("delVisitedViews", this.$route);
  619. this.$router.push({
  620. path: "/business/createPayment",
  621. query: { ...this.$route.query },
  622. });
  623. }
  624. },
  625. handleSelectionChange(val) {
  626. this.activeChiose = val;
  627. console.log(val);
  628. },
  629. startPay() {
  630. if (this.activeChiose.length < 1) {
  631. this.$message.error("请至少选择一名学员");
  632. return;
  633. }
  634. // console.log(this.activeChiose)
  635. let ids = this.activeChiose.map((item) => {
  636. return item.id;
  637. });
  638. ids = ids.join(",");
  639. // console.log(ids)
  640. openMusicGroupPaymentCalenderDetailPayment({ ids }).then((res) => {
  641. if (res.code == 200) {
  642. this.$message.success(res.msg);
  643. this.getList();
  644. }
  645. });
  646. },
  647. submitReset() {
  648. let obj = {};
  649. obj.expectAmount = this.resetPayForm.momey;
  650. obj.ids = this.ids;
  651. resetMusicGroupPaymentCalenderDetail(obj).then((res) => {
  652. if (res.code == 200) {
  653. this.$message.success("修改成功");
  654. this.resetPayVisible = false;
  655. this.getList();
  656. }
  657. });
  658. },
  659. addStudentBtn() {
  660. console.log(
  661. "musicGroupId:",
  662. this.teamid,
  663. "musicGroupPaymentCalenderId:",
  664. this.id
  665. );
  666. // 获取无缴费学员
  667. queryCanAddStudent({
  668. musicGroupId: this.teamid,
  669. musicGroupPaymentCalenderId: this.id,
  670. }).then((res) => {
  671. if (res.code == 200) {
  672. this.studentList = res.data;
  673. this.studentVisible = true;
  674. }
  675. });
  676. },
  677. delStudentBtn() {
  678. if (this.activeChiose.length < 1) {
  679. this.$message.error("请至少选择一名学员");
  680. return;
  681. }
  682. this.$confirm(`是否删除此学员`, "提示", {
  683. confirmButtonText: "确定",
  684. cancelButtonText: "取消",
  685. type: "warning",
  686. })
  687. .then(() => {
  688. let musicGroupPaymentCalenderDetailIds = this.activeChiose
  689. .map((stu) => {
  690. return stu.id;
  691. })
  692. .join(",");
  693. delMusicGroupPaymentCalenderStudent({
  694. musicGroupPaymentCalenderDetailIds,
  695. }).then((res) => {
  696. if (res.code == 200) {
  697. this.$message.success(`删除成功`);
  698. this.$set(this.rules, "page", 1);
  699. this.getList();
  700. }
  701. });
  702. })
  703. .catch(() => {});
  704. },
  705. handleCurrentChange(val) {
  706. this.chioseStudent = val;
  707. },
  708. submitAddStudent() {
  709. if (!this.chioseStudent) {
  710. this.$message.error("请选择学员");
  711. return;
  712. }
  713. addMusicGroupPaymentCalenderStudent({
  714. musicGroupPaymentCalenderId: this.id,
  715. userId: this.chioseStudent.userId,
  716. }).then((res) => {
  717. if (res.code == 200) {
  718. this.$message.success("添加成功");
  719. this.studentVisible = false;
  720. this.getList();
  721. }
  722. });
  723. },
  724. onMusicGroupPaymentCalenderDetail() {
  725. let searchForm = this.searchForm;
  726. // 报表导出
  727. let url = "/api-web/export/musicGroupPaymentCalenderDetail";
  728. let data = {
  729. id: this.$route.query.paymentId,
  730. musicGroupId: this.$route.query.id,
  731. };
  732. const options = {
  733. method: "POST",
  734. headers: {
  735. Authorization: getToken(),
  736. },
  737. data: qs.stringify(cleanDeep(data)),
  738. url,
  739. responseType: "blob",
  740. };
  741. this.$confirm("您确定导出缴费记录", "提示", {
  742. confirmButtonText: "确定",
  743. cancelButtonText: "取消",
  744. type: "warning",
  745. })
  746. .then(() => {
  747. load.startLoading();
  748. axios(options)
  749. .then((res) => {
  750. let blob = new Blob([res.data], {
  751. type: "application/vnd.ms-excel;charset=utf-8",
  752. });
  753. let text = new Response(blob).text();
  754. text.then((res) => {
  755. // 判断是否报错
  756. if (res.indexOf("code") != -1) {
  757. let json = JSON.parse(res);
  758. this.$message.error(json.msg);
  759. } else {
  760. let objectUrl = URL.createObjectURL(blob);
  761. let link = document.createElement("a");
  762. let fname = "缴费导出" + new Date().getTime() + ".xls"; //下载文件的名字
  763. link.href = objectUrl;
  764. link.setAttribute("download", fname);
  765. document.body.appendChild(link);
  766. link.click();
  767. }
  768. });
  769. load.endLoading();
  770. })
  771. .catch((error) => {
  772. this.$message.error("导出数据失败,请联系管理员");
  773. load.endLoading();
  774. });
  775. })
  776. .catch(() => {});
  777. },
  778. cancleAdd(row) {
  779. this.$refs.singleTable.setCurrentRow(row);
  780. this.studentVisible = false;
  781. },
  782. payRemind(){
  783. console.log(this.activeChiose)
  784. let submitArr = [];
  785. let msgArr = '';
  786. let str = ''
  787. this.activeChiose.forEach(item=>{
  788. if(item.open){
  789. submitArr.push(item.userId)
  790. }else{
  791. msgArr+=item?.sysUser?.username+','
  792. }
  793. })
  794. console.log(submitArr,msgArr)
  795. if(msgArr){
  796. str=`${msgArr}未开启缴费无法提醒`
  797. }else{
  798. str='是否发送提醒'
  799. }
  800. this.$confirm(str, '提示', {
  801. confirmButtonText: '确定',
  802. cancelButtonText: '取消',
  803. type: 'warning'
  804. }).then(async() => {
  805. try{
  806. const res = await sendWaitRenewMessage({studentIds:submitArr.join(','),calenderId:this.$route.query.paymentId})
  807. this.$message.success('提醒成功')
  808. this.getList()
  809. }catch(e){
  810. }
  811. }).catch(() => {
  812. });
  813. }
  814. },
  815. watch: {
  816. payVisible(val) {
  817. if (!val) {
  818. this.payForm = {
  819. startDate: null,
  820. };
  821. this.$refs["payForm"].resetFields();
  822. }
  823. },
  824. resetPayVisible(val) {
  825. if (!val) {
  826. this.resetPayForm = {
  827. momey: null,
  828. };
  829. }
  830. },
  831. },
  832. };
  833. </script>
  834. <style lang='scss' scoped>
  835. .studenTable {
  836. height: 300px;
  837. overflow: auto;
  838. }
  839. .infoMsg {
  840. margin: 30px 0;
  841. display: flex;
  842. flex-direction: row;
  843. justify-content: flex-start;
  844. text-align: center;
  845. .title {
  846. color: #999;
  847. font-size: 14px;
  848. line-height: 30px;
  849. min-width: 100px;
  850. }
  851. .status {
  852. font-size: 20px;
  853. }
  854. .left {
  855. width: 200px;
  856. display: flex;
  857. flex-direction: column;
  858. justify-content: center;
  859. height: 60px;
  860. margin-right: 200px;
  861. }
  862. .right {
  863. text-align: center;
  864. height: 60px;
  865. line-height: 30px;
  866. display: flex;
  867. flex-direction: row;
  868. justify-content: flex-start;
  869. .expectBox {
  870. width: 220px;
  871. border-right: 1px solid #ccc;
  872. &:nth-last-child(1) {
  873. border-right: none !important;
  874. }
  875. }
  876. .expectBox.first {
  877. width: 300px;
  878. }
  879. }
  880. }
  881. .wrap {
  882. display: flex;
  883. flex-direction: row;
  884. justify-content: flex-start;
  885. div {
  886. margin-right: 20px;
  887. }
  888. }
  889. .inputStyle {
  890. width: 180px;
  891. }
  892. </style>