Browse Source

新加库区记录

Qukatie 1 week ago
parent
commit
ed0087ac87

+ 8 - 1
src/api/basicData/inventoryAccount.js

@@ -102,7 +102,14 @@ export const stockDataDetails = (params) => {
     }
   })
 }
-
+//轮胎库存查询明细账
+export const selectReservoirAreaRecordItem = (params) => {
+  return request({
+    url: '/api/blade-sales-part/ship/selectReservoirAreaRecordItem',
+    method: 'get',
+    params:params
+  })
+}
 // 配件精灵
 export const AppPartsStockDataDetails = (params) => {
   return request({

+ 12 - 0
src/router/views/index.js

@@ -2095,6 +2095,18 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/tirePartsMall/inventory/areaDetail')
   }]
 }, {
+  path: '/tirePartsMall/inventory/areaRecord',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/tirePartsMall/inventory/areaRecord',
+    name: '库区记录',
+    meta: {
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/tirePartsMall/inventory/areaRecord')
+  }]
+}, {
   path: '/statisticAnalysis/AmtAmount/index',
   component: Layout,
   hidden: true,

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

@@ -10,6 +10,9 @@
       @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 480)"
       @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 480)"
     >
+      <template slot="balanceQuantity" slot-scope="{ row, index }">
+        <span style="color: #409EFF;cursor: pointer" @click.stop="inPage(row, index)">{{ row.balanceQuantity }}</span>
+      </template>
     </avue-crud>
   </basic-container>
 </template>
@@ -84,21 +87,21 @@ export default {
             prop: "dot",
             overHidden: true
           },
-          {
-            label: "数量",
-            prop: "quantity",
-            overHidden: true
-          },
-          {
-            label: "出库数量",
-            prop: "outQuantity",
-            overHidden: true
-          },
+          // {
+          //   label: "数量",
+          //   prop: "quantity",
+          //   overHidden: true
+          // },
+          // {
+          //   label: "出库数量",
+          //   prop: "outQuantity",
+          //   overHidden: true
+          // },
           {
             label: "结余数量",
             prop: "balanceQuantity",
             overHidden: true
-          },
+          }
         ]
       },
       dataList: [],
