teamSoundMoney.vue 32 KB

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