index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <div class='set-container'>
  3. <div class="topWrap">
  4. <h2>
  5. <!-- <div class="squrt"></div> -->
  6. <el-page-header @back="goBack"
  7. :content="name">
  8. </el-page-header>
  9. </h2>
  10. <div class="stepbox"
  11. v-if="isOld">
  12. <span class='stepspan'
  13. @click="activeIndex=0">
  14. <div class="step1 sptep"
  15. :class="activeIndex >= 0?'activestep':''">
  16. 班级设置
  17. </div>
  18. <img :src="activeIndex >= 0?stepImgs.nol:stepImgs.active"
  19. alt=""
  20. class="arrow">
  21. </span>
  22. <span class='stepspan stepspan2'
  23. @click="activeIndex=2">
  24. <div class="step2 sptep"
  25. :class="activeIndex >= 2?'activestep':''">
  26. 课表
  27. </div>
  28. <img :src="activeIndex >= 2?stepImgs.nol:stepImgs.active"
  29. alt=""
  30. class="
  31. arrow">
  32. </span>
  33. <span class='stepspan stepspan2'
  34. v-permission="'/teamSetting/salarySet'"
  35. @click="activeIndex=4">
  36. <div class="step2 sptep"
  37. :class="activeIndex >= 4?'activestep':''">
  38. 课酬
  39. </div>
  40. <img :src="activeIndex >= 4?stepImgs.nol:stepImgs.active"
  41. alt=""
  42. class="
  43. arrow">
  44. </span>
  45. </div>
  46. </div>
  47. <!-- 下面显示的内容 -->
  48. <div class="stepcontent"
  49. v-if="isOld">
  50. <div v-if='activeIndex==0'>
  51. <classSeting :teamid='id'
  52. :isSetSalary='isSetSalary'
  53. @gotoNav='gotoNav' />
  54. </div>
  55. <div v-if='activeIndex==1'>
  56. <teacherSeting :teamid='id'
  57. :isSetSalary='isSetSalary'
  58. @gotoNav='gotoNav' />
  59. </div>
  60. <div v-if='activeIndex==2'>
  61. <div class="m-container">
  62. <lookCourse :isSetSalary='isSetSalary'
  63. @gotoNav='gotoNav' />
  64. </div>
  65. </div>
  66. <div v-if='activeIndex==3'>
  67. <improvement :teamid='id'
  68. :isSetSalary='isSetSalary'
  69. @gotoNav='gotoNav' />
  70. </div>
  71. <div v-if='activeIndex==4'
  72. v-permission="'/teamSetting/salarySet'">
  73. <salarySet :teamid='id'
  74. :isSetSalary='isSetSalary' />
  75. </div>
  76. </div>
  77. <classSeting v-if="!isOld"
  78. :teamid='id'
  79. :isSetSalary='isSetSalary'
  80. @gotoNav='gotoNav' />
  81. </div>
  82. </template>
  83. <script>
  84. import classSeting from '@/views/teamBuild/teamSeting/components/setClassV2'
  85. import teacherSeting from '@/views/teamBuild/teamSeting/components/setTeacher'
  86. import coursePlan from '@/views/teamBuild/teamSeting/components/coursePlan'
  87. import salarySet from '@/views/teamBuild/teamSeting/components/salarySet'
  88. import improvement from '@/views/teamBuild/teamSeting/components/improvementClass'
  89. import lookCourse from '@/views/teamBuild/teamSeting/components/lookCourse'
  90. import { getTeamBaseInfo, checkSetSalary, getCourseSchedule } from '@/api/buildTeam'
  91. export default {
  92. name: 'teamSeting',
  93. components: {
  94. classSeting,
  95. teacherSeting,
  96. coursePlan,
  97. salarySet,
  98. improvement,
  99. lookCourse
  100. },
  101. data () {
  102. return {
  103. activeIndex: 0,
  104. stepImgs: {
  105. nol: require('@/assets/images/base/step-arrow-active.png'),
  106. active: require('@/assets/images/base/step-arrow.png')
  107. },
  108. id: '',
  109. chargeTypeId: '',
  110. name: '',
  111. isSetSalary: false,
  112. Fsearch: null,
  113. Frules: null,
  114. isOld: false
  115. }
  116. },
  117. created () {
  118. this.init()
  119. },
  120. activated () {
  121. this.init()
  122. },
  123. beforeDestroy () {
  124. localStorage.setItem('setStep', 0)
  125. localStorage.setItem('resetCode', 1)
  126. },
  127. mounted () {
  128. // 根据乐团id 获取乐团信息
  129. this.init()
  130. },
  131. methods: {
  132. init () {
  133. this.id = this.$route.query.id;
  134. // 判断是否带缓存参数
  135. if (this.$route.query.search) {
  136. this.Fsearch = this.$route.query.search;
  137. }
  138. if (this.$route.query.rules) {
  139. this.Frules = this.$route.query.rules
  140. }
  141. //localStorage.getItem('setStep') ||
  142. this.activeIndex = 0;
  143. getTeamBaseInfo({ musicGroupId: this.id }).then(res => {
  144. if (res.code == 200) {
  145. this.chargeTypeId = res.data.musicGroup.chargeTypeId;
  146. this.name = res.data.musicGroup.name;
  147. localStorage.setItem('chargeTypeId', this.chargeTypeId);
  148. localStorage.setItem('createTeamOrgnId', res.data.musicGroup.organId)
  149. }
  150. })
  151. // 获取是否设置课酬
  152. checkSetSalary({ musicGroupId: this.id }).then(res => {
  153. if (res.code == 200) {
  154. this.isSetSalary = res.data;
  155. }
  156. })
  157. // 查询有没有课
  158. getCourseSchedule({ musicGroupId: this.id }).then(res => {
  159. if (res.code == 200) {
  160. if (res.data && res.data.rows.length > 0) {
  161. this.isOld = true
  162. } else {
  163. this.isOld = false
  164. }
  165. }
  166. })
  167. },
  168. gotoNav (val) {
  169. this.activeIndex = val;
  170. },
  171. goBack () {
  172. this.$store.dispatch('delVisitedViews', this.$route)
  173. this.$router.push({ path: '/teamList'})
  174. }
  175. },
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .set-container {
  180. margin-left: 12px;
  181. .topWrap {
  182. padding: 18px 58px 0;
  183. // height: 136px;
  184. background-color: #fff;
  185. // display: flex;
  186. // flex-direction: row;
  187. // justify-content: space-between;
  188. .msg {
  189. text-align: right;
  190. color: #f97215;
  191. font-size: 32px;
  192. font-weight: bold;
  193. padding-top: 30px;
  194. box-sizing: border-box;
  195. img {
  196. width: 36px;
  197. height: 36px;
  198. position: relative;
  199. top: 5px;
  200. margin-right: 8px;
  201. display: block;
  202. }
  203. }
  204. h2 {
  205. height: 48px;
  206. line-height: 48px;
  207. position: relative;
  208. // padding-left: 30px;
  209. font-size: 32px;
  210. font-weight: 600;
  211. margin-bottom: 10px;
  212. display: flex;
  213. flex-direction: row;
  214. justify-content: flex-start;
  215. align-items: center;
  216. .term {
  217. height: 32px;
  218. line-height: 32px;
  219. border-radius: 24px;
  220. width: 100px;
  221. color: #14928a;
  222. border: 1px solid rgba(20, 146, 138, 1);
  223. font-size: 14px;
  224. text-align: center;
  225. margin-right: 12px;
  226. &:nth-child(1) {
  227. margin-left: 47px;
  228. }
  229. }
  230. .term.active {
  231. color: #fff;
  232. background-color: #14928a;
  233. }
  234. .squrt {
  235. position: absolute;
  236. left: -25px;
  237. top: 8px;
  238. height: 34px;
  239. width: 8px;
  240. background-color: #14928a;
  241. }
  242. }
  243. .btnList {
  244. display: flex;
  245. flex-direction: row;
  246. justify-content: flex-start;
  247. align-items: center;
  248. div {
  249. margin-right: 15px;
  250. }
  251. }
  252. .newBand.close {
  253. background-color: #777;
  254. border: 1px solid #777;
  255. }
  256. }
  257. .stepbox {
  258. display: flex;
  259. flex-direction: row;
  260. justify-content: flex-start;
  261. margin-top: 30px;
  262. .stepspan {
  263. cursor: pointer;
  264. font-size: 14px;
  265. display: block;
  266. line-height: 40px;
  267. // position: relative;
  268. // z-index: 100;
  269. display: flex;
  270. flex-direction: row;
  271. // justify-content: space-between;
  272. margin-left: -17px !important;
  273. .sptep {
  274. width: 110px;
  275. height: 40px;
  276. border: 1px solid #dcdfe6;
  277. border-right: none;
  278. border-bottom: none;
  279. padding-left: 25px;
  280. border-radius: 4px 0 0 0;
  281. text-align: center;
  282. }
  283. .arrow {
  284. height: 40px;
  285. width: 17px;
  286. position: relative;
  287. top: 1px;
  288. z-index: 30;
  289. }
  290. }
  291. .stepspan.stepspan2 {
  292. position: relative;
  293. padding-right: 0;
  294. .sptep {
  295. padding-left: 12px !important;
  296. border-radius: 0 !important;
  297. }
  298. }
  299. .sptep.activestep {
  300. color: #fff;
  301. font-weight: bold;
  302. background-color: #4eada7;
  303. }
  304. }
  305. .stepcontent {
  306. border-top: 1px solid #dcdfe6;
  307. padding-top: 12px;
  308. }
  309. }
  310. </style>