From 28c16471c755aea06086e0033574ce40649dc8aa Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Mon, 21 Oct 2024 18:56:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eightMembers/shortageSituation.vue | 168 +++++++++++++----- src/views/report/attReport/index.vue | 36 ++-- src/views/report/attReport/record.vue | 31 +++- 3 files changed, 170 insertions(+), 65 deletions(-) diff --git a/src/views/process/eightMembers/shortageSituation.vue b/src/views/process/eightMembers/shortageSituation.vue index b7b568e..89b5fec 100644 --- a/src/views/process/eightMembers/shortageSituation.vue +++ b/src/views/process/eightMembers/shortageSituation.vue @@ -25,15 +25,99 @@ - - - - - - - - - + + + + {{ scope.row.projectManager }} + + {{ scope.row.projectManager }} + + + + + + + {{ scope.row.safetyOfficer }} + + {{ scope.row.safetyOfficer }} + + + + + + + + {{ scope.row.qualityInspector }} + + {{ scope.row.qualityInspector }} + + + + + + {{ scope.row.chiefEngineer }} + + {{ scope.row.chiefEngineer }} + + + + + + {{ scope.row.mechanicalStaff }} + + {{ scope.row.mechanicalStaff }} + + + + + + {{ scope.row.documentStaff }} + + {{ scope.row.documentStaff }} + + + + + + {{ scope.row.constructionStaff }} + + {{ scope.row.constructionStaff }} + + + + + + {{ scope.row.materialStaff }} + + {{ scope.row.materialStaff }} + + + + + + {{ scope.row.other }} + + {{ scope.row.other }} + + @@ -46,39 +130,31 @@ /> - + - - - - - - - - - - + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/src/views/report/attReport/record.vue b/src/views/report/attReport/record.vue index 23ca8b3..f7b69eb 100644 --- a/src/views/report/attReport/record.vue +++ b/src/views/report/attReport/record.vue @@ -291,7 +291,7 @@ export default { openReason: false, dialogList:[], // 日期范围 - dateRange: this.getDefaultDateRange(), + dateRange:[], reasonStr:undefined, deptOptions: [], // 查询参数 @@ -309,15 +309,33 @@ export default { console.log(this.$route.query.param) this.queryParams.userName=this.$route.query.param } + this.getWeekDates(); this.getDeptList(); this.getList(); }, methods: { - getDefaultDateRange() { - const today = new Date(); - const start = new Date(today.toISOString().split('T')[0]); // 移除时间部分,只保留日期 - const end = new Date(today.toISOString().split('T')[0]); // 同样只保留日期 - return [start, end]; + getWeekDates() { + const now = new Date(); + const dayOfWeek = now.getDay(); + const dayOffset = dayOfWeek === 0 ? -6 : 1 - dayOfWeek; + + const monday = new Date(now); + monday.setDate(monday.getDate() + dayOffset); + + const sunday = new Date(monday); + sunday.setDate(sunday.getDate() + 6); + this.dateRange[0]=monday.toISOString().split('T')[0]; + this.dateRange[1]=sunday.toISOString().split('T')[0]; + }, + formatDate(dateString){ + const date = new Date(dateString); // 创建日期对象 + const year = date.getFullYear(); // 获取年份 + const month = String(date.getMonth() + 1).padStart(2, '0'); // 获取月份(注意:月份从0开始) + const day = String(date.getDate()).padStart(2, '0'); // 获取日期 + const weekdays = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']; // 星期几数组 + const weekday = weekdays[date.getDay()]; // 获取星期几 + + return `${year}-${month}-${day} ${weekday}`; // 组合成所需格式 }, getDeptList() { listDept().then(response => { @@ -360,6 +378,7 @@ export default { }, /** 重置按钮操作 */ resetQuery() { + this.getWeekDates(); this.resetForm("queryForm"); this.handleQuery(); }, From e73ed8647029990cab95ce9b1e758002c516ed23 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Tue, 22 Oct 2024 13:01:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/exceptionHandle/errorData/index.vue | 3 +++ src/views/exceptionHandle/errorForm/index.vue | 4 ++++ src/views/report/monthlyError/index.vue | 2 ++ 3 files changed, 9 insertions(+) diff --git a/src/views/exceptionHandle/errorData/index.vue b/src/views/exceptionHandle/errorData/index.vue index f0b3793..470d9e3 100644 --- a/src/views/exceptionHandle/errorData/index.vue +++ b/src/views/exceptionHandle/errorData/index.vue @@ -255,6 +255,9 @@ // 表单重置 reset() { this.queryForm = {}; + const lastMonth = new Date(); + lastMonth.setMonth(lastMonth.getMonth() - 1) + this.searchAttCurrentMonth = lastMonth; this.resetForm("queryForm"); this.getList(); }, diff --git a/src/views/exceptionHandle/errorForm/index.vue b/src/views/exceptionHandle/errorForm/index.vue index 0ac65bf..ddbcbcd 100644 --- a/src/views/exceptionHandle/errorForm/index.vue +++ b/src/views/exceptionHandle/errorForm/index.vue @@ -379,7 +379,11 @@ reset() { // this.searchAttCurrentMonth = ''; // this.queryParams.attCurrentMonth = null; + this.queryForm = {}; + const lastMonth = new Date(); + lastMonth.setMonth(lastMonth.getMonth() - 1) + this.searchAttCurrentMonth = lastMonth; this.resetForm("queryForm"); this.getList(); diff --git a/src/views/report/monthlyError/index.vue b/src/views/report/monthlyError/index.vue index 6ebc7b5..c39f31e 100644 --- a/src/views/report/monthlyError/index.vue +++ b/src/views/report/monthlyError/index.vue @@ -386,8 +386,10 @@ //打开月异常详情页面 openRecord(row,titleBoss){ this.id = row.id; + this.title = titleBoss; this.queryRecord.userId = row.userId; + this.queryRecord.orgId = row.orgId; this.queryRecord.attCurrent = row.attCurrentMonth; if(titleBoss=='打卡记录'){ this.queryRecord.attStatis=1;