新增套餐设置页面中的套餐管理页面并增加相应跳转逻辑
This commit is contained in:
@@ -421,9 +421,13 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { useRouter } from 'vue-router';
|
||||
import request from '@/utils/request';
|
||||
import { listInspectionType, addInspectionType, updateInspectionType, delInspectionType } from '@/api/system/inspectionType';
|
||||
|
||||
// 创建路由实例
|
||||
const router = useRouter();
|
||||
|
||||
// 导航数据
|
||||
const navItems = ref(['检验类型', '检验项目', '套餐设置']);
|
||||
const activeNav = ref(0);
|
||||
@@ -561,21 +565,6 @@ const handleAdd = (row, index) => {
|
||||
tableData.value.splice(index + 1, 0, newRow);
|
||||
editingRowId.value = newRow.id;
|
||||
};
|
||||
|
||||
// 测试删除API
|
||||
const testDeleteApi = () => {
|
||||
console.log('测试删除API');
|
||||
request({
|
||||
url: '/system/inspection-type/test-delete/1',
|
||||
method: 'delete'
|
||||
}).then(response => {
|
||||
console.log('测试删除成功,响应:', response);
|
||||
ElMessage.success('测试删除成功');
|
||||
}).catch(error => {
|
||||
console.error('测试删除失败:', error);
|
||||
ElMessage.error('测试删除失败: ' + (error.response?.data?.msg || '未知错误'));
|
||||
});
|
||||
};
|
||||
|
||||
const handleDelete = (id) => {
|
||||
console.log('删除按钮被点击,原始ID:', id, '类型:', typeof id);
|
||||
@@ -633,7 +622,10 @@ const handlePackageLevelChange = () => {
|
||||
};
|
||||
|
||||
const handlePackageManagement = () => {
|
||||
alert('即将进入套餐管理界面');
|
||||
// 跳转到套餐管理页面
|
||||
router.push({
|
||||
path: '/maintainSystem/Inspection/PackageManagement'
|
||||
});
|
||||
};
|
||||
|
||||
const refreshPage = () => {
|
||||
@@ -642,8 +634,13 @@ const refreshPage = () => {
|
||||
|
||||
// 页面加载时获取数据
|
||||
onMounted(() => {
|
||||
getInspectionTypeList();
|
||||
});
|
||||
getInspectionTypeList();
|
||||
// 检查URL参数,如果有tab参数则切换到对应导航项
|
||||
const query = router.currentRoute.value.query;
|
||||
if (query.tab === '0' || query.tab === '1' || query.tab === '2') {
|
||||
activeNav.value = parseInt(query.tab);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user