resetPayList.vue 27 KB

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