payInfoDetail.vue 36 KB

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