订单列表页面接入,修改crud搜索支持radio-button类型
This commit is contained in:
79
src/views/order/index/config/config.ts
Normal file
79
src/views/order/index/config/config.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user