|
|
@@ -50,21 +50,14 @@ const allTabOptions = [
|
|
|
{ label: "全部", name: "" },
|
|
|
{ label: "待使用", name: "1" },
|
|
|
{ label: "已完成", name: "2" },
|
|
|
- { label: "已退款", name: "3" }
|
|
|
-];
|
|
|
-
|
|
|
-// 商品类型选项
|
|
|
-const statusEnum = [
|
|
|
- { label: "团购", value: "1" },
|
|
|
- { label: "代金券", value: "2" },
|
|
|
- { label: "优惠券", value: "3" }
|
|
|
+ { label: "已退款", name: "5" }
|
|
|
];
|
|
|
|
|
|
// 状态映射
|
|
|
const statusMap: Record<string, string> = {
|
|
|
"1": "待使用",
|
|
|
"2": "已完成",
|
|
|
- "3": "已退款"
|
|
|
+ "5": "已退款"
|
|
|
};
|
|
|
|
|
|
// 表格配置项
|
|
|
@@ -81,41 +74,25 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
prop: "orderNo",
|
|
|
label: "订单编号",
|
|
|
search: {
|
|
|
- el: "input",
|
|
|
- props: { placeholder: "订单编号" }
|
|
|
+ el: "input"
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- prop: "productName",
|
|
|
+ prop: "name",
|
|
|
label: "商品名称",
|
|
|
search: {
|
|
|
- el: "input",
|
|
|
- props: { placeholder: "商品名称" }
|
|
|
+ el: "input"
|
|
|
}
|
|
|
},
|
|
|
- // {
|
|
|
- // prop: "productType",
|
|
|
- // label: "商品类型",
|
|
|
- // render: (scope: any) => {
|
|
|
- // const type = statusEnum.find(item => item.value === scope.row.productType);
|
|
|
- // return type ? type.label : "--";
|
|
|
- // },
|
|
|
- // search: {
|
|
|
- // el: "select",
|
|
|
- // props: { placeholder: "请选择" }
|
|
|
- // },
|
|
|
- // enum: statusEnum,
|
|
|
- // fieldNames: { label: "label", value: "value" }
|
|
|
- // },
|
|
|
{
|
|
|
- prop: "quantity",
|
|
|
+ prop: "couponCount",
|
|
|
label: "数量"
|
|
|
},
|
|
|
{
|
|
|
- prop: "paidAmount",
|
|
|
+ prop: "finalPrice",
|
|
|
label: "实付款",
|
|
|
render: (scope: any) => {
|
|
|
- return scope.row.paidAmount ? `¥${scope.row.paidAmount}` : "--";
|
|
|
+ return scope.row.finalPrice ? `¥${scope.row.finalPrice}` : "--";
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
@@ -128,6 +105,7 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
{
|
|
|
prop: "orderTime",
|
|
|
label: "下单时间",
|
|
|
+ isShow: false,
|
|
|
search: {
|
|
|
el: "date-picker",
|
|
|
props: {
|
|
|
@@ -139,6 +117,10 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
+ prop: "buyTime",
|
|
|
+ label: "下单时间"
|
|
|
+ },
|
|
|
+ {
|
|
|
prop: "status",
|
|
|
label: "状态",
|
|
|
render: (scope: any) => {
|
|
|
@@ -150,8 +132,8 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
|
|
|
// 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
|
|
|
const initParam = reactive({
|
|
|
- storeId: localGet("createdId") || "",
|
|
|
- groupType: localGet("businessSection") || "1",
|
|
|
+ storeId: localGet("createdId"),
|
|
|
+ groupType: localGet("businessSection"),
|
|
|
status: activeName
|
|
|
});
|
|
|
const type = ref(false);
|
|
|
@@ -174,6 +156,15 @@ const dataCallback = (data: any) => {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
+// 格式化日期为 yyyy/mm/dd
|
|
|
+const formatDate = (date: string | Date) => {
|
|
|
+ const d = new Date(date);
|
|
|
+ const year = d.getFullYear();
|
|
|
+ const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
|
+ const day = String(d.getDate()).padStart(2, "0");
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
+};
|
|
|
+
|
|
|
// 获取表格列表
|
|
|
const getTableList = (params: any) => {
|
|
|
let newParams = JSON.parse(JSON.stringify(params));
|
|
|
@@ -181,6 +172,12 @@ const getTableList = (params: any) => {
|
|
|
if (activeName.value) {
|
|
|
newParams.status = activeName.value;
|
|
|
}
|
|
|
+ // 处理 orderTime 参数,转换为 startTime 和 endTime
|
|
|
+ if (newParams.orderTime && Array.isArray(newParams.orderTime) && newParams.orderTime.length === 2) {
|
|
|
+ newParams.startTime = formatDate(newParams.orderTime[0]);
|
|
|
+ newParams.endTime = formatDate(newParams.orderTime[1]);
|
|
|
+ delete newParams.orderTime;
|
|
|
+ }
|
|
|
return getThaliList(newParams);
|
|
|
};
|
|
|
|