产值计划
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<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">
|
||||
@ -9,7 +10,8 @@
|
||||
</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>
|
||||
@ -25,7 +27,8 @@
|
||||
<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>
|
||||
@ -33,17 +36,12 @@
|
||||
<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="projectStructure" />
|
||||
<el-table-column label="对应项目结构" align="center" prop="projectStructureName" />
|
||||
<el-table-column label="预计开始时间" align="center" prop="planStartDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.planStartDate, '{y}-{m}-{d}') }}</span>
|
||||
@ -73,19 +71,16 @@
|
||||
<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>
|
||||
@ -95,48 +90,39 @@
|
||||
<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-input v-model="form.projectStructure" placeholder="请输入对应项目结构" />
|
||||
<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">
|
||||
@ -159,7 +145,7 @@ import {
|
||||
getConstructionSchedulePlan,
|
||||
delConstructionSchedulePlan,
|
||||
addConstructionSchedulePlan,
|
||||
updateConstructionSchedulePlan
|
||||
updateConstructionSchedulePlan, getProjectStructure
|
||||
} from '@/api/progress/constructionSchedulePlan';
|
||||
import {
|
||||
ConstructionSchedulePlanVO,
|
||||
@ -181,6 +167,7 @@ const currentProject = computed(() => userStore.selectedProject);
|
||||
const { project_construction_status } = toRefs<any>(proxy?.useDict('project_construction_status'));
|
||||
|
||||
const constructionSchedulePlanList = ref<ConstructionSchedulePlanVO[]>([]);
|
||||
const ProjectStructureList = ref([]);
|
||||
const constructionSchedulePlanOptions = ref<ConstructionSchedulePlanOption[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const showSearch = ref(true);
|
||||
@ -196,7 +183,7 @@ const dialog = reactive<DialogOption>({
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: ConstructionSchedulePlanForm = {
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
parentId: undefined,
|
||||
@ -207,7 +194,9 @@ const initFormData: ConstructionSchedulePlanForm = {
|
||||
practicalStartDate: undefined,
|
||||
practicalEndDate: undefined,
|
||||
status: undefined,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
projectStructureName: undefined
|
||||
|
||||
};
|
||||
|
||||
const data = reactive<PageData<ConstructionSchedulePlanForm, ConstructionSchedulePlanQuery>>({
|
||||
@ -236,13 +225,21 @@ const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listConstructionSchedulePlan(queryParams.value);
|
||||
const data = proxy?.handleTree<ConstructionSchedulePlanVO>(res.data, 'id', 'parentId');
|
||||
console.log('🚀 ~ getList ~ data:', data);
|
||||
|
||||
if (data) {
|
||||
constructionSchedulePlanList.value = data;
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
/** 查询施工进度计划列表 */
|
||||
const getProjectStructureList = async () => {
|
||||
const res = await getProjectStructure(currentProject.value?.id);
|
||||
ProjectStructureList.value = [res.data];
|
||||
console.log(ProjectStructureList.value);
|
||||
};
|
||||
/** 查询施工进度计划列表 */
|
||||
const handleCheckChange = (val) => {
|
||||
form.value.projectStructureName = val.name;
|
||||
};
|
||||
|
||||
/** 查询施工进度计划下拉树结构 */
|
||||
const getTreeselect = async () => {
|
||||
@ -343,6 +340,7 @@ const handleDelete = async (row: ConstructionSchedulePlanVO) => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getProjectStructureList();
|
||||
getList();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user