payInfoDetail.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986
  1. <template>
  2. <div class="m-container">
  3. <div class="payInfoWrap">
  4. <div class="left">
  5. <el-page-header
  6. @back="goback"
  7. style="padding-bottom: 30px"
  8. :content="
  9. $route.query.payUserType == 'SCHOOL' ? '学校缴费' : '学员缴费'
  10. "
  11. >
  12. </el-page-header>
  13. <div class="m-core">
  14. <el-form :inline="true" :model="form" label-width="120px" ref="form">
  15. <div class="payTitle">
  16. <div class="squrt"></div>
  17. <p>基础信息设置</p>
  18. </div>
  19. <el-form-item
  20. prop="paymentDate"
  21. :rules="[
  22. { required: true, message: '请选择缴费时间', trigger: 'blur' },
  23. ]"
  24. ref="paymentDate"
  25. >
  26. <template slot="label">
  27. <p style="position: relative">
  28. <span style="color: #f56c6c; margin-right: 4px">*</span>
  29. 缴费时间
  30. <el-tooltip placement="top" popper-class="mTooltip">
  31. <div slot="content">在改时间段内学员才可缴费</div>
  32. <i
  33. class="el-icon-question"
  34. style="
  35. font-size: 18px;
  36. color: #f56c6c;
  37. position: relative;
  38. top: 2px;
  39. "
  40. ></i>
  41. </el-tooltip>
  42. </p>
  43. </template>
  44. <el-date-picker
  45. v-model="form.paymentDate"
  46. type="daterange"
  47. style="width: 280px"
  48. :picker-options="{ firstDayOfWeek: 1 }"
  49. value-format="yyyy-MM-dd"
  50. range-separator="-"
  51. start-placeholder="开始日期"
  52. end-placeholder="结束日期"
  53. >
  54. </el-date-picker>
  55. </el-form-item>
  56. <el-row>
  57. <el-form-item
  58. prop="memo"
  59. :rules="[
  60. { required: true, message: '请输入备注', trigger: 'blur' },
  61. ]"
  62. ref="memo"
  63. >
  64. <template slot="label">
  65. <p style="position: relative">
  66. <span style="color: #f56c6c; margin-right: 4px">*</span>
  67. 备注
  68. <el-tooltip placement="top" popper-class="mTooltip">
  69. <div slot="content">本次缴费的内容描述</div>
  70. <i
  71. class="el-icon-question"
  72. style="
  73. font-size: 18px;
  74. color: #f56c6c;
  75. position: relative;
  76. top: 2px;
  77. "
  78. ></i>
  79. </el-tooltip>
  80. </p>
  81. </template>
  82. <el-input
  83. type="textarea"
  84. style="width: 280px"
  85. :rows="2"
  86. v-model="form.memo"
  87. maxlength="50"
  88. show-word-limit
  89. ></el-input>
  90. </el-form-item>
  91. </el-row>
  92. <div class="payTitle">
  93. <div class="squrt"></div>
  94. <p>基础项目配置</p>
  95. </div>
  96. <div class="checkWrap">
  97. <div
  98. class="checkBtn"
  99. :class="[
  100. teamCourse ? 'active' : '',
  101. teamCourseDisabled ? 'disabled' : '',
  102. ]"
  103. @click.prevent="
  104. () => {
  105. if (teamCourseDisabled) return;
  106. teamCourse = !teamCourse;
  107. if (teamCourse && form.eclass.length < 0) {
  108. form.eclass = [];
  109. form.eclass.push({});
  110. }
  111. }
  112. "
  113. >
  114. <p>乐团课</p>
  115. <el-checkbox
  116. v-model="teamCourse"
  117. :disabled="teamCourseDisabled"
  118. ></el-checkbox>
  119. </div>
  120. <div
  121. class="checkBtn"
  122. :class="[
  123. member ? 'active' : '',
  124. memberDisabled ? 'disabled' : '',
  125. ]"
  126. @click.prevent="
  127. () => {
  128. if (memberDisabled) return;
  129. member = !member;
  130. if (member && form.memberList.length < 0) {
  131. form.memberList = [];
  132. form.memberList.push({});
  133. }
  134. }
  135. "
  136. >
  137. <p>团练宝</p>
  138. <el-checkbox
  139. v-model="member"
  140. :disabled="memberDisabled"
  141. ></el-checkbox>
  142. </div>
  143. <div
  144. v-if="isShowLeBao&&tenantId==1"
  145. class="checkBtn"
  146. :class="[
  147. leBao ? 'active' : '',
  148. leBaoDisabled ? 'disabled' : '',
  149. ]"
  150. @click.prevent="
  151. () => {
  152. if (leBaoDisabled) return;
  153. leBao = !leBao;
  154. if (leBao && form.leBaoList.length < 0) {
  155. form.leBaoList = [];
  156. form.leBaoList.push({});
  157. }
  158. }
  159. "
  160. >
  161. <p>乐保</p>
  162. <el-checkbox
  163. v-model="leBao"
  164. :disabled="leBaoDisabled"
  165. ></el-checkbox>
  166. </div>
  167. <div
  168. class="checkBtn"
  169. :class="[
  170. teamActive ? 'active' : '',
  171. teamActiveDisabled ? 'disabled' : '',
  172. ]"
  173. @click.prevent="
  174. () => {
  175. if (teamActiveDisabled) return;
  176. teamActive = !teamActive;
  177. if (teamActive && form.activeList.length < 0) {
  178. form.activeList = [];
  179. form.activeList.push({});
  180. }
  181. }
  182. "
  183. >
  184. <p>乐团活动</p>
  185. <el-checkbox
  186. v-model="teamActive"
  187. :disabled="teamActiveDisabled"
  188. ></el-checkbox>
  189. </div>
  190. </div>
  191. <div class="coreList">
  192. <payTeamCourse
  193. :form="form"
  194. :charges="charges"
  195. :courseUnitPriceSettingsByType="
  196. organizationCourseUnitPriceSettingsByType
  197. "
  198. v-if="teamCourse"
  199. @create="addExtraClass"
  200. @remove="removeExtraClass"
  201. @moneyChange="syncAllMoney"
  202. @priceChange="priceChange"
  203. />
  204. <payMember
  205. ref="payMember"
  206. :memberRankList="memberRankList"
  207. @moneyChange="syncAllMoney"
  208. @priceChange="priceChange"
  209. :rulesForm="rulesForm"
  210. :organId="organId"
  211. :form="form"
  212. v-if="member"
  213. />
  214. <payLeBao :form="form" v-if="leBao" :leBaoInfo="leBaoInfo" />
  215. <payTeamActive
  216. :form="form"
  217. v-if="teamActive"
  218. :activeList="activeList"
  219. @create="addActive"
  220. @remove="removeActive"
  221. />
  222. </div>
  223. </el-form>
  224. <div v-if="!teamCourse && !member && !leBao && !teamActive">
  225. <empty desc="暂无缴费项目配置" />
  226. </div>
  227. <div v-else style="text-align:center;">
  228. <el-button class="submitBtn" @click="submitForm">确认</el-button>
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. <el-dialog
  234. title="报名声部预览"
  235. :visible.sync="dialogSubjectVisible"
  236. width="400px"
  237. class="subjectPreview"
  238. v-if="dialogSubjectVisible"
  239. >
  240. <el-tabs v-model="activeName" type="card">
  241. <el-tab-pane
  242. :label="subject.subName"
  243. lazy
  244. v-for="(subject, index) in dialogSubjectList"
  245. :key="index"
  246. :name="subject.subjectId.toString()"
  247. style="max-height: 500px;overflow-y: auto;"
  248. >
  249. <subject-preview
  250. :subjectId="subject.subjectId"
  251. :preViewData="preViewData"
  252. ></subject-preview>
  253. </el-tab-pane>
  254. </el-tabs>
  255. <div>
  256. <el-button style="width: 100%; border-radius: 0; line-height: 30px" size="medium" type="primary" @click="onSubmit">确认提交</el-button>
  257. </div>
  258. </el-dialog>
  259. </div>
  260. </template>
  261. <script>
  262. import payTeamCourse from "../modals/payTeamCourse";
  263. import payMember from "../modals/payMember";
  264. import payLeBao from "../modals/payLeBao";
  265. import payTeamActive from "../modals/payTeamActive";
  266. import numeral from "numeral";
  267. import dayjs from "dayjs";
  268. import subjectPreview from "@/views/resetTeaming/modals/subject-preview";
  269. import {
  270. chargeTypeList,
  271. musicGroupOrganizationCourseSettingsQueryPage,
  272. } from "@/api/specialSetting";
  273. import { getSysTenantConfig } from "@/views/courseRulersManager/api";
  274. import { sysConfigList } from "@/api/generalSettings";
  275. import {
  276. queryByMusicGroupOrganizationCourseSettingsId,
  277. getAllmemberRank,
  278. musicGroupcreateCalender,
  279. musicGroupresetCalender,
  280. } from "../api";
  281. import { getMusicGroupPaymentCalenderDetail, findMusicGroupSubjectInfo } from "@/api/buildTeam";
  282. import { vipGroupActivity } from "@/api/vipSeting";
  283. export default {
  284. components: {
  285. payTeamCourse,
  286. payMember,
  287. payLeBao,
  288. payTeamActive,
  289. subjectPreview
  290. },
  291. data() {
  292. return {
  293. form: {
  294. paymentType: "",
  295. memo: "",
  296. eclass: [{}],
  297. memberList: [
  298. {
  299. period: "",
  300. num: "",
  301. name: "",
  302. actualAmount: "",
  303. memberRankSettingId: "",
  304. optionalFlag: null,
  305. },
  306. ],
  307. leBaoList: [{}],
  308. activeList: [{}],
  309. leixing: "2",
  310. },
  311. teamCourse: false,
  312. teamCourseDisabled: false,
  313. member: false,
  314. memberDisabled: false,
  315. teamActive: false,
  316. teamActiveDisabled: false,
  317. leBao: false,
  318. leBaoDisabled: false,
  319. organizationCourseUnitPriceSettings: null,
  320. baseInfo: null,
  321. courseViewType: null,
  322. charges: null, // 乐团类型对应的收费方式
  323. memberRankList: [],
  324. organId: null,
  325. leBaoInfo: null,
  326. isShowLeBao: false,
  327. isSetCourseSettingsId: false,
  328. activeList: [{}],
  329. submitList: [],
  330. organizationCourseUnitPriceSettingsByType: null,
  331. rulesForm: {
  332. minMonthFee: null,
  333. maxMonthFee: null,
  334. minQuarterlyFee: null,
  335. maxQuarterlyFee: null,
  336. minHalfYearFee: null,
  337. maxHalfYearFee: null,
  338. minYearFee: null,
  339. maxYearFee: null,
  340. },
  341. dialogSubjectVisible: false, // 预览
  342. dialogSubjectList: [],
  343. activeName: null,
  344. preViewData: {},
  345. tenantId:null
  346. };
  347. },
  348. mounted() {
  349. let tenantConfig = sessionStorage.getItem('tenantConfig')
  350. tenantConfig = tenantConfig ? JSON.parse(tenantConfig) : {}
  351. if(tenantConfig.tenantId && tenantConfig.tenantId != 'undefined') {
  352. this.tenantId = tenantConfig.tenantId
  353. }
  354. this.organizationCourseUnitPriceSettings = JSON.parse(
  355. localStorage.getItem("organizationCourseUnitPriceSettings")
  356. );
  357. this.baseInfo = JSON.parse(localStorage.getItem("payMusicBase"));
  358. // 判断乐团状态 缴费类型
  359. this.init();
  360. },
  361. methods: {
  362. async init() {
  363. this.organId = this.musicGroup?.organId;
  364. this.courseViewType = this.baseInfo?.musicGroup?.courseViewType;
  365. if (
  366. this.courseViewType != 2 &&
  367. this.$route.query.team_status == "PRE_BUILD_FEE"
  368. ) {
  369. // 课程团的创建缴费
  370. this.teamCourse = true;
  371. this.teamCourseDisabled = true;
  372. this.form.paymentType = "MUSIC_APPLY";
  373. } else if (
  374. this.courseViewType == 2 &&
  375. this.$route.query.team_status == "PRE_BUILD_FEE"
  376. ) {
  377. // 会员团的创建缴费
  378. this.member = true;
  379. this.memberDisabled = true;
  380. }
  381. if (this.$route.query.payUserType == "SCHOOL") {
  382. this.member = false;
  383. this.memberDisabled = true;
  384. this.leBao = false;
  385. this.teamActive = false;
  386. this.leBaoDisabled = true;
  387. this.teamActiveDisabled = true;
  388. } else {
  389. }
  390. await this.getCharges(); // 续费的选择缴费类型
  391. await this.formatCourse(); // 临时加课的类型选择以及价格
  392. await this.getMemberList(); // 获取会员(团练保信息)
  393. await this.getLeBao(); // 获取乐保
  394. await this.getActive(); // 获取活动
  395. await this.getMemberRules();
  396. if (this.$route.query.calenderId) {
  397. // 说明是修改 查缴项目详情
  398. getMusicGroupPaymentCalenderDetail({
  399. id: this.$route.query.calenderId,
  400. }).then((res) => {
  401. if (res.code == 200) {
  402. if (res.data?.calender?.musicGroupOrganizationCourseSettingId) {
  403. this.form.leixing = "1";
  404. this.form.musicGroupOrganizationCourseSettingId =
  405. res.data?.calender?.musicGroupOrganizationCourseSettingId;
  406. } else {
  407. this.form.leixing = "2";
  408. }
  409. this.$set(this.form, "paymentDate", [
  410. res.data?.calender?.startPaymentDate,
  411. res.data?.calender?.deadlinePaymentDate,
  412. ]);
  413. this.$set(this.form, "memo", res.data?.calender?.memo);
  414. this.$set(
  415. this.form,
  416. "payUserType",
  417. res.data?.calender?.payUserType
  418. );
  419. if (res.data.member) {
  420. // 团练保
  421. this.member = true;
  422. this.$set(this.form, "memberList", [{ ...res.data.member }]);
  423. }
  424. if (res.data.repair) {
  425. this.leBao = true;
  426. this.$set(this.form, "leBaoList", [{ ...res.data.repair }]);
  427. }
  428. if (res.data?.course?.length > 0) {
  429. this.$nextTick(() => {
  430. this.teamCourse = true;
  431. this.isSetCourseSettingsId = true;
  432. this.$set(this.form, "eclass", res.data?.course);
  433. });
  434. }
  435. if (res.data?.activity?.length > 0) {
  436. this.teamActive = true;
  437. this.$set(this.form, "activeList", res.data.activity);
  438. this.form.activeList.forEach((active) => {
  439. active.vipGroupCategoryNames = active.categoryName;
  440. });
  441. }
  442. }
  443. });
  444. }
  445. if (this.submitList.length > 0) {
  446. this.$bus.$emit("showguide", this.submitList);
  447. return;
  448. }
  449. },
  450. getActive() {
  451. return vipGroupActivity({
  452. organId: this.organId,
  453. rows: 10,
  454. page: 1,
  455. status: "PROGRESS",
  456. activityChannel: 1,
  457. enable: true,
  458. }).then((res) => {
  459. if (res.code == 200) {
  460. this.activeList = res.data.rows;
  461. if (this.activeList.length <= 0) {
  462. this.submitList.push("teamActive");
  463. // this.$bus.$emit("showguide", ["teamCourseFee"]);
  464. }
  465. }
  466. });
  467. },
  468. async getMemberRules() {
  469. try {
  470. const res = await sysConfigList({ group: "DEFAULT" });
  471. const paramName = "cloud_price_range";
  472. res.data.forEach((item) => {
  473. if (item.paramName == paramName) {
  474. const itemValue = item.paranValue
  475. ? JSON.parse(item.paranValue)
  476. : null;
  477. if (itemValue) {
  478. this.rulesForm = itemValue;
  479. }
  480. }
  481. });
  482. } catch (e) {
  483. console.log(e);
  484. }
  485. },
  486. async getLeBao() {
  487. try {
  488. const res = await getSysTenantConfig({ group: "MUSIC_REPAIR" });
  489. this.leBaoInfo = res.data;
  490. res.data.forEach((element) => {
  491. if (element.id == 188) {
  492. this.isShowLeBao = !!element.paranValue;
  493. }
  494. });
  495. // this.$forceUpdate()
  496. } catch (e) {
  497. console.log(e);
  498. }
  499. },
  500. async getMemberList() {
  501. try {
  502. const res = await getAllmemberRank({ isDefault: 0 });
  503. this.memberRankList = res.data;
  504. } catch (e) {
  505. console.log(e);
  506. }
  507. },
  508. async getCharges() {
  509. const organId = this.musicGroup?.organId;
  510. const chargeTypeId = this.musicGroup?.chargeTypeId;
  511. this.chargeTypeName = this.musicGroup?.chargeTypeName;
  512. try {
  513. const res = await musicGroupOrganizationCourseSettingsQueryPage({
  514. row: 9999,
  515. chargeTypeId,
  516. organId,
  517. });
  518. const ids = res.data.rows.map((item) => item.id);
  519. if (!ids.includes(this.form.musicGroupOrganizationCourseSettingId)) {
  520. this.$set(this.form, "musicGroupOrganizationCourseSettingId", null);
  521. }
  522. this.charges = res.data.rows;
  523. // this.charges =[];
  524. if (this.charges.length <= 0) {
  525. this.submitList.push("teamCourseType");
  526. }
  527. } catch (error) {}
  528. },
  529. goback() {
  530. let query = { ...this.$route.query };
  531. query.calenderId = null;
  532. if (query.type == "resetTeam") {
  533. this.$store.dispatch("delVisitedViews", this.$route);
  534. this.$router.push({
  535. path: "/business/resetTeaming",
  536. query,
  537. });
  538. } else if (query.type == "look") {
  539. this.$store.dispatch("delVisitedViews", this.$route);
  540. this.$router.push({
  541. path: "/business/resetTeaming",
  542. query,
  543. });
  544. } else if (query.type == "PRE_BUILD_FEE" || query.type == "feeAudit") {
  545. this.$store.dispatch("delVisitedViews", this.$route);
  546. this.$router.push({
  547. path: "/business/resetTeaming",
  548. query,
  549. });
  550. }
  551. },
  552. formatCourse() {
  553. // 格式化课程类型
  554. const organId = this.musicGroup?.organId;
  555. const chargeTypeId = this.musicGroup?.chargeTypeId;
  556. const _ = {};
  557. const list = (this.organizationCourseUnitPriceSettings || []).filter(
  558. (item) =>
  559. organId &&
  560. organId == item.organId &&
  561. chargeTypeId &&
  562. chargeTypeId == item.chargeTypeId
  563. );
  564. for (const item of list) {
  565. _[item.courseType] = item;
  566. }
  567. this.organizationCourseUnitPriceSettingsByType = _;
  568. return _;
  569. },
  570. priceChange(item, index) {
  571. const _ = [...this.form.eclass];
  572. const active =
  573. this.organizationCourseUnitPriceSettingsByType[item.courseType] || {};
  574. const price = Math.round(
  575. numeral(active.unitPrice || 1)
  576. .multiply(item.courseTotalMinuties || 1)
  577. .value()
  578. );
  579. item.courseCurrentPrice = price;
  580. item.courseOriginalPrice = price;
  581. _[index] = item;
  582. this.$set(this.form, "eclass", [..._]);
  583. this.syncAllMoney();
  584. },
  585. syncAllMoney() {
  586. let money = 0;
  587. let first = 0;
  588. let other = 0;
  589. let classs = this.form.eclass;
  590. for (const item of classs) {
  591. money += item.courseCurrentPrice;
  592. if (this.cycles && this.cycles.length) {
  593. if (item.isStudentOptional) {
  594. first += item.courseCurrentPrice;
  595. } else {
  596. const floorMoney = Math.floor(
  597. item.courseCurrentPrice / this.cycles.length
  598. );
  599. const remainder = item.courseCurrentPrice % this.cycles.length;
  600. first += floorMoney + remainder;
  601. other += floorMoney;
  602. }
  603. }
  604. }
  605. // if (!money) {
  606. // this.$set(this.cycle, "paymentAmount", undefined);
  607. // } else {
  608. // this.$set(this.cycle, "paymentAmount", money);
  609. // }
  610. // money += parseFloat(this.memberForm.memberPaymentAmount || 0);
  611. // this.money = money;
  612. return money;
  613. },
  614. addExtraClass() {
  615. this.form.eclass.push({});
  616. },
  617. addActive() {
  618. this.form.activeList.push({});
  619. },
  620. removeActive(index) {
  621. this.form.activeList[index] = null;
  622. this.$set(
  623. this.form,
  624. "activeList",
  625. this.form.activeList.filter((item) => !!item)
  626. );
  627. },
  628. removeExtraClass(index) {
  629. this.form.eclass[index] = null;
  630. this.$set(
  631. this.form,
  632. "eclass",
  633. this.form.eclass.filter((item) => !!item)
  634. );
  635. // this.form.eclass = this.form.eclass.filter((item) => !!item);
  636. },
  637. async onPreview() {
  638. // 开始预览
  639. const musicGroupId = this.$route.query.id;
  640. await findMusicGroupSubjectInfo({ musicGroupId: musicGroupId }).then(
  641. (res) => {
  642. if (res.code == 200) {
  643. this.dialogSubjectList = res.data.musicGroupSubjectPlans;
  644. // 默认预览第一个
  645. this.activeName = this.dialogSubjectList[0].subjectId.toString();
  646. this.dialogSubjectVisible = true;
  647. } else {
  648. this.$message.warning("没有可预览的声部");
  649. }
  650. }
  651. );
  652. },
  653. submitForm() {
  654. this.$refs.form.validate(async (isok,obj) => {
  655. if (isok) {
  656. const preViewData = this.formatPreviewData()
  657. this.preViewData = preViewData
  658. await this.onPreview()
  659. // let obj = this.fommatDate();
  660. }else {
  661. this.$nextTick(() => {
  662. this.scrollView(obj);
  663. });
  664. }
  665. });
  666. },
  667. onSubmit() {
  668. console.log('提交')
  669. this.$refs.form.validate(async (isok) => {
  670. console.log('isok',isok)
  671. if (isok) {
  672. let obj = this.fommatDate();
  673. if (this.$route.query.calenderId) {
  674. obj.calenderId = this.$route.query.calenderId;
  675. try {
  676. const res = await musicGroupresetCalender(obj);
  677. this.$message.success("修改缴费成功");
  678. this.goback();
  679. } catch (e) {
  680. console.log(e);
  681. }
  682. } else {
  683. try {
  684. const res = await musicGroupcreateCalender(obj);
  685. this.$message.success("创建缴费成功");
  686. this.goback();
  687. } catch (e) {
  688. console.log(e);
  689. }
  690. }
  691. }
  692. });
  693. },
  694. scrollView(object) {
  695. console.log(object)
  696. for (const i in object) {
  697. let dom = this.$refs[i];
  698. // 这里是针对遍历的情况(多个输入框),取值为数组
  699. if (Object.prototype.toString.call(dom) !== "[object Object]") {
  700. dom = dom[0];
  701. }
  702. // 第一种方法(包含动画效果)
  703. dom.$el.scrollIntoView({
  704. // 滚动到指定节点
  705. // 值有start,center,end,nearest,当前显示在视图区域中间
  706. block: "center",
  707. // 值有auto、instant,smooth,缓动动画(当前是慢速的)
  708. behavior: "smooth",
  709. });
  710. break; // 跳出循环了
  711. }
  712. },
  713. formatPreviewData() {
  714. // 格式化预览数据
  715. const form = this.form;
  716. // 重置小班课数据
  717. let tmpActiveList = form.activeList?.length > 0 ? form.activeList : []
  718. let activeList = []
  719. if(tmpActiveList.length > 0) {
  720. tmpActiveList.forEach(active => {
  721. if(active.activityId) {
  722. active.categoryName = active.vipGroupCategoryNames
  723. activeList.push(active)
  724. }
  725. })
  726. }
  727. let memberObj = form.memberList?.length > 0 ? { ...form.memberList[0] } : null
  728. // 获取会员名称
  729. if(memberObj) {
  730. this.memberRankList.forEach(item => {
  731. if(item.id == memberObj.memberRankSettingId) {
  732. memberObj.name = item.name
  733. }
  734. })
  735. }
  736. // console.log(memberObj, 'memberObj', activeList)
  737. return {
  738. payUserType: this.$route.query.payUserType,
  739. musicGroup: this.musicGroup,
  740. paymentCalender: {
  741. activity: [...activeList], // 小班课
  742. course: form.eclass?.length > 0 ? form.eclass : [], // 课程
  743. member: memberObj, // 团练宝
  744. memberPrivilegesItemList: [], // 会员基本内容
  745. repair: form.leBaoList?.length > 0 ? { ...form.leBaoList[0], optionalFlag: false } : null, // 乐保
  746. }
  747. }
  748. },
  749. fommatDate() {
  750. return {
  751. payUserType: this.$route.query.payUserType,
  752. musicGroupOrganizationCourseSettingId:
  753. this.form.musicGroupOrganizationCourseSettingId || null,
  754. memo: this.form.memo,
  755. startPaymentDate: this.form.paymentDate[0],
  756. deadlinePaymentDate: this.form.paymentDate[1],
  757. calenderActivityList:
  758. this.form.activeList?.length > 0 ? this.form.activeList : null,
  759. musicRepair:
  760. this.form.leBaoList?.length > 0
  761. ? { ...this.form.leBaoList[0] }
  762. : null,
  763. calenderMember:
  764. this.form.memberList?.length > 0
  765. ? { ...this.form.memberList[0] }
  766. : null,
  767. musicGroupPaymentCalenderCourseSettingsList:
  768. this.form.eclass?.length > 0 ? this.form.eclass : null,
  769. musicGroupId: this.$route.query.id,
  770. };
  771. },
  772. },
  773. watch: {
  774. teamCourse(val) {
  775. if (!val) {
  776. this.$set(this.form, "eclass", [{}]);
  777. this.$set(this.form, "leixing", "2");
  778. }
  779. },
  780. member(val) {
  781. if (!val) {
  782. this.$set(this.form, "memberList", [{}]);
  783. }
  784. },
  785. teamActive(val) {
  786. if (!val) {
  787. this.$set(this.form, "activeList", [{}]);
  788. }
  789. },
  790. leBao(val) {
  791. if (!val) {
  792. this.$set(this.form, "leBaoList", [{}]);
  793. }
  794. },
  795. async "form.musicGroupOrganizationCourseSettingId"(val) {
  796. // && !this.rowDetail !this.$route.query.calenderId
  797. if (val && !this.isSetCourseSettingsId) {
  798. try {
  799. const res = await queryByMusicGroupOrganizationCourseSettingsId({
  800. id: val,
  801. });
  802. let CourseSettingDetail = res.data.map((course) => {
  803. return {
  804. ...course,
  805. };
  806. });
  807. this.$set(this.form, "eclass", res.data);
  808. // this.syncAllMoney();
  809. } catch (error) {}
  810. }
  811. this.isSetCourseSettingsId = false;
  812. },
  813. "form.leixing"(val) {
  814. this.cycles = [{}];
  815. this.collapse = [0];
  816. this.cycle = {};
  817. if (val != "1") {
  818. this.$set(
  819. this.form,
  820. "musicGroupOrganizationCourseSettingId",
  821. undefined
  822. );
  823. }
  824. // this.$set(this.cycle, "paymentAmount", undefined);
  825. // this.$set(this.other, "memo", null);
  826. if (val === "1" && !this.isSetCourseSettingsId) {
  827. this.$set(this.form, "eclass", []);
  828. } else if (val === "2") {
  829. this.$set(this.form, "eclass", [{}]);
  830. }
  831. this.isSetCourseSettingsId = false;
  832. },
  833. },
  834. computed: {
  835. musicGroup() {
  836. return this.baseInfo?.musicGroup;
  837. },
  838. },
  839. };
  840. </script>
  841. <style lang="scss" scoped>
  842. /deep/.el-form-item__label:before {
  843. content: "" !important;
  844. position: absolute;
  845. color: transparent;
  846. margin-right: 4px;
  847. }
  848. .payInfoWrap {
  849. .submitBtn {
  850. // width: 121px;
  851. // height: 41px;
  852. background: var(--color-primary);
  853. border-radius: 7px;
  854. // margin: 20px auto;
  855. // line-height: 40px;
  856. color: #fff;
  857. text-align: center;
  858. cursor: pointer;
  859. }
  860. .left {
  861. /deep/.el-checkbox {
  862. padding: 8px 10px 7px 10px;
  863. border-radius: 4px;
  864. }
  865. /deep/.el-checkbox .el-checkbox__inner {
  866. border-radius: 50%;
  867. border: 1px solid var(--color-primary);
  868. width: 16px;
  869. height: 16px;
  870. &:after {
  871. height: 8px;
  872. left: 5px;
  873. }
  874. }
  875. /deep/.el-checkbox__inner:hover {
  876. background-color: var(--color-primary);
  877. }
  878. /deep/.el-checkbox.is-checked {
  879. border-color: #fff;
  880. color: #fff;
  881. }
  882. .payTitle {
  883. display: flex;
  884. flex-direction: row;
  885. align-items: center;
  886. font-size: 18px;
  887. font-weight: 600;
  888. color: #1a1a1a;
  889. height: 25px;
  890. margin-bottom: 15px;
  891. p {
  892. line-height: 25px;
  893. }
  894. .squrt {
  895. width: 4px;
  896. height: 16px;
  897. background: var(--color-primary);
  898. margin-right: 5px;
  899. position: relative;
  900. top: -1px;
  901. }
  902. }
  903. .checkWrap {
  904. display: flex;
  905. flex-direction: row;
  906. justify-content: flex-start;
  907. .checkBtn.active {
  908. background-color: var(--color-primary);
  909. color: #fff;
  910. /deep/.el-checkbox .el-checkbox__inner {
  911. border: 1px solid #fff;
  912. }
  913. }
  914. .checkBtn {
  915. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  916. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  917. transition-property: border-color, background-color;
  918. transition-duration: 0.25s, 0.25s;
  919. transition-timing-function: cubic-bezier(0.71, -0.46, 0.29, 1.46),
  920. cubic-bezier(0.71, -0.46, 0.29, 1.46);
  921. transition-delay: 0s, 0s;
  922. margin-right: 12px;
  923. padding-left: 14px;
  924. display: flex;
  925. flex-direction: row;
  926. align-items: center;
  927. cursor: pointer;
  928. background: rgba(20, 146, 138, 0.12);
  929. border-radius: 6px;
  930. height: 41px;
  931. &:hover {
  932. background-color: var(--color-primary);
  933. color: #fff;
  934. /deep/.el-checkbox__inner {
  935. background-color: var(--color-primary);
  936. border: 1px solid #fff;
  937. }
  938. }
  939. p {
  940. height: 41px;
  941. line-height: 41px;
  942. }
  943. }
  944. .checkBtn.disabled {
  945. cursor: not-allowed;
  946. color: #d9d9d9;
  947. background-color: #f2f2f2 !important;
  948. /deep/.el-checkbox__inner {
  949. background-color: #fff !important;
  950. border-color: #d9d9d9;
  951. color: #fff;
  952. &::after {
  953. border-color: #d9d9d9;
  954. }
  955. }
  956. &:hover {
  957. background-color: #f2f2f2 !important;
  958. color: #d9d9d9;
  959. /deep/.el-checkbox__inner {
  960. background-color: #fff !important;
  961. }
  962. }
  963. }
  964. }
  965. }
  966. }
  967. </style>
  968. <style lang="less" scoped>
  969. /deep/.el-dialog__body {
  970. padding: 15px 0 0;
  971. }
  972. </style>