feat: 添加修改库存功能
This commit is contained in:
parent
c40281902a
commit
84cea59064
|
|
@ -119,6 +119,14 @@ const AuthAPI = {
|
|||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
// 库存修改
|
||||
modifyStock(data: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/modifyStock`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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: "上架",
|
||||
|
|
|
|||
Loading…
Reference in New Issue