浏览代码

增加放报错机制

xiaohaizhao 7 月之前
父节点
当前提交
b3ed184f3a

+ 5 - 2
src/HDrpManagement/contractManage/components/productList/productBillno.vue

@@ -251,7 +251,7 @@
               !scope.column.data[scope.column.columnname] &&
               scope.column.data[[scope.column.columnname]] !== 0 &&
               scope.column.columnname != 'operation' &&
-              scope.column.columnname != 'countPrice'&&
+              scope.column.columnname != 'countPrice' &&
               scope.column.columnname != 'model'
             "
           >
@@ -416,7 +416,10 @@ export default {
       this.totalPrice = this.tool.formatAmount(this.totalPrice, 2);
       this.list = res.data;
       this.total = res.total;
-      this.$refs.addProduct.doLayout();
+      try {
+         this.$refs.addProduct.doLayout();
+      } catch (error) {
+      }
       this.$emit("priceChange");
     },
     /*修改数量*/

+ 24 - 13
src/components/newLayout/index.vue

@@ -108,14 +108,17 @@ export default {
         clearTimeout(this.timer);
       }
       this.timer = setTimeout(() => {
-        let size = this.$refs.menu.$refs.menuList.$el.clientHeight / 40 - 1;
-        if (this.$refs.menu.$refs.menuList.$el.clientHeight === 80) {
-          this.divTop =
-            this.$refs.menu.$refs.menuList.$el.clientHeight - 25 * size + "px";
-        } else {
-          this.divTop = 0 + "px";
+        if (this.$refs.menu) {
+          let size = this.$refs.menu.$refs.menuList.$el.clientHeight / 40 - 1;
+          if (this.$refs.menu.$refs.menuList.$el.clientHeight === 80) {
+            this.divTop =
+              this.$refs.menu.$refs.menuList.$el.clientHeight -
+              25 * size +
+              "px";
+          } else {
+            this.divTop = 0 + "px";
+          }
         }
-
         /* this.divHeight = (this.$refs.divContent.clientHeight - this.$refs.menu.$refs.menuList.$el.clientHeight + 10) + 'px'*/
         /* if (this.$refs.menu.$el.clientWidth < 1206 && Array.from(this.$refs.menu.$el.getElementsByTagName('li')).filter(item => item.className.indexOf('el-submenu') != -1).length > 8) {
           this.marginTrue = true
@@ -142,12 +145,20 @@ export default {
     },
   },
   mounted() {
-
-    if (JSON.parse(sessionStorage.getItem('active_password')) == '1' && JSON.parse(sessionStorage.getItem('password')) != '1'){
-      if (JSON.parse(sessionStorage.getItem('active_account')).usertype == 0 && JSON.parse(sessionStorage.getItem('active_account')).usertype == 1 && (JSON.parse(sessionStorage.getItem('active_account')).siteid == 'HY' || JSON.parse(sessionStorage.getItem('active_account')).siteid == 'YOSTEST1')){
-        this.dialogVisible = false
-      }else {
-        this.dialogVisible = true
+    if (
+      JSON.parse(sessionStorage.getItem("active_password")) == "1" &&
+      JSON.parse(sessionStorage.getItem("password")) != "1"
+    ) {
+      if (
+        JSON.parse(sessionStorage.getItem("active_account")).usertype == 0 &&
+        JSON.parse(sessionStorage.getItem("active_account")).usertype == 1 &&
+        (JSON.parse(sessionStorage.getItem("active_account")).siteid == "HY" ||
+          JSON.parse(sessionStorage.getItem("active_account")).siteid ==
+            "YOSTEST1")
+      ) {
+        this.dialogVisible = false;
+      } else {
+        this.dialogVisible = true;
       }
     }
     /*this.debouned()*/

+ 74 - 58
src/components/newLayout/modules/navRight.vue

@@ -1,82 +1,98 @@
 <template>
   <div>
     <div class="nav-right">
-       <el-menu
-          :collapse="true"
-          style="background:none"
-          text-color="#fff"
-          active-text-color="#fff"
-          class="el-menu-vertical-demo">
-          <el-menu-item :index="String(index + 10)" v-for="(item,index) in menuApp" :key="index" @click="handelMenuAppClick(item,'app')">
-            <img width="20" :src="require(`@/assets/icons/${item.systemappid}.svg`)" alt="">
-            <span slot="title">{{item.meta.title}}</span>
-          </el-menu-item>
-        </el-menu>
+      <el-menu
+        :collapse="true"
+        style="background: none"
+        text-color="#fff"
+        active-text-color="#fff"
+        class="el-menu-vertical-demo"
+      >
+        <el-menu-item
+          :index="String(index + 10)"
+          v-for="(item, index) in menuApp"
+          :key="index"
+          @click="handelMenuAppClick(item, 'app')"
+        >
+          <img
+            width="20"
+            :src="require(`@/assets/icons/${item.systemappid}.svg`)"
+            alt=""
+          />
+          <span slot="title">{{ item.meta.title }}</span>
+        </el-menu-item>
+      </el-menu>
     </div>
   </div>
 </template>
 
 <script>
 export default {
-  data () {
+  data() {
     return {
-      menuApp:[],
-      modules:[],
-      system:[]
-    }
+      menuApp: [],
+      modules: [],
+      system: [],
+    };
   },
-  methods:{
-     // 查询右侧应用授权
-    async query_userauth () {
+  methods: {
+    // 查询右侧应用授权
+    async query_userauth() {
       const res = await this.$api.requested({
-        "classname": "sysmanage.develop.userauthforweb.userauth",
-        "method": "query_userauth",
-        "content": {
-          "place":2
-        }
-      })
-      this.system = res.data
-
-      this.modules = []
-      res.data.map(e=>{
-        this.modules = [...this.modules,...e.modules]
-      })
-      this.modules.map(e=>{
-        this.menuApp =[...this.menuApp,...e.apps]
-      })
+        classname: "sysmanage.develop.userauthforweb.userauth",
+        method: "query_userauth",
+        content: {
+          place: 2,
+        },
+      });
+      console.log("res", res);
+      if (res.code == 1) {
+        this.system = res.data;
+        this.modules = [];
+        res.data.map((e) => {
+          this.modules = [...this.modules, ...e.modules];
+        });
+        this.modules.map((e) => {
+          this.menuApp = [...this.menuApp, ...e.apps];
+        });
+      }
     },
-    handelMenuAppClick (app,type) {
-      this.$store.dispatch('changeDetailDrawer',false)
-      let at_modules = this.modules.filter(e=>{
-        if (e.systemmoduleid === app.systemmoduleid)
-        return e
-      })[0]
+    handelMenuAppClick(app, type) {
+      this.$store.dispatch("changeDetailDrawer", false);
+      let at_modules = this.modules.filter((e) => {
+        if (e.systemmoduleid === app.systemmoduleid) return e;
+      })[0];
 
-      let at_app = app
+      let at_app = app;
 
-      sessionStorage.setItem('active_modules',JSON.stringify(at_modules))
-      const link = ()=>{
-        this.$router.push({path:app.path})
-      }
-      this.$store.dispatch('setActiveApp',{name:app.name,app:at_app,val:'',link})
-      this.$router.push({path:app.path})
+      sessionStorage.setItem("active_modules", JSON.stringify(at_modules));
+      const link = () => {
+        this.$router.push({ path: app.path });
+      };
+      this.$store.dispatch("setActiveApp", {
+        name: app.name,
+        app: at_app,
+        val: "",
+        link,
+      });
+      this.$router.push({ path: app.path });
     },
   },
-  mounted () {
-    this.query_userauth()
-  }
-}
-
+  mounted() {
+    this.query_userauth();
+  },
+};
 </script>
 <style>
 </style>
 <style scoped>
-.nav-right{
-  position:fixed;
-  right:0;
-  top:0;
-  height:100%;
-  background:rgba(0, 0,0,.3);z-index:2000;
+.nav-right {
+  position: fixed;
+  right: 0;
+  top: 0;
+  height: 100%;
+  background: rgba(0, 0, 0, 0.3);
+  z-index: 2000;
   z-index: 2003;
 }
 </style>

+ 7 - 0
src/template/addProduct/index.vue

@@ -140,6 +140,13 @@ export default {
       this.total = res.total
       this.$refs.tableTemp.$refs.table.doLayout()
     },
+    doLayout(){
+      try {
+        this.$refs.tableTemp.$refs.table.doLayout()
+      } catch (error) {
+        
+      }
+    },
     /*获取品牌*/
     async queryBrands () {
       const res = await this.$api.requested({