进度管理产值管理

This commit is contained in:
Teo
2025-08-01 20:09:57 +08:00
parent bbc927edba
commit 4a5856f614
21 changed files with 2748 additions and 211 deletions

View File

@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 开发环境 # 开发环境
VITE_APP_BASE_API = 'http://192.168.110.180:8899' VITE_APP_BASE_API = 'http://192.168.110.159:8899'
# 无人机接口地址 # 无人机接口地址

View File

@ -0,0 +1,88 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CailiaoshebeiVO, CailiaoshebeiForm, CailiaoshebeiQuery } from '@/api/materials/cailiaoshebei/types';
/**
* 查询物资-材料设备列表
* @param query
* @returns {*}
*/
export const listCailiaoshebei = (query?: CailiaoshebeiQuery): AxiosPromise<CailiaoshebeiVO[]> => {
return request({
url: '/cailiaoshebei/cailiaoshebei/list',
method: 'get',
params: query
});
};
/**
* 查询物资-材料设备详细
* @param id
*/
export const getCailiaoshebei = (id: string | number): AxiosPromise<CailiaoshebeiVO> => {
return request({
url: '/cailiaoshebei/cailiaoshebei/' + id,
method: 'get'
});
};
/**
* 新增物资-材料设备
* @param data
*/
export const addCailiaoshebei = (data: CailiaoshebeiForm) => {
return request({
url: '/cailiaoshebei/cailiaoshebei',
method: 'post',
data: data
});
};
/**
* 修改物资-材料设备
* @param data
*/
export const updateCailiaoshebei = (data: CailiaoshebeiForm) => {
return request({
url: '/cailiaoshebei/cailiaoshebei',
method: 'put',
data: data
});
};
/**
* 删除物资-材料设备
* @param id
*/
export const delCailiaoshebei = (id: string | number | Array<string | number>) => {
return request({
url: '/cailiaoshebei/cailiaoshebei/' + id,
method: 'delete'
});
};
/**
* 查询物资-材料设备批次列表
* @param query
* @returns {*}
*/
export const listBatch = (query?: any): AxiosPromise => {
return request({
url: '/cailiaoshebei/cailiaoshebei/pcList',
method: 'get',
params: query
});
};
/**
* 新增物资-材料设备批次
* @param data
*/
export const getBatch = (data: any) => {
return request({
url: '/cailiaoshebei/cailiaoshebei/pcAdd',
method: 'post',
data: data
});
};

View File

@ -0,0 +1,225 @@
export interface CailiaoshebeiVO {
/**
* 主键ID
*/
id: string | number;
/**
* 批次ID
*/
batchId: string | number;
/**
* 供货商ID
*/
supplierId: string | number;
/**
* 供货商
*/
supplier: string;
/**
* 设备材料名称
*/
name: string;
/**
* 供货来源(字典)
*/
supply: string;
/**
* 规格型号
*/
specification: string;
/**
* 特征描述
*/
signalment: string;
/**
* 物料编码
*/
materialCode: string;
/**
* 计划到场时间
*/
arrivalTime: string;
/**
* 计划完成时间
*/
finishTime: string;
/**
* 计量单位
*/
unit: string;
/**
* 计划数量
*/
plan: number;
/**
* 实际数量
*/
realQuantity: number;
/**
* 备注
*/
remark: string;
}
export interface CailiaoshebeiForm extends BaseEntity {
/**
* 主键ID
*/
id?: string | number;
projectId?: string | number;
/**
* 批次ID
*/
batchId?: string | number;
/**
* 供货商ID
*/
supplierId?: string | number;
/**
* 供货商
*/
supplier?: string;
/**
* 设备材料名称
*/
name?: string;
/**
* 供货来源(字典)
*/
supply?: string;
/**
* 规格型号
*/
specification?: string;
/**
* 特征描述
*/
signalment?: string;
/**
* 物料编码
*/
materialCode?: string;
/**
* 计划到场时间
*/
arrivalTime?: string;
/**
* 计划完成时间
*/
finishTime?: string;
/**
* 计量单位
*/
unit?: string;
/**
* 计划数量
*/
plan?: number;
/**
* 实际数量
*/
realQuantity?: number;
/**
* 备注
*/
remark?: string;
}
export interface CailiaoshebeiQuery extends PageQuery {
/**
* 批次ID
*/
batchId?: string | number;
projectId?: string | number;
/**
* 供货商ID
*/
supplierId?: string | number;
/**
* 供货商
*/
supplier?: string;
/**
* 设备材料名称
*/
name?: string;
/**
* 供货来源(字典)
*/
supply?: string;
/**
* 规格型号
*/
specification?: string;
/**
* 特征描述
*/
signalment?: string;
/**
* 物料编码
*/
materialCode?: string;
/**
* 计划到场时间
*/
arrivalTime?: string;
/**
* 计划完成时间
*/
finishTime?: string;
/**
* 计量单位
*/
unit?: string;
/**
* 计划数量
*/
plan?: number;
/**
* 实际数量
*/
realQuantity?: number;
/**
* 日期范围参数
*/
params?: any;
}

View File

@ -61,3 +61,16 @@ export const delMonthPlan = (id: string | number | Array<string | number>) => {
method: 'delete' method: 'delete'
}); });
}; };
/**
* 获取月度产值计划
* @param query
* @returns {*}
*/
export const getMonth = (query: any): AxiosPromise => {
return request({
url: '/out/monthPlan/info',
method: 'get',
params: query
});
};

View File

