yangan
2025-03-24 76f165afb5462e1731540f761d04c621aee3cfb7
pages/driver-page/appointment/appointment.vue
@@ -5,7 +5,7 @@
         *您当前的预约时间段<text>{{yuYueSection}}</text>
      </view>
      <combined-title
         :title="yuYueData.length != 0 ? yuYueData[0].filedName + '——' + yuYueData[0].sendDate : '暂无预约列表'"></combined-title>
         :title="yuYueData.length != 0 ? yuYueData[0].filedName + '——' + yuYueSection : '暂无预约列表'"></combined-title>
      <view class="appointment-table">
         <uni-table border
            stripe
@@ -23,7 +23,7 @@
               <uni-td align="center">{{ item.carNum1 || '' }}</uni-td>
               <uni-td><u-button text="选择"
                     type="primary"
                     :disabled="item.carNum == item.carNum1"
                     :disabled="item.carNum == item.carNum1&&!isRCSQ"
                     @click="yuYueBtnClick(item)"></u-button></uni-td>
            </uni-tr>
         </uni-table>
@@ -65,11 +65,14 @@
         };
      },
      onLoad(params) {
         console.log(params,'params')
         if (params.type == '入场申请') {
            this.isRCSQ = true;
            this.rcsqData.originalYyId = params.yyId;
            this.yuYueSection = params.yuYueSection
            // this.yuYueSection = params.yuYueSection
            this.yuYueSection = this.getNowFormatDate();
         }
         this.yuYueSection = this.getNowFormatDate();
         this.yuYuePostParams.takeCoalId = params.takeCoalId;
         this.yuYueListParams.filedId = params.filedId;
         this.yuYueListParams.deptId = params.deptId;
@@ -127,6 +130,18 @@
               }
            })
         },
         //获取当天日期
         //获取当前日期函数
            getNowFormatDate() {
            let date = new Date(),
               year = date.getFullYear(), //获取完整的年份(4位)
               month = date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
               strDate = date.getDate() // 获取当前日(1-31)
            if (month < 10) month = `0${month}` // 如果月份是个位数,在前面补0
            if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数,在前面补0
            return `${year}-${month}-${strDate}`
            },
         // 更换预约时间段
         saveRCSQ(value) {
            this.rcsqData.yyId = value.id;
@@ -141,18 +156,20 @@
                     })
                  }, 1500);
                  //如果未签到 先签到再申请
               } else if (res.code == 3) {
                  this.$u.toast('请先签到');
                  setTimeout(() => {
                     uni.navigateTo({
                        url: `/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock?orderPlanId=${this.yuYuePostParams.takeCoalId}&coalStatus=${
                        this.coalStatus}&tmId=${this.tmId}&yyId=${this.rcsqData.originalYyId}&filedId=${this.yuYueListParams.filedId}&deptId=${this.yuYueListParams.deptId}&sendDate=${this.yuYueListParams.sendDate}&yuYueSection=${this.yuYueSection}`
                     })
                  }, 1500)
                  return
               } else {
                  this.$u.toast(res.msg ? res.msg : '更换预约时间段失败,请稍后重试');
               }
               // else if (res.code == 3) {
               //    this.$u.toast('请先签到');
               //    setTimeout(() => {
               //       uni.navigateTo({
               //          url: `/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock?orderPlanId=${this.yuYuePostParams.takeCoalId}&coalStatus=${
               //          this.coalStatus}&tmId=${this.tmId}&yyId=${this.rcsqData.originalYyId}&filedId=${this.yuYueListParams.filedId}&deptId=${this.yuYueListParams.deptId}&sendDate=${this.yuYueListParams.sendDate}&yuYueSection=${this.yuYueSection}`
               //       })
               //    }, 1500)
               //    return
               // }
            });
         }
      }