Просмотр исходного кода

非公出协单,打卡优化

dev01 дней назад: 4
Родитель
Сommit
2e9e5f9d42

+ 1 - 1
src/pages/applyDepart/publicContent.jsx

@@ -1006,7 +1006,7 @@ class PublicContent extends Component {
                   Taro.showToast({ title: "请选择协单内容", icon: "none" });
                   return
                 }
-                if (this.state.assistType.indexOf('0') && !this.state.assistContent) {
+                if (this.state.assistContentType.indexOf('0') > -1 && !this.state.assistContent) {
                   Taro.showToast({ title: "请输入协单内容说明", icon: "none" });
                   return
                 }

+ 1 - 1
src/pages/egressDetails/publicContent.jsx

@@ -1301,7 +1301,7 @@ class PublicContent extends Component {
                       Taro.showToast({ title: "请选择协单内容", icon: "none" });
                       return
                     }
-                    if (this.state.assistType.indexOf('0') && !this.state.assistContent) {
+                    if (this.state.assistContentType.indexOf('0') > -1 && !this.state.assistContent) {
                       Taro.showToast({ title: "请输入协单内容说明", icon: "none" });
                       return
                     }

+ 3 - 1
src/pages/punchClock/punchClocks.jsx

@@ -264,12 +264,14 @@ class PunchClocks extends Component {
       Taro.showToast({ title: '定位错误,请联系管理员', icon: 'none' })
       return;
     }
+    console.log([5, 6].includes(dtails.type))
 
     if ([5, 6].includes(dtails.type)) {
       let nowTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
       let startTime = dayjs(dtails.releaseStarts).format('YYYY-MM-DD 00:00:00')
       let endTime = dayjs(dtails.releaseEnds).format('YYYY-MM-DD 23:59:59')
-      if (dayjs(nowTime).isAfter(dayjs(startTime)) && dayjs(nowTime).isBefore(dayjs(endTime)) ) {
+      console.log(dayjs(nowTime).isAfter(dayjs(startTime)), dayjs(nowTime).isBefore(dayjs(endTime)))
+      if (!(dayjs(nowTime).isAfter(dayjs(startTime)) && dayjs(nowTime).isBefore(dayjs(endTime)))) {
         Taro.hideLoading()
         Taro.showToast({ title: '当前时间不在打卡时间范围内,无法打卡', icon: 'none' })
         return