Commit ae7a9dce authored by youjie's avatar youjie

no message

parent 37ea3e5c
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<q-icon class="cursor-pointer" name="close" size="18px" color="grey-5" @click="$emit('close')"></q-icon> <q-icon class="cursor-pointer" name="close" size="18px" color="grey-5" @click="$emit('close')"></q-icon>
</div> </div>
<q-separator color="grey-3" class="q-my-sm" /> <q-separator color="grey-3" class="q-my-sm" />
<div style="height: 700px;"> <div style="height: 600px;">
<q-scroll-area v-if="HotelCarList.length>0" :thumb-style="scrollStyle.thumbStyle" :bar-style="scrollStyle.barStyle" class="full-height"> <q-scroll-area v-if="HotelCarList.length>0" :thumb-style="scrollStyle.thumbStyle" :bar-style="scrollStyle.barStyle" class="full-height">
<q-list> <q-list>
<q-item class="rounded-borders"> <q-item class="rounded-borders">
...@@ -106,25 +106,35 @@ ...@@ -106,25 +106,35 @@
{{$t('noneData')}} {{$t('noneData')}}
</div> </div>
</div> </div>
<div class="column q-px-md"> <div class="column q-px-md q-py-lg">
<div class="row wrap justify-between col q-pb-lg"> <div class="row wrap justify-between col q-pb-lg">
<div class="col-6 q-pb-sm"> <div class="col-6 q-pb-sm">
<n-select filterable @update:value="changeOrderType" style="max-width: 200px;" <n-select filterable @update:value="changeOrderType" style="max-width: 200px;"
v-model:value="parameters.OrderType" :placeholder="$t('hotel.car.OrderType')" :options="cacheHotels" v-model:value="parameters.OrderType" :placeholder="$t('hotel.car.OrderType')" :options="cacheHotels"
max-tag-count="responsive" size="large" value-field="ID" label-field="Name" /> max-tag-count="responsive" size="large" value-field="ID" label-field="Name" />
</div> </div>
<q-input v-if="parameters.OrderType==2" class="col-6" v-model="parameters.TCNum" style="max-width: 200px;" reverse-fill-mask dense
<div v-if="parameters.OrderType==2" class="col-6"> type="text" standout :label="$t('hotel.car.TCNum')" ref="TCNumRef"
<q-input v-model="parameters.TCNum" style="max-width: 200px;" mask="#.##" reverse-fill-mask dense :rules="[val => !!val || $t('hotel.car.inputText')+$t('hotel.car.TCNum')]"/>
type="text" standout :label="$t('hotel.car.TCNum')" />
</div>
<template v-if="parameters.OrderType==1"> <template v-if="parameters.OrderType==1">
<q-input v-model="parameters.TCNum" style="max-width: 200px;" class="col-6 q-mr-md" mask="#.##" reverse-fill-mask dense <q-input v-model="parameters.ContactName" style="max-width: 200px;" class="col-6" reverse-fill-mask dense
type="text" standout :label="$t('hotel.car.ContactName')" /> type="text" standout :label="$t('hotel.car.ContactName')" ref="ContactNameRef"
<q-input v-model="parameters.TCNum" style="max-width: 200px;" class="col-6 q-mr-md" mask="#.##" reverse-fill-mask dense :rules="[val => !!val || $t('hotel.car.inputText')+$t('hotel.car.ContactName')]"/>
type="text" standout :label="$t('hotel.car.ContactNumber')" />
<q-input v-model="parameters.ContactNumber" style="max-width: 200px;" class="col-6 q-mr-md" reverse-fill-mask dense
type="text" standout :label="$t('hotel.car.ContactNumber')" ref="ContactNumberRef"
:rules="[val => !!val || $t('hotel.car.inputText')+$t('hotel.car.ContactNumber')]"/>
</template> </template>
<q-input class="col-6"
style="max-width: 200px;"
v-model="parameters.Remark"
reverse-fill-mask dense
filled
clearable
type="text"
:label="$t('hotel.car.Remark')"
/>
</div> </div>
<div class="row justify-between"> <div class="row justify-between">
...@@ -154,12 +164,16 @@ ...@@ -154,12 +164,16 @@
import useScrollModule from '../../../module/scrollbar/scrollModule' import useScrollModule from '../../../module/scrollbar/scrollModule'
import { DirtionmaryHelper } from '../../../config/dictionary' import { DirtionmaryHelper } from '../../../config/dictionary'
import message from '../../../utils/message' import message from '../../../utils/message'
import { ApiResult } from '../../../@types/enumHelper'
import HotelService from '../../../api/hotel'
export default defineComponent({ export default defineComponent({
props: { props: {
}, },
setup(props) { setup(props, context) {
// inject(DirtionmaryHelper.HOTEL_CAR_LIST) const TCNumRef = ref(null)
const ContactNameRef = ref(null)
const ContactNumberRef = ref(null)
const HotelCarList = inject(DirtionmaryHelper.HOTEL_CAR_LIST) as any const HotelCarList = inject(DirtionmaryHelper.HOTEL_CAR_LIST) as any
const {locale,t } = useI18n(); const {locale,t } = useI18n();
const data=reactive({ const data=reactive({
...@@ -182,8 +196,8 @@ ...@@ -182,8 +196,8 @@
HotelLength: 0, HotelLength: 0,
loading: false, loading: false,
cacheHotels: [ cacheHotels: [
{Name:'散客',ID:1}, {Name:t('hotel.car.scattered'),ID:1},
{Name:'团队',ID:2}, {Name:t('hotel.car.group'),ID:2},
], ],
}) })
data.scrollStyle = useScrollModule().scrollStyle data.scrollStyle = useScrollModule().scrollStyle
...@@ -195,7 +209,7 @@ ...@@ -195,7 +209,7 @@
const methods = { const methods = {
changeOrderType() { changeOrderType() {
setTimeout(() => { setTimeout(() => {
console.log(data.parameters.OrderType) // console.log(data.parameters.OrderType)
}, 1000) }, 1000)
}, },
getMoney(){ getMoney(){
...@@ -210,6 +224,27 @@ ...@@ -210,6 +224,27 @@
}) })
}, },
submit() { submit() {
// const tc = TCNumRef as any //断言任意类型
// const name = ContactNameRef as any
// const num = ContactNumberRef as any
// tc.value.validate()
// name.value.validate()
// num.value.validate()
if(data.parameters.OrderType==1){
if(!data.parameters.ContactName){
message.warnMsg(`${t("hotel.car.inputText")}${t("hotel.car.ContactName")}`)
return
}if(!data.parameters.ContactNumber){
message.warnMsg(`${t("hotel.car.inputText")}${t("hotel.car.ContactNumber")}`)
return
}
}
if(data.parameters.OrderType==2&&!data.parameters.TCNum){
message.warnMsg(`${t("hotel.car.inputText")}${t("hotel.car.TCNum")}`)
return
}
data.parameters.DetailList = [] as Array<any> data.parameters.DetailList = [] as Array<any>
HotelCarList._value.forEach(item=>{ HotelCarList._value.forEach(item=>{
item.timeList.forEach(t=>{ item.timeList.forEach(t=>{
...@@ -233,19 +268,19 @@ ...@@ -233,19 +268,19 @@
}) })
}) })
console.log(data.parameters,'-----') // console.log(data.parameters,'-----')
return // return
data.loading = true data.loading = true
HotelService.SetCustomerOrder(param) HotelService.SetCustomerOrder(data.parameters)
.then(r => { .then(r => {
if (r.data.resultCode == ApiResult.SUCCESS) { if (r.data.resultCode == ApiResult.SUCCESS) {
message.successMsg(`${t('success')}`)
HotelCarList._value = [] as Array<any>
context.emit('close')
} else { } else {
message.errorMsg(r.data.message) message.errorMsg(r.data.message)
} }
data.loading = false data.loading = false
}) })
.catch(e => { .catch(e => {
...@@ -323,7 +358,7 @@ ...@@ -323,7 +358,7 @@
methods.getLength() methods.getLength()
methods.getMoney() methods.getMoney()
}) })
return {...toRefs(data),HotelCarList,...methods} return {...toRefs(data),HotelCarList,TCNumRef,ContactNameRef,ContactNumberRef,...methods}
} }
}) })
</script> </script>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<span class="fz14 q-pl-xs text-weight-bold">{{item.Unit_Price}}</span> <span class="fz14 q-pl-xs text-weight-bold">{{item.Unit_Price}}</span>
</div> </div>
</div> </div>
<div class="row items-center justify-between"> <div class="row items-center no-wrap justify-between">
<div> <div>
<q-btn rounded dense color="white" text-color="black" size="xs" icon="remove" @click='addGoods(item,0)'/> <q-btn rounded dense color="white" text-color="black" size="xs" icon="remove" @click='addGoods(item,0)'/>
</div> </div>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<q-btn rounded dense color="primary" size="xs" icon="add" @click='addGoods(item,1)'/> <q-btn rounded dense color="primary" size="xs" icon="add" @click='addGoods(item,1)'/>
</div> </div>
</div> </div>
<div class="row items-center justify-between q-pl-md"> <div class="row items-center no-wrap justify-between q-pl-md">
<div> <div>
<q-btn rounded dense color="white" text-color="black" size="xs" icon="remove" @click='addPeople(item,0)'/> <q-btn rounded dense color="white" text-color="black" size="xs" icon="remove" @click='addPeople(item,0)'/>
</div> </div>
......
...@@ -130,7 +130,11 @@ export default { ...@@ -130,7 +130,11 @@ export default {
OrderType: '訂單類型', OrderType: '訂單類型',
TCNum: '组团号', TCNum: '组团号',
ContactName: '联系人名稱', ContactName: '联系人名稱',
ContactNumber: '联系人电话' ContactNumber: '联系人电话',
inputText: '請輸入',
Remark: '備註',
scattered: '散客',
group: '團'
}, },
shopping:{ shopping:{
labelNum: '房數', labelNum: '房數',
......
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