resetSound.vue 29 KB

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