wk
2024-11-14 927e4a7caf46bd073c65ce3b8f14dc1f1582c519
pages/driver-page/appointment/appointment.vue
@@ -1,5 +1,9 @@
<template>
   <view class="appointment">
      <view class="appointment-description"
         v-if="isRCSQ">
         *您当前的预约时间段<text>{{yuYueSection}}</text>
      </view>
      <combined-title
         :title="yuYueData.length != 0 ? yuYueData[0].filedName + '——' + yuYueData[0].sendDate : '暂无预约列表'"></combined-title>
      <view class="appointment-table">
@@ -19,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>
@@ -54,19 +58,25 @@
               yyId: '',
               deptId: '',
               filedId: '',
               remark: ''
            }
            },
            yuYueSection: '',
            coalStatus: '',
            tmId: ""
         };
      },
      onLoad(params) {
         if (params.type == '入场申请') {
            this.isRCSQ = true;
            this.rcsqData.originalYyId = params.yyId;
            this.yuYueSection = params.yuYueSection
         }
         this.yuYuePostParams.takeCoalId = params.takeCoalId;
         this.yuYueListParams.filedId = params.filedId;
         this.yuYueListParams.deptId = params.deptId;
         this.yuYueListParams.sendDate = params.sendDate;
         this.yuYueListParams.coalName = params.coalName;
         this.coalStatus = params.coalStatus;
         this.tmId = params.tmId
      },
      onShow() {
         this.init();
@@ -109,30 +119,40 @@
                  this.yuYueList();
                  this.$u.toast('预约成功');
                  let timer = setTimeout(() => {
                     uni.navigateBack({
                        delta: 1
                     });
                  }, 500);
                     uni.switchTab({
                        url: '/pages/tabbar-page/index-tabbar/index-tabbar'
                     })
                  }, 1500);
               } else {
                  this.$u.toast(res.msg ? res.msg : '预约失败');
                  this.$u.toast(res.msg ? res.msg.replaceAll('<br/>',"\n").replaceAll(/\n/g, "\n").replaceAll(/\r/g, "\r") : '预约失败');
               }
            })
         },
         // 入场申请
         // 更换预约时间段
         saveRCSQ(value) {
            this.rcsqData.yyId = value.id;
            this.rcsqData.deptId = value.deptId;
            this.rcsqData.filedId = value.filedId;
            this.$reqPost('saveRCSQ', this.rcsqData, 'json').then(res => {
               if (res.code == 0) {
                  this.$u.toast('入场申请成功');
                  this.$u.toast('更换预约时间段成功');
                  let timer = setTimeout(() => {
                     uni.switchTab({
                        url: '/pages/tabbar-page/index-tabbar/index-tabbar'
                     })
                  }, 500);
                  }, 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 : '入场申请失败,请稍后重试');
                  this.$u.toast(res.msg ? res.msg : '更换预约时间段失败,请稍后重试');
               }
            });
         }
@@ -146,6 +166,19 @@
      width: 94%;
      margin: 0 auto;
      // 预约界面描述
      .appointment-description {
         margin: vww(8) 0;
         color: #fd1446;
         text {
            font-weight: bold;
            display: inline-block;
            margin-left: vww(5);
            color: #252525;
         }
      }
      h1 {
         font-size: vww(20);
         text-align: center;