resetPayList.vue 30 KB

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