瀏覽代碼

2023年6月29日18:34:01

纪新园 2 年之前
父節點
當前提交
35c189a1e9
共有 2 個文件被更改,包括 24 次插入2 次删除
  1. 9 1
      src/api/basicData/inventoryAccount.js
  2. 15 1
      src/views/dealer/stock/index.vue

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

@@ -82,4 +82,12 @@ export const selectStockInventory = (params) => {
       ...params
     }
   })
-}
+}
+
+// 计算库存
+export function calculateInventory() {
+  return request({
+    url: '/api/blade-deliver-goods/allot/calculateInventory',
+    method: 'get'
+  })
+}

+ 15 - 1
src/views/dealer/stock/index.vue

@@ -43,6 +43,8 @@
           <el-button type="info" icon="el-icon-printer" size="small" :loading="exportLoading" @click.stop="statement">
             报表打印
           </el-button>
+          <el-button type="success" icon="el-icon-plus" size="small" @click="calculateInventory()">更新库存
+          </el-button>
         </template>
       </avue-crud>
       <el-dialog title="导入库存" append-to-body :visible.sync="excelBox" width="555px">
@@ -59,7 +61,8 @@ import option from "./config/mainList.json";
 import {
   deleteTemplate,
   customerList,
-  typeSave
+  typeSave,
+  calculateInventory
 } from "@/api/basicData/inventoryAccount";
 import { getToken } from "@/util/auth";
 import { defaultDate } from "@/util/date";
@@ -158,6 +161,17 @@ export default {
           }=${getToken()}`
         );
       });
+    },calculateInventory() {
+      this.$confirm("是否更新库存?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.loading = true;
+        calculateInventory().finally(() => {
+          this.loading = false;
+        })
+      });
     },
     uploadAfter(res, done, loading, column) {
       window.console.log(column);