feat(api): 优化订单模型并添加新字段

- 在 ThinkOrder 模型中添加 type、refundReason 和 isAdmin 字段
- 更新订单列表页面,增加退款原因显示
- 调整表格布局和样式,优化用户体验
This commit is contained in:
2025-08-25 17:08:07 +08:00
parent 1096c6f2de
commit 55e747e49a
4 changed files with 656 additions and 648 deletions
@@ -19,8 +19,11 @@ export interface ThinkOrderRefundLog {
source?: string;
// 状态:1新增,2退款成功,3已全额退款,4退款失败
status?: number;
type?: number;
refundReason?: string;
// 创建时间
createTime?: string;
isAdmin?: boolean;
}
/**
+103 -76
View File
@@ -1,7 +1,7 @@
<!-- 用户编辑弹窗 -->
<template>
<ele-modal
:width="`60%`"
:width="600"
:visible="visible"
:confirm-loading="loading"
title="退款"
@@ -10,104 +10,131 @@
:maskClosable="false"
@ok="save"
>
<a-form>
<a-form ref="formRef" :model="form" :rules="rules">
<a-form-item label="订单金额">
<span>{{ data.totalPrice }}元</span>
</a-form-item>
<a-form-item label="支付金额">
<span>{{ data.price }}元</span>
</a-form-item>
<a-form-item label="退款金额">
<a-input-number placeholder="请输入退款金额" style="width: 300px" v-model:value="form.refundAmount"
:max="data.price" />
<a-form-item label="退款金额" name="refundAmount">
<a-input-number
placeholder="请输入退款金额"
style="width: 300px"
v-model:value="form.refundAmount"
:max="data.price"
/>
</a-form-item>
<a-form-item label="退款原因" name="refundReason">
<a-textarea
:rows="3"
style="width: 300px"
:maxlength="100"
placeholder="备注信息"
v-model:value="form.refundReason"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { reactive, ref, watch } from "vue";
import { ThinkOrder } from "@/api/think/thinkOrder/model";
import { ThinkOrderRefundLog } from "@/api/think/thinkOrderRefundLog/model";
import { message } from "ant-design-vue";
import { addThinkOrderRefundLog } from "@/api/think/thinkOrderRefundLog";
import { reactive, ref, watch } from 'vue';
import { ThinkOrder } from '@/api/think/thinkOrder/model';
import { ThinkOrderRefundLog } from '@/api/think/thinkOrderRefundLog/model';
import { message } from 'ant-design-vue';
import { addThinkOrderRefundLog } from '@/api/think/thinkOrderRefundLog';
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data: ThinkOrder;
}>();
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data: ThinkOrder;
}>();
const emit = defineEmits<{
(e: "done"): void;
(e: "update:visible", visible: boolean): void;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
const form = reactive<ThinkOrderRefundLog>({
int: undefined,
uid: undefined,
refundAmount: undefined,
sid: undefined,
oid: undefined,
status: 1,
type: 0,
isAdmin: true
});
const form = reactive<ThinkOrderRefundLog>({
int: undefined,
uid: undefined,
refundAmount: undefined,
sid: undefined,
oid: undefined,
status: 1,
type: undefined,
refundReason: undefined,
isAdmin: true
});
// 请求状态
const loading = ref(false);
// 请求状态
const loading = ref(false);
/* 更新visible */
const updateVisible = (value: boolean) => {
emit("update:visible", value);
};
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const save = async () => {
if (!form.refundAmount && props.data.price > 0) return message.error("请输入退款金额");
loading.value = true;
await addThinkOrderRefundLog(form);
loading.value = false;
message.success("已提交");
updateVisible(false);
emit("done");
};
const save = async () => {
if (!form.refundAmount && props.data.price > 0)
return message.error('请输入退款金额');
loading.value = true;
await addThinkOrderRefundLog(form);
loading.value = false;
message.success('已提交');
updateVisible(false);
emit('done');
};
watch(
() => props.visible,
(visible) => {
if (visible) {
loading.value = false;
if (props.data) {
form.uid = props.data.uid;
form.oid = props.data.id;
form.sid = props.data.sid;
form.refundAmount = 0;
// 表单验证规则
const rules = reactive({
name: [
{
required: true,
type: 'string',
message: '请填写名称',
trigger: 'blur'
}
]
});
watch(
() => props.visible,
(visible) => {
if (visible) {
loading.value = false;
if (props.data) {
form.uid = props.data.uid;
form.oid = props.data.id;
form.sid = props.data.sid;
form.refundAmount = 0;
}
}
}
}
);
);
</script>
<style lang="less" scoped>
.order-card {
margin-bottom: 20px;
}
.ant-form-item {
margin-bottom: 5px;
}
.order-info {
display: flex;
.info {
padding-left: 5px;
display: flex;
flex-direction: column;
.order-card {
margin-bottom: 20px;
}
}
.tag-icon {
padding-right: 6px;
}
.ant-form-item {
margin-bottom: 5px;
}
.order-info {
display: flex;
.info {
padding-left: 5px;
display: flex;
flex-direction: column;
}
}
.tag-icon {
padding-right: 6px;
}
</style>
+404 -346
View File
@@ -8,7 +8,7 @@
:columns="columns"
:datasource="datasource"
:customRow="customRow"
:scroll="{ x: 800 }"
:scroll="{ x: 2000 }"
tool-class="ele-toolbar-form"
class="sys-org-table"
v-model:selection="selection"
@@ -28,6 +28,10 @@
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'name'">
<div class="text-gray-700">{{ record.name }}</div>
<div class="text-blue-500">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'dateTime'">
<div>{{ record.siteName }}</div>
<div>{{ record.dateTime }} ¥{{ record.totalPrice }}元</div>
@@ -147,8 +151,7 @@
<IdcardOutlined class="tag-icon" />
IC会员卡
</a-tag>
<a-tag v-if="record.couponType == 11" color="blue"
>
<a-tag v-if="record.couponType == 11" color="blue">
<IdcardOutlined class="tag-icon" />
免费订单
</a-tag>
@@ -180,7 +183,8 @@
</a-tag>
<a-tag
v-if="record.payStatus == 3 || record.payStatus == 0"
color="cyan">
color="cyan"
>
<CoffeeOutlined class="tag-icon" />
未付款,占场中
</a-tag>
@@ -190,20 +194,29 @@
</template>
<template v-if="column.key === 'orderStatus'">
<span v-if="record.orderStatus == 1" class="ele-text-success"
>已完成</span>
>已完成</span
>
<span v-if="record.orderStatus == 2" class="ele-text-placeholder"
>未使用</span>
>未使用</span
>
<span v-if="record.orderStatus == 3" class="ele-text-placeholder"
>已取消</span>
>已取消</span
>
<span v-if="record.orderStatus == 4" class="ele-text-warning"
>退款申请中</span>
>退款申请中</span
>
<span v-if="record.orderStatus == 5" class="ele-text-danger"
>退款被拒绝</span>
<span v-if="record.orderStatus == 6" class="ele-text-heading">退款成功</span>
>退款被拒绝</span
>
<span v-if="record.orderStatus == 6" class="ele-text-heading"
>退款成功</span
>
<span v-if="record.orderStatus == 7" class="ele-text-warning"
>客户端申请退款</span>
>客户端申请退款</span
>
<span v-if="record.orderStatus == 9" class="ele-text-warning"
>未完成</span>
>未完成</span
>
</template>
<template v-if="column.key === 'isInvoice'">
<a-tag
@@ -211,30 +224,36 @@
color="green"
class="cursor-pointer"
@click="openInvoicePdf(record)"
>已开票
>已开票
</a-tag>
<a-tag
v-if="record.isInvoice == 2"
color="red"
class="cursor-pointer"
@click="onInvoice(record)"
>未开票
>未开票
</a-tag>
<a-tag v-if="record.isInvoice == 3" color="purple">不能开</a-tag>
</template>
<template v-if="column.key === 'checkBill'">
<template v-if="record.payStatus === 1 && record.payType === 1 && !record.wechatOrder.includes('420000')">
<template
v-if="
record.payStatus === 1 &&
record.payType === 1 &&
!record.wechatOrder.includes('420000')
"
>
<a-tag
v-if="record.checkBill == 1"
color="green"
class="cursor-pointer"
>已对账
>已对账
</a-tag>
<a-tag
v-if="record.checkBill == 2"
color="red"
class="cursor-pointer"
>未对账
>未对账
</a-tag>
</template>
</template>
@@ -246,15 +265,36 @@
<a-space>
<a @click="openEdit(record)">详情</a>
<a-divider type="vertical" />
<template v-if="record.isInvoice == 2 && record.payStatus == 1 && [1, 2].includes(record.orderStatus)">
<template
v-if="
record.isInvoice == 2 &&
record.payStatus == 1 &&
[1, 2].includes(record.orderStatus)
"
>
<a @click="onInvoice(record)">开票</a>
<a-divider type="vertical" />
</template>
<template
v-if="record.payStatus === 1 && [1, 2].includes(record.orderStatus) && hasPermission('think:order:refund')">
<a class="ele-text-danger" @click="openRefund(record)"
v-if="dayjs(record.thinkOrderInfos[0].startTime * 1000).isBefore(dayjs())">退款</a>
<a class="ele-text-danger" @click="openRefund(record)" v-else>过期退款</a>
v-if="
record.payStatus === 1 &&
[1, 2].includes(record.orderStatus) &&
hasPermission('think:order:refund')
"
>
<a
class="ele-text-danger"
@click="openRefund(record)"
v-if="
dayjs(
record.thinkOrderInfos[0].startTime * 1000
).isBefore(dayjs())
"
>退款</a
>
<a class="ele-text-danger" @click="openRefund(record)" v-else
>过期退款</a
>
</template>
</a-space>
</template>
@@ -265,351 +305,369 @@
<OrderInfo v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 开具发票 -->
<Invoice v-model:visible="showInvoice" :data="current" @done="reload" />
<InvoiceByList v-model:visible="showInvoiceList" :data="current" @done="reload" />
<InvoiceByList
v-model:visible="showInvoiceList"
:data="current"
@done="reload"
/>
<Refund v-model:visible="showRefund" :data="refundOrder" @done="reload" />
</div>
</div>
</template>
<script lang="ts" setup>
import { createVNode, ref } from "vue";
import { message, Modal } from "ant-design-vue";
import {
ExclamationCircleOutlined,
CheckOutlined,
CloseOutlined,
AlipayCircleOutlined
} from "@ant-design/icons-vue";
import { EleProTable, messageLoading, toDateString } from "ele-admin-pro";
import type {
DatasourceFunction,
ColumnItem
} from "ele-admin-pro/es/ele-pro-table/types";
import Search from "./components/search.vue";
import OrderInfo from "./components/orderInfo.vue";
import Invoice from "./components/invoice.vue";
import InvoiceByList from "./components/invoiceByList.vue";
import {
pageThinkOrder,
removeThinkOrder,
removeBatchThinkOrder, thinkOrderExport
} from "@/api/think/thinkOrder";
import * as InvoiceApi from "@/api/think/thinkInvoice";
import type {
ThinkOrder,
ThinkOrderParam
} from "@/api/think/thinkOrder/model";
import { formatNumber } from "ele-admin-pro/es";
import type { ThinkInvoice } from "@/api/think/thinkInvoice/model";
import Refund from "@/views/think/thinkOrder/components/refund.vue";
import { hasPermission } from "@/utils/permission";
import dayjs from "dayjs";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import {
ExclamationCircleOutlined,
CheckOutlined,
CloseOutlined,
AlipayCircleOutlined
} from '@ant-design/icons-vue';
import { EleProTable, messageLoading, toDateString } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import OrderInfo from './components/orderInfo.vue';
import Invoice from './components/invoice.vue';
import InvoiceByList from './components/invoiceByList.vue';
import {
pageThinkOrder,
removeThinkOrder,
removeBatchThinkOrder,
thinkOrderExport
} from '@/api/think/thinkOrder';
import * as InvoiceApi from '@/api/think/thinkInvoice';
import type {
ThinkOrder,
ThinkOrderParam
} from '@/api/think/thinkOrder/model';
import { formatNumber } from 'ele-admin-pro/es';
import type { ThinkInvoice } from '@/api/think/thinkInvoice/model';
import Refund from '@/views/think/thinkOrder/components/refund.vue';
import { hasPermission } from '@/utils/permission';
import dayjs from 'dayjs';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ThinkOrder[]>([]);
// 当前编辑数据
const current = ref<ThinkOrder | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 开具发票弹窗
const showInvoice = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格选中数据
const selection = ref<ThinkOrder[]>([]);
// 当前编辑数据
const current = ref<ThinkOrder | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 开具发票弹窗
const showInvoice = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
where.forAdmin = true;
return pageThinkOrder({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: "订单号",
dataIndex: "orderNum",
key: "iod",
width: 90
},
{
title: "姓名",
dataIndex: "name",
key: "name",
align: "center"
},
{
title: "手机号",
dataIndex: "phone",
key: "phone",
width: 120,
align: "center"
},
{
title: "预约信息",
dataIndex: "dateTime",
key: "dateTime",
width: 120,
align: "center"
},
{
title: "总额",
dataIndex: "totalPrice",
key: "totalPrice",
align: "center",
sorter: true,
customRender: ({ text }) => `¥${formatNumber(text)}`
},
{
title: "减少金额",
dataIndex: "reducePrice",
key: "reducePrice",
align: "center",
sorter: true,
customRender: ({ text }) => `¥${formatNumber(text)}`
},
{
title: "实付金额",
dataIndex: "payPrice",
key: "payPrice",
align: "center",
sorter: true,
customRender: ({ text }) => `¥${formatNumber(text)}`
},
{
title: "支付方式",
dataIndex: "payType",
key: "payType",
align: "center"
},
{
title: "IC卡号",
dataIndex: "code",
key: "code",
align: "center"
},
{
title: "付款状态",
dataIndex: "payStatus",
key: "payStatus",
sorter: true,
align: "center"
},
{
title: "付款时间",
dataIndex: "payTime",
key: "payTime",
sorter: true,
align: "center",
customRender: ({ text }) => toDateString(text, "yyyy-MM-dd HH:mm:ss")
},
{
title: "订单状态",
dataIndex: "orderStatus",
key: "orderStatus",
align: "center"
},
{
title: "优惠类型",
dataIndex: "couponType",
key: "couponType",
align: "center"
},
{
title: "开票状态",
dataIndex: "isInvoice",
key: "isInvoice",
align: "center",
sorter: true
},
{
title: "对账状态",
key: "checkBill",
align: "center"
},
// {
// title: '类型',
// dataIndex: 'type',
// key: 'type',
// align: 'center',
// customRender: ({ text }) =>
// ['商城订单', '客户预定', '俱乐部训练场', '活动订场'][text]
// },
// {
// title: '申请退款时间',
// dataIndex: 'refundApplyTime',
// key: 'refundApplyTime',
// align: 'center',
// customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
// },
// {
// title: '备注',
// dataIndex: 'comments',
// key: 'comments',
// align: 'center'
// },
{
title: "操作",
key: "action",
width: 200,
fixed: "right",
align: "center",
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: ThinkOrderParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ThinkOrder) => {
current.value = row ?? null;
showEdit.value = true;
};
const showRefund = ref(false);
const refundOrder = ref<ThinkOrder>();
const openRefund = (row: ThinkOrder) => {
refundOrder.value = row;
showRefund.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ThinkOrder) => {
const hide = message.loading("请求中..", 0);
removeThinkOrder(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error("请至少选择一条数据");
return;
}
Modal.confirm({
title: "提示",
content: "确定要删除选中的记录吗?",
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading("请求中..", 0);
removeBatchThinkOrder(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
});
};
/* 开具发票 */
const onInvoice = (row?: ThinkOrder) => {
console.log(row?.payStatus);
if (row?.payStatus != 1) {
return false;
}
current.value = row ?? null;
showInvoice.value = true;
};
const openInvoicePdf = (row?: ThinkInvoice) => {
if (row?.id) {
InvoiceApi.showInvoice(row?.id).then((res) => {
const parse = JSON.parse(res);
const pdfUrl = parse[0].pdfUrl;
window.open(pdfUrl);
where.forAdmin = true;
return pageThinkOrder({
...where,
...orders,
page,
limit
});
}
};
/* 查询 */
const query = () => {
loading.value = true;
};
const showInvoiceList = ref(false);
const openInvoiceByList = async () => {
const list = selection.value.filter(item => (item.isInvoice === 2 && item.payStatus === 1 && [1, 2].includes(item.orderStatus)));
if (!list.length) return message.error("无可开票订单");
current.value = {
orderIdList: list.map((d) => d.id),
price: list.reduce((count, item) => count + parseFloat(item.payPrice), 0)
};
showInvoiceList.value = true;
};
const handleExport = async (params: ThinkOrderParam) => {
const hide = messageLoading("导出中...", 0);
const res = await thinkOrderExport(params);
hide();
window.open(res.url);
};
/* 自定义行属性 */
const customRow = (record: ThinkOrder) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单号',
dataIndex: 'orderNum',
key: 'iod',
width: 104
},
// 行双击事件
onDblclick: () => {
openEdit(record);
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center',
width: 120
},
// {
// title: '手机号',
// dataIndex: 'phone',
// key: 'phone',
// width: 120,
// align: 'center'
// },
{
title: '预约信息',
dataIndex: 'dateTime',
key: 'dateTime',
width: 260,
align: 'center'
},
{
title: '订单总额',
dataIndex: 'totalPrice',
key: 'totalPrice',
align: 'center',
sorter: true,
customRender: ({ text }) => `¥${formatNumber(text)}`
},
{
title: '减少金额',
dataIndex: 'reducePrice',
key: 'reducePrice',
align: 'center',
sorter: true,
customRender: ({ text }) => `¥${formatNumber(text)}`
},
{
title: '实付金额',
dataIndex: 'payPrice',
key: 'payPrice',
align: 'center',
sorter: true,
customRender: ({ text }) => `¥${formatNumber(text)}`
},
{
title: '支付方式',
dataIndex: 'payType',
key: 'payType',
align: 'center'
},
{
title: 'IC卡号',
dataIndex: 'code',
key: 'code',
align: 'center',
width: 120
},
{
title: '付款状态',
dataIndex: 'payStatus',
key: 'payStatus',
sorter: true,
align: 'center'
},
{
title: '付款时间',
dataIndex: 'payTime',
key: 'payTime',
sorter: true,
align: 'center',
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '订单状态',
dataIndex: 'orderStatus',
key: 'orderStatus',
align: 'center'
},
{
title: '优惠类型',
dataIndex: 'couponType',
key: 'couponType',
align: 'center'
},
{
title: '开票状态',
dataIndex: 'isInvoice',
key: 'isInvoice',
align: 'center',
sorter: true
},
{
title: '对账状态',
key: 'checkBill',
align: 'center'
},
{
title: '退款原因',
key: 'refundReason',
align: 'center'
},
// {
// title: '类型',
// dataIndex: 'type',
// key: 'type',
// align: 'center',
// customRender: ({ text }) =>
// ['商城订单', '客户预定', '俱乐部训练场', '活动订场'][text]
// },
// {
// title: '申请退款时间',
// dataIndex: 'refundApplyTime',
// key: 'refundApplyTime',
// align: 'center',
// customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
// },
// {
// title: '备注',
// dataIndex: 'comments',
// key: 'comments',
// align: 'center'
// },
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: ThinkOrderParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ThinkOrder) => {
current.value = row ?? null;
showEdit.value = true;
};
const showRefund = ref(false);
const refundOrder = ref<ThinkOrder>();
const openRefund = (row: ThinkOrder) => {
refundOrder.value = row;
showRefund.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ThinkOrder) => {
const hide = message.loading('请求中..', 0);
removeThinkOrder(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchThinkOrder(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 开具发票 */
const onInvoice = (row?: ThinkOrder) => {
console.log(row?.payStatus);
if (row?.payStatus != 1) {
return false;
}
current.value = row ?? null;
showInvoice.value = true;
};
const openInvoicePdf = (row?: ThinkInvoice) => {
if (row?.id) {
InvoiceApi.showInvoice(row?.id).then((res) => {
const parse = JSON.parse(res);
const pdfUrl = parse[0].pdfUrl;
window.open(pdfUrl);
});
}
};
};
query();
/* 查询 */
const query = () => {
loading.value = true;
};
const showInvoiceList = ref(false);
const openInvoiceByList = async () => {
const list = selection.value.filter(
(item) =>
item.isInvoice === 2 &&
item.payStatus === 1 &&
[1, 2].includes(item.orderStatus)
);
if (!list.length) return message.error('无可开票订单');
current.value = {
orderIdList: list.map((d) => d.id),
price: list.reduce((count, item) => count + parseFloat(item.payPrice), 0)
};
showInvoiceList.value = true;
};
const handleExport = async (params: ThinkOrderParam) => {
const hide = messageLoading('导出中...', 0);
const res = await thinkOrderExport(params);
hide();
window.open(res.url);
};
/* 自定义行属性 */
const customRow = (record: ThinkOrder) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
import * as MenuIcons from "@/layout/menu-icons";
import * as MenuIcons from '@/layout/menu-icons';
export default {
name: "ThinkOrder",
components: MenuIcons
};
export default {
name: 'ThinkOrder',
components: MenuIcons
};
</script>
<style lang="less" scoped>
.tag-icon {
padding-right: 6px;
}
.tag-icon {
padding-right: 6px;
}
</style>