修改进度管理bug
This commit is contained in:
@ -20,9 +20,8 @@
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane :label="item.name" v-for="item in tabList" :key="item.id"></el-tab-pane>
|
||||
|
||||
<el-tabs type="border-card" v-model="activeTab" @tab-change="getList">
|
||||
<el-tab-pane :label="item.name" v-for="item in tabList" :key="item.id" :name="item.id"></el-tab-pane>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
@ -55,6 +54,14 @@
|
||||
<dict-tag :options="progress_work_type" :value="row.workType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关联结构" align="center" prop="relevancyStructure" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.relevancyStructure == '1' ? 'primary' : 'success'">
|
||||
{{ row.relevancyStructure == '1' ? '子项目' : '方阵' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
@ -105,6 +112,12 @@
|
||||
<el-form-item label="类别名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入类别名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关联结构" prop="relevancyStructure">
|
||||
<el-select v-model="form.relevancyStructure" value-key="" placeholder="请选择关联结构" clearable filterable @change="">
|
||||
<el-option label="子项目" value="1"></el-option>
|
||||
<el-option label="方阵" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联数据" prop="workType">
|
||||
<el-select v-model="form.workType" placeholder="请选择关联数据">
|
||||
<el-option v-for="dict in progress_work_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
@ -131,6 +144,7 @@ import {
|
||||
getProgressCategoryTemplate,
|
||||
getTabList,
|
||||
listProgressCategoryTemplate,
|
||||
listProgressCategoryTemplateByParent,
|
||||
updateProgressCategoryTemplate
|
||||
} from '@/api/progress/progressCategoryTemplate';
|
||||
import {
|
||||
@ -165,6 +179,7 @@ const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
const activeTab = ref('0');
|
||||
|
||||
const initFormData: ProgressCategoryTemplateForm = {
|
||||
id: undefined,
|
||||
@ -194,7 +209,8 @@ const data = reactive<PageData<ProgressCategoryTemplateForm, ProgressCategoryTem
|
||||
name: [{ required: true, message: '类别名称不能为空', trigger: 'blur' }],
|
||||
unitType: [{ required: true, message: '计量方式不能为空', trigger: 'change' }],
|
||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||
constructionType: [{ required: true, message: '施工类型不能为空', trigger: 'change' }]
|
||||
constructionType: [{ required: true, message: '施工类型不能为空', trigger: 'change' }],
|
||||
relevancyStructure: [{ required: true, message: '关联结构不能为空', trigger: 'change' }]
|
||||
}
|
||||
});
|
||||
|
||||
@ -203,7 +219,7 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询进度类别模版列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listProgressCategoryTemplate(queryParams.value);
|
||||
const res = await listProgressCategoryTemplateByParent(activeTab.value);
|
||||
const data = proxy?.handleTree<ProgressCategoryTemplateVO>(res.data, 'id', 'parentId');
|
||||
if (data) {
|
||||
progressCategoryTemplateList.value = data;
|
||||
@ -213,7 +229,7 @@ const getList = async () => {
|
||||
|
||||
/** 查询进度类别模版下拉树结构 */
|
||||
const getTreeselect = async () => {
|
||||
const res = await listProgressCategoryTemplate();
|
||||
const res = await listProgressCategoryTemplate({ projectId: 0 });
|
||||
progressCategoryTemplateOptions.value = [];
|
||||
const data: ProgressCategoryTemplateOption = { id: 0, name: '顶级节点', children: [] };
|
||||
data.children = proxy?.handleTree<ProgressCategoryTemplateOption>(res.data, 'id', 'parentId');
|
||||
@ -311,10 +327,10 @@ const handleDelete = async (row: ProgressCategoryTemplateVO) => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getTabList().then((res) => {
|
||||
console.log('tabList', res.data);
|
||||
getTabList('0').then((res) => {
|
||||
tabList.value = res.data;
|
||||
activeTab.value = res.data[0]?.id;
|
||||
getList();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user