resetPayList.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  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.paymentType === 'SPAN_GROUP_CLASS_ADJUST' ? scope.row.courseOriginalPrice : 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 == '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-tabs v-model="activeName" type="card">
  348. <el-tab-pane :label="subject.subName" lazy v-for="(subject, index) in dialogSubjectList" :key="index" :name="subject.subjectId.toString()">
  349. <subject-preview :subjectId="subject.subjectId"
  350. :calenderId="dialogCalenderId"></subject-preview>
  351. </el-tab-pane>
  352. </el-tabs>
  353. <div slot="footer">
  354. <el-button @click="dialogSubjectVisible = false">取 消</el-button>
  355. </div>
  356. </el-dialog>
  357. </div>
  358. </template>
  359. <script>
  360. import axios from "axios";
  361. import { getToken } from "@/utils/auth";
  362. import pagination from "@/components/Pagination/index";
  363. import load from "@/utils/loading";
  364. import qs from "qs";
  365. import dayjs from 'dayjs'
  366. import QrCode from "@/components/QrCode/index";
  367. import { vaildStudentUrl } from '@/utils/validate'
  368. import { addMusicGroupPaymentCalender, getMusicGroupPaymentCalender, resetMusicGroupPaymentCalender, delMusicGroupPaymentCalender, findMusicGroupSubjectInfo } from "@/api/buildTeam";
  369. import { getAuditList } from '@/api/auditManager'
  370. import {
  371. getOrganizationCourseUnitPriceSettings
  372. } from '@/api/specialSetting'
  373. import { musicGroupPaymentCalenderQueryPage, getMusicGroupStu, musicGroupPaymentCalenderDetailBatchAdd, musicGroupPaymentCalenderDelByBatchNo } from '../api'
  374. import setStudentFee from './studentPayBase'
  375. import userPayForm from '../modals/user-pay-form'
  376. import payItems from '../modals/pay-items'
  377. import schoolPayForm from '../modals/school-pay-form'
  378. import review from '../modals/review'
  379. import reviewDetail from '../modals/review-detail'
  380. import subjectPreview from '@/views/resetTeaming/modals/subject-preview'
  381. import { userPaymentType } from '@/constant'
  382. import { objectToOptions } from '@/utils'
  383. import { payOrderTypeList } from "@/utils/searchArray";
  384. export default {
  385. props: ["baseInfo", "isNewGropu"],
  386. components: {
  387. pagination,
  388. setStudentFee,
  389. userPayForm,
  390. schoolPayForm,
  391. QrCode,
  392. review,
  393. reviewDetail,
  394. 'pay-items': payItems,
  395. subjectPreview
  396. },
  397. data () {
  398. return {
  399. musicGroupStu: [],
  400. payFormType: "user",
  401. userVisible: false,
  402. schoolVisible: false,
  403. itemsVisible: false,
  404. reviewVisible: false,
  405. organizationCourseUnitPriceSettings: [],
  406. searchForm: {
  407. paymentType: null,
  408. },
  409. viewDetail: null,
  410. tableList: [],
  411. rules: {
  412. // 分页规则
  413. limit: 10, // 限制显示条数
  414. page: 1, // 当前页
  415. total: 0, // 总条数
  416. page_size: [10, 20, 40, 50], // 选择限制显示条数
  417. },
  418. isInit: false,
  419. diTitle: "新增缴费",
  420. payVisible: false,
  421. payForm: {
  422. startPaymentDate: null,
  423. deadlinePaymentDate: null,
  424. paymentPattern: null,
  425. paymentValidStartDate: null,
  426. paymentValidEndDate: null,
  427. type: null,
  428. memo: null,
  429. },
  430. isNew: false,
  431. activeRow: null,
  432. pickerOptions: {
  433. firstDayOfWeek: 1,
  434. disabledDate (time) {
  435. return time.getTime() + 86400000 <= new Date().getTime();
  436. },
  437. },
  438. qrcodeStatus: false, // 生成二维码
  439. codeUrl: null,
  440. chioseStudentVisible: false,
  441. chioseStudentList: [],
  442. clearStduent: true,
  443. batchNo: "",
  444. musicGroupPaymentCalenderId: "",
  445. teamType: this.$route.query.type,
  446. payOrderTypeLists: payOrderTypeList,
  447. dialogSubjectVisible: false, // 预览声部
  448. dialogSubjectList: [],
  449. activeName: null,
  450. dialogCalenderId: null, // 选择编号
  451. };
  452. },
  453. //生命周期 - 创建完成(可以访问当前this实例)
  454. created () { },
  455. //生命周期 - 挂载完成(可以访问DOM元素)
  456. async mounted () {
  457. // 获取分部
  458. try {
  459. const res = await getOrganizationCourseUnitPriceSettings({
  460. rows: 9999
  461. })
  462. this.organizationCourseUnitPriceSettings = res.data.rows
  463. } catch (error) { }
  464. this.init();
  465. },
  466. computed: {
  467. payOrderTypeList () {
  468. return objectToOptions(userPaymentType);
  469. },
  470. payFormTitle () {
  471. if (this.isNew) {
  472. return this.payFormType === "user" ? "新增学员缴费" : "新增学校缴费";
  473. } else {
  474. return this.payFormType === "user" ? "修改学员缴费" : "修改学校缴费";
  475. }
  476. },
  477. teamStatus () {
  478. let type = this.$route.query.type;
  479. let team_status = this.$route.query.team_status
  480. return type == 'teamDraft' || type == 'resetTeam' || type == 'PRE_BUILD_FEE' || team_status == 'PRE_BUILD_FEE'
  481. }
  482. },
  483. // activated () {
  484. // this.init();
  485. // },
  486. methods: {
  487. async init () {
  488. try {
  489. const res = await getMusicGroupStu({
  490. musicGroupId: this.$route.query.id,
  491. });
  492. } catch (error) { }
  493. this.getList();
  494. },
  495. newUserPay () {
  496. this.payFormType = "user";
  497. this.isNew = true;
  498. this.activeRow = null
  499. this.userVisible = true;
  500. },
  501. newSchoolPay () {
  502. this.payFormType = "school";
  503. this.isNew = true;
  504. this.activeRow = null
  505. this.userVisible = true;
  506. },
  507. getList () {
  508. let musicGroupId = this.$route.query.id
  509. return getAuditList({
  510. page: this.rules.page,
  511. rows: this.rules.limit,
  512. search: musicGroupId,
  513. payUserType: 'STUDENT',
  514. paymentType: this.searchForm.paymentType,
  515. }).then(res => {
  516. if (res.code == 200) {
  517. this.rules.total = res.data.total;
  518. this.tableList = res.data.rows;
  519. }
  520. });
  521. },
  522. paymentPatternChange (val) {
  523. // if (val === 2) {
  524. // this.payForm.paymentValidEndDate = null
  525. // }
  526. },
  527. onCreateQRCode (row) { // 生成报名二维码
  528. this.qrcodeStatus = true
  529. this.codeUrl = vaildStudentUrl() + '/#/musicGroupRenew?calenderId=' + row.id + '&id=' + this.$route.query.id
  530. },
  531. chioseStudent (val) {
  532. this.chioseStudentList = val;
  533. },
  534. newPay () {
  535. this.diTitle = "新增缴费";
  536. this.isNew = true;
  537. this.payVisible = true;
  538. },
  539. resetPay (row) {
  540. this.diTitle = "修改缴费";
  541. this.isNew = false;
  542. this.activeRow = row;
  543. this.payFormType = row.payUserType === 'SCHOOL' ? 'school' : 'user'
  544. this.userVisible = true;
  545. },
  546. changeActive(val) {
  547. if (this.$listeners.changeActive) {
  548. this.$listeners.changeActive(val)
  549. }
  550. },
  551. async chioseStudentSubmited () {
  552. try {
  553. await this.$confirm('缴费创建完成, 是否立即排课?', '提示', {
  554. confirmButtonText: '确定',
  555. cancelButtonText: '取消',
  556. type: 'warning'
  557. })
  558. if (this.$listeners.changeActive) {
  559. this.$listeners.changeActive({
  560. name: '5'
  561. })
  562. }
  563. } catch (error) { }
  564. },
  565. detelePay (row) {
  566. let id = row.id;
  567. this.$confirm(`确定删除该缴费周期?`, "提示", {
  568. confirmButtonText: "确定",
  569. cancelButtonText: "取消",
  570. type: "warning",
  571. })
  572. .then(() => {
  573. delMusicGroupPaymentCalender({ id }).then((res) => {
  574. if (res.code == 200) {
  575. this.$message.success("删除成功");
  576. this.getList();
  577. }
  578. });
  579. })
  580. .catch(() => { });
  581. },
  582. lookList(row) {
  583. this.viewDetail = row
  584. this.itemsVisible = true
  585. },
  586. lookDetail (row) {
  587. let query = this.$route.query;
  588. this.$route.query.paymentId = row.id;
  589. this.viewDetail = row;
  590. if (row.payUserType === "SCHOOL") {
  591. this.reviewVisible = true;
  592. } else {
  593. this.$router.push({ path: "/business/strudentPayInfo", query });
  594. }
  595. },
  596. setStudentPay () {
  597. let query = this.$route.query;
  598. this.$router.push({ path: "/business/studentPayBase", query });
  599. },
  600. async removeBatchNo (row) {
  601. try {
  602. await this.$confirm('是否确认删除该缴费批次?', '提示', {
  603. type: 'warning',
  604. })
  605. await musicGroupPaymentCalenderDelByBatchNo({batchNo: row.batchNo})
  606. this.$message.success('删除成功')
  607. this.getList()
  608. } catch (error) {}
  609. },
  610. newPayInfo () {
  611. this.$refs["payForm"].validate((res) => {
  612. if (res) {
  613. /**
  614. * payForm: {
  615. startPaymentDate: null,
  616. deadlinePaymentDate: null,
  617. type: null,
  618. memo: null
  619. },
  620. *
  621. */
  622. this.chioseStudentVisible = true;
  623. return;
  624. }
  625. });
  626. },
  627. submitNewPay () {
  628. if (this.chioseStudentList.length < 1) {
  629. this.$message.error("请至少选择一名学员");
  630. return;
  631. }
  632. let obj = {};
  633. obj.userIdList = this.chioseStudentList.map((stu) => {
  634. return stu.userId;
  635. });
  636. obj.batchNo = this.batchNo;
  637. musicGroupPaymentCalenderDetailBatchAdd(obj).then((res) => {
  638. if (res.code == 200) {
  639. this.$message.success("添加成功");
  640. this.$refs.setStudentFee.clearTable();
  641. this.payVisible = false;
  642. this.chioseStudentVisible = false;
  643. // this.$refs.payItems?.getList()
  644. this.getList();
  645. }
  646. });
  647. },
  648. resetPayDate () {
  649. resetMusicGroupPaymentCalender({
  650. id: this.activeRow.id,
  651. startPaymentDate: this.payForm.startPaymentDate,
  652. deadlinePaymentDate: this.payForm.deadlinePaymentDate,
  653. paymentValidStartDate: this.payForm.paymentValidStartDate
  654. ? dayjs(this.payForm.paymentValidStartDate).format("YYYY-MM-DD")
  655. : this.payForm.paymentValidStartDate,
  656. paymentValidEndDate: this.payForm.paymentValidEndDate
  657. ? dayjs(this.payForm.paymentValidEndDate).format("YYYY-MM-DD")
  658. : this.payForm.paymentValidEndDate,
  659. paymentPattern: this.payForm.paymentPattern,
  660. }).then((res) => {
  661. if (res.code == 200) {
  662. this.$message.success("修改成功");
  663. this.payVisible = false;
  664. this.getList();
  665. }
  666. });
  667. },
  668. changeStartTime (val) {
  669. this.payForm.deadlinePaymentDate = this.dateAddDays(val, 3);
  670. },
  671. changePaymentStartTime (val) {
  672. this.payForm.paymentValidEndDate = null;
  673. },
  674. dateAddDays (dataStr, dayCount) {
  675. let strdate = dataStr; //日期字符串
  676. let isdate = new Date(strdate.replace(/-/g, "/")); //把日期字符串转换成日期格式
  677. isdate = new Date((isdate / 1000 + 86400 * dayCount) * 1000); //日期加1天
  678. let pdate =
  679. isdate.getFullYear() +
  680. "-" +
  681. (isdate.getMonth() + 1) +
  682. "-" +
  683. isdate.getDate(); //把日期格式转换成字符串
  684. return pdate;
  685. },
  686. beginDate (end) {
  687. return {
  688. firstDayOfWeek: 1,
  689. disabledDate (time) {
  690. if (end) {
  691. return new Date(end).getTime() - 86400000 >= time.getTime();
  692. } else {
  693. return time.getTime() + 86400000 < Date.now();
  694. //开始时间不选时,结束时间最大值小于等于当天
  695. }
  696. },
  697. };
  698. },
  699. search () {
  700. this.rules.page = 1;
  701. this.getList();
  702. },
  703. onReSet () {
  704. this.searchForm = { payUserType: null };
  705. },
  706. openChioseStudent (row) {
  707. this.chioseStudentVisible = true;
  708. this.batchNo = row.batchNo;
  709. this.musicGroupPaymentCalenderId = row.id
  710. },
  711. async payedSubmited (data) {
  712. try {
  713. await this.getList();
  714. // if (!this.isNewGropu) {
  715. // this.chioseStudentVisible = true;
  716. // if (data) {
  717. // this.musicGroupPaymentCalenderId = data.musicGroupPaymentCalenderId;
  718. // }
  719. // }
  720. } catch (error) { }
  721. },
  722. async onPreview (row) { // 开始预览
  723. this.dialogCalenderId = row.id
  724. const musicGroupId = this.$route.query.id
  725. await findMusicGroupSubjectInfo({ musicGroupId: musicGroupId }).then(res => {
  726. if (res.code == 200) {
  727. this.dialogSubjectList = res.data.musicGroupSubjectPlans
  728. // 默认预览第一个
  729. this.activeName = this.dialogSubjectList[0].subjectId.toString()
  730. this.dialogSubjectVisible = true
  731. } else {
  732. this.$message.warning('没有可预览的声部')
  733. }
  734. })
  735. }
  736. },
  737. watch: {
  738. chioseStudentVisible () {
  739. this.chioseStudentList = [];
  740. },
  741. payVisible (val) {
  742. if (!val) {
  743. this.payForm = {
  744. startPaymentDate: null,
  745. paymentPattern: null,
  746. paymentValidStartDate: null,
  747. paymentValidEndDate: null,
  748. type: null,
  749. memo: null,
  750. deadlinePaymentDate: null,
  751. };
  752. this.$refs["payForm"].resetFields();
  753. }
  754. },
  755. },
  756. };
  757. </script>
  758. <style lang='scss' scoped>
  759. .topWrap {
  760. display: flex;
  761. flex-direction: row;
  762. justify-content: flex-start;
  763. div {
  764. margin-right: 10px;
  765. }
  766. }
  767. .left-code,
  768. .right-code {
  769. // width: 50%;
  770. // float: left;
  771. h2 {
  772. font-size: 18px;
  773. text-align: center;
  774. padding-bottom: 8px;
  775. }
  776. .qrcode {
  777. display: flex;
  778. flex-direction: column;
  779. align-items: center;
  780. img {
  781. width: 200px;
  782. height: 200px;
  783. margin: 0 auto;
  784. }
  785. }
  786. .code-url {
  787. font-size: 18px;
  788. text-align: center;
  789. padding: 15px 15px 0 15px;
  790. }
  791. }
  792. .previewContainer {
  793. /deep/.el-dialog__body {
  794. padding: 0;
  795. }
  796. }
  797. </style>