resetPayList.vue 28 KB

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