初始版本,目前线上可用

This commit is contained in:
2025-11-19 12:49:16 +08:00
commit cb7f1c45e8
178 changed files with 30336 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
import { BaseEntity } from "@/abstrClass/BaseEntity";
import { Entity, Column } from "typeorm";
@Entity("cacnle_payment")
export class CancelPayment extends BaseEntity {
@Column({
type: "datetime",
name: "checkout_date",
comment: "结账日期",
default: () => "CURRENT_TIMESTAMP",
})
checkoutDate: Date;
@Column({ type: "varchar", length: 50, comment: "经办人" })
handler: string;
@Column({
type: "datetime",
name: "settlement_date",
comment: "结算日期",
default: () => "CURRENT_TIMESTAMP",
})
settlementDate: Date;
@Column({
type: "decimal",
precision: 12,
scale: 2,
name: "cash_amount",
comment: "现金金额",
})
cashAmount: number;
@Column({
type: "decimal",
precision: 12,
comment: "银联支付金额",
scale: 2,
name: "union_pay_amount",
})
unionPayAmount: number;
@Column({
type: "decimal",
precision: 12,
comment: "刷卡金额",
scale: 2,
name: "card_amount",
})
cardAmount: number;
@Column({
type: "decimal",
precision: 12,
scale: 2,
comment: "对公转账金额",
name: "public_transfer_amount",
})
publicTransferAmount: number;
@Column({
type: "decimal",
precision: 12,
scale: 2,
comment: "车间支付",
name: "workshop_payment",
})
workshopPayment: number;
@Column({
type: "int",
comment: "单子ID",
name: "retail_id",
default: 0,
})
retailId: number;
}
export default CancelPayment;

View File

@@ -0,0 +1,89 @@
import { Entity, Column, OneToOne, JoinColumn } from "typeorm";
import { BaseEntity } from "@/abstrClass/BaseEntity";
import DeceasedRetail from "./DeceasedRetail";
import dayjs from "dayjs";
@Entity("cancel_retail")
export class CancelRetail extends BaseEntity {
@Column("int", {
name: "deceasedRetail_id",
comment: "销售单ID",
default: 0,
})
deceasedRetailId: number;
@Column("int", {
name: "checkoutRetail_id",
comment: "服务销售单ID",
default: 0,
})
checkoutRetailId: number;
@Column("varchar", {
name: "cancel_person",
length: 100,
comment: "作废申请人",
default: "",
})
cancelPerson: string;
@Column("datetime", {
name: "cancel_date",
comment: "作废日期",
default: () => "CURRENT_TIMESTAMP", // 默认值为当前时间
transformer: {
to(value: Date) {
return value;
},
from(value) {
return dayjs(new Date(value)).format("YYYY-MM-DD HH:mm:ss");
},
},
})
cancelDate: Date;
@Column("varchar", {
name: "cancel_reason",
comment: "作废原因",
default: "",
})
cancelReason: string;
@Column("int", {
name: "examine_state",
comment: "审核状态 (0: 未审核, 1: 已审核, 2: 拒绝)",
default: 0,
})
examineState: number;
@Column("int", {
name: "cancel_type",
comment: "作废类型0结账处理、1零售结算",
default: 0,
})
cancelType: number;
@Column("varchar", {
name: "examine_pserson",
comment: "审核人",
default: "",
})
examinePserson: string;
@Column("datetime", {
name: "examine_date",
comment: "审核时间",
nullable: true, // 允许为空
transformer: {
to(value: Date) {
return value;
},
from(value) {
return dayjs(new Date(value)).format("YYYY-MM-DD HH:mm:ss");
},
},
})
examineDate: Date;
}
export default CancelRetail;

View File

