处理订单

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

@@ -133,9 +133,9 @@
</nut-form-item> </nut-form-item>
</view> </view>
</view> </view>
</nut-form> </nut-form>
<view class="top-bar"> <view class="top-bar">
<nut-button type="primary" plain size="small" @click="addGoods">新增商品</nut-button> <nut-button type="primary" plain size="small" @click="addGoods">新增商品</nut-button>
</view> </view>
<view class="title">订单优惠 </view> <view class="title">订单优惠 </view>
@@ -434,8 +434,9 @@
room_id: 0, room_id: 0,
fee_type: 0, fee_type: 0,
fee_type_name: '请选择', fee_type_name: '请选择',
fee_combo_id: 0, // 套餐费用ID fee_combo_id: 0, // 套餐ID
fee_combo_name: '请选择', // 套餐费用名称 fee_combo_name: '请选择', // 套餐名称
// fee_combo_price: null,
fee_amount: null, // 线下支付费用 fee_amount: null, // 线下支付费用
fee_pay_status: 0, // 费用支付状态 fee_pay_status: 0, // 费用支付状态
fee_pay_status_txt: '请选择', // 费用支付状态 fee_pay_status_txt: '请选择', // 费用支付状态

View File

@@ -48,8 +48,8 @@
<view class="title" v-if="form.fee_type==1 || form.fee_type==2 ">超时收费 </view> <view class="title" v-if="form.fee_type==1 || form.fee_type==2 ">超时收费 </view>
<nut-form v-if="form.fee_type==1 || form.fee_type==2 "> <nut-form v-if="form.fee_type==1 || form.fee_type==2 ">
<!-- 台费类型套餐支付状态 三者在同一行布局 --> <!-- 台费类型套餐支付状态 三者在同一行布局 -->
<view class="inline-form"> <view class="inline-form">
<!-- 台费类型选择 --> <!-- 台费类型选择 -->
@@ -124,9 +124,9 @@
</nut-form-item> </nut-form-item>
</view> </view>
</view> </view>
</nut-form> </nut-form>
<view class="top-bar"> <view class="top-bar">
<nut-button type="primary" plain size="small" @click="addGoods">新增商品</nut-button> <nut-button type="primary" plain size="small" @click="addGoods">新增商品</nut-button>
</view> </view>
<view class="title">订单优惠 </view> <view class="title">订单优惠 </view>
@@ -139,20 +139,19 @@
</template> </template>
</nut-form-item> </nut-form-item>
<nut-form-item label="备注"> <nut-form-item label="备注">
<nut-textarea v-model="form.remarks" :rows="3" <nut-textarea v-model="form.remarks" :rows="3" placeholder="请输入备注"></nut-textarea>
placeholder="请输入备注"></nut-textarea>
</nut-form-item> </nut-form-item>
</nut-form> </nut-form>
<view style="align-items: center;text-align: center; padding: 20rpx 60rpx;"> <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> </nut-button>
</view> </view>
<view style="align-items: center;text-align: center; padding: 20rpx 60rpx;"> <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> </nut-button>
</view> </view>
@@ -186,12 +185,6 @@
</nut-popup> </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> </view>
</template> </template>
@@ -212,7 +205,7 @@
import { import {
fetchCombos, fetchCombos,
fetchGoods, fetchGoods,
fetchAddOrder, fetchAddOrder,
fetchEditOrder, fetchEditOrder,
fetchRoomOrder, fetchRoomOrder,
} from '@/api/index'; } from '@/api/index';
@@ -221,10 +214,8 @@
console.log('onLoad'); console.log('onLoad');
// 获取房间ID // 获取房间ID
form.room_id = options.roomId form.room_id = options.roomId
// 获取房间订单详情
getRoomOrder() getRoomOrder()
console.log(form); console.log(form);
console.log(options); console.log(options);
}) })
@@ -252,10 +243,10 @@
form.discount_amount = res.discount_amount form.discount_amount = res.discount_amount
form.remarks = res.remarks form.remarks = res.remarks
orderGoods.value = res.goods orderGoods.value = res.goods
if (form.fee_type !== 3) { if (form.fee_type !== 3) {
getCombos(); getCombos();
} }
}) })
} }
@@ -361,7 +352,7 @@
if (popupPaymentTypeVal.value == 'over') { if (popupPaymentTypeVal.value == 'over') {
form.over_pay_status_txt = selectedValue.selectedOptions[0].label form.over_pay_status_txt = selectedValue.selectedOptions[0].label
form.over_pay_status = selectedValue.selectedOptions[0].value form.over_pay_status = selectedValue.selectedOptions[0].value
} }
// 商品 // 商品
if (popupPaymentTypeVal.value == 'goods' && goodsPayIndex.value >= 0) { if (popupPaymentTypeVal.value == 'goods' && goodsPayIndex.value >= 0) {
console.log("处理商品支付状态", goodsPayIndex.value); console.log("处理商品支付状态", goodsPayIndex.value);
@@ -473,7 +464,8 @@
fee_type: 0, fee_type: 0,
fee_type_name: '请选择', fee_type_name: '请选择',
fee_combo_id: 0, // 套餐费用ID fee_combo_id: 0, // 套餐费用ID
fee_combo_name: '请选择', // 套餐费用名称 fee_combo_name: '请选择', // 套餐费用名称
// fee_combo_price: null,
fee_amount: null, // 线下支付费用 fee_amount: null, // 线下支付费用
fee_pay_status: 0, // 费用支付状态 fee_pay_status: 0, // 费用支付状态
fee_pay_status_txt: '请选择', // 费用支付状态 fee_pay_status_txt: '请选择', // 费用支付状态
@@ -499,26 +491,26 @@
// 提交表 // 更新订
const submitForm = () => { const submitForm = (flag) => {
let data = { let data = {
order_goods: orderGoods.value, order_goods: orderGoods.value,
order: form order: form,
flag: flag,
} }
console.log('提交的订单数据:', data); console.log('提交的订单数据:', data);
fetchEditOrder(data).then(res => { fetchEditOrder(data).then(res => {
console.log(res); console.log(res);
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '更新账单成功' title: '更新账单成功'
}) })
setTimeout(() => { setTimeout(() => {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}); });
}, 500) }, 500)
}) })
}; };
</script> </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: 0,
fee_type_name: "请选择", fee_type_name: "请选择",
fee_combo_id: 0, fee_combo_id: 0,
// 套餐费用ID // 套餐ID
fee_combo_name: "请选择", fee_combo_name: "请选择",
// 套餐费用名称 // 套餐名称
// fee_combo_price: null,
fee_amount: null, fee_amount: null,
// 线下支付费用 // 线下支付费用
fee_pay_status: 0, fee_pay_status: 0,
@@ -236,9 +237,9 @@ const _sfc_main = {
order_goods: orderGoods.value, order_goods: orderGoods.value,
order: form 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) => { 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({ common_vendor.index.showToast({
icon: "none", icon: "none",
title: "开台成功" title: "开台成功"

View File

@@ -27,15 +27,15 @@ const _sfc_main = {
__name: "orderEdit", __name: "orderEdit",
setup(__props) { setup(__props) {
common_vendor.onLoad((options) => { 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; form.room_id = options.roomId;
getRoomOrder(); getRoomOrder();
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:228", form); common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:219", form);
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:229", options); common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:220", options);
}); });
const getRoomOrder = () => { const getRoomOrder = () => {
api_index.fetchRoomOrder(form.room_id).then((res) => { 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.room_id = res.room_id;
form.order_type = res.order_type; form.order_type = res.order_type;
form.fee_type = res.fee_type.value; form.fee_type = res.fee_type.value;
@@ -73,21 +73,21 @@ const _sfc_main = {
} }
]; ];
const onConfirmFeeType = (selectedValue) => { 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_name = selectedValue.selectedOptions[0].label;
form.fee_type = selectedValue.selectedOptions[0].value; 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) { if (form.fee_type !== 3) {
getCombos(); getCombos();
} }
visibleFeeTypePopup.value = false; visibleFeeTypePopup.value = false;
}; };
const getCombos = () => { 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({ api_index.fetchCombos({
type: form.fee_type type: form.fee_type
}).then((res) => { }).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; combos.value = res;
}); });
}; };
@@ -95,10 +95,10 @@ const _sfc_main = {
const popupCombosVal = common_vendor.ref([]); const popupCombosVal = common_vendor.ref([]);
const combos = common_vendor.ref([]); const combos = common_vendor.ref([]);
const onConfirmCombos = (selectedValue) => { 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_name = selectedValue.selectedOptions[0].label;
form.fee_combo_id = selectedValue.selectedOptions[0].value; 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; visibleCombosPopup.value = false;
}; };
const visiblePaymentStatusPopup = common_vendor.ref(false); const visiblePaymentStatusPopup = common_vendor.ref(false);
@@ -122,7 +122,7 @@ const _sfc_main = {
popupPaymentTypeVal.value = type; popupPaymentTypeVal.value = type;
goodsPayIndex.value = index; goodsPayIndex.value = index;
visiblePaymentStatusPopup.value = true; 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) => { const onConfirmPaymentStatus = (selectedValue) => {
if (popupPaymentTypeVal.value == "fee") { if (popupPaymentTypeVal.value == "fee") {
@@ -134,11 +134,11 @@ const _sfc_main = {
form.over_pay_status = selectedValue.selectedOptions[0].value; form.over_pay_status = selectedValue.selectedOptions[0].value;
} }
if (popupPaymentTypeVal.value == "goods" && goodsPayIndex.value >= 0) { 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_txt = selectedValue.selectedOptions[0].label;
orderGoods.value[goodsPayIndex.value].goods_pay_status = selectedValue.selectedOptions[0].value; 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; visiblePaymentStatusPopup.value = false;
popupPaymentTypeVal.value = ""; popupPaymentTypeVal.value = "";
goodsPayIndex.value = -1; goodsPayIndex.value = -1;
@@ -158,7 +158,7 @@ const _sfc_main = {
const goodsPayIndex = common_vendor.ref(0); const goodsPayIndex = common_vendor.ref(0);
const goodsIndex = common_vendor.ref(0); const goodsIndex = common_vendor.ref(0);
const addGoods = () => { 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({ orderGoods.value.push({
goods_type_name: null, goods_type_name: null,
goods_type_id: null, goods_type_id: null,
@@ -184,12 +184,12 @@ const _sfc_main = {
} }
}); });
const onGoodsChange = (...args) => { 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) => { 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:421", "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:422", "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:423", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
orderGoods.value[goodsIndex.value].goods_type_name = null; orderGoods.value[goodsIndex.value].goods_type_name = null;
orderGoods.value[goodsIndex.value].goods_type_id = null; orderGoods.value[goodsIndex.value].goods_type_id = null;
orderGoods.value[goodsIndex.value].goods_name = 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_id = args[1].value;
orderGoods.value[goodsIndex.value].goods_price = args[1].goods_price; 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 = () => { const onCloseGoodsCascader = () => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:451", "onCloseGoodsCascader"); common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:442", "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:443", "goodsIndex.value", goodsIndex.value);
if (orderGoods.value[goodsIndex.value].goods_type_id && orderGoods.value[goodsIndex.value].goods_id) { if (orderGoods.value[goodsIndex.value].goods_type_id && orderGoods.value[goodsIndex.value].goods_id) {
orderGoods.value[goodsIndex.value].cascader_val = [ orderGoods.value[goodsIndex.value].cascader_val = [
orderGoods.value[goodsIndex.value].goods_type_id, orderGoods.value[goodsIndex.value].goods_type_id,
@@ -216,11 +216,11 @@ const _sfc_main = {
]; ];
} }
goodsIndex.value = 0; 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 = () => { const onOpenGoodsCascader = () => {
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:463", "onOpenGoodsCascader"); common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:454", "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:455", "goodsIndex.value", goodsIndex.value);
}; };
const form = common_vendor.reactive({ const form = common_vendor.reactive({
order_type: 1, order_type: 1,
@@ -232,6 +232,7 @@ const _sfc_main = {
// 套餐费用ID // 套餐费用ID
fee_combo_name: "请选择", fee_combo_name: "请选择",
// 套餐费用名称 // 套餐费用名称
// fee_combo_price: null,
fee_amount: null, fee_amount: null,
// 线下支付费用 // 线下支付费用
fee_pay_status: 0, fee_pay_status: 0,
@@ -255,14 +256,15 @@ const _sfc_main = {
selectGoods.value = res; selectGoods.value = res;
}); });
}); });
const submitForm = () => { const submitForm = (flag) => {
let data = { let data = {
order_goods: orderGoods.value, 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) => { 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({ common_vendor.index.showToast({
icon: "none", icon: "none",
title: "更新账单成功" title: "更新账单成功"
@@ -392,12 +394,12 @@ const _sfc_main = {
L: common_vendor.p({ L: common_vendor.p({
label: "备注" label: "备注"
}), }),
M: common_vendor.o(submitForm), M: common_vendor.o(($event) => submitForm(1)),
N: common_vendor.p({ N: common_vendor.p({
type: "success", type: "success",
block: true block: true
}), }),
O: common_vendor.o(submitForm), O: common_vendor.o(($event) => submitForm(2)),
P: common_vendor.p({ P: common_vendor.p({
type: "danger", type: "danger",
block: true block: true