resetPayList.vue 27 KB

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