index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <div v-if="this.rolerShow">
  3. <dev v-if="billType != 12">
  4. <div v-if="billType && saberTenantId != 212186 && saberTenantId != 504978 && billType != 11">
  5. <tongjiSchool v-if="billType == 1"></tongjiSchool>
  6. <landTransportation v-else-if="billType == 7"></landTransportation>
  7. <jiatongPage v-else-if="billType == 8"></jiatongPage>
  8. <noctite v-else-if="billType == 9"></noctite>
  9. <equipment-control v-else-if="billType == 10"></equipment-control>
  10. <tireindex v-else-if="billType == 11" :sysType="billType"></tireindex>
  11. <defaultPage v-else :sysType="billType"></defaultPage>
  12. </div>
  13. <div v-else-if="saberTenantId == 212186" style="padding: 10px">
  14. <el-card class="home-container__card">
  15. <div class="title">
  16. <span>
  17. 快速发起
  18. </span>
  19. </div>
  20. <div class="content">
  21. <div class="content-icon" @click="inPage('/productionManagement/index')">
  22. <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
  23. <span style="font-size: 14px">模拟生产</span>
  24. </div>
  25. </div>
  26. </el-card>
  27. </div>
  28. <div v-else-if="saberTenantId == 504978" style="padding: 10px">
  29. <el-card class="home-container__card">
  30. <div class="title">
  31. <span>
  32. 快速发起
  33. </span>
  34. </div>
  35. <div class="content">
  36. <div class="content-icon" @click="inPage('/EquipmentArchives/index')">
  37. <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
  38. <span style="font-size: 14px">设备档案</span>
  39. </div>
  40. <div class="content-icon" @click="inPage('/maintenanceQ/index')">
  41. <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
  42. <span style="font-size: 14px">设备维修</span>
  43. </div>
  44. </div>
  45. </el-card>
  46. </div>
  47. <!--青岛鑫动力新的首页-->
  48. <div v-else-if="billType == 11">
  49. <xindongPower :sysType="billType"></xindongPower>
  50. </div>
  51. </dev>
  52. <!--货代首页 货代billType 12 -->
  53. <div v-if="billType == 12">
  54. <los-home :sysType="billType"></los-home>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import tireindex from '@/views/wel/home/tirezujian/tireindex';
  60. import defaultPage from "@/views/wel/home/defaultPage";
  61. import tongjiSchool from "@/views/wel/home/tongjiSchool";
  62. import landTransportation from "@/views/wel/home/landTransportation/landTransportation";
  63. import jiatongPage from "@/views/wel/home/jiatongPage/landTransportation";
  64. import noctite from "@/views/wel/home/noctite/landTransportation";
  65. import equipmentControl from "@/views/wel/home/equipmentControl/landTransportation";
  66. import { getUserInfo } from "@/api/system/user";
  67. import { setStore } from "@/util/store";
  68. import { areaTypeTree } from "@/api/basicData/customerInformation";
  69. import xindongPower from "@/views/wel/home/xindongPower/xindongPower.vue";
  70. import losHome from "@/views/wel/components/losHome.vue";
  71. export default {
  72. name: "wel",
  73. data() {
  74. return {
  75. billType: "",
  76. saberTenantId: '',
  77. roler: '',
  78. rolerShow:true,
  79. };
  80. },
  81. created() {
  82. this.saberTenantId = JSON.parse(localStorage.getItem('saber-tenantId')).content
  83. let obj = JSON.parse(localStorage.getItem('saber-userInfo')).content
  84. if (obj) {
  85. this.roler = obj.role_name
  86. this.getRegex(this.roler)
  87. }
  88. getUserInfo().then(res => {
  89. this.billType = res.data.data.billType;
  90. localStorage.setItem('sysitemType', this.billType)
  91. });
  92. if (!localStorage.getItem('areaTypeTree')) {
  93. areaTypeTree().then(res => {
  94. localStorage.setItem('areaTypeTree', JSON.stringify(res.data.data));
  95. })
  96. }
  97. },
  98. components: {
  99. tireindex,
  100. tongjiSchool,
  101. defaultPage,
  102. jiatongPage,
  103. noctite,
  104. equipmentControl,
  105. landTransportation,
  106. xindongPower,
  107. losHome
  108. },
  109. methods: {
  110. getRegex(str) {
  111. let regex = new RegExp('API', "g"); // g 标志表示全局匹配
  112. let matches = str.match(regex);
  113. if (matches) {
  114. this.rolerShow=false
  115. } else {
  116. this.rolerShow=true
  117. }
  118. },
  119. inPage(url) {
  120. this.$router.push(url);
  121. },
  122. }
  123. };
  124. </script>
  125. <style lang="scss" scoped>
  126. .content {
  127. display: flex;
  128. &-icon {
  129. display: flex;
  130. flex-direction: column;
  131. align-items: center;
  132. margin: 1.5vh 1vw 0vh 1vw;
  133. span {
  134. margin-top: 0.2vh;
  135. }
  136. }
  137. }
  138. .tradingIcon {
  139. font-size: 36px;
  140. }
  141. </style>