处理开台

This commit is contained in:
2026-01-11 01:49:45 +08:00
parent 9e957d5dea
commit a14a51d575
26 changed files with 2495 additions and 297 deletions

View File

@@ -167,7 +167,7 @@
<view style="align-items: center;text-align: center; padding: 20rpx 60rpx;">
<nut-button type="primary" block @click="submitForm">
保存订单
开台
</nut-button>
</view>
</view>
@@ -218,11 +218,27 @@
toValue
} from 'vue';
import {
onLoad,
onShow,
onHide
} from '@dcloudio/uni-app';
import {
fetchCombos,
fetchGoods,
fetchAddOrder,
} from '@/api/index';
onLoad(options => {
console.log('onLoad');
// 获取房间ID
form.room_id = options.roomId
console.log(form);
console.log(options);
})
// // 选择房间弹窗
// const visibleRoomsPopup = ref(false);
@@ -277,29 +293,31 @@
form.fee_type_name = selectedValue.selectedOptions[0].label
form.fee_type = selectedValue.selectedOptions[0].value
console.log(form);
if (form.fee_type !== 3) {
getCombos();
}
visibleFeeTypePopup.value = false
}
const getCombos = () => {
console.log("获取套餐");
fetchCombos({
type: form.fee_type
}).then(res => {
console.log(res);
combos.value = res;
})
}
// 选择套餐弹窗
const visibleCombosPopup = ref(false);
// 选中的套餐
const popupCombosVal = ref([])
// 套餐列表
const combos = [{
value: 1,
label: '美团中包套餐'
},
{
value: 2,
label: '美团小包套餐'
},
{
value: 3,
label: '美团小包套餐'
},
];
const combos = ref([]);
// 选择套餐
const onConfirmCombos = (selectedValue) => {
console.log(selectedValue);
@@ -308,8 +326,6 @@
console.log(form);
visibleCombosPopup.value = false
}
// 支付状态弹窗
const visiblePaymentStatusPopup = ref(false);
// 选中的支付状态
@@ -342,7 +358,7 @@
if (popupPaymentTypeVal.value == 'fee') {
form.fee_pay_status_txt = selectedValue.selectedOptions[0].label
form.payment_status = selectedValue.selectedOptions[0].value
form.fee_pay_status = selectedValue.selectedOptions[0].value
}
if (popupPaymentTypeVal.value == 'over') {
form.over_pay_status_txt = selectedValue.selectedOptions[0].label
@@ -353,7 +369,6 @@
orderGoods.value[goodsPayIndex.value].goods_pay_status_txt = selectedValue.selectedOptions[0].label
orderGoods.value[goodsPayIndex.value].goods_pay_status = selectedValue.selectedOptions[0].value
}
console.log(form);
visiblePaymentStatusPopup.value = false
popupPaymentTypeVal.value = ''
@@ -363,18 +378,18 @@
// 订单商品列表
const orderGoods = ref([
// {
// goods_type_name: null,
// goods_type_id: null,
// goods_name: null,
// goods_id: null,
// goods_price: null,
// goods_pay_status: 0,
// goods_pay_status_txt: "请选择",
// cascader_val: []
// },
])
const orderGoods = ref([
// {
// goods_type_name: null,
// goods_type_id: null,
// goods_name: null,
// goods_id: null,
// goods_price: null,
// goods_pay_status: 0,
// goods_pay_status_txt: "请选择",
// cascader_val: []
// },
])
// 当前操作的商品
const goodsPayIndex = ref(0)
// 当前操作的商品
@@ -454,11 +469,10 @@
const form = reactive({
// room_id: 0,
// room_name: '选择房间',
order_type: 1, // 开台订单
room_id: 0,
fee_type: 0,
fee_type_name: '选择方式',
fee_type_name: '选择',
fee_combo_id: 0, // 套餐费用ID
fee_combo_name: '请选择', // 套餐费用名称
fee_amount: null, // 线下支付费用
@@ -476,6 +490,7 @@
})
// 商品列表
const selectGoods = ref([])
onMounted(() => {
fetchGoods().then(res => {
@@ -494,7 +509,17 @@
// amount: amount.value,
// paymentStatus: paymentStatus.value
// };
console.log('提交的订单数据:', orderGoods.value);
let data = {
order_goods: orderGoods.value,
order: form
}
console.log('提交的订单数据:', data);
// console.log('提交的订单数据:', form);
fetchAddOrder(data).then(res => {
console.log(res);
// selectGoods.value = res;
})
};
</script>
@@ -547,72 +572,4 @@
gap: 20rpx;
margin-bottom: 20rpx;
}
// .inline-goods-form {
// display: flex;
// justify-content: space-between;
// gap: 10rpx;
// /* 在元素之间添加间距 */
// }
// .inline-goods-form {
// display: flex;
// flex-wrap: nowrap;
// /* 防止换行 */
// align-items: flex-start;
// gap: 10rpx;
// margin-bottom: 20rpx;
// padding: 20rpx;
// background-color: #f8f9fa;
// border-radius: 16rpx;
// box-sizing: border-box;
// overflow: hidden;
// /* 防止溢出 */
// }
// /* 关键为每个表单项设置适当的flex属性 */
// .inline-goods-form .nut-form-item {
// flex: 1; /* 平均分配空间 */
// min-width: 0; /* 重要:允许内容收缩 */
// max-width: 100%; /* 防止溢出 */
// word-break: break-word; /* 文本换行 */
// overflow: hidden; /* 隐藏溢出内容 */
// }
// /* 确保内部元素不会撑开 */
// .inline-goods-form .nut-form-item__body {
// width: 100%;
// overflow: hidden;
// }
// /* 调整按钮大小 */
// .inline-goods-form .nut-button {
// max-width: 100%;
// white-space: nowrap;
// overflow: hidden;
// text-overflow: ellipsis;
// }
// .inline-goods-form {
// display: flex;
// flex-wrap: wrap; /* 确保元素在不足的宽度时换行 */
// justify-content: space-between;
// gap: 10rpx; /* 设置每个表单项之间的间距 */
// width: 100%;
// // box-sizing: border-box;
// }
// .inline-goods-form-item-50 {
// flex: 0 0 50% !important; /* 第一个表单项占 50% */
// }
// .inline-goods-form-item-25 {
// flex: 0 0 25% !important; /* 其他两个表单项各占 25% */
// }
// .inline-item {
// flex: 1;
// display: flex;
// flex-direction: column;
// }
</style>