Browse Source

修改装置程序清单修订日期-下次修订日期

jiangbiao 3 years ago
parent
commit
efc81ce938
1 changed files with 15 additions and 1 deletions
  1. 15 1
      ui/src/views/components/PlantProgList/index.vue

+ 15 - 1
ui/src/views/components/PlantProgList/index.vue

@@ -734,7 +734,21 @@ export default {
     },
     //根据修订日期生成其他日期
     changeRevisionDate() {
-      var nexteditdate = Date.parse(this.form.filedate) + (3 * 365 * 24 * 3600 * 1000)
+      const filename = this.form.filename;
+      var nexteditdate="";
+      if (filename.indexOf("应急响应")!=-1) {
+        if(this.form.filedate.endsWith("02-29")){
+          nexteditdate=dayjs(new Date(this.form.filedate)).add(1,'year').format("YYYY-MM-DD");
+        }else{
+          nexteditdate=dayjs(new Date(this.form.filedate)).add(1,'year').subtract(1,'day').format("YYYY-MM-DD");
+        }
+      }else {
+        if(this.form.filedate.endsWith("02-29")){
+          nexteditdate=dayjs(new Date(this.form.filedate)).add(3,'year').format("YYYY-MM-DD");
+        }else{
+          nexteditdate=dayjs(new Date(this.form.filedate)).add(3,'year').subtract(1,'day').format("YYYY-MM-DD");
+        }
+      }
       var nextedit = new Date(nexteditdate);
       this.form.nexteditdate = formatDate(nextedit,'yyyy-MM-dd')
       // var reviewdate = Date.parse(this.form.filedate) + (1 * 365 * 24 * 3600 * 1000)