resetPayList.vue 29 KB

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