index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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" :sysType="billType"></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. import { getLazyList } from "@/api/system/dept";
  72. import { isProcurement } from "@/api/basicData/configuration";
  73. export default {
  74. name: "wel",
  75. data() {
  76. return {
  77. billType: "",
  78. saberTenantId: '',
  79. roler: '',
  80. rolerShow: true,
  81. };
  82. },
  83. created() {
  84. this.saberTenantId = JSON.parse(localStorage.getItem('saber-tenantId')).content
  85. let obj = JSON.parse(localStorage.getItem('saber-userInfo')).content
  86. if (obj) {
  87. this.roler = obj.role_name
  88. this.getRegex(this.roler)
  89. }
  90. getUserInfo().then(res => {
  91. this.billType = res.data.data.billType;
  92. localStorage.setItem('sysitemType', this.billType)
  93. localStorage.setItem('sysitemData', JSON.stringify(res.data.data))
  94. });
  95. isProcurement({ "param": "lock.term.Days" }).then(res => {
  96. localStorage.setItem('lockTermDays', res.data.data)
  97. })
  98. getLazyList().then(res => {
  99. localStorage.setItem('user-Information', res.data.data.length ? JSON.stringify(res.data.data[0]) : null)
  100. })
  101. if (!localStorage.getItem('areaTypeTree')) {
  102. areaTypeTree().then(res => {
  103. localStorage.setItem('areaTypeTree', JSON.stringify(res.data.data));
  104. })
  105. }
  106. },
  107. components: {
  108. tireindex,
  109. tongjiSchool,
  110. defaultPage,
  111. jiatongPage,
  112. noctite,
  113. equipmentControl,
  114. landTransportation,
  115. xindongPower,
  116. losHome
  117. },
  118. methods: {
  119. getRegex(str) {
  120. let regex = new RegExp('API', "g"); // g 标志表示全局匹配
  121. let matches = str.match(regex);
  122. if (matches) {
  123. this.rolerShow = false
  124. } else {
  125. this.rolerShow = true
  126. }
  127. },
  128. inPage(url) {
  129. this.$router.push(url);
  130. },
  131. }
  132. };
  133. </script>
  134. <style lang="scss" scoped>
  135. .content {
  136. display: flex;
  137. &-icon {
  138. display: flex;
  139. flex-direction: column;
  140. align-items: center;
  141. margin: 1.5vh 1vw 0vh 1vw;
  142. span {
  143. margin-top: 0.2vh;
  144. }
  145. }
  146. }
  147. .tradingIcon {
  148. font-size: 36px;
  149. }
  150. </style>