feat: 代客下单修改退款退菜
This commit is contained in:
@@ -122,7 +122,7 @@
|
||||
@noteClick="showNote"
|
||||
@packClick="showPack"
|
||||
@changePriceClick="showChangePrice"
|
||||
@return="showReturn"
|
||||
@return="refReturnCartShow"
|
||||
/>
|
||||
</div>
|
||||
<div class="right">
|
||||
@@ -205,6 +205,8 @@
|
||||
|
||||
<!-- 就餐人数 -->
|
||||
<dinerNumber ref="refDinerNumber" @confirm="dinerNumberConfirm"></dinerNumber>
|
||||
<!-- 退菜 -->
|
||||
<returnCart ref="refReturnCart" @confirm="refReturnCartConfirm"></returnCart>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
@@ -214,6 +216,7 @@ import note from "./components/note.vue";
|
||||
import Order from "./components/order.vue";
|
||||
import pack from "./components/pack.vue";
|
||||
import changePrice from "./components/popup-cart-changePrice.vue";
|
||||
import returnCart from "./components/return-cart.vue";
|
||||
import chooseUser from "./components/choose-user.vue";
|
||||
import changeWeight from "./components/popup-weight-goods.vue";
|
||||
import changeTaocan from "./components/popup-taocan-goods.vue";
|
||||
@@ -230,20 +233,45 @@ import shopUserApi from "@/api/account/shopUser";
|
||||
import { useCartsStore } from "@/store/modules/carts";
|
||||
import { useUserStore } from "@/store/modules/user";
|
||||
|
||||
import { ElLoading } from "element-plus";
|
||||
import { ElLoading, ElMessage } from "element-plus";
|
||||
|
||||
const carts = useCartsStore();
|
||||
const shopUser = useUserStore();
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
//退菜
|
||||
const refReturnCart = ref();
|
||||
async function refReturnCartConfirm(e) {
|
||||
console.log(e);
|
||||
const res = await orderApi.refundOrder({
|
||||
...e,
|
||||
orderId: oldOrder.value.id,
|
||||
});
|
||||
ElMessage({
|
||||
type: res ? "success" : "error",
|
||||
text: res ? "退菜成功" : "操作失败",
|
||||
});
|
||||
if (res) {
|
||||
// 获取历史订单数据
|
||||
const res1 = await orderApi.getHistoryList({
|
||||
orderId: oldOrder.value.id,
|
||||
});
|
||||
oldOrder.value = res1;
|
||||
orderInfo.value = res1;
|
||||
carts.setOldOrder(res1);
|
||||
}
|
||||
}
|
||||
function refReturnCartShow(e) {
|
||||
const memberPrice = e.memberPrice || e.salePrice;
|
||||
refReturnCart.value.open({
|
||||
...e,
|
||||
price: e.discount_sale_amount || (carts.useVipPrice ? memberPrice : e.salePrice),
|
||||
});
|
||||
}
|
||||
|
||||
//整单备注
|
||||
const remark = ref("");
|
||||
//退菜
|
||||
function showReturn(cart) {
|
||||
console.log(cart);
|
||||
}
|
||||
|
||||
//就餐人数
|
||||
let perpole = ref("");
|
||||
|
||||
Reference in New Issue
Block a user