index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  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. <!-- teamRemainTime -->
  158. <el-tab-pane
  159. label="剩余时长"
  160. lazy
  161. v-if="permission('/teamRemainTime')"
  162. name="12"
  163. :disabled="!teamid"
  164. >
  165. <teamRemainTime
  166. v-if="activeIndex == '12' && musicGroupInfo"
  167. :musicGroupInfo="musicGroupInfo"
  168. />
  169. </el-tab-pane>
  170. <el-tab-pane
  171. label="班级列表"
  172. lazy
  173. v-if="permission('/teamClassListInfo')"
  174. name="5"
  175. :disabled="!teamid"
  176. >
  177. <resetClass
  178. v-if="activeIndex == '5' && musicGroupInfo"
  179. :musicGroupInfo="musicGroupInfo"
  180. />
  181. </el-tab-pane>
  182. <el-tab-pane
  183. label="课表详情"
  184. lazy
  185. v-if="permission('/teamCourseListInfo')"
  186. name="8"
  187. :disabled="!teamid"
  188. >
  189. <courseList v-if="activeIndex == '8'" :teamid="teamid" />
  190. </el-tab-pane>
  191. <!-- v-if="permission('/resetTeaming/coursePlan')" -->
  192. <!-- <el-tab-pane
  193. label="乐团档案"
  194. :disabled="!teamid"
  195. name="13"
  196. v-if="permission('/teamJournal')"
  197. >
  198. <musicArchives :teamid="teamid" v-if="activeIndex == 13" />
  199. </el-tab-pane> -->
  200. </tab-router>
  201. </div>
  202. </div>
  203. </template>
  204. <script>
  205. import teamBaseInfo from "@/views/teamBuild/components/teamBaseInfo";
  206. // import resetSound from "@/views/resetTeaming/components/resetSoundv2";
  207. import resetSound from "@/views/teamBuild/components/teamSoundSet";
  208. import resetClass from "@/views/teamDetail/components/resetClass";
  209. // import coursePlan from '@/views/teamBuild/teamSeting/components/coursePlan'
  210. // import lookCourse from '@/views/teamBuild/teamSeting/components/lookCourse'
  211. // import improvement from '@/views/teamBuild/teamSeting/components/improvementClass'
  212. import teamSignupList from "@/views/teamBuild/signupList";
  213. import resetPayList from "@/views/resetTeaming/components/resetPayList";
  214. import resetPayListSchool from "@/views/resetTeaming/components/resetPayListSchool";
  215. import studentPayBase from "@/views/resetTeaming/components/studentPayBase";
  216. import musicArchives from "@/views/resetTeaming/components/musicArchices";
  217. import studentList from "@/views/teamDetail/components/studentList";
  218. import teacherList from "@/views/teamDetail/components/teacherList";
  219. import courseList from "@/views/teamDetail/components/courseList";
  220. import forecastNameList from "@/views/teamBuild/forecastNameList";
  221. // import forecastName from "@/views/teamBuild/forecastName";
  222. import musicOrder from "@/views/teamDetail/teamDetailedList";
  223. import teamJournal from "@/views/teamBuild/components/teamJournal";
  224. import teamRemainTime from "@/views/teamBuild/components/teamRemainTime";
  225. import merge from "webpack-merge";
  226. import { permission } from "@/utils/directivePage";
  227. import { getTeamBaseInfo } from "@/api/buildTeam";
  228. import { musicGroupType } from "@/constant";
  229. // forecastName,
  230. export default {
  231. components: {
  232. teamBaseInfo,
  233. resetSound,
  234. resetClass,
  235. resetPayList,
  236. resetPayListSchool,
  237. studentPayBase,
  238. studentList,
  239. teacherList,
  240. courseList,
  241. musicOrder,
  242. teamJournal,
  243. teamRemainTime,
  244. teamSignupList,
  245. musicArchives,
  246. forecastNameList
  247. },
  248. name: "resetTeaming",
  249. data() {
  250. return {
  251. visible:false,
  252. activeIndex: "1",
  253. teamid: "",
  254. baseInfo: null,
  255. // permissionStatus: {
  256. // teamBaseInfo: true,
  257. // resetSound: true,
  258. // resetClass: true,
  259. // resetSound: true,
  260. // coursePlan: true,
  261. // }
  262. name: null,
  263. teamName: "新建乐团",
  264. musicGroupInfo: null,
  265. musicGroupType,
  266. team_status: "",
  267. archices: require("@/assets/images/base/archices.png"),
  268. stepImgs: {
  269. AUDIT_FAILED: require("@/assets/images/base/end.png"),
  270. CANCELED: require("@/assets/images/base/end.png"),
  271. CLOSE: require("@/assets/images/base/end.png"),
  272. PAUSE: require("@/assets/images/base/end.png"),
  273. PROGRESS: require("@/assets/images/base/ing.png"),
  274. DRAFT: require("@/assets/images/base/ing.png"),
  275. AUDIT: require("@/assets/images/base/ing.png"),
  276. PRE_APPLY: require("@/assets/images/base/ing.png"),
  277. PRE_BUILD_FEE: require("@/assets/images/base/ing.png"),
  278. FEE_AUDIT: require("@/assets/images/base/ing.png"),
  279. APPLY: require("@/assets/images/base/clock.png"),
  280. PAY: require("@/assets/images/base/pay.png"),
  281. PREPARE: require("@/assets/images/base/ing.png"),
  282. },
  283. };
  284. },
  285. created() {
  286. // this.__init()
  287. },
  288. beforeDestroy() {
  289. // localStorage.setItem('setStep', 0)
  290. // localStorage.setItem('resetCode', 1)
  291. },
  292. mounted() {
  293. // let obj = {}
  294. // obj.name = this.activeIndex
  295. // console.log(this.activeIndex)
  296. // this.handleClick(obj)
  297. this.__init();
  298. // console.log('权限',this.permission('/musicArchices'))
  299. },
  300. async beforeRouteLeave(to, from, next) {
  301. if (this.activeIndex == 1) {
  302. // console.log(await this.$refs.teamBaseInfo.setStore('go'))
  303. if (await this.$refs.teamBaseInfo.setStore("go")) {
  304. next();
  305. }
  306. } else {
  307. next();
  308. }
  309. },
  310. // activated () {
  311. // let obj = {}
  312. // obj.name = this.activeIndex
  313. // this.handleClick(obj)
  314. // this.__init()
  315. // },
  316. methods: {
  317. __init() {
  318. // this.activeIndex = localStorage.getItem('resetCode') || '1';
  319. this.teamid = this.$route.query.id;
  320. this.team_status = this.$route.query.team_status;
  321. if (this.$route.query.tabrouter != 1 && this.teamid) {
  322. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  323. if (res.code == 200) {
  324. this.getBaseInfo(res.data);
  325. }
  326. });
  327. }
  328. },
  329. onCancel() {
  330. this.$store.dispatch("delVisitedViews", this.$route);
  331. this.$router.push({ path: "/teamList" });
  332. },
  333. getBaseInfo(baseInfo) {
  334. if (baseInfo) {
  335. this.baseInfo = baseInfo;
  336. if (baseInfo?.musicGroup?.name) {
  337. this.teamName = baseInfo?.musicGroup?.name;
  338. }
  339. this.musicGroupInfo = baseInfo?.musicGroup;
  340. // 在这里刷新一下 乐团状态 改变url
  341. // query: merge(this.$route.query, {
  342. // type: "teamDraft",
  343. // id: res.data,
  344. // team_status: "DRAFT",
  345. // }),
  346. this.$router.push({
  347. query: merge(this.$route.query, {
  348. ...this.$route.query,
  349. team_status: this.musicGroupInfo.status,
  350. }),
  351. });
  352. this.team_status = this.$route.query.team_status;
  353. // console.log(this.musicGroupInfo.status);
  354. } else {
  355. this.__init();
  356. }
  357. },
  358. handleClick(val) {
  359. this.teamid = this.$route.query.id;
  360. // if (val.name != 1 && this.$refs.teamBaseInfo) {
  361. // await this.$refs.teamBaseInfo.setStore();
  362. // this.activeIndex = val.name
  363. // }else{
  364. // this.activeIndex = val.name
  365. // }
  366. // this.team_status = this.$route.query.team_status;
  367. // console.log('切换tab',val)
  368. this.$refs.tab.tab(val);
  369. },
  370. permission(str) {
  371. return permission(str);
  372. },
  373. getName(val) {
  374. if (val) {
  375. this.teamName = val;
  376. }
  377. this.teamid = this.$route.query.id;
  378. },
  379. checkGoTo() {
  380. var p = new Promise(async (resolve, reject) => {
  381. if (this.activeIndex == 1 && this.$refs.teamBaseInfo) {
  382. if (await this.$refs.teamBaseInfo.setStore("go")) {
  383. resolve();
  384. }
  385. } else {
  386. resolve();
  387. }
  388. });
  389. return p;
  390. },
  391. setpopover(scope) {
  392. this.$nextTick(()=>{
  393. // this.visible = true;
  394. this.$refs.popover.updatePopper();
  395. })
  396. },
  397. gotoArchices() {
  398. console.log("跳转");
  399. this.$router.push({
  400. path: "/business/musicArchices",
  401. query: { ...this.$route.query },
  402. });
  403. },
  404. },
  405. watch: {
  406. // async activeIndex(val){
  407. // if(val != 1&&this.$refs.teamBaseInfo){
  408. // await this.$refs.teamBaseInfo.setStore();
  409. // }
  410. // }
  411. },
  412. };
  413. </script>
  414. <style lang="scss" scoped>
  415. // AUDIT_FAILED: require("@/assets/images/base/end.png"),
  416. // CANCELED: require("@/assets/images/base/end.png"),
  417. // CLOSE: require("@/assets/images/base/end.png"),
  418. // PAUSE: require("@/assets/images/base/end.png"),
  419. // PROGRESS: require("@/assets/images/base/ing.png"),
  420. // DRAFT: require("@/assets/images/base/ing.png"),
  421. // AUDIT: require("@/assets/images/base/ing.png"),
  422. // PRE_APPLY: require("@/assets/images/base/ing.png"),
  423. // PRE_BUILD_FEE: require("@/assets/images/base/ing.png"),
  424. // FEE_AUDIT: require("@/assets/images/base/ing.png"),
  425. // APPLYL: require("@/assets/images/base/clock.png"),
  426. // PAY: require("@/assets/images/base/pay.png"),
  427. // PREPARE: require("@/assets/images/base/ing.png"),
  428. .msg.PAY {
  429. color: #f85043;
  430. }
  431. .msg.APPLY {
  432. color: #f97215;
  433. }
  434. .msg.AUDIT_FAILED,
  435. .msg.CANCELED,
  436. .msg.CLOSE,
  437. .msg.PAUSE {
  438. color: #777;
  439. }
  440. .msg {
  441. color: #14928a;
  442. text-align: right;
  443. // color: #777;
  444. font-size: 32px;
  445. font-weight: bold;
  446. cursor: pointer;
  447. position: absolute;
  448. right: 40px;
  449. top: -55px;
  450. z-index: 990;
  451. img {
  452. width: 36px;
  453. height: 36px;
  454. position: relative;
  455. top: 5px;
  456. margin-right: 8px;
  457. }
  458. }
  459. .archices {
  460. width: 24px;
  461. height: 24px;
  462. margin-left: 10px;
  463. cursor: pointer;
  464. }
  465. .hearConcat {
  466. cursor: pointer;
  467. display: flex;
  468. flex-direction: row;
  469. align-items: center;
  470. img {
  471. width: 24px;
  472. height: 24px;
  473. position: relative;
  474. top: 0px;
  475. margin-right: 8px;
  476. }
  477. }
  478. /deep/.el-page-header__left {
  479. align-items: center;
  480. }
  481. .archicesName {
  482. cursor: pointer;
  483. }
  484. .titleWrap {
  485. display: flex;
  486. flex-direction: row;
  487. align-items: center;
  488. }
  489. </style>