对接订单列表接口

This commit is contained in:
gyq
2025-03-01 14:08:24 +08:00
parent d3ed4ec8e6
commit 573dd88b24
21 changed files with 2769 additions and 1674 deletions

View File

@@ -25,7 +25,7 @@
</div>
<span class="title">{{ item.payName }}</span>
</div>
<div class="item" :class="{ active: payActive == 'buyer' }"
<!-- <div class="item" :class="{ active: payActive == 'buyer' }"
@click="payTypeChange('buyer', { payType: 'buyer' })">
<div class="icon">
<div class="img"
@@ -34,7 +34,7 @@
</div>
</div>
<span class="title">挂账</span>
</div>
</div> -->
</div>
<div class="input_wrap">
<div class="input" style="flex: 1;">储值:{{ money }}</div>
@@ -62,7 +62,7 @@
</div>
</div>
<scanModal ref="scanModalRef" :amount="props.amount" :money="money" :orderId="props.orderId"
:selecttype="props.selecttype" :payType="payType" @success="scanCodeSuccess" />
:selecttype="props.selecttype" :payType="payType" :payData="payData" @success="scanCodeSuccess" />
<el-dialog :title="`选择会员`" top="3vh" v-model="showDialog" width="80%">
<el-form inline>
<el-form-item>
@@ -147,6 +147,8 @@ import { queryMembermember, createMembermember, membermemberScanPay, accountPaym
import { useUser } from "@/store/user.js"
import { clearNoNum, formatDecimal } from '@/utils'
import { getPayType } from '@/api/account.js'
import scanModal from '@/components/payCard/scanModal.vue'
import { ElMessage } from "element-plus";
import { useGlobal } from '@/store/global.js'
@@ -202,6 +204,7 @@ const payActive = ref(0)
const payType = ref('')
const payList = ref([])
const payLoading = ref(false)
const payData = ref({})
// 挂账人 start
const showBuyer = ref(false)
@@ -281,8 +284,8 @@ function scanCodeSuccess() {
// 切换支付类型
async function payTypeChange(index, item) {
try {
await staffPermission('yun_xu_shou_kuan')
if (item.disabled) return
// await staffPermission('yun_xu_shou_kuan')
// if (item.disabled) return
payActive.value = index
payType.value = item.payType
if (item.payType == 'scanCode') {
@@ -310,27 +313,11 @@ async function confirmOrder() {
try {
payLoading.value = true
// 暂时使用现金支付
await cashPay({
shopId: store.shopInfo.id,
checkOrderPay: {
orderId: goodsStore.orderInfo.id,
userId: '',
seatNum: 0, // 用餐人数
originAmount: goodsStore.orderInfo.originAmount, // 订单原金额(包含打包费+餐位费) 不含折扣价格
discountRatio: 1, // 折扣比例(计算时 向上取整保留 两位小数)
discountAmount: 0, // 手动优惠金额
productCouponDiscountAmount: 0, // 商品优惠券抵扣金额
fullCouponDiscountAmount: 0, // 满减优惠券抵扣金额
couponList: [], // 用户使用的卡券
orderAmount: goodsStore.orderInfo.originAmount, // 订单金额
roundAmount: 0, // 抹零金额 减免多少钱
pointsDiscountAmount: 0, // 积分抵扣金额(tb_points_basic_setting表)
pointsNum: 0 // 使用的积分数量 (扣除各类折扣 enable_deduction后使用)
}
})
await cashPay(payData.value)
payLoading.value = false
ElMessage.success('支付成功')
goodsStore.successDeleteCartItem()
emit('paySuccess')
return
await staffPermission('yun_xu_shou_kuan')
@@ -418,9 +405,7 @@ function delHandle() {
// 获取支付方式
async function queryPayTypeAjax() {
try {
const res = await queryPayType({
shopId: store.userInfo.shopId
})
const res = await getPayType()
res.map(item => {
if (props.amount <= 0 && item.payType == 'scanCode') {
@@ -431,7 +416,7 @@ async function queryPayTypeAjax() {
})
payList.value = res
if ((res[0].payType == 'scanCode' && !res[0].disabled) || res[0].payType == 'deposit') {
if (res[0].payType == 'scanCode' && !res[0].disabled) {
scanModalRef.value.show()
payType.value = res[0].payType
}
@@ -506,7 +491,28 @@ function cancelDiscount() {
onMounted(() => {
money.value = `${formatDecimal(props.amount)}`
// queryPayTypeAjax()
payData.value = {
shopId: store.shopInfo.id,
buyerRemark: '', // 订单备注
checkOrderPay: {
orderId: goodsStore.orderListInfo.id,
userId: '',
seatNum: goodsStore.tableInfo.num, // 用餐人数
originAmount: goodsStore.orderListInfo.originAmount, // 订单原金额(包含打包费+餐位费) 不含折扣价格
discountRatio: 1, // 折扣比例(计算时 向上取整保留 两位小数)
discountAmount: 0, // 手动优惠金额
productCouponDiscountAmount: 0, // 商品优惠券抵扣金额
fullCouponDiscountAmount: 0, // 满减优惠券抵扣金额
couponList: [], // 用户使用的卡券
orderAmount: goodsStore.orderListInfo.originAmount, // 订单金额
roundAmount: 0, // 抹零金额 减免多少钱
pointsDiscountAmount: 0, // 积分抵扣金额(tb_points_basic_setting表)
pointsNum: 0 // 使用的积分数量 (扣除各类折扣 enable_deduction后使用)
}
}
queryPayTypeAjax()
})
</script>