resetPayListSchool.vue 26 KB

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