| | |
| | | |
| | | <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: { |
| | |
| | | inputType: '' |
| | | }; |
| | | }, |
| | | created() { |
| | | onLoad(option) { |
| | | if(option && option.id){ |
| | | this.getDetail(option.id, option.type) |
| | | } |
| | | this.initData() |
| | | }, |
| | | methods: { |
| | |
| | | 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) |
| | | } |
| | | }) |
| | | }, |