@@ -0,0 +1,78 @@
import { BaseEntity } from "@/abstrClass/BaseEntity";
import { Entity, Column } from "typeorm";
@Entity("checkout_payment_records")
export class CheckoutPaymentRecords extends BaseEntity {
@Column({
type: "datetime",
name: "checkout_date",
comment: "结账日期",
default: () => "CURRENT_TIMESTAMP",
})
checkoutDate: Date;
@Column({ type: "varchar", length: 50, comment: "经办人" })
handler: string;
@Column({
type: "datetime",
name: "settlement_date",
comment: "结算日期",
default: () => "CURRENT_TIMESTAMP",
})
settlementDate: Date;
@Column({
type: "decimal",
precision: 12,
scale: 2,
name: "cash_amount",
comment: "现金金额",
})
cashAmount: number;
@Column({
type: "decimal",
precision: 12,
comment: "银联支付金额",
scale: 2,
name: "union_pay_amount",
})
unionPayAmount: number;
@Column({
type: "decimal",
precision: 12,
comment: "刷卡金额",
scale: 2,
name: "card_amount",
})
cardAmount: number;
@Column({
type: "decimal",
precision: 12,
scale: 2,
comment: "对公转账金额",
name: "public_transfer_amount",
})
publicTransferAmount: number;
@Column({
type: "decimal",
precision: 12,
scale: 2,
comment: "车间支付",
name: "workshop_payment",
})
workshopPayment: number;
@Column({
type: "int",
comment: "单子ID",
name: "checkout_retail_id",
})
checkoutRetailId: number;
}
export default CheckoutPaymentRecords;

View File

@@ -0,0 +1,85 @@
import { Entity, Column } from "typeorm";
import { BaseEntity } from "@/abstrClass/BaseEntity";
import dayjs from "dayjs";
@Entity("checkout_retail")
export class CheckoutRetail extends BaseEntity {
@Column("int", {
name: "deceased_id",
comment: "逝者ID",
default: 0,
})
deceasedId: number;
@Column("varchar", {
name: "buyer",
comment: "购买人",
length: 255,
default: "",
})
buyer: string;
@Column("datetime", {
name: "purchase_date",
comment: "购买日期",
default: () => "CURRENT_TIMESTAMP", // 默认值为当前时间
transformer: {
to(value: Date) {
return value;
},
from(value) {
return dayjs(new Date(value)).format("YYYY-MM-DD HH:mm:ss");
},
},
})
purchaseDate: Date;
@Column("varchar", {
name: "handler",
comment: "经办人",
length: 255,
default: "",
})
handler: string;
@Column("decimal", {
name: "sales_amount",
comment: "销售金额",
precision: 10,
scale: 2,
default: 0.0,
})
salesAmount: number;
@Column("varchar", {
name: "guide",
comment: "引导员",
length: 255,
default: "",
})
guide: string;
@Column("varchar", {
name: "service_items",
comment: "服务项目列表",
})
serviceItems: string;
// 0未结账、1已结账
@Column("int", {
name: "retail_state",
comment: "结账状态",
default: 0,
})
retailState: number;
// 0正常、1已作废
@Column("int", {
name: "cancel_state",
comment: "作废状态",
default: 0,
})
cancelState: number;
}
export default CheckoutRetail;

View File

@@ -0,0 +1,117 @@
import { Entity, Column } from "typeorm";
import { BaseEntity } from "@/abstrClass/BaseEntity";
import dayjs from "dayjs";
@Entity("deceased")
export class Deceased extends BaseEntity {
@Column("varchar", {
name: "name",
comment: "逝者姓名",
length: 255,
default: "",
})
name: string;
@Column("varchar", {
name: "id_number",
comment: "证件号码",
length: 50,
default: "",
})
idNumber: string;
@Column("varchar", {
name: "gender",
comment: "性别",
length: 10,
default: "男",
})
gender: string;
@Column("int", {
comment: "年龄",
default: 0,
})
age: number;
@Column("varchar", {
name: "buyer",
comment: "购买人",
length: 255,
default: "",
})
buyer: string;
@Column("varchar", {
name: "family_name",
comment: "购买人",
length: 255,
default: "",
})
familyName: string;
@Column("varchar", {
name: "family_phone",
comment: "购买人电话",
length: 255,
default: 0,
})
familyPhone: string;
@Column({ comment: "所在省", default: "" })
province: string; // 所在省
@Column({ comment: "所在市", default: "" })
city: string; // 所在市
@Column({ comment: "所在区域", default: "" })
area: string; // 所在区域
@Column({ comment: "详细地址", default: "" })
address: string; // 详细地址
@Column("datetime", {
name: "purchase_date",
comment: "购买日期",
default: () => "CURRENT_TIMESTAMP", // 默认值为当前时间
transformer: {
to(value: Date) {
return value;
},
from(value) {
return dayjs(new Date(value)).format("YYYY-MM-DD HH:mm:ss");
},
},
})
purchaseDate: Date;
@Column("varchar", {
name: "handler",
comment: "经办人",
length: 255,
default: "",
})
handler: string;
@Column("decimal", {
name: "sales_amount",
comment: "销售金额",
precision: 10,
scale: 2,
default: 0.0,
})
salesAmount: number;
@Column("varchar", {
name: "guide",
comment: "引导员",
length: 255,
default: "",
})
guide: string;
@Column("simple-array", {
name: "service_items",
comment: "服务项目列表",
})
serviceItems: number[];
}
export default Deceased;

