resetSound.vue 28 KB

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