From 127983bf9d28339110156cac9cb5b894d108fdc3 Mon Sep 17 00:00:00 2001 From: Vergil <974548713@qq.com> Date: Wed, 1 Apr 2020 16:23:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=85=AC=E7=A4=BA=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/tool.js | 45 +++++++++++++++++++ .../ManHourStatistics/index.vue | 5 ++- .../ProductionPlanQuery/index.vue | 11 +---- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src/utils/tool.js b/src/utils/tool.js index a1f1afe9..9aa12052 100644 --- a/src/utils/tool.js +++ b/src/utils/tool.js @@ -71,6 +71,51 @@ export function getNowTime1() { const time = date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second return time } +// 工时统计上个月26-本月25 +export function getTime26() { + const date = new Date() + const day = date.getDate() + if (day >= 25) { + var month = zeroFill(date.getMonth() + 1) + if (month === 0) { + month = 12 + const day = 26 + const time = date.getFullYear() - 1 + '-' + month + '-' + day + return time + } else { + const day = 26 + const time = date.getFullYear() + '-' + month + '-' + day + return time + } + } else { + var month2 = zeroFill(date.getMonth() + 1) - 1 + if (month2 === 0) { + month2 = 12 + const day = 26 + const time = date.getFullYear() - 1 + '-' + month2 + '-' + day + return time + } else { + const day = 26 + const time = date.getFullYear() + '-' + month2 + '-' + day + return time + } + } +} +export function getTime25() { + const date = new Date() + const day = date.getDate() + if (day >= 25) { + const month = zeroFill(date.getMonth() + 2) + const day2 = 25 + const time = date.getFullYear() + '-' + month + '-' + day2 + return time + } else { + const month = zeroFill(date.getMonth() + 1) + const day2 = 25 + const time = date.getFullYear() + '-' + month + '-' + day2 + return time + } +} // 判断类型 export function type(target) { const ret = typeof (target) diff --git a/src/views/ManufacturingCenter/ManHourStatistics/index.vue b/src/views/ManufacturingCenter/ManHourStatistics/index.vue index ab1a3c0f..d582167c 100644 --- a/src/views/ManufacturingCenter/ManHourStatistics/index.vue +++ b/src/views/ManufacturingCenter/ManHourStatistics/index.vue @@ -139,11 +139,12 @@