ll
liukangdong
2024-08-29 1382a7990e9b13f60c6416ada5477673a934dd16
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)
            }
         })
      },
@@ -196,12 +211,14 @@
         this.$forceUpdate();
         this.closeInput();
      },
      closeInput() {
         this.$refs.keyboard.close();
      },
      copy(){
         if(this.param.carCodeFront){
            this.$set(this.param, 'carCodeBack', this.param.carCodeFront)
            this.showToast('复制成功');
         }
      },
      handleUpload() {
         let token = uni.getStorageSync('token') || ''
@@ -245,9 +262,6 @@
           }
         })
      },
      closeInput() {
         this.$refs.keyboard.close();
      }
   }
};
</script>