From 84cea590646009f9419dbbdeb469d0cbdc717c06 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Fri, 21 Mar 2025 10:17:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/product/index.ts | 8 +++++++ .../consumables/components/addConsTakin.vue | 2 +- src/views/product/index.vue | 23 +++++++++++++++++++ src/views/product/indexconfig/content.ts | 3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/api/product/index.ts b/src/api/product/index.ts index a8865b3..79a3706 100644 --- a/src/api/product/index.ts +++ b/src/api/product/index.ts @@ -119,6 +119,14 @@ const AuthAPI = { method: "post", data, }); + }, + // 库存修改 + modifyStock(data: any) { + return request({ + url: `${baseURL}/modifyStock`, + method: "post", + data, + }); } }; diff --git a/src/views/inventory/consumables/components/addConsTakin.vue b/src/views/inventory/consumables/components/addConsTakin.vue index ce02143..1784c28 100644 --- a/src/views/inventory/consumables/components/addConsTakin.vue +++ b/src/views/inventory/consumables/components/addConsTakin.vue @@ -43,7 +43,7 @@ - + diff --git a/src/views/product/index.vue b/src/views/product/index.vue index a98ca37..a3f499c 100644 --- a/src/views/product/index.vue +++ b/src/views/product/index.vue @@ -25,6 +25,12 @@ + + @@ -155,6 +165,7 @@ import editModalConfig from "./indexconfig/edit"; import searchConfig from "./indexconfig/search"; import MyDialog from "@/components/mycomponents/myDialog.vue"; import Statistics from "./indexconfig/statistics.vue"; + const { searchRef, contentRef, @@ -174,8 +185,10 @@ const myDialogRef = ref(null); const route = useRoute(); const myDialogRefbaosun = ref(null); const myDialogRefhaocai = ref(null); +const myDialogRefkucun = ref(null); let haocaiData = ref({}); let options = ref([]); +let kucundata = ref(0) const form = reactive({ warnLine: "", }); @@ -189,6 +202,16 @@ function newHandleQueryClick(e: IObject | undefined) { contentRef.value?.fetchPageData({ ...e, ...filterParams }, true); getTongji(e); } +// 库存修改 +function kucunedit(item) { + kucundata.value = item + myDialogRefkucun.value.open() +} +async function confirmkucun() { + let res = await UserAPI.modifyStock({ id: kucundata.value.id, stockNumber: kucundata.value.stockNumber }) + ElMessage.success('成功') + myDialogRefkucun.value.close() +} function editOpen(item: any) { haocaiData.value = item if (haocaiData.value.consList.length == 0) { diff --git a/src/views/product/indexconfig/content.ts b/src/views/product/indexconfig/content.ts index a826a65..efd789d 100644 --- a/src/views/product/indexconfig/content.ts +++ b/src/views/product/indexconfig/content.ts @@ -76,7 +76,8 @@ const contentConfig: IContentConfig = { label: "商品规格", align: "center", prop: "type", templet: "custom", slotName: "type", }, - { label: "库存", align: "center", prop: "stockNumber" }, + // { label: "库存", align: "center", prop: "stockNumber" }, + { label: "库存", align: "center", slotName: "kucunedit", templet: "custom", prop: "stockNumber" }, { label: "耗材信息", align: "center", prop: "consName", slotName: "consumables", templet: "custom", }, { label: "上架",