@ -10,24 +10,19 @@ export interface MonthPlanVO {
projectId: string | number; projectId: string | number;
/** /**
* 计产值 * 计产值
*/ */
designValue: number; planValue: number;
/** /**
* 采购产值 * 完成产值
*/ */
procurementValue: number; completeValue: number;
/** /**
* 施工产值 * 差额
*/ */
constructionValue: number; differenceValue: number;
/**
* 总产值
*/
totalValue: number;
/** /**
* 计划月份YYYY-MM * 计划月份YYYY-MM
@ -35,9 +30,19 @@ export interface MonthPlanVO {
planMonth: string; planMonth: string;
/** /**
* 审核状态 * 1-设计 2-采购 3-施工
*/ */
auditStatus: string; valueType: string;
/**
* 计划审核状态
*/
planAuditStatus: string;
/**
* 完成审核状态
*/
completeAuditStatus: string;
} }
@ -53,24 +58,19 @@ export interface MonthPlanForm extends BaseEntity {
projectId?: string | number; projectId?: string | number;
/** /**
* 计产值 * 计产值
*/ */
designValue?: number; planValue?: number;
/** /**
* 采购产值 * 完成产值
*/ */
procurementValue?: number; completeValue?: number;
/** /**
* 施工产值 * 差额
*/ */
constructionValue?: number; differenceValue?: number;
/**
* 总产值
*/
totalValue?: number;
/** /**
* 计划月份YYYY-MM * 计划月份YYYY-MM
@ -78,9 +78,19 @@ export interface MonthPlanForm extends BaseEntity {
planMonth?: string; planMonth?: string;
/** /**
* 审核状态 * 1-设计 2-采购 3-施工
*/ */
auditStatus?: string; valueType?: string;
/**
* 计划审核状态
*/
planAuditStatus?: string;
/**
* 完成审核状态
*/
completeAuditStatus?: string;
} }
@ -92,24 +102,19 @@ export interface MonthPlanQuery extends PageQuery {
projectId?: string | number; projectId?: string | number;
/** /**
* 计产值 * 计产值
*/ */
designValue?: number; planValue?: number;
/** /**
* 采购产值 * 完成产值
*/ */
procurementValue?: number; completeValue?: number;
/** /**
* 施工产值 * 差额
*/ */
constructionValue?: number; differenceValue?: number;
/**
* 总产值
*/
totalValue?: number;
/** /**
* 计划月份YYYY-MM * 计划月份YYYY-MM
@ -117,9 +122,19 @@ export interface MonthPlanQuery extends PageQuery {
planMonth?: string; planMonth?: string;
/** /**
* 审核状态 * 1-设计 2-采购 3-施工
*/ */
auditStatus?: string; valueType?: string;
/**
* 计划审核状态
*/
planAuditStatus?: string;
/**
* 完成审核状态
*/
completeAuditStatus?: string;
/** /**
* 日期范围参数 * 日期范围参数

View File

@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MonthPlanAuditVO, MonthPlanAuditForm, MonthPlanAuditQuery } from '@/api/out/monthPlanAudit/types';
/**
* 查询审核通过月度产值计划列表
* @param query
* @returns {*}
*/
export const listMonthPlanAudit = (query?: MonthPlanAuditQuery): AxiosPromise<MonthPlanAuditVO[]> => {
return request({
url: '/out/monthPlanAudit/list',
method: 'get',
params: query
});
};
/**
* 查询审核通过月度产值计划详细
* @param id
*/
export const getMonthPlanAudit = (id: string | number): AxiosPromise<MonthPlanAuditVO> => {
return request({
url: '/out/monthPlanAudit/' + id,
method: 'get'
});
};
/**
* 新增审核通过月度产值计划
* @param data
*/
export const addMonthPlanAudit = (data: MonthPlanAuditForm) => {
return request({
url: '/out/monthPlanAudit',
method: 'post',
data: data
});
};
/**
* 修改审核通过月度产值计划
* @param data
*/
export const updateMonthPlanAudit = (data: MonthPlanAuditForm) => {
return request({
url: '/out/monthPlanAudit',
method: 'put',
data: data
});
};
/**
* 删除审核通过月度产值计划
* @param id
*/
export const delMonthPlanAudit = (id: string | number | Array<string | number>) => {
return request({
url: '/out/monthPlanAudit/' + id,
method: 'delete'
});
};

View File

@ -0,0 +1,116 @@
export interface MonthPlanAuditVO {
/**
* 主键ID
*/
id: string | number;
/**
* 项目ID
*/
projectId: string | number;
/**
* 设计产值
*/
designValue: number;
/**
* 采购产值
*/
purchaseValue: number;
/**
* 施工产值
*/
constructionValue: number;
/**
* 总产值
*/
totalValue: number;
/**
* 计划月份YYYY-MM
*/
planMonth: string;
}
export interface MonthPlanAuditForm extends BaseEntity {
/**
* 主键ID
*/
id?: string | number;
/**
* 项目ID
*/
projectId?: string | number;
/**
* 设计产值
*/
designValue?: number;
/**
* 采购产值
*/
purchaseValue?: number;
/**
* 施工产值
*/
constructionValue?: number;
/**
* 总产值
*/
totalValue?: number;
/**
* 计划月份YYYY-MM
*/
planMonth?: string;
}
export interface MonthPlanAuditQuery extends PageQuery {
/**
* 项目ID
*/
projectId?: string | number;
/**
* 设计产值
*/
designValue?: number;
/**
* 采购产值
*/
purchaseValue?: number;
/**
* 施工产值
*/
constructionValue?: number;
/**
* 总产值
*/
totalValue?: number;
/**
* 计划月份YYYY-MM
*/
planMonth?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ConstructionSchedulePlanVO, ConstructionSchedulePlanForm, ConstructionSchedulePlanQuery } from '@/api/progress/constructionSchedulePlan/types';
/**
* 查询施工进度计划列表
* @param query
* @returns {*}
*/
export const listConstructionSchedulePlan = (query?: ConstructionSchedulePlanQuery): AxiosPromise<ConstructionSchedulePlanVO[]> => {
return request({
url: '/progress/constructionSchedulePlan/list',
method: 'get',
params: query
});
};
/**
* 查询施工进度计划详细
* @param id
*/
export const getConstructionSchedulePlan = (id: string | number): AxiosPromise<ConstructionSchedulePlanVO> => {
return request({
url: '/progress/constructionSchedulePlan/' + id,
method: 'get'
});
};
/**
* 新增施工进度计划
* @param data
*/
export const addConstructionSchedulePlan = (data: ConstructionSchedulePlanForm) => {
return request({
url: '/progress/constructionSchedulePlan',
method: 'post',
data: data
});
};
/**
* 修改施工进度计划
* @param data
*/
export const updateConstructionSchedulePlan = (data: ConstructionSchedulePlanForm) => {
return request({
url: '/progress/constructionSchedulePlan',
method: 'put',
data: data
});
};
/**
* 删除施工进度计划
* @param id
*/
export const delConstructionSchedulePlan = (id: string | number | Array<string | number>) => {
return request({
url: '/progress/constructionSchedulePlan/' + id,
method: 'delete'
});
};

View File

@ -0,0 +1,145 @@
export interface ConstructionSchedulePlanVO {
/**
* 主键ID
*/
id: string | number;
/**
* 项目ID
*/
projectId: string | number;
/**
* 父ID
*/
parentId: string | number;
/**
* 节点名称
*/
nodeName: string;
/**
* 对应项目结构
*/
projectStructure: number;
/**
* 预计开始时间
*/
planStartDate: string;
/**
* 预计结束时间
*/
planEndDate: string;
/**
* 实际开始时间
*/
practicalStartDate: string;
/**
* 实际结束时间
*/
practicalEndDate: string;
/**
* 状态
*/
status: string;
/**
* 备注
*/
remark: string;
/**
* 子对象
*/
children: ConstructionSchedulePlanVO[];
}
export interface ConstructionSchedulePlanForm extends BaseEntity {
/**
* 主键ID
*/
id?: string | number;
parentId?: string | number;
/**
* 项目ID
*/
projectId?: string | number;
/**
* 父ID
*/
pId?: string | number;
/**
* 节点名称
*/
nodeName?: string;
/**
* 对应项目结构
*/
projectStructure?: number;
/**
* 预计开始时间
*/
planStartDate?: string;
/**
* 预计结束时间
*/
planEndDate?: string;
/**
* 实际开始时间
*/
practicalStartDate?: string;
/**
* 实际结束时间
*/
practicalEndDate?: string;
/**
* 状态
*/
status?: string;
/**
* 备注
*/
remark?: string;
}
export interface ConstructionSchedulePlanQuery {
/**
* 项目ID
*/
projectId?: string | number;
/**
* 父ID
*/
parentId?: string | number;
/**
* 节点名称
*/
nodeName?: string;
/**
* 状态
*/
status?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ProgressCategoryVO, ProgressCategoryForm, ProgressCategoryQuery } from '@/api/progress/progressCategory/types';
/**
* 查询分项工程单价列表
* @param query
* @returns {*}
*/
export const listProgressCategory = (query?: ProgressCategoryQuery): AxiosPromise<ProgressCategoryVO[]> => {
return request({
url: '/progress/progressCategory/list',
method: 'get',
params: query
});
};
/**
* 查询分项工程单价详细
* @param id
*/
export const getProgressCategory = (id: string | number): AxiosPromise<ProgressCategoryVO> => {
return request({
url: '/progress/progressCategory/' + id,
method: 'get'
});
};
/**
* 新增分项工程单价
* @param data
*/
export const addProgressCategory = (data: ProgressCategoryForm) => {
return request({
url: '/progress/progressCategory',
method: 'post',
data: data
});
};
/**
* 修改分项工程单价
* @param data
*/
export const updateProgressCategory = (data: ProgressCategoryForm) => {
return request({
url: '/progress/progressCategory/price',
method: 'post',
data: data
});
};
/**
* 删除分项工程单价
* @param id
*/
export const delProgressCategory = (id: string | number | Array<string | number>) => {
return request({
url: '/progress/progressCategory/' + id,
method: 'delete'
});
};

View File

@ -0,0 +1,265 @@
export interface ProgressCategoryVO {
/**
* 主键id
*/
id: string | number;
/**
* 父类别id
*/
parentId: string | number;
/**
* 项目id
*/
projectId: string | number;
/**
* 方阵id
*/
matrixId: string | number;
/**
* 方阵名称
*/
matrixName: string;
/**
* 类别名称
*/
name: string;
/**
* 计量方式0无 1数量 2百分比
*/
unitType: string;
/**
* 计量单位
*/
unit: string;
/**
* 综合单价
*/
unitPrice: number;
/**
* 产值金额
*/
outputValue: number;
/**
* 总数量/百分比
*/
total: number;
/**
* 已完成数量/百分比
*/
completed: number;
/**
* 计划总数量/百分比
*/
planTotal: number;
/**
* 是否超期0否 1是
*/
isDelay: string;
/**
* 工作类型
*/
workType: string;
/**
* 完成状态0未开始 1进行中 2已完成
*/
status: string;
/**
* 备注
*/
remark: string;
/**
* 子对象
*/
children: ProgressCategoryVO[];
}
export interface ProgressCategoryForm extends BaseEntity {
/**
* 主键id
*/
id?: string | number;
/**
* 父类别id
*/
parentId?: string | number;
/**
* 项目id
*/
projectId?: string | number;
/**
* 方阵id
*/
matrixId?: string | number;
/**
* 方阵名称
*/
matrixName?: string;
/**
* 类别名称
*/
name?: string;
/**
* 计量方式0无 1数量 2百分比
*/
unitType?: string;
/**
* 计量单位
*/
unit?: string;
/**
* 综合单价
*/
unitPrice?: number;
/**
* 产值金额
*/
outputValue?: number;
/**
* 总数量/百分比
*/
total?: number;
/**
* 已完成数量/百分比
*/
completed?: number;
/**
* 计划总数量/百分比
*/
planTotal?: number;
/**
* 是否超期0否 1是
*/
isDelay?: string;
/**
* 工作类型
*/
workType?: string;
/**
* 完成状态0未开始 1进行中 2已完成
*/
status?: string;
/**
* 备注
*/
remark?: string;
}
export interface ProgressCategoryQuery {
/**
* 父类别id
*/
parentId?: string | number;
/**
* 项目id
*/
projectId?: string | number;
/**
* 方阵id
*/
matrixId?: string | number;
/**
* 方阵名称
*/
matrixName?: string;
/**
* 类别名称
*/
name?: string;
/**
* 计量方式0无 1数量 2百分比
*/
unitType?: string;
/**
* 计量单位
*/
unit?: string;
/**
* 综合单价
*/
unitPrice?: number;
/**
* 产值金额
*/
outputValue?: number;
/**
* 总数量/百分比
*/
total?: number;
/**
* 已完成数量/百分比
*/
completed?: number;
/**
* 计划总数量/百分比
*/
planTotal?: number;
/**
* 是否超期0否 1是
*/
isDelay?: string;
/**
* 工作类型
*/
workType?: string;
/**
* 完成状态0未开始 1进行中 2已完成
*/
status?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@ -53,6 +53,7 @@ export interface QualityInspectionForm extends BaseEntity {
* 主键id * 主键id
*/ */
id?: string | number; id?: string | number;
rectificationUnit?: string;
/** /**
* 项目id * 项目id

View File

@ -0,0 +1,445 @@
<template>
<div class="p-2">
<!-- <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">
<el-form-item label="批次号" prop="batchId">
<el-input v-model="queryParams.batchId" placeholder="请输入批次ID" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="供货商ID" prop="supplierId">
<el-input v-model="queryParams.supplierId" placeholder="请输入供货商ID" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="供货商" prop="supplier">
<el-input v-model="queryParams.supplier" placeholder="请输入供货商" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="设备材料名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入设备材料名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="供货来源(字典)" prop="supply">
<el-input v-model="queryParams.supply" placeholder="请输入供货来源(字典)" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="规格型号" prop="specification">
<el-input v-model="queryParams.specification" placeholder="请输入规格型号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="特征描述" prop="signalment">
<el-input v-model="queryParams.signalment" placeholder="请输入特征描述" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="queryParams.materialCode" placeholder="请输入物料编码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="计划到场时间" prop="arrivalTime">
<el-date-picker clearable v-model="queryParams.arrivalTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择计划到场时间" />
</el-form-item>
<el-form-item label="计划完成时间" prop="finishTime">
<el-date-picker clearable v-model="queryParams.finishTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择计划完成时间" />
</el-form-item>
<el-form-item label="计量单位" prop="unit">
<el-input v-model="queryParams.unit" placeholder="请输入计量单位" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="计划数量" prop="plan">
<el-input v-model="queryParams.plan" placeholder="请输入计划数量" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="实际数量" prop="realQuantity">
<el-input v-model="queryParams.realQuantity" placeholder="请输入实际数量" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>-->
<el-row :gutter="20">
<!-- 流程分类树 -->
<el-col :lg="4" :xs="24" style="">
<el-card shadow="hover">
<template #header>
<el-button type="primary" size="default" @click="addBatch" icon="FolderAdd" plain>新增</el-button>
<el-button type="danger" size="default" @click="" icon="FolderDelete" plain>删除</el-button>
</template>
<el-input v-model="batchId" placeholder="请输入批次号" prefix-icon="Search" clearable />
<el-tree
ref="batchTreeRef"
class="mt-2"
node-key="id"
:data="batchOptions"
:props="{ label: 'label', children: 'children' }"
:expand-on-click-node="false"
highlight-current
default-expand-all
@node-click="handleNodeClick"
></el-tree>
</el-card>
</el-col>
<el-col :lg="20" :xs="24">
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['cailiaoshebei:cailiaoshebei:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate()"
v-hasPermi="['cailiaoshebei:cailiaoshebei:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete()"
v-hasPermi="['cailiaoshebei:cailiaoshebei:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['cailiaoshebei:cailiaoshebei:export']"
>导出</el-button
>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="cailiaoshebeiList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="id" v-if="true" />
<el-table-column label="批次ID" align="center" prop="batchId" />
<el-table-column label="供货商ID" align="center" prop="supplierId" />
<el-table-column label="供货商" align="center" prop="supplier" />
<el-table-column label="设备材料名称" align="center" prop="name" />
<el-table-column label="供货来源(字典)" align="center" prop="supply">
<template #default="scope">
<dict-tag :options="supply" :value="scope.row.supply" />
</template>
</el-table-column>
<el-table-column label="规格型号" align="center" prop="specification" />
<el-table-column label="特征描述" align="center" prop="signalment" />
<el-table-column label="物料编码" align="center" prop="materialCode" />
<el-table-column label="计划到场时间" align="center" prop="arrivalTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.arrivalTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划完成时间" align="center" prop="finishTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.finishTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="计量单位" align="center" prop="unit" />
<el-table-column label="计划数量" align="center" prop="plan" />
<el-table-column label="实际数量" align="center" prop="realQuantity" />
<el-table-column label="备注" align="center" prop="remark" />
<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="['cailiaoshebei:cailiaoshebei:edit']"
></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['cailiaoshebei:cailiaoshebei:remove']"
></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
</el-col>
</el-row>
<!-- 添加或修改物资-材料设备对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="cailiaoshebeiFormRef" :model="form" :rules="rules" label-width="110px">
<el-form-item label="批次ID" prop="batchId">
<el-input v-model="form.batchId" placeholder="请输入批次ID" />
</el-form-item>
<el-form-item label="供货商ID" prop="supplierId">
<el-input v-model="form.supplierId" placeholder="请输入供货商ID" />
</el-form-item>
<el-form-item label="供货商" prop="supplier">
<el-input v-model="form.supplier" placeholder="请输入供货商" />
</el-form-item>
<el-form-item label="设备材料名称" prop="name">
<el-input v-model="form.name" placeholder="请输入设备材料名称" />
</el-form-item>
<el-form-item label="供货来源(字典)" prop="supply">
<el-input v-model="form.supply" placeholder="请输入供货来源(字典)" />
</el-form-item>
<el-form-item label="规格型号" prop="specification">
<el-input v-model="form.specification" placeholder="请输入规格型号" />
</el-form-item>
<el-form-item label="特征描述" prop="signalment">
<el-input v-model="form.signalment" placeholder="请输入特征描述" />
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="form.materialCode" placeholder="请输入物料编码" />
</el-form-item>
<el-form-item label="计划到场时间" prop="arrivalTime">
<el-date-picker clearable v-model="form.arrivalTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择计划到场时间">
</el-date-picker>
</el-form-item>
<el-form-item label="计划完成时间" prop="finishTime">
<el-date-picker clearable v-model="form.finishTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择计划完成时间">
</el-date-picker>
</el-form-item>
<el-form-item label="计量单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入计量单位" />
</el-form-item>
<el-form-item label="计划数量" prop="plan">
<el-input v-model="form.plan" placeholder="请输入计划数量" />
</el-form-item>
<el-form-item label="实际数量" prop="realQuantity">
<el-input v-model="form.realQuantity" placeholder="请输入实际数量" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Cailiaoshebei" lang="ts">
import {
listCailiaoshebei,
getCailiaoshebei,
delCailiaoshebei,
addCailiaoshebei,
updateCailiaoshebei,
listBatch,
getBatch
} from '@/api/materials/cailiaoshebei';
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/cailiaoshebei/types';
import { useUserStoreHook } from '@/store/modules/user';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { supply } = toRefs<any>(proxy?.useDict('supply'));
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const batchOptions = ref<any[]>([]);
const batchId = ref('');
const queryFormRef = ref<ElFormInstance>();
const cailiaoshebeiFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const initFormData: CailiaoshebeiForm = {
id: undefined,
batchId: undefined,
supplierId: undefined,
supplier: undefined,
name: undefined,
supply: undefined,
specification: undefined,
signalment: undefined,
materialCode: undefined,
arrivalTime: undefined,
finishTime: undefined,
unit: undefined,
plan: undefined,
realQuantity: undefined,
projectId: currentProject.value.id,
remark: undefined
};
const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
form: { ...initFormData },
queryParams: {
pageNum: 1,
pageSize: 10,
batchId: undefined,
supplierId: undefined,
supplier: undefined,
name: undefined,
projectId: currentProject.value.id,
supply: undefined,
specification: undefined,
signalment: undefined,
materialCode: undefined,
arrivalTime: undefined,
finishTime: undefined,
unit: undefined,
plan: undefined,
realQuantity: undefined,
params: {}
},
rules: {
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询物资-材料设备列表 */
const getList = async () => {
const batchRes = await listBatch({
pageNum: 1,
pageSize: 1000,
projectId: currentProject.value.id
});
loading.value = true;
const res = await listCailiaoshebei(queryParams.value);
cailiaoshebeiList.value = res.rows;
total.value = res.total;
loading.value = false;
};
/** 节点单击事件 */
const handleNodeClick = (data: any) => {
queryParams.value.batchId = data.id;
if (data.id === '0') {
queryParams.value.batchId = '';
}
handleQuery();
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
cailiaoshebeiFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: CailiaoshebeiVO[]) => {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加物资-材料设备';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: CailiaoshebeiVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getCailiaoshebei(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改物资-材料设备';
};
/** 提交按钮 */
const submitForm = () => {
cailiaoshebeiFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateCailiaoshebei(form.value).finally(() => (buttonLoading.value = false));
} else {
await addCailiaoshebei(form.value).finally(() => (buttonLoading.value = false));
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
}
});
};
/** 新增批次 */
const addBatch = async () => {
await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false));
const res = await getBatch({
projectId: currentProject.value.id
});
console.log('🚀 ~ addBatch ~ res:', res);
proxy?.$modal.msgSuccess('新增成功');
await getList();
};
/** 删除按钮操作 */
const handleDelete = async (row?: CailiaoshebeiVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除物资-材料设备编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
await delCailiaoshebei(_ids);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'cailiaoshebei/cailiaoshebei/export',
{
...queryParams.value
},
`cailiaoshebei_${new Date().getTime()}.xlsx`
);
};
onMounted(() => {
getList();
});
</script>

