teamResetSound.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <div>
  3. <p class="subTitle">按月缴费时,将在所选月份的1号的前一周提醒用户缴费操作,单次的缴费金额为当前列表「预计收费」的设置金额</p>
  4. <div class="chioseWrap"
  5. v-if='isLoop=="loop"'>
  6. <p>请选择缴费月份:</p>
  7. <el-checkbox-group v-model="checkList"
  8. fill="#14928A"
  9. text-color='#474747'>
  10. <el-checkbox label="1">一月</el-checkbox>
  11. <el-checkbox label="2">二月</el-checkbox>
  12. <el-checkbox label="3">三月</el-checkbox>
  13. <el-checkbox label="4">四月</el-checkbox>
  14. <el-checkbox label="5">五月</el-checkbox>
  15. <el-checkbox label="6">六月</el-checkbox>
  16. <el-checkbox label="7">七月</el-checkbox>
  17. <el-checkbox label="8">八月</el-checkbox>
  18. <el-checkbox label="9">九月</el-checkbox>
  19. <el-checkbox label="10">十月</el-checkbox>
  20. <el-checkbox label="11">十一月</el-checkbox>
  21. <el-checkbox label="12">十二月</el-checkbox>
  22. </el-checkbox-group>
  23. </div>
  24. <div class="listWrap">
  25. <el-table :data='activeSoundList'
  26. ref="multipleTable"
  27. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  28. highlight-current-row
  29. @selection-change='handleSelectionChange'
  30. @row-click='handleclick'>
  31. <el-table-column type="selection"
  32. width="55">
  33. </el-table-column>
  34. <el-table-column label="声部"
  35. width="150"
  36. prop="sound">
  37. </el-table-column>
  38. <el-table-column label="预计收费"
  39. width="150"
  40. prop="yuji">
  41. <template slot-scope="scope">
  42. <div>
  43. <el-input type="number"
  44. v-model="scope.row.yuji"></el-input>
  45. </div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="声部学员">
  49. <template slot-scope="scope">
  50. <div>
  51. <el-button type="text"
  52. @click="resetStudent">添加</el-button>
  53. <el-button type="text">删除</el-button>
  54. </div>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. <div class="floor">
  59. <div class="remove"
  60. @click="removeListItem">删除</div>
  61. <div class='add'
  62. @click="addListItem">添加</div>
  63. </div>
  64. </div>
  65. <el-dialog title="声部选择"
  66. :visible.sync="dialogTableVisible"
  67. :modal-append-to-body="false">
  68. <div class="soundWrap">
  69. <div class="itemList">
  70. <div class="categroy"
  71. v-for="(item,index) in soundList"
  72. :key="index">
  73. <p>{{item.name }}</p>
  74. <el-checkbox-group v-model="soundLists[index]"
  75. @change='changeList'>
  76. <!-- sound: this.activeSoundList[item].name, // id
  77. jihua: '10', //计划招生人数
  78. yuji: '10', // 预计收费
  79. zhonglei: [], // 可选乐器种类
  80. fangshi: 2, // 乐器提供方式
  81. jiaopu: 'jiaopu1', // 教辅组合
  82. type: 1, // 操作
  83. id: this.activeSoundList[item].id, //声部id
  84. visible: false, // 当前乐器提供方式的pop提示框显示隐藏 -->
  85. <el-checkbox :label="sound.id"
  86. @change="checkinlist({'id':sound.id,'sound':sound.name,'yuji':0,studentList:{}})"
  87. v-for="(sound,indexs) in item.subjects"
  88. :key="indexs">{{sound.name }}</el-checkbox>
  89. </el-checkbox-group>
  90. </div>
  91. </div>
  92. </div>
  93. <p class='soundSubP'>当前选择声部数:{{chioseSoundNum}}</p>
  94. <div class="btnWraps">
  95. <div class="dialogBtn"
  96. @click="generates">确定</div>
  97. </div>
  98. </el-dialog>
  99. <el-dialog title="学员选择"
  100. width="800px"
  101. :visible.sync="studentVisible"
  102. :modal-append-to-body="false">
  103. <div class="studentMask">
  104. <div class="left">
  105. <h4>当前已选学员</h4>
  106. <div class="chioseStudentList">
  107. <div class="studentItem">
  108. 赵小雷
  109. <el-button type="text">删除</el-button>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="right">
  114. <el-select v-model="activeTeam"
  115. style="width:180px"
  116. clearable
  117. @change="chioseTeam"
  118. placeholder="乐团选择">
  119. <el-option v-for='(item,index) in teamList'
  120. :key="index"
  121. :label="item.name"
  122. :value="item.id"></el-option>
  123. </el-select>
  124. <!-- multiple
  125. collapse-tags -->
  126. <el-select v-model="activeChioseSound"
  127. style="width:180px"
  128. :disabled="!activeTeam"
  129. clearable
  130. placeholder="声部选择">
  131. <el-option v-for='(item,index) in chioseSoundList'
  132. :key='index'
  133. :label="item.name"
  134. :value="item.id"></el-option>
  135. </el-select>
  136. <el-button type="danger"
  137. style="margin-left:20px;"
  138. @click="searchStudent">搜索</el-button>
  139. <!-- 列表开始 -->
  140. <el-table tooltip-effect="dark"
  141. style="width: 100%; margin-top:10px;"
  142. :data='studentList'
  143. @selection-change="handleSelectionChange">
  144. <el-table-column type="selection"
  145. width="55">
  146. </el-table-column>
  147. <el-table-column prop="name"
  148. label="姓名">
  149. </el-table-column>
  150. <el-table-column prop="name"
  151. label="性别">
  152. </el-table-column>
  153. <el-table-column prop="name"
  154. label="所在乐团">
  155. </el-table-column>
  156. <el-table-column prop="name"
  157. label="学员声部">
  158. </el-table-column>
  159. </el-table>
  160. </div>
  161. </div>
  162. </el-dialog>
  163. </div>
  164. </template>
  165. <script>
  166. import store from '@/store'
  167. import { getSubject, getDefaultSubject, getGoods, createTeam, getSoundTree, findSound } from '@/api/buildTeam'
  168. export default {
  169. props: ['getTeamList'],
  170. data () {
  171. return {
  172. dialogTableVisible: false,
  173. studentVisible: true,
  174. checkList: [],
  175. isLoop: '',
  176. activeSoundList: [],
  177. soundList: [],
  178. soundLists: [],
  179. changeList: [],
  180. multipleSelection: [], // 列表选择的集合
  181. teamList: [], // 选择的乐团集合
  182. activeTeam: '', // 选中的乐团
  183. chioseSoundList: [],//根据选中的乐团id获取的声部集合
  184. activeChioseSound: '', // 选中声部的集合
  185. studentList: [] // 选择列表中的学生
  186. }
  187. },
  188. created () {
  189. this.teamList = this.getTeamList;
  190. },
  191. mounted () {
  192. this.payfor = this.$store.getters.payList;
  193. this.isLoop = this.payfor.student.chiose || 0;
  194. getSoundTree().then(res => {
  195. // console.log(res);
  196. if (res.code == 200) {
  197. this.soundList = res.data.rows;
  198. // // 生成动态的checkList
  199. for (let key in this.soundList) {
  200. this.$set(this.soundLists, key, [])
  201. }
  202. }
  203. })
  204. },
  205. methods: {
  206. handleSelectionChange () { },
  207. handleclick () { },
  208. // 删除
  209. removeListItem () {
  210. for (let i = 0; i < this.activeSoundList.length; i++) {
  211. for (let j = 0; j < this.multipleSelection.length; j++) {
  212. if (this.activeSoundList[i].id == this.multipleSelection[j].id) {
  213. this.activeSoundList.splice(i, 1);
  214. // 遍历循环所有的group 删除所选id
  215. for (let key in this.soundLists) {
  216. if (this.soundLists[key].indexOf(this.multipleSelection[j].id) != -1) {
  217. // console.log(this.soundLists[key], this.multipleSelection[j].id, this.soundLists[key].indexOf(this.multipleSelection[j].id));
  218. this.soundLists[key].splice(this.soundLists[key].indexOf(this.multipleSelection[j].id), 1)
  219. }
  220. }
  221. }
  222. }
  223. }
  224. },
  225. addListItem () {
  226. this.dialogTableVisible = true;
  227. },
  228. // 点击确认按钮生成表单
  229. generates () {
  230. this.dialogTableVisible = false;
  231. },
  232. checkinlist (obj) {
  233. let flag = false;
  234. this.activeSoundList.map(item => {
  235. if (item.id == obj.id) {
  236. flag = true
  237. }
  238. })
  239. if (!flag) {
  240. this.activeSoundList.push(obj)
  241. } else {
  242. for (let i = 0; i < this.activeSoundList.length; i++) {
  243. if (this.activeSoundList[i].id == obj.id) {
  244. this.activeSoundList.splice(i, 1);
  245. }
  246. }
  247. }
  248. },
  249. handleSelectionChange (e) {
  250. // 点击改变勾选
  251. this.multipleSelection = e;
  252. },
  253. // 点击添加学生
  254. resetStudent (row) {
  255. // 乐团id 声部id
  256. },
  257. handleSelectionChange (val) {
  258. },
  259. chioseTeam () {
  260. // console.log(this.activeTeam)
  261. // 发请求 获取乐团下的所有声部
  262. findSound({ musicGroupId: this.activeTeam }).then(res => {
  263. if (res.code == 200) {
  264. this.chioseSoundList = res.data;
  265. }
  266. })
  267. },
  268. searchStudent () {
  269. // activeTeam activeChioseSound
  270. if (!this.activeTeam || !this.activeChioseSound) {
  271. this.$message.error('请先选择乐团以及声部进行搜索')
  272. }
  273. // 筛选学生
  274. }
  275. },
  276. computed: {
  277. // 返回当前选中声部数量
  278. chioseSoundNum () {
  279. let num = 0;
  280. for (let key in this.soundList) {
  281. // console.log(this.soundLists[key])
  282. num += this.soundLists[key].length;
  283. }
  284. return num;
  285. },
  286. }
  287. }
  288. </script>
  289. <style lang="scss">
  290. .chioseWrap {
  291. margin-bottom: 30px;
  292. display: flex;
  293. flex-direction: row;
  294. padding: 0 25px;
  295. p {
  296. font-size: 14px;
  297. margin-right: 30px;
  298. }
  299. }
  300. .subTitle {
  301. width: 1203px;
  302. height: 40px;
  303. line-height: 40px;
  304. background-color: #fefceb;
  305. padding: 0 25px;
  306. box-sizing: border-box;
  307. font-size: 16px;
  308. color: #474747;
  309. margin-bottom: 20px;
  310. }
  311. .floor {
  312. display: flex;
  313. flex-direction: row;
  314. justify-content: flex-start;
  315. width: 100%;
  316. height: 48px;
  317. line-height: 48px;
  318. background: rgba(237, 238, 240, 1);
  319. font-size: 14px;
  320. color: #444;
  321. align-items: center;
  322. position: relative;
  323. z-index: 1;
  324. .remove {
  325. width: 98px;
  326. height: 32px;
  327. background: rgba(248, 80, 67, 1);
  328. border-radius: 3px;
  329. color: #fff;
  330. line-height: 32px;
  331. text-align: center;
  332. margin-left: 164px;
  333. cursor: pointer;
  334. }
  335. .add {
  336. width: 98px;
  337. height: 32px;
  338. background: rgba(20, 146, 138, 1);
  339. border-radius: 3px;
  340. color: #fff;
  341. line-height: 32px;
  342. text-align: center;
  343. margin-left: 20px;
  344. cursor: pointer;
  345. }
  346. }
  347. .studentMask {
  348. display: flex;
  349. flex-direction: row;
  350. justify-content: flex-start;
  351. .left {
  352. width: 200px;
  353. margin-right: 20px;
  354. h4 {
  355. font-size: 16px;
  356. color: #444;
  357. line-height: 38px;
  358. margin-bottom: 10px;
  359. }
  360. .chioseStudentList {
  361. height: 500px;
  362. overflow-y: auto;
  363. border: 1px solid #ccc;
  364. .studentItem {
  365. padding: 10px;
  366. }
  367. }
  368. }
  369. .right {
  370. overflow-y: auto;
  371. }
  372. }
  373. </style>