From 819d40eb1bec7acb2b3adaa4a9a3f8d8eeca1dcc Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期三, 24 十二月 2025 17:26:06 +0800
Subject: [PATCH] 上报
---
src/views/workbench.vue | 948 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 823 insertions(+), 125 deletions(-)
diff --git a/src/views/workbench.vue b/src/views/workbench.vue
index ce8c638..cd36e6f 100644
--- a/src/views/workbench.vue
+++ b/src/views/workbench.vue
@@ -3,7 +3,7 @@
<!-- 椤堕儴瀵艰埅鏍� -->
<div class="top-navbar">
<div class="welcome-message">
- <h2>鏃╁畨锛寋{ this.$store.state.user.name }}锛�</h2>
+ <h2>{{ getCurrentTimePeriod() }}锛寋{ this.$store.state.user.name }}锛�</h2>
<p>浠婂ぉ鏄瘂{ currentDate }}锛岀鎮ㄥ伐浣滄剦蹇紒</p>
</div>
<div class="quick-stats">
@@ -16,9 +16,18 @@
<span class="stat-label">浠婃棩鏃ョ▼</span>
</div>
<div class="stat-item">
- <span class="stat-number">{{ unreadMessages }}</span>
- <span class="stat-label">鏈娑堟伅</span>
+ <span class="stat-number">{{ totalActiveTasks }}</span>
+ <span class="stat-label">浠婃棩澶勭悊</span>
</div>
+ <div style="display: flex;align-items: center">
+ <el-button size="mini" @click="handleAddReport()"
+ class="report-btn"
+ icon="el-icon-upload2">涓婃姤</el-button>
+ <el-button size="mini" @click="handleViewReport()"
+ class="report-btn"
+ icon="el-icon-view">鏌ョ湅涓婃姤</el-button>
+ </div>
+
</div>
<div class="user-profile">
<!-- <el-dropdown>-->
@@ -52,15 +61,15 @@
<el-menu-item
v-for="project in projects"
:key="project.id"
- :index="project.id">
+ :index="project.id +''">
<i class="el-icon-folder"></i>
- <span slot="title" class="project-name" :title="project.name">
- {{ project.name }}
+ <span slot="title" class="project-name" :title="project.projectName">
+ {{ project.projectName }}
</span>
</el-menu-item>
</el-menu>
<div class="project-actions">
- <el-button type="primary" icon="el-icon-plus" size="small">鏂板缓椤圭洰</el-button>
+ <el-button type="primary" icon="el-icon-plus" size="small" @click="addProject">鏂板缓椤圭洰</el-button>
</div>
</div>
</div>
@@ -71,73 +80,99 @@
<div class="task-section">
<div class="section-header">
<h3>寰呭姙浠诲姟</h3>
- <el-button type="text" icon="el-icon-refresh">鍒锋柊</el-button>
+ <el-button type="text" icon="el-icon-refresh" @click="getWaitTaskList()" :disabled="waitTaskRefreshing">鍒锋柊</el-button>
</div>
- <el-table
- :data="tasks"
- border
- style="width: 100%"
+ <div>
+ <el-table
+ v-loading="loading"
+ :data="tasks"
+ border
+ style="width: 100%"
>
- <el-table-column
- prop="name"
- label="浠诲姟鍚嶇О"
- width="240">
- </el-table-column>
- <el-table-column
- prop="project"
- label="鎵�灞為」鐩�"
- show-overflow-tooltip
- width="300">
- </el-table-column>
- <el-table-column
- prop="startTime"
- label="寮�濮嬫椂闂�"
- align="center"
- width="160">
- </el-table-column>
- <el-table-column
- prop="deadline"
- label="鎴鏃堕棿"
- align="center"
- width="160">
- </el-table-column>
- <el-table-column
- prop="status"
- label="鐘舵��"
- align="center"
- width="100">
- <template slot-scope="scope">
- <el-tag :type="scope.row.status === '寰呭畬鎴�' ? 'success' : 'warning'" size="small">
- {{ scope.row.status }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column
- label="鎿嶄綔"
- fixed="right"
- width="120">
- <template slot-scope="scope">
- <el-button size="mini" @click="handleTaskEdit(scope.row)">鍔炵悊</el-button>
- </template>
- </el-table-column>
- </el-table>
+ <el-table-column
+ prop="taskName"
+ label="浠诲姟鍚嶇О"
+ width="240">
+ </el-table-column>
+ <el-table-column
+ prop="checkPointInfo.projectName"
+ label="鎵�灞為」鐩�"
+ show-overflow-tooltip
+ width="300">
+ </el-table-column>
+ <el-table-column
+ prop="startTime"
+ label="寮�濮嬫椂闂�"
+ align="center"
+ width="160">
+ </el-table-column>
+ <el-table-column
+ prop="endTime"
+ label="鎴鏃堕棿"
+ align="center"
+ width="160">
+ </el-table-column>
+ <el-table-column
+ prop="status"
+ label="鐘舵��"
+ align="center"
+ width="100">
+ <template slot-scope="scope">
+ <el-tag :type="scope.row.taskType === '寰呭畬鎴�' ? 'success' : 'warning'" size="small">
+ {{ scope.row.taskType }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鎿嶄綔"
+ fixed="right"
+ >
+ <template slot-scope="scope">
+ <el-button size="mini" @click="handleTaskEdit(scope.row)">鍔炵悊</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+
+ <div class="pagination-container">
+ <el-pagination
+ @current-change="handleCurrentChange"
+ :current-page="waitTaskQuery.currentPage"
+ :page-size="waitTaskQuery.pageSize"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="waitTaskTotal"
+ >
+ </el-pagination>
+ </div>
+
</div>
<!-- 椤圭洰鍔炵悊鏃ュ織 -->
<div class="log-section">
<div class="section-header">
<h3>椤圭洰鍔炵悊鏃ュ織</h3>
- <el-button type="text" icon="el-icon-refresh">鍒锋柊</el-button>
+ <el-button type="text" icon="el-icon-refresh" @click="getAuditHistoryPage" :disabled="auditHistoryRefreshing">鍒锋柊</el-button>
</div>
- <div class="log-list">
+ <div class="log-list" v-loading="auditHistoryLoading">
<div v-for="log in logs" :key="log.id" class="log-item">
<div class="log-time">{{ log.time }}</div>
<div class="log-content">
- <span class="log-project">{{ log.project }}</span>
- <span class="log-action">{{ log.action }}</span>
- <span class="log-detail">{{ log.detail }}</span>
+ <span class="log-project">{{ log.projectName }}</span>
+ <span class="log-action">{{ getAuditTypeText(log.auditType) }}</span>
+ <span class="log-detail">{{ log.content }}</span>
</div>
</div>
+
+ </div>
+ <div class="pagination-container">
+ <el-pagination
+ @current-change="auditHistoryHandleCurrentChange"
+ :current-page="auditHistoryQuery.currentPage"
+ :page-size="auditHistoryQuery.pageSize"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="auditHistoryTotal"
+ >
+ </el-pagination>
</div>
</div>
</div>
@@ -189,11 +224,12 @@
<h3>鏃ョ▼鍒楄〃</h3>
<div>
<el-button type="text" icon="el-icon-plus" @click="handleAddSchedule">鏂板</el-button>
- <el-button type="text" icon="el-icon-refresh">鍒锋柊</el-button>
+ <el-button type="text" icon="el-icon-refresh" @click="getScheduleList" :disabled="scheduleRefreshing">鍒锋柊</el-button>
</div>
</div>
<div class="schedule-list">
<el-table
+ v-loading="scheduleLoading"
:data="filteredSchedules"
style="width: 100%"
height="250">
@@ -217,71 +253,649 @@
</el-table-column>
</el-table>
</div>
+
</div>
</div>
</div>
+
+ <el-dialog
+ :title="diaLogTitle"
+ :visible.sync="scheduleDialogVisible"
+ width="500px"
+ @close="resetScheduleForm"
+ >
+ <el-form
+ ref="scheduleFormRef"
+ :model="scheduleForm"
+ :rules="scheduleRules"
+ label-width="80px"
+ >
+ <el-form-item label="閫夋嫨椤圭洰" prop="projectId">
+ <el-select
+ v-model="scheduleForm.projectId"
+ clearable
+ placeholder="閫夋嫨椤圭洰"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="project in allProjects"
+ :key="project.id"
+ :label="project.name"
+ :value="project.id"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ <!-- 宸ヤ綔鍐呭 -->
+ <el-form-item label="宸ヤ綔鍐呭" prop="content">
+ <el-input
+ v-model="scheduleForm.content"
+ type="textarea"
+ placeholder="璇疯緭鍏ュ伐浣滃唴瀹�"
+ rows="3"
+ ></el-input>
+ </el-form-item>
+ <!-- 瀹屾垚鏃ユ湡 -->
+ <el-form-item label="瀹屾垚鏃ユ湡" prop="completedTime">
+ <el-date-picker
+ v-model="scheduleForm.completedTime"
+ type="datetime"
+ placeholder="璇烽�夋嫨瀹屾垚鏃ユ湡"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ style="width: 100%;"
+ ></el-date-picker>
+ </el-form-item>
+
+ </el-form>
+ <template v-slot:footer>
+ <el-button @click="scheduleDialogVisible = false">鍙栨秷</el-button>
+ <el-button type="primary" @click="submitSaveSchedule">纭畾</el-button>
+ </template>
+ </el-dialog>
+ <el-dialog
+ :title="reportTitle"
+ :visible.sync="reportDialogVisible"
+ width="600px"
+ @close="resetReportForm"
+ >
+ <el-form
+ ref="reportFormRef"
+ :model="reportForm"
+ :rules="reportRules"
+ label-width="90px"
+ >
+ <el-form-item label="閫夋嫨椤圭洰" prop="projectId">
+ <el-select
+ v-model="reportForm.projectId"
+ clearable
+ placeholder="閫夋嫨椤圭洰"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="project in allProjects"
+ :key="project.id"
+ :label="project.name"
+ :value="project.id"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="涓婃姤鍐呭" prop="content">
+ <el-input
+ v-model="reportForm.content"
+ type="textarea"
+ placeholder="璇疯緭鍏ヤ笂鎶ュ唴瀹�"
+ rows="4"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="涓婁紶闄勪欢">
+ <FileUpload v-model="reportForm.fileUrl" :isShowTip="true" />
+ </el-form-item>
+ </el-form>
+ <template v-slot:footer>
+ <el-button @click="reportDialogVisible = false">鍙栨秷</el-button>
+ <el-button type="primary" @click="submitReport">纭畾</el-button>
+ </template>
+ </el-dialog>
+ <el-dialog
+ title="涓婃姤璁板綍"
+ :visible.sync="reportListDialogVisible"
+ width="700px"
+ >
+ <div class="calendar-section">
+ <el-calendar v-model="reportCalendarDate">
+ <template
+ slot="dateCell"
+ slot-scope="{date, data}">
+ <div class="calendar-day">
+ {{ data.day.split('-').slice(2).join('-') }}
+ <div v-if="getReportCount(date) > 0" class="schedule-count">
+ {{ getReportCount(date) }}涓笂鎶�
+ </div>
+ </div>
+ </template>
+ </el-calendar>
+ </div>
+ <div class="schedule-list-section">
+ <div class="section-header">
+ <h3>涓婃姤鍒楄〃</h3>
+ <div>
+ <el-button type="text" icon="el-icon-refresh" @click="getReportList" :disabled="reportRefreshing">鍒锋柊</el-button>
+ </div>
+ </div>
+ <div class="schedule-list">
+ <el-table
+ v-loading="reportLoading"
+ :data="filteredReport"
+ style="width: 100%"
+ height="250">
+ <el-table-column
+ prop="time"
+ label="鏃堕棿"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="title"
+ label="浜嬮」"
+ >
+ </el-table-column>
+ <el-table-column
+ label="鎿嶄綔">
+ <template slot-scope="scope">
+ <el-button size="mini" @click="handleEditReport(scope.row)">鏌ョ湅</el-button>
+ <el-button size="mini" @click="handleReturn(scope.row)" :disabled="scope.row.status !== 'PendingReview'">鎾ゅ洖</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+
+ </div>
+ <template v-slot:footer>
+ <el-button @click="reportListDialogVisible = false">鍏� 闂�</el-button>
+ </template>
+ </el-dialog>
</div>
</template>
<script>
+import {
+ getCountAchievements,
+ getProjectList,
+ getWaitTaskList,
+ add,
+ auditHistoryPage,
+ listByDate,
+ update,
+ del,
+ countTodayTask,
+} from "@/api/workbench/workbench"
+
+import {getTaskIsAuditing} from "@/api/projectProcess/projectProcess";
+import {getProjectSelectList} from "@/api/index";
+import {addReport, reportByDate,delReport} from "@/api/report/report";
+import { formatDateToFrontend,formatDate,formatCalendarDate,getDayStartAndEnd } from "@/utils/date.js"
export default {
+
data() {
return {
+ diaLogTitle:"",
+ reportTitle:"",
+ allProjects:[],
+
+ scheduleDialogVisible: false,
+ reportLoading:false,
+
+ reportCurrentPageNum:1,
+ reportPageSize:5,
+ reportTotal:5,
+ reportDialogVisible: false,
+ reportListDialogVisible: false,
+ // 鏂板锛氭柊澧炴棩绋嬭〃鍗曟暟鎹紙瀵瑰簲WorkStationSchedule瀹炰綋锛�
+ scheduleForm: {
+ id:'',
+ content: '', // 宸ヤ綔鍐呭
+ completedTime: '',
+ projectId:''
+
+ },
+ reportForm: {
+ id:'',
+ projectId: '',
+ content: '',
+ fileUrl: []
+ },
+ // 鏂板锛氳〃鍗曟牎楠岃鍒�
+ scheduleRules: {
+ content: [
+ {required: true, message: '璇疯緭鍏ュ伐浣滃唴瀹�', trigger: 'blur'},
+ {max: 500, message: '宸ヤ綔鍐呭鏈�澶�500涓瓧绗�', trigger: 'blur'}
+ ],
+ completedTime: [
+ {required: true, message: '璇烽�夋嫨瀹屾垚鏃ユ湡', trigger: 'change'}
+ ],
+ projectId:[
+ {required:true,message: '璇烽�夋嫨椤圭洰', trigger: 'change'}
+ ]
+ },
+ reportRules: {
+ projectId: [
+ { required: true, message: '璇烽�夋嫨椤圭洰', trigger: 'change' }
+ ],
+ content: [
+ { required: true, message: '璇疯緭鍏ヤ笂鎶ュ唴瀹�', trigger: 'blur' },
+ { max: 500, message: '涓婃姤鍐呭鏈�澶�500涓瓧绗�', trigger: 'blur' }
+ ]
+ },
+ queryParams: {
+ taskName: '',
+ taskType: 'todo',
+ pageSize: 5,
+ currentPage: 1,
+ projectId: null,
+ processDefId: null,
+ processInsId: null,
+ deployId: null,
+ processName: '' // 娴佺▼鍚嶇О
+ },
+ waitTaskRefreshing:false,
+ reportRefreshing:false,
+ scheduleRefreshing:false,
+ auditHistoryRefreshing:false,
+ loading:false,
+ scheduleLoading:false,
+ auditHistoryLoading:false,
+ waitTaskQuery:{
+ pageSize:5,
+ currentPage:1,
+ },
+ auditHistoryQuery:{
+ pageSize:5,
+ currentPage:1,
+ },
+ waitTaskTotal:0,
+ auditHistoryTotal:0,
+ projectId:null,
+
userInfo: {
name: '寮犲伐绋嬪笀',
avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
department: '椤圭洰閮�'
},
- currentDate: this.formatDate(new Date()),
- todayTasks: 5,
- todaySchedules: 3,
- unreadMessages: 2,
+ currentDate: formatDate(new Date()),
+ todayTasks: 0,
+ todaySchedules: 0,
+ totalActiveTasks: 0,
activeProject: 'all',
- projects: [
- { id: '1', name: '灏勬椽甯傛脖鐗岄晣缁煎悎姘村埄璁炬柦寤鸿椤圭洰' },
- { id: '2', name: '灏勬椽甯傚浗瀹跺偍澶囨灄寤鸿椤圭洰锛堜竴鏈燂級' },
- { id: '3', name: '灏勬椽甯傜櫧缇借倝楦′骇涓氬缓璁鹃」鐩�' },
- { id: '4', name: '閬傚畞甯傚皠娲�2024鈥�2027骞村害涓滃寳鐗囧尯楂樻爣鍑嗗啘鐢板缓璁鹃」鐩�' },
- { id: '5', name: '灏勬椽甯傜幇浠g涓氱ず鑼冨熀鍦板缓璁鹃」鐩�' },
- ],
- tasks: [
- { id: 1, name: '瀹℃牳鏂藉伐鍥剧焊', project: '灏勬椽甯傚浗瀹跺偍澶囨灄寤鸿椤圭洰锛堜竴鏈燂級', startTime: '2025-05-05', deadline: '2025-06-15', status: '寰呭畬鎴�' },
- { id: 2, name: '閲囪喘鏉愭枡娓呭崟', project: '灏勬椽甯傜櫧缇借倝楦′骇涓氬缓璁鹃」鐩�', startTime: '2025-05-14', deadline: '2025-06-18', status: '寰呭畬鎴�' },
- { id: 3, name: '鐜板満瀹夊叏妫�鏌�', project: '閬傚畞甯傚皠娲�2024鈥�2027骞村害涓滃寳鐗囧尯楂樻爣鍑嗗啘鐢板缓璁鹃」鐩�', startTime: '2025-05-10', deadline: '2025-06-12', status: '瀹圭己涓�' },
- { id: 4, name: '椤圭洰杩涘害鎶ュ憡', project: '灏勬椽甯傜幇浠g涓氱ず鑼冨熀鍦板缓璁鹃」鐩�', startTime: '2025-05-23', deadline: '2025-06-20', status: '寰呭畬鎴�' },
- { id: 5, name: '渚涘簲鍟嗕細璁�', project: '灏勬椽甯傛脖鐗岄晣缁煎悎姘村埄璁炬柦寤鸿椤圭洰', startTime: '2025-05-14', deadline: '2025-06-14', status: '瀹圭己涓�' }
- ],
- logs: [
- { id: 1, time: '09:30', project: '灏勬椽甯傚浗瀹跺偍澶囨灄寤鸿椤圭洰锛堜竴鏈燂級', action: '鎻愪氦', detail: '鎻愪氦浜嗘柦宸ュ浘绾稿鏍哥敵璇�' },
- { id: 2, time: '10:15', project: '灏勬椽甯傜櫧缇借倝楦′骇涓氬缓璁鹃」鐩�', action: '鏇存柊', detail: '鏇存柊浜嗘潗鏂欓噰璐竻鍗�' },
- { id: 3, time: '11:00', project: '閬傚畞甯傚皠娲�2024鈥�2027骞村害涓滃寳鐗囧尯楂樻爣鍑嗗啘鐢板缓璁鹃」鐩�', action: '瀹屾垚', detail: '瀹屾垚浜嗙數鍔涜澶囨祴璇�' },
- { id: 4, time: '14:30', project: '灏勬椽甯傜幇浠g涓氱ず鑼冨熀鍦板缓璁鹃」鐩�', action: '鍒涘缓', detail: '鍒涘缓浜嗘柊鐨勫畨瑁呰鍒�' },
- { id: 5, time: '16:45', project: '灏勬椽甯傛脖鐗岄晣缁煎悎姘村埄璁炬柦寤鸿椤圭洰', action: '瀹℃壒', detail: '瀹℃壒閫氳繃浜嗗畨鍏ㄦ柟妗�' }
- ],
+ projects: [],
+ tasks: [],
+ logs: [],//鏃ュ織鏁版嵁瀵硅薄
achievements: {
- completedTasks: 128,
- avgDuration: 3.5,
- totalSchedules: 89,
- completedSchedules: 76
+ completedTasks: 0,
+ avgDuration: 0,
+ totalSchedules: 0,
+ completedSchedules: 0
},
calendarDate: new Date(),
- schedules: [
- { id: 1, date: '2025-05-10', time: '09:00', title: '椤圭洰鍚姩浼氳', project: '灏勬椽甯傚浗瀹跺偍澶囨灄寤鸿椤圭洰锛堜竴鏈燂級' },
- { id: 2, date: '2025-05-10', time: '14:00', title: '渚涘簲鍟嗘唇璋�', project: '灏勬椽甯傜櫧缇借倝楦′骇涓氬缓璁鹃」鐩�' },
- { id: 3, date: '2025-05-11', time: '10:30', title: '鐜板満鍕樺療', project: '閬傚畞甯傚皠娲�2024鈥�2027骞村害涓滃寳鐗囧尯楂樻爣鍑嗗啘鐢板缓璁鹃」鐩�' },
- { id: 4, date: '2025-05-12', time: '09:00', title: '瀹夊叏鍩硅', project: '灏勬椽甯傜幇浠g涓氱ず鑼冨熀鍦板缓璁鹃」鐩�' },
- { id: 5, date: '2025-05-12', time: '15:00', title: '杩涘害姹囨姤', project: '灏勬椽甯傛脖鐗岄晣缁煎悎姘村埄璁炬柦寤鸿椤圭洰' },
- { id: 6, date: '2025-05-15', time: '13:00', title: '璁惧楠屾敹', project: '灏勬椽甯傜櫧缇借倝楦′骇涓氬缓璁鹃」鐩�' }
- ]
+ lastCalendarDate:new Date(),
+ reportCalendarDate: new Date(),
+ lastReportCalendarDate: new Date(),
+ schedules: [],
+ reports:[]
}
+ },
+ watch:{
+ calendarDate(newDate, oldDate) {
+ // 鎺掗櫎銆岀偣鍑绘棩鏈熷崟鍏冩牸銆嶅鑷寸殑鍙樺寲锛堜粎鏃ユ湡鍙橈紝鏈堜唤/骞翠唤涓嶅彉锛�
+ const isOnlyDayChange =
+ newDate.getFullYear() === oldDate.getFullYear() &&
+ newDate.getMonth() === oldDate.getMonth() &&
+ newDate.getDate() !== oldDate.getDate();
+
+ if (!isOnlyDayChange) {
+ // 瑙﹀彂鎸夐挳鐐瑰嚮閫昏緫锛堜笂鏈�/涓嬫湀/浠婃棩锛�
+ this.getScheduleList();
+ this.lastCalendarDate = new Date(newDate); // 鏇存柊璁板綍鐨勬棩鏈�
+ }
+ },
+ reportCalendarDate(newDate, oldDate) {
+ // 鎺掗櫎銆岀偣鍑绘棩鏈熷崟鍏冩牸銆嶅鑷寸殑鍙樺寲锛堜粎鏃ユ湡鍙橈紝鏈堜唤/骞翠唤涓嶅彉锛�
+ const isOnlyDayChange =
+ newDate.getFullYear() === oldDate.getFullYear() &&
+ newDate.getMonth() === oldDate.getMonth() &&
+ newDate.getDate() !== oldDate.getDate();
+
+ if (!isOnlyDayChange) {
+ // 瑙﹀彂鎸夐挳鐐瑰嚮閫昏緫锛堜笂鏈�/涓嬫湀/浠婃棩锛�
+ this.getReportList();
+ this.lastReportCalendarDate = new Date(newDate); // 鏇存柊璁板綍鐨勬棩鏈�
+ }
+ },
},
computed: {
+ // 璁$畻鑾峰緱鎸囧畾鏃ユ湡鏁版嵁
filteredSchedules() {
- const selectedDate = this.formatCalendarDate(this.calendarDate);
+ const selectedDate = formatCalendarDate(this.calendarDate);
return this.schedules.filter(schedule => schedule.date === selectedDate);
+ },
+ filteredReport(){
+ const selectDate = formatCalendarDate(this.reportCalendarDate);
+ return this.reports.filter(report => report.date === selectDate);
}
},
+ mounted() {
+ this.initData();
+ this.initSelect();
+ this.getScheduleList();
+ this.countTodayTask();
+ this.getAuditHistoryPage();
+ },
methods: {
+ handleReturn(row){
+ delReport(row.id).then(res =>{
+ if (res.code === 200){
+ this.getReportList()
+ }
+ })
+ },
+ handleAddReport(){
+ this.reportTitle="鎻愪氦涓婃姤";
+ this.resetReportForm();
+ this.reportDialogVisible = true;
+ },
+ handleEditReport(row){
+ this.reportTitle="缂栬緫涓婃姤";
+ this.resetReportForm();
+ this.reportDialogVisible = true;
+
+ this.reportForm.id = row.id;
+ this.reportForm.projectId = row.projectId + ""; //鍏堣浆涓哄瓧绗︿覆绫诲瀷 鎻愪氦鐨勬椂鍊欒浆涓烘暟瀛�
+ this.reportForm.content = row.title;
+ this.reportForm.fileUrl = row.fileUrl;
+ },
+
+ handleViewReport(){
+ this.getReportList();
+ this.reportListDialogVisible = true;
+ },
+ getAuditTypeText(auditType) {
+ // 鏄犲皠鍏崇郴锛氬悗绔�� 鈫� 鍓嶇姹夊瓧
+ const typeMap = {
+ Submit: '鎻愪氦',
+ Review: '瀹℃牳',
+ Reject: '椹冲洖',
+ Forward: '杞氦'
+ };
+ // 鍏滃簳锛氭湭鐭ュ�艰繑鍥炩�滄湭鐭ユ搷浣溾��
+ return typeMap[auditType] || '鏈煡鎿嶄綔';
+ },
+ countTodayTask(){
+ countTodayTask().then(res =>{
+ if (res.code === 200){
+ this.todayTasks = res.data.todayTasks;
+ this.todaySchedules = res.data.todaySchedules;
+ this.totalActiveTasks = res.data.totalActiveTasks;
+ }
+ })
+ },
+ // 鑾峰緱涓嬫媺椤圭洰鏁版嵁
+ initSelect(){
+ getProjectSelectList().then(res =>{
+ if (res.code === 200){
+ this.allProjects = Object.entries(res.data).map(([id, name]) => ({
+ id: id, // 椤圭洰ID锛堝"151"锛�
+ name: name // 椤圭洰鍚嶇О锛堝"灏勬椽甯備竾鏋楅挗鍘傜墖鍖烘鎴峰尯鏀归�犻」鐩�"锛�
+ }));
+ }
+ })
+ },
+ // 鑾峰緱涓婃姤鍒楄〃鏁版嵁
+ getReportList(){
+ if (this.reportRefreshing){
+ return
+ }
+ const form ={
+ startTime: getDayStartAndEnd(this.reportCalendarDate).startTime,
+ endTime: getDayStartAndEnd(this.reportCalendarDate).endTime,
+ projectId:this.activeProject
+ }
+ this.reportLoading = true;
+ this.reportRefreshing = true;
+ // 鍚庣鎺ュ彛鑾峰緱鏁版嵁
+ reportByDate(form).then(res =>{
+ this.reportRefreshing = false;
+ this.reportLoading = false;
+ if (res.code === 200){
+ this.reports = res.data;
+ }
+ })
+ },
+ // 鑾峰緱鏃ョ▼鍒楄〃鏁版嵁
+ getScheduleList(){
+ if (this.scheduleRefreshing){
+ return
+ }
+ const form ={
+ completedTime:formatDateToFrontend(this.calendarDate),
+ projectId:this.activeProject
+ }
+ this.scheduleLoading = true
+ this.scheduleRefreshing = true
+ listByDate(form).then(res =>{
+ this.scheduleRefreshing = false
+ this.scheduleLoading = false
+ if (res.code === 200){
+ this.schedules = res.data;
+ }
+ })
+ },
+
+ async submitSaveSchedule(){
+ this.$refs.scheduleFormRef.validate((valid, fields) => {
+ if (valid) {
+ console.log(this.scheduleForm.id)
+ if (this.scheduleForm.id === null || this.scheduleForm.id ==='' || this.scheduleForm.id === undefined){
+ const submitData = {
+ content: this.scheduleForm.content,
+ completedTime: formatDateToFrontend(this.scheduleForm.completedTime),
+ projectId:this.scheduleForm.projectId
+ };
+ this.$message.success('琛ㄥ崟鎻愪氦鎴愬姛锛�');
+ add(submitData).then(res =>{
+ if (res.code === 200){
+ this.scheduleDialogVisible = false;
+ this.$message.success('鏂板鏃ョ▼鎴愬姛')
+ //鍒锋柊鍒楄〃
+ this.getScheduleList();
+ }
+ })
+ }else {
+ const submitData = {
+ id:this.scheduleForm.id,
+ content: this.scheduleForm.content,
+ completedTime: formatDateToFrontend(this.scheduleForm.completedTime),
+ projectId:this.scheduleForm.projectId
+ };
+ this.$message.success('琛ㄥ崟鎻愪氦鎴愬姛锛�');
+ update(submitData).then(res =>{
+ if (res.code === 200){
+ this.scheduleDialogVisible = false;
+ this.$message.success('缂栬緫鏃ョ▼鎴愬姛')
+ //鍒锋柊鍒楄〃
+ this.getScheduleList();
+ }
+ })
+
+ }
+ }else {
+ const firstError = Object.values(fields)[0][0].message;
+ this.$message.error(firstError);
+ }
+
+
+ });
+ },
+ handleAddSchedule() {
+ this.resetScheduleForm();
+ this.scheduleDialogVisible = true;
+ this.diaLogTitle = "鏂板鏃ュ織"
+ },
+ handleEditSchedule(row){
+ this.resetScheduleForm();
+ this.scheduleDialogVisible = true;
+ this.diaLogTitle = "缂栬緫鏃ュ織"
+ //璧嬪��
+ this.scheduleForm.id = row.id;
+ this.scheduleForm.content = row.title;
+ this.scheduleForm.projectId = row.projectId +"";
+ this.scheduleForm.completedTime = new Date(row.completedTime);
+ console.log(row)
+ },
+ // 鏂板锛氶噸缃柊澧炶〃鍗�
+ resetScheduleForm() {
+ this.scheduleForm = {
+ if:'',
+ content: '',
+ completedTime: ''
+ };
+ // 閲嶇疆琛ㄥ崟鏍¢獙鐘舵��
+ if (this.$refs.scheduleFormRef) {
+ this.$refs.scheduleFormRef.resetFields();
+ }
+ },
+ resetReportForm() {
+ this.reportForm = {
+ projectId: '',
+ content: '',
+ fileUrl: []
+ };
+ if (this.$refs.reportFormRef) {
+ this.$refs.reportFormRef.resetFields();
+ }
+ },
+ submitReport() {
+
+ this.$refs.reportFormRef.validate(valid => {
+ if (valid) {
+ const matchItem = this.allProjects.find(item => item.id === this.reportForm.projectId);
+ let files=[];
+
+ this.reportForm.fileUrl.forEach(item =>{
+ if (item.url !== null || itme.url !== '')
+ files.push(item.url)
+ })
+ const submitData = {
+ projectId: Number(this.reportForm.projectId),
+ content: this.reportForm.content,
+ projectName:matchItem.name,
+ fileUrl: files
+ };
+
+ this.$message.success('涓婃姤鍐呭宸插噯澶囧氨缁�');
+ this.reportDialogVisible = false;
+ addReport(submitData).then(res =>{
+ if (res.code === 200){
+ this.getReportList();
+ }
+ })
+ } else {
+ this.$message.error('璇峰畬鍠勪笂鎶ヤ俊鎭�');
+ }
+ });
+ },
+ addProject(){
+ this.$router.push({path: '/projectEngineering/project/ProjectDetails'});
+ },
+ handleSizeChange(val) {
+ this.waitTaskQuery.pageSize = val;
+ },
+ handleCurrentChange(val) {
+ this.waitTaskQuery.currentPage = val;
+ this.getWaitTaskList();
+ },
+ auditHistoryHandleCurrentChange(val) {
+ this.auditHistoryTotal.currentPage = val;
+ this.getAuditHistoryPage();
+ },
+ getAuditHistoryPage(){
+ if (this.auditHistoryRefreshing)return;
+ this.auditHistoryLoading = true;
+ const form ={
+ pageSize:this.auditHistoryQuery.pageSize,
+ currentPage:this.auditHistoryQuery.currentPage,
+ projectId:this.activeProject
+ }
+ this.auditHistoryRefreshing = true
+ auditHistoryPage(form).then(res =>{
+ this.auditHistoryLoading = false;
+ this.auditHistoryRefreshing = false;
+ if (res.code === 200){
+ this.logs = res.data;
+ this.auditHistoryTotal = res.total;
+ }
+ })
+
+ },
+ getWaitTaskList(){
+ if (this.waitTaskRefreshing) return;
+ this.waitTaskRefreshing = true;
+ const form ={
+ pageSize:this.waitTaskQuery.pageSize,
+ currentPage:this.waitTaskQuery.currentPage,
+ id:this.activeProject
+ }
+ this.loading = true;
+ getWaitTaskList(form).then(res=>{
+ this.loading = false;
+ this.waitTaskRefreshing = false;
+ if (res.code === 200){
+ this.tasks = res.data;
+ this.waitTaskTotal = res.total;
+ }
+
+ })
+ },
+ getProjectList(){
+ getProjectList().then(res =>{
+ if (res.code === 200){
+ this.projects = res.data;
+ }
+ })
+ },
+ initData() {
+ this.getProjectList();
+ this.getWaitTaskList();
+ this.getCountAchievements();
+ },
+ getCountAchievements(){
+ getCountAchievements().then(res =>{
+ // 涓汉鎴愬氨
+ if (res.code === 200){
+ this.achievements = res.data;
+ }
+ })
+
+ },
+ getCurrentTimePeriod() {
+ // 鑾峰彇褰撳墠鏃堕棿鐨勫皬鏃跺拰鍒嗛挓
+ const now = new Date();
+ const hours = now.getHours();
+
+ // 鎸夊尯闂村垽鏂�
+ if (hours >= 0 && hours < 6) {
+ // 0:00 - 5:59 涓哄噷鏅�
+ return "鍑屾櫒濂�";
+ } else if (hours >= 6 && hours < 12) {
+ // 6:00 - 11:59 涓烘棭涓�
+ return "鏃╀笂濂�";
+ } else if (hours >= 12 && hours < 14) {
+ // 12:00 - 13:59 涓轰腑鍗�
+ return "涓崍濂�";
+ } else if (hours >= 14 && hours < 18) {
+ // 14:00 - 17:59 涓轰笅鍗�
+ return "涓嬪崍濂�";
+ } else {
+ // 18:00 - 23:59 涓烘櫄涓�
+ return "鏅氫笂濂�";
+ }
+ },
// 鎴柇杩囬暱鐨勯」鐩悕绉�
truncateProjectName(name) {
const maxLength = 10; // 鏈�澶ф樉绀洪暱搴�
@@ -291,20 +905,10 @@
isProjectNameTooLong(name) {
return name.length > 10;
},
- formatDate(date) {
- const year = date.getFullYear();
- const month = date.getMonth() + 1;
- const day = date.getDate();
- return `${year}骞�${month}鏈�${day}鏃;
- },
- formatCalendarDate(date) {
- const year = date.getFullYear();
- const month = (date.getMonth() + 1).toString().padStart(2, '0');
- const day = date.getDate().toString().padStart(2, '0');
- return `${year}-${month}-${day}`;
- },
handleProjectSelect(index) {
this.activeProject = index;
+ console.log(this.activeProject)
+ this.getWaitTaskList();
// 杩欓噷鍙互娣诲姞椤圭洰绛涢�夐�昏緫
},
getPriorityType(priority) {
@@ -315,19 +919,70 @@
default: return 'info';
}
},
- handleTaskEdit(task) {
- console.log('缂栬緫浠诲姟:', task);
- this.$message.info(`寮�濮嬪鐞嗕换鍔�: ${task.name}`);
+ handleTaskEdit(row) {
+ console.log(row)
+ this.queryParams.projectId = row.checkPointInfo.id +"";
+ this.queryParams.processDefId = row.checkPointInfo.processDefinitionId;
+ this.queryParams.processInsId = row.checkPointInfo.processInstanceId;
+ this.queryParams.deployId = row.checkPointInfo.deployId;
+ this.queryParams.processName = row.checkPointInfo.processName;
+
+ console.log(this.queryParams)
+
+ if (row.taskType === '瀹圭己') {
+ this.$router.push({
+ path: '/flowable/task/myProcess/send/index',
+ query: {
+ deployId: row.checkPointInfo.deployId,
+ procDefId: row.checkPointInfo.processDefinitionId,
+ procInsId: row.checkPointInfo.processInstanceId,
+ processName: row.taskName,
+ flowName: row.checkPointInfo.processName,
+ projectName: row.checkPointInfo.projectName,
+ taskId: row.id,
+ showAuditing: false,
+ projectId: row.checkPointInfo.id,
+ isWait: true,
+ goBackParams: this.queryParams
+ }
+ })
+ } else {
+ // 鏌ヨ璇ヤ换鍔℃槸鍚﹂厤缃簡闇�瑕佸鎵�
+ let params = {
+ processDefId: row.checkPointInfo.processDefinitionId,
+ taskId: row.id
+ }
+ getTaskIsAuditing(params).then(res => {
+ console.log("row",row)
+ this.$router.push({
+ path: '/flowable/task/myProcess/send/index',
+ query: {
+ deployId: row.checkPointInfo.deployId,
+ procDefId: row.checkPointInfo.processDefinitionId,
+ procInsId: row.checkPointInfo.processInstanceId,
+ processName: row.taskName,
+ flowName: row.checkPointInfo.processName,
+ projectName: row.checkPointInfo.projectName,
+ taskId: row.id,
+ showAuditing: res.data,
+ projectId: row.checkPointInfo.id,
+ isWait: false,
+ goBackParams: this.queryParams
+ }
+ })
+ })
+ }
},
+ // 鑾峰緱璁℃暟
+ getReportCount(date){
+ const dateStr = formatCalendarDate(date);
+ return this.reports.filter(s => s.date === dateStr).length;
+
+ },
+
getScheduleCount(date) {
- const dateStr = this.formatCalendarDate(date);
+ const dateStr = formatCalendarDate(date);
return this.schedules.filter(s => s.date === dateStr).length;
- },
- handleAddSchedule() {
- this.$message.info('鏂板鏃ョ▼');
- },
- handleEditSchedule(schedule) {
- this.$message.info(`缂栬緫鏃ョ▼: ${schedule.title}`);
},
handleDeleteSchedule(schedule) {
this.$confirm('纭畾鍒犻櫎璇ユ棩绋嬪悧?', '鎻愮ず', {
@@ -335,7 +990,12 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- this.$message.success('鍒犻櫎鎴愬姛');
+ del(schedule.id).then(res =>{
+ if (res.code === 200){
+ this.$message.success('鍒犻櫎鎴愬姛锛�');
+ }
+ this.getScheduleList()
+ })
}).catch(() => {
this.$message.info('宸插彇娑堝垹闄�');
});
@@ -345,6 +1005,12 @@
</script>
<style scoped>
+.pagination-container {
+ margin-top: 20px;
+ padding-right: 5px;
+ text-align: center;
+ width: 100%;
+}
.dashboard-container {
font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
height: 100vh;
@@ -453,6 +1119,7 @@
}
.center-content {
+
flex: 1;
padding: 15px;
overflow-y: auto;
@@ -476,13 +1143,14 @@
.task-section {
margin-bottom: 20px;
- height: 350px;
+ height: 450px;
}
.log-list {
border: 1px solid #ebeef5;
border-radius: 4px;
padding: 10px;
+ min-height: 100px;
}
.log-item {
@@ -569,7 +1237,7 @@
}
.schedule-count {
- font-size: 12px;
+ font-size: 10px;
color: #1e88e5;
margin-top: 2px;
}
@@ -582,7 +1250,7 @@
}
.calendar-section >>> .el-calendar-table .el-calendar-day {
- height: 40px !important; /* 璁剧疆姣忔棩鍗曞厓鏍奸珮搴� */
+ height: 45px !important; /* 璁剧疆姣忔棩鍗曞厓鏍奸珮搴� */
padding: 0 !important;
}
.calendar-section >>> .el-calendar__header {
@@ -593,4 +1261,34 @@
padding: 0 !important;
border: none !important;
}
+.report-btn {
+ background: linear-gradient(135deg, #409eff, #1e88e5) !important;
+ border: none !important;
+ border-radius: 20px !important;
+ padding: 6px 16px !important;
+ color: white !important;
+ font-weight: 500 !important;
+ box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3) !important;
+ transition: all 0.3s ease !important;
+ height: 32px !important;
+ margin-left: 10px;
+}
+.report-btn:hover {
+ background: linear-gradient(135deg, #66b1ff, #409eff) !important;
+ box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4) !important;
+ transform: translateY(-1px);
+}
+
+.report-btn:active {
+ background: linear-gradient(135deg, #1e88e5, #0d6efd) !important;
+ box-shadow: 0 2px 6px rgba(64, 158, 255, 0.2) !important;
+ transform: translateY(0);
+}
+
+.report-btn:disabled {
+ background: #e0e0e0 !important;
+ color: #999 !important;
+ box-shadow: none !important;
+ transform: none !important;
+}
</style>
--
Gitblit v1.8.0