ソースを参照

下班补卡按钮显示逻辑调整

cyy 1 年間 前
コミット
845a6d4d3b
1 ファイル変更8 行追加3 行削除
  1. 8 3
      src/views/platform/bpmn/my-schedule/index.vue

+ 8 - 3
src/views/platform/bpmn/my-schedule/index.vue

@@ -70,7 +70,7 @@
         </van-collapse-item>
       </van-collapse>
     </div>
-    <div v-show="showInfo&&unfoldInfo&&unfoldInfo.data.length>0&&active==='排班'" class="unfoldMessage">
+    <div v-show="showInfo&&unfoldInfo&&unfoldInfo.data&&unfoldInfo.data.length>0&&active==='排班'" class="unfoldMessage">
       <div v-for="(item,i) in unfoldInfo.data" :key="'uif'+ i" class="line">
         <!-- <div class="iconLine"><van-icon name="label" /></div> -->
         <van-icon class="iconLine" name="label" color="rgb(25, 137, 250)" size="125%" />
@@ -332,7 +332,7 @@ export default {
       } else if (this.active === '排班' && this.showDateArr[selectDate] !== '') {
         this.unfoldInfo = this.showDateArr[selectDate] ? { date: selectDate, data: this.showDateArr[selectDate].data } || {} : {}
 
-        if (Object.keys(this.unfoldInfo.data).length > 0) {
+        if (this.unfoldInfo.data && Object.keys(this.unfoldInfo.data).length > 0) {
           this.unfoldInfo.data.forEach((m, n) => {
             const mid = m.config.dateRange.filter(t => t.isSecondDay === 'Y')
             m.config['isSecondDayAll'] = mid.length > 0
@@ -571,6 +571,9 @@ export default {
       const normTime = new Date(this.entryTime).getTime()
       const bzTime = val.hasOwnProperty(mid[1]) ? new Date(val[mid[1]]).getTime() : ''
       const dkTime = val.hasOwnProperty(mid[0]) ? new Date(val[mid[0]]).getTime() : ''
+      // console.log(pickDate, normDate, 'sasdsadas')
+      const diff = Math.abs(normDate - pickDate)
+      const days = Math.floor(diff / (1000 * 60 * 60 * 24))
       if (pickDate > normDate) {
         return true
       } else if (pickDate === normDate && normTime <= bzTime) {
@@ -578,9 +581,11 @@ export default {
       } else if (pickDate === normDate) {
         if (type === 'am' && (!val.hasOwnProperty(mid[0]) || (val.hasOwnProperty(mid[0]) && dkTime > bzTime))) {
           return false
-        } else if (type === 'pm' && (!val.hasOwnProperty(mid[0]) || (val.hasOwnProperty(mid[0]) && dkTime < bzTime))) {
+        } else if (type === 'pm' && (val.hasOwnProperty(mid[0]) && dkTime < bzTime)) {
           return false
         }
+      } else if (pickDate < normDate && days === 1 && val['shi_fou_kua_ri_'] === 'Y' && type === 'pm') {
+        return true
       } else if (pickDate < normDate && !val.hasOwnProperty(mid[0]) || !val.hasOwnProperty(mid[2])) {
         return false
       }