resetPayListSchool.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993
  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. v-if="reviewVisible"
  411. >
  412. <reviewDetail
  413. @close="reviewVisible = false"
  414. @submited="getList"
  415. :detail="viewDetail"
  416. :musicGroupId="$route.query.id"
  417. />
  418. <div slot="footer" class="dialog-footer">
  419. <el-button type="primary" @click="reviewVisible = false"
  420. >关闭</el-button
  421. >
  422. </div>
  423. </el-dialog>
  424. <el-dialog :title="payFormTitle" :visible.sync="userVisible" width="830px">
  425. <userPayForm
  426. v-if="userVisible"
  427. @close="userVisible = false"
  428. @submited="payedSubmited"
  429. @changeActive="changeActive"
  430. :organizationCourseUnitPriceSettings="
  431. organizationCourseUnitPriceSettings
  432. "
  433. :rowDetail="activeRow"
  434. :type="payFormType"
  435. :baseInfo="baseInfo"
  436. :paymentType="paymentType"
  437. :musicGroupId="$route.query.id"
  438. @changePaymentType="changePaymentType"
  439. />
  440. <!-- -->
  441. </el-dialog>
  442. <el-dialog
  443. title="学员选择"
  444. :visible.sync="chioseStudentVisible"
  445. v-if="chioseStudentVisible"
  446. append-to-body
  447. width="800px"
  448. >
  449. <setStudentFee
  450. @chioseStudent="chioseStudent"
  451. v-if="chioseStudentVisible"
  452. ref="setStudentFee"
  453. :batchNo="batchNo"
  454. :musicGroupPaymentCalenderId="musicGroupPaymentCalenderId"
  455. @submited="chioseStudentSubmited"
  456. :clearTale="clearStduent"
  457. ></setStudentFee>
  458. <div slot="footer" class="dialog-footer">
  459. <el-button @click="chioseStudentVisible = false">取 消</el-button>
  460. <el-button type="primary" @click="submitNewPay">确 定</el-button>
  461. </div>
  462. </el-dialog>
  463. <qr-code v-model="qrcodeStatus" title="续费二维码" :codeUrl="codeUrl" />
  464. <el-dialog title="确认收款" :visible.sync="getMoneyVisible" width="600px">
  465. <isGetMoney @close="closeMoney" :data="activeRow" ref="getMoney" />
  466. <div slot="footer" class="dialog-footer">
  467. <el-button @click="getMoneyVisible = false">取 消</el-button>
  468. <el-button type="primary" @click="submitGetMoney">确 定</el-button>
  469. </div>
  470. </el-dialog>
  471. </div>
  472. </template>
  473. <script>
  474. import pagination from "@/components/Pagination/index";
  475. import dayjs from "dayjs";
  476. import QrCode from "@/components/QrCode/index";
  477. import { vaildStudentUrl } from "@/utils/validate";
  478. import {
  479. resetMusicGroupPaymentCalender,
  480. delMusicGroupPaymentCalender,
  481. } from "@/api/buildTeam";
  482. import { getOrganizationCourseUnitPriceSettings } from "@/api/specialSetting";
  483. import { getAuditList } from "@/api/auditManager";
  484. import {
  485. getMusicGroupStu,
  486. musicGroupPaymentCalenderDetailBatchAdd,
  487. musicGroupPaymentCalenderDelByBatchNo,
  488. revokeMusicGroupPaymentCalender,
  489. } from "../api";
  490. import setStudentFee from "./studentPayBase";
  491. import userPayForm from "../modals/user-pay-form";
  492. import payItems from "../modals/pay-items";
  493. import schoolPayForm from "../modals/school-pay-form";
  494. import schoolPayUserList from "../modals/school-pay-user-list";
  495. import isGetMoney from "../modals/isGetMoney";
  496. import review from "../modals/review";
  497. import reviewDetail from "../modals/review-detail";
  498. import { userPaymentType } from "@/constant";
  499. import { objectToOptions } from "@/utils";
  500. import { payOrderTypeList } from "@/utils/searchArray";
  501. import { getTeamBaseInfo } from "@/api/buildTeam";
  502. export default {
  503. props: ["isNewGropu"],
  504. components: {
  505. pagination,
  506. setStudentFee,
  507. userPayForm,
  508. schoolPayForm,
  509. QrCode,
  510. review,
  511. reviewDetail,
  512. teamType: "",
  513. "pay-items": payItems,
  514. schoolPayUserList,
  515. isGetMoney,
  516. },
  517. data() {
  518. return {
  519. musicGroupStu: [],
  520. payFormType: "user",
  521. userVisible: false,
  522. schoolVisible: false,
  523. reviewVisible: false,
  524. userListVisible: false,
  525. itemsVisible: false,
  526. teamType: this.$route.query.type,
  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. payOrderTypeLists: payOrderTypeList,
  568. getMoneyVisible: false,
  569. baseInfo: null,
  570. paymentType: "",
  571. };
  572. },
  573. //生命周期 - 创建完成(可以访问当前this实例)
  574. created() {},
  575. //生命周期 - 挂载完成(可以访问DOM元素)
  576. async mounted() {
  577. this.paymentType = this.team_status == "DRAFT" ? 0 : 1;
  578. // 获取分部
  579. try {
  580. const res = await getOrganizationCourseUnitPriceSettings({
  581. rows: 9999,
  582. });
  583. this.organizationCourseUnitPriceSettings = res.data.rows;
  584. if (this.organizationCourseUnitPriceSettings.length <= 0) {
  585. this.$bus.$emit("showguide", ["teamCourseFee"]);
  586. return;
  587. }
  588. } catch (error) {}
  589. this.init();
  590. },
  591. computed: {
  592. payOrderTypeList() {
  593. return objectToOptions(userPaymentType);
  594. },
  595. payFormTitle() {
  596. if (this.isNew) {
  597. return this.payFormType === "user" ? "新增学员缴费" : "新增学校缴费";
  598. } else {
  599. return this.payFormType === "user" ? "修改学员缴费" : "修改学校缴费";
  600. }
  601. },
  602. teamStatus() {
  603. // let type = this.$route.query.type;
  604. let team_status = this.team_status;
  605. return team_status == "DRAFT" || team_status == "PROGRESS";
  606. },
  607. team_status() {
  608. return this.$route.query.team_status;
  609. },
  610. },
  611. // activated () {
  612. // this.init();
  613. // },
  614. methods: {
  615. async init() {
  616. try {
  617. const res = await getMusicGroupStu({
  618. musicGroupId: this.$route.query.id,
  619. });
  620. } catch (error) {}
  621. this.getTeamInfo();
  622. this.getList();
  623. },
  624. getTeamInfo() {
  625. if (this.$route.query.id) {
  626. getTeamBaseInfo({ musicGroupId: this.$route.query.id }).then((res) => {
  627. if (res.code == 200) {
  628. this.baseInfo = res.data;
  629. this.$emit("getBaseInfo", this.baseInfo);
  630. }
  631. });
  632. }
  633. },
  634. newUserPay() {
  635. this.payFormType = "user";
  636. this.isNew = true;
  637. this.activeRow = null;
  638. this.userVisible = true;
  639. },
  640. changePaymentType(val) {
  641. this.paymentType = val;
  642. },
  643. newSchoolPay() {
  644. if (
  645. this.baseInfo?.musicGroup?.courseViewType == 2 &&
  646. this.team_status == "DRAFT"
  647. ) {
  648. this.$message.error("会员缴费乐团无法创建学校缴费");
  649. return;
  650. } else {
  651. let query = this.$route.query;
  652. this.$router.push({
  653. path: "/business/studentPaySet",
  654. query: { ...query, payUserType: "SCHOOL" },
  655. },(route) => {
  656. route.meta.title = '学校缴费设置'
  657. });
  658. }
  659. },
  660. getList() {
  661. let musicGroupId = this.$route.query.id;
  662. return getAuditList({
  663. page: this.rules.page,
  664. rows: this.rules.limit,
  665. musicGroupId: musicGroupId,
  666. payUserType: "SCHOOL",
  667. paymentType: this.searchForm.paymentType,
  668. }).then((res) => {
  669. if (res.code == 200) {
  670. this.rules.total = res.data.total;
  671. this.tableList = res.data.rows;
  672. }
  673. });
  674. },
  675. paymentPatternChange(val) {
  676. if (val === 2) {
  677. this.payForm.paymentValidEndDate = null;
  678. }
  679. },
  680. onCreateQRCode(row) {
  681. // 生成报名二维码
  682. this.qrcodeStatus = true;
  683. this.codeUrl =
  684. vaildStudentUrl() + "/#/musicGroupRenew?calenderId=" + row.id;
  685. },
  686. chioseStudent(val) {
  687. this.chioseStudentList = val;
  688. },
  689. newPay() {
  690. this.diTitle = "新增缴费";
  691. this.isNew = true;
  692. this.payVisible = true;
  693. },
  694. resetPay(row) {
  695. if (
  696. row.paymentType == "MUSIC_APPLY" ||
  697. row.paymentType == "MUSIC_RENEW" ||
  698. row.paymentType == "ADD_COURSE"
  699. ) {
  700. this.payFormType = row.payUserType === "SCHOOL" ? "school" : "user";
  701. this.isNew = false;
  702. this.activeRow = row;
  703. let query = this.$route.query;
  704. this.$router.push({
  705. path: "/business/studentPaySet",
  706. query: { ...query, payUserType: "SCHOOL", calenderId: row.id },
  707. },(route) => {
  708. route.meta.title = '学校缴费设置'
  709. });
  710. // 跳转新接口
  711. // this.memberVisible = true;
  712. } else {
  713. this.isNew = false;
  714. this.activeRow = row;
  715. this.payFormType = row.payUserType === "SCHOOL" ? "school" : "user";
  716. this.userVisible = true;
  717. }
  718. },
  719. changeActive(val) {
  720. if (this.$listeners.changeActive) {
  721. this.$listeners.changeActive(val);
  722. }
  723. },
  724. async chioseStudentSubmited() {
  725. try {
  726. await this.$confirm("缴费创建完成, 是否立即排课?", "提示", {
  727. confirmButtonText: "确定",
  728. cancelButtonText: "取消",
  729. type: "warning",
  730. });
  731. if (this.$listeners.changeActive) {
  732. this.$listeners.changeActive({
  733. name: "5",
  734. });
  735. }
  736. } catch (error) {}
  737. },
  738. detelePay(row) {
  739. let id = row.id;
  740. this.$confirm(`确定删除该缴费周期?`, "提示", {
  741. confirmButtonText: "确定",
  742. cancelButtonText: "取消",
  743. type: "warning",
  744. })
  745. .then(() => {
  746. delMusicGroupPaymentCalender({ id }).then((res) => {
  747. if (res.code == 200) {
  748. this.$message.success("删除成功");
  749. this.getList();
  750. }
  751. });
  752. })
  753. .catch(() => {});
  754. },
  755. lookList(row) {
  756. this.viewDetail = row;
  757. this.itemsVisible = true;
  758. },
  759. lookUserList(row) {
  760. console.log({ ...row });
  761. this.viewDetail = { ...row };
  762. this.userListVisible = true;
  763. },
  764. lookDetail(row) {
  765. let query = this.$route.query;
  766. this.$route.query.paymentId = row.id;
  767. this.viewDetail = row;
  768. if (row.payUserType === "SCHOOL") {
  769. this.reviewVisible = true;
  770. } else {
  771. this.$router.push({ path: "/business/strudentPayInfo", query });
  772. }
  773. },
  774. setStudentPay() {
  775. let query = this.$route.query;
  776. this.$router.push({ path: "/business/studentPayBase", query });
  777. },
  778. async removeBatchNo(row) {
  779. try {
  780. await this.$confirm("是否确认删除该缴费批次?", "提示", {
  781. type: "warning",
  782. });
  783. await musicGroupPaymentCalenderDelByBatchNo({ batchNo: row.batchNo });
  784. this.$message.success("删除成功");
  785. this.getList();
  786. } catch (error) {}
  787. },
  788. newPayInfo() {
  789. this.$refs["payForm"].validate((res) => {
  790. if (res) {
  791. /**
  792. * payForm: {
  793. startPaymentDate: null,
  794. deadlinePaymentDate: null,
  795. type: null,
  796. memo: null
  797. },
  798. *
  799. */
  800. this.chioseStudentVisible = true;
  801. return;
  802. }
  803. });
  804. },
  805. submitNewPay() {
  806. if (this.chioseStudentList.length < 1) {
  807. this.$message.error("请至少选择一名学员");
  808. return;
  809. }
  810. let obj = {};
  811. obj.userIdList = this.chioseStudentList.map((stu) => {
  812. return stu.userId;
  813. });
  814. obj.batchNo = this.batchNo;
  815. musicGroupPaymentCalenderDetailBatchAdd(obj).then((res) => {
  816. if (res.code == 200) {
  817. this.$message.success("添加成功");
  818. this.$refs.setStudentFee.clearTable();
  819. this.payVisible = false;
  820. this.chioseStudentVisible = false;
  821. this.getList();
  822. // this.$refs.payItems?.getList()
  823. }
  824. });
  825. },
  826. resetPayDate() {
  827. resetMusicGroupPaymentCalender({
  828. id: this.activeRow.id,
  829. startPaymentDate: this.payForm.startPaymentDate,
  830. deadlinePaymentDate: this.payForm.deadlinePaymentDate,
  831. paymentValidStartDate: this.payForm.paymentValidStartDate
  832. ? dayjs(this.payForm.paymentValidStartDate).format("YYYY-MM-DD")
  833. : this.payForm.paymentValidStartDate,
  834. paymentValidEndDate: this.payForm.paymentValidEndDate
  835. ? dayjs(this.payForm.paymentValidEndDate).format("YYYY-MM-DD")
  836. : this.payForm.paymentValidEndDate,
  837. paymentPattern: this.payForm.paymentPattern,
  838. }).then((res) => {
  839. if (res.code == 200) {
  840. this.$message.success("修改成功");
  841. this.payVisible = false;
  842. this.getTeamInfo();
  843. this.getList();
  844. }
  845. });
  846. },
  847. changeStartTime(val) {
  848. this.payForm.deadlinePaymentDate = this.dateAddDays(val, 3);
  849. },
  850. changePaymentStartTime(val) {
  851. this.payForm.paymentValidEndDate = null;
  852. },
  853. dateAddDays(dataStr, dayCount) {
  854. let strdate = dataStr; //日期字符串
  855. let isdate = new Date(strdate.replace(/-/g, "/")); //把日期字符串转换成日期格式
  856. isdate = new Date((isdate / 1000 + 86400 * dayCount) * 1000); //日期加1天
  857. let pdate =
  858. isdate.getFullYear() +
  859. "-" +
  860. (isdate.getMonth() + 1) +
  861. "-" +
  862. isdate.getDate(); //把日期格式转换成字符串
  863. return pdate;
  864. },
  865. beginDate(end) {
  866. return {
  867. firstDayOfWeek: 1,
  868. disabledDate(time) {
  869. if (end) {
  870. return new Date(end).getTime() - 86400000 >= time.getTime();
  871. } else {
  872. return time.getTime() + 86400000 < Date.now();
  873. //开始时间不选时,结束时间最大值小于等于当天
  874. }
  875. },
  876. };
  877. },
  878. search() {
  879. this.rules.page = 1;
  880. this.getList();
  881. },
  882. onReSet() {
  883. this.searchForm = { payUserType: null };
  884. },
  885. openChioseStudent(row) {
  886. this.chioseStudentVisible = true;
  887. this.batchNo = row.batchNo;
  888. this.musicGroupPaymentCalenderId = row.id;
  889. },
  890. async payedSubmited(data) {
  891. try {
  892. await this.getList();
  893. this.getTeamInfo();
  894. // if (!this.isNewGropu) {
  895. // this.chioseStudentVisible = true;
  896. // if (data) {
  897. // this.musicGroupPaymentCalenderId = data.musicGroupPaymentCalenderId;
  898. // }
  899. // }
  900. } catch (error) {}
  901. },
  902. commmitGetMoney(row) {
  903. this.activeRow = row;
  904. this.getMoneyVisible = true;
  905. },
  906. submitGetMoney() {
  907. this.$refs.getMoney.submitGetMoney();
  908. },
  909. closeMoney() {
  910. this.getMoneyVisible = false;
  911. this.getList();
  912. },
  913. async revoke(row) {
  914. try {
  915. await this.$confirm("是否撤回此缴费项目的审批?", "提示", {
  916. confirmButtonText: "确定",
  917. cancelButtonText: "取消",
  918. type: "warning",
  919. });
  920. const res = await revokeMusicGroupPaymentCalender({
  921. batchNo: row.batchNo,
  922. });
  923. this.$message.success("取消审批成功");
  924. this.getList();
  925. this.getTeamInfo();
  926. } catch {}
  927. },
  928. },
  929. watch: {
  930. chioseStudentVisible() {
  931. this.chioseStudentList = [];
  932. },
  933. payVisible(val) {
  934. if (!val) {
  935. this.payForm = {
  936. startPaymentDate: null,
  937. paymentPattern: null,
  938. paymentValidStartDate: null,
  939. paymentValidEndDate: null,
  940. type: null,
  941. memo: null,
  942. deadlinePaymentDate: null,
  943. };
  944. this.$refs["payForm"].resetFields();
  945. }
  946. },
  947. },
  948. };
  949. </script>
  950. <style lang='scss' scoped>
  951. .topWrap {
  952. display: flex;
  953. flex-direction: row;
  954. justify-content: flex-start;
  955. div {
  956. margin-right: 10px;
  957. }
  958. }
  959. .left-code,
  960. .right-code {
  961. // width: 50%;
  962. // float: left;
  963. h2 {
  964. font-size: 18px;
  965. text-align: center;
  966. padding-bottom: 8px;
  967. }
  968. .qrcode {
  969. display: flex;
  970. flex-direction: column;
  971. align-items: center;
  972. img {
  973. width: 200px;
  974. height: 200px;
  975. margin: 0 auto;
  976. }
  977. }
  978. .code-url {
  979. font-size: 18px;
  980. text-align: center;
  981. padding: 15px 15px 0 15px;
  982. }
  983. }
  984. </style>