soundSetCore.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  1. <template>
  2. <div>
  3. <div
  4. :class="isField ? 'soundBtnWrap' : 'soundBtnFixed'"
  5. v-if="!basdisabled"
  6. >
  7. <el-button
  8. type="primary"
  9. @click="allin"
  10. v-if="teamStatus != 'resetTeam' && !basdisabled"
  11. >全选</el-button
  12. >
  13. <el-button
  14. type="danger"
  15. @click="deleteRow"
  16. v-if="teamStatus != 'resetTeam' && !basdisabled"
  17. >删除</el-button
  18. >
  19. <el-button type="primary" @click="soundVisible = true" v-if="!basdisabled"
  20. >添加</el-button
  21. >
  22. </div>
  23. <div class="wall" v-if="!basdisabled"></div>
  24. <div class="coreWrap">
  25. <el-checkbox-group v-model="checkList" @change="lookCheck">
  26. <el-collapse v-model="chioseActiveSound">
  27. <el-collapse-item
  28. v-for="(item, index) in activeSoundList"
  29. :name="item.id"
  30. :key="index"
  31. >
  32. <template slot="title">
  33. <div class="coreItemTitle">
  34. <el-checkbox :label="item.id" :disabled="basdisabled">{{
  35. item.sound
  36. }}</el-checkbox>
  37. </div>
  38. </template>
  39. <div class="coreItem">
  40. <div class="coreItemRow">
  41. <p class="title">计划招生人数:</p>
  42. <el-input
  43. :disabled="basdisabled"
  44. style="width: 180px"
  45. v-model="item.expectedStudentNum"
  46. ></el-input>
  47. </div>
  48. </div>
  49. <el-divider></el-divider>
  50. <chioseMusic
  51. :activeSoundList="activeSoundList"
  52. :item="item"
  53. @lookMusic="lookMusic"
  54. :basdisabled="basdisabled"
  55. />
  56. <div class="coreItemRow">
  57. <p class="title">教辅:</p>
  58. <select-all
  59. style="width: 558px !important"
  60. v-model="item.markChioseList"
  61. :disabled="basdisabled"
  62. clearable
  63. filterable
  64. multiple
  65. >
  66. <el-option
  67. v-for="(item, index) in item.markList"
  68. :key="index"
  69. :label="item.name"
  70. :value="item.id"
  71. >
  72. <span style="float: left">{{ item.name }}</span>
  73. <span
  74. style="
  75. float: right;
  76. color: #8492a6;
  77. font-size: 13px;
  78. padding-right: 20px;
  79. "
  80. >{{ item.groupPurchasePrice | moneyFormat }}元</span
  81. >
  82. </el-option>
  83. </select-all>
  84. </div>
  85. </el-collapse-item>
  86. </el-collapse>
  87. </el-checkbox-group>
  88. </div>
  89. <el-dialog
  90. title="声部选择"
  91. :visible.sync="soundVisible"
  92. v-if="soundVisible"
  93. >
  94. <chioseSoundList
  95. :soundList="soundList"
  96. :activeSound="activeSound"
  97. @chioseSound="chioseSound"
  98. />
  99. </el-dialog>
  100. </div>
  101. </template>
  102. <script>
  103. import store from "@/store";
  104. import { formatData } from "@/utils/utils";
  105. import {
  106. getSubject,
  107. getDefaultSubject,
  108. getSoundTree,
  109. findMusicGroupSubjectInfo,
  110. updateSubjectInfo,
  111. getSubjectGoods,
  112. } from "@/api/buildTeam";
  113. import dayjs from "dayjs";
  114. import chioseSoundList from "./chioseSoundList";
  115. import chioseMusic from "./chioseMusic";
  116. import { findIndex } from "lodash";
  117. import numeral from "numeral";
  118. export default {
  119. components: { chioseSoundList, chioseMusic },
  120. data() {
  121. return {
  122. soundList: [], // 接口返回的一级二级声部
  123. soundVisible: false, // 设置声部弹窗
  124. childSoundList: [],
  125. activeSoundList: [], //列表上的声部
  126. activeSound: null, // 展开的列表
  127. chioseActiveSound: [],
  128. soundList: [], // 接口返回的一级二级声部
  129. childSoundList: [],
  130. teamStatus: "", // 乐团状态
  131. checkList: [],
  132. basdisabled: false,
  133. teamid: "",
  134. isField: true,
  135. };
  136. },
  137. mounted() {
  138. if (this.$route.query.id) {
  139. this.teamid = this.$route.query.id;
  140. }
  141. window.addEventListener("scroll", this.getScroll);
  142. this.$nextTick((res) => {
  143. this.init();
  144. });
  145. },
  146. deactivated() {
  147. window.removeEventListener("scroll", this.getScroll);
  148. },
  149. beforeDestroy() {
  150. this.setStore();
  151. window.removeEventListener("scroll", this.getScroll);
  152. },
  153. activated() {
  154. if (
  155. (this.teamid && this.teamid != this.$route.query.id) ||
  156. this.teamStatus != this.$route.query.type
  157. ) {
  158. this.init();
  159. } else {
  160. if (!this.teamid && this.activeSoundList.length < 1) {
  161. this.init();
  162. }
  163. }
  164. this.teamStatus = this.$route.query.type;
  165. if (
  166. this.teamStatus == "look" ||
  167. this.teamStatus == "teamAudit" ||
  168. this.teamStatus == "feeAudit" ||
  169. this.teamStatus == "teamCanceled"
  170. ) {
  171. this.basdisabled = true;
  172. } else {
  173. this.basdisabled = false;
  174. }
  175. },
  176. deactivated() {
  177. this.activeSoundList = [];
  178. },
  179. methods: {
  180. setStore() {
  181. localStorage.setItem(
  182. `${this.teamid}sound`,
  183. JSON.stringify(this.activeSoundList)
  184. );
  185. },
  186. async init() {
  187. // 获取第一页的数据
  188. // this.topfor = this.$store.getters.topinfo;
  189. // let type = this.topfor.type;
  190. // let section = this.topfor.section;
  191. this.topfor =
  192. JSON.parse(localStorage.getItem(`${this.$route.query.id}base`)) ||
  193. this.$store.getters.topinfo;
  194. this.teamStatus = this.$route.query.type;
  195. if (
  196. this.teamStatus == "look" ||
  197. this.teamStatus == "teamAudit" ||
  198. this.teamStatus == "feeAudit" ||
  199. this.teamStatus == "teamCanceled"
  200. ) {
  201. this.basdisabled = true;
  202. } else {
  203. this.basdisabled = false;
  204. }
  205. let sotrage = JSON.parse(
  206. localStorage.getItem(`${this.$route.query.id}sound`)
  207. );
  208. getSoundTree({ tenantId: 1 }).then(async (res) => {
  209. if (res.code == 200) {
  210. this.soundList = res.data.rows;
  211. if (sotrage && sotrage[0]?.id) {
  212. // this.$set(data,'activeSoundList',sotrage)
  213. this.activeSoundList = sotrage;
  214. let activeSound = [];
  215. this.activeSoundList.forEach((item) => {
  216. activeSound.push(item.id);
  217. });
  218. this.chioseActiveSound = activeSound;
  219. this.activeSound = activeSound;
  220. await this.changeActiveSound(activeSound.join(","));
  221. } else {
  222. if (this.teamStatus == "newTeam") {
  223. this.getDefaultSubject();
  224. } else {
  225. this.teamid = this.$route.query.id;
  226. if (this.teamid) {
  227. findMusicGroupSubjectInfo({ musicGroupId: this.teamid }).then(
  228. async (res) => {
  229. if (res.code == 200) {
  230. // 如果没有一个声部 则请求默认声部
  231. if (res.data?.musicGroupSubjectPlans?.length > 0) {
  232. let activeSound = [];
  233. this.activeSoundList =
  234. res.data?.musicGroupSubjectPlans.map((item) => {
  235. activeSound.push(item.subjectId);
  236. return {
  237. id: parseInt(item.subjectId),
  238. sound: item.subName,
  239. expectedStudentNum: item.expectedStudentNum,
  240. chioseMusic: [],
  241. markChioseList: [],
  242. goodsList: [],
  243. markList: [],
  244. };
  245. });
  246. this.activeSound = activeSound;
  247. this.chioseActiveSound = activeSound;
  248. // 格式化商品和教辅
  249. res.data.musicGroupSubjectGoodsGroups.forEach(
  250. (shop) => {
  251. let index = findIndex(this.activeSoundList, (o) => {
  252. return o.id == shop.subjectId;
  253. });
  254. if (index != -1) {
  255. if (shop.type == "ACCESSORIES") {
  256. shop.goodsIdList.split(",").forEach((item) => {
  257. this.activeSoundList[
  258. index
  259. ].markChioseList.push(parseInt(item));
  260. });
  261. } else if (shop.type == "INSTRUMENT") {
  262. // 商品
  263. let typeJson = Object.keys(
  264. JSON.parse(shop.kitGroupPurchaseTypeJson)
  265. );
  266. this.activeSoundList[index].chioseMusic.push({
  267. musical: parseInt(shop.goodsIdList),
  268. type: typeJson,
  269. groupPrice: shop.price,
  270. borrowPrice: shop.depositFee,
  271. groupRemissionCourseFee: Boolean(
  272. shop.groupRemissionCourseFee
  273. ),
  274. });
  275. }
  276. }
  277. }
  278. );
  279. await this.changeActiveSound(activeSound.join(","));
  280. } else {
  281. this.getDefaultSubject();
  282. }
  283. // 这里开始
  284. }
  285. }
  286. );
  287. }
  288. }
  289. }
  290. }
  291. });
  292. getSubject({ tenantId: 1 }).then((res) => {
  293. if (res.code == 200) {
  294. this.childSoundList = res.data;
  295. }
  296. });
  297. },
  298. getDefaultSubject() {
  299. let type = this.topfor.type;
  300. let section = this.topfor.section;
  301. getDefaultSubject({
  302. chargeTypeId: type,
  303. organId: section,
  304. number: 1,
  305. }).then(async (res) => {
  306. if (res.code == 200) {
  307. let activeSound = [];
  308. this.activeSoundList = res.data.map((item) => {
  309. activeSound.push(item.id);
  310. return this.initSound(item);
  311. });
  312. this.activeSound = activeSound;
  313. this.chioseActiveSound = activeSound;
  314. await this.changeActiveSound(activeSound.join(","));
  315. }
  316. });
  317. },
  318. lookCheck(val) {
  319. this.checkList = [...new Set(val)];
  320. },
  321. async chioseSound(activeSound) {
  322. // 同步数据
  323. this.activeSound = [...new Set(activeSound)];
  324. let newSoundList = [];
  325. for (let i in this.childSoundList) {
  326. if (this.activeSound.includes(this.childSoundList[i].id)) {
  327. newSoundList.push(this.initSound(this.childSoundList[i]));
  328. }
  329. }
  330. let idList = this.activeSoundList.map((item) => {
  331. return item.id;
  332. });
  333. for (let x in newSoundList) {
  334. const indexof = idList.indexOf(newSoundList[x]?.id);
  335. if (indexof > -1) {
  336. newSoundList[x] = this.activeSoundList[indexof];
  337. }
  338. }
  339. this.activeSoundList = newSoundList;
  340. let newActiveSound = [];
  341. this.activeSoundList.forEach((item) => {
  342. newActiveSound.push(item.id);
  343. });
  344. this.activeSound = newActiveSound;
  345. this.chioseActiveSound = newActiveSound;
  346. await this.changeActiveSound(newActiveSound.join(","));
  347. this.soundVisible = false;
  348. },
  349. initSound(item) {
  350. let obj = {
  351. id: item.id,
  352. sound: item.name,
  353. expectedStudentNum: item.expectedStudentNum,
  354. chioseMusic: [
  355. {
  356. musical: "",
  357. type: ["GROUP"],
  358. groupPrice: 0,
  359. borrowPrice: 1500,
  360. groupRemissionCourseFee: Boolean(item.groupRemissionCourseFee),
  361. },
  362. ],
  363. markChioseList: [],
  364. goodsList: [],
  365. markList: [],
  366. };
  367. return obj;
  368. },
  369. async changeActiveSound(val) {
  370. // 写入声部商品和辅件
  371. return getSubjectGoods({
  372. subjectIds: val,
  373. chargeTypeId: this.topfor.type,
  374. musicGroupId: this.teamid,
  375. courseViewType: this.topfor.courseViewType,
  376. }).then((res) => {
  377. if (res.code == 200) {
  378. if (res.data) {
  379. let keys = Object.keys(res.data);
  380. console.log("activeSoundList", this.activeSoundList);
  381. this.activeSoundList.forEach((item) => {
  382. if (keys.indexOf(item.id + "") != -1) {
  383. let goodList = [];
  384. let markList = [];
  385. res.data[item.id].forEach((shop) => {
  386. if (shop.type == "INSTRUMENT") {
  387. goodList.push(shop);
  388. } else if (shop.type == "ACCESSORIES") {
  389. markList.push(shop);
  390. }
  391. });
  392. item.goodsList = goodList;
  393. item.markList = markList;
  394. }
  395. });
  396. this.checkShopAndMark()
  397. }
  398. }
  399. });
  400. },
  401. lookMusic() {},
  402. checkShopAndMark() {
  403. let loadash = this.$helpers.lodash;
  404. this.activeSoundList.forEach((item) => {
  405. // 格式化教辅
  406. let markIdList = item.markList.map((mark) => {
  407. return mark.id;
  408. });
  409. let goodsIdList = item.goodsList.map(good=>{
  410. return good.id
  411. })
  412. for (let i = 0; i < item.markChioseList.length; i++) {
  413. if (!markIdList.includes(item.markChioseList[i])) {
  414. item.markChioseList.splice(i--, 1);
  415. }
  416. }
  417. for (let i = 0; i < item.chioseMusic.length; i++) {
  418. if (!goodsIdList.includes(item.chioseMusic[i].musical)) {
  419. item.chioseMusic.splice(i--, 1);
  420. }
  421. }
  422. // item.markChioseList.forEach((markChiose, index) => {
  423. // console.log(markChiose);
  424. // if (!markIdList.includes(markChiose)) {
  425. // item.markChioseList.splice(index--, 1);
  426. // }
  427. // });
  428. // if (item.markList.length > 0) {
  429. // item.markList.find((mark) => {
  430. // if (!item.markChioseList.includes(mark.id)) {
  431. // // 不包含就要删除就删除这一项
  432. // let loadash = this.$helper.loadash;
  433. // loadash.pull(item.markChioseList, mark.id);
  434. // }
  435. // });
  436. // }else{
  437. // item.markChioseList = []
  438. // }
  439. });
  440. },
  441. checkSubmit (){
  442. let flag = true;
  443. if (this.activeSoundList.length <= 0) {
  444. this.$message.error(`请至少设置一个声部`);
  445. flag = false
  446. return;
  447. }
  448. this.activeSoundList.forEach((item) => {
  449. if (!item.expectedStudentNum) {
  450. this.$message.error(`请填写${item.sound}的预计招生人数`);
  451. flag = false;
  452. return;
  453. }
  454. if (!item.chioseMusic[0]?.musical) {
  455. this.$message.error(`请选择${item.sound}的可选乐器`);
  456. flag = false;
  457. return;
  458. }
  459. item.chioseMusic.forEach((music) => {
  460. if (music.type.indexOf("LEASE") != -1) {
  461. if (!music.borrowPrice || parseFloat(music.borrowPrice) <= 0) {
  462. this.$message.error(`请填写正确的${item.sound}租赁押金`);
  463. flag = false;
  464. }
  465. }
  466. });
  467. });
  468. return flag
  469. },
  470. submitInfo(type) {
  471. // 计划招生人数
  472. // 可选乐器
  473. // 教辅
  474. let flag = this.checkSubmit()
  475. if (!flag) return;
  476. // 新建团
  477. let obj = {};
  478. // if (this.teamStatus == "newTeam") {
  479. // this.initCreateTeam(obj);
  480. // }
  481. // 初始化声部
  482. obj.musicGroupSubjectGoodsGroups = [];
  483. obj.musicGroupSubjectPlans = [];
  484. this.activeSoundList.forEach((active) => {
  485. // 格式化声部数据
  486. let item = {
  487. expectedStudentNum: active.expectedStudentNum,
  488. subName: active.sound,
  489. subjectId: active.id,
  490. };
  491. obj.musicGroupSubjectPlans.push(item);
  492. // 格式化商品数据 chioseMusic: [{ musical: '', type: ["GROUP"], groupPrice: 0, borrowPrice: 1500 }],
  493. active.chioseMusic.forEach((music) => {
  494. let goodsItem = null;
  495. let depositFee = music.borrowPrice;
  496. let price = music.groupPrice;
  497. let groupRemissionCourseFee;
  498. if (music.type.indexOf("GROUP") != -1) {
  499. groupRemissionCourseFee = music.groupRemissionCourseFee * 1;
  500. } else {
  501. groupRemissionCourseFee = 0;
  502. }
  503. let index = findIndex(active.goodsList, (o) => {
  504. return o.id == music.musical;
  505. });
  506. if (index != -1) {
  507. goodsItem = active.goodsList[index];
  508. }
  509. let kitGroupPurchaseTypeJson = {};
  510. music.type.forEach((type) => {
  511. kitGroupPurchaseTypeJson[type] = 0;
  512. });
  513. // if (Array.isArray(music.type)) {
  514. // music.type.forEach((type) => {
  515. // kitGroupPurchaseTypeJson[type] = 0;
  516. // });
  517. // }else{
  518. // // 字符串
  519. // let arr = [ music.type]
  520. // arr.forEach((type) => {
  521. // kitGroupPurchaseTypeJson[type] = 0;
  522. // });
  523. // }
  524. kitGroupPurchaseTypeJson = JSON.stringify(kitGroupPurchaseTypeJson);
  525. if (goodsItem) {
  526. let some = {
  527. subjectId: active.id,
  528. type: "INSTRUMENT",
  529. goodsIdList: music.musical,
  530. name: goodsItem.name,
  531. kitGroupPurchaseTypeJson,
  532. depositFee,
  533. price,
  534. groupRemissionCourseFee,
  535. };
  536. obj.musicGroupSubjectGoodsGroups.push(some);
  537. }
  538. });
  539. // 格式化辅件
  540. // markChioseList: [],
  541. // goodsList: [],
  542. // markList: [],
  543. active.markChioseList.forEach((ass) => {
  544. let index = findIndex(active.markList, (o) => {
  545. return o.id == ass;
  546. });
  547. let goodsItem = null;
  548. if (index != -1) {
  549. goodsItem = active.markList[index];
  550. }
  551. if (goodsItem) {
  552. let some = {
  553. subjectId: active.id,
  554. type: "ACCESSORIES",
  555. goodsIdList: ass,
  556. name: goodsItem.name,
  557. price: goodsItem.groupPurchasePrice,
  558. };
  559. obj.musicGroupSubjectGoodsGroups.push(some);
  560. }
  561. });
  562. });
  563. if (this.teamStatus == "newTeam") {
  564. } else {
  565. obj.musicGroupId = this.teamid;
  566. if (type) {
  567. obj.musicGroupStatus = "AUDIT";
  568. } else {
  569. obj.musicGroupStatus = "DRAFT";
  570. }
  571. if (type == 2) {
  572. this.$confirm("是否提交审核?", "提示", {
  573. confirmButtonText: "确定",
  574. cancelButtonText: "取消",
  575. type: "warning",
  576. })
  577. .then(() => {
  578. updateSubjectInfo(obj).then((res) => {
  579. if (res.code == 200) {
  580. this.$message.success("提交成功");
  581. this.$store.dispatch("delVisitedViews", this.$route);
  582. this.$router.push({
  583. path: "/teamList",
  584. });
  585. }
  586. });
  587. })
  588. .catch(() => {});
  589. } else {
  590. updateSubjectInfo(obj).then((res) => {
  591. if (res.code == 200) {
  592. this.setStore();
  593. if (type == 1) {
  594. this.$message.success("已提交审核");
  595. let query = this.$route.query;
  596. this.$store.dispatch("delVisitedViews", this.$route);
  597. this.$router.push({
  598. path: "/teamList",
  599. query: {
  600. ...query,
  601. },
  602. });
  603. } else {
  604. this.$message.success("保存成功");
  605. }
  606. // this.$emit("chiosetab", 2);
  607. // 创建乐团,只会到声部了
  608. }
  609. });
  610. }
  611. }
  612. },
  613. deleteRow() {
  614. if (this.checkList.length < 1) {
  615. this.$message.error("请至少勾选一个");
  616. return;
  617. }
  618. this.$confirm("确定删除选中声部?", "提示", {
  619. confirmButtonText: "确定",
  620. cancelButtonText: "取消",
  621. type: "warning",
  622. })
  623. .then(() => {
  624. for (let i = 0; i < this.activeSoundList.length; i++) {
  625. let index = this.checkList.indexOf(this.activeSoundList[i].id);
  626. if (index != -1) {
  627. this.activeSoundList.splice(i, 1);
  628. this.activeSound.splice(i, 1);
  629. i--;
  630. }
  631. }
  632. this.checkList = [];
  633. this.$message.success("删除成功");
  634. })
  635. .catch(() => {});
  636. },
  637. allin() {
  638. this.checkList = [];
  639. this.activeSoundList.forEach((item, index) => {
  640. this.checkList.push(item.id);
  641. });
  642. },
  643. // initCreateTeam(obj) {
  644. // let enrollClasses;
  645. // this.topfor.startClass
  646. // ? (enrollClasses = this.topfor.startClass.join(","))
  647. // : (enrollClasses = null);
  648. // obj.musicGroup = {
  649. // settlementType: this.topfor.salary,
  650. // applyExpireDate: dayjs(this.topfor.time).format("YYYY-MM-DD HH:mm:ss"),
  651. // chargeTypeId: this.topfor.type,
  652. // cooperationOrganId: this.topfor.school,
  653. // courseViewType: this.topfor.courseViewType,
  654. // teamTeacherId: this.topfor.boss,
  655. // educationalTeacherId: this.topfor.teacher,
  656. // enrollClasses,
  657. // name: this.topfor.name,
  658. // organId: this.topfor.section,
  659. // paymentPattern: this.topfor.paymentPattern,
  660. // paymentValidStartDate: this.topfor.paymentValidStartDate
  661. // ? dayjs(this.topfor.paymentValidStartDate).format("YYYY-MM-DD")
  662. // : this.topfor.paymentValidStartDate,
  663. // paymentValidEndDate: this.topfor.paymentValidEndDate
  664. // ? dayjs(this.topfor.paymentValidEndDate).format("YYYY-MM-DD")
  665. // : this.topfor.paymentValidEndDate,
  666. // // paymentMonths:obj.months 有待确认
  667. // schoolId: this.topfor.address,
  668. // expectStartGroupDate: this.topfor.startTime,
  669. // isClassroomLessons: this.topfor.isClass,
  670. // status: "DRAFT",
  671. // ownershipType: this.topfor.ownershipType,
  672. // repairUserId: this.topfor.repairUserId,
  673. // feeType: this.topfor.feeType,
  674. // directorUserId: this.topfor.head,
  675. // };
  676. // return obj;
  677. // },
  678. getScroll() {
  679. this.scrollTop =
  680. window.pageYOffset ||
  681. document.documentElement.scrollTop ||
  682. document.body.scrollTop;
  683. if (!!this.scrollTop && this.scrollTop >= 210) {
  684. this.isField = false;
  685. } else {
  686. this.isField = true;
  687. }
  688. },
  689. },
  690. watch: {
  691. activeSoundList: {
  692. immediate: true,
  693. deep: true,
  694. handler(n) {
  695. let chioseSoundNum = 0;
  696. let PlannedCount = 0;
  697. let activeSoundList = this.activeSoundList;
  698. if (n) {
  699. let Count = 0;
  700. if (n.length > 0) {
  701. for (let item in n) {
  702. Count += parseInt(n[item]?.expectedStudentNum) || 0;
  703. }
  704. }
  705. chioseSoundNum = n.length;
  706. PlannedCount = Count;
  707. this.$emit("getNumber", chioseSoundNum, PlannedCount);
  708. }
  709. },
  710. },
  711. },
  712. };
  713. </script>
  714. <style lang="scss" scoped>
  715. .wall {
  716. height: 60px;
  717. margin-bottom: 20px;
  718. }
  719. .soundBtnWrap {
  720. width: 100%;
  721. position: absolute;
  722. background-color: #fff;
  723. z-index: 100;
  724. padding: 20px;
  725. }
  726. .soundBtnFixed {
  727. top: 125px;
  728. left: 240px; // 205
  729. width: 100%;
  730. position: fixed;
  731. background-color: #fff;
  732. z-index: 100;
  733. padding: 20px;
  734. }
  735. /deep/.el-collapse-item__header {
  736. background-color: #edeef0;
  737. }
  738. .coreItemTitle {
  739. background-color: #edeef0;
  740. height: 46px;
  741. line-height: 46px;
  742. padding: 0 20px;
  743. }
  744. .coreItem {
  745. padding: 25px 0 0;
  746. }
  747. .coreItemRow {
  748. padding: 0 20px;
  749. // line-height: 50px;
  750. display: flex;
  751. flex-direction: row;
  752. align-items: center;
  753. p {
  754. margin-right: 10px;
  755. }
  756. .title {
  757. width: 140px;
  758. text-align: right;
  759. }
  760. }
  761. .marginLeft10 {
  762. margin-left: 10px;
  763. }
  764. /deep/.el-collapse-item__header {
  765. border-bottom: 1px solid #fff;
  766. }
  767. </style>