订单灵界值处理
Showing
2 changed files
with
16 additions
and
49 deletions
| ... | @@ -40,14 +40,14 @@ | ... | @@ -40,14 +40,14 @@ |
| 40 | </div> | 40 | </div> |
| 41 | <el-row style="flex: 1"> | 41 | <el-row style="flex: 1"> |
| 42 | <div style="flex: 1"> | 42 | <div style="flex: 1"> |
| 43 | <div style="margin-bottom: 20px;">{ language==0?'预约日期':"Appointment date" }} <span class="span">{{route.query.date}}</span></div> | 43 | <div style="margin-bottom: 20px;">{{ language==0?'预约日期':"Appointment date" }} <span class="span">{{route.query.date}}</span></div> |
| 44 | <div>{{ language==0?'套餐名称':"Package name" }} <span class="span">{{ formDatas.name }}</span></div> | 44 | <div>{{ language==0?'套餐名称':"Package name" }} <span class="span">{{ formDatas.name }}</span></div> |
| 45 | </div> | 45 | </div> |
| 46 | 46 | ||
| 47 | <div style="flex: 1"> | 47 | <div style="flex: 1"> |
| 48 | <!-- <div style="margin-bottom: 20px">预约时间 <span class="span">09:00~12:00</span> </div>--> | 48 | <!-- <div style="margin-bottom: 20px">预约时间 <span class="span">09:00~12:00</span> </div>--> |
| 49 | <div style="margin-bottom: 20px">{{ language==0?'上门化妆':'Home makeup' }} <span class="span">{{ formDatas.goHome==1?'是':'否' }}</span></div> | 49 | <div style="margin-bottom: 20px">{{ language==0?'上门化妆':'Home makeup' }} <span class="span">{{ formDatas.goHome==1?'是':'否' }}</span></div> |
| 50 | <div >{{ language==0?'价格':"Price" }} <span class="sign">{{language==0? '¥'+formDatas.mealPrice:'€'+formDatas.mealPriceEn }}</span></div> | 50 | <div >{{ language==0?' 价格':"Price" }} <span class="sign">{{language==0? '¥'+formDatas.mealPrice:'€'+formDatas.mealPriceEn }}</span></div> |
| 51 | </div> | 51 | </div> |
| 52 | 52 | ||
| 53 | <div style="flex: 1"> | 53 | <div style="flex: 1"> |
| ... | @@ -88,7 +88,6 @@ | ... | @@ -88,7 +88,6 @@ |
| 88 | </el-form> | 88 | </el-form> |
| 89 | </div> | 89 | </div> |
| 90 | </el-card> | 90 | </el-card> |
| 91 | |||
| 92 | </el-card> | 91 | </el-card> |
| 93 | 92 | ||
| 94 | <el-card class="mt30"> | 93 | <el-card class="mt30"> |
| ... | @@ -129,7 +128,6 @@ const language = useStorage('language', 0) | ... | @@ -129,7 +128,6 @@ const language = useStorage('language', 0) |
| 129 | const router = useRouter() | 128 | const router = useRouter() |
| 130 | const route = useRoute() | 129 | const route = useRoute() |
| 131 | const room = ref({}) | 130 | const room = ref({}) |
| 132 | const lform = ref({}) | ||
| 133 | const form = ref({ | 131 | const form = ref({ |
| 134 | num: '1', | 132 | num: '1', |
| 135 | roomNum: 0, | 133 | roomNum: 0, |
| ... | @@ -182,7 +180,7 @@ function getScheduleList() { | ... | @@ -182,7 +180,7 @@ function getScheduleList() { |
| 182 | } | 180 | } |
| 183 | 181 | ||
| 184 | function getRadioList(){ | 182 | function getRadioList(){ |
| 185 | booking.getMealConfList({ lasmId:route.params.lasId}).then(res => { | 183 | booking.getMealConfList({ lasmId:route.params.lasId,currentDate:route.query.date}).then(res => { |
| 186 | radioList.value = res.data | 184 | radioList.value = res.data |
| 187 | radioList.value.forEach(item=>{ | 185 | radioList.value.forEach(item=>{ |
| 188 | item.flag=false | 186 | item.flag=false |
| ... | @@ -191,37 +189,7 @@ function getRadioList(){ | ... | @@ -191,37 +189,7 @@ function getRadioList(){ |
| 191 | }).catch(err => { | 189 | }).catch(err => { |
| 192 | console.log(err) | 190 | console.log(err) |
| 193 | }) | 191 | }) |
| 194 | } | 192 | timeVal.value={} |
| 195 | |||
| 196 | |||
| 197 | function initDays() { | ||
| 198 | booking.getMealConfList({ lasmId:route.params.lasId}).then(res => { | ||
| 199 | lform.value = res.data | ||
| 200 | // if(lform.value.hqStart){ | ||
| 201 | // const today = dayjs() | ||
| 202 | // if(lform.value.hqStart.slice(0,10)<today.format('YYYY-MM-DD')){ | ||
| 203 | // lform.value.hqStart = today.format('YYYY-MM-DD') | ||
| 204 | // } | ||
| 205 | // rzRange.value = [lform.value.hqStart.slice(0,10),lform.value.hqEnd.slice(0,10)] | ||
| 206 | // getDaysBetween(rzRange.value) | ||
| 207 | // } | ||
| 208 | // console.log(rzRange.value,lform.value.hqStart) | ||
| 209 | }).catch(err => { | ||
| 210 | console.log(err) | ||
| 211 | }) | ||
| 212 | } | ||
| 213 | |||
| 214 | function disabledDateRZ(date) { | ||
| 215 | //判读今天大与form.value.hqStart | ||
| 216 | if (lform.value.hqStart) { | ||
| 217 | const today = dayjs().format('YYYY-MM-DD') | ||
| 218 | if (lform.value.hqStart < today) { | ||
| 219 | return !((date.getTime() >= dayjs(today).valueOf()) && (date.getTime() <= dayjs(lform.value.hqEnd).valueOf())) | ||
| 220 | } else { | ||
| 221 | return !((date.getTime() >= dayjs(lform.value.hqStart).valueOf()) && (date.getTime() <= dayjs(lform.value.hqEnd).valueOf())) | ||
| 222 | } | ||
| 223 | } | ||
| 224 | return true | ||
| 225 | } | 193 | } |
| 226 | 194 | ||
| 227 | function submit() { | 195 | function submit() { |
| ... | @@ -230,8 +198,7 @@ function submit() { | ... | @@ -230,8 +198,7 @@ function submit() { |
| 230 | return | 198 | return |
| 231 | } | 199 | } |
| 232 | 200 | ||
| 233 | if (!timeVal.value)return proxy.$modal.msgError('请选择预约时间!', ) | 201 | if (!timeVal.value.id)return proxy.$modal.msgError('请选择预约时间!', ) |
| 234 | |||
| 235 | proxy.$refs['formRef'].validate(valid=>{ | 202 | proxy.$refs['formRef'].validate(valid=>{ |
| 236 | if (valid){ | 203 | if (valid){ |
| 237 | form.value.total=money.value | 204 | form.value.total=money.value |
| ... | @@ -252,8 +219,8 @@ function submit() { | ... | @@ -252,8 +219,8 @@ function submit() { |
| 252 | }).then(() => { | 219 | }).then(() => { |
| 253 | booking.submitOrderMeal(form.value).then(res => { | 220 | booking.submitOrderMeal(form.value).then(res => { |
| 254 | if (res.data) { | 221 | if (res.data) { |
| 255 | if (res.data.roomNum == -100) { | 222 | if (res.data.orderId <0||res.data.total<0) { |
| 256 | ElMessage.warning(language.value == 0 ? '预定时间不足' : 'The remaining number of rooms is insufficient') | 223 | ElMessage.warning(language.value == 0 ? '订单库存数量不足!' : 'The order stock quantity is insufficient!') |
| 257 | getRadioList() | 224 | getRadioList() |
| 258 | } else { | 225 | } else { |
| 259 | //去付钱 | 226 | //去付钱 |
| ... | @@ -267,10 +234,10 @@ function submit() { | ... | @@ -267,10 +234,10 @@ function submit() { |
| 267 | }) | 234 | }) |
| 268 | } | 235 | } |
| 269 | } else { | 236 | } else { |
| 270 | ElMessage.warning(language.value == 0 ? '无可预订的时间' : 'No rooms available to book') | 237 | ElMessage.warning(language.value == 0 ? '无可预订的时间' : 'No booking time available') |
| 271 | } | 238 | } |
| 272 | }).catch(err => { | 239 | }).catch(err => { |
| 273 | ElMessage.warning(language.value == 0 ? '无可预订的时间' : 'No rooms available to book') | 240 | ElMessage.warning(language.value == 0 ? '无可预订的时间' : 'No booking time available') |
| 274 | }) | 241 | }) |
| 275 | }) | 242 | }) |
| 276 | 243 | ||
| ... | @@ -280,7 +247,6 @@ function submit() { | ... | @@ -280,7 +247,6 @@ function submit() { |
| 280 | }) | 247 | }) |
| 281 | } | 248 | } |
| 282 | 249 | ||
| 283 | |||
| 284 | function handleRadio(v){ | 250 | function handleRadio(v){ |
| 285 | timeVal.value=null | 251 | timeVal.value=null |
| 286 | radioList.value.forEach(t=>{ | 252 | radioList.value.forEach(t=>{ | ... | ... |
| ... | @@ -179,7 +179,7 @@ function getScheduleList() { | ... | @@ -179,7 +179,7 @@ function getScheduleList() { |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | function getRadioList(){ | 181 | function getRadioList(){ |
| 182 | booking.getPhotoConfList({ laspId:route.params.lasId}).then(res => { | 182 | booking.getPhotoConfList({ laspId:route.params.lasId,currentDate:route.query.date}).then(res => { |
| 183 | radioList.value = res.data | 183 | radioList.value = res.data |
| 184 | radioList.value.forEach(item=>{ | 184 | radioList.value.forEach(item=>{ |
| 185 | item.flag=false | 185 | item.flag=false |
| ... | @@ -188,6 +188,7 @@ function getRadioList(){ | ... | @@ -188,6 +188,7 @@ function getRadioList(){ |
| 188 | }).catch(err => { | 188 | }).catch(err => { |
| 189 | console.log(err) | 189 | console.log(err) |
| 190 | }) | 190 | }) |
| 191 | timeVal.value={} | ||
| 191 | } | 192 | } |
| 192 | 193 | ||
| 193 | function submit() { | 194 | function submit() { |
| ... | @@ -196,7 +197,7 @@ function submit() { | ... | @@ -196,7 +197,7 @@ function submit() { |
| 196 | return | 197 | return |
| 197 | } | 198 | } |
| 198 | 199 | ||
| 199 | if (!timeVal.value)return proxy.$modal.msgError('请选择预约时间!', ) | 200 | if (!timeVal.value.id)return proxy.$modal.msgError('请选择预约时间!', ) |
| 200 | 201 | ||
| 201 | proxy.$refs['formRef'].validate(valid=>{ | 202 | proxy.$refs['formRef'].validate(valid=>{ |
| 202 | if (valid){ | 203 | if (valid){ |
| ... | @@ -218,8 +219,8 @@ function submit() { | ... | @@ -218,8 +219,8 @@ function submit() { |
| 218 | }).then(() => { | 219 | }).then(() => { |
| 219 | booking.submitOrderPhoto(form.value).then(res => { | 220 | booking.submitOrderPhoto(form.value).then(res => { |
| 220 | if (res.data) { | 221 | if (res.data) { |
| 221 | if (res.data.roomNum == -100) { | 222 | if (res.data.orderId <0||res.data.total<0) { |
| 222 | ElMessage.warning(language.value == 0 ? '预定时间不足' : 'The remaining number of rooms is insufficient') | 223 | ElMessage.warning(language.value == 0 ? '订单库存数量不足!' : 'The order stock quantity is insufficient!') |
| 223 | getRadioList() | 224 | getRadioList() |
| 224 | } else { | 225 | } else { |
| 225 | //去付钱 | 226 | //去付钱 |
| ... | @@ -233,10 +234,10 @@ function submit() { | ... | @@ -233,10 +234,10 @@ function submit() { |
| 233 | }) | 234 | }) |
| 234 | } | 235 | } |
| 235 | } else { | 236 | } else { |
| 236 | ElMessage.warning(language.value == 0 ? '无可预订的时间' : 'No rooms available to book') | 237 | ElMessage.warning(language.value == 0 ? '无可预订的时间' : 'No booking time available') |
| 237 | } | 238 | } |
| 238 | }).catch(err => { | 239 | }).catch(err => { |
| 239 | ElMessage.warning(language.value == 0 ? '无可预订的时间' : 'No rooms available to book') | 240 | ElMessage.warning(language.value == 0 ? '无可预订的时间' : 'No booking time available') |
| 240 | }) | 241 | }) |
| 241 | }) | 242 | }) |
| 242 | 243 | ... | ... |
-
Please register or sign in to post a comment