Kaynağa Gözat

添加履职未开始提醒

gaoxiong 1 yıl önce
ebeveyn
işleme
088be06d81
1 değiştirilmiş dosya ile 14 ekleme ve 2 silme
  1. 14 2
      src/views/menu/resumption/list.vue

+ 14 - 2
src/views/menu/resumption/list.vue

@@ -17,7 +17,7 @@
                     :title="v.planName"
                     :label="formatTime(v.planStartTime,v.planEndTime,'HH:mm')"
                     is-link
-                    :to="{path:path,query:{id:v.id,enable:1,taskDate:date}}"
+                    @click="onClick(path,v.id,date,v.planStartTime)"
                     :value-class="`title-orange`">
                     <template #right-icon>
                       <span :style="{ color: getState(getDictLabel(v.status, 'resumption_status')) }">
@@ -77,7 +77,7 @@
                     :title="v.planName"
                     :label="formatTime(v.planStartTime,v.planEndTime,'YYYY-MM-DD')"
                     is-link
-                    :to="{path:path,query:{id:v.id,enable:1,taskDate:date}}"
+                    @click="onClick(path,v.id,date,v.planStartTime)"
                     :value-class="`title-orange`">
                     <template #right-icon>
                       <span :style="{ color: getState(getDictLabel(v.status, 'resumption_status')) }">
@@ -190,6 +190,18 @@ export default {
     })
   },
   methods:{
+    onClick(path,id,date,planStartTime){
+      let now = new Date();
+      let start = new Date(planStartTime);
+      if(now > start){
+        this.$router.push({path:path,query:{id:id,enable:1,taskDate:date}})
+      }else{
+        this.$toast.fail({
+          message: '任务未到开始时间!',
+          position: 'top'
+        })
+      }
+    },
     getState(state) {
       switch (state) {
         case '待履职':