resetPayListSchool.vue 30 KB

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