订单列表页面接入,修改crud搜索支持radio-button类型

This commit is contained in:
2025-02-14 15:44:42 +08:00
parent 3cd59b4cd7
commit 9dc8e6b866
15 changed files with 856 additions and 8 deletions

View File

@@ -0,0 +1,79 @@
import type { statusType } from "@/api/system/order";
export const statusOptions: statusOptions[] = [
{ label: "全部", value: "" },
{ label: "待支付", value: "unpaid" },
{ label: "制作中", value: "in-production" },
{ label: "待取餐", value: "wait-out" },
{ label: "订单完成", value: "done" },
{ label: "申请退单", value: "refunding" },
{ label: "退单", value: "refund" },
{ label: "部分退单", value: "part-refund" },
{ label: "取消订单", value: "cancelled" },
];
export const payTypeOptions: payTypeOptions[] = [
{ label: "全部", value: "" },
{
label: "现金",
value: "cash",
},
{
label: "银行卡",
value: "bank",
},
{
label: "扫码支付",
value: "scanCode",
},
{
label: "储值卡",
value: "deposit",
},
{
label: "会员支付",
value: "vipPay",
},
{
label: "挂账",
value: "arrears",
},
];
export type optionsType = "status";
export function returnOptions(type: optionsType) {
if (type === "status") {
return statusOptions;
}
}
export function returnOptionsLabel(optionsType: optionsType, value: string | number) {
const options = returnOptions(optionsType);
if (!options) {
return "";
}
const option = options.find((item) => item.value === value);
return option ? option.label : "";
}
export interface options {
label: string;
value: string | number;
[property: string]: any;
}
export interface statusOptions extends options {
value: statusType;
}
export type payTypeValue =
| ""
| "cash"
| "bank"
| "scanCode"
| "deposit"
| "vipPay"
| "arrears"
| "virtual"
| "arrears";
export interface payTypeOptions extends options {
value: payTypeValue;
}