diff --git a/manager/src/views/promotions/coupon/coupon.vue b/manager/src/views/promotions/coupon/coupon.vue
index e7334063..05863f8a 100644
--- a/manager/src/views/promotions/coupon/coupon.vue
+++ b/manager/src/views/promotions/coupon/coupon.vue
@@ -99,16 +99,16 @@
@click="close(row)"
>关闭
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
diff --git a/manager/src/views/promotions/points-goods/points-goods.vue b/manager/src/views/promotions/points-goods/points-goods.vue
index 86b7107d..db039d99 100644
--- a/manager/src/views/promotions/points-goods/points-goods.vue
+++ b/manager/src/views/promotions/points-goods/points-goods.vue
@@ -124,14 +124,14 @@
style="margin-right: 5px"
>关闭
-
+
+
+
+
+
+
+
+
diff --git a/manager/src/views/promotions/seckill/seckill.vue b/manager/src/views/promotions/seckill/seckill.vue
index a2114109..57b5d1aa 100644
--- a/manager/src/views/promotions/seckill/seckill.vue
+++ b/manager/src/views/promotions/seckill/seckill.vue
@@ -93,14 +93,14 @@
>关闭
-
+
+
+
+
+
+
+
+
diff --git a/seller/src/api/goods.js b/seller/src/api/goods.js
index 8b7ea365..635c2776 100644
--- a/seller/src/api/goods.js
+++ b/seller/src/api/goods.js
@@ -231,6 +231,13 @@ export const updateGoodsSkuStocks = params => {
"Content-Type": "application/json"
});
};
+// 更新商品库存预警
+export const updateGoodsAlertStocks = params => {
+ return putRequest("/goods/goods/update/alert/stocks", params, {
+ "Content-Type": "application/json"
+ });
+};
+
// 获取商品分页列表
export const getGoodsListDataSeller = params => {
return getRequest("/goods/goods/list", params);
diff --git a/seller/src/views/goods/goods-seller/goods.vue b/seller/src/views/goods/goods-seller/goods.vue
index 0140788e..63e4928b 100644
--- a/seller/src/views/goods/goods-seller/goods.vue
+++ b/seller/src/views/goods/goods-seller/goods.vue
@@ -148,9 +148,9 @@
title="更新库存"
v-model="updateStockModalVisible"
:mask-closable="false"
- :width="500"
+ :width="610"
>
-
+
-
-
+
+
+
+
+
@@ -218,6 +221,7 @@ import {
getGoodsListDataSeller,
getGoodsSkuListDataSeller,
updateGoodsSkuStocks,
+ updateGoodsAlertStocks,
upGoods,
lowGoods,
deleteGoods,
@@ -244,6 +248,7 @@ export default {
logisticsTemplate: [], // 物流列表
updateStockModalVisible: false, // 更新库存模态框显隐
stockAllUpdate: undefined, // 更新库存数量
+ stockAllAlertQuantity: undefined, // 更新规格预警数量
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
@@ -252,6 +257,7 @@ export default {
order: "desc", // 默认排序方式
},
stockList: [], // 库存列表
+ alertQuantityList: [], // 库存预警列表
form: {
// 添加或编辑表单对象初始化数据
goodsName: "",
@@ -262,7 +268,7 @@ export default {
},
updateStockColumns: [
{
- title: "库存预警",
+ title: "sku规格",
key: "sn",
minWidth: 120,
render: (h, params) => {
@@ -303,9 +309,9 @@ export default {
},
},
],
- yujingColumns: [
+ alertQuantityColumns: [
{
- title: "sku规格",
+ title: "库存预警",
key: "sn",
minWidth: 120,
render: (h, params) => {
@@ -335,11 +341,11 @@ export default {
let vm = this;
return h("InputNumber", {
props: {
- value: params.row.quantity,
+ value: params.row.alertQuantity,
},
on: {
"on-change": (event) => {
- vm.stockList[params.index].quantity = event;
+ vm.alertQuantityList[params.index].alertQuantity = event;
},
},
});
@@ -537,6 +543,7 @@ export default {
],
data: [], // 表单数据
total: 0, // 表单数据总数
+ updateStockType: 'updateStock', // 更新库存状态
};
},
methods: {
@@ -577,8 +584,11 @@ export default {
getGoodsSkuListDataSeller({ goodsId: id, pageSize: 1000 }).then((res) => {
if (res.success) {
this.updateStockModalVisible = true;
+ this.updateStockType = 'updateStock';
this.stockAllUpdate = undefined;
this.stockList = res.result.records;
+ this.stockAllAlertQuantity = undefined;
+ this.alertQuantityList = res.result.records;
}
});
},
@@ -631,21 +641,41 @@ export default {
});
},
// 更新库存
- updateStock() {
- let updateStockList = this.stockList.map((i) => {
- let j = { skuId: i.id, quantity: i.quantity };
- if (this.stockAllUpdate) {
- j.quantity = this.stockAllUpdate;
- }
- return j;
- });
- updateGoodsSkuStocks(updateStockList).then((res) => {
- if (res.success) {
- this.updateStockModalVisible = false;
- this.$Message.success("更新库存成功");
- this.getDataList();
- }
- });
+ updateStock () {
+ if (this.updateStockType === 'alertQuantity' || this.updateStockType === 'alertQuantityAll') {
+ // alertQuantity 手动库存预警更新,alertQuantityAll 批量库存预警更新
+ let updateAlertQuantityList = this.alertQuantityList.map((i) => {
+ let j = { skuId: i.id, alertQuantity: i.alertQuantity };
+ if (this.stockAllAlertQuantity) {
+ j.alertQuantity = this.stockAllAlertQuantity;
+ }
+ return j;
+ });
+ updateGoodsAlertStocks(updateAlertQuantityList).then((res) => {
+ if (res.success) {
+ this.updateStockModalVisible = false;
+ this.$Message.success("更新库存预警成功");
+ this.getDataList();
+ }
+ });
+ } else if (this.updateStockType === 'updateStock' || this.updateStockType === 'stockAll') {
+ // updateStock 手动规格更新,stockAll 批量规格更新
+ let updateStockList = this.stockList.map((i) => {
+ let j = { skuId: i.id, quantity: i.quantity };
+ if (this.stockAllUpdate) {
+ j.quantity = this.stockAllUpdate;
+ }
+ return j;
+ });
+ updateGoodsSkuStocks(updateStockList).then((res) => {
+ if (res.success) {
+ this.updateStockModalVisible = false;
+ this.$Message.success("更新库存成功");
+ this.getDataList();
+ }
+ });
+ }
+
},
// 改变页码
changePage(v) {
diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue
index c8762254..73da8c5d 100644
--- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue
+++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue
@@ -213,8 +213,8 @@
overflow-x: hidden;
}
">
-
-
+
+
{{baseInfoForm.goodsUnit || ""}}
@@ -644,6 +644,7 @@ export default {
"price",
"weight",
"quantity",
+ "alertQuantity",
"specId",
"specValueId",
],
@@ -1057,6 +1058,7 @@ export default {
price: e.price,
// cost: e.cost,
quantity: e.quantity,
+ alertQuantity: e.alertQuantity,
weight: e.weight,
};
e.specList.forEach((u) => {
@@ -1360,6 +1362,7 @@ export default {
find.sn && (find.sn = "");
// find.cost && (find.cost = "");
find.quantity && (find.quantity = "");
+ find.alertQuantity && (find.alertQuantity = "");
find.weight && (find.weight = "");
this.skuTableData.splice(this.skuTableData.length, 0, find);
@@ -1374,6 +1377,7 @@ export default {
find.sn && (find.sn = "");
// find.cost && (find.cost = "");
find.quantity && (find.quantity = "");
+ find.alertQuantity && (find.alertQuantity = "");
find.weight && (find.weight = "");
this.skuTableData.splice(index, 0, find);
@@ -1421,10 +1425,7 @@ export default {
key: columnName,
});
});
- pushData.push({
- title: "库存预警",
- slot: "yujing",
- });
+
// 有成本价和价格的情况
if (this.baseInfoForm.salesModel !== "WHOLESALE") {
pushData.push(
@@ -1458,12 +1459,15 @@ export default {
slot: "weight",
});
}
-
pushData.push(
{
title: "库存",
slot: "quantity",
},
+ {
+ title: "库存预警",
+ slot: "alertQuantity",
+ },
{
title: "货号",
slot: "sn",
@@ -1510,6 +1514,7 @@ export default {
id: skus[index].id,
sn: skus[index].sn,
quantity: skus[index].quantity,
+ alertQuantity: skus[index].alertQuantity,
cost: 1,
price: skus[index].price,
[spec[0].name]: specItem.value,
@@ -1591,7 +1596,18 @@ export default {
this.validatatxt = "请输入0~99999999之间的整数";
return;
}
- }
+ } else if (item === "alertQuantity") {
+ if (
+ !/^[0-9]\d*$/.test(row[item]) ||
+ parseInt(row[item]) < 0 ||
+ parseInt(row[item]) > 99999999
+ ) {
+ // 库存预警
+ this.validateError.push([index, item]);
+ this.validatatxt = "请输入0~99999999之间的整数";
+ return;
+ }
+ }
// else if (item === "cost" || item === "price") {
// if (
// !regular.money.test(row[item]) ||
@@ -1684,6 +1700,7 @@ export default {
cost: 1,
price: sku.price,
quantity: sku.quantity,
+ alertQuantity: sku.alertQuantity,
sn: sku.sn,
images: sku.images,
};
diff --git a/seller/src/views/promotion/coupon/coupon.vue b/seller/src/views/promotion/coupon/coupon.vue
index ecf49242..9bf5770d 100644
--- a/seller/src/views/promotion/coupon/coupon.vue
+++ b/seller/src/views/promotion/coupon/coupon.vue
@@ -235,7 +235,7 @@ export default {
slot: "action",
align: "center",
fixed: "right",
- maxWidth: 140,
+ maxWidth: 240,
},
],
data: [], // 表单数据
diff --git a/seller/src/views/promotion/full-discount/full-discount.vue b/seller/src/views/promotion/full-discount/full-discount.vue
index b7a9b1f4..e3b1a197 100644
--- a/seller/src/views/promotion/full-discount/full-discount.vue
+++ b/seller/src/views/promotion/full-discount/full-discount.vue
@@ -43,8 +43,8 @@
@click="openOrClose(row)">关闭
-
+
+
diff --git a/seller/src/views/promotion/pintuan/pintuan.vue b/seller/src/views/promotion/pintuan/pintuan.vue
index 25f86bae..a645505d 100644
--- a/seller/src/views/promotion/pintuan/pintuan.vue
+++ b/seller/src/views/promotion/pintuan/pintuan.vue
@@ -77,13 +77,13 @@
@click="manage(row, 'view')"
>查看
-
+
+
+
+
+
+
+