From ab42e8d9f932021e1100363cd1f42138b3ae8798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Tue, 8 Oct 2024 14:41:58 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=8E=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E7=9A=84=E8=AF=A6?= =?UTF-8?q?=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order_manage/components/orderDetail.vue | 166 ++++++++++++------ src/views/product/add_shop.vue | 3 +- 2 files changed, 117 insertions(+), 52 deletions(-) diff --git a/src/views/order_manage/components/orderDetail.vue b/src/views/order_manage/components/orderDetail.vue index 94cc1c2..19c573c 100644 --- a/src/views/order_manage/components/orderDetail.vue +++ b/src/views/order_manage/components/orderDetail.vue @@ -1,7 +1,18 @@ @@ -294,7 +358,7 @@ export default { padding-top: 20px; div { - width: 33.333%; + width: 25%; } } } diff --git a/src/views/product/add_shop.vue b/src/views/product/add_shop.vue index 72d9d6e..8c460c2 100644 --- a/src/views/product/add_shop.vue +++ b/src/views/product/add_shop.vue @@ -750,7 +750,8 @@ export default { console.log(this.form.skuList) const hasUndefined = this.form.skuList.some(obj => { for (const key in obj) { - if (obj[key] === undefined) { + console.log(key, obj) + if (obj['salePrice'] === undefined || obj['memberPrice'] === undefined || obj['costPrice'] === undefined || obj['originPrice'] === undefined) { return true; // 如果找到undefined,立即停止搜索并返回true } } 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 2/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=97=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; From 44c2f6c3dded627924e8c64baf54ff94a0866339 Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Tue, 8 Oct 2024 16:37:39 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=93=E5=AD=98=E9=A2=84=E8=AD=A6=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=80=97=E6=9D=90=E7=BB=91=E5=AE=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop.js | 6 +++--- src/views/product/index.vue | 40 ++++++++++++++++++++++++++++--------- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/api/shop.js b/src/api/shop.js index 00a4a48..e452c19 100644 --- a/src/api/shop.js +++ b/src/api/shop.js @@ -736,11 +736,11 @@ export function queryShopUserFlow(params) { } // 商品列表 V2 -export function tbProductListV2(params) { +export function tbProductListV2(data) { return request({ url: `/api/tbProduct/list/v2`, - method: "get", - params + method: "post", + data }); } diff --git a/src/views/product/index.vue b/src/views/product/index.vue index a45cd77..5c47368 100644 --- a/src/views/product/index.vue +++ b/src/views/product/index.vue @@ -16,6 +16,11 @@ + + + + 查询 重置 @@ -142,10 +147,11 @@