From 1ae471941bbdf9dde5dba668d33acf415fc6ec07 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 21 十月 2024 16:54:48 +0800
Subject: [PATCH] 最新版本541200007
---
h5/pages/driver/reserved.vue | 37 ++++++++++++++++++++++++++++++++-----
1 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/h5/pages/driver/reserved.vue b/h5/pages/driver/reserved.vue
index 0683f0f..7174127 100644
--- a/h5/pages/driver/reserved.vue
+++ b/h5/pages/driver/reserved.vue
@@ -7,8 +7,8 @@
<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>
@@ -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>
@@ -105,7 +105,8 @@
</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
@@ -121,7 +122,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: {
@@ -149,6 +150,27 @@
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('璇烽�夋嫨鍒板満鏃堕棿')
@@ -189,10 +211,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) {
@@ -297,6 +321,9 @@
display: flex;
align-items: center;
justify-content: flex-end;
+ .gray{
+ color: #999999 !important;
+ }
.btns {
display: flex;
align-items: center;
--
Gitblit v1.9.3