index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>
  5. 工作台
  6. <filter-search
  7. v-if="$route.query.tabrouter === 'teamSchedule'&&permission('/teamSchedule/abnormal')"
  8. :keys="['searchType']"
  9. :moreKeys="['organId']"
  10. @reload="reloadItem"
  11. />
  12. </h2>
  13. <div class="m-core">
  14. <tab-router @change="changeKey">
  15. <el-tab-pane
  16. v-if="permission('/main/main/allData/826')"
  17. lazy
  18. label="基本信息"
  19. name="baseinfo"
  20. >
  21. <baseinfo v-if="activeKey === 'baseinfo'" />
  22. </el-tab-pane>
  23. <el-tab-pane
  24. v-if="permission('/cloudDate')"
  25. lazy
  26. label="云教练数据"
  27. name="cloudDate"
  28. >
  29. <cloudDate v-if="activeKey === 'cloudDate'" />
  30. </el-tab-pane>
  31. <el-tab-pane v-if="permission('/getIndexErrData')" lazy name="abnormal">
  32. <el-badge
  33. slot="label"
  34. class="badge"
  35. is-dot
  36. :hidden="!status.indexErrData"
  37. >异常处理</el-badge
  38. >
  39. <abnormal v-if="activeKey === 'abnormal'" />
  40. </el-tab-pane>
  41. <el-tab-pane v-if="permission('getRemindMatterData')" name="reminders">
  42. <el-badge
  43. slot="label"
  44. class="badge"
  45. is-dot
  46. :hidden="!status.remindMatterData"
  47. >事项提醒</el-badge
  48. >
  49. <reminders v-if="activeKey === 'reminders'" />
  50. </el-tab-pane>
  51. <el-tab-pane
  52. v-if="permission('inspectionItem/queryPage')"
  53. lazy
  54. label="【乐团主管】日程安排"
  55. name="teamSchedule"
  56. >
  57. <teamSchedule
  58. v-if="activeKey === 'teamSchedule'"
  59. ref="teamSchedule"
  60. />
  61. </el-tab-pane>
  62. <el-tab-pane
  63. v-if="permission('inspection/queryPage')"
  64. lazy
  65. label="【分部经理】日程安排"
  66. name="ScheduleBranch"
  67. >
  68. <ScheduleBranch v-if="activeKey === 'ScheduleBranch'" />
  69. </el-tab-pane>
  70. </tab-router>
  71. </div>
  72. </div>
  73. </template>
  74. <script>
  75. import { permission } from "@/utils/directivePage";
  76. import baseinfo from "./baseinfo";
  77. import abnormal from "./abnormal";
  78. import teamSchedule from "./teamSchedule";
  79. import ScheduleBranch from "./schedule-branch";
  80. import reminders from "./reminders";
  81. import cloudDate from './cloudDate'
  82. export default {
  83. name: "Main",
  84. components: {
  85. baseinfo,
  86. abnormal,
  87. teamSchedule,
  88. ScheduleBranch,
  89. reminders,
  90. cloudDate
  91. },
  92. data() {
  93. return {
  94. activeKey: "",
  95. };
  96. },
  97. mounted() {
  98. // console.log(permission('/main/main/allData/826'))
  99. },
  100. computed: {
  101. status() {
  102. return this.$store.state.app.status || {};
  103. },
  104. },
  105. watch: {
  106. "$route.query"(newValue, oldValue) {
  107. if (newValue.tabrouter !== oldValue.tabrouter) {
  108. this.$forceUpdate();
  109. this.$store.dispatch("app/setDotStatus");
  110. }
  111. },
  112. },
  113. methods: {
  114. permission,
  115. changeKey(val) {
  116. this.activeKey = val;
  117. },
  118. __init() {
  119. getIndex().then((res) => {
  120. if (res.code == 200) {
  121. // this.dataInfo = res.data
  122. let md = res.data.musicDatas || {},
  123. vd = res.data.vipDatas || {},
  124. dd = res.data.demoDatas || {};
  125. let tempDate = {
  126. mdTotal:
  127. (md.progress_num_ ? md.progress_num_ : 0) +
  128. (md.prepare_num_ ? md.prepare_num_ : 0) +
  129. (md.pause_num_ ? md.pause_num_ : 0),
  130. progress_num_: md.progress_num_ >= 0 ? md.progress_num_ : "--",
  131. prepare_num_: md.prepare_num_ >= 0 ? md.prepare_num_ : "--",
  132. pause_num_: md.pause_num_ >= 0 ? md.pause_num_ : "--",
  133. vdTotal:
  134. (vd.finished_num_ ? vd.finished_num_ : 0) +
  135. (vd.applying_num_ ? vd.applying_num_ : 0),
  136. finished_num_: vd.finished_num_ >= 0 ? vd.finished_num_ : "--",
  137. applying_num_: vd.applying_num_ >= 0 ? vd.applying_num_ : "--",
  138. ddTotal:
  139. (dd.booked_num_ ? dd.booked_num_ : 0) +
  140. (dd.unbooked_num_ ? dd.unbooked_num_ : 0),
  141. booked_num_: dd.booked_num_ >= 0 ? dd.booked_num_ : "--",
  142. unbooked_num_: dd.unbooked_num_ >= 0 ? dd.unbooked_num_ : "--",
  143. };
  144. this.dataInfo = Object.assign(res.data, tempDate);
  145. }
  146. });
  147. },
  148. reloadItem() {
  149. console.log("调用");
  150. if (this.$refs.teamSchedule) {
  151. this.$refs.teamSchedule.getList();
  152. }
  153. },
  154. },
  155. };
  156. </script>
  157. <style lang="scss" scope>
  158. .itemWrap {
  159. display: flex;
  160. flex-direction: row;
  161. justify-content: flex-start;
  162. align-items: center;
  163. flex-wrap: wrap;
  164. .item {
  165. width: 333px;
  166. height: 137px;
  167. padding: 22px 28px 20px;
  168. box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.1);
  169. border-radius: 6px;
  170. margin: 0 15px 3rem;
  171. h4 {
  172. display: flex;
  173. flex-direction: row;
  174. justify-content: space-between;
  175. margin-bottom: 20px;
  176. color: #323c47;
  177. font-size: 14px;
  178. }
  179. .infos {
  180. display: flex;
  181. flex-direction: row;
  182. justify-content: space-between;
  183. .sub {
  184. font-size: 14px;
  185. line-height: 20px;
  186. color: #aaa;
  187. margin-bottom: 8px;
  188. }
  189. .msg {
  190. font-size: 24px;
  191. font-weight: 500;
  192. color: rgba(68, 68, 68, 1);
  193. line-height: 28px;
  194. text-align: center;
  195. }
  196. }
  197. }
  198. }
  199. .badge {
  200. .el-badge__content.is-fixed.is-dot {
  201. top: 5px;
  202. }
  203. }
  204. </style>