同步6/16
This commit is contained in:
@@ -133,10 +133,14 @@ const { queryParams, form } = toRefs(data);
|
||||
/** 查询房屋设施管理列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listHouseFacilities(queryParams.value);
|
||||
houseFacilitiesList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
listHouseFacilities(queryParams.value)
|
||||
.then((res) => {
|
||||
houseFacilitiesList.value = res.rows;
|
||||
total.value = res.total;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
@@ -180,27 +184,11 @@ const handleAdd = () => {
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: HouseFacilitiesVO) => {
|
||||
const _ids = row?.id || ids.value[0];
|
||||
router.push({
|
||||
path: '/system/addHouseFacilities',
|
||||
query: {
|
||||
id: row.id
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
houseFacilitiesFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateHouseFacilities(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addHouseFacilities(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
id: _ids
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user