Forráskód Böngészése

库存账跳转路由加限制

lichao 3 éve
szülő
commit
01ebf5a4c8

+ 3 - 0
src/page/index/tags.vue

@@ -338,6 +338,9 @@ export default {
         if (tag.label == "销售订单(N)") {
           this.$store.commit("DOMXS_OUT_DETAIL");
         }
+        if (tag.label == "锁定订单明细") {
+          this.$store.commit("DOMKC_OUT_DETAIL");
+        }
         this.$store.commit("DEL_TAG", tag);
         if (tag.value === this.tag.value) {
           tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个

+ 1 - 0
src/store/getters.js

@@ -38,5 +38,6 @@ const getters = {
   mainItemStatus: state => state.ifdetail.mainItemStatus,
   settleStatus: state => state.ifdetail.settleStatus,
   domSaleStatus: state => state.ifdetail.domSaleStatus,
+  domStockDetail: state => state.ifdetail.domStockDetail,
 }
 export default getters

+ 11 - 1
src/store/modules/ifdetail.js

@@ -12,6 +12,7 @@ const ifdetail = {
     mainItemStatus:false, //主营业务明细
     settleStatus:false,//结算明细
     domSaleStatus: false, // 内贸销售
+    domStockDetail: false, // 国内库存账
   },
   actions: {},
   mutations: {
@@ -112,12 +113,18 @@ const ifdetail = {
     },
     // 打开国内销售订单
     DOMXS_IN_DETAIL(state) {
-      state.domSaleStatus = false;
+      state.domSaleStatus = true;
     },
     //关闭国内销售订单
     DOMXS_OUT_DETAIL(state) {
       state.domSaleStatus = false;
     },
+    DOMKC_IN_DETAIL(state) {
+      state.domStockDetail = true;
+    },
+    DOMKC_OUT_DETAIL(state) {
+      state.domStockDetail = false;
+    },
     //关闭所有
     DEL_ALL_DETAIL(state) {
       for (let item in state) {
@@ -165,6 +172,9 @@ const ifdetail = {
       if (tag.label == '销售订单(N)') {
         state.domSaleStatus = true
       }
+      if (tag.label == '锁定订单明细') {
+        state.domStockDetail = true
+      }
     }
   }
 

+ 20 - 9
src/views/businessManagement/inventoryAccount/detail.vue

@@ -45,8 +45,9 @@ export default {
     }
   },
   async created() {
-    this.option = option
-    // this.option = await this.getColumnData(this.getColumnName(67), option);
+    // this.option = option
+    this.option = await this.getColumnData(this.getColumnName(67), option);
+    this.$store.commit("DOMKC_IN_DETAIL");
   },
   activated() {
     this.params = {
@@ -118,13 +119,23 @@ export default {
     },
     // 跳转
     beforeOpenPage(row,index) {
-      this.$router.$avueRouter.closeTag("/businessManagement/salesOrder/index");
-      this.$router.push({
-        path: "/businessManagement/salesOrder/index",
-        query: {
-          id: row.id
-        },
-      });
+      if (this.$store.getters.domSaleStatus) {
+        this.$alert("销售单存在,请保存关闭销售单再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: "warning",
+          callback: action => {
+            console.log(action);
+          }
+        });
+      } else {
+        this.$router.$avueRouter.closeTag("/businessManagement/salesOrder/index");
+        this.$router.push({
+          path: "/businessManagement/salesOrder/index",
+          query: {
+            id: row.id
+          },
+        });
+      }
     },
   },
 }

+ 20 - 10
src/views/businessManagement/inventoryAccount/index.vue

@@ -210,16 +210,26 @@ export default {
     },
     // 查看
     viewCell(row, index) {
-      this.params.corpId = row.corpId
-      this.params.itemId = row.goodsId
-      this.$router.$avueRouter.closeTag("/businessManagement/inventoryAccount/detail");
-      this.$router.push({
-        path: "/businessManagement/inventoryAccount/detail",
-        query: {
-          corpId: row.corpId,
-          itemId: row.goodsId
-        },
-      });
+      if (this.$store.getters.domStockDetail) {
+        this.$alert("明细已存在,请保存关闭明细再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: "warning",
+          callback: action => {
+            console.log(action);
+          }
+        });
+      } else {
+        this.params.corpId = row.corpId
+        this.params.itemId = row.goodsId
+        this.$router.$avueRouter.closeTag("/businessManagement/inventoryAccount/detail");
+        this.$router.push({
+          path: "/businessManagement/inventoryAccount/detail",
+          query: {
+            corpId: row.corpId,
+            itemId: row.goodsId
+          },
+        });
+      }
       // this.show = false;
     },
   }