feat:【代码优化】减少部分模块的 import * 的 API
This commit is contained in:
@@ -9,7 +9,7 @@ import { $t } from '@vben/locales';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import * as AfterSaleApi from '#/api/mall/trade/afterSale/index';
|
||||
import { disagreeAfterSale } from '#/api/mall/trade/afterSale';
|
||||
|
||||
import { useDisagreeFormSchema } from '../data';
|
||||
|
||||
@@ -40,7 +40,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
try {
|
||||
const data =
|
||||
(await formApi.getValues()) as MallAfterSaleApi.DisagreeRequest;
|
||||
await AfterSaleApi.disagreeAfterSale(data);
|
||||
await disagreeAfterSale(data);
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
emit('success');
|
||||
|
||||
@@ -18,9 +18,13 @@ import { useTabs } from '@vben/hooks';
|
||||
import { Card, message, Tag } from 'ant-design-vue';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import * as DeliveryExpressApi from '#/api/mall/trade/delivery/express';
|
||||
import * as DeliveryPickUpStoreApi from '#/api/mall/trade/delivery/pickUpStore';
|
||||
import * as TradeOrderApi from '#/api/mall/trade/order';
|
||||
import { getSimpleDeliveryExpressList } from '#/api/mall/trade/delivery/express';
|
||||
import { getDeliveryPickUpStore } from '#/api/mall/trade/delivery/pickUpStore';
|
||||
import {
|
||||
getExpressTrackList,
|
||||
getOrder,
|
||||
pickUpOrder,
|
||||
} from '#/api/mall/trade/order';
|
||||
import { useDescription } from '#/components/description';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
@@ -157,7 +161,7 @@ const [PriceFormModal, priceFormModalApi] = useVbenModal({
|
||||
async function getDetail() {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await TradeOrderApi.getOrder(orderId.value);
|
||||
const res = await getOrder(orderId.value);
|
||||
if (res === null) {
|
||||
message.error('交易订单不存在');
|
||||
handleBack();
|
||||
@@ -169,12 +173,9 @@ async function getDetail() {
|
||||
|
||||
// 如果配送方式为快递,则查询物流公司
|
||||
if (res.deliveryType === DeliveryTypeEnum.EXPRESS.type) {
|
||||
deliveryExpressList.value =
|
||||
await DeliveryExpressApi.getSimpleDeliveryExpressList();
|
||||
deliveryExpressList.value = await getSimpleDeliveryExpressList();
|
||||
if (res.logisticsId) {
|
||||
expressTrackList.value = await TradeOrderApi.getExpressTrackList(
|
||||
res.id!,
|
||||
);
|
||||
expressTrackList.value = await getExpressTrackList(res.id!);
|
||||
expressTrackGridApi.setGridOptions({
|
||||
data: expressTrackList.value || [],
|
||||
});
|
||||
@@ -183,9 +184,7 @@ async function getDetail() {
|
||||
res.deliveryType === DeliveryTypeEnum.PICK_UP.type &&
|
||||
res.pickUpStoreId
|
||||
) {
|
||||
pickUpStore.value = await DeliveryPickUpStoreApi.getDeliveryPickUpStore(
|
||||
res.pickUpStoreId,
|
||||
);
|
||||
pickUpStore.value = await getDeliveryPickUpStore(res.pickUpStoreId);
|
||||
}
|
||||
} finally {
|
||||
loading.value = false;
|
||||
@@ -217,7 +216,7 @@ const handlePickUp = async () => {
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await TradeOrderApi.pickUpOrder(order.value.id!);
|
||||
await pickUpOrder(order.value.id!);
|
||||
message.success('核销成功');
|
||||
await getDetail();
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user