mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 10:29:20 +08:00
1
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import type { OrderDTO, OrderVO } from '#/api/ecommerce/order';
|
||||
import type { OrderStatusVO } from '#/api/ecommerce/order-status';
|
||||
import type { ShopVO } from '#/api/ecommerce/shop/types';
|
||||
import type { PageQueryDTO } from '#/types/common';
|
||||
|
||||
@@ -13,8 +12,12 @@ import { createIconifyIcon } from '@vben/icons';
|
||||
import { Button, message, Popconfirm, Space, Tag } from 'ant-design-vue';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { deleteOrderApi, getOrderPageApi } from '#/api/ecommerce/order';
|
||||
import { getActiveOrderStatusListApi } from '#/api/ecommerce/order-status';
|
||||
import {
|
||||
deleteOrderApi,
|
||||
getOrderPageApi,
|
||||
} from '#/api/ecommerce/order';
|
||||
import { getAllOrderStatusListApi } from '#/api/ecommerce/order-status';
|
||||
import type { OrderStatusVO } from '#/api/ecommerce/order-status/types';
|
||||
import { getShopPageApi } from '#/api/ecommerce/shop';
|
||||
|
||||
import OrderFormModal from './components/OrderFormModal.vue';
|
||||
@@ -79,7 +82,7 @@ const gridOptions: VxeGridProps<any> = {
|
||||
slots: { default: 'orderStatus' },
|
||||
},
|
||||
{
|
||||
field: 'orderDate',
|
||||
field: 'orderTime',
|
||||
title: '下单时间',
|
||||
minWidth: 'auto',
|
||||
},
|
||||
@@ -190,7 +193,7 @@ const formOptions = computed(() => ({
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
placeholder: '请选择状态',
|
||||
options: orderStatusOptions.value,
|
||||
options: orderStatusOptions,
|
||||
allowClear: true,
|
||||
},
|
||||
fieldName: 'statusId',
|
||||
@@ -230,7 +233,7 @@ async function fetchShopOptions() {
|
||||
// 获取订单状态选项
|
||||
async function fetchOrderStatusOptions() {
|
||||
try {
|
||||
const data = await getActiveOrderStatusListApi();
|
||||
const data = await getAllOrderStatusListApi();
|
||||
orderStatusOptions.value = data.map((status: OrderStatusVO.Info) => ({
|
||||
label: status.statusName,
|
||||
value: status.id,
|
||||
@@ -277,7 +280,8 @@ function handleModalSuccess() {
|
||||
|
||||
// 初始化
|
||||
onMounted(async () => {
|
||||
await Promise.all([fetchShopOptions(), fetchOrderStatusOptions()]);
|
||||
await fetchShopOptions();
|
||||
await fetchOrderStatusOptions();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -297,10 +301,10 @@ onMounted(async () => {
|
||||
|
||||
<!-- 商品信息列 -->
|
||||
<template #productInfo="{ row }: { row: any }">
|
||||
<div v-if="row.productName">
|
||||
<div style="font-weight: bold">{{ row.productName }}</div>
|
||||
<div v-if="row.specName" style="color: #666; font-size: 12px">
|
||||
{{ row.specName }}
|
||||
<div v-if="row.linkProductName">
|
||||
<div style="font-weight: bold">{{ row.linkProductName }}</div>
|
||||
<div v-if="row.linkSpecName" style="color: #666; font-size: 12px">
|
||||
{{ row.linkSpecName }}
|
||||
</div>
|
||||
</div>
|
||||
<span v-else style="color: #999">暂无商品信息</span>
|
||||
@@ -321,11 +325,7 @@ onMounted(async () => {
|
||||
<!-- 订单状态列 -->
|
||||
<template #orderStatus="{ row }: { row: any }">
|
||||
<Tag color="blue">
|
||||
{{
|
||||
orderStatusOptions.find((s) => s.value === row.statusId)?.label ||
|
||||
row.statusName ||
|
||||
'未知状态'
|
||||
}}
|
||||
{{ row.statusName || '未知状态' }}
|
||||
</Tag>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user