From 6985a2bf495e83f311a951890f30542e4146e833 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期三, 14 一月 2026 15:26:51 +0800
Subject: [PATCH] 替换表格列显示产产品名称、产品编号、产品规格、库存数量、出库数量 添加成品库存查询API接口
---
src/api/inventoryManagement/stockManage.js | 9 ++++
src/views/inventoryManagement/stockManagement/index.vue | 77 ++++++++++++++++----------------------
2 files changed, 41 insertions(+), 45 deletions(-)
diff --git a/src/api/inventoryManagement/stockManage.js b/src/api/inventoryManagement/stockManage.js
index 4f5d957..e2a4ebf 100644
--- a/src/api/inventoryManagement/stockManage.js
+++ b/src/api/inventoryManagement/stockManage.js
@@ -17,7 +17,14 @@
params,
});
};
-
+// 鏌ヨ鎴愬搧搴撳瓨淇℃伅鍒楄〃
+export const getStockManageProduction = (params) => {
+ return request({
+ url: "/stockin/listPageProductionStock",
+ method: "get",
+ params,
+ });
+};
// 鏌ヨ鑷畾涔夊叆搴撳簱瀛樹俊鎭垪琛�
export const getStockManagePageByCustom = (params) => {
return request({
diff --git a/src/views/inventoryManagement/stockManagement/index.vue b/src/views/inventoryManagement/stockManagement/index.vue
index e6fb48d..08d05bd 100644
--- a/src/views/inventoryManagement/stockManagement/index.vue
+++ b/src/views/inventoryManagement/stockManagement/index.vue
@@ -47,38 +47,27 @@
label="搴忓彿"
type="index"
width="60" />
- <el-table-column label="鍏ュ簱鏃ユ湡"
- prop="createTime"
- width="100"
- show-overflow-tooltip />
- <el-table-column label="閿�鍞悎鍚屽彿"
- prop="salesContractNo"
+ <el-table-column label="浜у搧鍚嶇О"
+ prop="productName"
width="180"
show-overflow-tooltip />
- <el-table-column label="浜у搧澶х被"
- prop="productCategory"
+ <el-table-column label="浜у搧缂栧彿"
+ prop="productCode"
+ width="180"
show-overflow-tooltip />
- <el-table-column label="瑙勬牸鍨嬪彿"
- prop="specificationModel"
+ <el-table-column label="浜у搧瑙勬牸"
+ prop="model"
show-overflow-tooltip />
<el-table-column label="鍗曚綅"
prop="unit"
width="80"
show-overflow-tooltip />
<el-table-column label="宸插嚭搴撴暟閲�"
- prop="totalInboundNum"
- width="100"
+ prop="outboundNum"
show-overflow-tooltip />
<el-table-column label="鍓╀綑搴撳瓨"
- prop="inboundNum0"
- width="100"
+ prop="stockQuantity"
show-overflow-tooltip />
- <el-table-column label="鍗曚环(鍏�)"
- prop="unitPrice"
- width="150"></el-table-column>
- <el-table-column label="鎬讳环(鍏�)"
- prop="totalPrice"
- width="150"></el-table-column>
<!-- <el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
<template #default="scope">
<el-button link type="primary" size="small" @click="openForm('edit', scope.row);">缂栬緫</el-button>
@@ -203,7 +192,7 @@
import {
getStockManagePage,
getStockManagePageByProduction,
- delStockManage,
+ delStockManage, getStockManageProduction,
} from "@/api/inventoryManagement/stockManage.js";
import {
updateManagement,
@@ -337,7 +326,7 @@
const params = buildQueryParams();
const apiCall =
activeTab.value === "production"
- ? getStockManagePageByProduction(params)
+ ? getStockManageProduction(params)
: getStockManagePage(params);
apiCall
.then(res => {
@@ -345,28 +334,28 @@
tableData.value = res.data.records;
// 涓鸿〃鏍兼暟鎹嚜鍔ㄨ绠楁�讳环
- tableData.value = tableData.value.map(item => {
- // 璁$畻鍓╀綑搴撳瓨
- const stockQuantity = parseFloat(item.inboundNum) || 0;
- const outboundQuantity = parseFloat(item.totalInboundNum) || 0;
- const remainingStock = Math.max(stockQuantity - outboundQuantity, 0);
-
- // 鏍规嵁鏍囩椤电被鍨嬭绠楁�讳环
- if (activeTab.value === "production") {
- // 鎴愬搧搴撳瓨锛氭�讳环 = 鍗曚环 脳 鍓╀綑搴撳瓨
- const unitPrice = parseFloat(item.unitPrice) || 0;
- item.totalPrice = (unitPrice * remainingStock).toFixed(2);
- } else if (activeTab.value === "purchase") {
- // 鍘熸枡搴撳瓨锛氬惈绋庢�讳环 = 鍚◣鍗曚环 脳 鍓╀綑搴撳瓨
- const taxInclusiveUnitPrice =
- parseFloat(item.taxInclusiveUnitPrice) || 0;
- item.taxInclusiveTotalPrice = (
- taxInclusiveUnitPrice * remainingStock
- ).toFixed(2);
- }
-
- return item;
- });
+ // tableData.value = tableData.value.map(item => {
+ // // 璁$畻鍓╀綑搴撳瓨
+ // const stockQuantity = parseFloat(item.inboundNum) || 0;
+ // const outboundQuantity = parseFloat(item.totalInboundNum) || 0;
+ // const remainingStock = Math.max(stockQuantity - outboundQuantity, 0);
+ //
+ // // 鏍规嵁鏍囩椤电被鍨嬭绠楁�讳环
+ // if (activeTab.value === "production") {
+ // // 鎴愬搧搴撳瓨锛氭�讳环 = 鍗曚环 脳 鍓╀綑搴撳瓨
+ // const unitPrice = parseFloat(item.unitPrice) || 0;
+ // item.totalPrice = (unitPrice * remainingStock).toFixed(2);
+ // } else if (activeTab.value === "purchase") {
+ // // 鍘熸枡搴撳瓨锛氬惈绋庢�讳环 = 鍚◣鍗曚环 脳 鍓╀綑搴撳瓨
+ // const taxInclusiveUnitPrice =
+ // parseFloat(item.taxInclusiveUnitPrice) || 0;
+ // item.taxInclusiveTotalPrice = (
+ // taxInclusiveUnitPrice * remainingStock
+ // ).toFixed(2);
+ // }
+ //
+ // return item;
+ // });
total.value = res.data.total;
// 鏁版嵁鍔犺浇瀹屾垚鍚庢鏌ュ簱瀛�
--
Gitblit v1.9.3