@@ -133,6 +136,17 @@ export default {
     refreshChange() {
       this.onLoad();
     },
+    inPage(row) {
+      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) {
       /**

+ 211 - 0
src/views/tirePartsMall/inventory/areaRecord.vue

@@ -0,0 +1,211 @@
+<template>
+  <basic-container>
+    <avue-crud
+      ref="crud"
+      :data="dataList"
+      :option="option"
+      v-model="form"
+      :search.sync="search"
+      :table-loading="loading"
+      @saveColumn="saveColumn"
+      @resetColumn="resetColumn"
+      @search-change="searchChange"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @on-load="onLoad"
+    >
+      <template slot="billno" slot-scope="{ row, index }">
+        <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(row, index)">{{ row.billno }}</span>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import option from "./config/detail.json";
+import LTdetail from "./config/LTdetail.json";
+import {selectReservoirAreaRecordItem } from "@/api/basicData/inventoryAccount";
+
+export default {
+  name: "detail",
+  data() {
+    return {
+      option: {},
+      dataList: [],
+      form: {},
+      page: {
+        pageSize: 10,
+        pagerCount: 5,
+        total: 0
+      },
+      search: {},
+      loading: false,
+      params: null
+    };
+  },
+  async created() {
+    // this.option = option
+    console.log("打开了");
+    if (JSON.parse(localStorage.getItem("saber-tenantId")).content == 883868) {
+      this.option = LTdetail;
+    } else {
+      this.option = await this.getColumnData(this.getColumnName(279), option);
+    }
+    this.$store.commit("DOMAS_IN_DETAIL");
+  },
+  activated() {
+    this.$store.commit("DOMAS_IN_DETAIL");
+    this.params = {
+        goodsId: this.$route.query.goodsId,
+        stockId: this.$route.query.stockId,
+        dot: this.$route.query.dot,
+        reservoirAreaId: this.$route.query.reservoirAreaId
+      };
+    this.onLoad(this.page);
+  },
+  methods: {
+    onLoad(page, params) {
+      if (!this.params) return;
+      params = { ...params, ...this.params };
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false);
+      });
+      this.loading = true;
+      selectReservoirAreaRecordItem(params)
+        .then(res => {
+          this.dataList = res.data.data ? res.data.data : [];
+          this.page.total = res.data.data.total;
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 260;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    searchChange(params, done) {
+      this.onLoad(this.page, params);
+      done();
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    refreshChange() {
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false);
+      });
+      this.page.currentPage = 1;
+      this.onLoad(this.page, this.search);
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(this.getColumnName(279), this.option);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = option;
+      const inSave = await this.delColumnData(this.getColumnName(279), option);
+      if (inSave) {
+        this.$message.success("重置成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 跳转
+    beforeOpenPage(row, index) {
+      if (row.bizTypeName == "盘点") {
+        console.log(this.$store.getters, 139);
+        if (this.$store.getters.Inventory) {
+          this.$alert("明细账已存在,请保存关闭明细账再进行操作", "温馨提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+            callback: action => {
+              console.log(action);
+            }
+          });
+        } else {
+          this.$router.$avueRouter.closeTag("/tirePartsMall/salesManagement/Inventory/index");
+          this.$router.push({
+            path: "/tirePartsMall/salesManagement/Inventory/index",
+            query: {
+              orderId: row.id
+            }
+          });
+        }
+      } else {
+        if (this.$store.getters.inboundAndOutbound) {
+          this.$alert("明细账已存在,请保存关闭明细账再进行操作", "温馨提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+            callback: action => {
+              console.log(action);
+            }
+          });
+        } else {
+          if (row.bizTypeName == "出库") {
+            this.$router.$avueRouter.closeTag("/tirePartsMall/salesManagement/outboundWorkOrder/index");
+            this.$router.push({
+              path: "/tirePartsMall/salesManagement/outboundWorkOrder/index",
+              query: {
+                id: row.id
+              }
+            });
+          } else if (row.bizTypeName == "销售") {
+            this.$router.$avueRouter.closeTag("/salesOrder/index");
+            this.$router.push({
+              path: "/salesOrder/index",
+              query: {
+                orderId: row.id
+              }
+            });
+          } else if (row.bizTypeName == "采购") {
+            this.$router.$avueRouter.closeTag("/purchaseOrder/index");
+            this.$router.push({
+              path: "/purchaseOrder/index",
+              query: {
+                orderId: row.id
+              }
+            });
+          } else if (row.bizTypeName == "调出") {
+            if (this.$store.getters.Allocateandtransfer) {
+              this.$alert("调拨明细已存在,请保存关闭明细账再进行操作", "温馨提示", {
+                confirmButtonText: "确定",
+                type: "warning",
+                callback: action => {
+                  console.log(action);
+                }
+              });
+            } else {
+              this.$router.$avueRouter.closeTag("/tirePartsMall/salesManagement/outboundWorkOrderL/index");
+              this.$router.push({
+                path: "/tirePartsMall/salesManagement/outboundWorkOrderL/index",
+                query: {
+                  id: row.id
+                }
+              });
+            }
+          } else {
+            this.$router.$avueRouter.closeTag("/tirePartsMall/purchasingManagement/warehouseEntryOrder/index");
+            this.$router.push({
+              path: "/tirePartsMall/purchasingManagement/warehouseEntryOrder/index",
+              query: {
+                id: row.id
+              }
+            });
+          }
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style scoped></style>

+ 1 - 1
src/views/tirePartsMall/salesManagement/Inventory/detailsPage.vue

@@ -643,7 +643,7 @@ export default {
         cellBtn: true,
         rowKey: "ids",
         delBtn: false,
-        menuWidth: 140,
+        menuWidth: 250,
         dialogTop: 25,
         dialogWidth: "80%",
         summaryText: this.$t("land118n.total"),