View File

@@ -0,0 +1,143 @@
import { Entity, Column, Index } from "typeorm";
import { BaseEntity } from "@/abstrClass/BaseEntity";
import dayjs from "dayjs";
@Entity("deceased_retail")
export class DeceasedRetail extends BaseEntity {
@Index()
@Column("int", {
name: "deceased_id",
comment: "逝者ID",
default: 0,
})
deceasedId: number;
@Column("varchar", {
name: "deceased_name",
comment: "购买人",
length: 255,
default: "",
})
deceasedName: string;
@Column("varchar", {
name: "buyer",
comment: "购买人",
length: 255,
default: "",
})
buyer: string;
@Column("datetime", {
name: "purchase_date",
comment: "录单日期",
default: () => "CURRENT_TIMESTAMP", // 默认值为当前时间
transformer: {
to(value: Date) {
return value;
},
from(value) {
return dayjs(new Date(value)).format("YYYY-MM-DD HH:mm:ss");
},
},
})
purchaseDate: Date;
@Column("datetime", {
name: "checkout_date",
comment: "录单日期",
default: () => "CURRENT_TIMESTAMP", // 默认值为当前时间
transformer: {
to(value: Date) {
return value;
},
from(value) {
return dayjs(new Date(value)).format("YYYY-MM-DD HH:mm:ss");
},
},
})
checkoutDate: Date;
@Column("varchar", {
name: "handler",
comment: "经办人",
length: 255,
default: "",
})
handler: string;
@Column("decimal", {
name: "sales_amount",
comment: "销售金额",
precision: 10,
scale: 2,
default: 0.0,
})
salesAmount: number;
@Column("varchar", {
name: "guide",
comment: "引导员",
length: 255,
default: "",
})
guide: string;
@Column("varchar", {
name: "service_items",
comment: "服务项目列表",
})
serviceItems: string;
// 0未结账、1已结账
@Column("int", {
name: "retail_state",
comment: "结账状态",
default: 0,
})
retailState: number;
// 0正常、1已作废
@Column("int", {
name: "cancel_state",
comment: "作废状态",
default: 0,
})
cancelState: number;
// 0服务单、1有逝者零售单 2 无逝者零售单
@Column("int", {
name: "retail_type",
comment: "单子类型",
default: 0,
})
retailType: number;
//无逝者零售单
@Column("varchar", {
name: "family_name",
comment: "购买人",
length: 255,
default: "",
})
familyName: string;
@Column("varchar", {
name: "family_phone",
comment: "购买人电话",
length: 255,
default: 0,
})
familyPhone: string;
@Column({ comment: "所在省", default: "" })
province: string; // 所在省
@Column({ comment: "所在市", default: "" })
city: string; // 所在市
@Column({ comment: "所在区域", default: "" })
area: string; // 所在区域
@Column({ comment: "详细地址", default: "" })
address: string; // 详细地址
}
export default DeceasedRetail;

View File

@@ -0,0 +1,102 @@
import { BaseEntity } from "@/abstrClass/BaseEntity";
import {
Entity,
PrimaryGeneratedColumn,
Column,
OneToOne,
JoinColumn,
} from "typeorm";
import DeceasedRetail from "./DeceasedRetail";
@Entity("payment_records")
export class PaymentRecord extends BaseEntity {
@Column({
type: "datetime",
name: "checkout_date",
comment: "结账日期",
default: () => "CURRENT_TIMESTAMP",
})
checkoutDate: Date;
@Column({ type: "varchar", length: 50, comment: "经办人" })
handler: string;
@Column({
type: "datetime",
name: "settlement_date",
comment: "结算日期",
default: () => "CURRENT_TIMESTAMP",
})
settlementDate: Date;
@Column({
type: "decimal",
precision: 12,
scale: 2,
name: "cash_amount",
comment: "现金金额",
})
cashAmount: number;
@Column({
type: "decimal",
precision: 12,
comment: "银联支付金额",
scale: 2,
name: "union_pay_amount",
})
unionPayAmount: number;
@Column({
type: "decimal",
precision: 12,
comment: "刷卡金额",
scale: 2,
name: "card_amount",
})
cardAmount: number;
@Column({
type: "decimal",
precision: 12,
scale: 2,
comment: "对公转账金额",
name: "public_transfer_amount",
})
publicTransferAmount: number;
@Column({
type: "decimal",
precision: 12,
scale: 2,
comment: "车间支付",
name: "workshop_payment",
})
workshopPayment: number;
@Column({
type: "int",
comment: "零售单子ID",
default: 0,
name: "deceased_retail_id",
})
deceasedRetailId: number;
@Column({
type: "int",
comment: "无零售单子ID",
name: "no_deceased_retail_id",
default: 0,
})
noDeceasedRetailId: number;
@Column({
type: "int",
comment: "单子ID",
name: "retail_id",
default: 0,
})
retailId: number;
}
export default PaymentRecord;

View File

@@ -0,0 +1,12 @@
import { Column, Entity } from "typeorm";
import { BaseEntity } from "../abstrClass/BaseEntity";
@Entity("role")
export class Role extends BaseEntity {
@Column({ type: "varchar", comment: "角色值", default: "" })
values: string;
@Column({ type: "int", comment: "角色状态", default: 1 })
roleState: number;
@Column({ type: "varchar", comment: "角色名", default: "" })
name: string;
}

View File

@@ -0,0 +1,53 @@
import { Entity, Column } from "typeorm";
import { BaseEntity } from "@/abstrClass/BaseEntity";
@Entity("seleted_service_list")
export class SeletedServiceList extends BaseEntity {
@Column("varchar", {
name: "name",
comment: "服务项目名称",
length: 255,
default: "",
})
name: string;
@Column("int", {
comment: "数量",
default: 0,
})
quantity: number;
@Column("varchar", {
name: "unit",
comment: "单位",
length: 50,
default: "",
})
unit: string;
@Column("decimal", {
name: "price",
comment: "售价",
precision: 10,
scale: 2,
default: 0.0,
})
price: number;
@Column("varchar", {
name: "remark",
comment: "备注",
length: 500,
default: "",
})
remark: string;
@Column("int", {
name: "retail_id",
comment: "所属零售ID",
default: 0,
})
retailId: number;
}
export default SeletedServiceList;

View File

@@ -0,0 +1,30 @@
import { Entity, Column } from "typeorm";
import { BaseEntity } from "@/abstrClass/BaseEntity";
@Entity("service_category")
export class ServiceCategory extends BaseEntity {
@Column("varchar", {
name: "name",
comment: "商品分类名称",
length: 255,
default: "",
})
name: string; // 商品分类名称
@Column("varchar", {
name: "remark",
comment: "备注",
length: 500,
default: "",
})
remark: string;
@Column("int", {
name: "parentId",
comment: "分类ID",
default: 0,
})
parentId: number; // 关联分类
}
export default ServiceCategory;

View File

@@ -0,0 +1,60 @@
import { Entity, Column } from "typeorm";
import { BaseEntity } from "@/abstrClass/BaseEntity";
@Entity("service_item")
export class ServiceItem extends BaseEntity {
@Column("varchar", {
name: "name",
comment: "服务项目名称",
length: 255,
default: "",
})
name: string;
@Column("int", {
comment: "数量",
default: 0,
})
quantity: number;
@Column("varchar", {
name: "unit",
comment: "单位",
length: 50,
default: "",
})
unit: string;
@Column("decimal", {
name: "price",
comment: "售价",
precision: 10,
scale: 2,
default: 0.0,
})
price: number;
@Column("varchar", {
name: "remark",
comment: "备注",
length: 500,
default: "",
})
remark: string;
@Column("int", {
name: "parentId",
comment: "分类ID",
default: 0,
})
parentId: number; // 关联分类
@Column("int", {
name: "hasDeceased",
comment: "是否有逝者",
default: 1,
})
hasDeceased: number; // 关联分类
}
export default ServiceItem;

