ll
liukangdong
2024-12-06 86baa8ff948d2e79588e0dd7efa16f6b8ac3b157
h5/pages/driver/reserved.vue
@@ -48,7 +48,7 @@
               <text>总运输量</text>
            </view>
            <view class="value">
               <input type="number" placeholder="请输入总运输量" v-model="param.totalNum" placeholder-style="color: #999999;" />
               <input type="number" @blur="checkSurplus" placeholder="请输入总运输量" v-model="param.totalNum" placeholder-style="color: #999999;" />
               <text class="unit">万支</text>
            </view>
         </view>
@@ -98,7 +98,6 @@
            </view>
         </view>
         <view class="copy" @click="copy">复制车前牌照号</view>
         <view class="perch"></view>
         <view class="handle_sub" @click="onSubmit">
            提交
         </view>
@@ -122,7 +121,7 @@
<script>
import keyboardInput from '@/components/keyboard-input/keyboard-input.vue';
import { uploadUrl, driverCarApply,driverCarApplyEdit, driverReasonList, driverApplyDetail } from '@/api';
import { uploadUrl, driverCarApply,driverCarApplyEdit, driverReasonList, driverApplyDetail, checkSurplusNum } from '@/api';
import dayjs from 'dayjs'
export default {
   components: {
@@ -150,6 +149,21 @@
      this.initData()
   },
   methods: {
      checkSurplus() {
            const { arriveDate, reasonId, totalNum } = this.param
            if(!arriveDate || !reasonId || !totalNum) return
            checkSurplusNum({
              arriveDate: arriveDate + ':00',
              reasonId,
              totalNum
            }).then(res => {
              console.log('res', res);
              if( res.data == 0 ||  res.data < Number(totalNum)){
                this.showToast(`当日剩余可预约作业量不足请选择其他到场日期`)
              }
            })
          },
      reasonClick() {
         if(this.param.id){
            return
@@ -196,10 +210,12 @@
         const index = e.indexs[0]
         this.$set(this.param, 'inReason', reasonList[index].reason)
         this.$set(this.param, 'reasonId', reasonList[index].id)
         this.checkSurplus()
         this.showReason = false
      },
      setinDate(e) {
         this.$set(this.param, 'arriveDate', dayjs(e.value).format('YYYY-MM-DD HH:mm'))
         this.checkSurplus()
         this.showDatetime = false
      },
      inTypeClick(e) {
@@ -360,12 +376,12 @@
   }
}
.main_app {
   // padding-top: 10rpx;
   padding-top: 10rpx;
   .handle_sub{
      position: fixed;
      bottom: 64rpx;
      // position: fixed;
      // bottom: 64rpx;
      width: 690rpx;
      left: 30rpx;
      margin-top: 80rpx;
      background-color: #4d99a8;
      height: 88rpx;
      line-height: 88rpx;