Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

11868 vor 1 Tag
Ursprung
Commit
2d060c13dc

+ 26 - 34
src/views/grassrootsregistration/bdgleven/index.vue

@@ -487,38 +487,29 @@ export default {
   },
   methods: {
     timeDay(val) {
-      var date1 = Math.round(new Date(val) / 1000);
-      // 当月时间
-      this.current_month.forEach(element => {
-        // 十号之前是1678406400
-        var date2 = Math.round(new Date(element) / 1000);
-        if (date1 > 1678406400 && this.dayTime == 1) {
-          this.$confirm("请在规定时间内填写", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
-            .then(() => {
-              this.form.convokeTime = null;
-            })
-            .catch(() => {
-              this.form.convokeTime = null;
-            });
-        }
-        if (date1 < 1675180250 && this.dayTime == 1) {
-          this.$confirm("请在规定时间内填写", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
-            .then(() => {
-              this.form.convokeTime = null;
-            })
-            .catch(() => {
-              this.form.convokeTime = null;
-            });
-        }
-      });
+    // 如果没有选择日期或时间限制未开启,则不进行验证
+    if (!val || this.dayTime != 1) return;
+    
+    const selectedDate = new Date(val);
+    selectedDate.setHours(0, 0, 0, 0);
+    const selectedTimestamp = selectedDate.getTime();
+    
+    // 获取明天的日期
+    const tomorrow = new Date();
+    tomorrow.setHours(0, 0, 0, 0);
+    tomorrow.setDate(tomorrow.getDate() + 1);
+    
+    // 如果选择的日期在明天及之后,则提示并清空选择
+    if (selectedTimestamp >= tomorrow.getTime()) {
+      this.$confirm("会议时间不能晚于明天,请重新选择", "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
+        }).then(() => {
+          this.form.convokeTime = null;
+        }).catch(() => {
+          this.form.convokeTime = null;
+        });
+      }
     },
     // 获取当月日期
     getDay() {
@@ -759,6 +750,8 @@ export default {
         if (response.data.fileUrl != null) {
           if (response.data.fileUrl != "") {
             this.arr = response.data.fileUrl.split(",");
+          }
+        }
             this.tiemse = response.data.convokeTime;
             this.huiYiList.map(item => {
               if (item.dictValue == response.data.meetingForm) {
@@ -768,8 +761,7 @@ export default {
             this.title = "查看连务会记录本";
             this.menuRoleVisible = true;
             return this.name;
-          }
-        }
+
       });
     },
 

+ 23 - 32
src/views/grassrootsregistration/bdglmeeting/index.vue

@@ -647,38 +647,29 @@ export default {
       }
     },
     timeDay(val) {
-      var date1 = Math.round(new Date(val) / 1000);
-      // 当月时间
-      this.current_month.forEach((element) => {
-        // 十号之前是1675987200
-        var date2 = Math.round(new Date(element) / 1000);
-        if (date1 > 1678406400 && this.dayTime == 1) {
-          this.$confirm("请在规定时间内填写", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning",
-          })
-            .then(() => {
-              this.form.convokeTime = null;
-            })
-            .catch(() => {
-              this.form.convokeTime = null;
-            });
-        }
-        if (date1 < 1675180250 && this.dayTime == 1) {
-          this.$confirm("请在规定时间内填写", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning",
-          })
-            .then(() => {
-              this.form.convokeTime = null;
-            })
-            .catch(() => {
-              this.form.convokeTime = null;
-            });
-        }
-      });
+    // 如果没有选择日期或时间限制未开启,则不进行验证
+    if (!val || this.dayTime != 1) return;
+    
+    const selectedDate = new Date(val);
+    selectedDate.setHours(0, 0, 0, 0);
+    const selectedTimestamp = selectedDate.getTime();
+    
+    // 获取明天的日期
+    const tomorrow = new Date();
+    tomorrow.setHours(0, 0, 0, 0);
+    tomorrow.setDate(tomorrow.getDate() + 1);
+    
+    // 如果选择的日期在明天及之后,则提示并清空选择
+    if (selectedTimestamp >= tomorrow.getTime()) {
+      this.$confirm("会议时间不能晚于明天,请重新选择", "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
+        }).then(() => {
+          this.form.convokeTime = null;
+        }).catch(() => {
+          this.form.convokeTime = null;
+        });
+      }
     },
     // 翻译
     meetingFormFn(row) {

+ 23 - 32
src/views/grassrootsregistration/bdglparty/index.vue

@@ -601,38 +601,29 @@ export default {
       }
     },
     timeDay(val) {
-      var date1 = Math.round(new Date(val) / 1000);
-      // 当月时间
-      this.current_month.forEach((element) => {
-        // 十号之前是1675987200
-        var date2 = Math.round(new Date(element) / 1000);
-        if (date1 > 1678406400 && this.dayTime == 1) {
-          this.$confirm("请在规定时间内填写", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning",
-          })
-            .then(() => {
-              this.form.convokeTime = null;
-            })
-            .catch(() => {
-              this.form.convokeTime = null;
-            });
-        }
-        if (date1 < 1675180250 && this.dayTime == 1) {
-          this.$confirm("请在规定时间内填写", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning",
-          })
-            .then(() => {
-              this.form.convokeTime = null;
-            })
-            .catch(() => {
-              this.form.convokeTime = null;
-            });
-        }
-      });
+    // 如果没有选择日期或时间限制未开启,则不进行验证
+    if (!val || this.dayTime != 1) return;
+    
+    const selectedDate = new Date(val);
+    selectedDate.setHours(0, 0, 0, 0);
+    const selectedTimestamp = selectedDate.getTime();
+    
+    // 获取明天的日期
+    const tomorrow = new Date();
+    tomorrow.setHours(0, 0, 0, 0);
+    tomorrow.setDate(tomorrow.getDate() + 1);
+    
+    // 如果选择的日期在明天及之后,则提示并清空选择
+    if (selectedTimestamp >= tomorrow.getTime()) {
+      this.$confirm("会议时间不能晚于明天,请重新选择", "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
+        }).then(() => {
+          this.form.convokeTime = null;
+        }).catch(() => {
+          this.form.convokeTime = null;
+        });
+      }
     },
     // 翻译
     meetingFormFn(row) {

+ 23 - 5
src/views/grassrootsregistration/statistics/index.vue

@@ -213,7 +213,7 @@
             value-format="yyyy-MM-dd"
           ></el-date-picker>
         </el-form-item>
-        <FileUpload v-model="fielList" :limit="1" />
+        <FileUpload v-model="fielList" :limit="1" @input="getFileList" />
         <!-- <el-form-item label="上传文件" prop="unitName">
           <el-input v-model="form.unitName" placeholder="请输入单位名称" />
         </el-form-item>-->
@@ -348,6 +348,7 @@ export default {
           docx.renderAsync(data, this.$refs.file); // 渲染到页面预览
         });
       } else {
+        console.log(row.actualArrival);
         this.$modal.msgWarning("只能阅读word文档");
       }
     },
@@ -415,9 +416,14 @@ export default {
       const id = row.id || this.ids;
       getStatistics(id).then(response => {
         this.form = response.data;
-        this.fielList = [
-          { name: response.data.fileName, url: response.data.filePath }
-        ];
+        if(response.data.fileName != null){
+          this.fielList = [
+            { name: response.data.fileName, url: response.data.filePath }
+          ];
+        }else{
+          this.fielList = [];
+        }
+
         this.open = true;
         this.title = "修改军事训练月统计表";
       });
@@ -486,7 +492,19 @@ export default {
           this.exportLoading = false;
         })
         .catch(() => {});
-    }
+    },
+    getFileList(fileList) {
+      console.log(fileList);
+      if (fileList.length > 0) {
+        this.form.fileName = fileList[0].name;
+        this.form.filePath = fileList[0].url;
+        this.form.actualArrival = fileList[0].houZUI;
+      }else{
+        this.form.fileName = null;
+        this.form.filePath = null;
+        this.form.actualArrival = null;
+      }
+    },
   }
 };
 </script>