View File

@@ -0,0 +1,28 @@
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
@Entity("system_menue")
export class SystemMenue {
@PrimaryGeneratedColumn()
id: number;
@Column({ comment: "菜单名", default: "" })
name: string;
@Column({ comment: "创建时间", default: "" })
createDate: string;
@Column({ comment: "更新时间", default: "" })
updateDate: string;
@Column({ comment: "路径名", default: "" })
path: string;
@Column({ comment: "父级ID", default: 0 })
parentId: number;
@Column({ comment: "图标", default: "" })
icon: string;
@Column({ comment: "是否显示", default: true })
show: boolean;
}

View File

@@ -0,0 +1,45 @@
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
import dayjs from "dayjs";
import { BaseEntity } from "@/abstrClass/BaseEntity";
@Entity("user")
export class User extends BaseEntity {
@PrimaryGeneratedColumn({ type: "int", name: "id" })
id: number;
@Column("varchar", { name: "name", comment: "姓名\r\n", length: 255 })
name: string;
@Column("varchar", {
name: "phone",
nullable: true,
comment: "电话",
length: 255,
default: "",
})
phone: string;
@Column({ comment: "性别", default: "男" })
sex: string;
@Column("varchar", { name: "pwd", nullable: true, length: 255 })
pwd: string;
@Column({
comment: "创建时间",
default: dayjs().format("YYYY-MM-DD HH:mm:ss"),
})
@Column({ comment: "用户状态", default: 1 })
userState: number; // 账户状态
@Column({ comment: "角色", default: "" })
role: string; // 角色
@Column({ comment: "生日", default: "" })
birthday: string; // 生日
@Column({ comment: "年龄", default: "" })
age: string; // 年龄
@Column({ comment: "所在省", default: "" })
province: string; // 所在省
@Column({ comment: "所在市", default: "" })
city: string; // 所在市
@Column({ comment: "所在区域", default: "" })
area: string; // 所在区域
@Column({ comment: "详细地址", default: "" })
address: string; // 详细地址
}
export default User;

View File

@@ -0,0 +1,94 @@
import { Entity, Column } from "typeorm";
import { BaseEntity } from "@/abstrClass/BaseEntity";
import dayjs from "dayjs";
@Entity("nodeceased_retail")
export class noDeceasedRetail extends BaseEntity {
@Column("varchar", {
name: "buyer",
comment: "购买人",
length: 255,
default: "",
})
buyer: string;
@Column("datetime", {
name: "purchase_date",
comment: "购买日期",
default: () => "CURRENT_TIMESTAMP", // 默认值为当前时间
transformer: {
to(value: Date) {
return value;
},
from(value) {
return dayjs(new Date(value)).format("YYYY-MM-DD HH:mm:ss");
},
},
})
purchaseDate: Date;
@Column("varchar", {
name: "handler",
comment: "经办人",
length: 255,
default: "",
})
handler: string;
@Column("decimal", {
name: "sales_amount",
comment: "销售金额",
precision: 10,
scale: 2,
default: 0.0,
})
salesAmount: number;
@Column("varchar", {
name: "guide",
comment: "引导员",
length: 255,
default: "",
})
guide: string;
@Column("varchar", {
name: "family_name",
comment: "购买人",
length: 255,
default: "",
})
familyName: string;
@Column("varchar", {
name: "family_phone",
comment: "购买人电话",
length: 255,
default: 0,
})
familyPhone: string;
@Column("varchar", {
name: "service_items",
comment: "服务项目列表",
})
serviceItems: string;
// 0未结账、1已结账
@Column("int", {
name: "retail_state",
comment: "结账状态",
default: 0,
})
retailState: number;
// 0正常、1已作废
@Column("int", {
name: "cancel_state",
comment: "作废状态",
default: 0,
})
cancelState: number;
}
export default noDeceasedRetail;