feat: 添加修改库存功能
This commit is contained in:
parent
c40281902a
commit
84cea59064
|
|
@ -119,6 +119,14 @@ const AuthAPI = {
|
||||||
method: "post",
|
method: "post",
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
// 库存修改
|
||||||
|
modifyStock(data: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/modifyStock`,
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="售价" prop="price">
|
<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>
|
||||||
<el-table-column label="账存数量" prop="beforeNumber"></el-table-column>
|
<el-table-column label="账存数量" prop="beforeNumber"></el-table-column>
|
||||||
<el-table-column label="盈亏数量" prop="inOutNumber"></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"
|
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
|
||||||
@click="handleSwitchChange(scope.row)"></el-switch>
|
@click="handleSwitchChange(scope.row)"></el-switch>
|
||||||
</template>
|
</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">
|
<template #tuikuantuihui="scope">
|
||||||
<el-switch v-if="!scope.row.productId" v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
|
<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>
|
@click="handleSwitchhaocai(scope.row)"></el-switch>
|
||||||
|
|
@ -139,6 +145,10 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</MyDialog>
|
</MyDialog>
|
||||||
|
<!-- 库存修改 -->
|
||||||
|
<MyDialog ref="myDialogRefkucun" @confirm="confirmkucun" width="30%" title="库存修改">
|
||||||
|
<el-input-number v-model="kucundata.stockNumber" :min="0" />
|
||||||
|
</MyDialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -155,6 +165,7 @@ import editModalConfig from "./indexconfig/edit";
|
||||||
import searchConfig from "./indexconfig/search";
|
import searchConfig from "./indexconfig/search";
|
||||||
import MyDialog from "@/components/mycomponents/myDialog.vue";
|
import MyDialog from "@/components/mycomponents/myDialog.vue";
|
||||||
import Statistics from "./indexconfig/statistics.vue";
|
import Statistics from "./indexconfig/statistics.vue";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
searchRef,
|
searchRef,
|
||||||
contentRef,
|
contentRef,
|
||||||
|
|
@ -174,8 +185,10 @@ const myDialogRef = ref(null);
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const myDialogRefbaosun = ref(null);
|
const myDialogRefbaosun = ref(null);
|
||||||
const myDialogRefhaocai = ref(null);
|
const myDialogRefhaocai = ref(null);
|
||||||
|
const myDialogRefkucun = ref(null);
|
||||||
let haocaiData = ref({});
|
let haocaiData = ref({});
|
||||||
let options = ref([]);
|
let options = ref([]);
|
||||||
|
let kucundata = ref(0)
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
warnLine: "",
|
warnLine: "",
|
||||||
});
|
});
|
||||||
|
|
@ -189,6 +202,16 @@ function newHandleQueryClick(e: IObject | undefined) {
|
||||||
contentRef.value?.fetchPageData({ ...e, ...filterParams }, true);
|
contentRef.value?.fetchPageData({ ...e, ...filterParams }, true);
|
||||||
getTongji(e);
|
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) {
|
function editOpen(item: any) {
|
||||||
haocaiData.value = item
|
haocaiData.value = item
|
||||||
if (haocaiData.value.consList.length == 0) {
|
if (haocaiData.value.consList.length == 0) {
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,8 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||||
label: "商品规格", align: "center", prop: "type", templet: "custom",
|
label: "商品规格", align: "center", prop: "type", templet: "custom",
|
||||||
slotName: "type",
|
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: "耗材信息", align: "center", prop: "consName", slotName: "consumables", templet: "custom", },
|
||||||
{
|
{
|
||||||
label: "上架",
|
label: "上架",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue