This commit is contained in:
Teo
2025-08-30 01:16:18 +08:00
parent 76488de0cd
commit 873aecf815
6 changed files with 66 additions and 43 deletions

View File

@ -1,7 +1,6 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter"
:leave-active-class="proxy?.animate.searchAnimate.leave">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
@ -10,8 +9,7 @@
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option v-for="dict in project_construction_status" :key="dict.value" :label="dict.label"
:value="dict.value" />
<el-option v-for="dict in project_construction_status" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
@ -27,8 +25,7 @@
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd()"
v-hasPermi="['progress:constructionSchedulePlan:add']">新增</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['progress:constructionSchedulePlan:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
@ -36,9 +33,14 @@
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table ref="constructionSchedulePlanTableRef" v-loading="loading" :data="constructionSchedulePlanList"
row-key="id" :default-expand-all="isExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table
ref="constructionSchedulePlanTableRef"
v-loading="loading"
:data="constructionSchedulePlanList"
row-key="id"
:default-expand-all="isExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<!-- <el-table-column label="序号" type="id" /> -->
<el-table-column label="节点名称" prop="nodeName" />
<el-table-column label="对应项目结构" align="center" prop="projectStructureName" />
@ -71,16 +73,19 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['progress:constructionSchedulePlan:edit']" />
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['progress:constructionSchedulePlan:edit']" />
</el-tooltip>
<el-tooltip content="新增" placement="top">
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)"
v-hasPermi="['progress:constructionSchedulePlan:add']" />
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['progress:constructionSchedulePlan:add']" />
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['progress:constructionSchedulePlan:remove']" />
<el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['progress:constructionSchedulePlan:remove']"
/>
</el-tooltip>
</template>
</el-table-column>
@ -90,39 +95,57 @@
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="constructionSchedulePlanFormRef" :model="form" :rules="rules" label-width="110px">
<el-form-item label="父节点" prop="parentId">
<el-tree-select v-model="form.parentId" :data="constructionSchedulePlanOptions"
:props="{ value: 'id', label: 'nodeName', children: 'children' }" value-key="id" placeholder="请选择父节点"
check-strictly />
<el-tree-select
v-model="form.parentId"
:data="constructionSchedulePlanOptions"
:props="{ value: 'id', label: 'nodeName', children: 'children' }"
value-key="id"
placeholder="请选择父节点"
check-strictly
/>
</el-form-item>
<el-form-item label="节点名称" prop="nodeName">
<el-input v-model="form.nodeName" placeholder="请输入节点名称" />
</el-form-item>
<el-form-item label="对应项目结构" prop="projectStructure">
<el-tree-select v-model="form.projectStructure" :data="ProjectStructureList" @node-click="handleCheckChange"
:props="{ value: 'id', label: 'name', children: 'children' }" value-key="id" placeholder="请选择项目结构"
check-strictly />
<el-tree-select
v-model="form.projectStructure"
:data="ProjectStructureList"
@node-click="handleCheckChange"
:props="{ value: 'id', label: 'name', children: 'children' }"
value-key="id"
placeholder="请选择项目结构"
check-strictly
/>
<!-- <el-input v-model="form.projectStructure" placeholder="请输入对应项目结构" /> -->
</el-form-item>
<el-form-item label="预计开始时间" prop="planStartDate">
<el-date-picker clearable v-model="form.planStartDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择预计开始时间" />
<el-date-picker clearable v-model="form.planStartDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择预计开始时间" />
</el-form-item>
<el-form-item label="预计结束时间" prop="planEndDate">
<el-date-picker clearable v-model="form.planEndDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择预计结束时间" />
<el-date-picker clearable v-model="form.planEndDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择预计结束时间" />
</el-form-item>
<el-form-item label="实际开始时间" prop="practicalStartDate">
<el-date-picker clearable v-model="form.practicalStartDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择实际开始时间" />
<el-date-picker
clearable
v-model="form.practicalStartDate"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择实际开始时间"
/>
</el-form-item>
<el-form-item label="实际结束时间" prop="practicalEndDate">
<el-date-picker clearable v-model="form.practicalEndDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择实际结束时间" />
<el-date-picker
clearable
v-model="form.practicalEndDate"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择实际结束时间"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="请选择状态">
<el-option v-for="dict in project_construction_status" :key="dict.value" :label="dict.label"
:value="dict.value" />
<el-option v-for="dict in project_construction_status" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
@ -145,7 +168,8 @@ import {
getConstructionSchedulePlan,
delConstructionSchedulePlan,
addConstructionSchedulePlan,
updateConstructionSchedulePlan, getProjectStructure
updateConstructionSchedulePlan,
getProjectStructure
} from '@/api/progress/constructionSchedulePlan';
import {
ConstructionSchedulePlanVO,
@ -196,7 +220,6 @@ const initFormData = {
status: undefined,
remark: undefined,
projectStructureName: undefined
};
const data = reactive<PageData<ConstructionSchedulePlanForm, ConstructionSchedulePlanQuery>>({
@ -243,7 +266,7 @@ const handleCheckChange = (val) => {
/** 查询施工进度计划下拉树结构 */
const getTreeselect = async () => {
const res = await listConstructionSchedulePlan();
const res = await listConstructionSchedulePlan({ projectId: currentProject.value?.id });
constructionSchedulePlanOptions.value = [];
const data: ConstructionSchedulePlanOption = { id: 0, nodeName: '顶级节点', children: [] };
data.children = proxy?.handleTree<ConstructionSchedulePlanOption>(res.data, 'id', 'parentId');