Selaa lähdekoodia

修改跳转tabg提示

Qukatie 1 viikko sitten
vanhempi
commit
94d21c7724

+ 4 - 1
src/main.js

@@ -8,7 +8,8 @@ import './error'; // 日志
 import './cache'; //页面缓存
 import store from './store';
 import {
-    loadStyle
+    loadStyle,
+    verifyTags
 } from './util/util'
 import * as urls from '@/config/env';
 import Element from 'element-ui';
@@ -84,6 +85,8 @@ Vue.prototype.website = website;
 Vue.prototype.getWorkDicts = getWorkDicts
 //判断是否为空
 Vue.prototype.validatenull=validatenull
+//检验标签是否重复
+Vue.prototype.verifyTags=verifyTags
 // 动态加载阿里云字体库
 iconfontVersion.forEach(ele => {
     loadStyle(iconfontUrl.replace('$key', ele));

+ 3 - 3
src/store/modules/tags.js

@@ -55,9 +55,9 @@ const navs = {
       })
       console.log(action)
       if (state.tagList.some(ele => diff(ele, action))) return
-      if (state.tagList.filter(item => item.label == action.label).length == 1) {
-        return MessageBox.alert(`请关闭重复的${action.label}标签,否则无法进行操作!`, '提示', { type: 'warning' });
-      }
+      // if (state.tagList.filter(item => item.label == action.label).length == 1) {
+      //   return MessageBox.alert(`请关闭重复的${action.label}标签,否则无法进行操作!`, '提示', { type: 'warning' });
+      // }
       state.tagList.push(action)
       setFistTag(state.tagList);
       setStore({

+ 13 - 0
src/util/util.js

@@ -1,4 +1,17 @@
 import { validatenull } from './validate'
+import store from '@/store';
+import { MessageBox } from 'element-ui';
+//检验标签是否重复
+export const verifyTags = (name) => {
+  console.log(store.getters.tagList, name)
+  const tagList = store.getters.tagList
+  if (tagList.filter(item => item.label == name).length > 0) {
+    MessageBox.alert(`请关闭重复的${name}标签,否则无法进行操作!`, '提示', { type: 'warning' });
+    return false
+  }
+  return true
+  // const tagList=state.tagList
+}
 //表单序列化
 export const serialize = data => {
   let list = [];

+ 4 - 4
src/views/bulletin/index.vue

@@ -63,13 +63,13 @@ export default {
         searchIndex: 3,
         column: [
           {
-            label: "公告标题",
-            prop: "title",
+            label: "分类名称",
+            prop: "categoryName",
             overHidden: true,
           },
           {
-            label: "分类名称",
-            prop: "categoryName",
+            label: "公告标题",
+            prop: "title",
             overHidden: true,
           },
         ],

+ 8 - 6
src/views/inventory/detail.vue

@@ -216,12 +216,14 @@ export default {
     },
     // 跳转
     beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/outboundWorkOrder/index",
-        query: {
-          id: row.id,
-        },
-      });
+      if (this.verifyTags("出库工单")) {
+        this.$router.push({
+          path: "/outboundWorkOrder/index",
+          query: {
+            id: row.id,
+          },
+        });
+      }
     },
   },
 };

+ 3 - 23
src/views/inventory/index.vue

@@ -652,29 +652,8 @@ export default {
     },
     //点击可用库存打开
     storeInventoryOpen(row) {
-      // if (this.$store.getters.tagList.filter(item=>item.value.includes("/inventory/detail")).length>0) {
-      //   this.$alert("明细账已存在,请关闭明细账再进行操作", "温馨提示", {
-      //     confirmButtonText: "确定",
-      //     type: "warning",
-      //     callback: (action) => {
-      //       console.log(action);
-      //     },
-      //   });
-      // } else {
-      //   this.params.corpId = row.corpId;
-      //   this.params.itemId = row.goodsId;
-      //   this.params.storageId = row.storageId;
-      //   this.$router.$avueRouter.closeTag("/inventory/detail");
-      //   this.$router.push({
-      //     path: "/inventory/detail",
-      //     query: {
-      //       stockId: row.storageId,
-      //       goodsId: row.goodsId,
-      //       dot: row.dot,
-      //     },
-      //   });
-      // }
-      this.$router.push({
+      if (this.verifyTags("明细账")) {
+        this.$router.push({
           path: "/inventory/detail",
           query: {
             stockId: row.storageId,
@@ -682,6 +661,7 @@ export default {
             dot: row.dot,
           },
         });
+      }
     },
   },
 };

+ 8 - 4
src/views/outboundWorkOrder/index.vue

@@ -603,6 +603,7 @@ export default {
       this.option.searchMenuPosition = "right";
     }
     if (this.$route.query.id) {
+      this.detailsOpen = false;
       this.detailData = {
         id: this.$route.query.id,
       };
@@ -618,10 +619,13 @@ export default {
       this.$refs.crud2.refreshTable();
     });
     if (this.$route.query.id) {
-      this.detailData = {
-        id: this.$route.query.id,
-      };
-      this.detailsOpen = true;
+      this.detailsOpen = false;
+      setTimeout(() => {
+        this.detailData = {
+          id: this.$route.query.id,
+        };
+        this.detailsOpen = true;
+      }, 100);
     }
     setTimeout(() => {
       if (this.$route.query.srcId) {

+ 2 - 2
src/views/wel/components/bulletin.vue

@@ -9,9 +9,9 @@
           >
         </div>
         <div v-for="item in data" :key="item.id" style="font-size: 14px">
-          <span style="cursor: pointer" @click="rowEdit(item)">
+          <el-link style="cursor: pointer;font-weight: 600;font-size: 14px" @click="rowEdit(item)">
             {{ item.title }}
-          </span>
+          </el-link>
         </div>
         <div v-if="data.length == 0" style="font-size: 14px; color: #c0c4cc">
           <div>暂无公告</div>