View File

@ -55,14 +55,15 @@
<el-table-column label="确认数量" align="center" prop="confirmNum" /> <el-table-column label="确认数量" align="center" prop="confirmNum" />
<el-table-column label="产值" align="center" prop="outValue" /> <el-table-column label="产值" align="center" prop="outValue" />
<!-- <el-table-column label="审核状态" align="center" prop="auditStatus" /> --> <!-- <el-table-column label="审核状态" align="center" prop="auditStatus" /> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="210">
<template #default="scope"> <template #default="scope">
<el-tooltip content="修改" placement="top"> <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['out:constructionValue:edit']">修改</el-button>
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['out:constructionValue:edit']"></el-button> <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['out:constructionValue:remove']"
</el-tooltip> >删除</el-button
<el-tooltip content="删除" placement="top"> >
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['out:constructionValue:remove']"></el-button> <el-button link type="primary" icon="Finished" @click="handleDelete(scope.row)" v-hasPermi="['out:constructionValue:remove']"
</el-tooltip> >审核</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -145,10 +146,9 @@ import {
import { ConstructionValueVO, ConstructionValueQuery, ConstructionValueForm } from '@/api/out/constructionValue/types'; import { ConstructionValueVO, ConstructionValueQuery, ConstructionValueForm } from '@/api/out/constructionValue/types';
import { getProjectSquare, listProgressCategory, workScheduleList, workScheduleListDetail, workScheduleListPosition } from '@/api/progress/plan'; import { getProjectSquare, listProgressCategory, workScheduleList, workScheduleListDetail, workScheduleListPosition } from '@/api/progress/plan';
import { ProgressCategoryVO } from '@/api/progress/plan/types'; import { ProgressCategoryVO } from '@/api/progress/plan/types';
import { useUserStoreHook } from '@/store/modules/user';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { useUserStoreHook } from '@/store/modules/user';
// 获取用户 store // 获取用户 store
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目 // 从 store 中获取项目列表和当前选中的项目
@ -330,6 +330,7 @@ const submitForm = () => {
if (form.value.id) { if (form.value.id) {
await updateConstructionValue(form.value).finally(() => (buttonLoading.value = false)); await updateConstructionValue(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
console.log('🚀 ~ submitForm ~ form.value :', form.value);
await addConstructionValue(form.value).finally(() => (buttonLoading.value = false)); await addConstructionValue(form.value).finally(() => (buttonLoading.value = false));
} }
proxy?.$modal.msgSuccess('操作成功'); proxy?.$modal.msgSuccess('操作成功');

View File

@ -4,14 +4,8 @@
<div v-show="showSearch" class="mb-[10px]"> <div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover"> <el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true"> <el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="项目ID" prop="projectId"> <el-form-item label="计划月份" prop="planMonth">
<el-input v-model="queryParams.projectId" placeholder="请输入项目ID" clearable @keyup.enter="handleQuery" /> <el-date-picker v-model="queryParams.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" />
</el-form-item>
<el-form-item label="产值" prop="outValue">
<el-input v-model="queryParams.outValue" placeholder="请输入产值" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="完工月份" prop="completeMonth">
<el-input v-model="queryParams.completeMonth" placeholder="请输入完工月份" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@ -26,53 +20,66 @@
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['out:designCompletion:add']">新增</el-button> <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['out:monthPlan:add']">新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['out:monthPlan:edit']"
>修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['out:designCompletion:edit']">修改</el-button> <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['out:monthPlan:remove']"
>删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['out:designCompletion:remove']">删除</el-button> <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['out:monthPlan:export']">导出</el-button>
</el-col> </el-col> -->
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['out:designCompletion:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
</template> </template>
<el-table v-loading="loading" :data="designCompletionList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="monthPlanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="id" v-if="true" /> <el-table-column label="计划月份" align="center" prop="planMonth" />
<el-table-column label="项目ID" align="center" prop="projectId" /> <el-table-column label="计划产值" align="center" prop="planValue" />
<el-table-column label="产值" align="center" prop="outValue" /> <el-table-column label="完成产值" align="center" prop="completeValue" />
<el-table-column label="完工月份" align="center" prop="completeMonth" /> <el-table-column label="差额" align="center" prop="differenceValue" />
<el-table-column label="审核状态" align="center" prop="auditStatus" /> <el-table-column label="产值类型" align="center" prop="valueType">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-tooltip content="修改" placement="top"> <dict-tag :options="out_value_type" :value="scope.row.valueType" />
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['out:designCompletion:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['out:designCompletion:remove']"></el-button>
</el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
<!-- <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="['out:monthPlan:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['out:monthPlan:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column> -->
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card> </el-card>
<!-- 添加或修改设计完工产值对话框 --> <!-- 添加或修改月度产值计划对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="designCompletionFormRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="monthPlanFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="项目ID" prop="projectId"> <el-form-item label="所属项目" prop="projectId">
<el-input v-model="form.projectId" placeholder="请输入项目ID" /> <el-select v-model="form.projectId" placeholder="请选择所属项目">
<el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="产值" prop="outValue"> <el-form-item label="计划月份" prop="planMonth">
<el-input v-model="form.outValue" placeholder="请输入产值" /> <el-date-picker v-model="form.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" @change="handlePlanMonthChange" />
</el-form-item> </el-form-item>
<el-form-item label="完工月份" prop="completeMonth"> <el-form-item label="计划产值" prop="planValue">
<el-input v-model="form.completeMonth" placeholder="请输入完工月份" /> <el-input v-model="form.planValue" placeholder="请输入计划产值" disabled />
</el-form-item>
<el-form-item label="完成产值" prop="completeValue">
<el-input v-model="form.completeValue" placeholder="请输入完成产值" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -85,13 +92,19 @@
</div> </div>
</template> </template>
<script setup name="DesignCompletion" lang="ts"> <script setup name="MonthPlan" lang="ts">
import { listDesignCompletion, getDesignCompletion, delDesignCompletion, addDesignCompletion, updateDesignCompletion } from '@/api/out/designCompletion'; import { listMonthPlan, getMonthPlan, delMonthPlan, addMonthPlan, updateMonthPlan, getMonth } from '@/api/out/monthPlan';
import { DesignCompletionVO, DesignCompletionQuery, DesignCompletionForm } from '@/api/out/designCompletion/types'; import { MonthPlanVO, MonthPlanQuery, MonthPlanForm } from '@/api/out/monthPlan/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
const designCompletionList = ref<DesignCompletionVO[]>([]); import { useUserStoreHook } from '@/store/modules/user';
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const projectList = computed(() => userStore.projects);
const monthPlanList = ref<MonthPlanVO[]>([]);
const buttonLoading = ref(false); const buttonLoading = ref(false);
const loading = ref(true); const loading = ref(true);
const showSearch = ref(true); const showSearch = ref(true);
@ -101,141 +114,168 @@ const multiple = ref(true);
const total = ref(0); const total = ref(0);
const queryFormRef = ref<ElFormInstance>(); const queryFormRef = ref<ElFormInstance>();
const designCompletionFormRef = ref<ElFormInstance>(); const monthPlanFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({ const dialog = reactive<DialogOption>({
visible: false, visible: false,
title: '' title: ''
}); });
const initFormData: DesignCompletionForm = { const initFormData: MonthPlanForm = {
id: undefined, id: undefined,
projectId: undefined, projectId: currentProject.value?.id,
outValue: undefined, planValue: undefined,
completeMonth: undefined, completeValue: undefined,
auditStatus: undefined, differenceValue: undefined,
} planMonth: undefined,
const data = reactive<PageData<DesignCompletionForm, DesignCompletionQuery>>({ valueType: '1',
planAuditStatus: undefined,
completeAuditStatus: undefined
};
const data = reactive<PageData<MonthPlanForm, MonthPlanQuery>>({
form: { ...initFormData }, form: { ...initFormData },
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: undefined, projectId: undefined,
outValue: undefined, planValue: undefined,
completeMonth: undefined, completeValue: undefined,
auditStatus: undefined, differenceValue: undefined,
params: { planMonth: undefined,
} valueType: '1',
planAuditStatus: undefined,
completeAuditStatus: undefined,
params: {}
}, },
rules: { rules: {
id: [ id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
{ required: true, message: "主键ID不能为空", trigger: "blur" } projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
], planValue: [{ required: true, message: '计划产值不能为空', trigger: 'blur' }],
projectId: [ planMonth: [{ required: true, message: '计划月份不能为空', trigger: 'blur' }],
{ required: true, message: "项目ID不能为空", trigger: "blur" } valueType: [{ required: true, message: '1-设计 2-采购 3-施工不能为空', trigger: 'change' }]
],
outValue: [
{ required: true, message: "产值不能为空", trigger: "blur" }
],
completeMonth: [
{ required: true, message: "完工月份不能为空", trigger: "blur" }
],
} }
}); });
const { queryParams, form, rules } = toRefs(data); const { queryParams, form, rules } = toRefs(data);
/** 查询设计完工产值列表 */ /** 查询月度产值计划列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listDesignCompletion(queryParams.value); const res = await listMonthPlan(queryParams.value);
designCompletionList.value = res.rows; monthPlanList.value = res.rows;
total.value = res.total; total.value = res.total;
loading.value = false; loading.value = false;
} };
/** 取消按钮 */ /** 取消按钮 */
const cancel = () => { const cancel = () => {
reset(); reset();
dialog.visible = false; dialog.visible = false;
} };
/** 表单重置 */ /** 表单重置 */
const reset = () => { const reset = () => {
form.value = { ...initFormData }; form.value = { ...initFormData };
designCompletionFormRef.value?.resetFields(); monthPlanFormRef.value?.resetFields();
} };
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
queryParams.value.pageNum = 1; queryParams.value.pageNum = 1;
getList(); getList();
} };
/** 重置按钮操作 */ /** 重置按钮操作 */
const resetQuery = () => { const resetQuery = () => {
queryFormRef.value?.resetFields(); queryFormRef.value?.resetFields();
handleQuery(); handleQuery();
} };
/** 多选框选中数据 */ /** 多选框选中数据 */
const handleSelectionChange = (selection: DesignCompletionVO[]) => { const handleSelectionChange = (selection: MonthPlanVO[]) => {
ids.value = selection.map(item => item.id); ids.value = selection.map((item) => item.id);
single.value = selection.length != 1; single.value = selection.length != 1;
multiple.value = !selection.length; multiple.value = !selection.length;
} };
/** 新增按钮操作 */ /** 新增按钮操作 */
const handleAdd = () => { const handleAdd = () => {
reset(); reset();
dialog.visible = true; dialog.visible = true;
dialog.title = "添加设计完工产值"; dialog.title = '添加设计完工产值';
} };
/** 修改按钮操作 */ /** 修改按钮操作 */
const handleUpdate = async (row?: DesignCompletionVO) => { const handleUpdate = async (row?: MonthPlanVO) => {
reset(); reset();
const _id = row?.id || ids.value[0] const _id = row?.id || ids.value[0];
const res = await getDesignCompletion(_id); const res = await getMonthPlan(_id);
Object.assign(form.value, res.data); Object.assign(form.value, res.data);
dialog.visible = true; dialog.visible = true;
dialog.title = "修改设计完工产值"; dialog.title = '修改设计完工产值';
} };
/** 提交按钮 */ /** 提交按钮 */
const submitForm = () => { const submitForm = () => {
designCompletionFormRef.value?.validate(async (valid: boolean) => { monthPlanFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
if (form.value.id) { await updateMonthPlan(form.value).finally(() => (buttonLoading.value = false));
await updateDesignCompletion(form.value).finally(() => buttonLoading.value = false); proxy?.$modal.msgSuccess('操作成功');
} else {
await addDesignCompletion(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false; dialog.visible = false;
await getList(); await getList();
} }
}); });
} };
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (row?: DesignCompletionVO) => { const handleDelete = async (row?: MonthPlanVO) => {
const _ids = row?.id || ids.value; const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除设计完工产值编号为"' + _ids + '"的数据项?').finally(() => loading.value = false); await proxy?.$modal.confirm('是否确认删除月度产值计划编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
await delDesignCompletion(_ids); await delMonthPlan(_ids);
proxy?.$modal.msgSuccess("删除成功"); proxy?.$modal.msgSuccess('删除成功');
await getList(); await getList();
} };
/** 计划月份改变 */
const handlePlanMonthChange = async (val: string) => {
const res = await getMonth({
projectId: form.value.projectId,
planMonth: val,
valueType: form.value.valueType
});
if (!res.data) return proxy?.$modal.msgError('该月份未计划');
form.value.planValue = res.data.planValue;
form.value.id = res.data.id;
console.log(res);
};
/** 导出按钮操作 */ /** 导出按钮操作 */
const handleExport = () => { const handleExport = () => {
proxy?.download('out/designCompletion/export', { proxy?.download(
'out/monthPlan/export',
{
...queryParams.value ...queryParams.value
}, `designCompletion_${new Date().getTime()}.xlsx`) },
} `monthPlan_${new Date().getTime()}.xlsx`
);
};
onMounted(() => { onMounted(() => {
getList(); getList();
}); });
//监听项目id刷新数据
// const listeningProject = watch(
// () => currentProject.value.id,
// (nid, oid) => {
// queryParams.value.projectId = nid;
// form.value.projectId = nid;
// getList();
// }
// );
// onUnmounted(() => {
// listeningProject();
// });
</script> </script>

