|
|
|
|
@ -135,144 +135,115 @@
|
|
|
|
|
<ProjectSelect ref="projectSelectRef" :multiple="false" @confirm-call-back="projectInfoSelectCallBack"></ProjectSelect>
|
|
|
|
|
|
|
|
|
|
<!-- 项目周报具体信息管理区域 -->
|
|
|
|
|
<el-card shadow="never" style="margin-top: 20px">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div style="text-align: left; font-weight: bold; font-size: 18px">项目周报具体信息</div>
|
|
|
|
|
</template>
|
|
|
|
|
<el-card shadow="never">
|
|
|
|
|
<template #header>
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="Edit"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate()"
|
|
|
|
|
v-if="routeParams.type === 'view' && routeParams.reportData"
|
|
|
|
|
v-hasPermi="['oa/erp:projectReportDetail:edit']"
|
|
|
|
|
>修改</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
plain
|
|
|
|
|
icon="Delete"
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete()"
|
|
|
|
|
v-if="routeParams.type === 'view' && routeParams.reportData"
|
|
|
|
|
v-hasPermi="['oa/erp:projectReportDetail:remove']"
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
plain
|
|
|
|
|
icon="Download"
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
v-hasPermi="['oa/erp:projectReportDetail:export']"
|
|
|
|
|
v-if="routeParams.type === 'view'"
|
|
|
|
|
>导出</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="false" @queryTable="getProjectDetail"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
</template>
|
|
|
|
|
<el-card shadow="hover" style="margin-top: 20px">
|
|
|
|
|
<div style="text-align: left; font-weight: bold; font-size: 18px">项目周报具体信息</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
<!-- 项目周报具体信息表格 -->
|
|
|
|
|
<!-- <div style="margin-bottom: 16px">
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="Edit"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate()"
|
|
|
|
|
v-if="routeParams.type === 'view' && routeParams.reportData"
|
|
|
|
|
v-hasPermi="['oa/erp:projectReportDetail:edit']"
|
|
|
|
|
>修改</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
plain
|
|
|
|
|
icon="Delete"
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete()"
|
|
|
|
|
v-if="routeParams.type === 'view' && routeParams.reportData"
|
|
|
|
|
v-hasPermi="['oa/erp:projectReportDetail:remove']"
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
plain
|
|
|
|
|
icon="Download"
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
v-hasPermi="['oa/erp:projectReportDetail:export']"
|
|
|
|
|
v-if="routeParams.type === 'view'"
|
|
|
|
|
>导出</el-button
|
|
|
|
|
>
|
|
|
|
|
</div> -->
|
|
|
|
|
<el-table
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
border
|
|
|
|
|
:data="projectReportDetailList"
|
|
|
|
|
v-if="routeParams.type !== 'add' && routeParams.type !== 'approval'"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="项目周报明细ID" align="center" prop="reportDetailId" v-if="columns[0].visible" />
|
|
|
|
|
<el-table-column label="项目周报ID" align="center" prop="reportId" v-if="columns[1].visible" />
|
|
|
|
|
<el-table-column label="项目ID" align="center" prop="projectId" v-if="columns[2].visible" />
|
|
|
|
|
<el-table-column label="填写日期" align="center" prop="fillTime" width="180" v-if="columns[3].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.fillTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="所在的工作周" align="center" prop="currentWorkWeek" v-if="columns[4].visible" />
|
|
|
|
|
<el-table-column label="所属里程碑" align="center" prop="milestonePlan" v-if="columns[5].visible" />
|
|
|
|
|
<el-table-column label="二级进度阶段" align="center" prop="secondaryPhase" v-if="columns[6].visible" />
|
|
|
|
|
<el-table-column label="本周完成工作" align="center" prop="tasksCompleted" v-if="columns[7].visible" />
|
|
|
|
|
<el-table-column label="下周计划" align="center" prop="nextPlan" v-if="columns[8].visible" />
|
|
|
|
|
<el-table-column label="风险及解决措施" align="center" prop="riskResolution" v-if="columns[9].visible" />
|
|
|
|
|
<el-table-column label="项目状态" align="center" prop="scheduleStatus" v-if="columns[12].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="project_risk_status" :value="scope.row.scheduleStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="计划完成率" align="center" prop="plannedCompletionRate" v-if="columns[10].visible" />
|
|
|
|
|
<el-table-column label="周报情况说明" align="center" prop="informationNote" v-if="columns[11].visible" />
|
|
|
|
|
<el-table-column label="周报状态(1暂存 2审批中 3可用)" align="center" prop="projectReportStatus" v-if="columns[13].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="project_report_status" :value="scope.row.projectReportStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="流程状态" align="center" prop="flowStatus" v-if="columns[14].visible" />
|
|
|
|
|
<el-table-column label="排序号" align="center" prop="sortOrder" v-if="columns[15].visible" />
|
|
|
|
|
<el-table-column label="项目阶段(预留)" align="center" prop="projectPhases" v-if="columns[16].visible" />
|
|
|
|
|
<el-table-column label="合同ID(预留)" align="center" prop="contractId" v-if="columns[17].visible" />
|
|
|
|
|
<el-table-column label="附件ID" align="center" prop="ossId" v-if="columns[18].visible" />
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" v-if="columns[19].visible" />
|
|
|
|
|
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[20].visible" />
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="150" v-if="routeParams.type !== 'view' && routeParams.type != 'approval'">
|
|
|
|
|
<!-- <template #default="scope">
|
|
|
|
|
<el-card shadow="never">
|
|
|
|
|
<template #header>
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="Edit"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate()"
|
|
|
|
|
v-if="routeParams.type === 'view' && routeParams.reportData"
|
|
|
|
|
v-hasPermi="['oa/erp:projectReportDetail:edit']"
|
|
|
|
|
>修改</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
plain
|
|
|
|
|
icon="Delete"
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete()"
|
|
|
|
|
v-if="routeParams.type === 'view' && routeParams.reportData"
|
|
|
|
|
v-hasPermi="['oa/erp:projectReportDetail:remove']"
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
plain
|
|
|
|
|
icon="Download"
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
v-hasPermi="['oa/erp:projectReportDetail:export']"
|
|
|
|
|
v-if="routeParams.type === 'view'"
|
|
|
|
|
>导出</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar
|
|
|
|
|
v-model:showSearch="showSearch"
|
|
|
|
|
v-if="routeParams.type === 'view' && routeParams.reportData"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:search="false"
|
|
|
|
|
@queryTable="getProjectDetail"
|
|
|
|
|
></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
</template>
|
|
|
|
|
<el-table
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
border
|
|
|
|
|
:data="projectReportDetailList"
|
|
|
|
|
v-if="routeParams.type !== 'add' && routeParams.type !== 'approval'"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="项目周报明细ID" align="center" prop="reportDetailId" v-if="columns[0].visible" />
|
|
|
|
|
<el-table-column label="项目周报ID" align="center" prop="reportId" v-if="columns[1].visible" />
|
|
|
|
|
<el-table-column label="项目ID" align="center" prop="projectId" v-if="columns[2].visible" />
|
|
|
|
|
<el-table-column label="填写日期" align="center" prop="fillTime" width="180" v-if="columns[3].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.fillTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="所在的工作周" align="center" prop="currentWorkWeek" v-if="columns[4].visible" />
|
|
|
|
|
<el-table-column label="所属里程碑" align="center" prop="milestonePlan" v-if="columns[5].visible" />
|
|
|
|
|
<el-table-column label="二级进度阶段" align="center" prop="secondaryPhase" v-if="columns[6].visible" />
|
|
|
|
|
<el-table-column label="本周完成工作" align="center" prop="tasksCompleted" v-if="columns[7].visible" />
|
|
|
|
|
<el-table-column label="下周计划" align="center" prop="nextPlan" v-if="columns[8].visible" />
|
|
|
|
|
<el-table-column label="风险及解决措施" align="center" prop="riskResolution" v-if="columns[9].visible" />
|
|
|
|
|
<el-table-column label="项目状态" align="center" prop="scheduleStatus" v-if="columns[12].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="project_risk_status" :value="scope.row.scheduleStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="计划完成率" align="center" prop="plannedCompletionRate" v-if="columns[10].visible" />
|
|
|
|
|
<el-table-column label="周报情况说明" align="center" prop="informationNote" v-if="columns[11].visible" />
|
|
|
|
|
<el-table-column label="周报状态(1暂存 2审批中 3可用)" align="center" prop="projectReportStatus" v-if="columns[13].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="project_report_status" :value="scope.row.projectReportStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="流程状态" align="center" prop="flowStatus" v-if="columns[14].visible" />
|
|
|
|
|
<el-table-column label="排序号" align="center" prop="sortOrder" v-if="columns[15].visible" />
|
|
|
|
|
<el-table-column label="项目阶段(预留)" align="center" prop="projectPhases" v-if="columns[16].visible" />
|
|
|
|
|
<el-table-column label="合同ID(预留)" align="center" prop="contractId" v-if="columns[17].visible" />
|
|
|
|
|
<el-table-column label="附件ID" align="center" prop="ossId" v-if="columns[18].visible" />
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" v-if="columns[19].visible" />
|
|
|
|
|
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[20].visible" />
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="150" v-if="routeParams.type !== 'view' && routeParams.type != 'approval'">
|
|
|
|
|
<!-- <template #default="scope">
|
|
|
|
|
<el-button link type="primary" icon="Edit" @click="handleEditMaterial(scope.row)">编辑</el-button>
|
|
|
|
|
<el-button link type="danger" icon="Delete" @click="handleDeleteMaterial(scope.row)">删除</el-button>
|
|
|
|
|
</template> -->
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total > 0 && routeParams.type === 'view'"
|
|
|
|
|
:total="total"
|
|
|
|
|
v-model:page="projectReportFormQuery.pageNum"
|
|
|
|
|
v-model:limit="projectReportFormQuery.pageSize"
|
|
|
|
|
@pagination="getProjectDetail"
|
|
|
|
|
/>
|
|
|
|
|
</el-card>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total > 0 && routeParams.type === 'view'"
|
|
|
|
|
:total="total"
|
|
|
|
|
v-model:page="projectReportFormQuery.pageNum"
|
|
|
|
|
v-model:limit="projectReportFormQuery.pageSize"
|
|
|
|
|
@pagination="getProjectDetail"
|
|
|
|
|
/>
|
|
|
|
|
<el-form
|
|
|
|
|
ref="projectReportDetailFormRef"
|
|
|
|
|
:model="projectReportForm"
|
|
|
|
|
:loading="buttonLoading"
|
|
|
|
|
:disabled="routeParams.type === 'view' || routeParams.type === 'approval'"
|
|
|
|
|
:rules="reportRules"
|
|
|
|
|
label-width="120px"
|
|
|
|
|
@ -384,9 +355,9 @@
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改项目周报明细对话框 -->
|
|
|
|
|
<!-- 修改项目周报明细对话框 -->
|
|
|
|
|
<el-dialog :title="ReportDialog.title" v-model="ReportDialog.visible" width="800px" append-to-body>
|
|
|
|
|
<el-form ref="projectReportDetailDialogFormRef" :model="detailForm" :rules="rules" label-width="120px">
|
|
|
|
|
<el-form ref="projectReportDetailDialogFormRef" :model="detailForm" :rules="detailRules" label-width="120px">
|
|
|
|
|
<el-row :gutter="10" class="form-row">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="项目周报ID" prop="reportId">
|
|
|
|
|
@ -400,15 +371,18 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row :gutter="10" class="form-row">
|
|
|
|
|
<!-- 修改对话框中的日期选择器 -->
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="填写日期" prop="fillTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
clearable
|
|
|
|
|
v-model="detailForm.fillTime"
|
|
|
|
|
type="datetime"
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
v-model="modifyDatePart"
|
|
|
|
|
type="date"
|
|
|
|
|
format="YYYY-MM-DD"
|
|
|
|
|
value-format="YYYY-MM-DD"
|
|
|
|
|
placeholder="请选择填写日期"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
@change="handleModifyDateChange"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
@ -458,9 +432,16 @@
|
|
|
|
|
<el-row :gutter="10" class="form-row">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="计划完成率" prop="plannedCompletionRate">
|
|
|
|
|
<el-input v-model="detailForm.plannedCompletionRate" placeholder="请输入计划完成率">
|
|
|
|
|
<template #append>%</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="detailForm.plannedCompletionRate"
|
|
|
|
|
placeholder="请输入0-1之间的数字"
|
|
|
|
|
clearable
|
|
|
|
|
type="number"
|
|
|
|
|
:min="0"
|
|
|
|
|
:max="1"
|
|
|
|
|
:step="0.01"
|
|
|
|
|
@input="validateModifyPlannedCompletionRate"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
@ -738,12 +719,70 @@ const projectReportDetailData = reactive<PageData<ProjectReportDetailForm, Proje
|
|
|
|
|
activeFlag: undefined,
|
|
|
|
|
params: {}
|
|
|
|
|
},
|
|
|
|
|
rules: {}
|
|
|
|
|
rules: {
|
|
|
|
|
tasksCompleted: [{ required: true, message: '本周完成工作不能为空', trigger: 'blur' }],
|
|
|
|
|
nextPlan: [{ required: true, message: '下周计划不能为空', trigger: 'blur' }],
|
|
|
|
|
secondaryPhase: [{ required: true, message: '二级进度阶段不能为空', trigger: 'blur' }],
|
|
|
|
|
// 在 detailRules 中添加计划完成率的验证规则
|
|
|
|
|
plannedCompletionRate: [
|
|
|
|
|
{ required: false, message: '请填写计划完成率', trigger: 'blur' },
|
|
|
|
|
{
|
|
|
|
|
validator: (rule: any, value: any, callback: any) => {
|
|
|
|
|
if (value === null || value === undefined || value === '') {
|
|
|
|
|
callback();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 转换为数字
|
|
|
|
|
const numValue = Number(value);
|
|
|
|
|
// 检查是否为数字
|
|
|
|
|
if (isNaN(numValue)) {
|
|
|
|
|
callback(new Error('请输入有效的数字'));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 检查是否在0-1之间
|
|
|
|
|
if (numValue < 0 || numValue > 1) {
|
|
|
|
|
callback(new Error('请输入0-1之间的数字'));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 检查小数位数(可选)
|
|
|
|
|
const decimalPlaces = value.toString().split('.')[1];
|
|
|
|
|
if (decimalPlaces && decimalPlaces.length > 2) {
|
|
|
|
|
callback(new Error('最多支持两位小数'));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
callback();
|
|
|
|
|
},
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 解构明细数据
|
|
|
|
|
const { form: detailForm, queryParams: detailQueryParams, rules: detailRules } = toRefs(projectReportDetailData);
|
|
|
|
|
|
|
|
|
|
// 验证修改对话框中的计划完成率输入
|
|
|
|
|
const validateModifyPlannedCompletionRate = (value: string) => {
|
|
|
|
|
if (!value) return;
|
|
|
|
|
// 转换为数字
|
|
|
|
|
const numValue = Number(value);
|
|
|
|
|
// 如果输入无效或超出范围,重置为有效值
|
|
|
|
|
if (isNaN(numValue)) {
|
|
|
|
|
detailForm.value.plannedCompletionRate = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 限制在0-1之间
|
|
|
|
|
if (numValue < 0) {
|
|
|
|
|
detailForm.value.plannedCompletionRate = 0;
|
|
|
|
|
} else if (numValue > 1) {
|
|
|
|
|
detailForm.value.plannedCompletionRate = 1;
|
|
|
|
|
} else {
|
|
|
|
|
// 限制小数位数(可选)
|
|
|
|
|
const decimalPlaces = value.split('.')[1];
|
|
|
|
|
if (decimalPlaces && decimalPlaces.length > 2) {
|
|
|
|
|
detailForm.value.plannedCompletionRate = parseFloat(numValue.toFixed(2));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
// OSS功能
|
|
|
|
|
const dialog = reactive<DialogOption>({
|
|
|
|
|
visible: false,
|
|
|
|
|
@ -786,7 +825,17 @@ const submitOss = () => {
|
|
|
|
|
dialog.visible = false;
|
|
|
|
|
proxy?.$modal.msgSuccess('附件已更新');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 监听上传组件返回的文件(ossId 串)并同步到表单字段
|
|
|
|
|
// 同步表单初值到上传模型
|
|
|
|
|
watch(
|
|
|
|
|
() => form.value.ossId,
|
|
|
|
|
(val) => {
|
|
|
|
|
if (!dialog.visible) {
|
|
|
|
|
ossFileModel.value = val as any;
|
|
|
|
|
projectReportForm.value.ossId = val as any;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
const ReportDialog = reactive<DialogOption>({
|
|
|
|
|
visible: false,
|
|
|
|
|
title: ''
|
|
|
|
|
@ -825,13 +874,13 @@ const columns = ref<FieldOption[]>([
|
|
|
|
|
{ key: 17, label: `合同ID(预留)`, visible: false },
|
|
|
|
|
{ key: 18, label: `附件ID`, visible: true },
|
|
|
|
|
{ key: 19, label: `备注`, visible: true },
|
|
|
|
|
{ key: 20, label: `激活标识`, visible: false },
|
|
|
|
|
{ key: 21, label: `删除标志`, visible: true },
|
|
|
|
|
{ key: 22, label: `创建部门`, visible: true },
|
|
|
|
|
{ key: 23, label: `创建时间`, visible: true },
|
|
|
|
|
{ key: 24, label: `创建人`, visible: true },
|
|
|
|
|
{ key: 25, label: `更新人`, visible: true },
|
|
|
|
|
{ key: 26, label: `更新时间`, visible: true }
|
|
|
|
|
{ key: 20, label: `激活标识`, visible: false }
|
|
|
|
|
// { key: 21, label: `删除标志`, visible: true },
|
|
|
|
|
// { key: 22, label: `创建部门`, visible: true },
|
|
|
|
|
// { key: 23, label: `创建时间`, visible: true },
|
|
|
|
|
// { key: 24, label: `创建人`, visible: true },
|
|
|
|
|
// { key: 25, label: `更新人`, visible: true },
|
|
|
|
|
// { key: 26, label: `更新时间`, visible: true }
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
// 项目周报明细表单引用
|
|
|
|
|
@ -937,7 +986,7 @@ const validatePlannedCompletionRate = (value: string) => {
|
|
|
|
|
const numValue = Number(value);
|
|
|
|
|
// 如果输入无效或超出范围,重置为有效值
|
|
|
|
|
if (isNaN(numValue)) {
|
|
|
|
|
projectReportForm.value.plannedCompletionRate = '';
|
|
|
|
|
projectReportForm.value.plannedCompletionRate = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 限制在0-1之间
|
|
|
|
|
@ -968,6 +1017,7 @@ const formattedPlannedCompletionRate = computed(() => {
|
|
|
|
|
/** 表单重置 */
|
|
|
|
|
const reset = () => {
|
|
|
|
|
detailForm.value = { ...initProjectReportDetailFormData };
|
|
|
|
|
modifyDatePart.value = ''; // 重置修改对话框的日期部分
|
|
|
|
|
projectReportDetailDialogFormRef.value?.resetFields();
|
|
|
|
|
};
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
@ -976,6 +1026,34 @@ const handleUpdate = async (row?: ProjectReportDetailVO) => {
|
|
|
|
|
const _reportDetailId = row?.reportDetailId || ids.value[0];
|
|
|
|
|
const res = await getProjectReportDetail(_reportDetailId);
|
|
|
|
|
Object.assign(detailForm.value, res.data);
|
|
|
|
|
|
|
|
|
|
// 从 fillTime 中提取日期部分,用于日期选择器
|
|
|
|
|
if (detailForm.value.fillTime) {
|
|
|
|
|
const [date] = detailForm.value.fillTime.split(' ');
|
|
|
|
|
if (date) {
|
|
|
|
|
modifyDatePart.value = date;
|
|
|
|
|
// 计算工作周
|
|
|
|
|
detailForm.value.currentWorkWeek = getWorkWeek(date);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// 如果没有日期,设置当前日期
|
|
|
|
|
const now = new Date();
|
|
|
|
|
const year = now.getFullYear();
|
|
|
|
|
const month = String(now.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
const day = String(now.getDate()).padStart(2, '0');
|
|
|
|
|
const dateStr = `${year}-${month}-${day}`;
|
|
|
|
|
|
|
|
|
|
// 设置当前时间
|
|
|
|
|
const hours = String(now.getHours()).padStart(2, '0');
|
|
|
|
|
const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
|
|
|
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
|
|
|
const timeStr = `${hours}:${minutes}:${seconds}`;
|
|
|
|
|
|
|
|
|
|
modifyDatePart.value = dateStr;
|
|
|
|
|
detailForm.value.fillTime = `${dateStr} ${timeStr}`;
|
|
|
|
|
detailForm.value.currentWorkWeek = getWorkWeek(dateStr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ReportDialog.visible = true;
|
|
|
|
|
ReportDialog.title = '修改项目周报明细';
|
|
|
|
|
};
|
|
|
|
|
@ -1146,6 +1224,41 @@ watch(
|
|
|
|
|
{ immediate: true }
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// 添加修改对话框的日期部分变量
|
|
|
|
|
const modifyDatePart = ref('');
|
|
|
|
|
// 处理修改对话框日期变化
|
|
|
|
|
const handleModifyDateChange = (selectedDate) => {
|
|
|
|
|
if (selectedDate) {
|
|
|
|
|
// 获取当前时间(保持原有时间或使用当前时间)
|
|
|
|
|
let timeStr = '';
|
|
|
|
|
if (detailForm.value.fillTime && detailForm.value.fillTime.includes(' ')) {
|
|
|
|
|
const [, time] = detailForm.value.fillTime.split(' ');
|
|
|
|
|
if (time) {
|
|
|
|
|
timeStr = time;
|
|
|
|
|
} else {
|
|
|
|
|
const now = new Date();
|
|
|
|
|
const hours = String(now.getHours()).padStart(2, '0');
|
|
|
|
|
const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
|
|
|
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
|
|
|
timeStr = `${hours}:${minutes}:${seconds}`;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
const now = new Date();
|
|
|
|
|
const hours = String(now.getHours()).padStart(2, '0');
|
|
|
|
|
const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
|
|
|
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
|
|
|
timeStr = `${hours}:${minutes}:${seconds}`;
|
|
|
|
|
}
|
|
|
|
|
// 组合成完整的日期时间字符串
|
|
|
|
|
detailForm.value.fillTime = `${selectedDate} ${timeStr}`;
|
|
|
|
|
// 计算工作周
|
|
|
|
|
detailForm.value.currentWorkWeek = getWorkWeek(selectedDate);
|
|
|
|
|
} else {
|
|
|
|
|
// 如果清空了日期
|
|
|
|
|
detailForm.value.fillTime = '';
|
|
|
|
|
detailForm.value.currentWorkWeek = '';
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
// 审批记录
|
|
|
|
|
const handleApprovalRecord = () => {
|
|
|
|
|
approvalRecordRef.value.init(projectReportForm.value.reportDetailId);
|
|
|
|
|
@ -1162,17 +1275,6 @@ const approvalVerifyOpen = async () => {
|
|
|
|
|
await submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 监听上传组件返回的文件(ossId 串)并同步到表单字段
|
|
|
|
|
// 同步表单初值到上传模型
|
|
|
|
|
watch(
|
|
|
|
|
() => form.value.ossId,
|
|
|
|
|
(val) => {
|
|
|
|
|
if (!dialog.visible) {
|
|
|
|
|
ossFileModel.value = val as any;
|
|
|
|
|
projectReportForm.value.ossId = val as any;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
const isCodeGenerated = ref(false);
|
|
|
|
|
|
|
|
|
|
// 生成项目周报编号
|
|
|
|
|
|