处理订单

This commit is contained in:
2026-01-12 21:29:09 +08:00
parent 96d49a3cc2
commit d27423a1ab
6 changed files with 75 additions and 79 deletions

View File

@@ -434,8 +434,9 @@
room_id: 0,
fee_type: 0,
fee_type_name: '请选择',
fee_combo_id: 0, // 套餐费用ID
fee_combo_name: '请选择', // 套餐费用名称
fee_combo_id: 0, // 套餐ID
fee_combo_name: '请选择', // 套餐名称
// fee_combo_price: null,
fee_amount: null, // 线下支付费用
fee_pay_status: 0, // 费用支付状态
fee_pay_status_txt: '请选择', // 费用支付状态

View File

@@ -139,20 +139,19 @@
</template>
</nut-form-item>
<nut-form-item label="备注">
<nut-textarea v-model="form.remarks" :rows="3"
placeholder="请输入备注"></nut-textarea>
<nut-textarea v-model="form.remarks" :rows="3" placeholder="请输入备注"></nut-textarea>
</nut-form-item>
</nut-form>
<view style="align-items: center;text-align: center; padding: 20rpx 60rpx;">
<nut-button type="success" block @click="submitForm">
<nut-button type="success" block @click="submitForm(1)">
仅保存账单
</nut-button>
</view>
<view style="align-items: center;text-align: center; padding: 20rpx 60rpx;">
<nut-button type="danger" block @click="submitForm">
<nut-button type="danger" block @click="submitForm(2)">
保存账单并结束该房间
</nut-button>
</view>
@@ -186,12 +185,6 @@
</nut-popup>
<!-- <nut-popup v-model:visible="visibleRoomsPopup" position="bottom" safe-area-inset-bottom>
<nut-picker v-model="popupRoomsVal" :columns="rooms" :field-names="{text:'label',value:'value'}"
title="选择房间" @confirm="onConfirmRoom" @cancel="visibleRoomsPopup = false">
</nut-picker>
</nut-popup> -->
</view>
</template>
@@ -221,10 +214,8 @@
console.log('onLoad');
// 获取房间ID
form.room_id = options.roomId
// 获取房间订单详情
getRoomOrder()
console.log(form);
console.log(options);
})
@@ -474,6 +465,7 @@
fee_type_name: '请选择',
fee_combo_id: 0, // 套餐费用ID
fee_combo_name: '请选择', // 套餐费用名称
// fee_combo_price: null,
fee_amount: null, // 线下支付费用
fee_pay_status: 0, // 费用支付状态
fee_pay_status_txt: '请选择', // 费用支付状态
@@ -499,11 +491,12 @@
// 提交表
const submitForm = () => {
// 更新订
const submitForm = (flag) => {
let data = {
order_goods: orderGoods.value,
order: form
order: form,
flag: flag,
}
console.log('提交的订单数据:', data);
fetchEditOrder(data).then(res => {
@@ -518,7 +511,6 @@
});
}, 500)
})
};
</script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -204,9 +204,10 @@ const _sfc_main = {
fee_type: 0,
fee_type_name: "请选择",
fee_combo_id: 0,
// 套餐费用ID
// 套餐ID
fee_combo_name: "请选择",
// 套餐费用名称
// 套餐名称
// fee_combo_price: null,
fee_amount: null,
// 线下支付费用
fee_pay_status: 0,
@@ -236,9 +237,9 @@ const _sfc_main = {
order_goods: orderGoods.value,
order: form
};
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:469", "提交的订单数据:", data);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:470", "提交的订单数据:", data);
api_index.fetchAddOrder(data).then((res) => {
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:472", res);
common_vendor.index.__f__("log", "at pages/index/orderAdd.vue:473", res);
common_vendor.index.showToast({
icon: "none",
title: "开台成功"

View File

@@ -27,15 +27,15 @@ const _sfc_main = {
__name: "orderEdit",
setup(__props) {
common_vendor.onLoad((options) => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:221", "onLoad");
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:214", "onLoad");
form.room_id = options.roomId;
getRoomOrder();
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:228", form);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:229", options);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:219", form);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:220", options);
});
const getRoomOrder = () => {
api_index.fetchRoomOrder(form.room_id).then((res) => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:235", res);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:226", res);
form.room_id = res.room_id;
form.order_type = res.order_type;
form.fee_type = res.fee_type.value;
@@ -73,21 +73,21 @@ const _sfc_main = {
}
];
const onConfirmFeeType = (selectedValue) => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:290", selectedValue);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:281", selectedValue);
form.fee_type_name = selectedValue.selectedOptions[0].label;
form.fee_type = selectedValue.selectedOptions[0].value;
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:293", form);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:284", form);
if (form.fee_type !== 3) {
getCombos();
}
visibleFeeTypePopup.value = false;
};
const getCombos = () => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:302", "获取套餐");
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:293", "获取套餐");
api_index.fetchCombos({
type: form.fee_type
}).then((res) => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:306", res);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:297", res);
combos.value = res;
});
};
@@ -95,10 +95,10 @@ const _sfc_main = {
const popupCombosVal = common_vendor.ref([]);
const combos = common_vendor.ref([]);
const onConfirmCombos = (selectedValue) => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:321", selectedValue);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:312", selectedValue);
form.fee_combo_name = selectedValue.selectedOptions[0].label;
form.fee_combo_id = selectedValue.selectedOptions[0].value;
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:324", form);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:315", form);
visibleCombosPopup.value = false;
};
const visiblePaymentStatusPopup = common_vendor.ref(false);
@@ -122,7 +122,7 @@ const _sfc_main = {
popupPaymentTypeVal.value = type;
goodsPayIndex.value = index;
visiblePaymentStatusPopup.value = true;
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:352", type);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:343", type);
};
const onConfirmPaymentStatus = (selectedValue) => {
if (popupPaymentTypeVal.value == "fee") {
@@ -134,11 +134,11 @@ const _sfc_main = {
form.over_pay_status = selectedValue.selectedOptions[0].value;
}
if (popupPaymentTypeVal.value == "goods" && goodsPayIndex.value >= 0) {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:367", "处理商品支付状态", goodsPayIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:358", "处理商品支付状态", goodsPayIndex.value);
orderGoods.value[goodsPayIndex.value].goods_pay_status_txt = selectedValue.selectedOptions[0].label;
orderGoods.value[goodsPayIndex.value].goods_pay_status = selectedValue.selectedOptions[0].value;
}
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:371", form);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:362", form);
visiblePaymentStatusPopup.value = false;
popupPaymentTypeVal.value = "";
goodsPayIndex.value = -1;
@@ -158,7 +158,7 @@ const _sfc_main = {
const goodsPayIndex = common_vendor.ref(0);
const goodsIndex = common_vendor.ref(0);
const addGoods = () => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:398", orderGoods.value);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:389", orderGoods.value);
orderGoods.value.push({
goods_type_name: null,
goods_type_id: null,
@@ -184,12 +184,12 @@ const _sfc_main = {
}
});
const onGoodsChange = (...args) => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:426", "onGoodsChange", args);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:417", "onGoodsChange", args);
};
const onGoodsPathChange = (args) => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:430", "onGoodsPathChange", args);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:431", "goodsIndex", goodsIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:432", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:421", "onGoodsPathChange", args);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:422", "goodsIndex", goodsIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:423", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
orderGoods.value[goodsIndex.value].goods_type_name = null;
orderGoods.value[goodsIndex.value].goods_type_id = null;
orderGoods.value[goodsIndex.value].goods_name = null;
@@ -204,11 +204,11 @@ const _sfc_main = {
orderGoods.value[goodsIndex.value].goods_id = args[1].value;
orderGoods.value[goodsIndex.value].goods_price = args[1].goods_price;
}
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:448", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:439", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
};
const onCloseGoodsCascader = () => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:451", "onCloseGoodsCascader");
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:452", "goodsIndex.value", goodsIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:442", "onCloseGoodsCascader");
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:443", "goodsIndex.value", goodsIndex.value);
if (orderGoods.value[goodsIndex.value].goods_type_id && orderGoods.value[goodsIndex.value].goods_id) {
orderGoods.value[goodsIndex.value].cascader_val = [
orderGoods.value[goodsIndex.value].goods_type_id,
@@ -216,11 +216,11 @@ const _sfc_main = {
];
}
goodsIndex.value = 0;
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:460", "goodsIndex.value", goodsIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:451", "goodsIndex.value", goodsIndex.value);
};
const onOpenGoodsCascader = () => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:463", "onOpenGoodsCascader");
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:464", "goodsIndex.value", goodsIndex.value);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:454", "onOpenGoodsCascader");
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:455", "goodsIndex.value", goodsIndex.value);
};
const form = common_vendor.reactive({
order_type: 1,
@@ -232,6 +232,7 @@ const _sfc_main = {
// 套餐费用ID
fee_combo_name: "请选择",
// 套餐费用名称
// fee_combo_price: null,
fee_amount: null,
// 线下支付费用
fee_pay_status: 0,
@@ -255,14 +256,15 @@ const _sfc_main = {
selectGoods.value = res;
});
});
const submitForm = () => {
const submitForm = (flag) => {
let data = {
order_goods: orderGoods.value,
order: form
order: form,
flag
};
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:508", "提交的订单数据:", data);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:501", "提交的订单数据:", data);
api_index.fetchEditOrder(data).then((res) => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:510", res);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:503", res);
common_vendor.index.showToast({
icon: "none",
title: "更新账单成功"
@@ -392,12 +394,12 @@ const _sfc_main = {
L: common_vendor.p({
label: "备注"
}),
M: common_vendor.o(submitForm),
M: common_vendor.o(($event) => submitForm(1)),
N: common_vendor.p({
type: "success",
block: true
}),
O: common_vendor.o(submitForm),
O: common_vendor.o(($event) => submitForm(2)),
P: common_vendor.p({
type: "danger",
block: true