teamSoundMoney.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930
  1. <template>
  2. <div class='sound-container'>
  3. <div class="topMsg">
  4. <p>当前选择声部数(个):{{chioseSoundNum}}</p>
  5. <p style='margin-left:30px;'>计划招生人数(个):{{PlannedCount}}</p>
  6. </div>
  7. <div class="listWrap">
  8. <el-table :data='activeSoundList'
  9. ref="multipleTable"
  10. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  11. highlight-current-row
  12. @selection-change='handleSelectionChange'
  13. @row-click='handleclick'>
  14. <el-table-column type="selection"
  15. width="55">
  16. </el-table-column>
  17. <el-table-column label="声部"
  18. align="center"
  19. width="80"
  20. prop="sound">
  21. </el-table-column>
  22. <el-table-column label="计划招生"
  23. align="center"
  24. width="100"
  25. prop="jihua">
  26. <template slot-scope="scope"
  27. width="100">
  28. <div>
  29. <el-input v-if='scope.row.type == 1'
  30. type='number'
  31. style="width:80px"
  32. size='mini'
  33. v-model="scope.row.jihua"
  34. placeholder="请输入"></el-input>
  35. <!-- <p v-if='scope.row.type == 2'>{{scope.row.jihua}}</p> -->
  36. </div>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="预计收费"
  40. width="100"
  41. align="center"
  42. prop="yuji">
  43. <template slot-scope="scope">
  44. <div>
  45. <el-input v-if='scope.row.type == 1'
  46. type='number'
  47. style="width:80px"
  48. size='mini'
  49. v-model="scope.row.yuji"
  50. placeholder="请输入"></el-input>
  51. <!-- <p v-if='scope.row.type == 2'>{{scope.row.yuji}}</p> -->
  52. </div>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="可选乐器规格"
  56. align="center"
  57. prop="zhonglei"
  58. width="300">
  59. <template slot-scope="scope">
  60. <!-- 'typeVisible':false,'provideVisible':false,'markVisible':false -->
  61. <div>
  62. <span>{{scope.row.zhonglei | zhongleiFilter(scope.row.goodsList)}}</span>
  63. <el-popover placement="bottom"
  64. @show='chioseType(scope.row)'
  65. v-model="scope.row.typeVisible"
  66. v-if='scope.row.type == 1'>
  67. <el-button type="text"
  68. slot='reference'>
  69. 修改
  70. </el-button>
  71. <!-- zhonglei -->
  72. <el-select v-model="scope.row.zhonglei"
  73. multiple
  74. clearable
  75. collapse-tags>
  76. <el-option v-for="(item,index) in scope.row.goodsList"
  77. :key='index'
  78. :label="item.name"
  79. :value="item.id"></el-option>
  80. </el-select>
  81. <div style="text-align: right; margin-top: 20px">
  82. <!-- <el-button size="mini"
  83. type="text"
  84. @click="closechioseType(scope.row)">取消</el-button> -->
  85. <el-button type="primary"
  86. size="mini"
  87. @click="scope.row.typeVisible = false">确定</el-button>
  88. </div>
  89. </el-popover>
  90. </div>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="乐器提供方式"
  94. align="center"
  95. prop="fangshi"
  96. width="180">
  97. <template slot-scope="scope">
  98. <div>
  99. <!-- <div class="chiose"
  100. >选择</div> -->
  101. <span v-if="scope.row.fangshi">{{scope.row.fangshi | fangshiFilter(scope.row.fangshiprice)}}</span>
  102. <el-popover placement="bottom"
  103. v-model="scope.row.provideVisible"
  104. v-if='scope.row.type == 1'>
  105. <i class='el-icon-edit'
  106. slot='reference'>
  107. </i>
  108. <el-select v-model="scope.row.fangshi"
  109. clearable>
  110. <el-option label="团购"
  111. value="GROUP"></el-option>
  112. <el-option label="借用"
  113. value="LEASE"></el-option>
  114. <el-option label="免费"
  115. value="FREE"></el-option>
  116. </el-select>
  117. <el-input placeholder="请输入费用"
  118. v-if='scope.row.fangshi == "LEASE"'
  119. v-model="scope.row.fangshiprice"
  120. style='width:180px; margin-top:20px'></el-input>
  121. <div style="text-align: right; margin-top: 20px">
  122. <!-- <el-button size="mini"
  123. type="text"
  124. @click="scope.row.provideVisible = false">取消</el-button> -->
  125. <el-button type="primary"
  126. size="mini"
  127. @click="scope.row.provideVisible = false">确定</el-button>
  128. </div>
  129. </el-popover>
  130. </div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="教辅组合"
  134. align="center"
  135. prop="jiaopu">
  136. <template slot-scope="scope">
  137. <div>
  138. <el-dialog :visible.sync="scope.row.markVisible"
  139. style="text-align:left;"
  140. width="60%">
  141. <el-button type='text'
  142. @click="addMark(scope.row)">添加教辅</el-button>
  143. <div class="markWrap">
  144. <div class="markItem"
  145. v-for="(item, index) in scope.row.markList"
  146. :key='index'>
  147. <el-form :model="item"
  148. :inline="true">
  149. <el-form-item label="教辅名称">
  150. <el-input type="text"
  151. v-model="item.name"></el-input>
  152. </el-form-item>
  153. <el-form-item label="教辅商品">
  154. <el-select v-model="item.goods"
  155. multiple
  156. collapse-tags>
  157. <el-option v-for='(item,index) in scope.row.markChioseList'
  158. :key='index'
  159. :label="item.name"
  160. :value="item.id"></el-option>
  161. </el-select>
  162. </el-form-item>
  163. <el-form-item label="教辅打包价">
  164. <el-input type='number'
  165. v-model="item.price"></el-input>
  166. </el-form-item>
  167. <el-form-item>
  168. <el-button type="danger"
  169. icon="el-icon-delete"
  170. circle
  171. @click='removeMartItem(scope.row,index)'>
  172. </el-button>
  173. </el-form-item>
  174. </el-form>
  175. </div>
  176. </div>
  177. <span slot="footer"
  178. class="dialog-footer">
  179. <!-- <el-button @click="scope.row.markVisible = false">取 消</el-button> -->
  180. <el-button type="primary"
  181. @click="scope.row.markVisible = false">确 定</el-button>
  182. </span>
  183. </el-dialog>
  184. <span>
  185. <span v-for='(item,index) in scope.row.markList'
  186. v-if="item.name && scope.row.markChioseList.length>0"
  187. :key='index'>{{item.name+':'}}{{item.goods|goodsFilter(scope.row.markChioseList)}}{{' 价格 '+item.price }} </span>
  188. </span>
  189. <i class='el-icon-edit'
  190. slot='reference'
  191. @click="chioseMark(scope.row)">
  192. </i>
  193. </div>
  194. </template>
  195. </el-table-column>
  196. <!-- <el-table-column label="操作">
  197. <template slot-scope="scope">
  198. <div>
  199. <el-button v-if='scope.row.type == 2'
  200. type="text"
  201. @click="savecolumn(scope.row)">编辑</el-button>
  202. <el-button v-if='scope.row.type == 1'
  203. type="text"
  204. @click="savecolumn(scope.row)">保存</el-button>
  205. </div>
  206. </template>
  207. </el-table-column> -->
  208. </el-table>
  209. <div class="floor">
  210. <div class="remove"
  211. @click="removeListItem">删除</div>
  212. <div class='add'
  213. @click="addListItem">添加</div>
  214. </div>
  215. </div>
  216. <el-dialog title="声部选择"
  217. :visible.sync="dialogTableVisible"
  218. :modal-append-to-body="false">
  219. <div class="soundWrap">
  220. <div class="itemList">
  221. <div class="categroy"
  222. v-for="(item,index) in soundList"
  223. :key="index">
  224. <p>{{item.name }}</p>
  225. <el-checkbox-group v-model="soundLists[index]"
  226. @change='changeList'>
  227. <!-- sound: this.activeSoundList[item].name, // id
  228. jihua: '10', //计划招生人数
  229. yuji: '10', // 预计收费
  230. zhonglei: [], // 可选乐器种类
  231. fangshi: 2, // 乐器提供方式
  232. jiaopu: 'jiaopu1', // 教辅组合
  233. type: 1, // 操作
  234. id: this.activeSoundList[item].id, //声部id
  235. visible: false, // 当前乐器提供方式的pop提示框显示隐藏 -->
  236. <el-checkbox :label="sound.id"
  237. @change="checkinlist({'id':sound.id,'sound':sound.name,'jihua':0,'yuji':0,'zhonglei':[],'fangshi':'','fangshiprice':0,'jiaopu':'','type':1,'typeVisible':false,'provideVisible':false,'markVisible':false,'goodsList':[],'markList':[{'name':'','goods':[],'price':''}],'markChioseList':[]})"
  238. v-for="(sound,indexs) in item.subjects"
  239. :key="indexs">{{sound.name }}</el-checkbox>
  240. </el-checkbox-group>
  241. </div>
  242. </div>
  243. </div>
  244. <p class='soundSubP'>当前选择声部数:{{chioseSoundNum}}</p>
  245. <div class="btnWraps">
  246. <div class="dialogBtn"
  247. @click="generates">确定</div>
  248. </div>
  249. </el-dialog>
  250. <div class="btnWrap">
  251. <div class="PrevBtn"
  252. @click="goback">上一步</div>
  253. <div class="submitBtn"
  254. v-if="teamStatus == 'teamAudit'"
  255. @click="approval">审核通过</div>
  256. <div class="submitBtn"
  257. v-if="teamStatus == 'teamAudit'"
  258. @click="refuse">拒绝</div>
  259. <div class="submitBtn"
  260. v-if="teamStatus != 'teamAudit'"
  261. @click="submitInfo(1)">保存</div>
  262. <div class="submitBtn"
  263. v-if="teamStatus != 'teamAudit'"
  264. @click="submitInfo(2)">提交</div>
  265. </div>
  266. </div>
  267. </template>
  268. <script>
  269. import store from '@/store'
  270. import { getSubject, getDefaultSubject, getGoods, createTeam, getSoundTree, findMusicGroupSubjectInfo, updateSubjectInfo, auditSuccess, auditFailed } from '@/api/buildTeam'
  271. export default {
  272. data () {
  273. return {
  274. dialogTableVisible: false,
  275. soundList: [],
  276. soundLists: [], // 存储选中项的声部id 记录变量
  277. activeSoundList: [], // 记录存储后的所选中的声部列表
  278. checkList: [],
  279. multipleSelection: [], // 列表选择的集合
  280. isLoop: '', // 是否显示周期循环
  281. payfor: {},
  282. topfor: {},
  283. checkfor: {},
  284. teamStatus: '',
  285. teamid: ''
  286. }
  287. },
  288. methods: {
  289. // 改变checkbox
  290. changeList (e) {
  291. // console.log(e);
  292. },
  293. handleSelectionChange (e) {
  294. // 点击改变勾选
  295. this.multipleSelection = e;
  296. },
  297. handleclick (e) { },
  298. handleStatus (data) {
  299. },
  300. // 点击添加按钮
  301. addListItem () {
  302. this.dialogTableVisible = true;
  303. },
  304. // 点击确认按钮生成表单
  305. generates () {
  306. this.dialogTableVisible = false;
  307. },
  308. removeListItem () {
  309. for (let i = 0; i < this.activeSoundList.length; i++) {
  310. for (let j = 0; j < this.multipleSelection.length; j++) {
  311. if (this.activeSoundList[i].id == this.multipleSelection[j].id) {
  312. this.activeSoundList.splice(i, 1);
  313. // 遍历循环所有的group 删除所选id
  314. for (let key in this.soundLists) {
  315. if (this.soundLists[key].indexOf(this.multipleSelection[j].id) != -1) {
  316. // console.log(this.soundLists[key], this.multipleSelection[j].id, this.soundLists[key].indexOf(this.multipleSelection[j].id));
  317. this.soundLists[key].splice(this.soundLists[key].indexOf(this.multipleSelection[j].id), 1)
  318. }
  319. }
  320. }
  321. }
  322. }
  323. },
  324. // 勾选选中框处理数据,存储勾选过的checkbox值
  325. checkinlist (obj) {
  326. let flag = false;
  327. this.activeSoundList.map(item => {
  328. if (item.id == obj.id) {
  329. flag = true
  330. }
  331. })
  332. if (!flag) {
  333. this.activeSoundList.push(obj)
  334. } else {
  335. for (let i = 0; i < this.activeSoundList.length; i++) {
  336. if (this.activeSoundList[i].id == obj.id) {
  337. this.activeSoundList.splice(i, 1);
  338. }
  339. }
  340. }
  341. },
  342. // 根据声部id获取可选乐器种类
  343. chioseType (row) {
  344. // 根据id查询可选类型种类
  345. let id = row.id;
  346. // console.log(row.id);
  347. // 'subjectId': id, ' type'='INSTRUMENT'
  348. getGoods({ 'subjectId': id, 'type': 'INSTRUMENT' }).then(res => {
  349. if (res.code == 200) {
  350. row.goodsList = res.data;
  351. // console.log(row);
  352. }
  353. })
  354. },
  355. // 点击关闭乐器种类
  356. closechioseType (row) {
  357. row.typeVisible = false;
  358. },
  359. // 根据声部id查询可选教辅
  360. chioseMark (row) {
  361. console.log(row);
  362. row.markVisible = true
  363. let id = row.id;
  364. getGoods({ 'subjectId': id, 'type': 'ACCESSORIES' }).then(res => {
  365. if (res.code == 200) {
  366. row.markChioseList = res.data;
  367. // console.log(row);
  368. }
  369. })
  370. },
  371. // 添加教辅
  372. addMark (row) {
  373. row.markList.push({ 'name': '', 'goods': [], 'price': '' })
  374. },
  375. // 删除教辅
  376. removeMartItem (row, index) {
  377. // console.log(index);
  378. row.markList.splice(index, 1);
  379. },
  380. // 点击保存或编辑
  381. savecolumn (row) {
  382. row.type == 1 ? row.type = 2 : row.type = 1
  383. },
  384. // 返回上一步
  385. goback () {
  386. this.$emit('chiosetab', 0);
  387. },
  388. submitInfo (type) {
  389. // console.log(this.activeSoundList)
  390. // return;
  391. let status;
  392. if (type == 1) {
  393. // 保存
  394. status = 'DRAFT'
  395. } else if (type == 2) {
  396. // 提交
  397. status = 'AUDIT'
  398. }
  399. // 整理数据提交
  400. if (this.teamStatus == 'newTeam') {
  401. let obj = {};
  402. obj.months = this.payfor.chioseMonth || [];
  403. let enrollClasses;
  404. this.topfor.startClass ? enrollClasses = this.topfor.startClass.join(',') : enrollClasses = null;
  405. obj.musicGroup = {
  406. settlementType: this.topfor.salary,
  407. applyExpireDate: this.topfor.time + ' 00:00:01',
  408. chargeTypeId: this.topfor.type,
  409. cooperationOrganId: this.topfor.school,
  410. teamTeacherId: this.topfor.boss,
  411. educationalTeacherId: this.topfor.teacher,
  412. enrollClasses,
  413. name: this.topfor.name,
  414. organId: this.topfor.section,
  415. // paymentMonths:obj.months 有待确认
  416. schoolId: this.topfor.address,
  417. courseForm: JSON.stringify(this.checkfor),
  418. isClassroomLessons: this.topfor.isClass,
  419. status
  420. }
  421. obj.musicGroupPaymentEntities = []
  422. // 添加学校主体付费方式
  423. if (this.payfor.student.ischeck) {
  424. obj.musicGroupPaymentEntities.push({
  425. 'paymentMethod': this.payfor.student.chiose,
  426. 'name': '学生'
  427. })
  428. }
  429. if (this.payfor.school.ischeck) {
  430. obj.musicGroupPaymentEntities.push({
  431. 'amount': this.payfor.school.price,
  432. 'memo': this.payfor.school.value,
  433. 'paymentMethod': this.payfor.school.chiose,
  434. 'name': '学校'
  435. })
  436. }
  437. // 添加公司主体付费方式
  438. if (this.payfor.company.ischeck) {
  439. obj.musicGroupPaymentEntities.push({
  440. 'amount': this.payfor.company.price,
  441. 'memo': this.payfor.company.value,
  442. 'paymentMethod': this.payfor.company.chiose,
  443. 'name': '公司'
  444. })
  445. }
  446. let activeSoundList = this.activeSoundList
  447. // 添加商品以及教辅
  448. obj.musicGroupSubjectGoodsGroups = []
  449. obj.musicGroupSubjectPlans = []
  450. activeSoundList.forEach(active => {
  451. // 乐器
  452. active.zhonglei.forEach(zl => {
  453. let some = {
  454. subjectId: active.id,
  455. type: 'INSTRUMENT',
  456. goodsIdList: zl
  457. }
  458. obj.musicGroupSubjectGoodsGroups.push(some);
  459. })
  460. // 附件
  461. active.markList.forEach(mark => {
  462. let some = {
  463. subjectId: active.id,
  464. type: 'ACCESSORIES',
  465. goodsIdList: mark.goods.join(','),
  466. name: mark.name,
  467. price: mark.price
  468. }
  469. obj.musicGroupSubjectGoodsGroups.push(some);
  470. })
  471. // 添加声部
  472. let item = {
  473. expectedStudentNum: active.jihua,
  474. fee: active.yuji,
  475. kitGroupPurchaseType: active.fangshi,
  476. subName: active.sound,
  477. subjectId: active.id,
  478. depositFee: active.fangshiprice // depositFee 只有租赁才有
  479. }
  480. obj.musicGroupSubjectPlans.push(item);
  481. })
  482. console.log(obj);
  483. createTeam(obj).then(res => {
  484. if (res.code == 200) {
  485. // 成功 跳转到乐团报名详情
  486. this.$router.push({ path: '/business/teamDetail' })
  487. }
  488. })
  489. } else {
  490. // 只提交第二页的数据
  491. let obj = {};
  492. let activeSoundList = this.activeSoundList
  493. // 添加商品以及教辅
  494. obj.musicGroupId = this.teamid
  495. obj.musicGroupStatus = status;
  496. obj.musicGroupSubjectGoodsGroups = []
  497. obj.musicGroupSubjectPlans = []
  498. activeSoundList.forEach(active => {
  499. // 乐器
  500. active.zhonglei.forEach(zl => {
  501. let some = {
  502. subjectId: active.id,
  503. type: 'INSTRUMENT',
  504. goodsIdList: zl
  505. }
  506. obj.musicGroupSubjectGoodsGroups.push(some);
  507. })
  508. // 遍历声部里的教辅
  509. active.markList.forEach(mark => {
  510. let some = {
  511. subjectId: active.id,
  512. type: 'ACCESSORIES',
  513. goodsIdList: mark.goods ? mark.goods.join(',') : '',
  514. name: mark.name,
  515. price: mark.price
  516. }
  517. obj.musicGroupSubjectGoodsGroups.push(some);
  518. })
  519. // 添加声部
  520. let item = {
  521. expectedStudentNum: active.jihua,
  522. fee: active.yuji,
  523. kitGroupPurchaseType: active.fangshi,
  524. subName: active.sound,
  525. subjectId: active.id,
  526. depositFee: active.fangshiprice // depositFee 只有租赁才有
  527. }
  528. obj.musicGroupSubjectPlans.push(item);
  529. })
  530. // 发请求修改声部信息
  531. updateSubjectInfo(obj).then(res => {
  532. if (res.code == 200) {
  533. this.$message.success('提交成功')
  534. this.$router.push({ path: '/business/teamDetail' })
  535. }
  536. })
  537. }
  538. },
  539. // 同意
  540. approval () {
  541. auditSuccess({ musicGroupId: this.teamid }).then(res => {
  542. if (res.code == 200) {
  543. this.$message.success('审批通过')
  544. this.$router.push({ path: '/business/teamDetail' })
  545. }
  546. })
  547. },
  548. // 拒绝
  549. refuse () {
  550. // auditFailed
  551. this.$prompt('请输入拒绝原因', '提示', {
  552. confirmButtonText: '确定',
  553. cancelButtonText: '取消',
  554. }).then(({ value }) => {
  555. // 点击确认 值是value
  556. if (!value) {
  557. this.$message.error('请输入拒绝原因')
  558. return;
  559. } else {
  560. auditFailed({ musicGroupId: this.teamid, memo: value }).then(res => {
  561. if (res.code == 200) {
  562. this.$message.success('已拒绝')
  563. this.$router.push({ path: '/business/teamDetail' })
  564. }
  565. })
  566. }
  567. })
  568. }
  569. },
  570. filters: {
  571. zhongleiFilter (val, list) {
  572. if (list.length <= 0) {
  573. return;
  574. }
  575. let arr = []
  576. for (let i = 0; i < list.length; i++) {
  577. for (let j = 0; j < val.length; j++) {
  578. if (val[j] == list[i].id) {
  579. arr.push(list[i].name)
  580. }
  581. }
  582. }
  583. if (arr.length > 0) {
  584. return arr.join(',')
  585. } else {
  586. return ''
  587. }
  588. },
  589. fangshiFilter (val, price) {
  590. let str = ''
  591. if (val == 'FREE') {
  592. str = '免费'
  593. return str;
  594. } else if (val == 'GROUP') {
  595. str = '团购'
  596. return str
  597. } else if (val == 'LEASE') {
  598. str = '借用'
  599. }
  600. return str + '费用:' + price
  601. },
  602. goodsFilter (val, list) {
  603. if (list.length <= 0) {
  604. return '';
  605. }
  606. let arr = [];
  607. for (let i = 0; i < val.length; i++) {
  608. for (let j = 0; j < list.length; j++) {
  609. if (val[i] == list[j].id) {
  610. arr.push(list[j].name);
  611. }
  612. }
  613. }
  614. if (arr.length > 0) {
  615. return arr.join(',')
  616. } else {
  617. return ''
  618. }
  619. }
  620. // markFilter(val){
  621. // for
  622. // let name = val.name;
  623. // let goods = val.goods.join(',');
  624. // let price = val.price
  625. // }
  626. },
  627. mounted () {
  628. getSoundTree().then(res => {
  629. // console.log(res);
  630. if (res.code == 200) {
  631. this.soundList = res.data.rows;
  632. // // 生成动态的checkList
  633. for (let key in this.soundList) {
  634. this.$set(this.soundLists, key, [])
  635. }
  636. // 新建团带默认的数据
  637. if (this.teamStatus == 'newTeam') {
  638. getDefaultSubject({ chargeTypeId: type }).then(res => {
  639. if (res.code == 200) {
  640. this.activeSoundList = res.data.map(item => {
  641. this.soundLists[0].push(item.id)
  642. let obj = { 'id': item.id, 'sound': item.name, 'jihua': 0, 'yuji': 0, 'zhonglei': [], 'fangshi': '', 'fangshiprice': 0, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [{ 'name': '', 'goods': [], 'price': '' }], 'markChioseList': [] }
  643. return obj;
  644. })
  645. // 并且把所有soundLists 里面
  646. }
  647. });
  648. }
  649. // 修改带原有团的数据
  650. if (this.teamStatus == 'teamDraft' || this.teamStatus == 'teamAudit') {
  651. // 获取第二页的数据
  652. this.teamid = this.$route.query.id;
  653. findMusicGroupSubjectInfo({ musicGroupId: this.teamid }).then(res => {
  654. if (res.code == 200) {
  655. this.activeSoundList = res.data.musicGroupSubjectPlans.map(item => {
  656. this.soundLists[0].push(item.subjectId)
  657. let obj = { 'id': item.subjectId, 'sound': item.subName, 'jihua': item.expectedStudentNum, 'yuji': item.fee, 'zhonglei': [], 'fangshi': item.kitGroupPurchaseType, 'fangshiprice': item.depositFee, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [{ 'name': '', 'goods': [], 'price': '' }], 'markChioseList': [] }
  658. return obj;
  659. })
  660. // 循环列表里的声部 拿取商品
  661. for (let i in this.activeSoundList) {
  662. for (let j in res.data.musicGroupSubjectGoodsGroups) {
  663. if (this.activeSoundList[i].id == res.data.musicGroupSubjectGoodsGroups[j].subjectId) {
  664. //
  665. if (res.data.musicGroupSubjectGoodsGroups[j].type == 'INSTRUMENT') {
  666. this.activeSoundList[i].zhonglei = this.activeSoundList[i].zhonglei.concat(res.data.musicGroupSubjectGoodsGroups[j].goodsIdList)
  667. console.log(this.activeSoundList[i].zhonglei)
  668. this.activeSoundList[i].zhonglei = this.activeSoundList[i].zhonglei.map(item => {
  669. return parseInt(item);
  670. })
  671. this.activeSoundList[i].goodsList = this.activeSoundList[i].goodsList.concat(res.data.musicGroupSubjectGoodsGroups[j].goodsList);
  672. // goodsList
  673. // console.log(this.activeSoundList[i].goodsList)
  674. }
  675. // 拿辅件
  676. if (res.data.musicGroupSubjectGoodsGroups[j].type == 'ACCESSORIES') {
  677. if (res.data.musicGroupSubjectGoodsGroups[j].goodsList.length >= 0) {
  678. this.activeSoundList[i].markList = [];
  679. let obj = {};
  680. obj.goods = res.data.musicGroupSubjectGoodsGroups[j].goodsIdList.split(',');
  681. obj.name = res.data.musicGroupSubjectGoodsGroups[j].name
  682. obj.price = res.data.musicGroupSubjectGoodsGroups[j].price;
  683. this.activeSoundList[i].markList.push(obj);
  684. // this.activeSoundList[i].markList.goodsList.goods = JSON.parse(res.data.musicGroupSubjectGoodsGroups[j].goodsIdList)
  685. this.activeSoundList[i].markChioseList = this.activeSoundList[i].markChioseList.concat(res.data.musicGroupSubjectGoodsGroups[j].goodsList);
  686. // console.log(this.activeSoundList[i].markChioseList);
  687. }
  688. }
  689. }
  690. }
  691. }
  692. }
  693. })
  694. }
  695. }
  696. })
  697. // 拿到刚才的存储的信息
  698. this.payfor = this.$store.getters.payList;
  699. this.topfor = this.$store.getters.topinfo;
  700. this.checkfor = this.$store.getters.checkinfo;
  701. let type = this.topfor.type;
  702. // 判断进来的乐团状态
  703. this.teamStatus = this.$route.query.type;
  704. console.log(this.teamStatus)
  705. // console.log(this.topfor);
  706. // console.log(this.checkfor);
  707. // console.log(this.payfor);
  708. },
  709. watch: {
  710. },
  711. computed: {
  712. // 返回当前选中声部数量
  713. chioseSoundNum () {
  714. let num = 0;
  715. for (let key in this.soundList) {
  716. // console.log(this.soundLists[key])
  717. num += this.soundLists[key].length;
  718. }
  719. return num;
  720. },
  721. // 计划招生人数
  722. PlannedCount () {
  723. let Count = 0;
  724. for (let item in this.activeSoundList) {
  725. Count += parseInt(this.activeSoundList[item].jihua)
  726. }
  727. return Count
  728. }
  729. },
  730. }
  731. </script>
  732. <style lang="scss" >
  733. // .el-table__body tr.current-row > td {
  734. // background-color: #c6cbd4 !important;
  735. // }
  736. .el-checkbox__input.is-checked .el-checkbox__inner,
  737. .el-checkbox__input.is-indeterminate .el-checkbox__inner {
  738. background-color: #14928a;
  739. border-color: #14928a;
  740. }
  741. .el-select__tags .el-tag__close.el-icon-close {
  742. display: inline-block;
  743. }
  744. // .el-dialog__header {
  745. // padding: 0 32px !important;
  746. // height: 40px;
  747. // line-height: 40px;
  748. // background-color: #14928a;
  749. // .el-dialog__title {
  750. // color: #fff;
  751. // font-size: 16px;
  752. // }
  753. // }
  754. .el-checkbox__input.is-checked + .el-checkbox__label {
  755. color: #606266;
  756. }
  757. .sound-container {
  758. .chioseWrap {
  759. margin-bottom: 30px;
  760. display: flex;
  761. flex-direction: row;
  762. padding: 0 25px;
  763. p {
  764. font-size: 14px;
  765. margin-right: 30px;
  766. }
  767. }
  768. .topMsg {
  769. padding: 0 25px;
  770. display: flex;
  771. flex-direction: row;
  772. justify-content: flex-start;
  773. font-size: 14px;
  774. color: #444;
  775. margin-bottom: 15px;
  776. }
  777. .subTitle {
  778. width: 1203px;
  779. height: 40px;
  780. line-height: 40px;
  781. background-color: #fefceb;
  782. padding: 0 25px;
  783. box-sizing: border-box;
  784. font-size: 16px;
  785. color: #474747;
  786. margin-bottom: 20px;
  787. }
  788. .floor {
  789. display: flex;
  790. flex-direction: row;
  791. justify-content: flex-start;
  792. width: 100%;
  793. height: 48px;
  794. line-height: 48px;
  795. background: rgba(237, 238, 240, 1);
  796. font-size: 14px;
  797. color: #444;
  798. align-items: center;
  799. position: relative;
  800. z-index: 1;
  801. .remove {
  802. width: 98px;
  803. height: 32px;
  804. background: rgba(248, 80, 67, 1);
  805. border-radius: 3px;
  806. color: #fff;
  807. line-height: 32px;
  808. text-align: center;
  809. margin-left: 164px;
  810. cursor: pointer;
  811. }
  812. .add {
  813. width: 98px;
  814. height: 32px;
  815. background: rgba(20, 146, 138, 1);
  816. border-radius: 3px;
  817. color: #fff;
  818. line-height: 32px;
  819. text-align: center;
  820. margin-left: 20px;
  821. cursor: pointer;
  822. }
  823. }
  824. .xuanze {
  825. width: 71px;
  826. }
  827. .chiose {
  828. width: 65px;
  829. height: 24px;
  830. line-height: 24px;
  831. border: 1px solid rgba(151, 151, 151, 1);
  832. border-radius: 12px;
  833. text-align: center;
  834. cursor: pointer;
  835. }
  836. }
  837. .soundWrap {
  838. width: 100%;
  839. overflow: auto;
  840. .itemList {
  841. display: flex;
  842. flex-direction: row;
  843. justify-content: flex-start;
  844. flex-wrap: nowrap;
  845. flex-grow: 1;
  846. height: 300px;
  847. max-height: 300px;
  848. overflow: auto;
  849. .categroy {
  850. width: 150px;
  851. min-width: 150px;
  852. .el-checkbox {
  853. height: 30px;
  854. line-height: 30px;
  855. display: block;
  856. padding-left: 20px;
  857. }
  858. p {
  859. height: 40px;
  860. line-height: 40px;
  861. background-color: #edeef0;
  862. margin-bottom: 15px;
  863. text-align: center;
  864. }
  865. }
  866. }
  867. }
  868. .soundSubP {
  869. height: 40px;
  870. line-height: 40px;
  871. background-color: #edeef0;
  872. padding-left: 25px;
  873. }
  874. .btnWraps {
  875. display: flex;
  876. flex-direction: column;
  877. align-items: center;
  878. margin-top: 150px;
  879. .dialogBtn {
  880. width: 188px;
  881. height: 40px;
  882. background: rgba(249, 114, 21, 1);
  883. border-radius: 4px;
  884. line-height: 40px;
  885. color: #fff;
  886. text-align: center;
  887. cursor: pointer;
  888. }
  889. }
  890. .btnWrap {
  891. margin-top: 40px;
  892. .PrevBtn {
  893. background-color: #444444;
  894. width: 120px;
  895. }
  896. .submitBtn {
  897. background-color: #f85043;
  898. width: 120px;
  899. }
  900. }
  901. .el-icon-plus {
  902. cursor: pointer;
  903. }
  904. </style>