Qukatie пре 1 година
родитељ
комит
a8015d33d4
1 измењених фајлова са 108 додато и 92 уклоњено
  1. 108 92
      src/views/wel/index.vue

+ 108 - 92
src/views/wel/index.vue

@@ -1,59 +1,59 @@
 <template>
-  <div>
-      <dev v-if="billType != 12">
-          <div v-if="billType && saberTenantId != 212186 && saberTenantId != 504978 && billType != 11">
-              <tongjiSchool v-if="billType == 1"></tongjiSchool>
-              <landTransportation v-else-if="billType == 7"></landTransportation>
-              <jiatongPage v-else-if="billType == 8"></jiatongPage>
-              <noctite v-else-if="billType == 9"></noctite>
-              <equipment-control v-else-if="billType == 10"></equipment-control>
-              <tireindex v-else-if="billType == 11" :sysType="billType"></tireindex>
-              <defaultPage v-else :sysType="billType"></defaultPage>
-          </div>
-          <div v-else-if="saberTenantId == 212186" style="padding: 10px">
-              <el-card class="home-container__card">
-                  <div class="title">
-                <span>
-                    快速发起
-                </span>
-                  </div>
-                  <div class="content">
-                      <div class="content-icon" @click="inPage('/productionManagement/index')">
-                          <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
-                          <span style="font-size: 14px">模拟生产</span>
-                      </div>
-                  </div>
-              </el-card>
-          </div>
-          <div v-else-if="saberTenantId == 504978" style="padding: 10px">
-              <el-card class="home-container__card">
-                  <div class="title">
-                <span>
-                    快速发起
-                </span>
-                  </div>
-                  <div class="content">
-                      <div class="content-icon" @click="inPage('/EquipmentArchives/index')">
-                          <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
-                          <span style="font-size: 14px">设备档案</span>
-                      </div>
-                      <div class="content-icon" @click="inPage('/maintenanceQ/index')">
-                          <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
-                          <span style="font-size: 14px">设备维修</span>
-                      </div>
-                  </div>
-              </el-card>
-          </div>
-          <!--青岛鑫动力新的首页-->
-          <div v-else-if="billType == 11">
-              <xindongPower :sysType="billType"></xindongPower>
-          </div>
-      </dev>
-      <!--货代首页 货代billType 12 -->
-      <div v-if="billType == 12">
-          <los-home :sysType="billType" ></los-home>
-      </div>
-  </div>
+    <div v-if="this.rolerShow">
+        <dev v-if="billType != 12">
+            <div v-if="billType && saberTenantId != 212186 && saberTenantId != 504978 && billType != 11">
+                <tongjiSchool v-if="billType == 1"></tongjiSchool>
+                <landTransportation v-else-if="billType == 7"></landTransportation>
+                <jiatongPage v-else-if="billType == 8"></jiatongPage>
+                <noctite v-else-if="billType == 9"></noctite>
+                <equipment-control v-else-if="billType == 10"></equipment-control>
+                <tireindex v-else-if="billType == 11" :sysType="billType"></tireindex>
+                <defaultPage v-else :sysType="billType"></defaultPage>
+            </div>
+            <div v-else-if="saberTenantId == 212186" style="padding: 10px">
+                <el-card class="home-container__card">
+                    <div class="title">
+                        <span>
+                            快速发起
+                        </span>
+                    </div>
+                    <div class="content">
+                        <div class="content-icon" @click="inPage('/productionManagement/index')">
+                            <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
+                            <span style="font-size: 14px">模拟生产</span>
+                        </div>
+                    </div>
+                </el-card>
+            </div>
+            <div v-else-if="saberTenantId == 504978" style="padding: 10px">
+                <el-card class="home-container__card">
+                    <div class="title">
+                        <span>
+                            快速发起
+                        </span>
+                    </div>
+                    <div class="content">
+                        <div class="content-icon" @click="inPage('/EquipmentArchives/index')">
+                            <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
+                            <span style="font-size: 14px">设备档案</span>
+                        </div>
+                        <div class="content-icon" @click="inPage('/maintenanceQ/index')">
+                            <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
+                            <span style="font-size: 14px">设备维修</span>
+                        </div>
+                    </div>
+                </el-card>
+            </div>
+            <!--青岛鑫动力新的首页-->
+            <div v-else-if="billType == 11">
+                <xindongPower :sysType="billType"></xindongPower>
+            </div>
+        </dev>
+        <!--货代首页 货代billType 12 -->
+        <div v-if="billType == 12">
+            <los-home :sysType="billType"></los-home>
+        </div>
+    </div>
 </template>
 
 <script>
@@ -70,44 +70,59 @@ import { areaTypeTree } from "@/api/basicData/customerInformation";
 import xindongPower from "@/views/wel/home/xindongPower/xindongPower.vue";
 import losHome from "@/views/wel/components/losHome.vue";
 export default {
-  name: "wel",
-  data() {
-    return {
-      billType: "",
-        saberTenantId:''
-    };
-  },
-  created() {
-      console.log(JSON.parse(localStorage.getItem('saber-tenantId')).content)
-      this.saberTenantId = JSON.parse(localStorage.getItem('saber-tenantId')).content
-      // console.log(localStorage.getItem('saber-tenantId'))
-    getUserInfo().then(res => {
-      this.billType = res.data.data.billType;
-      localStorage.setItem('sysitemType', this.billType)
-    });
-    if (!localStorage.getItem('areaTypeTree')) {
-      areaTypeTree().then(res => {
-        localStorage.setItem('areaTypeTree', JSON.stringify(res.data.data));
-      })
-    }
+    name: "wel",
+    data() {
+        return {
+            billType: "",
+            saberTenantId: '',
+            roler: '',
+            rolerShow:true,
+        };
+    },
+    created() {
+        this.saberTenantId = JSON.parse(localStorage.getItem('saber-tenantId')).content
+        let obj = JSON.parse(localStorage.getItem('saber-userInfo')).content
+        if (obj) {
+            this.roler = obj.role_name
+            this.getRegex(this.roler)
+        }
+        getUserInfo().then(res => {
+            this.billType = res.data.data.billType;
+            localStorage.setItem('sysitemType', this.billType)
+        });
+        if (!localStorage.getItem('areaTypeTree')) {
+            areaTypeTree().then(res => {
+                localStorage.setItem('areaTypeTree', JSON.stringify(res.data.data));
+            })
+        }
 
-  },
-  components: {
-      tireindex,
-    tongjiSchool,
-    defaultPage,
-    jiatongPage,
-    noctite,
-    equipmentControl,
-    landTransportation,
-      xindongPower,
-      losHome
-  },
-  methods: {
-      inPage(url){
-          this.$router.push(url);
-      },
-  }
+    },
+    components: {
+        tireindex,
+        tongjiSchool,
+        defaultPage,
+        jiatongPage,
+        noctite,
+        equipmentControl,
+        landTransportation,
+        xindongPower,
+        losHome
+    },
+    methods: {
+        getRegex(str) {
+            let regex = new RegExp('API', "g"); // g 标志表示全局匹配
+
+            let matches = str.match(regex);
+            if (matches) {
+                this.rolerShow=false
+            } else {
+                this.rolerShow=true
+            }
+        },
+        inPage(url) {
+            this.$router.push(url);
+        },
+    }
 };
 </script>
 <style lang="scss" scoped>
@@ -125,6 +140,7 @@ export default {
         }
     }
 }
+
 .tradingIcon {
     font-size: 36px;
 }