resetPayListSchool.vue 27 KB

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