resetPayList.vue 24 KB

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