resetPayList.vue 26 KB

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