浏览代码

修改作息提交报错问题

凉纪 1 年之前
父节点
当前提交
39365e0d62
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      src/views/system/workTimeSet/dialog.add.vue

+ 6 - 4
src/views/system/workTimeSet/dialog.add.vue

@@ -346,10 +346,11 @@ export default {
       //判断是否有重复的日期
       let dateList = [];
       console.log(this.workTimeList, "this.workTimeList");
-      // let workTimeList = JSON.parse(JSON.stringify(this.workTimeList))
-      let workTimeList = this.workTimeList;
-      for (let v of workTimeList) {
+      let workTimeList = JSON.parse(JSON.stringify(this.workTimeList))
+      //let workTimeList = this.workTimeList;
+      for (let v of this.workTimeList) {
         if (v.ymdDate) {
+          console.log(v,'vvvvv')
           let date = this.formatTime(v.ymdDate, "YYYY-MM-DD");
           if (dateList.indexOf(date) > -1) {
             this.$message.error(`日期: ${date} 重复`);
@@ -360,8 +361,9 @@ export default {
       }
       // 校验
       for (let workTime of workTimeList) {
+        console.log(workTime,'workTime')
         const adjustedDate = new Date(
-          workTime.ymdDate.getTime() + 8 * 60 * 60 * 1000
+          dayjs(workTime.ymdDate).toDate().getTime() + 8 * 60 * 60 * 1000
         );
         workTime.ymdDate = adjustedDate.toISOString().split("T")[0];
         if (!this.check(workTime)) {