resetPayList.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072
  1. <!-- -->
  2. <template>
  3. <div class="m-core">
  4. <save-form
  5. :inline="true"
  6. save-key="resetPayList"
  7. @submit="getList"
  8. :model="searchForm"
  9. >
  10. <el-form-item>
  11. <el-select
  12. placeholder="缴费类型"
  13. v-model="searchForm.paymentType"
  14. clearable
  15. filterable
  16. >
  17. <el-option
  18. v-for="(item, index) in payOrderTypeList"
  19. :label="item.label"
  20. :value="item.value"
  21. :key="index"
  22. ></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item>
  26. <el-button type="danger" native-type="submit">搜索</el-button>
  27. <!-- <el-button @click="onReSet" type="primary">重置</el-button> -->
  28. </el-form-item>
  29. </save-form>
  30. <div class="topWrap">
  31. <div
  32. class="newBand"
  33. @click="newUserPay"
  34. v-if="teamStatus"
  35. v-permission="'musicGroupPaymentCalender/createCalender/3895'"
  36. >
  37. 新建学员缴费
  38. </div>
  39. <!-- <div class="newBand"
  40. v-if="teamStatus"
  41. v-permission="'/studentPayBase'"
  42. @click="setStudentPay">学员缴费设置</div> -->
  43. <!-- <div class="newBand"
  44. v-if="!isNewGropu"
  45. @click="onCreateQRCode">续费二维码</div> -->
  46. </div>
  47. <div class="tableWrap">
  48. <el-table
  49. style="width: 100%"
  50. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  51. :data="tableList"
  52. >
  53. <el-table-column
  54. align="center"
  55. prop="batchNo"
  56. width="200"
  57. label="缴费批次"
  58. >
  59. <template slot-scope="scope">
  60. <div>
  61. <copy-text>{{ scope.row.batchNo }}</copy-text>
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column align="center" prop="paymentType" label="缴费类型">
  66. <template slot-scope="scope">
  67. <div>
  68. {{ scope.row.paymentType | userPaymentTypeFormat }}
  69. </div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column
  73. align="center"
  74. prop="auditStatus"
  75. label="审核状态"
  76. width="100px"
  77. >
  78. <template slot-scope="scope">
  79. <div>
  80. {{ scope.row.status | auditType }}
  81. </div>
  82. </template>
  83. </el-table-column>
  84. <!-- <el-table-column
  85. align="center"
  86. prop="addCourseTotalTime"
  87. width="150px"
  88. label="加课总时长"
  89. >
  90. </el-table-column> -->
  91. <!-- <el-table-column
  92. align="center"
  93. prop="courseCurrentPrice"
  94. label="课程费用"
  95. >
  96. <template slot-scope="scope">
  97. <div>
  98. {{
  99. (scope.row.paymentType === "SPAN_GROUP_CLASS_ADJUST"
  100. ? scope.row.courseOriginalPrice
  101. : scope.row.courseCurrentPrice) | moneyFormat
  102. }}
  103. </div>
  104. </template>
  105. </el-table-column>
  106. <el-table-column
  107. align="center"
  108. prop="courseCurrentPrice"
  109. label="会员费用"
  110. >
  111. <template slot-scope="scope">
  112. <div>
  113. {{ scope.row.memberPaymentAmount | moneyFormat }}
  114. </div>
  115. </template>
  116. </el-table-column> -->
  117. <el-table-column align="center" prop="status" label="缴费人数">
  118. <template slot-scope="scope">
  119. <div>{{ scope.row.actualNum }}/{{ scope.row.expectNum }}</div>
  120. </template>
  121. </el-table-column>
  122. <!-- <el-table-column align="center"
  123. prop="operatorName"
  124. label="责任人">
  125. </el-table-column> -->
  126. <el-table-column align="center" prop="memo" width="200px" label="备注">
  127. <template slot-scope="scope">
  128. <overflow-text width="200px" :text="scope.row.memo" />
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="操作" fixed="right" min-width="200px">
  132. <template slot-scope="scope">
  133. <div>
  134. <auth auths="musicGroupPaymentCalender/queryPage/4315">
  135. <!-- v-permission="'musicGroupPaymentCalender/queryPage/4315'" -->
  136. <el-button type="text" @click="lookDetail(scope.row)"
  137. >查看</el-button
  138. ></auth
  139. >
  140. <auth
  141. auths="musicGroupPaymentCalenderDetail/batchAdd/3890"
  142. v-if="
  143. scope.row.auditStatus != 'REJECT' &&
  144. scope.row.auditStatus != 'AUDITING' &&
  145. scope.row.auditStatus != 'DRAFT' &&
  146. teamStatus &&
  147. scope.row.paymentType != 'MUSIC_APPLY' &&
  148. scope.row.paymentType != 'ADD_STUDENT' &&
  149. scope.row.paymentType != 'SPAN_GROUP_CLASS_ADJUST'
  150. "
  151. >
  152. <el-button type="text" @click="openChioseStudent(scope.row)"
  153. >添加学员</el-button
  154. >
  155. </auth>
  156. <!-- v-permission="'musicGroupPaymentCalenderDetail/batchAdd/3890'" v-permission="''" -->
  157. <auth
  158. auths="musicGroupPaymentCalender/update/4313"
  159. v-if="
  160. teamStatus &&
  161. (scope.row.status === 'REJECT' ||
  162. scope.row.status === 'DRAFT')
  163. "
  164. >
  165. <el-button type="text" @click="resetPay(scope.row)"
  166. >修改</el-button
  167. >
  168. </auth>
  169. <auth
  170. auths="musicGroupPaymentCalender/revoke"
  171. v-if="
  172. (team_status == 'FEE_AUDIT' || team_status == 'PROGRESS') &&
  173. scope.row.auditStatus === 'AUDITING' &&
  174. scope.row.paymentType != 'ADD_STUDENT' &&
  175. scope.row.paymentType != 'SPAN_GROUP_CLASS_ADJUST'
  176. "
  177. >
  178. <el-button type="text" @click="revoke(scope.row)"
  179. >撤回</el-button
  180. >
  181. </auth>
  182. <!-- -->
  183. <auth
  184. auths="musicGroupPaymentCalender/delByBatchNo/4305"
  185. v-if="
  186. teamStatus &&
  187. scope.row.paymentType != 'ADD_STUDENT' &&
  188. scope.row.paymentType != 'SPAN_GROUP_CLASS_ADJUST' &&
  189. (scope.row.auditStatus == 'DRAFT' ||
  190. scope.row.auditStatus == 'REJECT')
  191. "
  192. >
  193. <el-button type="text" @click="removeBatchNo(scope.row)"
  194. >删除</el-button
  195. ></auth
  196. >
  197. <auth
  198. auths="musicGroupPaymentCalender/delByBatchNo/4305"
  199. v-if="
  200. teamStatus &&
  201. scope.row.paymentType == 'ADD_STUDENT' &&
  202. (scope.row.auditStatus == 'DRAFT' ||
  203. scope.row.auditStatus == 'REJECT')
  204. "
  205. >
  206. <el-button type="text" @click="removeBatchNo(scope.row)"
  207. >删除</el-button
  208. ></auth
  209. >
  210. <el-button
  211. type="text"
  212. v-if="
  213. !isNewGropu &&
  214. teamStatus &&
  215. scope.row.paymentType != 'MUSIC_APPLY' &&
  216. (scope.row.auditStatus == 'DRAFT' ||
  217. scope.row.auditStatus == 'REJECT')
  218. "
  219. @click="onCreateQRCode(scope.row)"
  220. >续费二维码</el-button
  221. >
  222. <el-button
  223. type="text"
  224. v-if="
  225. scope.row.payUserType === 'STUDENT' &&
  226. scope.row.paymentType == 'MUSIC_APPLY' &&
  227. $helpers.permission(
  228. 'musicGroup/findMusicGroupSubjectInfo/966'
  229. )
  230. "
  231. @click="onPreview(scope.row)"
  232. >预览</el-button
  233. >
  234. </div>
  235. </template>
  236. </el-table-column>
  237. </el-table>
  238. <pagination
  239. save-key="resetPayList"
  240. sync
  241. :total.sync="rules.total"
  242. :page.sync="rules.page"
  243. :limit.sync="rules.limit"
  244. :page-sizes="rules.page_size"
  245. @pagination="getList"
  246. />
  247. </div>
  248. <el-dialog :visible.sync="itemsVisible" title="查看缴费计划" width="1000px">
  249. <pay-items
  250. v-if="itemsVisible"
  251. ref="payItems"
  252. :batchNo="viewDetail && viewDetail.batchNo"
  253. payUserType="STUDENT"
  254. :teamStatus="teamStatus"
  255. :teamType="teamType"
  256. :isNewGropu="isNewGropu"
  257. @lookDetail="lookDetail"
  258. @onPreview="onPreview"
  259. @openChioseStudent="openChioseStudent"
  260. @resetPay="resetPay"
  261. @close="itemsVisible = false"
  262. @onCreateQRCode="onCreateQRCode"
  263. />
  264. </el-dialog>
  265. <el-dialog
  266. :visible.sync="payVisible"
  267. :close-on-click-modal="false"
  268. width="500px"
  269. :title="diTitle"
  270. >
  271. <el-form
  272. :model="payForm"
  273. :inline="true"
  274. label-width="120px"
  275. label-position="right"
  276. ref="payForm"
  277. >
  278. <el-form-item
  279. label="缴费开始日期"
  280. :rules="[
  281. { required: true, message: '请设置缴费开始日期', trigger: 'blur' },
  282. ]"
  283. prop="startPaymentDate"
  284. >
  285. <el-date-picker
  286. v-model.trim="payForm.startPaymentDate"
  287. @change="changeStartTime"
  288. type="date"
  289. :picker-options="pickerOptions"
  290. value-format="yyyy-MM-dd"
  291. placeholder="开始日期"
  292. ></el-date-picker>
  293. </el-form-item>
  294. <el-form-item
  295. label="缴费结束日期"
  296. :rules="[
  297. { required: true, message: '请设置缴费结束日期', trigger: 'blur' },
  298. ]"
  299. prop="deadlinePaymentDate"
  300. >
  301. <el-date-picker
  302. v-model.trim="payForm.deadlinePaymentDate"
  303. type="date"
  304. :picker-options="beginDate(payForm.startPaymentDate)"
  305. value-format="yyyy-MM-dd"
  306. placeholder="结束日期"
  307. ></el-date-picker>
  308. </el-form-item>
  309. <el-form-item
  310. label="缴费方式"
  311. prop="paymentPattern"
  312. :rules="[{ required: true, message: '请选择缴费方式' }]"
  313. >
  314. <el-select
  315. placeholder="缴费方式"
  316. style="width: 220px"
  317. clearable
  318. filterable
  319. @change="paymentPatternChange"
  320. v-model.trim="payForm.paymentPattern"
  321. >
  322. <el-option :value="0" label="按月"></el-option>
  323. <el-option :value="1" label="按季"></el-option>
  324. <el-option :value="2" label="一次性"></el-option>
  325. </el-select>
  326. </el-form-item>
  327. <el-form-item
  328. label="缴费有效期开始"
  329. :rules="[
  330. {
  331. required: true,
  332. message: '请设置缴费有效期开始日期',
  333. trigger: 'blur',
  334. },
  335. ]"
  336. prop="paymentValidStartDate"
  337. >
  338. <el-date-picker
  339. v-model.trim="payForm.paymentValidStartDate"
  340. type="date"
  341. @change="changePaymentStartTime"
  342. :picker-options="pickerOptions"
  343. value-format="yyyy-MM-dd"
  344. placeholder="有效期开始日期"
  345. ></el-date-picker>
  346. </el-form-item>
  347. <el-form-item
  348. label="缴费有效期结束"
  349. :rules="[
  350. {
  351. required: true,
  352. message: '请设置缴费有效期结束日期',
  353. trigger: 'blur',
  354. },
  355. ]"
  356. prop="paymentValidEndDate"
  357. >
  358. <el-date-picker
  359. v-model.trim="payForm.paymentValidEndDate"
  360. type="date"
  361. :picker-options="beginDate(payForm.paymentValidStartDate)"
  362. value-format="yyyy-MM-dd"
  363. placeholder="有效期结束日期"
  364. ></el-date-picker>
  365. </el-form-item>
  366. <el-form-item
  367. label="收费类型"
  368. v-if="isNew"
  369. :rules="[
  370. { required: true, message: '请选择收费类型', trigger: 'blur' },
  371. ]"
  372. prop="type"
  373. >
  374. <el-select
  375. v-model.trim="payForm.type"
  376. style="width: 220px !important"
  377. placeholder="课程类型"
  378. >
  379. <el-option label="线上" value="ONLINE"></el-option>
  380. <el-option label="线下" value="OFFLINE"></el-option>
  381. </el-select>
  382. </el-form-item>
  383. <el-form-item
  384. label="备注"
  385. v-if="isNew"
  386. :rules="[{ required: true, message: '请填写备注', trigger: 'blur' }]"
  387. prop="memo"
  388. >
  389. <el-input
  390. type="textarea"
  391. style="width: 220px !important"
  392. :rows="4"
  393. placeholder="请填写备注"
  394. v-model="payForm.memo"
  395. ></el-input>
  396. </el-form-item>
  397. </el-form>
  398. <div slot="footer" class="dialog-footer">
  399. <el-button @click="payVisible = false">取 消</el-button>
  400. <el-button type="primary" v-if="isNew" @click="newPayInfo"
  401. >确 定</el-button
  402. >
  403. <el-button type="primary" v-else @click="resetPayDate">确 定</el-button>
  404. </div>
  405. </el-dialog>
  406. <el-dialog
  407. title="查看"
  408. :visible.sync="reviewVisible"
  409. width="900px"
  410. destroy-on-close
  411. >
  412. <reviewDetail
  413. @close="reviewVisible = false"
  414. @submited="getList"
  415. :detail="viewDetail"
  416. :musicGroupId="$route.query.id"
  417. destroy-on-close
  418. />
  419. <div slot="footer" class="dialog-footer">
  420. <el-button type="primary" @click="reviewVisible = false"
  421. >关闭</el-button
  422. >
  423. </div>
  424. </el-dialog>
  425. <el-dialog :title="payFormTitle" :visible.sync="userVisible" width="830px">
  426. <userPayForm
  427. v-if="userVisible"
  428. @close="userVisible = false"
  429. @submited="payedSubmited"
  430. @changeActive="changeActive"
  431. :organizationCourseUnitPriceSettings="
  432. organizationCourseUnitPriceSettings
  433. "
  434. :rowDetail="activeRow"
  435. :type="payFormType"
  436. :baseInfo="baseInfo"
  437. :paymentType="paymentType"
  438. :musicGroupId="$route.query.id"
  439. @changePaymentType="changePaymentType"
  440. />
  441. </el-dialog>
  442. <!-- 会员缴费 -->
  443. <el-dialog
  444. :title="payFormTitle"
  445. :visible.sync="memberVisible"
  446. width="830px"
  447. >
  448. <memberPayForm
  449. v-if="memberVisible"
  450. @close="memberVisible = false"
  451. @submited="payedSubmited"
  452. @changeActive="changeActive"
  453. :organizationCourseUnitPriceSettings="
  454. organizationCourseUnitPriceSettings
  455. "
  456. :rowDetail="activeRow"
  457. :type="payFormType"
  458. :baseInfo="baseInfo"
  459. :paymentType="paymentType"
  460. :musicGroupId="$route.query.id"
  461. />
  462. </el-dialog>
  463. <el-dialog
  464. title="学员选择"
  465. :visible.sync="chioseStudentVisible"
  466. destroy-on-close
  467. append-to-body
  468. width="800px"
  469. >
  470. <setStudentFee
  471. @chioseStudent="chioseStudent"
  472. ref="setStudentFee"
  473. v-if="chioseStudentVisible"
  474. :batchNo="batchNo"
  475. :musicGroupPaymentCalenderId="musicGroupPaymentCalenderId"
  476. @submited="chioseStudentSubmited"
  477. :clearTale="clearStduent"
  478. ></setStudentFee>
  479. <div slot="footer" class="dialog-footer">
  480. <el-button @click="chioseStudentVisible = false">取 消</el-button>
  481. <el-button type="primary" @click="submitNewPay">确 定</el-button>
  482. </div>
  483. </el-dialog>
  484. <qr-code v-model="qrcodeStatus" title="续费二维码" :codeUrl="codeUrl" />
  485. <el-dialog
  486. title="报名声部预览"
  487. :visible.sync="dialogSubjectVisible"
  488. width="400px"
  489. class="subjectPreview"
  490. >
  491. <el-tabs v-model="activeName" type="card">
  492. <el-tab-pane
  493. :label="subject.subName"
  494. lazy
  495. v-for="(subject, index) in dialogSubjectList"
  496. :key="index"
  497. :name="subject.subjectId.toString()"
  498. style="max-height: 500px; overflow-y: auto"
  499. >
  500. <subject-preview
  501. :subjectId="subject.subjectId"
  502. :calenderId="dialogCalenderId"
  503. ></subject-preview>
  504. </el-tab-pane>
  505. </el-tabs>
  506. <!-- <div slot="footer">
  507. <el-button @click="dialogSubjectVisible = false">取 消</el-button>
  508. </div> -->
  509. </el-dialog>
  510. </div>
  511. </template>
  512. <script>
  513. import pagination from "@/components/Pagination/index";
  514. import dayjs from "dayjs";
  515. import QrCode from "@/components/QrCode/index";
  516. import { vaildStudentUrl } from "@/utils/validate";
  517. import { getTeamBaseInfo } from "@/api/buildTeam";
  518. import {
  519. resetMusicGroupPaymentCalender,
  520. delMusicGroupPaymentCalender,
  521. findMusicGroupSubjectInfo,
  522. } from "@/api/buildTeam";
  523. import { getAuditList } from "@/api/auditManager";
  524. import { getOrganizationCourseUnitPriceSettings } from "@/api/specialSetting";
  525. import {
  526. getMusicGroupStu,
  527. musicGroupPaymentCalenderDetailBatchAdd,
  528. musicGroupPaymentCalenderDelByBatchNo,
  529. revokeMusicGroupPaymentCalender,
  530. } from "../api";
  531. import setStudentFee from "./studentPayBase";
  532. import userPayForm from "../modals/user-pay-form";
  533. import memberPayForm from "../modals/member-pay-form";
  534. import payItems from "../modals/pay-items";
  535. import schoolPayForm from "../modals/school-pay-form";
  536. import review from "../modals/review";
  537. import reviewDetail from "../modals/review-detail";
  538. import subjectPreview from "@/views/resetTeaming/modals/subject-preview";
  539. import { userPaymentType } from "@/constant";
  540. import { objectToOptions } from "@/utils";
  541. import { payOrderTypeList } from "@/utils/searchArray";
  542. export default {
  543. props: ["isNewGropu"],
  544. components: {
  545. pagination,
  546. setStudentFee,
  547. userPayForm,
  548. memberPayForm,
  549. schoolPayForm,
  550. QrCode,
  551. review,
  552. reviewDetail,
  553. "pay-items": payItems,
  554. subjectPreview,
  555. },
  556. data() {
  557. return {
  558. paymentType: this.team_status == "PRE_BUILD_FEE" ? 0 : 1,
  559. musicGroupStu: [],
  560. payFormType: "user",
  561. userVisible: false,
  562. schoolVisible: false,
  563. itemsVisible: false,
  564. reviewVisible: false,
  565. organizationCourseUnitPriceSettings: [],
  566. searchForm: {
  567. paymentType: null,
  568. },
  569. viewDetail: null,
  570. tableList: [],
  571. rules: {
  572. // 分页规则
  573. limit: 10, // 限制显示条数
  574. page: 1, // 当前页
  575. total: 0, // 总条数
  576. page_size: [10, 20, 40, 50], // 选择限制显示条数
  577. },
  578. isInit: false,
  579. diTitle: "新增缴费",
  580. payVisible: false,
  581. payForm: {
  582. startPaymentDate: null,
  583. deadlinePaymentDate: null,
  584. paymentPattern: null,
  585. paymentValidStartDate: null,
  586. paymentValidEndDate: null,
  587. type: null,
  588. memo: null,
  589. },
  590. isNew: false,
  591. activeRow: null,
  592. pickerOptions: {
  593. firstDayOfWeek: 1,
  594. disabledDate(time) {
  595. return time.getTime() + 86400000 <= new Date().getTime();
  596. },
  597. },
  598. qrcodeStatus: false, // 生成二维码
  599. codeUrl: null,
  600. chioseStudentVisible: false,
  601. chioseStudentList: [],
  602. clearStduent: true,
  603. batchNo: "",
  604. musicGroupPaymentCalenderId: "",
  605. teamType: this.$route.query.type,
  606. payOrderTypeLists: payOrderTypeList,
  607. dialogSubjectVisible: false, // 预览声部
  608. dialogSubjectList: [],
  609. activeName: null,
  610. dialogCalenderId: null, // 选择编号
  611. baseInfo: null,
  612. memberVisible: false, // 会员缴费
  613. };
  614. },
  615. //生命周期 - 创建完成(可以访问当前this实例)
  616. created() {},
  617. //生命周期 - 挂载完成(可以访问DOM元素)
  618. async mounted() {
  619. this.paymentType = this.team_status == "PRE_BUILD_FEE" ? 0 : 1;
  620. // 获取分部
  621. try {
  622. const res = await getOrganizationCourseUnitPriceSettings({
  623. rows: 9999,
  624. });
  625. this.organizationCourseUnitPriceSettings = res.data.rows;
  626. // this.organizationCourseUnitPriceSettings=[];
  627. if (this.organizationCourseUnitPriceSettings.length <= 0) {
  628. this.$bus.$emit("showguide", ["teamCourseFee"]);
  629. return;
  630. }
  631. localStorage.setItem(
  632. "organizationCourseUnitPriceSettings",
  633. JSON.stringify(this.organizationCourseUnitPriceSettings)
  634. );
  635. } catch (error) {
  636. localStorage.removeItem("organizationCourseUnitPriceSettings");
  637. }
  638. this.init();
  639. },
  640. computed: {
  641. payOrderTypeList() {
  642. return objectToOptions(userPaymentType);
  643. },
  644. payFormTitle() {
  645. if (this.isNew) {
  646. return this.payFormType === "user" ? "新增学员缴费" : "新增学校缴费";
  647. } else {
  648. return this.payFormType === "user" ? "修改学员缴费" : "修改学校缴费";
  649. }
  650. },
  651. teamStatus() {
  652. // let type = this.$route.query.type;
  653. return (
  654. this.team_status == "PRE_BUILD_FEE" || this.team_status == "PROGRESS"
  655. );
  656. },
  657. team_status() {
  658. return this.$route.query.team_status;
  659. },
  660. },
  661. // activated () {
  662. // this.init();
  663. // },
  664. methods: {
  665. async init() {
  666. // this.team_status = this.$route.query.team_status;
  667. try {
  668. const res = await getMusicGroupStu({
  669. musicGroupId: this.$route.query.id,
  670. });
  671. } catch (error) {}
  672. this.getTeamInfo();
  673. this.getList();
  674. },
  675. getTeamInfo() {
  676. if (this.$route.query.id) {
  677. getTeamBaseInfo({ musicGroupId: this.$route.query.id }).then((res) => {
  678. if (res.code == 200) {
  679. this.baseInfo = res.data;
  680. this.$emit("getBaseInfo", this.baseInfo);
  681. localStorage.setItem("payMusicBase", JSON.stringify(this.baseInfo));
  682. } else {
  683. localStorage.removeItem("payMusicBase");
  684. }
  685. });
  686. }
  687. },
  688. changePaymentType(val) {
  689. this.paymentType = val;
  690. },
  691. newUserPay() {
  692. let query = this.$route.query;
  693. this.$router.push({
  694. path: "/business/studentPaySet",
  695. query: { ...query, payUserType: "STUDENT" },
  696. });
  697. // 判断一下乐团是课程缴费 还是会员缴费 且乐团状态为创建缴费中
  698. // if (
  699. // this.baseInfo?.musicGroup?.courseViewType == 2 &&
  700. // this.team_status == "PRE_BUILD_FEE"
  701. // ) {
  702. // this.payFormType = "user";
  703. // this.isNew = true;
  704. // this.activeRow = null;
  705. // this.memberVisible = true;
  706. // } else {
  707. // this.payFormType = "user";
  708. // this.isNew = true;
  709. // this.activeRow = null;
  710. // this.userVisible = true;
  711. // }
  712. },
  713. newSchoolPay() {
  714. this.payFormType = "school";
  715. this.isNew = true;
  716. this.activeRow = null;
  717. this.userVisible = true;
  718. },
  719. getList() {
  720. let musicGroupId = this.$route.query.id;
  721. return getAuditList({
  722. page: this.rules.page,
  723. rows: this.rules.limit,
  724. search: musicGroupId,
  725. payUserType: "STUDENT",
  726. paymentType: this.searchForm.paymentType,
  727. }).then((res) => {
  728. if (res.code == 200) {
  729. this.rules.total = res.data.total;
  730. this.tableList = res.data.rows;
  731. }
  732. });
  733. // 请求乐团状态
  734. },
  735. paymentPatternChange(val) {
  736. // if (val === 2) {
  737. // this.payForm.paymentValidEndDate = null
  738. // }
  739. },
  740. onCreateQRCode(row) {
  741. // 生成报名二维码
  742. this.qrcodeStatus = true;
  743. this.codeUrl =
  744. vaildStudentUrl() +
  745. "/#/musicGroupRenew?calenderId=" +
  746. row.id +
  747. "&id=" +
  748. this.$route.query.id;
  749. },
  750. chioseStudent(val) {
  751. this.chioseStudentList = val;
  752. },
  753. newPay() {
  754. this.diTitle = "新增缴费";
  755. this.isNew = true;
  756. this.payVisible = true;
  757. },
  758. resetPay(row) {
  759. this.diTitle = "修改缴费";
  760. if (
  761. row.paymentType == "MUSIC_APPLY" ||
  762. row.paymentType == "MUSIC_RENEW" ||
  763. row.paymentType == "ADD_COURSE"
  764. ) {
  765. this.payFormType = row.payUserType === "SCHOOL" ? "school" : "user";
  766. this.isNew = false;
  767. this.activeRow = row;
  768. let query = this.$route.query;
  769. this.$router.push({
  770. path: "/business/studentPaySet",
  771. query: { ...query, payUserType: "STUDENT", calenderId: row.id },
  772. });
  773. // 跳转新接口
  774. // this.memberVisible = true;
  775. } else {
  776. this.isNew = false;
  777. this.activeRow = row;
  778. this.payFormType = row.payUserType === "SCHOOL" ? "school" : "user";
  779. this.userVisible = true;
  780. }
  781. // 判断一下 是不是云收费团 且是乐团报名缴费
  782. },
  783. async revoke(row) {
  784. try {
  785. await this.$confirm("是否撤回此缴费项目的审批?", "提示", {
  786. confirmButtonText: "确定",
  787. cancelButtonText: "取消",
  788. type: "warning",
  789. });
  790. const res = await revokeMusicGroupPaymentCalender({
  791. batchNo: row.batchNo,
  792. });
  793. this.$message.success("取消审批成功");
  794. this.getList();
  795. this.getTeamInfo();
  796. } catch {}
  797. },
  798. changeActive(val) {
  799. if (this.$listeners.changeActive) {
  800. this.$listeners.changeActive(val);
  801. }
  802. },
  803. async chioseStudentSubmited() {
  804. try {
  805. await this.$confirm("缴费创建完成, 是否立即排课?", "提示", {
  806. confirmButtonText: "确定",
  807. cancelButtonText: "取消",
  808. type: "warning",
  809. });
  810. if (this.$listeners.changeActive) {
  811. this.$listeners.changeActive({
  812. name: "5",
  813. });
  814. }
  815. } catch (error) {}
  816. },
  817. detelePay(row) {
  818. let id = row.id;
  819. this.$confirm(`确定删除该缴费周期?`, "提示", {
  820. confirmButtonText: "确定",
  821. cancelButtonText: "取消",
  822. type: "warning",
  823. })
  824. .then(() => {
  825. delMusicGroupPaymentCalender({ id }).then((res) => {
  826. if (res.code == 200) {
  827. this.$message.success("删除成功");
  828. this.getList();
  829. }
  830. });
  831. })
  832. .catch(() => {});
  833. },
  834. lookList(row) {
  835. this.viewDetail = row;
  836. this.itemsVisible = true;
  837. },
  838. lookDetail(row) {
  839. let query = this.$route.query;
  840. this.$route.query.paymentId = row.id;
  841. this.viewDetail = row;
  842. if (row.payUserType === "SCHOOL") {
  843. this.reviewVisible = true;
  844. } else {
  845. this.$router.push({ path: "/business/strudentPayInfo", query });
  846. // this.$router.push({ path: "/teamPayInfo/strudentPayInfo", query });
  847. }
  848. },
  849. // setStudentPay () {
  850. // let query = this.$route.query;
  851. // this.$router.push({ path: "/business/studentPayBase", query });
  852. // },
  853. async removeBatchNo(row) {
  854. try {
  855. await this.$confirm("是否确认删除该缴费批次?", "提示", {
  856. type: "warning",
  857. });
  858. await musicGroupPaymentCalenderDelByBatchNo({ batchNo: row.batchNo });
  859. this.$message.success("删除成功");
  860. this.getList();
  861. } catch (error) {}
  862. },
  863. newPayInfo() {
  864. this.$refs["payForm"].validate((res) => {
  865. if (res) {
  866. /**
  867. * payForm: {
  868. startPaymentDate: null,
  869. deadlinePaymentDate: null,
  870. type: null,
  871. memo: null
  872. },
  873. *
  874. */
  875. this.chioseStudentVisible = true;
  876. return;
  877. }
  878. });
  879. },
  880. submitNewPay() {
  881. if (this.chioseStudentList.length < 1) {
  882. this.$message.error("请至少选择一名学员");
  883. return;
  884. }
  885. let obj = {};
  886. obj.userIdList = this.chioseStudentList.map((stu) => {
  887. return stu.userId;
  888. });
  889. obj.batchNo = this.batchNo;
  890. musicGroupPaymentCalenderDetailBatchAdd(obj).then((res) => {
  891. if (res.code == 200) {
  892. this.$message.success("添加成功");
  893. this.$refs.setStudentFee.clearTable();
  894. this.payVisible = false;
  895. this.chioseStudentVisible = false;
  896. // this.$refs.payItems?.getList()
  897. this.getList();
  898. }
  899. });
  900. },
  901. resetPayDate() {
  902. resetMusicGroupPaymentCalender({
  903. id: this.activeRow.id,
  904. startPaymentDate: this.payForm.startPaymentDate,
  905. deadlinePaymentDate: this.payForm.deadlinePaymentDate,
  906. paymentValidStartDate: this.payForm.paymentValidStartDate
  907. ? dayjs(this.payForm.paymentValidStartDate).format("YYYY-MM-DD")
  908. : this.payForm.paymentValidStartDate,
  909. paymentValidEndDate: this.payForm.paymentValidEndDate
  910. ? dayjs(this.payForm.paymentValidEndDate).format("YYYY-MM-DD")
  911. : this.payForm.paymentValidEndDate,
  912. paymentPattern: this.payForm.paymentPattern,
  913. }).then((res) => {
  914. if (res.code == 200) {
  915. this.$message.success("修改成功");
  916. this.payVisible = false;
  917. this.getTeamInfo();
  918. this.getList();
  919. }
  920. });
  921. },
  922. changeStartTime(val) {
  923. this.payForm.deadlinePaymentDate = this.dateAddDays(val, 3);
  924. },
  925. changePaymentStartTime(val) {
  926. this.payForm.paymentValidEndDate = null;
  927. },
  928. dateAddDays(dataStr, dayCount) {
  929. let strdate = dataStr; //日期字符串
  930. let isdate = new Date(strdate.replace(/-/g, "/")); //把日期字符串转换成日期格式
  931. isdate = new Date((isdate / 1000 + 86400 * dayCount) * 1000); //日期加1天
  932. let pdate =
  933. isdate.getFullYear() +
  934. "-" +
  935. (isdate.getMonth() + 1) +
  936. "-" +
  937. isdate.getDate(); //把日期格式转换成字符串
  938. return pdate;
  939. },
  940. beginDate(end) {
  941. return {
  942. firstDayOfWeek: 1,
  943. disabledDate(time) {
  944. if (end) {
  945. return new Date(end).getTime() - 86400000 >= time.getTime();
  946. } else {
  947. return time.getTime() + 86400000 < Date.now();
  948. //开始时间不选时,结束时间最大值小于等于当天
  949. }
  950. },
  951. };
  952. },
  953. search() {
  954. this.rules.page = 1;
  955. this.getList();
  956. },
  957. onReSet() {
  958. this.searchForm = { payUserType: null };
  959. },
  960. openChioseStudent(row) {
  961. this.chioseStudentVisible = true;
  962. this.batchNo = row.batchNo;
  963. this.musicGroupPaymentCalenderId = row.id;
  964. },
  965. async payedSubmited(data) {
  966. try {
  967. await this.getList();
  968. this.getTeamInfo();
  969. // if (!this.isNewGropu) {
  970. // this.chioseStudentVisible = true;
  971. // if (data) {
  972. // this.musicGroupPaymentCalenderId = data.musicGroupPaymentCalenderId;
  973. // }
  974. // }
  975. } catch (error) {}
  976. },
  977. async onPreview(row) {
  978. // 开始预览
  979. this.dialogCalenderId = row.id;
  980. const musicGroupId = this.$route.query.id;
  981. await findMusicGroupSubjectInfo({ musicGroupId: musicGroupId }).then(
  982. (res) => {
  983. if (res.code == 200) {
  984. this.dialogSubjectList = res.data.musicGroupSubjectPlans;
  985. // 默认预览第一个
  986. this.activeName = this.dialogSubjectList[0].subjectId.toString();
  987. this.dialogSubjectVisible = true;
  988. } else {
  989. this.$message.warning("没有可预览的声部");
  990. }
  991. }
  992. );
  993. },
  994. },
  995. watch: {
  996. chioseStudentVisible() {
  997. this.chioseStudentList = [];
  998. },
  999. payVisible(val) {
  1000. if (!val) {
  1001. this.payForm = {
  1002. startPaymentDate: null,
  1003. paymentPattern: null,
  1004. paymentValidStartDate: null,
  1005. paymentValidEndDate: null,
  1006. type: null,
  1007. memo: null,
  1008. deadlinePaymentDate: null,
  1009. };
  1010. this.$refs["payForm"].resetFields();
  1011. }
  1012. },
  1013. },
  1014. };
  1015. </script>
  1016. <style lang='scss' scoped>
  1017. .topWrap {
  1018. display: flex;
  1019. flex-direction: row;
  1020. justify-content: flex-start;
  1021. div {
  1022. margin-right: 10px;
  1023. }
  1024. }
  1025. .left-code,
  1026. .right-code {
  1027. // width: 50%;
  1028. // float: left;
  1029. h2 {
  1030. font-size: 18px;
  1031. text-align: center;
  1032. padding-bottom: 8px;
  1033. }
  1034. .qrcode {
  1035. display: flex;
  1036. flex-direction: column;
  1037. align-items: center;
  1038. img {
  1039. width: 200px;
  1040. height: 200px;
  1041. margin: 0 auto;
  1042. }
  1043. }
  1044. .code-url {
  1045. font-size: 18px;
  1046. text-align: center;
  1047. padding: 15px 15px 0 15px;
  1048. }
  1049. }
  1050. .previewContainer {
  1051. /deep/.el-dialog__body {
  1052. padding: 0;
  1053. }
  1054. }
  1055. .subjectPreview {
  1056. /deep/.el-dialog__body {
  1057. padding: 30px 0 0;
  1058. }
  1059. }
  1060. </style>