resetPayListSchool.vue 27 KB

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