View File

@ -4,23 +4,16 @@
<div v-show="showSearch" class="mb-[10px]"> <div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover"> <el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true"> <el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="项目ID" prop="projectId"> <el-form-item label="计划产值" prop="planValue">
<el-input v-model="queryParams.projectId" placeholder="请输入项目ID" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.planValue" placeholder="请输入计划产值" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="设计产值" prop="designValue">
<el-input v-model="queryParams.designValue" placeholder="请输入设计产值" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="采购产值" prop="procurementValue">
<el-input v-model="queryParams.procurementValue" placeholder="请输入采购产值" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="施工产值" prop="constructionValue">
<el-input v-model="queryParams.constructionValue" placeholder="请输入施工产值" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="总产值" prop="totalValue">
<el-input v-model="queryParams.totalValue" placeholder="请输入总产值" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="计划月份" prop="planMonth"> <el-form-item label="计划月份" prop="planMonth">
<el-input v-model="queryParams.planMonth" placeholder="请输入计划月份" clearable @keyup.enter="handleQuery" /> <el-date-picker v-model="queryParams.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" />
</el-form-item>
<el-form-item label="产值类型" prop="valueType">
<el-select v-model="queryParams.valueType" placeholder="请选择产值类型">
<el-option v-for="item in out_value_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@ -57,11 +50,14 @@
<el-table v-loading="loading" :data="monthPlanList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="monthPlanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="计划月份" align="center" prop="planMonth" /> <el-table-column label="计划月份" align="center" prop="planMonth" />
<el-table-column label="计产值" align="center" prop="designValue" /> <el-table-column label="计产值" align="center" prop="planValue" />
<el-table-column label="采购产值" align="center" prop="procurementValue" /> <el-table-column label="完成产值" align="center" prop="completeValue" />
<el-table-column label="施工产值" align="center" prop="constructionValue" /> <el-table-column label="差额" align="center" prop="differenceValue" />
<el-table-column label="产值" align="center" prop="totalValue" /> <el-table-column label="产值类型" align="center" prop="valueType">
<el-table-column label="审核状态" align="center" prop="auditStatus" /> <template #default="scope">
<dict-tag :options="out_value_type" :value="scope.row.valueType" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-tooltip content="修改" placement="top"> <el-tooltip content="修改" placement="top">
@ -79,23 +75,16 @@
<!-- 添加或修改月度产值计划对话框 --> <!-- 添加或修改月度产值计划对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="monthPlanFormRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="monthPlanFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="项目ID" prop="projectId"> <el-form-item label="计划产值" prop="planValue">
<el-input v-model="form.projectId" placeholder="请输入项目ID" /> <el-input v-model="form.planValue" placeholder="请输入计划产值" />
</el-form-item>
<el-form-item label="设计产值" prop="designValue">
<el-input v-model="form.designValue" placeholder="请输入设计产值" />
</el-form-item>
<el-form-item label="采购产值" prop="procurementValue">
<el-input v-model="form.procurementValue" placeholder="请输入采购产值" />
</el-form-item>
<el-form-item label="施工产值" prop="constructionValue">
<el-input v-model="form.constructionValue" placeholder="请输入施工产值" />
</el-form-item>
<el-form-item label="总产值" prop="totalValue">
<el-input v-model="form.totalValue" placeholder="请输入总产值" />
</el-form-item> </el-form-item>
<el-form-item label="计划月份" prop="planMonth"> <el-form-item label="计划月份" prop="planMonth">
<el-input v-model="form.planMonth" placeholder="请输入计划月份" /> <el-date-picker v-model="form.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" />
</el-form-item>
<el-form-item label="产值类型" prop="valueType">
<el-select v-model="form.valueType" placeholder="请选择产值类型">
<el-option v-for="item in out_value_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -111,9 +100,14 @@
<script setup name="MonthPlan" lang="ts"> <script setup name="MonthPlan" lang="ts">
import { listMonthPlan, getMonthPlan, delMonthPlan, addMonthPlan, updateMonthPlan } from '@/api/out/monthPlan'; import { listMonthPlan, getMonthPlan, delMonthPlan, addMonthPlan, updateMonthPlan } from '@/api/out/monthPlan';
import { MonthPlanVO, MonthPlanQuery, MonthPlanForm } from '@/api/out/monthPlan/types'; import { MonthPlanVO, MonthPlanQuery, MonthPlanForm } from '@/api/out/monthPlan/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
import { useUserStoreHook } from '@/store/modules/user';
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const monthPlanList = ref<MonthPlanVO[]>([]); const monthPlanList = ref<MonthPlanVO[]>([]);
const buttonLoading = ref(false); const buttonLoading = ref(false);
const loading = ref(true); const loading = ref(true);
@ -133,36 +127,36 @@ const dialog = reactive<DialogOption>({
const initFormData: MonthPlanForm = { const initFormData: MonthPlanForm = {
id: undefined, id: undefined,
projectId: undefined, projectId: currentProject.value?.id,
designValue: undefined, planValue: undefined,
procurementValue: undefined, completeValue: undefined,
constructionValue: undefined, differenceValue: undefined,
totalValue: undefined,
planMonth: undefined, planMonth: undefined,
auditStatus: undefined valueType: undefined,
planAuditStatus: undefined,
completeAuditStatus: undefined
}; };
const data = reactive<PageData<MonthPlanForm, MonthPlanQuery>>({ const data = reactive<PageData<MonthPlanForm, MonthPlanQuery>>({
form: { ...initFormData }, form: { ...initFormData },
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: undefined, projectId: currentProject.value?.id,
designValue: undefined, planValue: undefined,
procurementValue: undefined, completeValue: undefined,
constructionValue: undefined, differenceValue: undefined,
totalValue: undefined,
planMonth: undefined, planMonth: undefined,
auditStatus: undefined, valueType: undefined,
planAuditStatus: undefined,
completeAuditStatus: undefined,
params: {} params: {}
}, },
rules: { rules: {
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }], id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }], projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
designValue: [{ required: true, message: '计产值不能为空', trigger: 'blur' }], planValue: [{ required: true, message: '计产值不能为空', trigger: 'blur' }],
procurementValue: [{ required: true, message: '采购产值不能为空', trigger: 'blur' }], planMonth: [{ required: true, message: '计划月份不能为空', trigger: 'blur' }],
constructionValue: [{ required: true, message: '施工产值不能为空', trigger: 'blur' }], valueType: [{ required: true, message: '1-设计 2-采购 3-施工不能为空', trigger: 'change' }]
totalValue: [{ required: true, message: '总产值不能为空', trigger: 'blur' }],
planMonth: [{ required: true, message: '计划月份不能为空', trigger: 'blur' }]
} }
}); });
@ -265,4 +259,18 @@ const handleExport = () => {
onMounted(() => { onMounted(() => {
getList(); getList();
}); });
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;
getList();
}
);
onUnmounted(() => {
listeningProject();
});
</script> </script>

