| | |
| | | <text>*</text> |
| | | <text>入园原因</text> |
| | | </view> |
| | | <view class="value" @click="showReason = true"> |
| | | <text class="mr6" :style="{ color: param.inReason ? '#000000' : '#999999' }">{{ param.inReason ? param.inReason : '请选择' }}</text> |
| | | <view class="value" @click="reasonClick"> |
| | | <text class="mr6" :class="{gray: param.id}" :style="{ color: param.inReason ? '#000000' : '#999999' }">{{ param.inReason ? param.inReason : '请选择' }}</text> |
| | | <u-icon name="arrow-right" color="#CCCCCC" size="16"></u-icon> |
| | | </view> |
| | | </view> |
| | |
| | | <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> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="copy" @click="copy">复制车前牌照号</view> |
| | | <view class="perch"></view> |
| | | <view class="handle_sub" @click="onSubmit"> |
| | | 提交 |
| | | <view class="footer"> |
| | | <view class="handle_sub" @click="onSubmit"> |
| | | 提交 |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- --> |
| | | <u-picker :show="showReason" keyName="reason" :columns="reasonList" @confirm="reasonConfirm"></u-picker> |
| | | <u-picker :show="showReason" keyName="reason" closeOnClickOverlay @close="showReason = false" |
| | | @cancel="showReason = false" :columns="reasonList" @confirm="reasonConfirm"></u-picker> |
| | | <u-datetime-picker |
| | | :show="showDatetime" |
| | | closeOnClickOverlay |
| | |
| | | |
| | | <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: { |
| | |
| | | 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 |
| | | } |
| | | this.showReason = true |
| | | }, |
| | | onSubmit() { |
| | | const param = { ...this.param } |
| | | if (!param.arriveDate) return this.showToast('请选择到场时间') |
| | |
| | | setTimeout(() => { |
| | | this.showToast('预约申请成功') |
| | | }) |
| | | this.$jump('/pages/driver/reservedRecord') |
| | | uni.redirectTo({ |
| | | url: '/pages/driver/index' |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | 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) { |
| | |
| | | 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') || '' |
| | |
| | | } |
| | | }) |
| | | }, |
| | | closeInput() { |
| | | this.$refs.keyboard.close(); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | .gray{ |
| | | color: #999999 !important; |
| | | } |
| | | .btns { |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | } |
| | | } |
| | | .main_app { |
| | | // padding-top: 10rpx; |
| | | padding-top: 10rpx; |
| | | .footer{ |
| | | background-color: #f7f7f7; |
| | | padding: 20rpx 30rpx 30rpx; |
| | | margin: 0 -30rpx; |
| | | } |
| | | .handle_sub{ |
| | | position: fixed; |
| | | bottom: 64rpx; |
| | | width: 690rpx; |
| | | left: 30rpx; |
| | | background-color: #4d99a8; |
| | | height: 88rpx; |
| | | line-height: 88rpx; |
| | |
| | | background-color: #f7f7f7; |
| | | display: flex; |
| | | margin: 0 -30rpx; |
| | | width: 750rpx; |
| | | justify-content: flex-end; |
| | | padding: 12rpx 30rpx; |
| | | font-size: 26rpx; |