resetPayList.vue 27 KB

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