From 477906d4c5dc90c173094018ed49d817b208472a Mon Sep 17 00:00:00 2001
From: gyq <875626088@qq.com>
Date: Tue, 8 Oct 2024 15:25:33 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=95=86=E5=93=81=E5=88=97?=
=?UTF-8?q?=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/shop.js | 9 ++++++
src/views/product/index.vue | 56 +++++++++++++++++++++++++++++++++----
2 files changed, 60 insertions(+), 5 deletions(-)
diff --git a/src/api/shop.js b/src/api/shop.js
index 6e99bf6..00a4a48 100644
--- a/src/api/shop.js
+++ b/src/api/shop.js
@@ -770,3 +770,12 @@ export function tbProductStockDetailStock(data) {
data
});
}
+
+// 商品库存记录列表
+export function stockWarnLine(data) {
+ return request({
+ url: `/api/stock/warnLine`,
+ method: "PUT",
+ data
+ });
+}
diff --git a/src/views/product/index.vue b/src/views/product/index.vue
index e126c53..a45cd77 100644
--- a/src/views/product/index.vue
+++ b/src/views/product/index.vue
@@ -19,6 +19,7 @@
查询
重置
+ 库存预警:{{ warnLine }}
@@ -42,7 +43,7 @@
现有数量
- {{ countInfo.stockNumber || 0 }}
+ {{ countInfo.stockNumber || 0 }}
@@ -56,8 +57,15 @@
{{ countInfo.addCountNumber || 0 }}
-
手动增加:
-
{{ countInfo.addNumber || 0 }}
+
+ 手动增加:
+ {{ countInfo.addNumber || 0 }}
+
+
+
+ 退货:
+ {{ countInfo.refundNumber || 0 }}
+
@@ -215,6 +223,18 @@
确 定
+
+
+
+
+
+
+
+
+
@@ -224,7 +244,7 @@ import dayjs from 'dayjs'
import settings from '@/settings'
import BindCons from './components/bindCons.vue'
import StockHistory from './components/stockHistory.vue'
-import { tbProductListV2, tbShopCategoryGet, tbProductDelete, tbProductIsHot, upProSort, updateProductData, tbProductStockDetailStockCount } from '@/api/shop'
+import { tbProductListV2, tbShopCategoryGet, tbProductDelete, tbProductIsHot, upProSort, updateProductData, tbProductStockDetailStockCount, stockWarnLine } from '@/api/shop'
export default {
components: {
BindCons,
@@ -264,7 +284,10 @@ export default {
key: '',
value: ''
},
- countInfo: {}
+ countInfo: {},
+ showStockWarning: false, // 显示库存预警值
+ warnLineLoading: false,
+ warnLine: 0
}
},
async mounted() {
@@ -285,6 +308,26 @@ export default {
this.tbProductStockDetailStockCount()
},
methods: {
+ // 显示修改商品警告线
+ showStockWarningHandle() {
+ this.showStockWarning = true
+ },
+ // 修改商品警告线
+ async stockWarnLineConfirm() {
+ try {
+ this.warnLineLoading = true
+ const res = await stockWarnLine({
+ shopId: localStorage.getItem('shopId'),
+ warnLine: this.warnLine
+ })
+ this.warnLineLoading = false
+ this.showStockWarning = false
+ this.$message.success('修改成功')
+ } catch (error) {
+ this.warnLineLoading = false
+ console.log(error);
+ }
+ },
// 显示库存记录
showStockHistory(key) {
this.$refs.stockHistory.show(key)
@@ -440,6 +483,8 @@ export default {
sort: this.tableData.sort
})
+ this.warnLine = res.warnLine
+
res.content.map(item => {
item.key = item.id
item.skuList.map(val => {
@@ -497,6 +542,7 @@ export default {
.data_wrap {
display: flex;
justify-content: space-between;
+ padding: 0 60px;
.item {
display: flex;