teamSoundMoney.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  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':1500,'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. },
  292. handleSelectionChange (e) {
  293. // 点击改变勾选
  294. this.multipleSelection = e;
  295. },
  296. handleclick (e) { },
  297. handleStatus (data) {
  298. },
  299. // 点击添加按钮
  300. addListItem () {
  301. this.dialogTableVisible = true;
  302. },
  303. // 点击确认按钮生成表单
  304. generates () {
  305. this.dialogTableVisible = false;
  306. },
  307. removeListItem () {
  308. for (let i = 0; i < this.activeSoundList.length; i++) {
  309. for (let j = 0; j < this.multipleSelection.length; j++) {
  310. if (this.activeSoundList[i].id == this.multipleSelection[j].id) {
  311. this.activeSoundList.splice(i, 1);
  312. // 遍历循环所有的group 删除所选id
  313. for (let key in this.soundLists) {
  314. if (this.soundLists[key].indexOf(this.multipleSelection[j].id) != -1) {
  315. this.soundLists[key].splice(this.soundLists[key].indexOf(this.multipleSelection[j].id), 1)
  316. }
  317. }
  318. }
  319. }
  320. }
  321. },
  322. // 勾选选中框处理数据,存储勾选过的checkbox值
  323. checkinlist (obj) {
  324. let flag = false;
  325. this.activeSoundList.map(item => {
  326. if (item.id == obj.id) {
  327. flag = true
  328. }
  329. })
  330. if (!flag) {
  331. this.activeSoundList.push(obj)
  332. } else {
  333. for (let i = 0; i < this.activeSoundList.length; i++) {
  334. if (this.activeSoundList[i].id == obj.id) {
  335. this.activeSoundList.splice(i, 1);
  336. }
  337. }
  338. }
  339. },
  340. // 根据声部id获取可选乐器种类
  341. chioseType (row) {
  342. // 根据id查询可选类型种类
  343. let id = row.id;
  344. // 'subjectId': id, ' type'='INSTRUMENT'
  345. getGoods({ 'subjectId': id, 'type': 'INSTRUMENT' }).then(res => {
  346. if (res.code == 200) {
  347. row.goodsList = res.data;
  348. }
  349. })
  350. },
  351. // 点击关闭乐器种类
  352. closechioseType (row) {
  353. row.typeVisible = false;
  354. },
  355. // 根据声部id查询可选教辅
  356. chioseMark (row) {
  357. row.markVisible = true
  358. let id = row.id;
  359. getGoods({ 'subjectId': id, 'type': 'ACCESSORIES' }).then(res => {
  360. if (res.code == 200) {
  361. row.markChioseList = res.data;
  362. }
  363. })
  364. },
  365. // 添加教辅
  366. addMark (row) {
  367. row.markList.push({ 'name': '', 'goods': [], 'price': '' })
  368. },
  369. // 删除教辅
  370. removeMartItem (row, index) {
  371. row.markList.splice(index, 1);
  372. },
  373. // 点击保存或编辑
  374. savecolumn (row) {
  375. row.type == 1 ? row.type = 2 : row.type = 1
  376. },
  377. // 返回上一步
  378. goback () {
  379. this.$emit('chiosetab', 0);
  380. },
  381. submitInfo (type) {
  382. // return;
  383. let status;
  384. if (type == 1) {
  385. // 保存
  386. status = 'DRAFT'
  387. } else if (type == 2) {
  388. // 提交
  389. status = 'AUDIT'
  390. }
  391. // 整理数据提交
  392. if (this.teamStatus == 'newTeam') {
  393. let obj = {};
  394. obj.months = this.payfor.chioseMonth || [];
  395. let enrollClasses;
  396. this.topfor.startClass ? enrollClasses = this.topfor.startClass.join(',') : enrollClasses = null;
  397. obj.musicGroup = {
  398. settlementType: this.topfor.salary,
  399. applyExpireDate: this.topfor.time + ' 00:00:01',
  400. chargeTypeId: this.topfor.type,
  401. cooperationOrganId: this.topfor.school,
  402. teamTeacherId: this.topfor.boss,
  403. educationalTeacherId: this.topfor.teacher,
  404. enrollClasses,
  405. name: this.topfor.name,
  406. organId: this.topfor.section,
  407. // paymentMonths:obj.months 有待确认
  408. schoolId: this.topfor.address,
  409. courseForm: JSON.stringify(this.checkfor),
  410. expectStartGroupDate: this.topfor.startTime,
  411. isClassroomLessons: this.topfor.isClass,
  412. status
  413. }
  414. obj.musicGroupPaymentEntities = []
  415. // 添加学校主体付费方式
  416. if (this.payfor.student.ischeck) {
  417. obj.musicGroupPaymentEntities.push({
  418. 'paymentMethod': this.payfor.student.chiose,
  419. 'name': '学生'
  420. })
  421. }
  422. if (this.payfor.school.ischeck) {
  423. obj.musicGroupPaymentEntities.push({
  424. 'amount': this.payfor.school.price,
  425. 'memo': this.payfor.school.value,
  426. 'paymentMethod': this.payfor.school.chiose,
  427. 'name': '学校'
  428. })
  429. }
  430. // 添加公司主体付费方式
  431. if (this.payfor.company.ischeck) {
  432. obj.musicGroupPaymentEntities.push({
  433. 'amount': this.payfor.company.price,
  434. 'memo': this.payfor.company.value,
  435. 'paymentMethod': this.payfor.company.chiose,
  436. 'name': '公司'
  437. })
  438. }
  439. let activeSoundList = this.activeSoundList
  440. // 添加商品以及教辅
  441. obj.musicGroupSubjectGoodsGroups = []
  442. obj.musicGroupSubjectPlans = []
  443. activeSoundList.forEach(active => {
  444. // 乐器
  445. active.zhonglei.forEach(zl => {
  446. let goodsItem = []
  447. active.goodsList.forEach(goods => {
  448. if (goods.id == zl) {
  449. goodsItem = goods
  450. }
  451. })
  452. let some = {
  453. subjectId: active.id,
  454. type: 'INSTRUMENT',
  455. goodsIdList: zl,
  456. name: goodsItem.name,
  457. price: goodsItem.groupPurchasePrice
  458. }
  459. obj.musicGroupSubjectGoodsGroups.push(some);
  460. })
  461. // 附件
  462. active.markList.forEach(mark => {
  463. if (mark.goods.length >= 1) {
  464. let some = {
  465. subjectId: active.id,
  466. type: 'ACCESSORIES',
  467. goodsIdList: mark.goods.join(','),
  468. name: mark.name,
  469. price: mark.price
  470. }
  471. obj.musicGroupSubjectGoodsGroups.push(some);
  472. }
  473. })
  474. // 添加声部
  475. let item = {
  476. expectedStudentNum: active.jihua,
  477. fee: active.yuji,
  478. kitGroupPurchaseType: active.fangshi,
  479. subName: active.sound,
  480. subjectId: active.id,
  481. depositFee: active.fangshiprice // depositFee 只有租赁才有
  482. }
  483. obj.musicGroupSubjectPlans.push(item);
  484. })
  485. createTeam(obj).then(res => {
  486. if (res.code == 200) {
  487. // 成功 跳转到乐团报名详情
  488. this.$router.push({ path: '/business/teamDetail' })
  489. }
  490. })
  491. } else {
  492. // 只提交第二页的数据
  493. let obj = {};
  494. let activeSoundList = this.activeSoundList
  495. // 添加商品以及教辅
  496. obj.musicGroupId = this.teamid
  497. obj.musicGroupStatus = status;
  498. obj.musicGroupSubjectGoodsGroups = []
  499. obj.musicGroupSubjectPlans = []
  500. activeSoundList.forEach(active => {
  501. // 乐器
  502. active.zhonglei.forEach(zl => {
  503. let goodsItem = []
  504. active.goodsList.forEach(goods => {
  505. if (goods.id == zl) {
  506. goodsItem = goods
  507. }
  508. })
  509. let some = {
  510. subjectId: active.id,
  511. type: 'INSTRUMENT',
  512. goodsIdList: zl,
  513. name: goodsItem.name,
  514. price: goodsItem.groupPurchasePrice
  515. }
  516. obj.musicGroupSubjectGoodsGroups.push(some);
  517. })
  518. // 遍历声部里的教辅
  519. active.markList.forEach(mark => {
  520. if (mark.goods.length >= 1) {
  521. let some = {
  522. subjectId: active.id,
  523. type: 'ACCESSORIES',
  524. goodsIdList: mark.goods.join(','),
  525. name: mark.name,
  526. price: mark.price
  527. }
  528. obj.musicGroupSubjectGoodsGroups.push(some);
  529. }
  530. })
  531. // 添加声部
  532. let item = {
  533. expectedStudentNum: active.jihua,
  534. fee: active.yuji,
  535. kitGroupPurchaseType: active.fangshi,
  536. subName: active.sound,
  537. subjectId: active.id,
  538. depositFee: active.fangshiprice // depositFee 只有租赁才有
  539. }
  540. obj.musicGroupSubjectPlans.push(item);
  541. })
  542. // 发请求修改声部信息
  543. updateSubjectInfo(obj).then(res => {
  544. if (res.code == 200) {
  545. this.$message.success('提交成功')
  546. this.$router.push({ path: '/business/teamDetail' })
  547. }
  548. })
  549. }
  550. },
  551. // 同意
  552. approval () {
  553. auditSuccess({ musicGroupId: this.teamid }).then(res => {
  554. if (res.code == 200) {
  555. this.$message.success('审批通过')
  556. this.$router.push({ path: '/business/teamDetail' })
  557. }
  558. })
  559. },
  560. // 拒绝
  561. refuse () {
  562. // auditFailed
  563. this.$prompt('请输入拒绝原因', '提示', {
  564. confirmButtonText: '确定',
  565. cancelButtonText: '取消',
  566. }).then(({ value }) => {
  567. // 点击确认 值是value
  568. if (!value) {
  569. this.$message.error('请输入拒绝原因')
  570. return;
  571. } else {
  572. auditFailed({ musicGroupId: this.teamid, memo: value }).then(res => {
  573. if (res.code == 200) {
  574. this.$message.success('已拒绝')
  575. this.$router.push({ path: '/business/teamDetail' })
  576. }
  577. })
  578. }
  579. })
  580. }
  581. },
  582. filters: {
  583. zhongleiFilter (val, list) {
  584. if (list.length <= 0) {
  585. return;
  586. }
  587. let arr = []
  588. for (let i = 0; i < list.length; i++) {
  589. for (let j = 0; j < val.length; j++) {
  590. if (val[j] == list[i].id) {
  591. arr.push(list[i].name)
  592. }
  593. }
  594. }
  595. if (arr.length > 0) {
  596. return arr.join(',')
  597. } else {
  598. return ''
  599. }
  600. },
  601. fangshiFilter (val, price) {
  602. let str = ''
  603. if (val == 'FREE') {
  604. str = '免费'
  605. return str;
  606. } else if (val == 'GROUP') {
  607. str = '团购'
  608. return str
  609. } else if (val == 'LEASE') {
  610. str = '借用'
  611. }
  612. return str + '费用:' + price
  613. },
  614. goodsFilter (val, list) {
  615. if (list.length <= 0) {
  616. return '';
  617. }
  618. let arr = [];
  619. for (let i = 0; i < val.length; i++) {
  620. for (let j = 0; j < list.length; j++) {
  621. if (val[i] == list[j].id) {
  622. arr.push(list[j].name);
  623. }
  624. }
  625. }
  626. if (arr.length > 0) {
  627. return arr.join(',')
  628. } else {
  629. return ''
  630. }
  631. }
  632. // markFilter(val){
  633. // for
  634. // let name = val.name;
  635. // let goods = val.goods.join(',');
  636. // let price = val.price
  637. // }
  638. },
  639. mounted () {
  640. getSoundTree().then(res => {
  641. if (res.code == 200) {
  642. this.soundList = res.data.rows;
  643. // // 生成动态的checkList
  644. for (let key in this.soundList) {
  645. this.$set(this.soundLists, key, [])
  646. }
  647. // 新建团带默认的数据
  648. if (this.teamStatus == 'newTeam') {
  649. getDefaultSubject({ chargeTypeId: type }).then(res => {
  650. if (res.code == 200) {
  651. this.activeSoundList = res.data.map(item => {
  652. this.soundLists[0].push(item.id)
  653. let obj = { 'id': item.id, 'sound': item.name, 'jihua': 0, 'yuji': 0, 'zhonglei': [], 'fangshi': '', 'fangshiprice': 1500, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [{ 'name': '', 'goods': [], 'price': '' }], 'markChioseList': [] }
  654. return obj;
  655. })
  656. // 并且把所有soundLists 里面
  657. }
  658. });
  659. }
  660. // 修改带原有团的数据
  661. if (this.teamStatus == 'teamDraft' || this.teamStatus == 'teamAudit') {
  662. // 获取第二页的数据
  663. this.teamid = this.$route.query.id;
  664. findMusicGroupSubjectInfo({ musicGroupId: this.teamid }).then(res => {
  665. if (res.code == 200) {
  666. this.activeSoundList = res.data.musicGroupSubjectPlans.map(item => {
  667. this.soundLists[0].push(item.subjectId)
  668. 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': [] }
  669. return obj;
  670. })
  671. // 循环列表里的声部 拿取商品
  672. for (let i in this.activeSoundList) {
  673. for (let j in res.data.musicGroupSubjectGoodsGroups) {
  674. if (this.activeSoundList[i].id == res.data.musicGroupSubjectGoodsGroups[j].subjectId) {
  675. //
  676. if (res.data.musicGroupSubjectGoodsGroups[j].type == 'INSTRUMENT') {
  677. this.activeSoundList[i].zhonglei = this.activeSoundList[i].zhonglei.concat(res.data.musicGroupSubjectGoodsGroups[j].goodsIdList)
  678. this.activeSoundList[i].zhonglei = this.activeSoundList[i].zhonglei.map(item => {
  679. return parseInt(item);
  680. })
  681. this.activeSoundList[i].goodsList = this.activeSoundList[i].goodsList.concat(res.data.musicGroupSubjectGoodsGroups[j].goodsList);
  682. // goodsList
  683. }
  684. // 拿辅件
  685. if (res.data.musicGroupSubjectGoodsGroups[j].type == 'ACCESSORIES') {
  686. if (res.data.musicGroupSubjectGoodsGroups[j].goodsList.length >= 0) {
  687. this.activeSoundList[i].markList = [];
  688. let obj = {};
  689. obj.goods = res.data.musicGroupSubjectGoodsGroups[j].goodsIdList.split(',');
  690. obj.goods = obj.goods.map(item => {
  691. return parseInt(item);
  692. })
  693. obj.name = res.data.musicGroupSubjectGoodsGroups[j].name
  694. obj.price = res.data.musicGroupSubjectGoodsGroups[j].price;
  695. this.activeSoundList[i].markList.push(obj);
  696. // this.activeSoundList[i].markList.goodsList.goods = JSON.parse(res.data.musicGroupSubjectGoodsGroups[j].goodsIdList)
  697. this.activeSoundList[i].markChioseList = this.activeSoundList[i].markChioseList.concat(res.data.musicGroupSubjectGoodsGroups[j].goodsList);
  698. }
  699. }
  700. }
  701. }
  702. }
  703. }
  704. })
  705. }
  706. }
  707. })
  708. // 拿到刚才的存储的信息
  709. this.payfor = this.$store.getters.payList;
  710. this.topfor = this.$store.getters.topinfo;
  711. this.checkfor = this.$store.getters.checkinfo;
  712. let type = this.topfor.type;
  713. // 判断进来的乐团状态
  714. this.teamStatus = this.$route.query.type;
  715. },
  716. watch: {
  717. },
  718. computed: {
  719. // 返回当前选中声部数量
  720. chioseSoundNum () {
  721. let num = 0;
  722. for (let key in this.soundList) {
  723. num += this.soundLists[key].length;
  724. }
  725. return num;
  726. },
  727. // 计划招生人数
  728. PlannedCount () {
  729. let Count = 0;
  730. for (let item in this.activeSoundList) {
  731. Count += parseInt(this.activeSoundList[item].jihua)
  732. }
  733. return Count
  734. }
  735. },
  736. }
  737. </script>
  738. <style lang="scss" >
  739. // .el-table__body tr.current-row > td {
  740. // background-color: #c6cbd4 !important;
  741. // }
  742. .el-checkbox__input.is-checked .el-checkbox__inner,
  743. .el-checkbox__input.is-indeterminate .el-checkbox__inner {
  744. background-color: #14928a;
  745. border-color: #14928a;
  746. }
  747. .el-select__tags .el-tag__close.el-icon-close {
  748. display: inline-block;
  749. }
  750. // .el-dialog__header {
  751. // padding: 0 32px !important;
  752. // height: 40px;
  753. // line-height: 40px;
  754. // background-color: #14928a;
  755. // .el-dialog__title {
  756. // color: #fff;
  757. // font-size: 16px;
  758. // }
  759. // }
  760. .el-checkbox__input.is-checked + .el-checkbox__label {
  761. color: #606266;
  762. }
  763. .sound-container {
  764. .chioseWrap {
  765. margin-bottom: 30px;
  766. display: flex;
  767. flex-direction: row;
  768. padding: 0 25px;
  769. p {
  770. font-size: 14px;
  771. margin-right: 30px;
  772. }
  773. }
  774. .topMsg {
  775. padding: 0 25px;
  776. display: flex;
  777. flex-direction: row;
  778. justify-content: flex-start;
  779. font-size: 14px;
  780. color: #444;
  781. margin-bottom: 15px;
  782. }
  783. .subTitle {
  784. width: 1203px;
  785. height: 40px;
  786. line-height: 40px;
  787. background-color: #fefceb;
  788. padding: 0 25px;
  789. box-sizing: border-box;
  790. font-size: 16px;
  791. color: #474747;
  792. margin-bottom: 20px;
  793. }
  794. .floor {
  795. display: flex;
  796. flex-direction: row;
  797. justify-content: flex-start;
  798. width: 100%;
  799. height: 48px;
  800. line-height: 48px;
  801. background: rgba(237, 238, 240, 1);
  802. font-size: 14px;
  803. color: #444;
  804. align-items: center;
  805. position: relative;
  806. z-index: 1;
  807. .remove {
  808. width: 98px;
  809. height: 32px;
  810. background: rgba(248, 80, 67, 1);
  811. border-radius: 3px;
  812. color: #fff;
  813. line-height: 32px;
  814. text-align: center;
  815. margin-left: 164px;
  816. cursor: pointer;
  817. }
  818. .add {
  819. width: 98px;
  820. height: 32px;
  821. background: rgba(20, 146, 138, 1);
  822. border-radius: 3px;
  823. color: #fff;
  824. line-height: 32px;
  825. text-align: center;
  826. margin-left: 20px;
  827. cursor: pointer;
  828. }
  829. }
  830. .xuanze {
  831. width: 71px;
  832. }
  833. .chiose {
  834. width: 65px;
  835. height: 24px;
  836. line-height: 24px;
  837. border: 1px solid rgba(151, 151, 151, 1);
  838. border-radius: 12px;
  839. text-align: center;
  840. cursor: pointer;
  841. }
  842. }
  843. .soundWrap {
  844. width: 100%;
  845. overflow: auto;
  846. .itemList {
  847. display: flex;
  848. flex-direction: row;
  849. justify-content: flex-start;
  850. flex-wrap: nowrap;
  851. flex-grow: 1;
  852. height: 300px;
  853. max-height: 300px;
  854. overflow: auto;
  855. .categroy {
  856. width: 150px;
  857. min-width: 150px;
  858. .el-checkbox {
  859. height: 30px;
  860. line-height: 30px;
  861. display: block;
  862. padding-left: 20px;
  863. }
  864. p {
  865. height: 40px;
  866. line-height: 40px;
  867. background-color: #edeef0;
  868. margin-bottom: 15px;
  869. text-align: center;
  870. }
  871. }
  872. }
  873. }
  874. .soundSubP {
  875. height: 40px;
  876. line-height: 40px;
  877. background-color: #edeef0;
  878. padding-left: 25px;
  879. }
  880. .btnWraps {
  881. display: flex;
  882. flex-direction: column;
  883. align-items: center;
  884. margin-top: 150px;
  885. .dialogBtn {
  886. width: 188px;
  887. height: 40px;
  888. background: rgba(249, 114, 21, 1);
  889. border-radius: 4px;
  890. line-height: 40px;
  891. color: #fff;
  892. text-align: center;
  893. cursor: pointer;
  894. }
  895. }
  896. .btnWrap {
  897. margin-top: 40px;
  898. .PrevBtn {
  899. background-color: #444444;
  900. width: 120px;
  901. }
  902. .submitBtn {
  903. background-color: #f85043;
  904. width: 120px;
  905. }
  906. }
  907. .el-icon-plus {
  908. cursor: pointer;
  909. }
  910. </style>