商品分类和违禁物品页面弹窗参数重置问题优化

This commit is contained in:
2090205686@qq.com 2025-06-11 10:32:05 +08:00
parent 2a5eb70a1f
commit 182b981c63
2 changed files with 36 additions and 9 deletions

View File

@ -278,10 +278,20 @@ const onSaveCategory = () => {
}; };
const addItem = () => { const addItem = () => {
dialogTitle.value = "添加违禁物品"; dialogTitle.value = "添加违禁物品";
Object.assign(dialogForm, { //
id: "",
violateGoodName: "",
goodParameter: "",
});
dialogFormVisible.value = true; dialogFormVisible.value = true;
}; };
const cancelDialog = () => { const cancelDialog = () => {
dialogRef.value.resetFields(); dialogRef.value.resetFields();
Object.assign(dialogForm, { //
id: "",
violateGoodName: "",
goodParameter: "",
});
dialogFormVisible.value = false; dialogFormVisible.value = false;
}; };

View File

@ -280,7 +280,7 @@ const handleEdit = (row) => {
dialogForm.name = row.name; dialogForm.name = row.name;
dialogForm.level = row.level; dialogForm.level = row.level;
dialogForm.parentId = row.parentId; dialogForm.parentId = row.parentId;
dialogForm.status = row.status.toString(); dialogForm.status = row.status?.toString() ?? '1';
}; };
// //
const handleDelete = (row) => { const handleDelete = (row) => {
@ -314,7 +314,7 @@ const dialogTitle = ref("添加分类");
const dialogForm = reactive({ const dialogForm = reactive({
type: null, //1->,2->3->,4-> type: null, //1->,2->3->,4->
name: "", // name: "", //
parentId: [], //id parentId: "", //id
level: "", //,parentId level: "", //,parentId
sort: "", // sort: "", //
status: "1", //(1- 2-) status: "1", //(1- 2-)
@ -400,10 +400,27 @@ const onSaveCategory = () => {
const addCategory = () => { const addCategory = () => {
dialogTitle.value = "添加分类"; dialogTitle.value = "添加分类";
getGoodTypeList(); getGoodTypeList();
dialogRef.value.resetFields();
Object.assign(dialogForm, { //
id: "",
type: null,
name: "",
level: "",
parentId: "",
status: "1",
});
dialogFormVisible.value = true; dialogFormVisible.value = true;
}; };
const cancelDialog = () => { const cancelDialog = () => {
dialogRef.value.resetFields(); dialogRef.value.resetFields();
Object.assign(dialogForm, { //
id: "",
type: null,
name: "",
level: "",
parentId: "",
status: "1",
});
dialogFormVisible.value = false; dialogFormVisible.value = false;
}; };