teamList.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>乐团列表
  5. </h2>
  6. <div class="m-core">
  7. <div class="btnList">
  8. <div class='newBand'
  9. v-permission="'/teamBuild'"
  10. @click="createNewTeam">新建乐团</div>
  11. <div class='newBand'
  12. v-permission="'/teamBuild/trimming'"
  13. @click="resetTeam">乐团调整</div>
  14. </div>
  15. <el-form :inline="true"
  16. class="topForm"
  17. ref="topForm"
  18. :model="topForm">
  19. <el-form-item prop='teamName'>
  20. <el-input v-model.trim="topForm.teamName"
  21. @keyup.enter.native='search'
  22. placeholder="请输入乐团名称"></el-input>
  23. </el-form-item>
  24. <el-form-item prop='orgin'>
  25. <el-select class='multiple'
  26. v-model.trim="topForm.orgin"
  27. filterable
  28. clearable
  29. placeholder="请选择分部">
  30. <el-option v-for="(item,index) in organList"
  31. :key="index"
  32. :label="item.name"
  33. :value="item.id"></el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item prop='status'>
  37. <el-select class='multiple'
  38. v-model.trim="topForm.status"
  39. filterable
  40. clearable
  41. placeholder="请选择乐团状态">
  42. <el-option v-for="(item,index) in nowStatus"
  43. :key="index"
  44. :label="item.text"
  45. :value="item.value"></el-option>
  46. </el-select>
  47. </el-form-item>
  48. <!-- 收费类型 -->
  49. <el-form-item prop='payType'>
  50. <el-select v-model.trim="topForm.payType"
  51. filterable
  52. placeholder="请选择收费类型"
  53. clearable>
  54. <el-option v-for="(item,index) in typeList"
  55. :key='index'
  56. :label="item.name"
  57. :value="item.id"></el-option>
  58. </el-select>
  59. </el-form-item>
  60. <el-form-item>
  61. <el-button type='danger'
  62. @click="search">搜索</el-button>
  63. </el-form-item>
  64. <el-form-item>
  65. <el-button type='primary'
  66. @click="reset">重置</el-button>
  67. </el-form-item>
  68. </el-form>
  69. <div class="tableWrap">
  70. <el-table style="width: 100%"
  71. @selection-change="handleSelectionChange"
  72. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  73. :data='tableData'>
  74. <el-table-column type="selection"
  75. :selectable="checkSelectable"
  76. width="50">
  77. </el-table-column>
  78. <el-table-column prop="id"
  79. width="100"
  80. align='center'
  81. label="乐团编号">
  82. </el-table-column>
  83. <el-table-column prop="name"
  84. width="200px"
  85. align='center'
  86. label="乐团名称">
  87. </el-table-column>
  88. <el-table-column align='center'
  89. width="200px"
  90. prop="cooperationOrganName"
  91. max-width='274'
  92. label="合作单位">
  93. </el-table-column>
  94. <el-table-column prop="status"
  95. align='center'
  96. label="乐团状态">
  97. <template slot-scope="scope">
  98. <div>
  99. {{ scope.row.status | teamStatus }}
  100. </div>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align='center'
  104. prop="chargeTypeName"
  105. label="收费类型">
  106. </el-table-column>
  107. <el-table-column prop="educationalTeacherName"
  108. align='center'
  109. label="教务老师">
  110. </el-table-column>
  111. <el-table-column prop="teamTeacherName"
  112. align='center'
  113. label="运营主管">
  114. </el-table-column>
  115. <el-table-column prop="groupMemberNum"
  116. align='center'
  117. label="成团人数">
  118. </el-table-column>
  119. <el-table-column prop="payNum"
  120. align='center'
  121. label="在读人数">
  122. </el-table-column>
  123. <!-- <el-table-column prop="course"
  124. align='center'
  125. label="当前课时">
  126. </el-table-column> -->
  127. <el-table-column prop="createTime"
  128. width='100px'
  129. align='center'
  130. label="申请时间">
  131. <template slot-scope="scope">
  132. <div>
  133. {{ scope.row.createTime | formatTimer}}
  134. </div>
  135. </template>
  136. </el-table-column>
  137. <el-table-column align='center'
  138. width='100px'
  139. label="成团时间">
  140. <template slot-scope="scope">
  141. <div>
  142. {{ scope.row.billStartDate | formatTimer}}
  143. </div>
  144. </template>
  145. </el-table-column>
  146. <el-table-column align='center'
  147. width='100px'
  148. label="清单状况">
  149. <template slot-scope="scope">
  150. <div>
  151. {{ scope.row.hasVerifyMusicalList?'已确认':'未确认'}}
  152. </div>
  153. </template>
  154. </el-table-column>
  155. <el-table-column align='center'
  156. width='220px'
  157. fixed="right"
  158. label="操作">
  159. <template slot-scope="scope">
  160. <div>
  161. <!-- <el-button type="text"
  162. v-if="scope.row.status == 'PREPARE' && permission('/setImprovement')"
  163. @click="gotoImprovement(scope.row)">基础技能班</el-button> -->
  164. <el-button type="text"
  165. v-if="scope.row.status == 'PREPARE' && permission('/teamDetailedList')"
  166. @click="gotodetailList(scope.row)">发放清单</el-button>
  167. <!-- <el-button type="text"
  168. v-if="scope.row.status == 'PREPARE'"
  169. @click="lookTeamCourse(scope.row)">查看课表</el-button> -->
  170. <!-- 报名中&缴费中 查看 -->
  171. <el-button type="text"
  172. v-if="(scope.row.status == 'APPLY'|| scope.row.status == 'PAY') && permission('/signupList')"
  173. @click="lookTeamDetail(scope.row)">查看</el-button>
  174. <!-- 报名中缴费中筹备中查看乐团 -->
  175. <el-button type="text"
  176. v-if="(scope.row.status == 'APPLY'|| scope.row.status == 'PAY' || scope.row.status == 'PREPARE') && permission('/teamLookBase')"
  177. @click="lookTeamInfo(scope.row)">乐团信息</el-button>
  178. <el-button v-if="permission('recharge/findAll')"
  179. type="text"
  180. @click="lookSteam(scope.row)">乐团日志</el-button>
  181. <!-- 进行中 查看 -->
  182. <el-button type="text"
  183. v-if="scope.row.status == 'PROGRESS' && permission('/teamDetails')"
  184. @click="lookTeamDetail(scope.row)">查看</el-button>
  185. <!-- 暂停中 查看 -->
  186. <el-button type="text"
  187. v-if="scope.row.status == 'PAUSE' && permission('musicGroup/pauseMusicGroup/look')"
  188. @click="lookTeamDetail(scope.row)">查看</el-button>
  189. <!-- <el-button type="text"
  190. v-if="scope.row.status != 'PROGRESS' && scope.row.status != 'CANCELED' && scope.row.status != 'PAUSE' && scope.row.status != 'APPLY'&& scope.row.status != 'PAY'"
  191. @click="lookTeamDetail(scope.row)">编辑</el-button> -->
  192. <!-- 筹备中 编辑 -->
  193. <el-button type="text"
  194. v-if="scope.row.status == 'PREPARE' && permission('teamDetail/teamSeting/update')"
  195. @click="lookTeamDetail(scope.row)">班级列表</el-button>
  196. <!-- 审核中 编辑 -->
  197. <el-button type="text"
  198. v-if="scope.row.status == 'AUDIT' && permission('teamDetail/audit/update')"
  199. @click="lookTeamDetail(scope.row)">编辑</el-button>
  200. <!-- 编辑中 编辑 -->
  201. <el-button type="text"
  202. v-if="scope.row.status == 'DRAFT' && permission('teamDetail/draft/update')"
  203. @click="lookTeamDetail(scope.row)">编辑</el-button>
  204. <el-button type="text"
  205. v-if="(scope.row.status == 'DRAFT' || scope.row.status == 'AUDIT' || (scope.row.status == 'APPLY'|| scope.row.status == 'PAY') && permission('musicGroup/cancelMusicGroup'))"
  206. @click="stopTeam(scope.row)">取消乐团</el-button>
  207. <!-- 审核失败 编辑 -->
  208. <el-button type="text"
  209. v-if="scope.row.status == 'AUDIT_FAILED' && permission('teamDetail/aduitFailed/update')"
  210. @click="lookTeamDetail(scope.row)">编辑</el-button>
  211. <el-button v-if="scope.row.status == 'PREPARE' && permission('musicGroup/action')"
  212. @click="startTeam(scope.row)"
  213. type="text">确认成团</el-button>
  214. <!-- <el-button type="text"
  215. v-if="scope.row.status == 'AUDIT' && permission('musicGroup/cancelMusicGroup')"
  216. @click="stopTeam(scope.row)">取消乐团</el-button> -->
  217. <el-button v-if="scope.row.status == 'PAUSE' && permission('musicGroup/resumeMusicGroup')"
  218. @click="onTeamOpeation('start', scope.row)"
  219. type="text">启动</el-button>
  220. <el-button v-if="scope.row.status == 'PROGRESS' && permission('musicGroup/pauseMusicGroup')"
  221. @click="onTeamOpeation('pause', scope.row)"
  222. type="text">暂停</el-button>
  223. <el-button v-if="scope.row.status == 'PROGRESS' && permission('/resetTeaming')"
  224. @click="resetTeaming(scope.row)"
  225. type="text">修改</el-button>
  226. <el-button v-if="scope.row.status == 'CANCELED' && permission('musicGroup/deleteMusicGroup')"
  227. @click="deteleTeaming(scope.row)"
  228. type="text">删除</el-button>
  229. </div>
  230. </template>
  231. </el-table-column>
  232. </el-table>
  233. <!-- 分页器 -->
  234. <!-- 分页 -->
  235. <pagination :total="rules.total"
  236. :page.sync="rules.page"
  237. :limit.sync="rules.limit"
  238. :page-sizes="rules.page_size"
  239. @pagination="getList" />
  240. </div>
  241. <el-dialog :visible.sync="showSteam"
  242. width="500px"
  243. title="乐团流程">
  244. <teamSteam :activeId='activeId' />
  245. <div slot="footer"
  246. class="dialog-footer">
  247. <el-button type="primary"
  248. @click="showSteam=false">确 定</el-button>
  249. </div>
  250. </el-dialog>
  251. </div>
  252. </div>
  253. </template>
  254. <script>
  255. import pagination from '@/components/Pagination/index'
  256. import { getTeamList, getPayType } from '@/api/teamServer'
  257. import { getCooperation, cancelMusicGroup, startTeam, getEmployeeOrgan, pauseMusicGroup, resumeMusicGroup, deleteMusicGroup } from '@/api/buildTeam'
  258. import { musicGroupStatus } from '@/utils/searchArray'
  259. import { isObject } from 'util'
  260. import { permission } from '@/utils/directivePage'
  261. import teamSteam from './teamListComponent/teamSteam'
  262. export default {
  263. name: "teamList",
  264. data () {
  265. return {
  266. topForm: {
  267. teamName: '',
  268. status: '',
  269. payType: '',
  270. word: '',
  271. orgin: ''
  272. },
  273. organList: [],
  274. typeList: [], // 收费类型
  275. nowStatus: musicGroupStatus,
  276. searchLsit: [], // 存储选择后的数组
  277. tableData: [], // table数据
  278. rules: {
  279. // 分页规则
  280. limit: 10, // 限制显示条数
  281. page: 1, // 当前页
  282. total: 0, // 总条数
  283. page_size: [10, 20, 40, 50] // 选择限制显示条数
  284. },
  285. passed: [], // 传递的参数
  286. showSteam: false,
  287. activeId: null
  288. }
  289. },
  290. components: {
  291. pagination,
  292. teamSteam
  293. },
  294. mounted () {
  295. this.init();
  296. },
  297. activated () {
  298. this.init();
  299. },
  300. methods: {
  301. init () {
  302. if (this.$route.query.search) {
  303. this.$route.query.search instanceof Object ? this.topForm = this.$route.query.search : this.topForm = JSON.parse(this.$route.query.search);
  304. }
  305. if (this.$route.query.rules) {
  306. this.$route.query.rules instanceof Object ? this.rules = this.$route.query.rules : this.rules = JSON.parse(this.$route.query.rules);
  307. }
  308. sessionStorage.setItem('resetCode', '1')
  309. getEmployeeOrgan().then(res => {
  310. if (res.code == 200) {
  311. this.organList = res.data;
  312. }
  313. })
  314. // 获取乐团收费类型
  315. getPayType().then(res => {
  316. if (res.code == 200) {
  317. this.typeList = res.data.rows;
  318. }
  319. })
  320. // 获取乐团合作单位(学校)
  321. // getCooperation().then(res => {
  322. // })
  323. this.getList();
  324. },
  325. permission (str) {
  326. return permission(str)
  327. },
  328. reset () {
  329. this.rules.page = 1;
  330. this.$refs['topForm'].resetFields();
  331. this.getList()
  332. },
  333. search () {
  334. this.rules.page = 1;
  335. this.getList();
  336. },
  337. getList () {
  338. getTeamList({
  339. rows: this.rules.limit,
  340. page: this.rules.page,
  341. organId: this.topForm.orgin || null,
  342. chargeTypeId: this.topForm.payType || null,
  343. musicGroupName: this.topForm.teamName || null,
  344. musicGroupStatus: this.topForm.status || null,
  345. }).then(res => {
  346. if (res.code == 200) {
  347. this.tableData = res.data.rows
  348. this.rules.total = res.data.total
  349. }
  350. })
  351. },
  352. createNewTeam () {
  353. let search = JSON.stringify(this.topForm)
  354. let rules = JSON.stringify(this.rules)
  355. this.$router.push({ path: '/business/teamBuild', query: { type: 'newTeam', search, rules } })
  356. },
  357. resetTeam () {
  358. // 这里还有勾选的乐团信息
  359. if (this.passed && this.passed.length <= 0) {
  360. this.$message.error('请至少选择一个乐团进行调整')
  361. return
  362. }
  363. let search = JSON.stringify(this.topForm)
  364. let rules = JSON.stringify(this.rules)
  365. this.$router.push({ path: '/business/teamBuild', query: { type: 'teamList', teamList: this.passed, search, rules } })
  366. },
  367. resetTeaming (row) {
  368. // 修改进行中的乐团
  369. let search = JSON.stringify(this.topForm)
  370. let rules = JSON.stringify(this.rules)
  371. this.$router.push({ path: '/business/resetTeaming', query: { type: 'resetTeam', id: row.id, search, rules } })
  372. },
  373. setSearchList (obj) {
  374. //
  375. // 没有相同的key=>添加这个对象
  376. // 有相同的key => 替换这个对象
  377. if (obj.type == 1) {
  378. let flag = false;
  379. this.searchLsit = this.searchLsit.map(item => {
  380. if (item.id == obj.id) {
  381. item = obj;
  382. flag = true;
  383. }
  384. return item;
  385. })
  386. if (!flag) {
  387. this.searchLsit.push(obj)
  388. }
  389. } else {
  390. let flag = false;
  391. this.searchLsit = this.searchLsit.map(item => {
  392. if (item.key == obj.key) {
  393. // 多选框的再次点击=> 等于 就是删除
  394. item = obj;
  395. flag = true;
  396. }
  397. return item;
  398. })
  399. if (!flag) {
  400. this.searchLsit.push(obj)
  401. }
  402. }
  403. },
  404. closeSearch (item) {
  405. // 1.删除search里的元素
  406. if (item.type == 1) {
  407. for (let some in this.searchLsit) {
  408. if (this.searchLsit[some].id == item.id) {
  409. this.searchLsit.splice(some, 1);
  410. }
  411. }
  412. // 2.清空对应元素所对应的的值
  413. this.topForm[item.id] = '';
  414. } else {
  415. for (let i = 0; i < this.topForm[item.id].length; i++) {
  416. if (this.topForm[item.id][i] == item.value) {
  417. this.topForm[item.id].splice(i, 1);
  418. }
  419. }
  420. // 处理search
  421. for (let some in this.searchLsit) {
  422. if (this.searchLsit[some].value == item.value && this.searchLsit[some].id == item.id) {
  423. this.searchLsit.splice(some, 1);
  424. }
  425. // id: 'school', key: this.schools[item].text, value: val, type: 1
  426. }
  427. }
  428. },
  429. onTeamOpeation (type, row) {
  430. if (type == 'start') {
  431. this.$confirm('是否确定开启乐团?', '提示', {
  432. confirmButtonText: '确定',
  433. cancelButtonText: '取消',
  434. type: 'warning'
  435. }).then(() => {
  436. resumeMusicGroup({ musicGroupId: row.id }).then(res => {
  437. if (res.code == 200) {
  438. this.$message.success('开启成功')
  439. this.getList()
  440. } else {
  441. this.$message.error(res.msg)
  442. }
  443. })
  444. }).catch(() => { })
  445. } else if (type == 'pause') {
  446. this.$confirm('是否确定暂停乐团?', '提示', {
  447. confirmButtonText: '确定',
  448. cancelButtonText: '取消',
  449. type: 'warning'
  450. }).then(() => {
  451. pauseMusicGroup({ musicGroupId: row.id }).then(res => {
  452. if (res.code == 200) {
  453. this.$message.success('暂停成功')
  454. this.getList()
  455. } else {
  456. this.$message.error(res.msg)
  457. }
  458. })
  459. }).catch(() => { })
  460. }
  461. },
  462. gotoSearch () {
  463. this.$refs['topForm'].resetFields();
  464. this.searchLsit = [];
  465. },
  466. lookTeamCourse (row) {
  467. // 查看课表
  468. let search = JSON.stringify(this.topForm)
  469. let rules = JSON.stringify(this.rules)
  470. this.$router.push({ path: '/business/teamDetailCourse', query: { id: row.id, name: row.name, search, rules } })
  471. },
  472. lookTeamDetail (row) {
  473. let search = JSON.stringify(this.topForm)
  474. let rules = JSON.stringify(this.rules)
  475. switch (row.status) {
  476. case 'DRAFT': {
  477. // 编辑中
  478. this.$router.push({ path: '/business/teamBuild', query: { type: 'teamDraft', id: row.id, search, rules } })
  479. break;
  480. }
  481. case 'AUDIT': {
  482. // 审核中
  483. this.$router.push({ path: '/business/teamBuild', query: { type: 'teamAudit', id: row.id, search, rules } })
  484. break;
  485. }
  486. case 'AUDIT_FAILED': {
  487. // 审核失败
  488. this.$router.push({ path: '/business/teamBuild', query: { type: 'teamDraft', id: row.id, search, rules } })
  489. break;
  490. }
  491. case 'APPLY': {
  492. // 报名中
  493. this.$router.push({ path: `/business/signupList`, query: { status: row.status, id: row.id, name: row.name, search, rules } })
  494. break;
  495. }
  496. case 'PAY': {
  497. // 缴费中
  498. this.$router.push({ path: `/business/signupList`, query: { status: row.status, id: row.id, name: row.name, search, rules } })
  499. break;
  500. }
  501. case 'PREPARE': {
  502. // 筹备中 跳转到乐团设置界面
  503. this.$router.push({ path: `/business/teamSeting`, query: { status: row.status, id: row.id, name: row.name, search, rules } })
  504. break;
  505. }
  506. case 'PROGRESS': {
  507. // 进行中
  508. // 调到乐团详情 teamDetails
  509. this.$router.push({ path: `/business/teamDetails`, query: { status: row.status, id: row.id, name: row.name, search, rules, organId: row.organId } })
  510. break
  511. }
  512. case 'CANCELED': {
  513. // 取消
  514. break
  515. }
  516. case 'PAUSE': {
  517. // 暂停
  518. this.$router.push({ path: `/business/teamDetails`, query: { status: row.status, id: row.id, name: row.name, search, rules } })
  519. break;
  520. }
  521. }
  522. },
  523. checkSelectable (row) {
  524. return row.status == 'PROGRESS'
  525. },
  526. handleSelectionChange (arr) {
  527. this.passed = [];
  528. for (let i in arr) {
  529. let obj = {};
  530. obj.id = arr[i].id;
  531. obj.name = arr[i].name;
  532. this.passed.push(obj)
  533. }
  534. },
  535. gotodetailList (row) {
  536. let search = JSON.stringify(this.topForm)
  537. let rules = JSON.stringify(this.rules)
  538. this.$router.push({ path: '/business/teamDetailedList', query: { id: row.id, search, rules } })
  539. },
  540. //
  541. lookTeamInfo (row) {
  542. let search = JSON.stringify(this.topForm)
  543. let rules = JSON.stringify(this.rules)
  544. this.$router.push({ path: '/business/teamLookBase', query: { type: 'look', id: row.id, name: row.name, search, rules } })
  545. },
  546. // setImprovement 设置基础技能班
  547. gotoImprovement (row) {
  548. let search = JSON.stringify(this.topForm)
  549. let rules = JSON.stringify(this.rules)
  550. this.$router.push({ path: '/business/setImprovement', query: { id: row.id, search, rules } })
  551. },
  552. // 停止乐团
  553. stopTeam (row) {
  554. this.$confirm('您确定取消申请乐团?', '提示', {
  555. confirmButtonText: '确定',
  556. cancelButtonText: '取消',
  557. type: 'warning'
  558. }).then(() => {
  559. cancelMusicGroup({
  560. musicGroupId: row.id
  561. }).then(res => {
  562. if (res.code == 200) {
  563. this.$message.success('停止成功')
  564. this.getList()
  565. }
  566. })
  567. }).catch(() => {
  568. })
  569. },
  570. // 确认成团
  571. startTeam (row) {
  572. this.$confirm('是否确定成团?', '提示', {
  573. confirmButtonText: '确定',
  574. cancelButtonText: '取消',
  575. type: 'warning'
  576. }).then(() => {
  577. startTeam({ musicGroupId: row.id }).then(res => {
  578. if (res.code == 200) {
  579. this.$message.success('开启乐团成功')
  580. this.getList();
  581. }
  582. })
  583. }).catch(() => { })
  584. },
  585. deteleTeaming (row) {
  586. this.$confirm('您确定删除该乐团?', '提示', {
  587. confirmButtonText: '确定',
  588. cancelButtonText: '取消',
  589. type: 'warning'
  590. }).then(() => {
  591. deleteMusicGroup({
  592. musicGroupId: row.id
  593. }).then(res => {
  594. if (res.code == 200) {
  595. this.$message.success('删除成功')
  596. this.getList()
  597. }
  598. })
  599. }).catch(() => {
  600. })
  601. },
  602. lookSteam (row) {
  603. this.activeId = row.id
  604. this.showSteam = true
  605. }
  606. },
  607. watch: {
  608. showSteam (val) {
  609. if (!val) {
  610. this.activeId = null
  611. }
  612. }
  613. }
  614. }
  615. </script>
  616. <style lang="scss" scoped>
  617. .select {
  618. font-size: 14px;
  619. }
  620. .btnList {
  621. display: flex;
  622. flex-direction: row;
  623. justify-content: flex-start;
  624. align-items: center;
  625. div {
  626. margin-right: 15px;
  627. }
  628. }
  629. </style>