dev01 пре 3 година
родитељ
комит
d6d7d2eaf9
2 измењених фајлова са 16 додато и 5 уклоњено
  1. 15 4
      src/pages/applyDepart/publicContent.jsx
  2. 1 1
      src/pages/egressDetails/publicContent.jsx

+ 15 - 4
src/pages/applyDepart/publicContent.jsx

@@ -12,7 +12,11 @@ import {
   getWorkingHoursList,
 } from "../../utils/servers/servers";
 
-import { getHours, getNumHourse, getUserWordTimes } from "../../utils/tools";
+import {
+  getHours,
+  getNumHourse,
+  getUserWordTimes,
+} from "../../utils/tools";
 
 import "taro-ui/dist/style/components/form.scss";
 import "taro-ui/dist/style/components/button.scss";
@@ -115,7 +119,10 @@ class PublicContent extends Component {
       return;
     }
     if (this.state.totalDuration === 0) {
-      Taro.showToast({ title: "公出时间不足0小时", icon: "none" });
+      Taro.showToast({
+        title: "请选择公出时间,目前设置公出时间不足0.5小时",
+        icon: "none",
+      });
       return;
     }
     this.setState({
@@ -258,12 +265,16 @@ class PublicContent extends Component {
       rangeStartMinuteVal: data.selectStartTime,
       rangeEndMinuteVal: data.selectEndTime,
     });
-    console.log(this.state.rangeStartMinuteVal);
     let arr = [];
     if (data.startTime && data.endTime) {
       let a = dayjs(data.startTime);
       let b = dayjs(data.endTime);
-      let num = b.diff(a, "day") + 1;
+      let num;
+      if (a.hour() <= b.hour()) {
+        num = b.diff(a, "day") + 1;
+      } else {
+        num = b.diff(a, "day") + 2;
+      }
       let strAdd = data.startTime;
       for (let i = 0; i < num; i++) {
         let time = dayjs(strAdd).add(i, "days").format("YYYY-MM-DD");

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

@@ -164,7 +164,7 @@ class PublicContent extends Component {
       return;
     }
     if (this.state.totalDuration === 0) {
-      Taro.showToast({ title: "公出时间不足0小时", icon: "none" });
+      Taro.showToast({ title: "请选择公出时间,目前设置公出时间不足0.5小时", icon: "none" });
       return;
     }
     this.setState({