宴席2.0

This commit is contained in:
sjeam 2025-08-15 09:40:08 +08:00
parent 949007e1cd
commit c906d4132d
4 changed files with 169 additions and 74 deletions

View File

@ -0,0 +1,31 @@
<template>
<div class="dish-category">
<h4>{{ title }}</h4>
<slot></slot>
</div>
</template>
<script>
import { defineComponent } from 'vue';
export default defineComponent({
props: {
title: {
type: String,
required: true,
},
},
});
</script>
<style scoped>
.dish-category {
margin-bottom: 20px;
}
.dish-category h4 {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,31 @@
<template>
<div class="dish-category">
<h4>{{ title }}</h4>
<slot></slot>
</div>
</template>
<script>
import { defineComponent } from 'vue';
export default defineComponent({
props: {
title: {
type: String,
required: true,
},
},
});
</script>
<style scoped>
.dish-category {
margin-bottom: 20px;
}
.dish-category h4 {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
</style>

View File

@ -271,7 +271,7 @@ export default defineComponent({
phone: '', phone: '',
address: '', address: '',
remark: '', remark: '',
banquet_type: '', banquet_type: '1',
reservation_type: 1, reservation_type: 1,
server_user_id: 0, server_user_id: 0,
// table_number: 0, // table_number: 0,
@ -324,8 +324,23 @@ export default defineComponent({
}, },
// //
payOrder() { payOrder (order_id) {
this.close();
CommonApi.commonPost('/api/banquet/order/pay', {order_id:order_id}).catch((res) => {
if (res.code === 1) {
// this.payOrder(res.data.order_id);
// this.propShowOrder = true;
console.log(res.data);
// this.close();
} else {
uni.$u.toast(res.msg);
}
});
}, },
// //
getArea () { getArea () {
@ -359,11 +374,12 @@ export default defineComponent({
getBanquetType () { getBanquetType () {
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => { CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
if (res.code === 1) { if (res.code === 1) {
this.banquetType = res.data;
res.data.forEach(item => { res.data.forEach(item => {
item.label = item.name; item.label = item.name;
}); });
this.banquetType = res.data;
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }

View File

@ -158,13 +158,12 @@
<view>厨师姓名{{ server_user.public_name }}</view> <view>厨师姓名{{ server_user.public_name }}</view>
<view>厨师联系方式{{ server_user.phone }}</view> <view>厨师联系方式{{ server_user.phone }}</view>
<template #footer> <template #footer>
<wd-button size="small" plain @click="cookDetail( server_user.id)">查看详情</wd-button> <wd-button size="small" plain @click="cookDetail(server_user.id)">查看详情</wd-button>
</template> </template>
</wd-card> </wd-card>
<wd-card> <wd-card>
<template #title> <template #title>
<!-- <u-alert :show-icon="true" title="温馨提示:请确认酒席需求" type="" effect="dark" description=" "></u-alert> -->
</template> </template>
<view>1.(不交定金)如若厨师接到更高价订单可能会将您的订单取消</view> <view>1.(不交定金)如若厨师接到更高价订单可能会将您的订单取消</view>
<view>2.(付定金)如若厨师的做席档期存在冲突可能会致电与您沟通并推荐您更换厨师</view> <view>2.(付定金)如若厨师的做席档期存在冲突可能会致电与您沟通并推荐您更换厨师</view>
@ -175,7 +174,7 @@
<wd-cell-group border> <wd-cell-group border>
<view class="pb-4" /> <view class="pb-4" />
<wd-input label="联系姓名" prop="customer_name" clearable v-model="orderInfo.customer_name" placeholder="请填写联系姓名" <!-- <wd-input label="联系姓名" prop="customer_name" clearable v-model="orderInfo.customer_name" placeholder="请填写联系姓名"
:rules="[ :rules="[
{ {
required: false, required: false,
@ -224,18 +223,15 @@
message: '请输入详细地址' message: '请输入详细地址'
} }
]" /> ]" />
<wd-textarea label="备注" v-model="orderInfo.remark" placeholder="请填写备注" /> <wd-textarea label="备注" v-model="orderInfo.remark" placeholder="请填写备注" /> -->
<!-- <wd-button plain hairline custom-style="width: calc(100vw - 100rpx);" <wd-button plain hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(1)">确定支付</wd-button>
@click="handleSubmit(1)">确定预定做席后再支付</wd-button> <wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(2)">取消支付</wd-button>
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit(1)">付定金锁定订单</wd-button> -->
</wd-cell-group> </wd-cell-group>
</wd-form> </wd-form>
<!-- 一般的检举内容由承办的党的委员会或纪律检查委员会将处理意见或复议复查结论同申诉人见面听取其意见复议复查的结论和决定应交给申诉人一份 -->
<template #footer> <template #footer>
<!-- <wd-button size="small" plain>查看详情</wd-button> -->
</template> </template>
</wd-card> </wd-card>
</view> </view>
@ -270,7 +266,7 @@ export default defineComponent({
phone: '', phone: '',
address: '', address: '',
remark: '', remark: '',
banquet_type: '', banquet_type: '1',
reservation_type: 1, reservation_type: 1,
order_id: 0, order_id: 0,
// table_number: 0, // table_number: 0,
@ -284,7 +280,7 @@ export default defineComponent({
this.order_id = option.id;; this.order_id = option.id;;
this.orderInfo.order_id = option.id; this.orderInfo.order_id = option.id;
this.getOrderDetail() this.getOrderDetail()
this.getArea() // this.getArea()
}, },
created () { created () {
@ -293,76 +289,98 @@ export default defineComponent({
close () { close () {
this.propShowOrder = false; this.propShowOrder = false;
}, },
// // //
handleSubmit (reservation_type) { // handleSubmit (reservation_type) {
// console.log(this.orderInfo); // // console.log(this.orderInfo);
this.orderInfo.reservation_type = reservation_type; // // this.orderInfo.reservation_type = reservation_type; //
this.$refs.form.validate() // this.$refs.form.validate()
.then(({ valid, errors }) => { // .then(({ valid, errors }) => {
if (valid) { // if (valid) {
this.orderInfo.address = this.address_string + this.orderInfo.street_name; // this.orderInfo.address = this.address_string + this.orderInfo.street_name;
console.log(this.orderInfo); // console.log(this.orderInfo);
this.addOrder(); // this.addOrder();
} // }
}) // })
.catch((error) => { // .catch((error) => {
console.log(error, 'error') // console.log(error, 'error')
}) // })
}, // },
// // //
addOrder () { // addOrder () {
CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => { // CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
if (res.code === 1) { // if (res.code === 1) {
this.propShowOrder = true; // this.payOrder(res.data.order_id);
} else {
uni.$u.toast(res.msg); // this.propShowOrder = true;
} // } else {
}); // uni.$u.toast(res.msg);
}, // }
// });
// },
// //
payOrder () { payOrder (type) {
this.close(); if (type === 1) {
}, //
// CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
getArea () { if (res.code === 1) {
this.area = [colPickerData.map(item => ({ // this.payOrder(res.data.order_id);
value: item.value,
label: item.text // this.propShowOrder = true;
}))];
}, console.log(res.data);
//-- // this.close();
handleConfirm (value) { } else {
this.address_string = value.selectedItems.map(item => item.label).join('') uni.$u.toast(res.msg);
}, }
// });
columnChange ({ selectedItem, resolve, finish }) { } else {
try { //
const areaData = findChildrenByCode(colPickerData, selectedItem.value);
if (areaData && areaData.length) {
resolve(areaData.map(item => ({
value: item.value,
label: item.text
})));
} else {
finish();
}
} catch (error) {
console.error('处理列变更时出错:', error);
finish(); //
} }
}, },
// //
// getArea () {
// this.area = [colPickerData.map(item => ({
// value: item.value,
// label: item.text
// }))];
// },
// //--
// handleConfirm (value) {
// this.address_string = value.selectedItems.map(item => item.label).join('')
// },
// //
// columnChange ({ selectedItem, resolve, finish }) {
// try {
// const areaData = findChildrenByCode(colPickerData, selectedItem.value);
// if (areaData && areaData.length) {
// resolve(areaData.map(item => ({
// value: item.value,
// label: item.text
// })));
// } else {
// finish();
// }
// } catch (error) {
// console.error(':', error);
// finish(); //
// }
// },
// //
getBanquetType () { getBanquetType () {
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => { CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
if (res.code === 1) { if (res.code === 1) {
this.banquetType = res.data;
res.data.forEach(item => { res.data.forEach(item => {
item.label = item.name; item.label = item.name;
}); });
this.banquetType = res.data;
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }
@ -370,10 +388,9 @@ export default defineComponent({
}, },
// // // //
getOrderDetail () { getOrderDetail () {
CommonApi.commonPost('/api/banquet/order/detail', { order_id: this.order_id }).catch((res) => { CommonApi.commonGet('/api/banquet/order/detail', { order_id: this.order_id }).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
console.log(res)
console.log(res)
// this.matchedItems_sp = res.data.cart_list; // this.matchedItems_sp = res.data.cart_list;
// this.totalPrice = res.data.total_price; // this.totalPrice = res.data.total_price;
// this.server_user.phone = res.data.server_user.certification.phone; // this.server_user.phone = res.data.server_user.certification.phone;