Commit 839e981e authored by youjie's avatar youjie

no message

parent 67f3cdc0
...@@ -37,10 +37,11 @@ ...@@ -37,10 +37,11 @@
row: $q.screen.width >= 1200 && $q.platform.is.desktop, row: $q.screen.width >= 1200 && $q.platform.is.desktop,
column: $q.screen.width < 1200 || $q.platform.is.mobile, column: $q.screen.width < 1200 || $q.platform.is.mobile,
}" }"
> >
<div class="col"> <div class="col">
<q-form ref="baseUserInfo">
<q-card flat class="q-pa-md"> <q-card flat class="q-pa-md">
<div class="text-subtitle1 text-weight-bolder" ref="baseUserInfoTitle">訂購人資訊</div> <div class="text-subtitle1 text-weight-bolder">訂購人資訊</div>
<q-separator color="grey-2" class="q-my-md" /> <q-separator color="grey-2" class="q-my-md" />
<div class="row q-col-gutter-md"> <div class="row q-col-gutter-md">
<div :class="filedWidth"> <div :class="filedWidth">
...@@ -69,8 +70,7 @@ ...@@ -69,8 +70,7 @@
</q-card> </q-card>
<q-card flat class="q-pa-md q-mt-lg" v-if="details"> <q-card flat class="q-pa-md q-mt-lg" v-if="details">
<div class="text-subtitle1 text-weight-bolder q-mb-md" ref="passengerInformation">旅客資料</div> <div class="text-subtitle1 text-weight-bolder q-mb-md">旅客資料</div>
<div class="row"> <div class="row">
<vue-core-video-players <vue-core-video-players
v-if="details.videoStr" v-if="details.videoStr"
...@@ -407,7 +407,9 @@ ...@@ -407,7 +407,9 @@
<div class="text-subtitle1 q-my-md text-weight-bold">特殊需求備註:</div> <div class="text-subtitle1 q-my-md text-weight-bold">特殊需求備註:</div>
<q-input standout v-model="parameters.Remark" input-style="height:170px;" type="textarea" placeholder="此欄位僅限資料備註。不在商品規範內的個人需求,不保證提供" maxlength="200" counter /> <q-input standout v-model="parameters.Remark" input-style="height:170px;" type="textarea" placeholder="此欄位僅限資料備註。不在商品規範內的個人需求,不保證提供" maxlength="200" counter />
</q-card> </q-card>
</q-form>
</div> </div>
<div class="relative-position" v-if="details" <div class="relative-position" v-if="details"
:class="{ :class="{
'q-ml-lg': !($q.screen.width < 1200 || $q.platform.is.mobile), 'q-ml-lg': !($q.screen.width < 1200 || $q.platform.is.mobile),
...@@ -549,6 +551,8 @@ export default { ...@@ -549,6 +551,8 @@ export default {
}, },
data() { data() {
return { return {
validateIndex: 0,
submiting: true,
order: null,//订单信息 order: null,//订单信息
orderKey: "", orderKey: "",
isRangeClick: true, isRangeClick: true,
...@@ -706,52 +710,24 @@ export default { ...@@ -706,52 +710,24 @@ export default {
} }
return this.orderKey != ""; return this.orderKey != "";
}, },
async submit() {
submit(){ this.submiting=true
let flag = false let flag = true
flag = await this.formValidateHandler('baseUserInfo')
this.$refs.mail.validate() if(!flag){
let errorObj = this.$refs.baseUserInfo.getValidationComponents().find(x=>x.innerError)
this.$refs.SurName.validate() window.scrollTo(0,errorObj.$el.offsetTop)
this.$refs.Name.validate()
this.$refs.ContactWay.validate()
this.$refs.Mobile.validate()
this.$refs.OrderDate.validate()
this.$refs.ManNum.validate()
if(this.details.CarType!=3){
this.$refs.AirportTerminal.validate()
this.$refs.AirLine.validate()
this.$refs.FlightNumber.validate()
this.$refs.FlightTime.validate()
if(this.details.CarType!=1){
this.$refs.GetonAddress.validate()
flag = !this.$refs.SurName.hasError&& !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
&& !this.$refs.Mobile.hasError&& !this.$refs.OrderDate.hasError&& !this.$refs.ManNum.hasError
&& !this.$refs.AirportTerminal.hasError&& !this.$refs.AirLine.hasError&& !this.$refs.FlightNumber.hasError
&& !this.$refs.FlightTime.hasError&& !this.$refs.GetonAddress.hasError&& !this.$refs.mail.hasError
}else{
this.$refs.GetoffAddress.validate()
flag = !this.$refs.SurName.hasError&& !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
&& !this.$refs.Mobile.hasError&& !this.$refs.OrderDate.hasError&& !this.$refs.ManNum.hasError
&& !this.$refs.AirportTerminal.hasError&& !this.$refs.AirLine.hasError&& !this.$refs.FlightNumber.hasError
&& !this.$refs.FlightTime.hasError&& !this.$refs.GetoffAddress.hasError&& !this.$refs.mail.hasError
}
}else{
this.$refs.GetonAddress.validate()
this.$refs.GetoffAddress.validate()
flag = !this.$refs.SurName.hasError&& !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
&& !this.$refs.Mobile.hasError&& !this.$refs.OrderDate.hasError&& !this.$refs.ManNum.hasError
&& !this.$refs.GetonAddress.hasError&& !this.$refs.GetoffAddress.hasError&& !this.$refs.mail.hasError
} }
if(!flag) return this.goScrollToForm('baseUserInfoTitle') if(flag){
this.SetCarOrder()
this.SetCarOrder() return;
}
this.submiting=false
}, },
goScrollToForm(formName){ async formValidateHandler(formName){
let temp=this.$refs[formName] let temp=this.$refs[formName]
let formObj = temp instanceof Array ? temp[0] : temp let formObj = temp instanceof Array ? temp[0] : temp
window.scrollTo(0,formObj.offsetTop) return formObj.validate()
}, },
SetCarOrder(){ SetCarOrder(){
this.loading = true this.loading = true
...@@ -765,12 +741,7 @@ export default { ...@@ -765,12 +741,7 @@ export default {
let ErpOrderId = r.data.data.Id let ErpOrderId = r.data.data.Id
this.AddOrderInfo(ErpOrderId) this.AddOrderInfo(ErpOrderId)
}else{ }else{
this.$q.notify({ this.$message.error(r.data.message)
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000,
});
this.loading = false this.loading = false
} }
}) })
...@@ -804,27 +775,14 @@ export default { ...@@ -804,27 +775,14 @@ export default {
PlatformTax: 0,//平台税金默认0 PlatformTax: 0,//平台税金默认0
Income: 0,//已收默认0 Income: 0,//已收默认0
Refund: 0,//退款金额默认0 Refund: 0,//退款金额默认0
OrderSource: this.parameters.pType
}, },
(r) => { (r) => {
if (r.data.resultCode == 1) { if (r.data.resultCode == 1) {
this.step = 3 this.step = 3
this.$q.notify({ this.$message.success("訂單創建成功")
color: "green-4",
textColor: "white",
icon: "check",
message: "訂單提交成功",
position:'center',
});
return
this.goPayHandler(r.data.data) this.goPayHandler(r.data.data)
}else{ }else{
this.$q.notify({ this.$message.error(r.data.message)
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000,
});
} }
this.loading = false this.loading = false
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment