处理订单
This commit is contained in:
@@ -133,9 +133,9 @@
|
||||
</nut-form-item>
|
||||
</view>
|
||||
</view>
|
||||
</nut-form>
|
||||
<view class="top-bar">
|
||||
<nut-button type="primary" plain size="small" @click="addGoods">新增商品</nut-button>
|
||||
</nut-form>
|
||||
<view class="top-bar">
|
||||
<nut-button type="primary" plain size="small" @click="addGoods">新增商品</nut-button>
|
||||
</view>
|
||||
|
||||
<view class="title">订单优惠 </view>
|
||||
@@ -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: '请选择', // 费用支付状态
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
|
||||
|
||||
|
||||
<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 ">
|
||||
<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 ">
|
||||
<!-- 台费类型、套餐、支付状态 三者在同一行布局 -->
|
||||
<view class="inline-form">
|
||||
<!-- 台费类型选择 -->
|
||||
@@ -124,9 +124,9 @@
|
||||
</nut-form-item>
|
||||
</view>
|
||||
</view>
|
||||
</nut-form>
|
||||
<view class="top-bar">
|
||||
<nut-button type="primary" plain size="small" @click="addGoods">新增商品</nut-button>
|
||||
</nut-form>
|
||||
<view class="top-bar">
|
||||
<nut-button type="primary" plain size="small" @click="addGoods">新增商品</nut-button>
|
||||
</view>
|
||||
|
||||
<view class="title">订单优惠 </view>
|
||||
@@ -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>
|
||||
|
||||
@@ -212,7 +205,7 @@
|
||||
import {
|
||||
fetchCombos,
|
||||
fetchGoods,
|
||||
fetchAddOrder,
|
||||
fetchAddOrder,
|
||||
fetchEditOrder,
|
||||
fetchRoomOrder,
|
||||
} from '@/api/index';
|
||||
@@ -221,10 +214,8 @@
|
||||
console.log('onLoad');
|
||||
// 获取房间ID
|
||||
form.room_id = options.roomId
|
||||
|
||||
// 获取房间订单详情
|
||||
getRoomOrder()
|
||||
|
||||
|
||||
console.log(form);
|
||||
console.log(options);
|
||||
})
|
||||
@@ -252,10 +243,10 @@
|
||||
form.discount_amount = res.discount_amount
|
||||
form.remarks = res.remarks
|
||||
|
||||
orderGoods.value = res.goods
|
||||
|
||||
if (form.fee_type !== 3) {
|
||||
getCombos();
|
||||
orderGoods.value = res.goods
|
||||
|
||||
if (form.fee_type !== 3) {
|
||||
getCombos();
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -361,7 +352,7 @@
|
||||
if (popupPaymentTypeVal.value == 'over') {
|
||||
form.over_pay_status_txt = selectedValue.selectedOptions[0].label
|
||||
form.over_pay_status = selectedValue.selectedOptions[0].value
|
||||
}
|
||||
}
|
||||
// 商品
|
||||
if (popupPaymentTypeVal.value == 'goods' && goodsPayIndex.value >= 0) {
|
||||
console.log("处理商品支付状态", goodsPayIndex.value);
|
||||
@@ -473,7 +464,8 @@
|
||||
fee_type: 0,
|
||||
fee_type_name: '请选择',
|
||||
fee_combo_id: 0, // 套餐费用ID
|
||||
fee_combo_name: '请选择', // 套餐费用名称
|
||||
fee_combo_name: '请选择', // 套餐费用名称
|
||||
// fee_combo_price: null,
|
||||
fee_amount: null, // 线下支付费用
|
||||
fee_pay_status: 0, // 费用支付状态
|
||||
fee_pay_status_txt: '请选择', // 费用支付状态
|
||||
@@ -499,26 +491,26 @@
|
||||
|
||||
|
||||
|
||||
// 提交表单
|
||||
const submitForm = () => {
|
||||
// 更新订单
|
||||
const submitForm = (flag) => {
|
||||
let data = {
|
||||
order_goods: orderGoods.value,
|
||||
order: form
|
||||
order: form,
|
||||
flag: flag,
|
||||
}
|
||||
console.log('提交的订单数据:', data);
|
||||
fetchEditOrder(data).then(res => {
|
||||
console.log(res);
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '更新账单成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
console.log(res);
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '更新账单成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}, 500)
|
||||
})
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user