|
|
@@ -93,13 +93,13 @@
|
|
|
<el-dialog v-model="dialogFormVisible" title="修改库存" width="500">
|
|
|
<el-form ref="ruleFormRef" :model="formInventory" :rules="rules" @submit.prevent>
|
|
|
<el-form-item label="套餐名">
|
|
|
- {{ formInventory.packageName }}
|
|
|
+ {{ formInventory.groupName }}
|
|
|
</el-form-item>
|
|
|
<el-form-item label="剩余库存">
|
|
|
- {{ formInventory.remainingInventory }}
|
|
|
+ {{ formInventory.inventoryNum }}
|
|
|
</el-form-item>
|
|
|
<el-form-item label="修改库存" prop="newInventory">
|
|
|
- <el-input v-model="formInventory.newInventory" placeholder="请输入" />
|
|
|
+ <el-input v-model="formInventory.newInventory" placeholder="请输入库存数量" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
@@ -154,14 +154,14 @@ import { ElMessage } from "element-plus";
|
|
|
import ProTable from "@/components/ProTable/index.vue";
|
|
|
import { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
|
|
|
import { Plus } from "@element-plus/icons-vue";
|
|
|
-import { deleteThali, getThaliList, sjxj, xgkc } from "@/api/modules/groupPackageManagement";
|
|
|
+import { deleteThali, getThaliList, sjxj, updateNum } from "@/api/modules/groupPackageManagement";
|
|
|
|
|
|
const router = useRouter();
|
|
|
const dialogFormVisible = ref(false);
|
|
|
const formInventory: any = ref({
|
|
|
id: "",
|
|
|
- packageName: "",
|
|
|
- remainingInventory: "",
|
|
|
+ groupName: "",
|
|
|
+ inventoryNum: "",
|
|
|
newInventory: ""
|
|
|
});
|
|
|
const rowData = ref<any>();
|
|
|
@@ -432,8 +432,8 @@ const changeTypes = async (row: any, status: string) => {
|
|
|
};
|
|
|
const changeInventory = (row: any) => {
|
|
|
formInventory.value.id = row.id;
|
|
|
- formInventory.value.packageName = 1;
|
|
|
- formInventory.value.remainingInventory = 1;
|
|
|
+ formInventory.value.groupName = row.groupName;
|
|
|
+ formInventory.value.inventoryNum = row.inventoryNum;
|
|
|
formInventory.value.newInventory = "";
|
|
|
dialogFormVisible.value = true;
|
|
|
};
|
|
|
@@ -442,7 +442,7 @@ const handleSubmit = async () => {
|
|
|
if (!ruleFormRef.value) return;
|
|
|
await ruleFormRef.value.validate(async (valid, fields) => {
|
|
|
if (valid) {
|
|
|
- let res = await xgkc({ id: formInventory.value.id, status: formInventory.value.newInventory });
|
|
|
+ let res = await updateNum({ id: formInventory.value.id, num: formInventory.value.newInventory });
|
|
|
if (res && res.code == 200) {
|
|
|
ElMessage.success("库存修改成功");
|
|
|
dialogFormVisible.value = false;
|
|
|
@@ -456,8 +456,8 @@ const closeDialog = () => {
|
|
|
dialogFormVisible.value = false;
|
|
|
formInventory.value = {
|
|
|
id: "",
|
|
|
- packageName: "",
|
|
|
- remainingInventory: "",
|
|
|
+ groupName: "",
|
|
|
+ inventoryNum: "",
|
|
|
newInventory: ""
|
|
|
};
|
|
|
};
|