index.vue 14 KB

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