feat(order): 更新API配置和订单支付功能
- 修改开发和生产环境配置文件中的API和WebSocket地址 - 添加updateOrderPay API方法用于更新订单支付信息 - 在订单信息组件中添加日期选择器用于修改开始和过期时间 - 实现订单过期天数计算逻辑的改进 - 添加数据保存成功提示消息 - 更新头像文件存储地址配置
This commit is contained in:
@@ -283,7 +283,7 @@
|
||||
ref="tableRef2"
|
||||
:pagination="true"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.key === 'orderNo'">
|
||||
<span
|
||||
:class="[record.isAdminRenew === 1 ? 'ele-text-primary' : '']"
|
||||
@@ -300,17 +300,33 @@
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="column.key === 'expirationTime'">
|
||||
<div>{{ record.startTime }}</div>
|
||||
<div>{{ record.expirationTime }}</div>
|
||||
<div>
|
||||
<a-date-picker
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
@change="changeData(record, 'startTime')"
|
||||
class="ele-fluid"
|
||||
placeholder="请选择时间"
|
||||
v-model:value="record.startTime"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<a-date-picker
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
@change="changeData(record, 'expirationTime')"
|
||||
class="ele-fluid"
|
||||
placeholder="请选择时间"
|
||||
v-model:value="record.expirationTime"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="column.key === 'expirationDay'">
|
||||
<span
|
||||
class="ele-text-danger"
|
||||
v-if="expirationDay(record).includes('逾期')"
|
||||
>{{ expirationDay(record) }}</span
|
||||
v-if="expirationDay(record, index).includes('逾期')"
|
||||
>{{ expirationDay(record, index) }}</span
|
||||
>
|
||||
<span class="ele-text-success" v-else>{{
|
||||
expirationDay(record)
|
||||
expirationDay(record, index)
|
||||
}}</span>
|
||||
</template>
|
||||
|
||||
@@ -444,13 +460,13 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, EleProTable, timeAgo } from 'ele-admin-pro';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { formatNumber } from 'ele-admin-pro/es';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { copyText } from '@/utils/common';
|
||||
import { Order } from '@/api/order/model';
|
||||
import { Order, OrderPay } from '@/api/order/model';
|
||||
import OrderXufei from '../components/order-xufei.vue';
|
||||
import { listEquipmentOrderGoods } from '@/api/apps/equipment/order/goods';
|
||||
import { EquipmentOrderGoods } from '@/api/apps/equipment/order/goods/model';
|
||||
@@ -460,7 +476,7 @@
|
||||
ColumnItem,
|
||||
DatasourceFunction
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import { listOrder, listOrderPay } from '@/api/order';
|
||||
import { listOrder, listOrderPay, updateOrderPay } from '@/api/order';
|
||||
import { CopyOutlined } from '@ant-design/icons-vue';
|
||||
import { EquipmentRecord } from '@/api/apps/equipment/record/model';
|
||||
import dayjs from 'dayjs';
|
||||
@@ -795,7 +811,8 @@
|
||||
const getEquipmentRecordList = () => {
|
||||
EquipmentRecordApi.pageEquipmentRecord({
|
||||
orderId: order.orderId,
|
||||
userId: order.userId
|
||||
userId: order.userId,
|
||||
limit: 100
|
||||
}).then((data) => {
|
||||
EquipmentRecordList.value = data.list;
|
||||
});
|
||||
@@ -818,13 +835,18 @@
|
||||
// });
|
||||
// };
|
||||
|
||||
const expirationDay = (order) => {
|
||||
const expirationDay = (order, index) => {
|
||||
if (dayjs(order.expirationTime).isBefore(dayjs())) {
|
||||
const useDay = dayjs(order.expirationTime).diff(
|
||||
dayjs(props?.data?.payTime),
|
||||
'd'
|
||||
);
|
||||
return `使用${useDay}天`;
|
||||
if (index === 0) {
|
||||
const useDay = dayjs().diff(dayjs(order.expirationTime), 'd');
|
||||
return `逾期${useDay}天`;
|
||||
} else {
|
||||
const useDay = dayjs(order.expirationTime).diff(
|
||||
dayjs(props?.data?.payTime),
|
||||
'd'
|
||||
);
|
||||
return `使用${useDay}天`;
|
||||
}
|
||||
} else {
|
||||
const day = dayjs(order.expirationTime).diff(dayjs(order.payTime), 'd');
|
||||
if (day < 0) {
|
||||
@@ -865,6 +887,11 @@
|
||||
}
|
||||
};
|
||||
|
||||
const changeData = async (data: OrderPay) => {
|
||||
await updateOrderPay(data);
|
||||
message.success('保存成功');
|
||||
};
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {};
|
||||
|
||||
@@ -884,6 +911,7 @@
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
emit('done')
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user