index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <el-page-header @back="onCancel">
  5. <template slot="content">
  6. <div
  7. class="hearConcat"
  8. @click="gotoArchices"
  9. v-if="permission('/musicArchices')"
  10. >
  11. <el-tooltip placement="top" popper-class="mTooltip">
  12. <div slot="content">乐团档案</div>
  13. <div class="titleWrap">
  14. <p>{{ teamName }}</p>
  15. <img :src="archices" alt="" class="archices" />
  16. </div>
  17. </el-tooltip>
  18. </div>
  19. <div v-else>
  20. <p>{{ teamName }}</p>
  21. </div>
  22. </template>
  23. </el-page-header>
  24. </h2>
  25. <div class="m-core">
  26. <el-popover
  27. placement="left"
  28. :append-to-body="false"
  29. width="1000"
  30. trigger="hover"
  31. ref="popover"
  32. :open-delay="500"
  33. @show="setpopover()"
  34. >
  35. <!-- @setpopover='setpopover' -->
  36. <teamJournal :teamid="teamid" />
  37. <!-- v-if="team_status" -->
  38. <p slot="reference" class="msg" :class="team_status">
  39. <img
  40. :src="stepImgs[team_status]"
  41. alt=""
  42. v-if="stepImgs[team_status]"
  43. />
  44. {{ musicGroupType[team_status] }}
  45. </p>
  46. </el-popover>
  47. <!-- navMenu -->
  48. <tab-router
  49. v-model="activeIndex"
  50. type="card"
  51. ref="tab"
  52. :before-leave="checkGoTo"
  53. >
  54. <!-- @tab-click="handleClick" -->
  55. <el-tab-pane
  56. label="基本信息"
  57. lazy
  58. v-if="permission('/teamBaseInfo')"
  59. name="1"
  60. >
  61. <!-- v-if="activeIndex == 'teamBaseInfo'" -->
  62. <teamBaseInfo
  63. ref="teamBaseInfo"
  64. v-if="activeIndex == '1'"
  65. @getBaseInfo="getBaseInfo"
  66. :baseInfo="baseInfo"
  67. @getName="getName"
  68. @handleClick="handleClick"
  69. />
  70. </el-tab-pane>
  71. <el-tab-pane
  72. label="声部设置"
  73. lazy
  74. v-if="permission('/teamSoundMoney')"
  75. name="2"
  76. :disabled="!teamid"
  77. >
  78. <resetSound v-if="activeIndex == '2'" />
  79. </el-tab-pane>
  80. <el-tab-pane
  81. lazy
  82. label="预报名信息"
  83. name="9"
  84. :disabled="!teamid"
  85. v-if="permission('/teamForecastNameIndex')"
  86. >
  87. <!-- v-if="
  88. team_status == 'PRE_APPLY' ||
  89. team_status == 'PRE_BUILD_FEE' ||
  90. team_status == 'FEE_AUDIT' ||
  91. team_status == 'APPLY'
  92. " -->
  93. <forecastNameList
  94. v-if="activeIndex == '9'"
  95. :isedit="team_status == 'PRE_APPLY'"
  96. />
  97. </el-tab-pane>
  98. <el-tab-pane
  99. label="学员缴费设置"
  100. lazy
  101. v-if="permission('/teamStudentPayList')"
  102. name="3"
  103. :disabled="!teamid"
  104. >
  105. <resetPayList
  106. v-if="activeIndex == '3'"
  107. @changeActive="handleClick"
  108. @getBaseInfo="getBaseInfo"
  109. />
  110. </el-tab-pane>
  111. <el-tab-pane
  112. label="学校缴费设置"
  113. lazy
  114. v-if="permission('/teamSchoolPayList')"
  115. name="6"
  116. :disabled="!teamid"
  117. >
  118. <resetPayListSchool
  119. v-if="activeIndex == '6'"
  120. @changeActive="handleClick"
  121. @getBaseInfo="getBaseInfo"
  122. />
  123. </el-tab-pane>
  124. <el-tab-pane
  125. label="报名缴费"
  126. :disabled="!teamid"
  127. name="11"
  128. v-if="permission('/teamSignupList')"
  129. >
  130. <teamSignupList :teamid="teamid" v-if="activeIndex == 11" />
  131. </el-tab-pane>
  132. <el-tab-pane
  133. lazy
  134. label="乐器清单"
  135. name="10"
  136. :disabled="!teamid"
  137. v-if="permission('/teamMusicList')"
  138. >
  139. <musicOrder v-if="activeIndex == '10'" />
  140. </el-tab-pane>
  141. <el-tab-pane
  142. label="老师列表"
  143. v-if="permission('/teamTeacherList')"
  144. name="4"
  145. :disabled="!teamid"
  146. >
  147. <teacherList :teamid="teamid" v-if="activeIndex == '4'" />
  148. </el-tab-pane>
  149. <el-tab-pane
  150. label="学生列表"
  151. v-if="permission('/teamStudentList')"
  152. name="7"
  153. :disabled="!teamid"
  154. >
  155. <studentList :teamid="teamid" v-if="activeIndex == '7'" />
  156. </el-tab-pane>
  157. <el-tab-pane
  158. label="待激活团练宝"
  159. v-if="permission('/giveMemberList')"
  160. name="13"
  161. :disabled="!teamid"
  162. >
  163. <giveMemberList :teamid="teamid" v-if="activeIndex == '13'" />
  164. </el-tab-pane>
  165. <el-tab-pane
  166. label="剩余时长"
  167. lazy
  168. v-if="permission('/teamRemainTime')"
  169. name="12"
  170. :disabled="!teamid"
  171. >
  172. <teamRemainTime
  173. v-if="activeIndex == '12' && musicGroupInfo"
  174. :musicGroupInfo="musicGroupInfo"
  175. />
  176. </el-tab-pane>
  177. <el-tab-pane
  178. label="班级列表"
  179. lazy
  180. v-if="permission('/teamClassListInfo')"
  181. name="5"
  182. :disabled="!teamid"
  183. >
  184. <resetClass
  185. v-if="activeIndex == '5' && musicGroupInfo"
  186. :musicGroupInfo="musicGroupInfo"
  187. />
  188. </el-tab-pane>
  189. <el-tab-pane
  190. label="课表详情"
  191. lazy
  192. v-if="permission('/teamCourseListInfo')"
  193. name="8"
  194. :disabled="!teamid"
  195. >
  196. <courseList v-if="activeIndex == '8'" :teamid="teamid" />
  197. </el-tab-pane>
  198. <!-- v-if="permission('/resetTeaming/coursePlan')" -->
  199. <!-- <el-tab-pane
  200. label="乐团档案"
  201. :disabled="!teamid"
  202. name="13"
  203. v-if="permission('/teamJournal')"
  204. >
  205. <musicArchives :teamid="teamid" v-if="activeIndex == 13" />
  206. </el-tab-pane> -->
  207. </tab-router>
  208. </div>
  209. </div>
  210. </template>
  211. <script>
  212. import teamBaseInfo from "@/views/teamBuild/components/teamBaseInfo";
  213. // import resetSound from "@/views/resetTeaming/components/resetSoundv2";
  214. import resetSound from "@/views/teamBuild/components/teamSoundSet";
  215. import resetClass from "@/views/teamDetail/components/resetClass";
  216. // import coursePlan from '@/views/teamBuild/teamSeting/components/coursePlan'
  217. // import lookCourse from '@/views/teamBuild/teamSeting/components/lookCourse'
  218. // import improvement from '@/views/teamBuild/teamSeting/components/improvementClass'
  219. import teamSignupList from "@/views/teamBuild/signupList";
  220. import resetPayList from "@/views/resetTeaming/components/resetPayList";
  221. import resetPayListSchool from "@/views/resetTeaming/components/resetPayListSchool";
  222. import studentPayBase from "@/views/resetTeaming/components/studentPayBase";
  223. import musicArchives from "@/views/resetTeaming/components/musicArchices";
  224. import studentList from "@/views/teamDetail/components/studentList";
  225. import teacherList from "@/views/teamDetail/components/teacherList";
  226. import courseList from "@/views/teamDetail/components/courseList";
  227. import giveMemberList from "@/views/resetTeaming/components/giveMemberList";
  228. import forecastNameList from "@/views/teamBuild/forecastNameList";
  229. // import forecastName from "@/views/teamBuild/forecastName";
  230. import musicOrder from "@/views/teamDetail/teamDetailedList";
  231. import teamJournal from "@/views/teamBuild/components/teamJournal";
  232. import teamRemainTime from "@/views/teamBuild/components/teamRemainTime";
  233. import merge from "webpack-merge";
  234. import { permission } from "@/utils/directivePage";
  235. import { getTeamBaseInfo } from "@/api/buildTeam";
  236. import { musicGroupType } from "@/constant";
  237. // forecastName,
  238. export default {
  239. components: {
  240. teamBaseInfo,
  241. resetSound,
  242. resetClass,
  243. resetPayList,
  244. resetPayListSchool,
  245. studentPayBase,
  246. studentList,
  247. teacherList,
  248. courseList,
  249. musicOrder,
  250. teamJournal,
  251. teamRemainTime,
  252. teamSignupList,
  253. musicArchives,
  254. forecastNameList,
  255. giveMemberList,
  256. },
  257. name: "resetTeaming",
  258. data() {
  259. return {
  260. visible: false,
  261. activeIndex: "1",
  262. teamid: "",
  263. baseInfo: null,
  264. // permissionStatus: {
  265. // teamBaseInfo: true,
  266. // resetSound: true,
  267. // resetClass: true,
  268. // resetSound: true,
  269. // coursePlan: true,
  270. // }
  271. name: null,
  272. teamName: "新建乐团",
  273. musicGroupInfo: null,
  274. musicGroupType,
  275. team_status: "",
  276. archices: require("@/assets/images/base/archices.png"),
  277. stepImgs: {
  278. AUDIT_FAILED: require("@/assets/images/base/end.png"),
  279. CANCELED: require("@/assets/images/base/end.png"),
  280. CLOSE: require("@/assets/images/base/end.png"),
  281. PAUSE: require("@/assets/images/base/end.png"),
  282. PROGRESS: require("@/assets/images/base/ing.png"),
  283. DRAFT: require("@/assets/images/base/ing.png"),
  284. AUDIT: require("@/assets/images/base/ing.png"),
  285. PRE_APPLY: require("@/assets/images/base/ing.png"),
  286. PRE_BUILD_FEE: require("@/assets/images/base/ing.png"),
  287. FEE_AUDIT: require("@/assets/images/base/ing.png"),
  288. APPLY: require("@/assets/images/base/clock.png"),
  289. PAY: require("@/assets/images/base/pay.png"),
  290. PREPARE: require("@/assets/images/base/ing.png"),
  291. },
  292. };
  293. },
  294. created() {
  295. // this.__init()
  296. },
  297. beforeDestroy() {
  298. // localStorage.setItem('setStep', 0)
  299. // localStorage.setItem('resetCode', 1)
  300. //
  301. },
  302. mounted() {
  303. // let obj = {}
  304. // obj.name = this.activeIndex
  305. // console.log(this.activeIndex)
  306. // this.handleClick(obj)
  307. this.__init();
  308. // console.log('权限',this.permission('/musicArchices'))
  309. },
  310. async beforeRouteLeave(to, from, next) {
  311. if (this.activeIndex == 1) {
  312. // console.log(await this.$refs.teamBaseInfo.setStore('go'))
  313. if (await this.$refs.teamBaseInfo.setStore("go")) {
  314. next();
  315. }
  316. } else {
  317. next();
  318. }
  319. },
  320. // activated () {
  321. // let obj = {}
  322. // obj.name = this.activeIndex
  323. // this.handleClick(obj)
  324. // this.__init()
  325. // },
  326. methods: {
  327. __init() {
  328. // this.activeIndex = localStorage.getItem('resetCode') || '1';
  329. this.teamid = this.$route.query.id;
  330. this.team_status = this.$route.query.team_status;
  331. if (this.$route.query.tabrouter != 1 && this.teamid) {
  332. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  333. if (res.code == 200) {
  334. this.getBaseInfo(res.data);
  335. }
  336. });
  337. }
  338. },
  339. onCancel() {
  340. this.$store.dispatch("delVisitedViews", this.$route);
  341. this.$router.push({ path: "/teamList" });
  342. },
  343. getBaseInfo(baseInfo) {
  344. if (baseInfo) {
  345. this.baseInfo = baseInfo;
  346. if (baseInfo?.musicGroup?.name) {
  347. this.teamName = baseInfo?.musicGroup?.name;
  348. }
  349. this.musicGroupInfo = baseInfo?.musicGroup;
  350. // 在这里刷新一下 乐团状态 改变url
  351. // query: merge(this.$route.query, {
  352. // type: "teamDraft",
  353. // id: res.data,
  354. // team_status: "DRAFT",
  355. // }),
  356. this.$router.push({
  357. query: merge(this.$route.query, {
  358. ...this.$route.query,
  359. team_status: this.musicGroupInfo.status,
  360. }),
  361. });
  362. this.team_status = this.$route.query.team_status;
  363. // console.log(this.musicGroupInfo.status);
  364. } else {
  365. this.__init();
  366. }
  367. },
  368. handleClick(val) {
  369. this.teamid = this.$route.query.id;
  370. // if (val.name != 1 && this.$refs.teamBaseInfo) {
  371. // await this.$refs.teamBaseInfo.setStore();
  372. // this.activeIndex = val.name
  373. // }else{
  374. // this.activeIndex = val.name
  375. // }
  376. // this.team_status = this.$route.query.team_status;
  377. // console.log('切换tab',val)
  378. this.$refs.tab.tab(val);
  379. },
  380. permission(str) {
  381. return permission(str);
  382. },
  383. getName(val) {
  384. if (val) {
  385. this.teamName = val;
  386. }
  387. this.teamid = this.$route.query.id;
  388. },
  389. checkGoTo() {
  390. var p = new Promise(async (resolve, reject) => {
  391. if (this.activeIndex == 1 && this.$refs.teamBaseInfo) {
  392. if (await this.$refs.teamBaseInfo.setStore("go")) {
  393. resolve();
  394. }
  395. } else {
  396. resolve();
  397. }
  398. });
  399. return p;
  400. },
  401. setpopover(scope) {
  402. this.$nextTick(() => {
  403. // this.visible = true;
  404. this.$refs.popover.updatePopper();
  405. });
  406. },
  407. gotoArchices() {
  408. console.log("跳转");
  409. this.$router.push({
  410. path: "/business/musicArchices",
  411. query: { ...this.$route.query },
  412. });
  413. },
  414. },
  415. watch: {
  416. // async activeIndex(val){
  417. // if(val != 1&&this.$refs.teamBaseInfo){
  418. // await this.$refs.teamBaseInfo.setStore();
  419. // }
  420. // }
  421. },
  422. };
  423. </script>
  424. <style lang="scss" scoped>
  425. // AUDIT_FAILED: require("@/assets/images/base/end.png"),
  426. // CANCELED: require("@/assets/images/base/end.png"),
  427. // CLOSE: require("@/assets/images/base/end.png"),
  428. // PAUSE: require("@/assets/images/base/end.png"),
  429. // PROGRESS: require("@/assets/images/base/ing.png"),
  430. // DRAFT: require("@/assets/images/base/ing.png"),
  431. // AUDIT: require("@/assets/images/base/ing.png"),
  432. // PRE_APPLY: require("@/assets/images/base/ing.png"),
  433. // PRE_BUILD_FEE: require("@/assets/images/base/ing.png"),
  434. // FEE_AUDIT: require("@/assets/images/base/ing.png"),
  435. // APPLYL: require("@/assets/images/base/clock.png"),
  436. // PAY: require("@/assets/images/base/pay.png"),
  437. // PREPARE: require("@/assets/images/base/ing.png"),
  438. .msg.PAY {
  439. color: #f85043;
  440. }
  441. .msg.APPLY {
  442. color: #f97215;
  443. }
  444. .msg.AUDIT_FAILED,
  445. .msg.CANCELED,
  446. .msg.CLOSE,
  447. .msg.PAUSE {
  448. color: #777;
  449. }
  450. .msg {
  451. color: var(--color-primary);
  452. text-align: right;
  453. // color: #777;
  454. font-size: 32px;
  455. font-weight: bold;
  456. cursor: pointer;
  457. position: absolute;
  458. right: 40px;
  459. top: -55px;
  460. z-index: 990;
  461. img {
  462. width: 36px;
  463. height: 36px;
  464. position: relative;
  465. top: 5px;
  466. margin-right: 8px;
  467. }
  468. }
  469. .archices {
  470. width: 24px;
  471. height: 24px;
  472. margin-left: 10px;
  473. cursor: pointer;
  474. }
  475. .hearConcat {
  476. cursor: pointer;
  477. display: flex;
  478. flex-direction: row;
  479. align-items: center;
  480. img {
  481. width: 24px;
  482. height: 24px;
  483. position: relative;
  484. top: 0px;
  485. margin-right: 8px;
  486. }
  487. }
  488. /deep/.el-page-header__left {
  489. align-items: center;
  490. }
  491. .archicesName {
  492. cursor: pointer;
  493. }
  494. .titleWrap {
  495. display: flex;
  496. flex-direction: row;
  497. align-items: center;
  498. }
  499. </style>