index.vue 11 KB

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