Browse Source

no message

linwenxin 5 months ago
parent
commit
ac386183a9
1 changed files with 12 additions and 16 deletions
  1. 12 16
      src/packageMine/pages/workerEnter.vue

+ 12 - 16
src/packageMine/pages/workerEnter.vue

@@ -415,19 +415,18 @@ export default {
 
   computed: {
     idCardEndTimeMin() {
-      return this.idCardStateTime ? new Date(this.idCardStateTime + ' 23:59:59').getTime() : ''
+      return this.idCardStateTime ? new Date(this.idCardStateTime + 'T23:59:59').getTime() : ''
     },
     altitudeDocumentEndTimeMin() {
-      return this.altitudeDocumentStateTime ? new Date(this.altitudeDocumentStateTime + ' 23:59:59').getTime() : ''
+      return this.altitudeDocumentStateTime ? new Date(this.altitudeDocumentStateTime + 'T23:59:59').getTime() : ''
     },
     insuranceEndTimeMin() {
-      return this.insuranceStateTime ? new Date(this.insuranceStateTime + ' 23:59:59').getTime() : ''
+      return this.insuranceStateTime ? new Date(this.insuranceStateTime + 'T23:59:59').getTime() : ''
     },
     altitudeDocumentEndTimeMAX() {
-      return this.altitudeDocumentEndTime ? new Date(this.altitudeDocumentEndTime + ' 23:59:59').getTime() : ''
+      return this.altitudeDocumentEndTime ? new Date(this.altitudeDocumentEndTime + 'T23:59:59').getTime() : ''
     }
   },
-
   methods: {
     getUser() {
       this.$api
@@ -518,17 +517,14 @@ export default {
         ) {
           this.$tips('高空证信息需要完整!')
           return false
-        } else if (
-          this.reexamineTime &&
-          this.altitudeDocumentStateTime &&
-          this.altitudeDocumentEndTime &&
-          (new Date(this.reexamineTime + ' 23:59:59').getTime() <
-            new Date(this.altitudeDocumentStateTime + ' 00:00:00').getTime() ||
-            new Date(this.reexamineTime + ' 23:59:59').getTime() >
-              new Date(this.altitudeDocumentEndTime + ' 23:59:59').getTime())
-        ) {
-          this.$tips('复审日期必须包含在有效期内!')
-          return false
+        } else if (this.reexamineTime && this.altitudeDocumentStateTime && this.altitudeDocumentEndTime) {
+          const reexamineEndTime = new Date(this.reexamineTime + 'T23:59:59').getTime()
+          const altitudeDocumentStartTime = new Date(this.altitudeDocumentStateTime + 'T00:00:00').getTime()
+          const altitudeDocumentEndTime = new Date(this.altitudeDocumentEndTime + 'T23:59:59').getTime()
+          if (reexamineEndTime < altitudeDocumentStartTime || reexamineEndTime > altitudeDocumentEndTime) {
+            this.$tips('复审日期必须包含在有效期内!')
+            return false
+          }
         }
       } else {
         this.altitudeDocumentNumber = ''