soundSetCore.vue 26 KB

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