Sfoglia il codice sorgente

新加tabs公共方法

Qukatie 1 settimana fa
parent
commit
470fed790a

+ 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';
@@ -193,6 +194,8 @@ Vue.prototype.checkLocks = checkLocks;
 //业务上锁
 Vue.prototype.submitLock=submitLock;
 Vue.prototype.overdueJudgment=overdueJudgment;
+//检验标签是否重复
+Vue.prototype.verifyTags=verifyTags
 new Vue({
   router,
   store,

+ 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 = [];

+ 11 - 9
src/views/tirePartsMall/inventory/areaDetail.vue

@@ -137,15 +137,17 @@ export default {
       this.onLoad();
     },
     inPage(row) {
-      this.$router.push({
-        path: "/tirePartsMall/inventory/areaRecord",
-        query: {
-          stockId: row.storageId,
-          goodsId: row.goodsId,
-          dot: row.dot,
-          reservoirAreaId: row.reservoirAreaId
-        }
-      });
+      if (this.verifyTags("库区记录")) {
+        this.$router.push({
+          path: "/tirePartsMall/inventory/areaRecord",
+          query: {
+            stockId: row.storageId,
+            goodsId: row.goodsId,
+            dot: row.dot,
+            reservoirAreaId: row.reservoirAreaId
+          }
+        });
+      }
     },
     //自定义列保存
     async saveColumnTwo(ref, option, optionBack, code) {

+ 14 - 27
src/views/tirePartsMall/inventory/index.vue

@@ -356,8 +356,8 @@ export default {
             prop: "sort",
             overHidden: true,
             search: true,
-            searchValue:0,
-            hide: true,
+            searchValue: 0,
+            hide: true
           }
         ]
       },
@@ -680,34 +680,21 @@ export default {
       return "padding:0;height:40px;";
     },
     inPage(row) {
-      this.$router.$avueRouter.closeTag("/tirePartsMall/inventory/areaDetail");
-      this.$router.push({
-        path: "/tirePartsMall/inventory/areaDetail",
-        query: {
-          pid: row.id,
-          storageId: row.storageId,
-          goodsId: row.goodsId,
-          dot: row.dot
-        }
-      });
+      if (this.verifyTags("库区明细")) {
+        this.$router.push({
+          path: "/tirePartsMall/inventory/areaDetail",
+          query: {
+            pid: row.id,
+            storageId: row.storageId,
+            goodsId: row.goodsId,
+            dot: row.dot
+          }
+        });
+      }
     },
     //点击可用库存打开
     storeInventoryOpen(row) {
-      console.log(this.$store.getters.inventoryAccount);
-      if (this.$store.getters.inventoryAccount) {
-        this.$alert("明细账已存在,请保存关闭明细账再进行操作", "温馨提示", {
-          confirmButtonText: "确定",
-          type: "warning",
-          callback: action => {
-            console.log(action);
-          }
-        });
-      } else {
-        console.log(row);
-        this.params.corpId = row.corpId;
-        this.params.itemId = row.goodsId;
-        this.params.storageId = row.storageId;
-        this.$router.$avueRouter.closeTag("/tirePartsMall/inventory/detail");
+      if (this.verifyTags("库存账明细")) {
         this.$router.push({
           path: "/tirePartsMall/inventory/detail",
           query: {

+ 1 - 1
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/detailsPage.vue

@@ -122,7 +122,7 @@
                   size="small"
                   @click="allClick('修改库区')"
                   :disabled="editDisabled || selectionMultilist.length == 0"
-                  >修改库区</el-button
+                  >匹配库区</el-button
                 >
                 <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('导入库区')" :disabled="editDisabled"
                   >导入库区</el-button