View File

@ -0,0 +1,249 @@
<template>
<div class="p-2">
<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">
<el-form-item label="计划月份" prop="planMonth">
<el-date-picker
v-model="queryParams.planMonth"
type="month"
value-format="YYYY-MM"
placeholder="请选择计划月份"
clearable
@change="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['out:monthPlanAudit:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="monthPlanAuditList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="设计产值" align="center" prop="designValue" />
<el-table-column label="采购产值" align="center" prop="purchaseValue" />
<el-table-column label="施工产值" align="center" prop="constructionValue" />
<el-table-column label="总产值" align="center" prop="totalValue" />
<el-table-column label="计划月份" align="center" prop="planMonth" />
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改审核通过月度产值计划对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="monthPlanAuditFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设计产值" prop="designValue">
<el-input v-model="form.designValue" placeholder="请输入设计产值" />
</el-form-item>
<el-form-item label="采购产值" prop="purchaseValue">
<el-input v-model="form.purchaseValue" placeholder="请输入采购产值" />
</el-form-item>
<el-form-item label="施工产值" prop="constructionValue">
<el-input v-model="form.constructionValue" placeholder="请输入施工产值" />
</el-form-item>
<el-form-item label="总产值" prop="totalValue">
<el-input v-model="form.totalValue" placeholder="请输入总产值" />
</el-form-item>
<el-form-item label="计划月份" prop="planMonth">
<el-date-picker v-model="form.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" clearable />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="MonthPlanAudit" lang="ts">
import { listMonthPlanAudit, getMonthPlanAudit, delMonthPlanAudit, addMonthPlanAudit, updateMonthPlanAudit } from '@/api/out/monthPlanAudit';
import { MonthPlanAuditVO, MonthPlanAuditQuery, MonthPlanAuditForm } from '@/api/out/monthPlanAudit/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { useUserStoreHook } from '@/store/modules/user';
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const monthPlanAuditList = ref<MonthPlanAuditVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const monthPlanAuditFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const initFormData: MonthPlanAuditForm = {
id: undefined,
projectId: currentProject.value?.id,
designValue: undefined,
purchaseValue: undefined,
constructionValue: undefined,
totalValue: undefined,
planMonth: undefined
};
const data = reactive<PageData<MonthPlanAuditForm, MonthPlanAuditQuery>>({
form: { ...initFormData },
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: currentProject.value?.id,
designValue: undefined,
purchaseValue: undefined,
constructionValue: undefined,
totalValue: undefined,
planMonth: undefined,
params: {}
},
rules: {
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
designValue: [{ required: true, message: '设计产值不能为空', trigger: 'blur' }],
purchaseValue: [{ required: true, message: '采购产值不能为空', trigger: 'blur' }],
constructionValue: [{ required: true, message: '施工产值不能为空', trigger: 'blur' }],
totalValue: [{ required: true, message: '总产值不能为空', trigger: 'blur' }],
planMonth: [{ required: true, message: '计划月份不能为空', trigger: 'blur' }]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询审核通过月度产值计划列表 */
const getList = async () => {
loading.value = true;
const res = await listMonthPlanAudit(queryParams.value);
monthPlanAuditList.value = res.rows;
total.value = res.total;
loading.value = false;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
monthPlanAuditFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: MonthPlanAuditVO[]) => {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加审核通过月度产值计划';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: MonthPlanAuditVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getMonthPlanAudit(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改审核通过月度产值计划';
};
/** 提交按钮 */
const submitForm = () => {
monthPlanAuditFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateMonthPlanAudit(form.value).finally(() => (buttonLoading.value = false));
} else {
await addMonthPlanAudit(form.value).finally(() => (buttonLoading.value = false));
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: MonthPlanAuditVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除审核通过月度产值计划编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
await delMonthPlanAudit(_ids);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'out/monthPlanAudit/export',
{
...queryParams.value
},
`monthPlanAudit_${new Date().getTime()}.xlsx`
);
};
onMounted(() => {
getList();
});
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;
getList();
}
);
onUnmounted(() => {
listeningProject();
});
</script>

