resetPayList.vue 30 KB

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