Browse Source

解决履职任务跨季度执行时 提示数据不存在的问题

zhulu 9 months ago
parent
commit
df5cafc876
2 changed files with 7 additions and 3 deletions
  1. 3 0
      src/views/menu/resumption/detail.vue
  2. 4 3
      src/views/menu/resumption/list.vue

+ 3 - 0
src/views/menu/resumption/detail.vue

@@ -844,6 +844,8 @@
         data.checks = this.checks
         data.nfcs = this.nfcs
         data.subType = 1
+        data.taskDate= this.$route.query.taskDate
+        
         saveTask(data).then(res => {
           // 自动保存时 不提示 保存成功,否则前一个提示会立马消失, 只有点击保存按钮时提示
           if(autoSave!==true){
@@ -950,6 +952,7 @@
           data.checks = this.checks
           data.nfcs = subNFCS
           data.subType = 2
+          data.taskDate= this.$route.query.taskDate
 
           saveTask(data).then(res => {
             this.$toast('提交成功')

+ 4 - 3
src/views/menu/resumption/list.vue

@@ -36,7 +36,7 @@
                     :title="v.planName"
                     :label="formatTime(v.planStartTime,v.planEndTime,'HH:mm')"
                     is-link
-                    :to="{path:path,query:{id:v.id,taskDate:date}}"
+                    :to="{path:path,query:{id:v.id,taskDate:dayjs(v.planStartTime).format('YYYY-MM-DD')}}"
                     :value-class="`title-green`">
                     <template #right-icon>
                       <span :style="{ color: getState(getDictLabel(v.status, 'resumption_status')) }">
@@ -97,7 +97,7 @@
                     :title="v.planName"
                     :label="formatTime(v.planStartTime,v.planEndTime,'YYYY-MM-DD')"
                     is-link
-                    :to="{path:path,query:{id:v.id,taskDate:date}}"
+                    :to="{path:path,query:{id:v.id,taskDate:dayjs(v.planStartTime).format('YYYY-MM-DD')}}"
                     :value-class="`title-green`">
                     <template #right-icon>
                       <span :style="{ color: getState(getDictLabel(v.status, 'resumption_status')) }">
@@ -196,8 +196,9 @@ export default {
     onClick(path,id,date,planStartTime){
       let now = new Date();
       let start = new Date(planStartTime);
+      let taskDate= dayjs(start).format('YYYY-MM-DD');
       if(now > start){
-        this.$router.push({path:path,query:{id:id,enable:1,taskDate:date}})
+        this.$router.push({path:path,query:{id:id,enable:1,taskDate:taskDate}})
       }else{
         this.$toast.fail({
           message: '任务未到开始时间!',