feat: 添加修改库存功能

This commit is contained in:
duan 2025-03-21 10:17:25 +08:00
parent c40281902a
commit 84cea59064
4 changed files with 34 additions and 2 deletions

View File

@ -119,6 +119,14 @@ const AuthAPI = {
method: "post",
data,
});
},
// 库存修改
modifyStock(data: any) {
return request<any, Responseres>({
url: `${baseURL}/modifyStock`,
method: "post",
data,
});
}
};

View File

@ -43,7 +43,7 @@
</template>
</el-table-column>
<el-table-column label="售价" prop="price">
<template v-slot="scope">{{ scope.row.price }}</template>
<template v-slot="scope">{{ scope.row.winLossAmount }}</template>
</el-table-column>
<el-table-column label="账存数量" prop="beforeNumber"></el-table-column>
<el-table-column label="盈亏数量" prop="inOutNumber"></el-table-column>

View File

@ -25,6 +25,12 @@
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
@click="handleSwitchChange(scope.row)"></el-switch>
</template>
<template #kucunedit="scope">
{{ scope.row.stockNumber }} <el-icon @click="kucunedit(scope.row)" style="cursor: pointer;color: #4080ff;">
<EditPen />
</el-icon>
</template>
<template #tuikuantuihui="scope">
<el-switch v-if="!scope.row.productId" v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
@click="handleSwitchhaocai(scope.row)"></el-switch>
@ -139,6 +145,10 @@
</el-table-column>
</el-table>
</MyDialog>
<!-- 库存修改 -->
<MyDialog ref="myDialogRefkucun" @confirm="confirmkucun" width="30%" title="库存修改">
<el-input-number v-model="kucundata.stockNumber" :min="0" />
</MyDialog>
</div>
</template>
@ -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) {

View File

@ -76,7 +76,8 @@ const contentConfig: IContentConfig<UserPageQuery> = {
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: "上架",