更新订单
This commit is contained in:
@@ -48,8 +48,8 @@
|
||||
|
||||
|
||||
|
||||
<view class="title">超时收费 </view>
|
||||
<nut-form>
|
||||
<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">
|
||||
<!-- 台费类型选择 -->
|
||||
@@ -82,15 +82,9 @@
|
||||
|
||||
|
||||
<view class="title">商品 </view>
|
||||
<view class="top-bar">
|
||||
<nut-button type="primary" plain size="small" @click="addGoods">新增商品</nut-button>
|
||||
</view>
|
||||
<nut-form>
|
||||
<!-- 台费类型、套餐、支付状态 三者在同一行布局 -->
|
||||
<view class="inline-goods-form" v-for="(item, index) in orderGoods" :key="index">
|
||||
|
||||
<view class="form-row">
|
||||
<!-- 台费类型选择 -->
|
||||
<nut-form-item label-position="top">
|
||||
<template v-slot:label>商品</template>
|
||||
<template v-slot:default>
|
||||
@@ -102,8 +96,6 @@
|
||||
</view>
|
||||
</template>
|
||||
</nut-form-item>
|
||||
|
||||
<!-- 套餐选择 -->
|
||||
<nut-form-item label-position="top">
|
||||
<template v-slot:label>售价</template>
|
||||
<template v-slot:default>
|
||||
@@ -113,10 +105,7 @@
|
||||
</template>
|
||||
</nut-form-item>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-row">
|
||||
<!-- 支付状态选择 -->
|
||||
<nut-form-item label-position="top">
|
||||
<template v-slot:label>支付状态</template>
|
||||
<template v-slot:default>
|
||||
@@ -125,7 +114,6 @@
|
||||
</view>
|
||||
</template>
|
||||
</nut-form-item>
|
||||
<!-- 套餐选择 -->
|
||||
<nut-form-item label-position="top">
|
||||
<template v-slot:label>操作</template>
|
||||
<template v-slot:default>
|
||||
@@ -135,12 +123,11 @@
|
||||
</template>
|
||||
</nut-form-item>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</nut-form>
|
||||
</nut-form>
|
||||
<view class="top-bar">
|
||||
<nut-button type="primary" plain size="small" @click="addGoods">新增商品</nut-button>
|
||||
</view>
|
||||
|
||||
<view class="title">订单优惠 </view>
|
||||
|
||||
@@ -152,7 +139,7 @@
|
||||
</template>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="备注">
|
||||
<nut-textarea v-model="form.remarks" :rows="3" :adjust-keyboard-to="bottom"
|
||||
<nut-textarea v-model="form.remarks" :rows="3"
|
||||
placeholder="请输入备注"></nut-textarea>
|
||||
</nut-form-item>
|
||||
</nut-form>
|
||||
@@ -225,7 +212,8 @@
|
||||
import {
|
||||
fetchCombos,
|
||||
fetchGoods,
|
||||
fetchAddOrder,
|
||||
fetchAddOrder,
|
||||
fetchEditOrder,
|
||||
fetchRoomOrder,
|
||||
} from '@/api/index';
|
||||
|
||||
@@ -264,7 +252,11 @@
|
||||
form.discount_amount = res.discount_amount
|
||||
form.remarks = res.remarks
|
||||
|
||||
orderGoods.value = res.goods
|
||||
orderGoods.value = res.goods
|
||||
|
||||
if (form.fee_type !== 3) {
|
||||
getCombos();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -509,22 +501,22 @@
|
||||
|
||||
// 提交表单
|
||||
const submitForm = () => {
|
||||
// const formData = {
|
||||
// room: room.value,
|
||||
// feeType: feeType.value,
|
||||
// selectedPackage: selectedPackage.value,
|
||||
// amount: amount.value,
|
||||
// paymentStatus: paymentStatus.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;
|
||||
fetchEditOrder(data).then(res => {
|
||||
console.log(res);
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '更新账单成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}, 500)
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user