resetPayListSchool.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940
  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/4359'"
  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/3881'"
  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/4360'"
  159. >添加学员</el-button
  160. >
  161. <auth auths="musicGroupPaymentCalender/revoke">
  162. <el-button
  163. type="text"
  164. v-if="
  165. (team_status == 'FEE_AUDIT' || team_status == 'PROGRESS') &&
  166. scope.row.auditStatus === 'AUDITING' &&
  167. scope.row.paymentType != 'ADD_STUDENT' &&
  168. scope.row.paymentType != 'SPAN_GROUP_CLASS_ADJUST'
  169. "
  170. @click="revoke(scope.row)"
  171. >撤回</el-button
  172. >
  173. </auth>
  174. <el-button
  175. type="text"
  176. v-if="teamStatus && (scope.row.auditStatus === 'REJECT' ||
  177. scope.row.auditStatus === 'DRAFT')"
  178. v-permission="'musicGroupPaymentCalender/update/3883'"
  179. @click="resetPay(scope.row)"
  180. >修改</el-button
  181. >
  182. <el-button
  183. type="text"
  184. v-permission="'musicGroupPaymentCalender/delByBatchNo/3925'"
  185. v-if="
  186. (scope.row.auditStatus == 'REJECT' ||
  187. scope.row.auditStatus == 'AUDITING' ||
  188. scope.row.auditStatus == 'NO') &&
  189. teamStatus &&
  190. scope.row.paymentType != 'ADD_STUDENT' &&
  191. scope.row.paymentType != 'SPAN_GROUP_CLASS_ADJUST'
  192. "
  193. @click="removeBatchNo(scope.row)"
  194. >删除</el-button
  195. >
  196. <!-- <el-button type="text"
  197. v-if="!isNewGropu&&teamStatus&&scope.row.paymentType!='MUSIC_APPLY'"
  198. @click="onCreateQRCode(scope.row)">续费二维码</el-button> -->
  199. <!-- <el-button type="text"
  200. v-if="isNewGropu"
  201. v-permission="'musicGroup/findMusicGroupSubjectInfo/966'"
  202. @click="onPreview(scope.row)">预览</el-button> -->
  203. </div>
  204. </template>
  205. </el-table-column>
  206. </el-table>
  207. <pagination
  208. save-key="resetPayListSchool"
  209. sync
  210. :total.sync="rules.total"
  211. :page.sync="rules.page"
  212. :limit.sync="rules.limit"
  213. :page-sizes="rules.page_size"
  214. @pagination="getList"
  215. />
  216. </div>
  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: payForm.paymentPattern !== 2,
  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. :disabled="payForm.paymentPattern === 2"
  314. :picker-options="beginDate(payForm.paymentValidStartDate)"
  315. value-format="yyyy-MM-dd"
  316. placeholder="有效期结束日期"
  317. ></el-date-picker>
  318. </el-form-item>
  319. <el-form-item
  320. label="收费类型"
  321. v-if="isNew"
  322. :rules="[
  323. { required: true, message: '请选择收费类型', trigger: 'blur' },
  324. ]"
  325. prop="type"
  326. >
  327. <el-select
  328. v-model.trim="payForm.type"
  329. style="width: 220px !important"
  330. placeholder="课程类型"
  331. >
  332. <el-option label="线上" value="ONLINE"></el-option>
  333. <el-option label="线下" value="OFFLINE"></el-option>
  334. </el-select>
  335. </el-form-item>
  336. <el-form-item
  337. label="备注"
  338. v-if="isNew"
  339. :rules="[{ required: true, message: '请填写备注', trigger: 'blur' }]"
  340. prop="memo"
  341. >
  342. <el-input
  343. type="textarea"
  344. style="width: 220px !important"
  345. :rows="4"
  346. placeholder="请填写备注"
  347. v-model="payForm.memo"
  348. ></el-input>
  349. </el-form-item>
  350. </el-form>
  351. <div slot="footer" class="dialog-footer">
  352. <el-button @click="payVisible = false">取 消</el-button>
  353. <el-button type="primary" v-if="isNew" @click="newPayInfo"
  354. >确 定</el-button
  355. >
  356. <el-button type="primary" v-else @click="resetPayDate">确 定</el-button>
  357. </div>
  358. </el-dialog>
  359. <el-dialog :visible.sync="itemsVisible" title="查看缴费计划" width="1000px">
  360. <pay-items
  361. v-if="itemsVisible"
  362. ref="payItems"
  363. :batchNo="viewDetail && viewDetail.batchNo"
  364. payUserType="SCHOOL"
  365. :teamStatus="teamStatus"
  366. :teamType="teamType"
  367. :isNewGropu="isNewGropu"
  368. @lookUserList="lookUserList"
  369. @lookDetail="lookDetail"
  370. @openChioseStudent="openChioseStudent"
  371. @resetPay="resetPay"
  372. @close="itemsVisible = false"
  373. @onCreateQRCode="onCreateQRCode"
  374. />
  375. </el-dialog>
  376. <el-dialog
  377. title="查看缴费用户列表"
  378. :visible.sync="userListVisible"
  379. width="850px"
  380. >
  381. <schoolPayUserList
  382. v-if="userListVisible && viewDetail"
  383. :detail="viewDetail"
  384. />
  385. </el-dialog>
  386. <el-dialog
  387. title="查看"
  388. :visible.sync="reviewVisible"
  389. width="900px"
  390. destroy-on-close
  391. >
  392. <reviewDetail
  393. @close="reviewVisible = false"
  394. @submited="getList"
  395. :detail="viewDetail"
  396. :musicGroupId="$route.query.id"
  397. destroy-on-close
  398. />
  399. <div slot="footer" class="dialog-footer">
  400. <el-button type="primary" @click="reviewVisible = false"
  401. >关闭</el-button
  402. >
  403. </div>
  404. </el-dialog>
  405. <el-dialog :title="payFormTitle" :visible.sync="userVisible" width="830px">
  406. <userPayForm
  407. v-if="userVisible"
  408. @close="userVisible = false"
  409. @submited="payedSubmited"
  410. @changeActive="changeActive"
  411. :organizationCourseUnitPriceSettings="
  412. organizationCourseUnitPriceSettings
  413. "
  414. :rowDetail="activeRow"
  415. :type="payFormType"
  416. :baseInfo="baseInfo"
  417. :paymentType="team_status == 'PRE_BUILD_FEE' ? 0 : undefined"
  418. :musicGroupId="$route.query.id"
  419. />
  420. <!-- -->
  421. </el-dialog>
  422. <el-dialog
  423. title="学员选择"
  424. :visible.sync="chioseStudentVisible"
  425. destroy-on-close
  426. append-to-body
  427. width="800px"
  428. >
  429. <setStudentFee
  430. @chioseStudent="chioseStudent"
  431. v-if="chioseStudentVisible"
  432. ref="setStudentFee"
  433. :batchNo="batchNo"
  434. :musicGroupPaymentCalenderId="musicGroupPaymentCalenderId"
  435. @submited="chioseStudentSubmited"
  436. :clearTale="clearStduent"
  437. ></setStudentFee>
  438. <div slot="footer" class="dialog-footer">
  439. <el-button @click="chioseStudentVisible = false">取 消</el-button>
  440. <el-button type="primary" @click="submitNewPay">确 定</el-button>
  441. </div>
  442. </el-dialog>
  443. <qr-code v-model="qrcodeStatus" title="续费二维码" :codeUrl="codeUrl" />
  444. <el-dialog title="确认收款" :visible.sync="getMoneyVisible" width="600px">
  445. <isGetMoney @close="closeMoney" :data="activeRow" ref="getMoney" />
  446. <div slot="footer" class="dialog-footer">
  447. <el-button @click="getMoneyVisible = false">取 消</el-button>
  448. <el-button type="primary" @click="submitGetMoney">确 定</el-button>
  449. </div>
  450. </el-dialog>
  451. </div>
  452. </template>
  453. <script>
  454. import pagination from "@/components/Pagination/index";
  455. import dayjs from "dayjs";
  456. import QrCode from "@/components/QrCode/index";
  457. import { vaildStudentUrl } from "@/utils/validate";
  458. import {
  459. resetMusicGroupPaymentCalender,
  460. delMusicGroupPaymentCalender,
  461. } from "@/api/buildTeam";
  462. import { getOrganizationCourseUnitPriceSettings } from "@/api/specialSetting";
  463. import { getAuditList } from "@/api/auditManager";
  464. import {
  465. getMusicGroupStu,
  466. musicGroupPaymentCalenderDetailBatchAdd,
  467. musicGroupPaymentCalenderDelByBatchNo,
  468. revokeMusicGroupPaymentCalender
  469. } from "../api";
  470. import setStudentFee from "./studentPayBase";
  471. import userPayForm from "../modals/user-pay-form";
  472. import payItems from "../modals/pay-items";
  473. import schoolPayForm from "../modals/school-pay-form";
  474. import schoolPayUserList from "../modals/school-pay-user-list";
  475. import isGetMoney from "../modals/isGetMoney";
  476. import review from "../modals/review";
  477. import reviewDetail from "../modals/review-detail";
  478. import { userPaymentType } from "@/constant";
  479. import { objectToOptions } from "@/utils";
  480. import { payOrderTypeList } from "@/utils/searchArray";
  481. import { getTeamBaseInfo } from "@/api/buildTeam";
  482. export default {
  483. props: ["isNewGropu"],
  484. components: {
  485. pagination,
  486. setStudentFee,
  487. userPayForm,
  488. schoolPayForm,
  489. QrCode,
  490. review,
  491. reviewDetail,
  492. teamType: "",
  493. "pay-items": payItems,
  494. schoolPayUserList,
  495. isGetMoney,
  496. },
  497. data() {
  498. return {
  499. musicGroupStu: [],
  500. payFormType: "user",
  501. userVisible: false,
  502. schoolVisible: false,
  503. reviewVisible: false,
  504. userListVisible: false,
  505. itemsVisible: false,
  506. teamType: this.$route.query.type,
  507. organizationCourseUnitPriceSettings: [],
  508. searchForm: {
  509. paymentType: null,
  510. },
  511. viewDetail: null,
  512. tableList: [],
  513. rules: {
  514. // 分页规则
  515. limit: 10, // 限制显示条数
  516. page: 1, // 当前页
  517. total: 0, // 总条数
  518. page_size: [10, 20, 40, 50], // 选择限制显示条数
  519. },
  520. isInit: false,
  521. diTitle: "新增缴费",
  522. payVisible: false,
  523. payForm: {
  524. startPaymentDate: null,
  525. deadlinePaymentDate: null,
  526. paymentPattern: null,
  527. paymentValidStartDate: null,
  528. paymentValidEndDate: null,
  529. type: null,
  530. memo: null,
  531. },
  532. isNew: false,
  533. activeRow: null,
  534. pickerOptions: {
  535. firstDayOfWeek: 1,
  536. disabledDate(time) {
  537. return time.getTime() + 86400000 <= new Date().getTime();
  538. },
  539. },
  540. qrcodeStatus: false, // 生成二维码
  541. codeUrl: null,
  542. chioseStudentVisible: false,
  543. chioseStudentList: [],
  544. clearStduent: true,
  545. batchNo: "",
  546. musicGroupPaymentCalenderId: "",
  547. payOrderTypeLists: payOrderTypeList,
  548. getMoneyVisible: false,
  549. baseInfo: null,
  550. };
  551. },
  552. //生命周期 - 创建完成(可以访问当前this实例)
  553. created() {},
  554. //生命周期 - 挂载完成(可以访问DOM元素)
  555. async mounted() {
  556. // 获取分部
  557. try {
  558. const res = await getOrganizationCourseUnitPriceSettings({
  559. rows: 9999,
  560. });
  561. this.organizationCourseUnitPriceSettings = res.data.rows;
  562. } catch (error) {}
  563. this.init();
  564. },
  565. computed: {
  566. payOrderTypeList() {
  567. return objectToOptions(userPaymentType);
  568. },
  569. payFormTitle() {
  570. if (this.isNew) {
  571. return this.payFormType === "user" ? "新增学员缴费" : "新增学校缴费";
  572. } else {
  573. return this.payFormType === "user" ? "修改学员缴费" : "修改学校缴费";
  574. }
  575. },
  576. teamStatus() {
  577. // let type = this.$route.query.type;
  578. let team_status = this.team_status;
  579. return team_status == "PRE_BUILD_FEE" || team_status == "PROGRESS";
  580. },
  581. team_status() {
  582. return this.$route.query.team_status;
  583. },
  584. },
  585. // activated () {
  586. // this.init();
  587. // },
  588. methods: {
  589. async init() {
  590. try {
  591. const res = await getMusicGroupStu({
  592. musicGroupId: this.$route.query.id,
  593. });
  594. } catch (error) {}
  595. this.getTeamInfo();
  596. this.getList();
  597. },
  598. getTeamInfo() {
  599. getTeamBaseInfo({ musicGroupId: this.$route.query.id }).then((res) => {
  600. if (res.code == 200) {
  601. this.baseInfo = res.data;
  602. this.$emit("getBaseInfo", this.baseInfo);
  603. }
  604. });
  605. },
  606. newUserPay() {
  607. this.payFormType = "user";
  608. this.isNew = true;
  609. this.activeRow = null;
  610. this.userVisible = true;
  611. },
  612. newSchoolPay() {
  613. if (
  614. this.baseInfo?.musicGroup?.courseViewType == 1 &&
  615. this.team_status == "PRE_BUILD_FEE"
  616. ) {
  617. this.$message.error('会员缴费乐团无法创建学校缴费')
  618. return
  619. } else {
  620. this.payFormType = "school";
  621. this.isNew = true;
  622. this.activeRow = null;
  623. this.userVisible = true;
  624. }
  625. },
  626. getList() {
  627. let musicGroupId = this.$route.query.id;
  628. return getAuditList({
  629. page: this.rules.page,
  630. rows: this.rules.limit,
  631. search: musicGroupId,
  632. payUserType: "SCHOOL",
  633. paymentType: this.searchForm.paymentType,
  634. }).then((res) => {
  635. if (res.code == 200) {
  636. this.rules.total = res.data.total;
  637. this.tableList = res.data.rows;
  638. }
  639. });
  640. },
  641. paymentPatternChange(val) {
  642. if (val === 2) {
  643. this.payForm.paymentValidEndDate = null;
  644. }
  645. },
  646. onCreateQRCode(row) {
  647. // 生成报名二维码
  648. this.qrcodeStatus = true;
  649. this.codeUrl =
  650. vaildStudentUrl() + "/#/musicGroupRenew?calenderId=" + row.id;
  651. },
  652. chioseStudent(val) {
  653. this.chioseStudentList = val;
  654. },
  655. newPay() {
  656. this.diTitle = "新增缴费";
  657. this.isNew = true;
  658. this.payVisible = true;
  659. },
  660. resetPay(row) {
  661. this.diTitle = "修改缴费";
  662. this.isNew = false;
  663. this.activeRow = row;
  664. this.payFormType = row.payUserType === "SCHOOL" ? "school" : "user";
  665. this.userVisible = true;
  666. },
  667. changeActive(val) {
  668. if (this.$listeners.changeActive) {
  669. this.$listeners.changeActive(val);
  670. }
  671. },
  672. async chioseStudentSubmited() {
  673. try {
  674. await this.$confirm("缴费创建完成, 是否立即排课?", "提示", {
  675. confirmButtonText: "确定",
  676. cancelButtonText: "取消",
  677. type: "warning",
  678. });
  679. if (this.$listeners.changeActive) {
  680. this.$listeners.changeActive({
  681. name: "5",
  682. });
  683. }
  684. } catch (error) {}
  685. },
  686. detelePay(row) {
  687. let id = row.id;
  688. this.$confirm(`确定删除该缴费周期?`, "提示", {
  689. confirmButtonText: "确定",
  690. cancelButtonText: "取消",
  691. type: "warning",
  692. })
  693. .then(() => {
  694. delMusicGroupPaymentCalender({ id }).then((res) => {
  695. if (res.code == 200) {
  696. this.$message.success("删除成功");
  697. this.getList();
  698. }
  699. });
  700. })
  701. .catch(() => {});
  702. },
  703. lookList(row) {
  704. this.viewDetail = row;
  705. this.itemsVisible = true;
  706. },
  707. lookUserList(row) {
  708. console.log({ ...row });
  709. this.viewDetail = { ...row };
  710. this.userListVisible = true;
  711. },
  712. lookDetail(row) {
  713. let query = this.$route.query;
  714. this.$route.query.paymentId = row.id;
  715. this.viewDetail = row;
  716. if (row.payUserType === "SCHOOL") {
  717. this.reviewVisible = true;
  718. } else {
  719. this.$router.push({ path: "/business/strudentPayInfo", query });
  720. }
  721. },
  722. setStudentPay() {
  723. let query = this.$route.query;
  724. this.$router.push({ path: "/business/studentPayBase", query });
  725. },
  726. async removeBatchNo(row) {
  727. try {
  728. await this.$confirm("是否确认删除该缴费批次?", "提示", {
  729. type: "warning",
  730. });
  731. await musicGroupPaymentCalenderDelByBatchNo({ batchNo: row.batchNo });
  732. this.$message.success("删除成功");
  733. this.getList();
  734. } catch (error) {}
  735. },
  736. newPayInfo() {
  737. this.$refs["payForm"].validate((res) => {
  738. if (res) {
  739. /**
  740. * payForm: {
  741. startPaymentDate: null,
  742. deadlinePaymentDate: null,
  743. type: null,
  744. memo: null
  745. },
  746. *
  747. */
  748. this.chioseStudentVisible = true;
  749. return;
  750. }
  751. });
  752. },
  753. submitNewPay() {
  754. if (this.chioseStudentList.length < 1) {
  755. this.$message.error("请至少选择一名学员");
  756. return;
  757. }
  758. let obj = {};
  759. obj.userIdList = this.chioseStudentList.map((stu) => {
  760. return stu.userId;
  761. });
  762. obj.batchNo = this.batchNo;
  763. musicGroupPaymentCalenderDetailBatchAdd(obj).then((res) => {
  764. if (res.code == 200) {
  765. this.$message.success("添加成功");
  766. this.$refs.setStudentFee.clearTable();
  767. this.payVisible = false;
  768. this.chioseStudentVisible = false;
  769. this.getList();
  770. // this.$refs.payItems?.getList()
  771. }
  772. });
  773. },
  774. resetPayDate() {
  775. resetMusicGroupPaymentCalender({
  776. id: this.activeRow.id,
  777. startPaymentDate: this.payForm.startPaymentDate,
  778. deadlinePaymentDate: this.payForm.deadlinePaymentDate,
  779. paymentValidStartDate: this.payForm.paymentValidStartDate
  780. ? dayjs(this.payForm.paymentValidStartDate).format("YYYY-MM-DD")
  781. : this.payForm.paymentValidStartDate,
  782. paymentValidEndDate: this.payForm.paymentValidEndDate
  783. ? dayjs(this.payForm.paymentValidEndDate).format("YYYY-MM-DD")
  784. : this.payForm.paymentValidEndDate,
  785. paymentPattern: this.payForm.paymentPattern,
  786. }).then((res) => {
  787. if (res.code == 200) {
  788. this.$message.success("修改成功");
  789. this.payVisible = false;
  790. this.getTeamInfo();
  791. this.getList();
  792. }
  793. });
  794. },
  795. changeStartTime(val) {
  796. this.payForm.deadlinePaymentDate = this.dateAddDays(val, 3);
  797. },
  798. changePaymentStartTime(val) {
  799. this.payForm.paymentValidEndDate = null;
  800. },
  801. dateAddDays(dataStr, dayCount) {
  802. let strdate = dataStr; //日期字符串
  803. let isdate = new Date(strdate.replace(/-/g, "/")); //把日期字符串转换成日期格式
  804. isdate = new Date((isdate / 1000 + 86400 * dayCount) * 1000); //日期加1天
  805. let pdate =
  806. isdate.getFullYear() +
  807. "-" +
  808. (isdate.getMonth() + 1) +
  809. "-" +
  810. isdate.getDate(); //把日期格式转换成字符串
  811. return pdate;
  812. },
  813. beginDate(end) {
  814. return {
  815. firstDayOfWeek: 1,
  816. disabledDate(time) {
  817. if (end) {
  818. return new Date(end).getTime() - 86400000 >= time.getTime();
  819. } else {
  820. return time.getTime() + 86400000 < Date.now();
  821. //开始时间不选时,结束时间最大值小于等于当天
  822. }
  823. },
  824. };
  825. },
  826. search() {
  827. this.rules.page = 1;
  828. this.getList();
  829. },
  830. onReSet() {
  831. this.searchForm = { payUserType: null };
  832. },
  833. openChioseStudent(row) {
  834. this.chioseStudentVisible = true;
  835. this.batchNo = row.batchNo;
  836. this.musicGroupPaymentCalenderId = row.id;
  837. },
  838. async payedSubmited(data) {
  839. try {
  840. await this.getList();
  841. this.getTeamInfo();
  842. // if (!this.isNewGropu) {
  843. // this.chioseStudentVisible = true;
  844. // if (data) {
  845. // this.musicGroupPaymentCalenderId = data.musicGroupPaymentCalenderId;
  846. // }
  847. // }
  848. } catch (error) {}
  849. },
  850. commmitGetMoney(row) {
  851. this.activeRow = row;
  852. this.getMoneyVisible = true;
  853. },
  854. submitGetMoney() {
  855. this.$refs.getMoney.submitGetMoney();
  856. },
  857. closeMoney() {
  858. this.getMoneyVisible = false;
  859. this.getList();
  860. },
  861. async revoke(row) {
  862. try {
  863. await this.$confirm("是否撤回此缴费项目的审批?", "提示", {
  864. confirmButtonText: "确定",
  865. cancelButtonText: "取消",
  866. type: "warning",
  867. });
  868. const res = await revokeMusicGroupPaymentCalender({
  869. batchNo: row.batchNo,
  870. });
  871. this.$message.success("取消审批成功");
  872. this.getList();
  873. this.getTeamInfo();
  874. } catch {}
  875. },
  876. },
  877. watch: {
  878. chioseStudentVisible() {
  879. this.chioseStudentList = [];
  880. },
  881. payVisible(val) {
  882. if (!val) {
  883. this.payForm = {
  884. startPaymentDate: null,
  885. paymentPattern: null,
  886. paymentValidStartDate: null,
  887. paymentValidEndDate: null,
  888. type: null,
  889. memo: null,
  890. deadlinePaymentDate: null,
  891. };
  892. this.$refs["payForm"].resetFields();
  893. }
  894. },
  895. },
  896. };
  897. </script>
  898. <style lang='scss' scoped>
  899. .topWrap {
  900. display: flex;
  901. flex-direction: row;
  902. justify-content: flex-start;
  903. div {
  904. margin-right: 10px;
  905. }
  906. }
  907. .left-code,
  908. .right-code {
  909. // width: 50%;
  910. // float: left;
  911. h2 {
  912. font-size: 18px;
  913. text-align: center;
  914. padding-bottom: 8px;
  915. }
  916. .qrcode {
  917. display: flex;
  918. flex-direction: column;
  919. align-items: center;
  920. img {
  921. width: 200px;
  922. height: 200px;
  923. margin: 0 auto;
  924. }
  925. }
  926. .code-url {
  927. font-size: 18px;
  928. text-align: center;
  929. padding: 15px 15px 0 15px;
  930. }
  931. }
  932. </style>