soundSetCore.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  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. let errorShop = []
  405. let flag = false
  406. this.activeSoundList.forEach((item) => {
  407. // 格式化教辅
  408. let markIdList = item.markList.map((mark) => {
  409. return mark.id;
  410. });
  411. let goodsIdList = item.goodsList.map(good=>{
  412. return good.id
  413. })
  414. for (let i = 0; i < item.markChioseList.length; i++) {
  415. if (!markIdList.includes(item.markChioseList[i])) {
  416. errorShop.push(item.markChioseList[i])
  417. flag = true
  418. item.markChioseList.splice(i--, 1);
  419. }
  420. }
  421. for (let i = 0; i < item.chioseMusic.length; i++) {
  422. if (!goodsIdList.includes(item.chioseMusic[i].musical)) {
  423. errorShop.push(item.chioseMusic[i].musical)
  424. flag = true
  425. item.chioseMusic[i].musical = null
  426. item.chioseMusic[i].groupPrice = null
  427. }
  428. }
  429. });
  430. if(flag){
  431. // 提示
  432. this.$message.error(`{${errorShop.join(',')}}商品已失效,请联系仓库主管`)
  433. }
  434. this.$set(this,'activeSoundList',this.activeSoundList)
  435. },
  436. checkSubmit (){
  437. let flag = true;
  438. if (this.activeSoundList.length <= 0) {
  439. this.$message.error(`请至少设置一个声部`);
  440. flag = false
  441. return;
  442. }
  443. this.activeSoundList.forEach((item) => {
  444. if (!item.expectedStudentNum) {
  445. this.$message.error(`请填写${item.sound}的预计招生人数`);
  446. flag = false;
  447. return;
  448. }
  449. if (!item.chioseMusic[0]?.musical) {
  450. this.$message.error(`请选择${item.sound}的可选乐器`);
  451. flag = false;
  452. return;
  453. }
  454. item.chioseMusic.forEach((music) => {
  455. if (music.type.indexOf("LEASE") != -1) {
  456. if (!music.borrowPrice || parseFloat(music.borrowPrice) <= 0) {
  457. this.$message.error(`请填写正确的${item.sound}租赁押金`);
  458. flag = false;
  459. }
  460. }
  461. });
  462. });
  463. return flag
  464. },
  465. submitInfo(type) {
  466. // 计划招生人数
  467. // 可选乐器
  468. // 教辅
  469. let flag = this.checkSubmit()
  470. if (!flag) return;
  471. // 新建团
  472. let obj = {};
  473. // if (this.teamStatus == "newTeam") {
  474. // this.initCreateTeam(obj);
  475. // }
  476. // 初始化声部
  477. obj.musicGroupSubjectGoodsGroups = [];
  478. obj.musicGroupSubjectPlans = [];
  479. this.activeSoundList.forEach((active) => {
  480. // 格式化声部数据
  481. let item = {
  482. expectedStudentNum: active.expectedStudentNum,
  483. subName: active.sound,
  484. subjectId: active.id,
  485. };
  486. obj.musicGroupSubjectPlans.push(item);
  487. // 格式化商品数据 chioseMusic: [{ musical: '', type: ["GROUP"], groupPrice: 0, borrowPrice: 1500 }],
  488. active.chioseMusic.forEach((music) => {
  489. let goodsItem = null;
  490. let depositFee = music.borrowPrice;
  491. let price = music.groupPrice;
  492. let groupRemissionCourseFee;
  493. if (music.type.indexOf("GROUP") != -1) {
  494. groupRemissionCourseFee = music.groupRemissionCourseFee * 1;
  495. } else {
  496. groupRemissionCourseFee = 0;
  497. }
  498. let index = findIndex(active.goodsList, (o) => {
  499. return o.id == music.musical;
  500. });
  501. if (index != -1) {
  502. goodsItem = active.goodsList[index];
  503. }
  504. let kitGroupPurchaseTypeJson = {};
  505. music.type.forEach((type) => {
  506. kitGroupPurchaseTypeJson[type] = 0;
  507. });
  508. // if (Array.isArray(music.type)) {
  509. // music.type.forEach((type) => {
  510. // kitGroupPurchaseTypeJson[type] = 0;
  511. // });
  512. // }else{
  513. // // 字符串
  514. // let arr = [ music.type]
  515. // arr.forEach((type) => {
  516. // kitGroupPurchaseTypeJson[type] = 0;
  517. // });
  518. // }
  519. kitGroupPurchaseTypeJson = JSON.stringify(kitGroupPurchaseTypeJson);
  520. if (goodsItem) {
  521. let some = {
  522. subjectId: active.id,
  523. type: "INSTRUMENT",
  524. goodsIdList: music.musical,
  525. name: goodsItem.name,
  526. kitGroupPurchaseTypeJson,
  527. depositFee,
  528. price,
  529. groupRemissionCourseFee,
  530. };
  531. obj.musicGroupSubjectGoodsGroups.push(some);
  532. }
  533. });
  534. // 格式化辅件
  535. // markChioseList: [],
  536. // goodsList: [],
  537. // markList: [],
  538. active.markChioseList.forEach((ass) => {
  539. let index = findIndex(active.markList, (o) => {
  540. return o.id == ass;
  541. });
  542. let goodsItem = null;
  543. if (index != -1) {
  544. goodsItem = active.markList[index];
  545. }
  546. if (goodsItem) {
  547. let some = {
  548. subjectId: active.id,
  549. type: "ACCESSORIES",
  550. goodsIdList: ass,
  551. name: goodsItem.name,
  552. price: goodsItem.groupPurchasePrice,
  553. };
  554. obj.musicGroupSubjectGoodsGroups.push(some);
  555. }
  556. });
  557. });
  558. if (this.teamStatus == "newTeam") {
  559. } else {
  560. obj.musicGroupId = this.teamid;
  561. if (type) {
  562. obj.musicGroupStatus = "AUDIT";
  563. } else {
  564. obj.musicGroupStatus = "DRAFT";
  565. }
  566. if (type == 2) {
  567. this.$confirm("是否提交审核?", "提示", {
  568. confirmButtonText: "确定",
  569. cancelButtonText: "取消",
  570. type: "warning",
  571. })
  572. .then(() => {
  573. updateSubjectInfo(obj).then((res) => {
  574. if (res.code == 200) {
  575. this.$message.success("提交成功");
  576. this.$store.dispatch("delVisitedViews", this.$route);
  577. this.$router.push({
  578. path: "/teamList",
  579. });
  580. }
  581. });
  582. })
  583. .catch(() => {});
  584. } else {
  585. updateSubjectInfo(obj).then((res) => {
  586. if (res.code == 200) {
  587. this.setStore();
  588. if (type == 1) {
  589. this.$message.success("已提交审核");
  590. let query = this.$route.query;
  591. this.$store.dispatch("delVisitedViews", this.$route);
  592. this.$router.push({
  593. path: "/teamList",
  594. query: {
  595. ...query,
  596. },
  597. });
  598. } else {
  599. this.$message.success("保存成功");
  600. }
  601. // this.$emit("chiosetab", 2);
  602. // 创建乐团,只会到声部了
  603. }
  604. });
  605. }
  606. }
  607. },
  608. deleteRow() {
  609. if (this.checkList.length < 1) {
  610. this.$message.error("请至少勾选一个");
  611. return;
  612. }
  613. this.$confirm("确定删除选中声部?", "提示", {
  614. confirmButtonText: "确定",
  615. cancelButtonText: "取消",
  616. type: "warning",
  617. })
  618. .then(() => {
  619. for (let i = 0; i < this.activeSoundList.length; i++) {
  620. let index = this.checkList.indexOf(this.activeSoundList[i].id);
  621. if (index != -1) {
  622. this.activeSoundList.splice(i, 1);
  623. this.activeSound.splice(i, 1);
  624. i--;
  625. }
  626. }
  627. this.checkList = [];
  628. this.$message.success("删除成功");
  629. })
  630. .catch(() => {});
  631. },
  632. allin() {
  633. this.checkList = [];
  634. this.activeSoundList.forEach((item, index) => {
  635. this.checkList.push(item.id);
  636. });
  637. },
  638. // initCreateTeam(obj) {
  639. // let enrollClasses;
  640. // this.topfor.startClass
  641. // ? (enrollClasses = this.topfor.startClass.join(","))
  642. // : (enrollClasses = null);
  643. // obj.musicGroup = {
  644. // settlementType: this.topfor.salary,
  645. // applyExpireDate: dayjs(this.topfor.time).format("YYYY-MM-DD HH:mm:ss"),
  646. // chargeTypeId: this.topfor.type,
  647. // cooperationOrganId: this.topfor.school,
  648. // courseViewType: this.topfor.courseViewType,
  649. // teamTeacherId: this.topfor.boss,
  650. // educationalTeacherId: this.topfor.teacher,
  651. // enrollClasses,
  652. // name: this.topfor.name,
  653. // organId: this.topfor.section,
  654. // paymentPattern: this.topfor.paymentPattern,
  655. // paymentValidStartDate: this.topfor.paymentValidStartDate
  656. // ? dayjs(this.topfor.paymentValidStartDate).format("YYYY-MM-DD")
  657. // : this.topfor.paymentValidStartDate,
  658. // paymentValidEndDate: this.topfor.paymentValidEndDate
  659. // ? dayjs(this.topfor.paymentValidEndDate).format("YYYY-MM-DD")
  660. // : this.topfor.paymentValidEndDate,
  661. // // paymentMonths:obj.months 有待确认
  662. // schoolId: this.topfor.address,
  663. // expectStartGroupDate: this.topfor.startTime,
  664. // isClassroomLessons: this.topfor.isClass,
  665. // status: "DRAFT",
  666. // ownershipType: this.topfor.ownershipType,
  667. // repairUserId: this.topfor.repairUserId,
  668. // feeType: this.topfor.feeType,
  669. // directorUserId: this.topfor.head,
  670. // };
  671. // return obj;
  672. // },
  673. getScroll() {
  674. this.scrollTop =
  675. window.pageYOffset ||
  676. document.documentElement.scrollTop ||
  677. document.body.scrollTop;
  678. if (!!this.scrollTop && this.scrollTop >= 210) {
  679. this.isField = false;
  680. } else {
  681. this.isField = true;
  682. }
  683. },
  684. },
  685. watch: {
  686. activeSoundList: {
  687. immediate: true,
  688. deep: true,
  689. handler(n) {
  690. let chioseSoundNum = 0;
  691. let PlannedCount = 0;
  692. let activeSoundList = this.activeSoundList;
  693. if (n) {
  694. let Count = 0;
  695. if (n.length > 0) {
  696. for (let item in n) {
  697. Count += parseInt(n[item]?.expectedStudentNum) || 0;
  698. }
  699. }
  700. chioseSoundNum = n.length;
  701. PlannedCount = Count;
  702. this.$emit("getNumber", chioseSoundNum, PlannedCount);
  703. }
  704. },
  705. },
  706. },
  707. };
  708. </script>
  709. <style lang="scss" scoped>
  710. .wall {
  711. height: 60px;
  712. margin-bottom: 20px;
  713. }
  714. .soundBtnWrap {
  715. width: 100%;
  716. position: absolute;
  717. background-color: #fff;
  718. z-index: 100;
  719. padding: 20px;
  720. }
  721. .soundBtnFixed {
  722. top: 125px;
  723. left: 240px; // 205
  724. width: 100%;
  725. position: fixed;
  726. background-color: #fff;
  727. z-index: 100;
  728. padding: 20px;
  729. }
  730. /deep/.el-collapse-item__header {
  731. background-color: #edeef0;
  732. }
  733. .coreItemTitle {
  734. background-color: #edeef0;
  735. height: 46px;
  736. line-height: 46px;
  737. padding: 0 20px;
  738. }
  739. .coreItem {
  740. padding: 25px 0 0;
  741. }
  742. .coreItemRow {
  743. padding: 0 20px;
  744. // line-height: 50px;
  745. display: flex;
  746. flex-direction: row;
  747. align-items: center;
  748. p {
  749. margin-right: 10px;
  750. }
  751. .title {
  752. width: 140px;
  753. text-align: right;
  754. }
  755. }
  756. .marginLeft10 {
  757. margin-left: 10px;
  758. }
  759. /deep/.el-collapse-item__header {
  760. border-bottom: 1px solid #fff;
  761. }
  762. </style>