teamList.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>
  5. 乐团管理
  6. <filter-search
  7. @reload="reloadSearch"
  8. :moreKeys="['organId']"
  9. :keys="['searchType']"
  10. v-if="permission('/teamList/abnormal')"
  11. />
  12. </h2>
  13. <div class="m-core">
  14. <div class="btnList" style="margin-bottom: 20px">
  15. <el-button
  16. type="primary"
  17. v-if="permission('musicGroup/createGroup')"
  18. @click="createNewTeam"
  19. >新建乐团</el-button
  20. >
  21. </div>
  22. <save-form
  23. :inline="true"
  24. @submit="search"
  25. @reset="reset"
  26. class="topForm"
  27. ref="topForm"
  28. :model="topForm"
  29. >
  30. <el-form-item prop="search">
  31. <el-input
  32. v-model.trim="topForm.search"
  33. clearable
  34. @keyup.enter.native="search"
  35. placeholder="请输入乐团名称"
  36. ></el-input>
  37. </el-form-item>
  38. <el-form-item prop="orgin">
  39. <el-select
  40. class="multiple"
  41. v-model.trim="topForm.orgin"
  42. filterable
  43. multiple
  44. collapse-tags
  45. clearable
  46. placeholder="请选择分部"
  47. @change="onBranchChange"
  48. >
  49. <el-option
  50. v-for="(item, index) in organList"
  51. :key="index"
  52. :label="item.name"
  53. :value="item.id"
  54. ></el-option>
  55. </el-select>
  56. </el-form-item>
  57. <el-form-item prop="cooperationOrganId">
  58. <el-select
  59. class="multiple"
  60. :disabled="!topForm.orgin.length > 0"
  61. v-model.trim="topForm.cooperationOrganId"
  62. filterable
  63. clearable
  64. placeholder="请选择合作单位"
  65. >
  66. <el-option
  67. v-for="(item, index) in cooperationList"
  68. :key="index"
  69. :label="item.name"
  70. :value="item.id"
  71. ></el-option>
  72. </el-select>
  73. </el-form-item>
  74. <el-form-item prop="status">
  75. <el-select
  76. class="multiple"
  77. v-model.trim="topForm.status"
  78. filterable
  79. clearable
  80. placeholder="请选择乐团状态"
  81. >
  82. <el-option
  83. v-for="(item, index) in nowStatus"
  84. :key="index"
  85. :label="item.label"
  86. :value="item.value"
  87. ></el-option>
  88. </el-select>
  89. </el-form-item>
  90. <!-- 收费类型 -->
  91. <el-form-item prop="payType">
  92. <el-select
  93. v-model.trim="topForm.payType"
  94. filterable
  95. placeholder="请选择收费类型"
  96. clearable
  97. >
  98. <el-option
  99. v-for="(item, index) in typeList"
  100. :key="index"
  101. :label="item.name"
  102. :value="item.id"
  103. ></el-option>
  104. </el-select>
  105. </el-form-item>
  106. <el-form-item prop="courseViewType">
  107. <el-select
  108. v-model.trim="topForm.courseViewType"
  109. filterable
  110. placeholder="请选择收费模式"
  111. clearable
  112. >
  113. <el-option
  114. :label="item.label"
  115. :value="item.value"
  116. v-for="item in courseViewTypeList"
  117. :key="item.value"
  118. ></el-option>
  119. </el-select>
  120. </el-form-item>
  121. <el-form-item prop="createTimer">
  122. <el-date-picker
  123. v-model.trim="topForm.createTimer"
  124. style="width: 420px"
  125. type="daterange"
  126. value-format="yyyy-MM-dd"
  127. range-separator="至"
  128. start-placeholder="申请开始日期"
  129. end-placeholder="申请结束日期"
  130. :picker-options="{
  131. firstDayOfWeek: 1,
  132. }"
  133. ></el-date-picker>
  134. </el-form-item>
  135. <el-form-item prop="billTimer">
  136. <el-date-picker
  137. v-model.trim="topForm.billTimer"
  138. style="width: 420px"
  139. type="daterange"
  140. value-format="yyyy-MM-dd"
  141. range-separator="至"
  142. start-placeholder="成团开始日期"
  143. end-placeholder="成团结束日期"
  144. :picker-options="{
  145. firstDayOfWeek: 1,
  146. }"
  147. ></el-date-picker>
  148. </el-form-item>
  149. <el-form-item>
  150. <el-button type="danger" native-type="submit">搜索</el-button>
  151. </el-form-item>
  152. <el-form-item>
  153. <el-button type="primary" native-type="reset">重置</el-button>
  154. </el-form-item>
  155. <el-form-item>
  156. <el-button
  157. type="primary"
  158. v-permission="'export/musicGroup'"
  159. @click="onExport"
  160. >导出</el-button
  161. >
  162. </el-form-item>
  163. </save-form>
  164. <div class="tableWrap">
  165. <el-table
  166. style="width: 100%"
  167. @selection-change="handleSelectionChange"
  168. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  169. :data="tableData"
  170. >
  171. <!-- <el-table-column type="selection"
  172. :selectable="checkSelectable"
  173. width="50">
  174. </el-table-column> -->
  175. <el-table-column
  176. prop="organName"
  177. align="center"
  178. label="所属分部"
  179. ></el-table-column>
  180. <el-table-column
  181. prop="id"
  182. width="100"
  183. align="center"
  184. label="乐团编号"
  185. >
  186. <template slot-scope="scope">
  187. <copy-text>
  188. {{ scope.row.id }}
  189. </copy-text>
  190. </template>
  191. </el-table-column>
  192. <el-table-column
  193. prop="name"
  194. width="200px"
  195. align="center"
  196. label="乐团名称"
  197. >
  198. <template slot-scope="scope">
  199. <p>
  200. {{ scope.row.name }}
  201. </p>
  202. </template>
  203. </el-table-column>
  204. <el-table-column
  205. align="center"
  206. width="200px"
  207. prop="cooperationOrganName"
  208. max-width="274"
  209. label="合作单位"
  210. >
  211. </el-table-column>
  212. <el-table-column prop="status" align="center" label="乐团状态">
  213. <template slot-scope="scope">
  214. <div>
  215. {{ scope.row.status | musicGroupType }}
  216. </div>
  217. </template>
  218. </el-table-column>
  219. <el-table-column prop="status" align="center" label="收费模式">
  220. <template slot-scope="scope">
  221. <div>
  222. {{ scope.row.courseViewType | courseViewType }}
  223. </div>
  224. </template>
  225. </el-table-column>
  226. <el-table-column
  227. align="center"
  228. prop="chargeTypeName"
  229. label="收费类型"
  230. >
  231. </el-table-column>
  232. <el-table-column
  233. prop="educationalTeacherName"
  234. align="center"
  235. label="乐团主管"
  236. >
  237. </el-table-column>
  238. <!-- <el-table-column
  239. prop="teamTeacherName"
  240. align="center"
  241. label="运营主管"
  242. >
  243. </el-table-column> -->
  244. <el-table-column
  245. prop="groupMemberNum"
  246. align="center"
  247. label="成团人数"
  248. >
  249. </el-table-column>
  250. <el-table-column prop="payNum" align="center" label="在读人数">
  251. </el-table-column>
  252. <!-- <el-table-column prop="course"
  253. align='center'
  254. label="当前课时">
  255. </el-table-column> -->
  256. <el-table-column
  257. prop="createTime"
  258. width="100px"
  259. align="center"
  260. label="申请时间"
  261. >
  262. <template slot-scope="scope">
  263. <div>
  264. {{ scope.row.createTime | formatTimer }}
  265. </div>
  266. </template>
  267. </el-table-column>
  268. <el-table-column align="center" width="100px" label="成团时间">
  269. <template slot-scope="scope">
  270. <div>
  271. {{ scope.row.billStartDate | formatTimer }}
  272. </div>
  273. </template>
  274. </el-table-column>
  275. <el-table-column align="center" width="100px" label="清单状态">
  276. <template slot-scope="scope">
  277. <div>
  278. {{ scope.row.hasVerifyMusicalList ? "已确认" : "未确认" }}
  279. </div>
  280. </template>
  281. </el-table-column>
  282. <el-table-column
  283. align="center"
  284. width="220px"
  285. fixed="right"
  286. label="操作"
  287. >
  288. <template slot-scope="scope">
  289. <div>
  290. <!-- 审核中 编辑 -->
  291. <el-button
  292. type="text"
  293. v-if="
  294. scope.row.status == 'AUDIT' &&
  295. permission('musicGroup/auditSuccess')
  296. "
  297. @click="lookTeamDetail(scope.row)"
  298. >审核</el-button
  299. >
  300. <el-button
  301. type="text"
  302. v-if="
  303. scope.row.status == 'DRAFT' &&
  304. permission('musicGroup/update')
  305. "
  306. @click="lookTeamDetail(scope.row)"
  307. >编辑</el-button
  308. >
  309. <!-- 审核失败 编辑 -->
  310. <el-button
  311. type="text"
  312. v-if="
  313. scope.row.status == 'AUDIT_FAILED' &&
  314. permission('musicGroup/update')
  315. "
  316. @click="lookTeamDetail(scope.row)"
  317. >编辑</el-button
  318. >
  319. <!-- 报名中缴费中筹备中查看乐团 -->
  320. <el-button
  321. type="text"
  322. v-if="
  323. (scope.row.status == 'PRE_APPLY' ||
  324. scope.row.status == 'PAUSE' ||
  325. scope.row.status == 'PRE_BUILD_FEE' ||
  326. scope.row.status == 'PROGRESS' ||
  327. scope.row.status == 'CANCELED' ||
  328. scope.row.status == 'APPLY' ||
  329. scope.row.status == 'PAY' ||
  330. scope.row.status == 'PREPARE' ||
  331. scope.row.status == 'CLOSE' ||
  332. scope.row.status == 'FEE_AUDIT') &&
  333. permission('/resetTeaming')
  334. "
  335. @click="lookTeamDetail(scope.row)"
  336. >详情</el-button
  337. >
  338. <!-- <el-button
  339. v-if="permission('recharge/findAll')"
  340. type="text"
  341. @click="lookSteam(scope.row)"
  342. >乐团日志</el-button
  343. > -->
  344. <!-- 进行中 关闭 -->
  345. <el-button
  346. type="text"
  347. v-if="
  348. scope.row.status == 'PROGRESS' &&
  349. permission('musicGroup/closeMusicGroup')
  350. "
  351. @click="closeTeamDetail(scope.row)"
  352. >关闭</el-button
  353. >
  354. <!-- 进行中 查看 -->
  355. <!-- <el-button
  356. type="text"
  357. v-if="
  358. scope.row.status == 'PROGRESS' && permission('/teamDetails')
  359. "
  360. @click="lookTeamDetail(scope.row)"
  361. >查看</el-button
  362. > -->
  363. <el-button
  364. type="text"
  365. v-if="
  366. (scope.row.status == 'DRAFT' ||
  367. scope.row.status == 'AUDIT' ||
  368. scope.row.status == 'FEE_AUDIT' ||
  369. scope.row.status == 'APPLY' ||
  370. scope.row.status == 'PAY' ||
  371. scope.row.status == 'PRE_APPLY' ||
  372. scope.row.status == 'PRE_BUILD_FEE') &&
  373. permission('musicGroup/cancelMusicGroup')
  374. "
  375. @click="stopTeam(scope.row)"
  376. >取消乐团</el-button
  377. >
  378. <el-button
  379. v-if="
  380. scope.row.status == 'PREPARE' &&
  381. permission('musicGroup/action')
  382. "
  383. @click="startTeam(scope.row)"
  384. type="text"
  385. >确认成团</el-button
  386. >
  387. <!-- <el-button type="text"
  388. v-if="scope.row.status == 'AUDIT' && permission('musicGroup/cancelMusicGroup')"
  389. @click="stopTeam(scope.row)">取消乐团</el-button> -->
  390. <el-button
  391. v-if="
  392. scope.row.status == 'PAUSE' &&
  393. permission('musicGroup/resumeMusicGroup')
  394. "
  395. @click="onTeamOpeation('start', scope.row)"
  396. type="text"
  397. >启动</el-button
  398. >
  399. <el-button
  400. v-if="
  401. scope.row.status == 'PROGRESS' &&
  402. permission('musicGroup/pauseMusicGroup')
  403. "
  404. @click="onTeamOpeation('pause', scope.row)"
  405. type="text"
  406. >暂停</el-button
  407. >
  408. <el-button
  409. v-if="
  410. scope.row.status == 'CANCELED' &&
  411. permission('musicGroup/deleteMusicGroup')
  412. "
  413. @click="deteleTeaming(scope.row)"
  414. type="text"
  415. >删除</el-button
  416. >
  417. </div>
  418. </template>
  419. </el-table-column>
  420. </el-table>
  421. <!-- 分页器 -->
  422. <!-- 分页 -->
  423. <pagination
  424. sync
  425. :total.sync="rules.total"
  426. :page.sync="rules.page"
  427. :limit.sync="rules.limit"
  428. :page-sizes="rules.page_size"
  429. @pagination="getList"
  430. />
  431. </div>
  432. <el-dialog :visible.sync="showSteam" width="500px" title="乐团流程">
  433. <teamSteam :activeId="activeId" />
  434. <div slot="footer" class="dialog-footer">
  435. <el-button type="primary" @click="showSteam = false">确 定</el-button>
  436. </div>
  437. </el-dialog>
  438. <el-dialog :visible.sync="closeVisible" title="确认学员" width="800px">
  439. <closeStudens
  440. v-if="closeVisible"
  441. :detail="closeDetail"
  442. @close="closeVisible = false"
  443. @submited="getList"
  444. />
  445. </el-dialog>
  446. </div>
  447. </div>
  448. </template>
  449. <script>
  450. import pagination from "@/components/Pagination/index";
  451. import { getTeamList, getPayType } from "@/api/teamServer";
  452. import qs from "qs";
  453. import cleanDeep from "clean-deep";
  454. import {
  455. getCooperation,
  456. cancelMusicGroup,
  457. startTeam,
  458. getEmployeeOrgan,
  459. pauseMusicGroup,
  460. resumeMusicGroup,
  461. deleteMusicGroup,
  462. } from "@/api/buildTeam";
  463. import { musicGroupStatus, courseViewTypeList } from "@/utils/searchArray";
  464. import { isObject } from "util";
  465. import { permission } from "@/utils/directivePage";
  466. import teamSteam from "./teamListComponent/teamSteam";
  467. import closeStudens from "../teamBuild/modals/close-studens";
  468. import { getTimes } from "@/utils";
  469. import { Export } from "@/utils/downLoadFile";
  470. import { queryByOrganId } from "@/api/systemManage";
  471. import Tooltip from "@/components/Tooltip/index";
  472. export default {
  473. name: "teamList",
  474. data() {
  475. return {
  476. courseViewTypeList,
  477. closeDetail: {},
  478. closeVisible: false,
  479. topForm: {
  480. search: "",
  481. status: "",
  482. payType: "",
  483. word: "",
  484. orgin: [],
  485. courseViewType: "",
  486. billTimer: [],
  487. createTimer: [],
  488. cooperationOrganId: null,
  489. },
  490. organList: [],
  491. typeList: [], // 收费类型
  492. nowStatus: musicGroupStatus,
  493. searchLsit: [], // 存储选择后的数组
  494. tableData: [], // table数据
  495. rules: {
  496. // 分页规则
  497. limit: 10, // 限制显示条数
  498. page: 1, // 当前页
  499. total: 0, // 总条数
  500. page_size: [10, 20, 40, 50], // 选择限制显示条数
  501. },
  502. passed: [], // 传递的参数
  503. showSteam: false,
  504. activeId: null,
  505. cooperationList: [],
  506. };
  507. },
  508. components: {
  509. pagination,
  510. teamSteam,
  511. closeStudens,
  512. Tooltip,
  513. },
  514. mounted() {
  515. const { query } = this.$route;
  516. if (query.organId) {
  517. this.topForm.orgin = [];
  518. this.topForm.orgin.push(query.organId);
  519. // this.topForm.orgin = query.organId;
  520. }
  521. if (query.search) {
  522. this.topForm.search = query.search;
  523. }
  524. if (this.topForm.orgin.length > 0) {
  525. this.onBranchChange(this.topForm.orgin);
  526. }
  527. this.init();
  528. },
  529. activated() {
  530. this.init();
  531. },
  532. methods: {
  533. reloadSearch() {
  534. this.rules.page = 1;
  535. this.getList();
  536. },
  537. init() {
  538. localStorage.setItem("resetCode", "1");
  539. getEmployeeOrgan().then((res) => {
  540. if (res.code == 200) {
  541. this.organList = res.data;
  542. }
  543. });
  544. // 获取乐团收费类型
  545. getPayType().then((res) => {
  546. if (res.code == 200) {
  547. this.typeList = res.data.rows;
  548. }
  549. });
  550. // 获取乐团合作单位(学校)
  551. // getCooperation().then(res => {
  552. // })
  553. this.getList();
  554. },
  555. permission(str) {
  556. return permission(str);
  557. },
  558. reset() {
  559. this.rules.page = 1;
  560. this.$refs["topForm"].resetFields();
  561. this.getList();
  562. },
  563. search() {
  564. this.rules.page = 1;
  565. this.getList();
  566. },
  567. getList() {
  568. let { createTimer, billTimer, ...reset } = this.topForm;
  569. getTeamList({
  570. rows: this.rules.limit,
  571. page: this.rules.page,
  572. organId: this.topForm.orgin.join(","),
  573. chargeTypeId: this.topForm.payType || null,
  574. search: this.topForm.search || null,
  575. musicGroupStatus: this.topForm.status || null,
  576. courseViewType: this.topForm.courseViewType || null,
  577. cooperationOrganId: this.topForm.cooperationOrganId || null,
  578. searchType: this.$route.query.searchType,
  579. ...getTimes(
  580. createTimer,
  581. ["createStartDate", "createEndDate"],
  582. "YYYY-MM-DD"
  583. ),
  584. ...getTimes(billTimer, ["billStartDate", "billEndDate"], "YYYY-MM-DD"),
  585. }).then((res) => {
  586. if (res.code == 200) {
  587. this.tableData = res.data.rows;
  588. this.rules.total = res.data.total;
  589. }
  590. });
  591. },
  592. createNewTeam() {
  593. // this.$store.dispatch("buildIndex", 0);
  594. // this.$store.dispatch("delVisitedViews", { path: "/business/teamBuild" });
  595. localStorage.removeItem(`newTeambase`);
  596. this.$router.push(
  597. {
  598. path: "/business/resetTeaming",
  599. query: { type: "newTeam", team_status: "newTeam" },
  600. },
  601. (router) => {
  602. router.meta.title = "新建乐团";
  603. }
  604. );
  605. },
  606. resetTeam() {
  607. // 这里还有勾选的乐团信息
  608. if (this.passed && this.passed.length <= 0) {
  609. this.$message.error("请至少选择一个乐团进行调整");
  610. return;
  611. }
  612. this.$router.push({
  613. path: "/business/teamDraft",
  614. query: { type: "teamList", teamList: this.passed },
  615. });
  616. },
  617. resetTeaming(row) {
  618. // 修改进行中的乐团
  619. localStorage.removeItem(`${row.id}base`);
  620. localStorage.removeItem(`${row.id}sound`);
  621. this.$nextTick((res) => {
  622. this.$router.push({
  623. path: "/business/resetTeaming",
  624. query: { type: "resetTeam", id: row.id },
  625. });
  626. });
  627. },
  628. setSearchList(obj) {
  629. //
  630. // 没有相同的key=>添加这个对象
  631. // 有相同的key => 替换这个对象
  632. if (obj.type == 1) {
  633. let flag = false;
  634. this.searchLsit = this.searchLsit.map((item) => {
  635. if (item.id == obj.id) {
  636. item = obj;
  637. flag = true;
  638. }
  639. return item;
  640. });
  641. if (!flag) {
  642. this.searchLsit.push(obj);
  643. }
  644. } else {
  645. let flag = false;
  646. this.searchLsit = this.searchLsit.map((item) => {
  647. if (item.key == obj.key) {
  648. // 多选框的再次点击=> 等于 就是删除
  649. item = obj;
  650. flag = true;
  651. }
  652. return item;
  653. });
  654. if (!flag) {
  655. this.searchLsit.push(obj);
  656. }
  657. }
  658. },
  659. closeSearch(item) {
  660. // 1.删除search里的元素
  661. if (item.type == 1) {
  662. for (let some in this.searchLsit) {
  663. if (this.searchLsit[some].id == item.id) {
  664. this.searchLsit.splice(some, 1);
  665. }
  666. }
  667. // 2.清空对应元素所对应的的值
  668. this.topForm[item.id] = "";
  669. } else {
  670. for (let i = 0; i < this.topForm[item.id].length; i++) {
  671. if (this.topForm[item.id][i] == item.value) {
  672. this.topForm[item.id].splice(i, 1);
  673. }
  674. }
  675. // 处理search
  676. for (let some in this.searchLsit) {
  677. if (
  678. this.searchLsit[some].value == item.value &&
  679. this.searchLsit[some].id == item.id
  680. ) {
  681. this.searchLsit.splice(some, 1);
  682. }
  683. // id: 'school', key: this.schools[item].text, value: val, type: 1
  684. }
  685. }
  686. },
  687. closeTeamDetail(row) {
  688. this.closeVisible = true;
  689. this.closeDetail = { ...row };
  690. },
  691. onTeamOpeation(type, row) {
  692. if (type == "start") {
  693. this.$confirm("是否确定开启乐团?", "提示", {
  694. confirmButtonText: "确定",
  695. cancelButtonText: "取消",
  696. type: "warning",
  697. })
  698. .then(() => {
  699. resumeMusicGroup({ musicGroupId: row.id }).then((res) => {
  700. if (res.code == 200) {
  701. this.$message.success("开启成功");
  702. this.getList();
  703. } else {
  704. this.$message.error(res.msg);
  705. }
  706. });
  707. })
  708. .catch(() => {});
  709. } else if (type == "pause") {
  710. this.$confirm("是否确定暂停乐团?", "提示", {
  711. confirmButtonText: "确定",
  712. cancelButtonText: "取消",
  713. type: "warning",
  714. })
  715. .then(() => {
  716. pauseMusicGroup({ musicGroupId: row.id }).then((res) => {
  717. if (res.code == 200) {
  718. this.$message.success("暂停成功");
  719. this.getList();
  720. } else {
  721. this.$message.error(res.msg);
  722. }
  723. });
  724. })
  725. .catch(() => {});
  726. }
  727. },
  728. gotoSearch() {
  729. this.$refs["topForm"].resetFields();
  730. this.searchLsit = [];
  731. },
  732. lookTeamCourse(row) {
  733. // 查看课表
  734. this.$router.push({
  735. path: "/teamListCourse",
  736. query: { id: row.id, name: row.name },
  737. });
  738. },
  739. lookTeamDetail(row) {
  740. localStorage.removeItem(`${row.id}base`);
  741. localStorage.removeItem(`${row.id}sound`);
  742. localStorage.removeItem("newTeambase");
  743. switch (row.status) {
  744. case "DRAFT": {
  745. // 编辑中
  746. this.$store.dispatch("draftIndex", 0);
  747. // teamBaseInfo
  748. // this.$router.push(
  749. // {
  750. // path: "/business/teamDraft",
  751. // query: { type: "teamDraft", id: row.id ,clear:'true'},
  752. // },
  753. // (router) => {
  754. // router.meta.title = "编辑乐团";
  755. // }
  756. // );
  757. this.$router.push(
  758. {
  759. path: "/business/resetTeaming",
  760. query: { type: "teamDraft", id: row.id, team_status: row.status },
  761. },
  762. (router) => {
  763. router.meta.title = "乐团编辑中";
  764. }
  765. );
  766. break;
  767. }
  768. case "AUDIT": {
  769. // 审核中
  770. this.$store.dispatch("draftIndex", 0);
  771. this.$router.push(
  772. {
  773. path: "/business/resetTeaming",
  774. query: {
  775. type: "teamAudit",
  776. id: row.id,
  777. clear: "true",
  778. team_status: row.status,
  779. },
  780. },
  781. (router) => {
  782. router.meta.title = "乐团审核中";
  783. }
  784. );
  785. break;
  786. }
  787. case "PRE_BUILD_FEE": {
  788. // 创建缴费中
  789. // this.$router.push({
  790. // path: "/business/createPayment",
  791. // query: { type: "PRE_BUILD_FEE", id: row.id, name: row.name },
  792. // });
  793. this.$router.push(
  794. {
  795. path: "/business/resetTeaming",
  796. query: {
  797. type: "look",
  798. id: row.id,
  799. name: row.name,
  800. team_status: "PRE_BUILD_FEE",
  801. tabrouter: 3,
  802. },
  803. },
  804. (router) => {
  805. router.meta.title = "创建缴费中";
  806. }
  807. );
  808. break;
  809. }
  810. case "FEE_AUDIT": {
  811. // 费用审核中
  812. this.$store.dispatch("draftIndex", 0);
  813. this.$router.push(
  814. {
  815. path: "/business/resetTeaming",
  816. query: {
  817. type: "feeAudit",
  818. id: row.id,
  819. clear: "true",
  820. team_status: row.status,
  821. },
  822. },
  823. (router) => {
  824. router.meta.title = "乐团费用审核中";
  825. }
  826. );
  827. break;
  828. }
  829. case "AUDIT_FAILED": {
  830. // 审核失败
  831. this.$store.dispatch("draftIndex", 0);
  832. this.$router.push(
  833. {
  834. path: "/business/resetTeaming",
  835. query: {
  836. type: "teamDraft",
  837. id: row.id,
  838. clear: "true",
  839. team_status: row.status,
  840. },
  841. },
  842. (router) => {
  843. router.meta.title = "乐团审核失败";
  844. }
  845. );
  846. break;
  847. }
  848. case "PRE_APPLY": {
  849. // 预报名
  850. this.$router.push(
  851. {
  852. path: "/business/resetTeaming",
  853. query: {
  854. type: "look",
  855. id: row.id,
  856. name: row.name,
  857. team_status: "PRE_APPLY",
  858. tabrouter: 9,
  859. },
  860. },
  861. (router) => {
  862. router.meta.title = "乐团预报名";
  863. }
  864. );
  865. // this.$router.push({
  866. // path: "/business/forecastName",
  867. // query: { id: row.id, name: row.name },
  868. // });
  869. break;
  870. }
  871. case "APPLY": {
  872. // 报名中
  873. this.$router.push(
  874. {
  875. path: `/business/resetTeaming`,
  876. query: {
  877. status: row.status,
  878. id: row.id,
  879. name: row.name,
  880. team_status: "APPLY",
  881. type: "look",
  882. tabrouter: 11,
  883. },
  884. },
  885. (router) => {
  886. router.meta.title = "乐团报名中";
  887. }
  888. );
  889. break;
  890. }
  891. case "PAY": {
  892. // 缴费中
  893. this.$router.push(
  894. {
  895. path: `/business/resetTeaming`,
  896. query: {
  897. status: row.status,
  898. id: row.id,
  899. name: row.name,
  900. team_status: "PAY",
  901. type: "look",
  902. tabrouter: 11,
  903. },
  904. },
  905. (router) => {
  906. router.meta.title = "乐团缴费中";
  907. }
  908. );
  909. break;
  910. }
  911. case "PREPARE": {
  912. // 筹备中 跳转到乐团设置界面
  913. this.$router.push(
  914. {
  915. path: `/business/resetTeaming`,
  916. query: {
  917. type: "look",
  918. status: row.status,
  919. id: row.id,
  920. name: row.name,
  921. team_status: row.status,
  922. tabrouter: 10,
  923. },
  924. },
  925. (router) => {
  926. router.meta.title = "乐团筹备中";
  927. }
  928. );
  929. break;
  930. }
  931. case "PROGRESS": {
  932. // 进行中
  933. // 调到乐团详情 teamDetails
  934. this.$router.push(
  935. {
  936. path: `/business/resetTeaming`,
  937. query: {
  938. status: row.status,
  939. id: row.id,
  940. name: row.name,
  941. organId: row.organId,
  942. type: "resetTeam",
  943. team_status: row.status,
  944. },
  945. },
  946. (router) => {
  947. router.meta.title = "乐团进行中";
  948. }
  949. );
  950. break;
  951. }
  952. case "CANCELED": {
  953. // 取消
  954. this.$router.push(
  955. {
  956. path: "/business/resetTeaming",
  957. query: {
  958. type: "teamCanceled",
  959. id: row.id,
  960. team_status: row.status,
  961. },
  962. },
  963. (router) => {
  964. router.meta.title = "取消乐团";
  965. }
  966. );
  967. break;
  968. }
  969. case "PAUSE": {
  970. // 暂停
  971. // this.$router.push({
  972. // path: `/teamLists`,
  973. // query: { status: row.status, id: row.id, name: row.name },
  974. // });
  975. this.$router.push(
  976. {
  977. path: "/business/resetTeaming",
  978. query: { type: "resetTeam", id: row.id, team_status: row.status },
  979. },
  980. (router) => {
  981. router.meta.title = "乐团暂停";
  982. }
  983. );
  984. break;
  985. }
  986. case "CLOSE": {
  987. this.$router.push(
  988. {
  989. path: `/business/resetTeaming`,
  990. query: {
  991. status: row.status,
  992. id: row.id,
  993. name: row.name,
  994. team_status: "CLOSE",
  995. type: "look",
  996. },
  997. },
  998. (router) => {
  999. router.meta.title = "乐团关闭";
  1000. }
  1001. );
  1002. }
  1003. }
  1004. },
  1005. checkSelectable(row) {
  1006. return row.status == "PROGRESS";
  1007. },
  1008. handleSelectionChange(arr) {
  1009. this.passed = [];
  1010. for (let i in arr) {
  1011. let obj = {};
  1012. obj.id = arr[i].id;
  1013. obj.name = arr[i].name;
  1014. this.passed.push(obj);
  1015. }
  1016. },
  1017. gotodetailList(row) {
  1018. this.$router.push({
  1019. path: "/teamListedList",
  1020. query: { id: row.id },
  1021. });
  1022. },
  1023. //
  1024. lookTeamInfo(row) {
  1025. localStorage.removeItem(`${row.id}base`);
  1026. localStorage.removeItem(`${row.id}sound`);
  1027. this.$router.push({
  1028. path: "/business/teamLookBase",
  1029. query: {
  1030. type: "look",
  1031. id: row.id,
  1032. name: row.name,
  1033. team_status: row.status,
  1034. },
  1035. });
  1036. },
  1037. // setImprovement 设置基础技能班
  1038. gotoImprovement(row) {
  1039. let search = JSON.stringify(this.topForm);
  1040. let rules = JSON.stringify(this.rules);
  1041. this.$router.push({
  1042. path: "/business/setImprovement",
  1043. query: { id: row.id },
  1044. });
  1045. },
  1046. // 停止乐团
  1047. stopTeam(row) {
  1048. this.$confirm("您确定取消申请乐团?", "提示", {
  1049. confirmButtonText: "确定",
  1050. cancelButtonText: "取消",
  1051. type: "warning",
  1052. })
  1053. .then(() => {
  1054. cancelMusicGroup({
  1055. musicGroupId: row.id,
  1056. }).then((res) => {
  1057. if (res.code == 200) {
  1058. this.$message.success("停止成功");
  1059. this.getList();
  1060. }
  1061. });
  1062. })
  1063. .catch(() => {});
  1064. },
  1065. // 确认成团
  1066. startTeam(row) {
  1067. this.$confirm("是否确定成团?", "提示", {
  1068. confirmButtonText: "确定",
  1069. cancelButtonText: "取消",
  1070. type: "warning",
  1071. })
  1072. .then(() => {
  1073. startTeam({ musicGroupId: row.id }).then((res) => {
  1074. if (res.code == 200) {
  1075. this.$message.success("开启乐团成功");
  1076. this.getList();
  1077. }
  1078. });
  1079. })
  1080. .catch(() => {});
  1081. },
  1082. deteleTeaming(row) {
  1083. this.$confirm("您确定删除该乐团?", "提示", {
  1084. confirmButtonText: "确定",
  1085. cancelButtonText: "取消",
  1086. type: "warning",
  1087. })
  1088. .then(() => {
  1089. deleteMusicGroup({
  1090. musicGroupId: row.id,
  1091. }).then((res) => {
  1092. if (res.code == 200) {
  1093. this.$message.success("删除成功");
  1094. this.getList();
  1095. }
  1096. });
  1097. })
  1098. .catch(() => {});
  1099. },
  1100. lookSteam(row) {
  1101. this.activeId = row.id;
  1102. this.showSteam = true;
  1103. },
  1104. gotoSigin(row) {
  1105. this.$router.push(
  1106. {
  1107. path: `/business/remedy`,
  1108. query: { status: row.status, id: row.id, name: row.name },
  1109. },
  1110. (router) => {
  1111. router.meta.title = "报名详情";
  1112. }
  1113. );
  1114. },
  1115. async onExport() {
  1116. let { createTimer, billTimer, ...reset } = this.topForm;
  1117. let obj = {
  1118. ...reset,
  1119. organId: this.topForm.orgin.join(",") || null,
  1120. ...getTimes(
  1121. createTimer,
  1122. ["createStartDate", "createEndDate"],
  1123. "YYYY-MM-DD"
  1124. ),
  1125. ...getTimes(billTimer, ["billStartDate", "billEndDate"], "YYYY-MM-DD"),
  1126. };
  1127. await Export(
  1128. this,
  1129. {
  1130. url: "/api-web/export/musicGroup",
  1131. fileName: "乐团列表.xls",
  1132. method: "post",
  1133. params: qs.stringify(cleanDeep(obj)),
  1134. },
  1135. "您确定导出乐团列表?"
  1136. );
  1137. },
  1138. async onBranchChange(value) {
  1139. if (!value) {
  1140. this.cooperationList = [];
  1141. this.topForm.cooperationOrganId = null;
  1142. return;
  1143. }
  1144. // 合作单位
  1145. await queryByOrganId({ organId: value.join(",") }).then((res) => {
  1146. if (res.code == 200) {
  1147. this.cooperationList = res.data;
  1148. this.topForm.cooperationOrganId = null;
  1149. }
  1150. });
  1151. },
  1152. },
  1153. watch: {
  1154. showSteam(val) {
  1155. if (!val) {
  1156. this.activeId = null;
  1157. }
  1158. },
  1159. },
  1160. };
  1161. </script>
  1162. <style lang="scss" scoped>
  1163. /deep/.el-button + .el-button {
  1164. margin-left: 0px;
  1165. }
  1166. .select {
  1167. font-size: 14px;
  1168. }
  1169. .btnList {
  1170. display: flex;
  1171. flex-direction: row;
  1172. justify-content: flex-start;
  1173. align-items: center;
  1174. .exportBtn {
  1175. margin-left: 15px;
  1176. }
  1177. }
  1178. </style>