payInfoDetail.vue 35 KB

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