|
|
|
@ -5,13 +5,7 @@
|
|
|
|
<el-card shadow="hover">
|
|
|
|
<el-card shadow="hover">
|
|
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="120px">
|
|
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="120px">
|
|
|
|
<el-form-item label="项目名称" prop="projectName">
|
|
|
|
<el-form-item label="项目名称" prop="projectName">
|
|
|
|
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery">
|
|
|
|
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
|
|
|
|
<!-- <template #suffix>
|
|
|
|
|
|
|
|
<el-icon style="cursor: pointer; margin-right: 4px; font-size: 14px" @click="openProjectSelect">
|
|
|
|
|
|
|
|
<Search />
|
|
|
|
|
|
|
|
</el-icon>
|
|
|
|
|
|
|
|
</template> -->
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="项目编号" prop="projectCode">
|
|
|
|
<el-form-item label="项目编号" prop="projectCode">
|
|
|
|
<el-input v-model="queryParams.projectCode" placeholder="请输入项目编号" clearable @keyup.enter="handleQuery" />
|
|
|
|
<el-input v-model="queryParams.projectCode" placeholder="请输入项目编号" clearable @keyup.enter="handleQuery" />
|
|
|
|
@ -107,13 +101,11 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</transition>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <ProjectSelect ref="projectSelectRef" :multiple="false" @confirm-call-back="projectInfoSelectCallBack"></ProjectSelect> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-card shadow="never">
|
|
|
|
<el-card shadow="never">
|
|
|
|
<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="['oa/erp:projectReport:add']">新增</el-button>
|
|
|
|
<el-button type="primary" plain icon="Plus" @click="handleAdd(null)" v-hasPermi="['oa/erp:projectReport:add']">新增</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="['oa/erp:projectReport:edit']"
|
|
|
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['oa/erp:projectReport:edit']"
|
|
|
|
@ -135,9 +127,9 @@
|
|
|
|
<el-table v-loading="loading" border :data="projectReportList" @selection-change="handleSelectionChange">
|
|
|
|
<el-table v-loading="loading" border :data="projectReportList" @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="reportId" v-if="columns[0].visible" />
|
|
|
|
<el-table-column label="项目周报ID" align="center" prop="reportId" v-if="columns[0].visible" />
|
|
|
|
<el-table-column label="项目ID" align="center" prop="projectId" v-if="columns[2].visible" />
|
|
|
|
<el-table-column label="项目ID" align="center" prop="projectId" v-if="columns[1].visible" />
|
|
|
|
<el-table-column label="项目名称" align="center" prop="projectName" v-if="columns[3].visible" />
|
|
|
|
<el-table-column label="项目名称" align="center" prop="projectName" v-if="columns[2].visible" />
|
|
|
|
<el-table-column label="项目编码" align="center" prop="projectCode" v-if="columns[20].visible" />
|
|
|
|
<el-table-column label="项目编码" align="center" prop="projectCode" v-if="columns[3].visible" />
|
|
|
|
<el-table-column label="当前里程碑" align="center" prop="milestonePlan" v-if="columns[4].visible" />
|
|
|
|
<el-table-column label="当前里程碑" align="center" prop="milestonePlan" v-if="columns[4].visible" />
|
|
|
|
<el-table-column label="项目经理" align="center" prop="managerName" v-if="columns[5].visible" />
|
|
|
|
<el-table-column label="项目经理" align="center" prop="managerName" v-if="columns[5].visible" />
|
|
|
|
<el-table-column label="部门名称" align="center" prop="deptName" v-if="columns[6].visible" />
|
|
|
|
<el-table-column label="部门名称" align="center" prop="deptName" v-if="columns[6].visible" />
|
|
|
|
@ -148,11 +140,11 @@
|
|
|
|
<el-table-column label="附件ID" align="center" prop="ossId" v-if="columns[11].visible" />
|
|
|
|
<el-table-column label="附件ID" align="center" prop="ossId" v-if="columns[11].visible" />
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" v-if="columns[12].visible" />
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" v-if="columns[12].visible" />
|
|
|
|
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[13].visible" />
|
|
|
|
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[13].visible" />
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="100" v-if="columns[17].visible" />
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="100" v-if="columns[14].visible" />
|
|
|
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="100" v-if="columns[19].visible" />
|
|
|
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="100" v-if="columns[15].visible" />
|
|
|
|
<el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
|
|
|
|
<el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<el-tooltip content="新增" placement="top">
|
|
|
|
<el-tooltip content="新增已有周报明细" placement="top">
|
|
|
|
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['oa/erp:projectReport:add']"></el-button>
|
|
|
|
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['oa/erp:projectReport:add']"></el-button>
|
|
|
|
</el-tooltip>
|
|
|
|
</el-tooltip>
|
|
|
|
<el-tooltip content="查看详情" placement="top">
|
|
|
|
<el-tooltip content="查看详情" placement="top">
|
|
|
|
@ -176,7 +168,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<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-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
|
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
|
|
|
<el-form ref="projectReportFormRef" :model="form" :rules="rules" label-width="120px">
|
|
|
|
<el-form ref="projectReportFormRef" :model="form" :rules="rules" label-width="120px">
|
|
|
|
<el-row :gutter="10" class="form-row">
|
|
|
|
<el-row :gutter="10" class="form-row">
|
|
|
|
@ -331,12 +323,8 @@
|
|
|
|
<script setup name="ProjectReport" lang="ts">
|
|
|
|
<script setup name="ProjectReport" lang="ts">
|
|
|
|
import { ProjectReportVO, ProjectReportQuery, ProjectReportForm } from '@/api/oa/erp/projectReport/types';
|
|
|
|
import { ProjectReportVO, ProjectReportQuery, ProjectReportForm } from '@/api/oa/erp/projectReport/types';
|
|
|
|
import { listProjectReport, getProjectReport, delProjectReport, addProjectReport, updateProjectReport } from '@/api/oa/erp/projectReport';
|
|
|
|
import { listProjectReport, getProjectReport, delProjectReport, addProjectReport, updateProjectReport } from '@/api/oa/erp/projectReport';
|
|
|
|
import ProjectSelect from '@/components/ProjectSelect/index.vue';
|
|
|
|
import { allListDept } from '@/api/system/dept';
|
|
|
|
import { report } from 'process';
|
|
|
|
import { listUserByDeptId } from '@/api/system/user';
|
|
|
|
import { fa } from 'element-plus/es/locale/index.mjs';
|
|
|
|
|
|
|
|
import { allListDept, listDept } from '@/api/system/dept';
|
|
|
|
|
|
|
|
import { listUserByDeptAndRole, listUserByDeptId } from '@/api/system/user';
|
|
|
|
|
|
|
|
import { delProjectReportDetailByReportId } from '@/api/oa/erp/projectReportDetail/index';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
|
|
|
|
|
|
@ -354,8 +342,6 @@ const total = ref(0);
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
|
// 对话框引用
|
|
|
|
// 对话框引用
|
|
|
|
const projectReportFormRef = ref<ElFormInstance>();
|
|
|
|
const projectReportFormRef = ref<ElFormInstance>();
|
|
|
|
// 根据项目名称选择项目组件引用
|
|
|
|
|
|
|
|
const projectSelectRef = ref<InstanceType<typeof ProjectSelect>>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dialog = reactive<DialogOption>({
|
|
|
|
const dialog = reactive<DialogOption>({
|
|
|
|
visible: false,
|
|
|
|
visible: false,
|
|
|
|
@ -365,9 +351,9 @@ const dialog = reactive<DialogOption>({
|
|
|
|
// 列显隐信息
|
|
|
|
// 列显隐信息
|
|
|
|
const columns = ref<FieldOption[]>([
|
|
|
|
const columns = ref<FieldOption[]>([
|
|
|
|
{ key: 0, label: `项目周报ID`, visible: false },
|
|
|
|
{ key: 0, label: `项目周报ID`, visible: false },
|
|
|
|
{ key: 1, label: `租户编号`, visible: false },
|
|
|
|
{ key: 1, label: `项目ID`, visible: false },
|
|
|
|
{ key: 2, label: `项目ID`, visible: false },
|
|
|
|
{ key: 2, label: `项目名称`, visible: true },
|
|
|
|
{ key: 3, label: `项目名称`, visible: true },
|
|
|
|
{ key: 3, label: `项目编码`, visible: true },
|
|
|
|
{ key: 4, label: `当前里程碑`, visible: true },
|
|
|
|
{ key: 4, label: `当前里程碑`, visible: true },
|
|
|
|
{ key: 5, label: `项目经理`, visible: true },
|
|
|
|
{ key: 5, label: `项目经理`, visible: true },
|
|
|
|
{ key: 6, label: `部门名称`, visible: true },
|
|
|
|
{ key: 6, label: `部门名称`, visible: true },
|
|
|
|
@ -378,13 +364,8 @@ const columns = ref<FieldOption[]>([
|
|
|
|
{ key: 11, label: `附件ID`, visible: true },
|
|
|
|
{ key: 11, label: `附件ID`, visible: true },
|
|
|
|
{ key: 12, label: `备注`, visible: true },
|
|
|
|
{ key: 12, label: `备注`, visible: true },
|
|
|
|
{ key: 13, label: `激活标识`, visible: false },
|
|
|
|
{ key: 13, label: `激活标识`, visible: false },
|
|
|
|
{ key: 14, label: `删除标志`, visible: false },
|
|
|
|
{ key: 14, label: `创建时间`, visible: true },
|
|
|
|
{ key: 15, label: `创建部门`, visible: true },
|
|
|
|
{ key: 15, label: `更新时间`, visible: true }
|
|
|
|
{ key: 16, label: `创建人`, visible: true },
|
|
|
|
|
|
|
|
{ key: 17, label: `创建时间`, visible: true },
|
|
|
|
|
|
|
|
{ key: 18, label: `更新人`, visible: true },
|
|
|
|
|
|
|
|
{ key: 19, label: `更新时间`, visible: true },
|
|
|
|
|
|
|
|
{ key: 20, label: `项目编码`, visible: true }
|
|
|
|
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
const initFormData: ProjectReportForm = {
|
|
|
|
const initFormData: ProjectReportForm = {
|
|
|
|
reportId: undefined,
|
|
|
|
reportId: undefined,
|
|
|
|
@ -447,10 +428,10 @@ const dialogOSS = reactive<DialogOption>({
|
|
|
|
/** 文件按钮操作 */
|
|
|
|
/** 文件按钮操作 */
|
|
|
|
const handleFile = () => {
|
|
|
|
const handleFile = () => {
|
|
|
|
type.value = 0;
|
|
|
|
type.value = 0;
|
|
|
|
dialogOSS.visible = true;
|
|
|
|
|
|
|
|
dialogOSS.title = '上传周报附件';
|
|
|
|
|
|
|
|
// 打开时回显已有附件
|
|
|
|
// 打开时回显已有附件
|
|
|
|
ossFileModel.value = form.value.ossId as any;
|
|
|
|
ossFileModel.value = form.value.ossId as any;
|
|
|
|
|
|
|
|
dialogOSS.visible = true;
|
|
|
|
|
|
|
|
dialogOSS.title = '上传周报附件';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// OSS 上传内部 v-model 中转,避免直接绑定到 form 的未知属性
|
|
|
|
// OSS 上传内部 v-model 中转,避免直接绑定到 form 的未知属性
|
|
|
|
const ossFileModel = ref<string | string[] | undefined>(undefined);
|
|
|
|
const ossFileModel = ref<string | string[] | undefined>(undefined);
|
|
|
|
@ -472,7 +453,6 @@ watch(
|
|
|
|
(val) => {
|
|
|
|
(val) => {
|
|
|
|
if (!dialog.visible) {
|
|
|
|
if (!dialog.visible) {
|
|
|
|
ossFileModel.value = val as any;
|
|
|
|
ossFileModel.value = val as any;
|
|
|
|
// form.value.ossId = val as any;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -502,16 +482,12 @@ const getUsersByDept = async (deptId: number | string) => {
|
|
|
|
deputyList.value = [];
|
|
|
|
deputyList.value = [];
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
loadingUsers.value = true;
|
|
|
|
loadingUsers.value = true;
|
|
|
|
|
|
|
|
|
|
|
|
// 获取当前部门的用户(用于项目经理和部门负责人)
|
|
|
|
// 获取当前部门的用户(用于项目经理和部门负责人)
|
|
|
|
const currentDeptUsers = await listUserByDeptId(deptId);
|
|
|
|
const currentDeptUsers = await listUserByDeptId(deptId);
|
|
|
|
|
|
|
|
|
|
|
|
// 找到当前部门的信息,获取父部门ID
|
|
|
|
// 找到当前部门的信息,获取父部门ID
|
|
|
|
const currentDept = deptList.value.find((dept) => String(dept.deptId) === String(deptId));
|
|
|
|
const currentDept = deptList.value.find((dept) => String(dept.deptId) === String(deptId));
|
|
|
|
|
|
|
|
|
|
|
|
if (currentDept) {
|
|
|
|
if (currentDept) {
|
|
|
|
// 当前部门的用户用于项目经理和部门负责人
|
|
|
|
// 当前部门的用户用于项目经理和部门负责人
|
|
|
|
managerList.value = currentDeptUsers.data || [];
|
|
|
|
managerList.value = currentDeptUsers.data || [];
|
|
|
|
@ -524,7 +500,6 @@ const getUsersByDept = async (deptId: number | string) => {
|
|
|
|
// 如果没有父部门,则当前部门的用户也可作为分管副总
|
|
|
|
// 如果没有父部门,则当前部门的用户也可作为分管副总
|
|
|
|
deputyList.value = currentDeptUsers.data || [];
|
|
|
|
deputyList.value = currentDeptUsers.data || [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 更新部门名称
|
|
|
|
// 更新部门名称
|
|
|
|
form.value.deptName = currentDept.deptName || currentDept.label;
|
|
|
|
form.value.deptName = currentDept.deptName || currentDept.label;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -546,12 +521,10 @@ const handleDeptChange = async (deptId: number | string) => {
|
|
|
|
form.value.managerName = undefined;
|
|
|
|
form.value.managerName = undefined;
|
|
|
|
form.value.chargeName = undefined;
|
|
|
|
form.value.chargeName = undefined;
|
|
|
|
form.value.deputyName = undefined;
|
|
|
|
form.value.deputyName = undefined;
|
|
|
|
|
|
|
|
|
|
|
|
// 清空用户列表
|
|
|
|
// 清空用户列表
|
|
|
|
managerList.value = [];
|
|
|
|
managerList.value = [];
|
|
|
|
chargeList.value = [];
|
|
|
|
chargeList.value = [];
|
|
|
|
deputyList.value = [];
|
|
|
|
deputyList.value = [];
|
|
|
|
|
|
|
|
|
|
|
|
// 获取该部门的用户
|
|
|
|
// 获取该部门的用户
|
|
|
|
await getUsersByDept(deptId);
|
|
|
|
await getUsersByDept(deptId);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
@ -676,7 +649,7 @@ const handleUpdateReport = (row?: ProjectReportVO) => {
|
|
|
|
const handleUpdate = async (row?: ProjectReportVO) => {
|
|
|
|
const handleUpdate = async (row?: ProjectReportVO) => {
|
|
|
|
reset();
|
|
|
|
reset();
|
|
|
|
// 打开遮罩层
|
|
|
|
// 打开遮罩层
|
|
|
|
proxy?.$modal.loading('正在导出数据,请稍后...');
|
|
|
|
proxy?.$modal.loading('正在查询数据,请稍后...');
|
|
|
|
|
|
|
|
|
|
|
|
const _reportId = row?.reportId || ids.value[0];
|
|
|
|
const _reportId = row?.reportId || ids.value[0];
|
|
|
|
const res = await getProjectReport(_reportId);
|
|
|
|
const res = await getProjectReport(_reportId);
|
|
|
|
|