Browse Source

【值班系统】公告配置提醒时间配置全部配置为提前一个小时,值班人员-工作台显示提醒消息不全

CzRger 1 year ago
parent
commit
34146fd1c5
1 changed files with 14 additions and 5 deletions
  1. 14 5
      src/views/staging/zby/center/index.vue

+ 14 - 5
src/views/staging/zby/center/index.vue

@@ -76,6 +76,7 @@ import StatisticCom from './statistic.vue'
 import DailyDetailCom from '@/views/system/daily-manage/detail.vue'
 import WeeklyDetailCom from '@/views/system/weekly-manage/detail.vue'
 import {ElMessage, ElMessageBox} from "element-plus";
+import {oneDayTime} from "@/views/staging/common/handle";
 
 
 export default defineComponent({
@@ -156,17 +157,25 @@ export default defineComponent({
         }
       }
     }
+    const ratherTime = (now, time, diff) => {
+      const a = new Date(now).getTime()
+      const b = new Date(`${that.$util.YMD(now)} ${time}`).getTime() - 1000 * 60 * Number(diff)
+      return a >= b
+    }
+    const ratherTimeDaily = (now, time, diff) => {
+      const a = new Date(now).getTime()
+      const b = new Date(`${that.$util.YMD(now)} ${time}`).getTime() + oneDayTime - 1000 * 60 * Number(diff)
+      return a >= b
+    }
     const tipsCpt = computed(() => {
       let str: Array<string> = []
-      if (!store.state.app.signInfo?.id) {
+      if (!store.state.app.signInfo?.id && ratherTime(store.state.app.timestamp, store.state.app.publicConfig['sign.begin.time'], store.state.app.publicConfig['sign.remind.time'])) {
         str.push('未签到')
-      } else if (store.state.app.signInfo.type !== '2' && state.tools.now >= state.tools.signEnd) {
-        str.push('未签退')
       }
-      if (!store.state.app.dailyInfo?.id) {
+      if (!store.state.app.dailyInfo?.id && ratherTimeDaily(store.state.app.timestamp, store.state.app.publicConfig['log.submit.time'], store.state.app.publicConfig['log.remind.time'])) {
         str.push('未提交日志')
       }
-      if (store.getters['app/isWeeklyDay'] && !store.state.app.weeklyInfo?.id) {
+      if (store.getters['app/isWeeklyDay'] && !store.state.app.weeklyInfo?.id && ratherTime(store.state.app.timestamp, store.state.app.publicConfig['week.submit.time'], store.state.app.publicConfig['week.remind.time'])) {
         str.push('未提交周报')
       }
       return str.length > 0 ? `您还${str.join('/')},请尽快完成操作` : ''