mirror of
https://gitee.com/yudaocode/yudao-ui-admin-vben.git
synced 2025-12-30 10:32:25 +00:00
feat:【mall 商城】交易订单(30% antd remark 优化代码风格)
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { MallOrderApi } from '#/api/mall/trade/order';
|
||||
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||
@@ -53,35 +52,7 @@ function handleDelivery(row: MallOrderApi.Order) {
|
||||
|
||||
/** 备注 */
|
||||
function handleRemark(row: MallOrderApi.Order) {
|
||||
remarkOrderId.value = row.id;
|
||||
remarkFormVisible.value = true;
|
||||
remarkFormApi.setValues(row);
|
||||
}
|
||||
|
||||
/** 提交备注 */
|
||||
async function handleRemarkSubmit() {
|
||||
const { valid } = await remarkFormApi.validate();
|
||||
if (!valid) return;
|
||||
|
||||
remarkFormLoading.value = true;
|
||||
try {
|
||||
const data =
|
||||
(await remarkFormApi.getValues()) as MallOrderApi.RemarkRequest;
|
||||
await updateOrderRemark(data);
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
remarkFormVisible.value = false;
|
||||
handleRefresh();
|
||||
} catch (error) {
|
||||
console.error('更新订单备注失败:', error);
|
||||
} finally {
|
||||
remarkFormLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** 取消备注 */
|
||||
function handleRemarkCancel() {
|
||||
remarkFormVisible.value = false;
|
||||
remarkOrderId.value = undefined;
|
||||
remarkFormModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
@@ -134,18 +105,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
</template>
|
||||
|
||||
<DeliveryFormModal @success="handleRefresh" />
|
||||
|
||||
<!-- 订单备注弹窗 -->
|
||||
<Modal
|
||||
v-model:open="remarkFormVisible"
|
||||
title="订单备注"
|
||||
:confirm-loading="remarkFormLoading"
|
||||
@ok="handleRemarkSubmit"
|
||||
@cancel="handleRemarkCancel"
|
||||
width="33.33%"
|
||||
>
|
||||
<RemarkForm class="mx-4" />
|
||||
</Modal>
|
||||
<RemarkFormModal @success="handleRefresh" />
|
||||
<Grid table-title="订单列表">
|
||||
<template #expand_content="{ row }">
|
||||
<List item-layout="vertical" :data-source="row.items">
|
||||
|
||||
@@ -52,7 +52,7 @@ const [OrderDeliveryFormModal, formModalApi] = useVbenModal({
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
const [OrderUpdateRemarkFormModal, remarkFormModalApi] = useVbenModal({
|
||||
const [RemarkFormModal, remarkFormModalApi] = useVbenModal({
|
||||
connectedComponent: OrderUpdateRemarkForm,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user