ll
liukangdong
2024-08-28 2c62224302e67151a26c73cdcb9b6421dc4dcc62
h5/pages/driver/reserved.vue
@@ -121,7 +121,7 @@
<script>
import keyboardInput from '@/components/keyboard-input/keyboard-input.vue';
import { uploadUrl, driverCarApply, driverReasonList } from '@/api';
import { uploadUrl, driverCarApply,driverCarApplyEdit, driverReasonList, driverApplyDetail } from '@/api';
import dayjs from 'dayjs'
export default {
   components: {
@@ -142,7 +142,10 @@
         inputType: ''
      };
   },
   created() {
   onLoad(option) {
      if(option && option.id){
         this.getDetail(option.id, option.type)
      }
      this.initData()
   },
   methods: {
@@ -158,9 +161,21 @@
         if (!param.carCodeBack) return this.showToast('请输入车后牌号')
         if (!param.transportImgFull) return this.showToast('请上传准运证照片')
         param.arriveDate = param.arriveDate + ':00'
         driverCarApply({...param}).then(res => {
         let fn = param.id ? driverCarApplyEdit : driverCarApply
         fn({...param}).then(res => {
            if(res && res.code === 200){
               uni.navigateBack()
               setTimeout(() => {
                  this.showToast('预约申请成功')
               })
               this.$jump('/pages/driver/reservedRecord')
            }
         })
      },
      getDetail(id, type) {
         driverApplyDetail({id}).then(res => {
            this.param = { ...res.data, transportImgFull: res.data.prefixUrl + res.data.transportImg }
            if(type && type == 'reject'){
               this.$set(this.param, 'id', null)
            }
         })
      },