View File

@ -0,0 +1,362 @@
<template>
<div class="p-2">
<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">
<el-form-item label="节点名称" prop="nodeName">
<el-input v-model="queryParams.nodeName" placeholder="请输入节点名称" clearable @keyup.enter="handleQuery" />
</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-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<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-col>
<el-col :span="1.5">
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
</el-col>
<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-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="planStartDate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.planStartDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="预计结束时间" align="center" prop="planEndDate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.planEndDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="实际开始时间" align="center" prop="practicalStartDate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.practicalStartDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="实际结束时间" align="center" prop="practicalEndDate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.practicalEndDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<dict-tag :options="project_construction_status" :value="scope.row.status" />
</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">
<el-tooltip content="修改" placement="top">
<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-tooltip>
<el-tooltip content="删除" placement="top">
<el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['progress:constructionSchedulePlan:remove']"
/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</el-card>
<!-- 添加或修改施工进度计划对话框 -->
<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-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-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-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-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-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-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-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="ConstructionSchedulePlan" lang="ts">
import {
listConstructionSchedulePlan,
getConstructionSchedulePlan,
delConstructionSchedulePlan,
addConstructionSchedulePlan,
updateConstructionSchedulePlan
} from '@/api/progress/constructionSchedulePlan';
import {
ConstructionSchedulePlanVO,
ConstructionSchedulePlanQuery,
ConstructionSchedulePlanForm
} from '@/api/progress/constructionSchedulePlan/types';
import { useUserStoreHook } from '@/store/modules/user';
type ConstructionSchedulePlanOption = {
id: number;
nodeName: string;
children?: ConstructionSchedulePlanOption[];
};
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const { project_construction_status } = toRefs<any>(proxy?.useDict('project_construction_status'));
const constructionSchedulePlanList = ref<ConstructionSchedulePlanVO[]>([]);
const constructionSchedulePlanOptions = ref<ConstructionSchedulePlanOption[]>([]);
const buttonLoading = ref(false);
const showSearch = ref(true);
const isExpandAll = ref(true);
const loading = ref(false);
const queryFormRef = ref<ElFormInstance>();
const constructionSchedulePlanFormRef = ref<ElFormInstance>();
const constructionSchedulePlanTableRef = ref<ElTableInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const initFormData: ConstructionSchedulePlanForm = {
id: undefined,
projectId: currentProject.value.id,
parentId: undefined,
nodeName: undefined,
projectStructure: undefined,
planStartDate: undefined,
planEndDate: undefined,
practicalStartDate: undefined,
practicalEndDate: undefined,
status: undefined,
remark: undefined
};
const data = reactive<PageData<ConstructionSchedulePlanForm, ConstructionSchedulePlanQuery>>({
form: { ...initFormData },
queryParams: {
projectId: currentProject.value.id,
parentId: undefined,
nodeName: undefined,
status: undefined,
params: {}
},
rules: {
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
parentId: [{ required: true, message: '父ID不能为空', trigger: 'blur' }],
nodeName: [{ required: true, message: '节点名称不能为空', trigger: 'blur' }],
planStartDate: [{ required: true, message: '预计开始时间不能为空', trigger: 'blur' }],
planEndDate: [{ required: true, message: '预计结束时间不能为空', trigger: 'blur' }]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询施工进度计划列表 */
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 getTreeselect = async () => {
const res = await listConstructionSchedulePlan();
constructionSchedulePlanOptions.value = [];
const data: ConstructionSchedulePlanOption = { id: 0, nodeName: '顶级节点', children: [] };
data.children = proxy?.handleTree<ConstructionSchedulePlanOption>(res.data, 'id', 'parentId');
constructionSchedulePlanOptions.value.push(data);
};
// 取消按钮
const cancel = () => {
reset();
dialog.visible = false;
};
// 表单重置
const reset = () => {
form.value = { ...initFormData };
constructionSchedulePlanFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 新增按钮操作 */
const handleAdd = (row?: ConstructionSchedulePlanVO) => {
reset();
getTreeselect();
if (row != null && row.id) {
form.value.parentId = row.id;
} else {
form.value.parentId = 0;
}
dialog.visible = true;
dialog.title = '添加施工进度计划';
};
/** 展开/折叠操作 */
const handleToggleExpandAll = () => {
isExpandAll.value = !isExpandAll.value;
toggleExpandAll(constructionSchedulePlanList.value, isExpandAll.value);
};
/** 展开/折叠操作 */
const toggleExpandAll = (data: ConstructionSchedulePlanVO[], status: boolean) => {
data.forEach((item) => {
constructionSchedulePlanTableRef.value?.toggleRowExpansion(item, status);
if (item.children && item.children.length > 0) toggleExpandAll(item.children, status);
});
};
/** 修改按钮操作 */
const handleUpdate = async (row: ConstructionSchedulePlanVO) => {
reset();
await getTreeselect();
if (row != null) {
form.value.parentId = row.parentId;
}
const res = await getConstructionSchedulePlan(row.id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改施工进度计划';
};
/** 提交按钮 */
const submitForm = () => {
constructionSchedulePlanFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateConstructionSchedulePlan(form.value).finally(() => (buttonLoading.value = false));
} else {
await addConstructionSchedulePlan(form.value).finally(() => (buttonLoading.value = false));
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
getList();
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row: ConstructionSchedulePlanVO) => {
await proxy?.$modal.confirm('是否确认删除施工进度计划编号为"' + row.id + '"的数据项?');
loading.value = true;
await delConstructionSchedulePlan(row.id).finally(() => (loading.value = false));
await getList();
proxy?.$modal.msgSuccess('删除成功');
};
onMounted(() => {
getList();
});
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;
getList();
}
);
onUnmounted(() => {
listeningProject();
});
</script>

View File

@ -288,11 +288,9 @@ const getList = async () => {
} }
} }
loading.value = true; loading.value = true;
loading.value = true;
try { try {
const res = await listProgressCategory(queryParams.value); const res = await listProgressCategory(queryParams.value);
const data = proxy?.handleTree<ProgressCategoryVO>(res.data, 'id', 'pid'); const data = proxy?.handleTree<ProgressCategoryVO>(res.data, 'id', 'parentId');
if (data) { if (data) {
progressCategoryList.value = data; progressCategoryList.value = data;
} }

View File

@ -0,0 +1,371 @@
<template>
<div class="p-2">
<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">
<el-form-item label="请选择方阵:" prop="pid" label-width="100">
<!-- <el-input v-model="queryParams.pid" placeholder="请选择" clearable /> -->
<el-cascader
:options="matrixOptions"
placeholder="请选择"
@change="handleChange"
:props="{ value: 'matrixId', label: 'name' }"
v-model="queryParams.matrixId"
clearable
/>
<!-- <el-select v-model="matrixValue" placeholder="请选择" @change="handleChange" clearable>
<el-option v-for="item in matrixOptions" :key="item.id" :label="item.matrixName" :value="item.id" />
</el-select> -->
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table
ref="progressCategoryTableRef"
v-loading="loading"
:data="progressCategoryList"
row-key="id"
:default-expand-all="isExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<!-- <el-table-column label="父类别id" prop="parentId" /> -->
<el-table-column label="类别名称" prop="name" />
<el-table-column label="计量方式" align="center" prop="unitType">
<template #default="{ row }">
<dict-tag :options="progress_unit_type" :value="row.unitType" v-if="row.parentId != 0" />
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="计量单位" align="center" prop="unit">
<template #default="{ row }">
{{ row.parentId == 0 ? '' : row.unit }}
</template>
</el-table-column>
<el-table-column label="综合单价" align="center" prop="unitPrice">
<template #default="{ row }">
{{ row.parentId == 0 ? '' : row.unitPrice }}
</template>
</el-table-column>
<el-table-column label="产值金额" align="center" prop="outputValue">
<template #default="{ row }">
{{ row.parentId == 0 ? '' : row.outputValue }}
</template>
</el-table-column>
<el-table-column label="总数量/百分比" align="center" prop="total">
<template #default="{ row }">
{{ row.parentId == 0 ? '' : row.total }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<div v-if="scope.row.parentId">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['progress:progressCategory:edit']">
修改
</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['progress:progressCategory:remove']">
删除
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</el-card>
<!-- 添加或修改分项工程单价对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="progressCategoryFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="类别名称" prop="name">
<el-input v-model="form.name" placeholder="请输入类别名称" disabled />
</el-form-item>
<el-form-item label="计量单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入计量单位" />
</el-form-item>
<el-form-item label="综合单价" prop="unitPrice">
<el-input v-model="form.unitPrice" placeholder="请输入综合单价" />
</el-form-item>
<!-- <el-form-item label="总数量/百分比" prop="total">
<el-input v-model="form.total" placeholder="请输入总数量/百分比" />
</el-form-item> -->
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="ProgressCategory" lang="ts">
import { getProjectSquare } from '@/api/progress/plan';
import {
listProgressCategory,
getProgressCategory,
delProgressCategory,
addProgressCategory,
updateProgressCategory
} from '@/api/progress/progressCategory';
import { ProgressCategoryVO, ProgressCategoryQuery, ProgressCategoryForm } from '@/api/progress/progressCategory/types';
import { useUserStoreHook } from '@/store/modules/user';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { progress_unit_type, progress_status } = toRefs<any>(proxy?.useDict('progress_unit_type', 'progress_status'));
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
type ProgressCategoryOption = {
id: number;
name: string;
children?: ProgressCategoryOption[];
};
const matrixOptions = ref([]);
const progressCategoryList = ref<ProgressCategoryVO[]>([]);
const progressCategoryOptions = ref<ProgressCategoryOption[]>([]);
const buttonLoading = ref(false);
const showSearch = ref(true);
const isExpandAll = ref(true);
const loading = ref(false);
const queryFormRef = ref<ElFormInstance>();
const progressCategoryFormRef = ref<ElFormInstance>();
const progressCategoryTableRef = ref<ElTableInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const initFormData: ProgressCategoryForm = {
id: undefined,
parentId: undefined,
projectId: currentProject.value.id,
matrixId: undefined,
matrixName: undefined,
name: undefined,
unitType: undefined,
unit: undefined,
unitPrice: undefined,
outputValue: undefined,
total: undefined,
completed: undefined,
planTotal: undefined,
isDelay: undefined,
workType: undefined,
status: undefined,
remark: undefined
};
const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
form: { ...initFormData },
queryParams: {
parentId: undefined,
projectId: currentProject.value.id,
matrixId: undefined,
matrixName: undefined,
name: undefined,
unitType: undefined,
unit: undefined,
unitPrice: undefined,
outputValue: undefined,
total: undefined,
completed: undefined,
planTotal: undefined,
isDelay: undefined,
workType: undefined,
status: undefined,
params: {}
},
rules: {
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
parentId: [{ required: true, message: '父类别id不能为空', trigger: 'blur' }],
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
matrixId: [{ required: true, message: '方阵id不能为空', trigger: 'blur' }],
name: [{ required: true, message: '类别名称不能为空', trigger: 'blur' }],
unitType: [{ required: true, message: '计量方式不能为空', trigger: 'change' }],
unitPrice: [{ required: true, message: '综合单价不能为空', trigger: 'blur' }],
outputValue: [{ required: true, message: '产值金额不能为空', trigger: 'blur' }],
isDelay: [{ required: true, message: '是否超期不能为空', trigger: 'blur' }],
status: [{ required: true, message: '完成状态不能为空', trigger: 'change' }]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询分项工程单价列表 */
const getList = async () => {
if (!queryParams.value.matrixId) {
const res = await getProjectSquare(currentProject.value.id);
if (res.data.length === 0) {
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
} else {
let matrixList = res.data.map((item) => {
return {
...item,
matrixId: item.projectId
};
});
if (!matrixValue.value) matrixValue.value = matrixList[0].id;
matrixOptions.value = matrixList;
queryParams.value.matrixId = matrixList[0].children[0].matrixId;
}
}
loading.value = true;
try {
const res = await listProgressCategory(queryParams.value);
const data = proxy?.handleTree<ProgressCategoryVO>(res.data, 'id', 'parentId');
if (data) {
progressCategoryList.value = data;
loading.value = false;
}
} finally {
loading.value = false;
}
};
/** 查询分项工程单价下拉树结构 */
const getTreeselect = async () => {
const res = await listProgressCategory(queryParams.value);
progressCategoryOptions.value = [];
const data: ProgressCategoryOption = { id: 0, name: '顶级节点', children: [] };
data.children = proxy?.handleTree<ProgressCategoryOption>(res.data, 'id', 'parentId');
progressCategoryOptions.value.push(data);
};
// 取消按钮
const cancel = () => {
reset();
dialog.visible = false;
};
// 表单重置
const reset = () => {
form.value = { ...initFormData };
progressCategoryFormRef.value?.resetFields();
};
/** 级联选择器改变事件 */
const handleChange = (value: number) => {
queryParams.value.matrixId = value[1];
getList();
};
/** 搜索按钮操作 */
const handleQuery = () => {
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 新增按钮操作 */
const handleAdd = (row?: ProgressCategoryVO) => {
reset();
getTreeselect();
if (row != null && row.id) {
form.value.parentId = row.id;
} else {
form.value.parentId = 0;
}
dialog.visible = true;
dialog.title = '添加分项工程单价';
};
/** 展开/折叠操作 */
const handleToggleExpandAll = () => {
isExpandAll.value = !isExpandAll.value;
toggleExpandAll(progressCategoryList.value, isExpandAll.value);
};
/** 展开/折叠操作 */
const toggleExpandAll = (data: ProgressCategoryVO[], status: boolean) => {
data.forEach((item) => {
progressCategoryTableRef.value?.toggleRowExpansion(item, status);
if (item.children && item.children.length > 0) toggleExpandAll(item.children, status);
});
};
/** 修改按钮操作 */
const handleUpdate = async (row: ProgressCategoryVO) => {
reset();
await getTreeselect();
if (row != null) {
form.value.parentId = row.parentId;
}
const res = await getProgressCategory(row.id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改分项工程单价';
};
/** 提交按钮 */
const submitForm = () => {
progressCategoryFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateProgressCategory(form.value).finally(() => (buttonLoading.value = false));
} else {
await addProgressCategory(form.value).finally(() => (buttonLoading.value = false));
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
getList();
}
});
};
//切换项目重置方阵
const matrixValue = ref<number | undefined>(matrixOptions.value.length > 0 ? matrixOptions.value[0].id : undefined);
const resetMatrix = () => {
matrixValue.value = undefined;
queryParams.value.matrixId = undefined;
matrixOptions.value = [];
};
/** 删除按钮操作 */
const handleDelete = async (row: ProgressCategoryVO) => {
await proxy?.$modal.confirm('是否确认删除分项工程单价编号为"' + row.id + '"的数据项?');
loading.value = true;
await delProgressCategory(row.id).finally(() => (loading.value = false));
await getList();
proxy?.$modal.msgSuccess('删除成功');
};
onMounted(() => {
getList();
});
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;
resetMatrix();
getList();
}
);
onUnmounted(() => {
listeningProject();
});
</script>

View File

@ -124,6 +124,11 @@
<el-option v-for="dict in quality_inspection_check_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> <el-option v-for="dict in quality_inspection_check_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="整改单位" prop="rectificationUnit">
<el-select v-model="form.rectificationUnit" placeholder="请选择整改单位">
<el-option v-for="dict in rectification_unit_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所在班组" prop="teamId"> <el-form-item label="所在班组" prop="teamId">
<el-select v-model="form.teamId" placeholder="请选择所在班组"> <el-select v-model="form.teamId" placeholder="请选择所在班组">
<el-option <el-option
@ -177,8 +182,8 @@ import { QualityInspectionVO, QualityInspectionQuery, QualityInspectionForm } fr
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
import QualityInspectionDetail from './component/qualityInspectionDetail.vue'; import QualityInspectionDetail from './component/qualityInspectionDetail.vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { quality_inspection_check_type, quality_inspection_status_type } = toRefs<any>( const { quality_inspection_check_type, quality_inspection_status_type, rectification_unit_type } = toRefs<any>(
proxy?.useDict('quality_inspection_check_type', 'quality_inspection_status_type') proxy?.useDict('quality_inspection_check_type', 'quality_inspection_status_type', 'rectification_unit_type')
); );
// 获取用户 store // 获取用户 store
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
@ -220,6 +225,7 @@ const initFormData: QualityInspectionForm = {
verificationResult: undefined, verificationResult: undefined,
verificationType: undefined, verificationType: undefined,
verificationTime: undefined, verificationTime: undefined,
rectificationUnit: undefined,
remark: undefined remark: undefined
}; };
const data = reactive<PageData<QualityInspectionForm, QualityInspectionQuery>>({ const data = reactive<PageData<QualityInspectionForm, QualityInspectionQuery>>({