修复订单商品页面

This commit is contained in:
2025-07-30 02:42:59 +08:00
parent a73a7ea497
commit aa9e9a6b2f
9 changed files with 993 additions and 286 deletions

View File

@@ -97,7 +97,7 @@
已核销
</a-tooltip>
</a-tag>
<a-tag v-if="form.deliveryStatus == 30" color="bule">部分核销</a-tag>
<a-tag v-if="form.deliveryStatus == 30" color="blue">部分核销</a-tag>
</a-descriptions-item>
<!-- 第五排-->
<a-descriptions-item
@@ -178,6 +178,13 @@
<IdcardOutlined class="tag-icon"/>
IC季卡
</a-tag>
<a-tag v-if="form.payType == 18">
<IdcardOutlined class="tag-icon"/>
代付
</a-tag>
</template>
<template v-else>
<span class="text-gray-400">未支付</span>
</template>
</a-tooltip>
</a-descriptions-item>
@@ -219,7 +226,7 @@
<a-card class="order-card" :bordered="false">
<a-spin :spinning="loading">
<a-table
:data-source="orderInfo"
:data-source="orderGoods"
:columns="columns"
:pagination="false"
/>
@@ -236,13 +243,16 @@ import {ColumnItem} from 'ele-admin-pro/es/ele-pro-table/types';
import {
CheckOutlined,
CloseOutlined,
CoffeeOutlined
CoffeeOutlined,
WechatOutlined,
AlipayCircleOutlined,
IdcardOutlined
} from '@ant-design/icons-vue';
import {ShopOrder} from '@/api/shop/shopOrder/model';
import {BszxPay} from '@/api/bszx/bszxPay/model';
import {pageBszxPay} from '@/api/bszx/bszxPay';
import {toDateString} from 'ele-admin-pro';
import {copyText} from "@/utils/common";
import {listShopOrderGoods} from "@/api/shop/shopOrderGoods";
const useForm = Form.useForm;
@@ -264,7 +274,7 @@ const isUpdate = ref(false);
// 是否显示最大化切换按钮
const maxAble = ref(true);
// 订单信息
const orderInfo = ref<BszxPay[]>([]);
const orderGoods = ref<BszxPay[]>([]);
// 步骤条
const steps = ref<step[]>([
@@ -447,15 +457,26 @@ const updateVisible = (value: boolean) => {
const columns = ref<ColumnItem[]>([
{
title: '商品名称',
dataIndex: 'formName',
key: 'formName',
dataIndex: 'goodsName',
key: 'goodsName',
align: 'center',
width: 280
},
{
title: '金额',
dataIndex: 'price',
align: 'center'
align: 'center',
customRender: ({ record }) => {
return `${record.price || 0}`;
}
},
{
title: '数量',
dataIndex: 'quantity',
align: 'center',
customRender: ({ record }) => {
return record.quantity || 1;
}
},
{
title: '备注',
@@ -464,9 +485,12 @@ const columns = ref<ColumnItem[]>([
align: 'center'
},
{
title: '操作',
title: '是否免费',
dataIndex: 'isFree',
align: 'center'
align: 'center',
customRender: ({ record }) => {
return record.isFree ? '是' : '否';
}
}
]);
@@ -532,7 +556,7 @@ const loadSteps = (order) => {
// const getOrderInfo = () => {
// const orderId = props.data?.orderId;
// listOrderInfo({ orderId }).then((data) => {
// orderInfo.value = data.filter((d) => d.totalNum > 0);
// orderGoods.value = data.filter((d) => d.totalNum > 0);
// });
// };
@@ -547,16 +571,29 @@ watch(
if (props.data) {
loading.value = true;
assignObject(form, props.data);
pageBszxPay({orderNo: form.orderNo}).then((res) => {
if (res?.list) {
orderInfo.value = res?.list;
}
// 加载订单商品
if (form.orderId) {
listShopOrderGoods({orderId: form.orderId})
.then((data) => {
orderGoods.value = data || [];
})
.catch((error) => {
console.error('加载订单商品失败:', error);
orderGoods.value = [];
})
.finally(() => {
loading.value = false;
});
} else {
loading.value = false;
});
}
loadSteps(props.data);
}
} else {
resetFields();
orderGoods.value = [];
}
}
);