feat(creditCompany): 为信用公司信息标签页添加数据状态指示

- 在标签页标题中添加徽章显示数据数量
- 实现 tabHasData 方法检查标签页是否有数据
- 为有数据的标签页添加高亮样式
- 为有数据的表格添加边框高亮效果
- 优化标签页标题的显示样式
This commit is contained in:
2026-01-10 00:55:55 +08:00
parent cc04fee941
commit e2649265c2
273 changed files with 9 additions and 50345 deletions

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicAppointment, ClinicAppointmentParam } from './model';
/**
* 分页查询挂号
*/
export async function pageClinicAppointment(params: ClinicAppointmentParam) {
const res = await request.get<ApiResult<PageResult<ClinicAppointment>>>(
'/clinic/clinic-appointment/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询挂号列表
*/
export async function listClinicAppointment(params?: ClinicAppointmentParam) {
const res = await request.get<ApiResult<ClinicAppointment[]>>(
'/clinic/clinic-appointment',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加挂号
*/
export async function addClinicAppointment(data: ClinicAppointment) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-appointment',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改挂号
*/
export async function updateClinicAppointment(data: ClinicAppointment) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-appointment',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除挂号
*/
export async function removeClinicAppointment(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-appointment/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除挂号
*/
export async function removeBatchClinicAppointment(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-appointment/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询挂号
*/
export async function getClinicAppointment(id: number) {
const res = await request.get<ApiResult<ClinicAppointment>>(
'/clinic/clinic-appointment/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,47 +0,0 @@
import type { PageParam } from '@/api';
/**
* 挂号
*/
export interface ClinicAppointment {
// 主键ID
id?: number;
// 类型
type?: number;
// 就诊原因
reason?: string;
// 挂号时间
evaluateTime?: string;
// 医生
doctorId?: number;
// 医生名称
doctorName?: string;
// 医生职位
doctorPosition?: string;
// 患者
userId?: number;
// 患者名称
nickname?: string;
// 患者联系电话
phone?: string;
// 备注
comments?: string;
// 排序号
sortNumber?: number;
// 是否删除
isDelete?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 挂号搜索条件
*/
export interface ClinicAppointmentParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicDoctorApply, ClinicDoctorApplyParam } from './model';
/**
* 分页查询医生入驻申请
*/
export async function pageClinicDoctorApply(params: ClinicDoctorApplyParam) {
const res = await request.get<ApiResult<PageResult<ClinicDoctorApply>>>(
'/clinic/clinic-doctor-apply/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询医生入驻申请列表
*/
export async function listClinicDoctorApply(params?: ClinicDoctorApplyParam) {
const res = await request.get<ApiResult<ClinicDoctorApply[]>>(
'/clinic/clinic-doctor-apply',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加医生入驻申请
*/
export async function addClinicDoctorApply(data: ClinicDoctorApply) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-doctor-apply',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改医生入驻申请
*/
export async function updateClinicDoctorApply(data: ClinicDoctorApply) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-doctor-apply',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除医生入驻申请
*/
export async function removeClinicDoctorApply(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-doctor-apply/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除医生入驻申请
*/
export async function removeBatchClinicDoctorApply(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-doctor-apply/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询医生入驻申请
*/
export async function getClinicDoctorApply(id: number) {
const res = await request.get<ApiResult<ClinicDoctorApply>>(
'/clinic/clinic-doctor-apply/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,75 +0,0 @@
import type { PageParam } from '@/api';
/**
* 医生入驻申请
*/
export interface ClinicDoctorApply {
// 主键ID
applyId?: number;
// 类型 0医生
type?: number;
// 用户ID
userId?: number;
// 姓名
realName?: string;
// 性别 1男 2女
gender?: number;
// 手机号
mobile?: string;
// 客户名称
dealerName?: string;
// 证件号码
idCard?: string;
// 生日
birthDate?: string;
// 区分职称等级(如主治医师、副主任医师)
professionalTitle?: string;
// 工作单位
workUnit?: string;
// 执业资格核心凭证
practiceLicense?: string;
// 限定可执业科室或疾病类型
practiceScope?: string;
// 开始工作时间
startWorkDate?: string;
// 简历
resume?: string;
// 使用 JSON 存储多个证件文件路径(如执业证、学历证)
certificationFiles?: string;
// 详细地址
address?: string;
// 签约价格
money?: string;
// 推荐人用户ID
refereeId?: number;
// 申请方式(10需后台审核 20无需审核)
applyType?: number;
// 审核状态 (10待审核 20审核通过 30驳回)
applyStatus?: number;
// 申请时间
applyTime?: string;
// 审核时间
auditTime?: string;
// 合同时间
contractTime?: string;
// 过期时间
expirationTime?: string;
// 驳回原因
rejectReason?: string;
// 备注
comments?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 医生入驻申请搜索条件
*/
export interface ClinicDoctorApplyParam extends PageParam {
applyId?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicDoctorMedicalRecord, ClinicDoctorMedicalRecordParam } from './model';
/**
* 分页查询医疗记录
*/
export async function pageClinicDoctorMedicalRecord(params: ClinicDoctorMedicalRecordParam) {
const res = await request.get<ApiResult<PageResult<ClinicDoctorMedicalRecord>>>(
'/clinic/clinic-doctor-medical-record/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询医疗记录列表
*/
export async function listClinicDoctorMedicalRecord(params?: ClinicDoctorMedicalRecordParam) {
const res = await request.get<ApiResult<ClinicDoctorMedicalRecord[]>>(
'/clinic/clinic-doctor-medical-record',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加医疗记录
*/
export async function addClinicDoctorMedicalRecord(data: ClinicDoctorMedicalRecord) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-doctor-medical-record',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改医疗记录
*/
export async function updateClinicDoctorMedicalRecord(data: ClinicDoctorMedicalRecord) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-doctor-medical-record',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除医疗记录
*/
export async function removeClinicDoctorMedicalRecord(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-doctor-medical-record/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除医疗记录
*/
export async function removeBatchClinicDoctorMedicalRecord(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-doctor-medical-record/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询医疗记录
*/
export async function getClinicDoctorMedicalRecord(id: number) {
const res = await request.get<ApiResult<ClinicDoctorMedicalRecord>>(
'/clinic/clinic-doctor-medical-record/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,61 +0,0 @@
import type { PageParam } from '@/api';
/**
* 医疗记录
*/
export interface ClinicDoctorMedicalRecord {
// 主键ID
id?: number;
// 买家用户ID
userId?: number;
// 订单编号
orderNo?: string;
// 分销商用户id(一级)
firstUserId?: number;
// 分销商用户id(二级)
secondUserId?: number;
// 分销商用户id(三级)
thirdUserId?: number;
// 分销佣金(一级)
firstMoney?: string;
// 分销佣金(二级)
secondMoney?: string;
// 分销佣金(三级)
thirdMoney?: string;
// 单价
price?: string;
// 订单总金额
orderPrice?: string;
// 结算金额
settledPrice?: string;
// 换算成度
degreePrice?: string;
// 实发金额
payPrice?: string;
// 税率
rate?: string;
// 结算月份
month?: string;
// 订单是否失效(0未失效 1已失效)
isInvalid?: number;
// 佣金结算(0未结算 1已结算)
isSettled?: number;
// 结算时间
settleTime?: string;
// 备注
comments?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 医疗记录搜索条件
*/
export interface ClinicDoctorMedicalRecordParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicDoctorUser, ClinicDoctorUserParam } from './model';
/**
* 分页查询分销商用户记录表
*/
export async function pageClinicDoctorUser(params: ClinicDoctorUserParam) {
const res = await request.get<ApiResult<PageResult<ClinicDoctorUser>>>(
'/clinic/clinic-doctor-user/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询分销商用户记录表列表
*/
export async function listClinicDoctorUser(params?: ClinicDoctorUserParam) {
const res = await request.get<ApiResult<ClinicDoctorUser[]>>(
'/clinic/clinic-doctor-user',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加分销商用户记录表
*/
export async function addClinicDoctorUser(data: ClinicDoctorUser) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-doctor-user',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改分销商用户记录表
*/
export async function updateClinicDoctorUser(data: ClinicDoctorUser) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-doctor-user',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除分销商用户记录表
*/
export async function removeClinicDoctorUser(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-doctor-user/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除分销商用户记录表
*/
export async function removeBatchClinicDoctorUser(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-doctor-user/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询分销商用户记录表
*/
export async function getClinicDoctorUser(id: number) {
const res = await request.get<ApiResult<ClinicDoctorUser>>(
'/clinic/clinic-doctor-user/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,55 +0,0 @@
import type { PageParam } from '@/api';
/**
* 分销商用户记录表
*/
export interface ClinicDoctorUser {
// 主键ID
id?: number;
// 类型 0经销商 1企业 2集团
type?: number;
// 自增ID
userId?: number;
// 姓名
realName?: string;
// 手机号
phone?: string;
// 部门
departmentId?: number;
// 专业领域
specialty?: string;
// 职务级别
position?: string;
// 执业资格
qualification?: string;
// 医生简介
introduction?: string;
// 挂号费
consultationFee?: string;
// 工作年限
workYears?: number;
// 问诊人数
consultationCount?: number;
// 专属二维码
qrcode?: string;
// 备注
comments?: string;
// 排序号
sortNumber?: number;
// 是否删除
isDelete?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 分销商用户记录表搜索条件
*/
export interface ClinicDoctorUserParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicMedicalHistory, ClinicMedicalHistoryParam } from './model';
/**
* 分页查询病例
*/
export async function pageClinicMedicalHistory(params: ClinicMedicalHistoryParam) {
const res = await request.get<ApiResult<PageResult<ClinicMedicalHistory>>>(
'/clinic/clinic-medical-history/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询病例列表
*/
export async function listClinicMedicalHistory(params?: ClinicMedicalHistoryParam) {
const res = await request.get<ApiResult<ClinicMedicalHistory[]>>(
'/clinic/clinic-medical-history',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加病例
*/
export async function addClinicMedicalHistory(data: ClinicMedicalHistory) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-medical-history',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改病例
*/
export async function updateClinicMedicalHistory(data: ClinicMedicalHistory) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-medical-history',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除病例
*/
export async function removeClinicMedicalHistory(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medical-history/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除病例
*/
export async function removeBatchClinicMedicalHistory(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medical-history/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询病例
*/
export async function getClinicMedicalHistory(id: number) {
const res = await request.get<ApiResult<ClinicMedicalHistory>>(
'/clinic/clinic-medical-history/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,61 +0,0 @@
import type { PageParam } from '@/api';
/**
* 病例
*/
export interface ClinicMedicalHistory {
// 主键ID
id?: number;
// 买家用户ID
userId?: number;
// 订单编号
orderNo?: string;
// 分销商用户id(一级)
firstUserId?: number;
// 分销商用户id(二级)
secondUserId?: number;
// 分销商用户id(三级)
thirdUserId?: number;
// 分销佣金(一级)
firstMoney?: string;
// 分销佣金(二级)
secondMoney?: string;
// 分销佣金(三级)
thirdMoney?: string;
// 单价
price?: string;
// 订单总金额
orderPrice?: string;
// 结算金额
settledPrice?: string;
// 换算成度
degreePrice?: string;
// 实发金额
payPrice?: string;
// 税率
rate?: string;
// 结算月份
month?: string;
// 订单是否失效(0未失效 1已失效)
isInvalid?: number;
// 佣金结算(0未结算 1已结算)
isSettled?: number;
// 结算时间
settleTime?: string;
// 备注
comments?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 病例搜索条件
*/
export interface ClinicMedicalHistoryParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicMedicine, ClinicMedicineParam } from './model';
/**
* 分页查询药品库
*/
export async function pageClinicMedicine(params: ClinicMedicineParam) {
const res = await request.get<ApiResult<PageResult<ClinicMedicine>>>(
'/clinic/clinic-medicine/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询药品库列表
*/
export async function listClinicMedicine(params?: ClinicMedicineParam) {
const res = await request.get<ApiResult<ClinicMedicine[]>>(
'/clinic/clinic-medicine',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加药品库
*/
export async function addClinicMedicine(data: ClinicMedicine) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-medicine',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改药品库
*/
export async function updateClinicMedicine(data: ClinicMedicine) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-medicine',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除药品库
*/
export async function removeClinicMedicine(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medicine/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除药品库
*/
export async function removeBatchClinicMedicine(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medicine/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询药品库
*/
export async function getClinicMedicine(id: number) {
const res = await request.get<ApiResult<ClinicMedicine>>(
'/clinic/clinic-medicine/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,43 +0,0 @@
import type { PageParam } from '@/api';
/**
* 药品库
*/
export interface ClinicMedicine {
// 主键ID
id?: number;
// 药名
name?: string;
// 拼音
pinyin?: string;
// 分类(如“清热解毒”、“补气养血”)
category?: string;
// 规格(如“饮片”、“颗粒”)
specification?: string;
// 单位(如“克”、“袋”)
unit?: string;
// 描述
content?: string;
// 单价
pricePerUnit?: string;
// 是否活跃
isActive?: number;
// 买家用户ID
userId?: number;
// 备注
comments?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 药品库搜索条件
*/
export interface ClinicMedicineParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicMedicineInout, ClinicMedicineInoutParam } from './model';
/**
* 分页查询出入库
*/
export async function pageClinicMedicineInout(params: ClinicMedicineInoutParam) {
const res = await request.get<ApiResult<PageResult<ClinicMedicineInout>>>(
'/clinic/clinic-medicine-inout/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询出入库列表
*/
export async function listClinicMedicineInout(params?: ClinicMedicineInoutParam) {
const res = await request.get<ApiResult<ClinicMedicineInout[]>>(
'/clinic/clinic-medicine-inout',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加出入库
*/
export async function addClinicMedicineInout(data: ClinicMedicineInout) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-medicine-inout',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改出入库
*/
export async function updateClinicMedicineInout(data: ClinicMedicineInout) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-medicine-inout',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除出入库
*/
export async function removeClinicMedicineInout(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medicine-inout/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除出入库
*/
export async function removeBatchClinicMedicineInout(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medicine-inout/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询出入库
*/
export async function getClinicMedicineInout(id: number) {
const res = await request.get<ApiResult<ClinicMedicineInout>>(
'/clinic/clinic-medicine-inout/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,61 +0,0 @@
import type { PageParam } from '@/api';
/**
* 出入库
*/
export interface ClinicMedicineInout {
// 主键ID
id?: number;
// 买家用户ID
userId?: number;
// 订单编号
orderNo?: string;
// 分销商用户id(一级)
firstUserId?: number;
// 分销商用户id(二级)
secondUserId?: number;
// 分销商用户id(三级)
thirdUserId?: number;
// 分销佣金(一级)
firstMoney?: string;
// 分销佣金(二级)
secondMoney?: string;
// 分销佣金(三级)
thirdMoney?: string;
// 单价
price?: string;
// 订单总金额
orderPrice?: string;
// 结算金额
settledPrice?: string;
// 换算成度
degreePrice?: string;
// 实发金额
payPrice?: string;
// 税率
rate?: string;
// 结算月份
month?: string;
// 订单是否失效(0未失效 1已失效)
isInvalid?: number;
// 佣金结算(0未结算 1已结算)
isSettled?: number;
// 结算时间
settleTime?: string;
// 备注
comments?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 出入库搜索条件
*/
export interface ClinicMedicineInoutParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicMedicineStock, ClinicMedicineStockParam } from './model';
/**
* 分页查询药品库存
*/
export async function pageClinicMedicineStock(params: ClinicMedicineStockParam) {
const res = await request.get<ApiResult<PageResult<ClinicMedicineStock>>>(
'/clinic/clinic-medicine-stock/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询药品库存列表
*/
export async function listClinicMedicineStock(params?: ClinicMedicineStockParam) {
const res = await request.get<ApiResult<ClinicMedicineStock[]>>(
'/clinic/clinic-medicine-stock',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加药品库存
*/
export async function addClinicMedicineStock(data: ClinicMedicineStock) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-medicine-stock',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改药品库存
*/
export async function updateClinicMedicineStock(data: ClinicMedicineStock) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-medicine-stock',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除药品库存
*/
export async function removeClinicMedicineStock(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medicine-stock/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除药品库存
*/
export async function removeBatchClinicMedicineStock(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medicine-stock/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询药品库存
*/
export async function getClinicMedicineStock(id: number) {
const res = await request.get<ApiResult<ClinicMedicineStock>>(
'/clinic/clinic-medicine-stock/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,35 +0,0 @@
import type { PageParam } from '@/api';
/**
* 药品库存
*/
export interface ClinicMedicineStock {
// 主键ID
id?: number;
// 药品
medicineId?: number;
// 库存数量
stockQuantity?: number;
// 最小库存预警
minStockLevel?: number;
// 上次更新时间
lastUpdated?: string;
// 买家用户ID
userId?: number;
// 备注
comments?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 药品库存搜索条件
*/
export interface ClinicMedicineStockParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicOrder, ClinicOrderParam } from './model';
/**
* 分页查询处方订单
*/
export async function pageClinicOrder(params: ClinicOrderParam) {
const res = await request.get<ApiResult<PageResult<ClinicOrder>>>(
'/clinic/clinic-order/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询处方订单列表
*/
export async function listClinicOrder(params?: ClinicOrderParam) {
const res = await request.get<ApiResult<ClinicOrder[]>>(
'/clinic/clinic-order',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加处方订单
*/
export async function addClinicOrder(data: ClinicOrder) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-order',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改处方订单
*/
export async function updateClinicOrder(data: ClinicOrder) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-order',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除处方订单
*/
export async function removeClinicOrder(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-order/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除处方订单
*/
export async function removeBatchClinicOrder(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-order/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询处方订单
*/
export async function getClinicOrder(id: number) {
const res = await request.get<ApiResult<ClinicOrder>>(
'/clinic/clinic-order/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,167 +0,0 @@
import type { PageParam } from '@/api';
/**
* 处方订单
*/
export interface ClinicOrder {
// 订单号
orderId?: number;
// 订单编号
orderNo?: string;
// 订单类型0商城订单 1预定订单/外卖 2会员卡
type?: number;
// 订单标题
title?: string;
// 快递/自提
deliveryType?: number;
// 下单渠道0小程序预定 1俱乐部训练场 3活动订场
channel?: number;
// 微信支付交易号号
transactionId?: string;
// 微信退款订单号
refundOrder?: string;
// 商户ID
merchantId?: number;
// 商户名称
merchantName?: string;
// 商户编号
merchantCode?: string;
// 使用的优惠券id
couponId?: number;
// 使用的会员卡id
cardId?: string;
// 关联管理员id
adminId?: number;
// 核销管理员id
confirmId?: number;
// IC卡号
icCard?: string;
// 真实姓名
realName?: string;
// 关联收货地址
addressId?: number;
// 收货地址
address?: string;
//
addressLat?: string;
//
addressLng?: string;
// 买家留言
buyerRemarks?: string;
// 自提店铺id
selfTakeMerchantId?: number;
// 自提店铺
selfTakeMerchantName?: string;
// 配送开始时间
sendStartTime?: string;
// 配送结束时间
sendEndTime?: string;
// 发货店铺id
expressMerchantId?: number;
// 发货店铺
expressMerchantName?: string;
// 订单总额
totalPrice?: string;
// 减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
reducePrice?: string;
// 实际付款
payPrice?: string;
// 用于统计
price?: string;
// 价钱,用于积分赠送
money?: string;
// 取消时间
cancelTime?: string;
// 取消原因
cancelReason?: string;
// 退款金额
refundMoney?: string;
// 教练价格
coachPrice?: string;
// 购买数量
totalNum?: number;
// 教练id
coachId?: number;
// 商品ID
formId?: number;
// 支付的用户id
payUserId?: number;
// 0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付
payType?: number;
// 微信支付子类型JSAPI小程序支付NATIVE扫码支付
wechatPayType?: string;
// 0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付
friendPayType?: number;
// 0未付款1已付款
payStatus?: string;
// 0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款
orderStatus?: number;
// 发货状态(10未发货 20已发货 30部分发货)
deliveryStatus?: number;
// 无需发货备注
deliveryNote?: string;
// 发货时间
deliveryTime?: string;
// 评价状态(0未评价 1已评价)
evaluateStatus?: number;
// 评价时间
evaluateTime?: string;
// 优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
couponType?: number;
// 优惠说明
couponDesc?: string;
// 二维码地址,保存订单号,支付成功后才生成
qrcode?: string;
// vip月卡年卡、ic月卡年卡回退次数
returnNum?: number;
// vip充值回退金额
returnMoney?: string;
// 预约详情开始时间数组
startTime?: string;
// 是否已开具发票0未开发票1已开发票2不能开具发票
isInvoice?: string;
// 发票流水号
invoiceNo?: string;
// 商家留言
merchantRemarks?: string;
// 支付时间
payTime?: string;
// 退款时间
refundTime?: string;
// 申请退款时间
refundApplyTime?: string;
// 过期时间
expirationTime?: string;
// 自提码
selfTakeCode?: string;
// 是否已收到赠品
hasTakeGift?: string;
// 对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单
checkBill?: number;
// 订单是否已结算(0未结算 1已结算)
isSettled?: number;
// 系统版本号 0当前版本 value=其他版本
version?: number;
// 用户id
userId?: number;
// 备注
comments?: string;
// 排序号
sortNumber?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 修改时间
updateTime?: string;
// 创建时间
createTime?: string;
}
/**
* 处方订单搜索条件
*/
export interface ClinicOrderParam extends PageParam {
orderId?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicPatientUser, ClinicPatientUserParam } from './model';
/**
* 分页查询患者
*/
export async function pageClinicPatientUser(params: ClinicPatientUserParam) {
const res = await request.get<ApiResult<PageResult<ClinicPatientUser>>>(
'/clinic/clinic-patient-user/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询患者列表
*/
export async function listClinicPatientUser(params?: ClinicPatientUserParam) {
const res = await request.get<ApiResult<ClinicPatientUser[]>>(
'/clinic/clinic-patient-user',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加患者
*/
export async function addClinicPatientUser(data: ClinicPatientUser) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-patient-user',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改患者
*/
export async function updateClinicPatientUser(data: ClinicPatientUser) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-patient-user',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除患者
*/
export async function removeClinicPatientUser(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-patient-user/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除患者
*/
export async function removeBatchClinicPatientUser(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-patient-user/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询患者
*/
export async function getClinicPatientUser(id: number) {
const res = await request.get<ApiResult<ClinicPatientUser>>(
'/clinic/clinic-patient-user/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,49 +0,0 @@
import type { PageParam } from '@/api';
/**
* 患者
*/
export interface ClinicPatientUser {
// 主键ID
id?: number;
// 类型 0经销商 1企业 2集团
type?: number;
// 自增ID
userId?: number;
// 姓名
realName?: string;
// 性别
sex?: string;
// 手机号
phone?: string;
// 年龄
age?: number;
// 身高
height?: number;
// 体重
weight?: number;
// 过敏史
allergyHistory?: string;
// 专属二维码
qrcode?: string;
// 备注
comments?: string;
// 排序号
sortNumber?: number;
// 是否删除
isDelete?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 患者搜索条件
*/
export interface ClinicPatientUserParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,112 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicPrescription, ClinicPrescriptionParam } from './model';
/**
* 分页查询处方主表
*/
export async function pageClinicPrescription(params: ClinicPrescriptionParam) {
const res = await request.get<ApiResult<PageResult<ClinicPrescription>>>(
'/clinic/clinic-prescription/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询处方主表
列表
*/
export async function listClinicPrescription(params?: ClinicPrescriptionParam) {
const res = await request.get<ApiResult<ClinicPrescription[]>>(
'/clinic/clinic-prescription',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加处方主表
*/
export async function addClinicPrescription(data: ClinicPrescription) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-prescription',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改处方主表
*/
export async function updateClinicPrescription(data: ClinicPrescription) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-prescription',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除处方主表
*/
export async function removeClinicPrescription(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-prescription/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除处方主表
*/
export async function removeBatchClinicPrescription(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-prescription/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询处方主表
*/
export async function getClinicPrescription(id: number) {
const res = await request.get<ApiResult<ClinicPrescription>>(
'/clinic/clinic-prescription/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,57 +0,0 @@
import type { PageParam } from '@/api';
/**
* 处方主表
*/
export interface ClinicPrescription {
// 主键ID
id?: number;
// 患者
userId?: number;
// 医生
doctorId?: number;
// 订单编号
orderNo?: string;
// 关联就诊表
visitRecordId?: number;
// 处方类型 0中药 1西药
prescriptionType?: number;
// 诊断结果
diagnosis?: string;
// 治疗方案
treatmentPlan?: string;
// 煎药说明
decoctionInstructions?: string;
// 订单总金额
orderPrice?: string;
// 单价
price?: string;
// 实付金额
payPrice?: string;
// 订单是否失效(0未失效 1已失效)
isInvalid?: number;
// 结算(0未结算 1已结算)
isSettled?: number;
// 结算时间
settleTime?: string;
// 状态, 0正常, 1已完成2已支付3已取消
status?: number;
// 备注
comments?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 处方主表
搜索条件
*/
export interface ClinicPrescriptionParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,112 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicPrescriptionItem, ClinicPrescriptionItemParam } from './model';
/**
* 分页查询处方明细表
*/
export async function pageClinicPrescriptionItem(params: ClinicPrescriptionItemParam) {
const res = await request.get<ApiResult<PageResult<ClinicPrescriptionItem>>>(
'/clinic/clinic-prescription-item/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询处方明细表
列表
*/
export async function listClinicPrescriptionItem(params?: ClinicPrescriptionItemParam) {
const res = await request.get<ApiResult<ClinicPrescriptionItem[]>>(
'/clinic/clinic-prescription-item',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加处方明细表
*/
export async function addClinicPrescriptionItem(data: ClinicPrescriptionItem) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-prescription-item',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改处方明细表
*/
export async function updateClinicPrescriptionItem(data: ClinicPrescriptionItem) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-prescription-item',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除处方明细表
*/
export async function removeClinicPrescriptionItem(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-prescription-item/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除处方明细表
*/
export async function removeBatchClinicPrescriptionItem(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-prescription-item/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询处方明细表
*/
export async function getClinicPrescriptionItem(id: number) {
const res = await request.get<ApiResult<ClinicPrescriptionItem>>(
'/clinic/clinic-prescription-item/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,49 +0,0 @@
import type { PageParam } from '@/api';
/**
* 处方明细表
*/
export interface ClinicPrescriptionItem {
// 自增ID
id?: number;
// 关联处方
prescriptionId?: number;
// 订单编号
prescriptionNo?: string;
// 关联药品
medicineId?: number;
// 剂量如“10g”
dosage?: string;
// 用法频率(如“每日三次”)
usageFrequency?: string;
// 服用天数
days?: number;
// 购买数量
amount?: number;
// 单价
unitPrice?: string;
// 数量
quantity?: number;
// 排序号
sortNumber?: number;
// 备注
comments?: string;
// 用户id
userId?: number;
// 租户id
tenantId?: number;
// 更新时间
updateTime?: string;
// 创建时间
createTime?: string;
}
/**
* 处方明细表
搜索条件
*/
export interface ClinicPrescriptionItemParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicReport, ClinicReportParam } from './model';
/**
* 分页查询报告
*/
export async function pageClinicReport(params: ClinicReportParam) {
const res = await request.get<ApiResult<PageResult<ClinicReport>>>(
'/clinic/clinic-report/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询报告列表
*/
export async function listClinicReport(params?: ClinicReportParam) {
const res = await request.get<ApiResult<ClinicReport[]>>(
'/clinic/clinic-report',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加报告
*/
export async function addClinicReport(data: ClinicReport) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-report',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改报告
*/
export async function updateClinicReport(data: ClinicReport) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-report',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除报告
*/
export async function removeClinicReport(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-report/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除报告
*/
export async function removeBatchClinicReport(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-report/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询报告
*/
export async function getClinicReport(id: number) {
const res = await request.get<ApiResult<ClinicReport>>(
'/clinic/clinic-report/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,61 +0,0 @@
import type { PageParam } from '@/api';
/**
* 报告
*/
export interface ClinicReport {
// 主键ID
id?: number;
// 买家用户ID
userId?: number;
// 订单编号
orderNo?: string;
// 分销商用户id(一级)
firstUserId?: number;
// 分销商用户id(二级)
secondUserId?: number;
// 分销商用户id(三级)
thirdUserId?: number;
// 分销佣金(一级)
firstMoney?: string;
// 分销佣金(二级)
secondMoney?: string;
// 分销佣金(三级)
thirdMoney?: string;
// 单价
price?: string;
// 订单总金额
orderPrice?: string;
// 结算金额
settledPrice?: string;
// 换算成度
degreePrice?: string;
// 实发金额
payPrice?: string;
// 税率
rate?: string;
// 结算月份
month?: string;
// 订单是否失效(0未失效 1已失效)
isInvalid?: number;
// 佣金结算(0未结算 1已结算)
isSettled?: number;
// 结算时间
settleTime?: string;
// 备注
comments?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 报告搜索条件
*/
export interface ClinicReportParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicVisitRecord, ClinicVisitRecordParam } from './model';
/**
* 分页查询病例
*/
export async function pageClinicVisitRecord(params: ClinicVisitRecordParam) {
const res = await request.get<ApiResult<PageResult<ClinicVisitRecord>>>(
'/clinic/clinic-visit-record/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询病例列表
*/
export async function listClinicVisitRecord(params?: ClinicVisitRecordParam) {
const res = await request.get<ApiResult<ClinicVisitRecord[]>>(
'/clinic/clinic-visit-record',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加病例
*/
export async function addClinicVisitRecord(data: ClinicVisitRecord) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-visit-record',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改病例
*/
export async function updateClinicVisitRecord(data: ClinicVisitRecord) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-visit-record',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除病例
*/
export async function removeClinicVisitRecord(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-visit-record/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除病例
*/
export async function removeBatchClinicVisitRecord(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-visit-record/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询病例
*/
export async function getClinicVisitRecord(id: number) {
const res = await request.get<ApiResult<ClinicVisitRecord>>(
'/clinic/clinic-visit-record/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,61 +0,0 @@
import type { PageParam } from '@/api';
/**
* 病例
*/
export interface ClinicVisitRecord {
// 主键ID
id?: number;
// 买家用户ID
userId?: number;
// 订单编号
orderNo?: string;
// 分销商用户id(一级)
firstUserId?: number;
// 分销商用户id(二级)
secondUserId?: number;
// 分销商用户id(三级)
thirdUserId?: number;
// 分销佣金(一级)
firstMoney?: string;
// 分销佣金(二级)
secondMoney?: string;
// 分销佣金(三级)
thirdMoney?: string;
// 单价
price?: string;
// 订单总金额
orderPrice?: string;
// 结算金额
settledPrice?: string;
// 换算成度
degreePrice?: string;
// 实发金额
payPrice?: string;
// 税率
rate?: string;
// 结算月份
month?: string;
// 订单是否失效(0未失效 1已失效)
isInvalid?: number;
// 佣金结算(0未结算 1已结算)
isSettled?: number;
// 结算时间
settleTime?: string;
// 备注
comments?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 病例搜索条件
*/
export interface ClinicVisitRecordParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DormitoryApply, DormitoryApplyParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询审批管理
*/
export async function pageDormitoryApply(params: DormitoryApplyParam) {
const res = await request.get<ApiResult<PageResult<DormitoryApply>>>(
MODULES_API_URL + '/dormitory/dormitory-apply/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询审批管理列表
*/
export async function listDormitoryApply(params?: DormitoryApplyParam) {
const res = await request.get<ApiResult<DormitoryApply[]>>(
MODULES_API_URL + '/dormitory/dormitory-apply',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加审批管理
*/
export async function addDormitoryApply(data: DormitoryApply) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-apply',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改审批管理
*/
export async function updateDormitoryApply(data: DormitoryApply) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-apply',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除审批管理
*/
export async function removeDormitoryApply(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-apply/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除审批管理
*/
export async function removeBatchDormitoryApply(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-apply/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询审批管理
*/
export async function getDormitoryApply(id: number) {
const res = await request.get<ApiResult<DormitoryApply>>(
MODULES_API_URL + '/dormitory/dormitory-apply/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,57 +0,0 @@
import type { PageParam } from '@/api';
/**
* 审批管理
*/
export interface DormitoryApply {
// 主键ID
id?: number;
// 类型
type?: number;
// 用户ID
userId?: number;
// 姓名
realName?: string;
// 手机号
mobile?: string;
// 客户名称
dealerName?: string;
// 客户编号
dealerCode?: string;
// 详细地址
address?: string;
// 签约价格
money?: string;
// 推荐人用户ID
refereeId?: number;
// 申请方式(10需后台审核 20无需审核)
applyType?: number;
// 审核状态 (10待审核 20审核通过 30驳回)
applyStatus?: number;
// 申请时间
applyTime?: string;
// 审核时间
auditTime?: string;
// 合同时间
contractTime?: string;
// 过期时间
expirationTime?: string;
// 驳回原因
rejectReason?: string;
// 备注
comments?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 审批管理搜索条件
*/
export interface DormitoryApplyParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DormitoryBed, DormitoryBedParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询宿舍床铺
*/
export async function pageDormitoryBed(params: DormitoryBedParam) {
const res = await request.get<ApiResult<PageResult<DormitoryBed>>>(
MODULES_API_URL + '/dormitory/dormitory-bed/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询宿舍床铺列表
*/
export async function listDormitoryBed(params?: DormitoryBedParam) {
const res = await request.get<ApiResult<DormitoryBed[]>>(
MODULES_API_URL + '/dormitory/dormitory-bed',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加宿舍床铺
*/
export async function addDormitoryBed(data: DormitoryBed) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-bed',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改宿舍床铺
*/
export async function updateDormitoryBed(data: DormitoryBed) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-bed',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除宿舍床铺
*/
export async function removeDormitoryBed(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-bed/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除宿舍床铺
*/
export async function removeBatchDormitoryBed(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-bed/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询宿舍床铺
*/
export async function getDormitoryBed(id: number) {
const res = await request.get<ApiResult<DormitoryBed>>(
MODULES_API_URL + '/dormitory/dormitory-bed/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,55 +0,0 @@
import type { PageParam } from '@/api';
/**
* 宿舍床铺
*/
export interface DormitoryBed {
// ID
id?: number;
// 宿舍名称
name?: string;
// 编号
code?: string;
// 楼栋ID
buildingId?: number;
// 楼栋名称
buildingName?: string;
// 楼层ID
floorId?: number;
// 楼层名称
floorName?: string;
// 房间ID
recordId?: number;
// 房间名称
recordName?: string;
// 上下铺 1下铺 2上铺 0无
bunk?: number;
// 充电口
chargingPort?: string;
// 用户ID
userId?: number;
// 真实姓名
realName?: string;
// 手机号码
phone?: string;
// 头像
avatar?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1报修
status?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 宿舍床铺搜索条件
*/
export interface DormitoryBedParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DormitoryBuilding, DormitoryBuildingParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询宿舍楼栋
*/
export async function pageDormitoryBuilding(params: DormitoryBuildingParam) {
const res = await request.get<ApiResult<PageResult<DormitoryBuilding>>>(
MODULES_API_URL + '/dormitory/dormitory-building/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询宿舍楼栋列表
*/
export async function listDormitoryBuilding(params?: DormitoryBuildingParam) {
const res = await request.get<ApiResult<DormitoryBuilding[]>>(
MODULES_API_URL + '/dormitory/dormitory-building',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加宿舍楼栋
*/
export async function addDormitoryBuilding(data: DormitoryBuilding) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-building',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改宿舍楼栋
*/
export async function updateDormitoryBuilding(data: DormitoryBuilding) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-building',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除宿舍楼栋
*/
export async function removeDormitoryBuilding(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-building/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除宿舍楼栋
*/
export async function removeBatchDormitoryBuilding(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-building/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询宿舍楼栋
*/
export async function getDormitoryBuilding(id: number) {
const res = await request.get<ApiResult<DormitoryBuilding>>(
MODULES_API_URL + '/dormitory/dormitory-building/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,31 +0,0 @@
import type { PageParam } from '@/api';
/**
* 宿舍楼栋
*/
export interface DormitoryBuilding {
// ID
id?: number;
// 楼栋名称
name?: string;
// 楼栋编号
code?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 宿舍楼栋搜索条件
*/
export interface DormitoryBuildingParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DormitoryFloor, DormitoryFloorParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询宿舍楼层
*/
export async function pageDormitoryFloor(params: DormitoryFloorParam) {
const res = await request.get<ApiResult<PageResult<DormitoryFloor>>>(
MODULES_API_URL + '/dormitory/dormitory-floor/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询宿舍楼层列表
*/
export async function listDormitoryFloor(params?: DormitoryFloorParam) {
const res = await request.get<ApiResult<DormitoryFloor[]>>(
MODULES_API_URL + '/dormitory/dormitory-floor',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加宿舍楼层
*/
export async function addDormitoryFloor(data: DormitoryFloor) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-floor',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改宿舍楼层
*/
export async function updateDormitoryFloor(data: DormitoryFloor) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-floor',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除宿舍楼层
*/
export async function removeDormitoryFloor(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-floor/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除宿舍楼层
*/
export async function removeBatchDormitoryFloor(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-floor/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询宿舍楼层
*/
export async function getDormitoryFloor(id: number) {
const res = await request.get<ApiResult<DormitoryFloor>>(
MODULES_API_URL + '/dormitory/dormitory-floor/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,35 +0,0 @@
import type { PageParam } from '@/api';
/**
* 宿舍楼层
*/
export interface DormitoryFloor {
// ID
id?: number;
// 楼层
name?: string;
// 编号
code?: string;
// 楼栋ID
buildingId?: number;
// 楼栋名称
buildingName?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 宿舍楼层搜索条件
*/
export interface DormitoryFloorParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DormitoryRecord, DormitoryRecordParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询宿舍记录
*/
export async function pageDormitoryRecord(params: DormitoryRecordParam) {
const res = await request.get<ApiResult<PageResult<DormitoryRecord>>>(
MODULES_API_URL + '/dormitory/dormitory-record/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询宿舍记录列表
*/
export async function listDormitoryRecord(params?: DormitoryRecordParam) {
const res = await request.get<ApiResult<DormitoryRecord[]>>(
MODULES_API_URL + '/dormitory/dormitory-record',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加宿舍记录
*/
export async function addDormitoryRecord(data: DormitoryRecord) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-record',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改宿舍记录
*/
export async function updateDormitoryRecord(data: DormitoryRecord) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-record',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除宿舍记录
*/
export async function removeDormitoryRecord(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-record/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除宿舍记录
*/
export async function removeBatchDormitoryRecord(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/dormitory/dormitory-record/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询宿舍记录
*/
export async function getDormitoryRecord(id: number) {
const res = await request.get<ApiResult<DormitoryRecord>>(
MODULES_API_URL + '/dormitory/dormitory-record/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,43 +0,0 @@
import type { PageParam } from '@/api';
/**
* 宿舍记录
*/
export interface DormitoryRecord {
// ID
id?: number;
// 宿舍名称
name?: string;
// 编号
code?: string;
// 楼栋ID
buildingId?: number;
// 楼栋名称
buildingName?: string;
// 楼层ID
floorId?: number;
// 楼层名称
floorName?: string;
// 床铺数
beds?: number;
// 独立卫生间
toilet?: boolean;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 宿舍记录搜索条件
*/
export interface DormitoryRecordParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { HjmBxLog, HjmBxLogParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询黄家明_报险记录
*/
export async function pageHjmBxLog(params: HjmBxLogParam) {
const res = await request.get<ApiResult<PageResult<HjmBxLog>>>(
MODULES_API_URL + '/hjm/hjm-bx-log/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询黄家明_报险记录列表
*/
export async function listHjmBxLog(params?: HjmBxLogParam) {
const res = await request.get<ApiResult<HjmBxLog[]>>(
MODULES_API_URL + '/hjm/hjm-bx-log',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加黄家明_报险记录
*/
export async function addHjmBxLog(data: HjmBxLog) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-bx-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改黄家明_报险记录
*/
export async function updateHjmBxLog(data: HjmBxLog) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-bx-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除黄家明_报险记录
*/
export async function removeHjmBxLog(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-bx-log/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除黄家明_报险记录
*/
export async function removeBatchHjmBxLog(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-bx-log/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询黄家明_报险记录
*/
export async function getHjmBxLog(id: number) {
const res = await request.get<ApiResult<HjmBxLog>>(
MODULES_API_URL + '/hjm/hjm-bx-log/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,45 +0,0 @@
import type { PageParam } from '@/api';
/**
* 黄家明_报险记录
*/
export interface HjmBxLog {
// 自增ID
id?: number;
// 用户ID
userId?: number;
// 车辆ID
carId?: number;
// 车牌号
carNo?: string;
// 操作员
realName?: string;
// 事故类型
accidentType?: string;
// 部门
parentOrganization?: string;
// 保险图片
image?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 黄家明_报险记录搜索条件
*/
export interface HjmBxLogParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,135 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { HjmCar, HjmCarParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询车辆管理
*/
export async function pageHjmCar(params: HjmCarParam) {
const res = await request.get<ApiResult<PageResult<HjmCar>>>(
MODULES_API_URL + '/hjm/hjm-car/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询车辆管理列表
*/
export async function listHjmCar(params?: HjmCarParam) {
const res = await request.get<ApiResult<HjmCar[]>>(
MODULES_API_URL + '/hjm/hjm-car',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加车辆管理
*/
export async function addHjmCar(data: HjmCar) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-car',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改车辆管理
*/
export async function updateHjmCar(data: HjmCar) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-car',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除车辆管理
*/
export async function removeHjmCar(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-car/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除车辆管理
*/
export async function removeBatchHjmCar(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-car/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询车辆管理
*/
export async function getHjmCar(id: number) {
const res = await request.get<ApiResult<HjmCar>>(
MODULES_API_URL + '/hjm/hjm-car/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 车辆批量导入
*/
export async function importHjmCar(file: File) {
const formData = new FormData();
formData.append('file', file);
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-car/import',
formData
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据code查询黄家明_车辆管理
*/
export async function getHjmCarByCode(code: string) {
const res = await request.get<ApiResult<HjmCar>>(
MODULES_API_URL + '/hjm/hjm-car/getByCode/' + code
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,96 +0,0 @@
import type { PageParam } from '@/api';
import {HjmFence} from "@/api/hjm/hjmFence/model";
/**
* 车辆管理
*/
export interface HjmCar {
// 自增ID
id?: number;
// 车辆名称
name?: string;
// 车辆图片
image?: string;
// 类型 0汽车 1其他车
type?: number;
// 快递公司
kuaidi?: string;
// 管理负责人
kuaidiAdmin?: string;
// 车辆编号
code?: string;
// 车架号
vinCode?: string;
// 保单图片
bdImg?: string;
// 绑定操作员
driverId?: number;
// 操作员名称
driver?: string;
// 操作员名称
driverName?: string;
// 操作员手机号
driverPhone?: string;
// 安装人员
installerId?: number;
// 安装时间
installTime?: string;
// 保险状态
insuranceStatus?: string;
// GPS设备编号
gpsNo?: string;
// 电子围栏ID
fenceId?: number;
// 电子围栏名称
fenceName?: string;
// 车辆是否在电子围栏内
inFence?: boolean;
// 电子围栏名称
fence?: HjmFence;
// 位置
location?: string;
// 经度
longitude?: string,
// 纬度
latitude?: string,
// 区域
district?: string;
// 地址
address?: string,
// 组织ID
organizationId?: number;
// 父级组织ID
organizationParentId?: number;
// 用户ID
userId?: number;
// 认领状态
claim?: number;
// 认领时间
claimTime?: string;
// 绑定用户
toUser?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 车辆管理搜索条件
*/
export interface HjmCarParam extends PageParam {
id?: number;
status?: number;
organizationId?: number;
installerId?: number;
organizationParentId?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { HjmChoices, HjmChoicesParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询选择题选项
*/
export async function pageHjmChoices(params: HjmChoicesParam) {
const res = await request.get<ApiResult<PageResult<HjmChoices>>>(
MODULES_API_URL + '/hjm/hjm-choices/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询选择题选项列表
*/
export async function listHjmChoices(params?: HjmChoicesParam) {
const res = await request.get<ApiResult<HjmChoices[]>>(
MODULES_API_URL + '/hjm/hjm-choices',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加选择题选项
*/
export async function addHjmChoices(data: HjmChoices) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-choices',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改选择题选项
*/
export async function updateHjmChoices(data: HjmChoices) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-choices',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除选择题选项
*/
export async function removeHjmChoices(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-choices/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除选择题选项
*/
export async function removeBatchHjmChoices(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-choices/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询选择题选项
*/
export async function getHjmChoices(id: number) {
const res = await request.get<ApiResult<HjmChoices>>(
MODULES_API_URL + '/hjm/hjm-choices/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,39 +0,0 @@
import type { PageParam } from '@/api';
/**
* 选择题选项
*/
export interface HjmChoices {
// 自增ID
id?: number;
// 题目ID
questionId?: number;
// 题目
content?: string;
// 是否正确
isCorrect?: boolean;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
// 选择题内容
choiceContent?: string;
}
/**
* 选择题选项搜索条件
*/
export interface HjmChoicesParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { HjmCourses, HjmCoursesParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询课程
*/
export async function pageHjmCourses(params: HjmCoursesParam) {
const res = await request.get<ApiResult<PageResult<HjmCourses>>>(
MODULES_API_URL + '/hjm/hjm-courses/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询课程列表
*/
export async function listHjmCourses(params?: HjmCoursesParam) {
const res = await request.get<ApiResult<HjmCourses[]>>(
MODULES_API_URL + '/hjm/hjm-courses',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加课程
*/
export async function addHjmCourses(data: HjmCourses) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-courses',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改课程
*/
export async function updateHjmCourses(data: HjmCourses) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-courses',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除课程
*/
export async function removeHjmCourses(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-courses/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除课程
*/
export async function removeBatchHjmCourses(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-courses/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询课程
*/
export async function getHjmCourses(id: number) {
const res = await request.get<ApiResult<HjmCourses>>(
MODULES_API_URL + '/hjm/hjm-courses/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,41 +0,0 @@
import type { PageParam } from '@/api';
/**
* 课程
*/
export interface HjmCourses {
// 自增ID
id?: number;
// 课程名称
name?: string;
// 类型
type?: number;
// 课程编号
code?: string;
// 课程封面图
image?: string;
// 用户ID
userId?: number;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 课程搜索条件
*/
export interface HjmCoursesParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { HjmExamLog, HjmExamLogParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询黄家明_学习记录
*/
export async function pageHjmExamLog(params: HjmExamLogParam) {
const res = await request.get<ApiResult<PageResult<HjmExamLog>>>(
MODULES_API_URL + '/hjm/hjm-exam-log/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询黄家明_学习记录列表
*/
export async function listHjmExamLog(params?: HjmExamLogParam) {
const res = await request.get<ApiResult<HjmExamLog[]>>(
MODULES_API_URL + '/hjm/hjm-exam-log',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加黄家明_学习记录
*/
export async function addHjmExamLog(data: HjmExamLog) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-exam-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改黄家明_学习记录
*/
export async function updateHjmExamLog(data: HjmExamLog) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-exam-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除黄家明_学习记录
*/
export async function removeHjmExamLog(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-exam-log/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除黄家明_学习记录
*/
export async function removeBatchHjmExamLog(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-exam-log/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询黄家明_学习记录
*/
export async function getHjmExamLog(id: number) {
const res = await request.get<ApiResult<HjmExamLog>>(
MODULES_API_URL + '/hjm/hjm-exam-log/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,38 +0,0 @@
import type { PageParam } from '@/api';
/**
* 黄家明_学习记录
*/
export interface HjmExamLog {
// 自增ID
id?: number;
// 用户ID
userId?: number;
// 得分
total?: string;
// 用时
useTime?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 黄家明_学习记录搜索条件
*/
export interface HjmExamLogParam extends PageParam {
id?: number;
status?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { HjmFence, HjmFenceParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询电子围栏
*/
export async function pageHjmFence(params: HjmFenceParam) {
const res = await request.get<ApiResult<PageResult<HjmFence>>>(
MODULES_API_URL + '/hjm/hjm-fence/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询电子围栏列表
*/
export async function listHjmFence(params?: HjmFenceParam) {
const res = await request.get<ApiResult<HjmFence[]>>(
MODULES_API_URL + '/hjm/hjm-fence',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加电子围栏
*/
export async function addHjmFence(data: HjmFence) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-fence',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改电子围栏
*/
export async function updateHjmFence(data: HjmFence) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-fence',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除电子围栏
*/
export async function removeHjmFence(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-fence/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除电子围栏
*/
export async function removeBatchHjmFence(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-fence/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询电子围栏
*/
export async function getHjmFence(id: number) {
const res = await request.get<ApiResult<HjmFence>>(
MODULES_API_URL + '/hjm/hjm-fence/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,44 +0,0 @@
import type { PageParam } from '@/api';
/**
* 电子围栏
*/
export interface HjmFence {
// 自增ID
id?: number;
// 围栏名称
name?: string;
// 类型 0圆形 1方形
type?: number;
// 位置
location?: string;
// 经度
longitude?: string;
// 纬度
latitude?: string;
// 区域
district?: string;
// 轮廓
points?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 电子围栏搜索条件
*/
export interface HjmFenceParam extends PageParam {
id?: number;
type?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { HjmGpsLog, HjmGpsLogParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询黄家明_gps轨迹
*/
export async function pageHjmGpsLog(params: HjmGpsLogParam) {
const res = await request.get<ApiResult<PageResult<HjmGpsLog>>>(
MODULES_API_URL + '/hjm/hjm-gps-log/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询黄家明_gps轨迹列表
*/
export async function listHjmGpsLog(params?: HjmGpsLogParam) {
const res = await request.get<ApiResult<HjmGpsLog[]>>(
MODULES_API_URL + '/hjm/hjm-gps-log',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加黄家明_gps轨迹
*/
export async function addHjmGpsLog(data: HjmGpsLog) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-gps-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改黄家明_gps轨迹
*/
export async function updateHjmGpsLog(data: HjmGpsLog) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-gps-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除黄家明_gps轨迹
*/
export async function removeHjmGpsLog(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-gps-log/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除黄家明_gps轨迹
*/
export async function removeBatchHjmGpsLog(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-gps-log/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询黄家明_gps轨迹
*/
export async function getHjmGpsLog(id: number) {
const res = await request.get<ApiResult<HjmGpsLog>>(
MODULES_API_URL + '/hjm/hjm-gps-log/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,34 +0,0 @@
import type { PageParam } from '@/api';
/**
* 黄家明_gps轨迹
*/
export interface HjmGpsLog {
// 自增ID
id?: number;
// 车辆ID
carId?: number;
// gps编号
gpsNo?: string;
// 经度
longitude?: string;
// 纬度
latitude?: string;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 黄家明_gps轨迹搜索条件
*/
export interface HjmGpsLogParam extends PageParam {
id?: number;
gpsNo?: string;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { HjmQuestions, HjmQuestionsParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询题目
*/
export async function pageHjmQuestions(params: HjmQuestionsParam) {
const res = await request.get<ApiResult<PageResult<HjmQuestions>>>(
MODULES_API_URL + '/hjm/hjm-questions/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询题目列表
*/
export async function listHjmQuestions(params?: HjmQuestionsParam) {
const res = await request.get<ApiResult<HjmQuestions[]>>(
MODULES_API_URL + '/hjm/hjm-questions',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加题目
*/
export async function addHjmQuestions(data: HjmQuestions) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-questions',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改题目
*/
export async function updateHjmQuestions(data: HjmQuestions) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-questions',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除题目
*/
export async function removeHjmQuestions(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-questions/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除题目
*/
export async function removeBatchHjmQuestions(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-questions/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询题目
*/
export async function getHjmQuestions(id: number) {
const res = await request.get<ApiResult<HjmQuestions>>(
MODULES_API_URL + '/hjm/hjm-questions/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,55 +0,0 @@
import type { PageParam } from '@/api';
import {HjmChoices} from "@/api/hjm/hjmChoices/model";
/**
* 题目
*/
export interface HjmQuestions {
// 自增ID
id?: number;
// 课程ID
courseId?: number;
// 课程名称
courseName?: string;
// 类型 0choice 1fill 2essay
type?: number;
// 题目
question?: string;
// 正确答案
correctAnswer?: string;
// 难度,'easy', 'medium', 'hard'
difficulty?: number;
// 用户ID
userId?: number;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
// 选项
choicesA?: string,
choicesB?: string,
choicesC?: string,
choicesD?: string,
choices?: number;
choicesList?: HjmChoices[];
}
/**
* 题目搜索条件
*/
export interface HjmQuestionsParam extends PageParam {
id?: number;
courseId?: number;
type?: number;
keywords?: string;
}

View File

@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { HjmViolation, HjmViolationParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询黄家明_违章记录
*/
export async function pageHjmViolation(params: HjmViolationParam) {
const res = await request.get<ApiResult<PageResult<HjmViolation>>>(
MODULES_API_URL + '/hjm/hjm-violation/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询黄家明_违章记录列表
*/
export async function listHjmViolation(params?: HjmViolationParam) {
const res = await request.get<ApiResult<HjmViolation[]>>(
MODULES_API_URL + '/hjm/hjm-violation',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加黄家明_违章记录
*/
export async function addHjmViolation(data: HjmViolation) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-violation',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改黄家明_违章记录
*/
export async function updateHjmViolation(data: HjmViolation) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-violation',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除黄家明_违章记录
*/
export async function removeHjmViolation(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-violation/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除黄家明_违章记录
*/
export async function removeBatchHjmViolation(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/hjm/hjm-violation/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询黄家明_违章记录
*/
export async function getHjmViolation(id: number) {
const res = await request.get<ApiResult<HjmViolation>>(
MODULES_API_URL + '/hjm/hjm-violation/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,43 +0,0 @@
import type { PageParam } from '@/api';
/**
* 黄家明_违章记录
*/
export interface HjmViolation {
// 自增ID
id?: number;
// 车辆编号
code?: string;
// 标题
title?: string;
// 文章分类ID
categoryId?: number;
// 处罚金额
money?: string;
// 扣分
score?: string;
// 录入员
adminId?: number;
// 用户ID
userId?: number;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0未处理, 1已处理
status?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 黄家明_违章记录搜索条件
*/
export interface HjmViolationParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -1,27 +0,0 @@
import request from '@/utils/request';
import type { ApiResult } from '@/api';
import { MODULES_API_URL } from '@/config/setting';
export async function stopReplace(data: any) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/led/bme/stop-replace',
data
);
if (res.data.code === 0) {
const data = res.data.data;
return data || [];
}
return Promise.reject(new Error(res.data.message));
}
export async function numberReplace(data: any) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/led/bme/number-sources',
data
);
if (res.data.code === 0) {
const data = res.data.data;
return data || [];
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,45 +0,0 @@
import type { PageParam } from '@/api';
/**
* 黄家明_报险记录
*/
export interface HjmBxLog {
// 自增ID
id?: number;
// 用户ID
userId?: number;
// 车辆ID
carId?: number;
// 车牌号
carNo?: string;
// 操作员
realName?: string;
// 事故类型
accidentType?: string;
// 部门
parentOrganization?: string;
// 保险图片
image?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 黄家明_报险记录搜索条件
*/
export interface HjmBxLogParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -25,11 +25,6 @@ export const routes = [
component: () => import('@/views/passport/register/index.vue'), component: () => import('@/views/passport/register/index.vue'),
meta: { title: '注册' } meta: { title: '注册' }
}, },
{
path: '/bszx/pay-cert/:id',
component: () => import('@/views/bszx/bszxPayCert/index.vue'),
meta: { title: '查看证书' }
},
{ {
path: '/dealer/register', path: '/dealer/register',
component: () => import('@/views/passport/dealer/register.vue'), component: () => import('@/views/passport/dealer/register.vue'),
@@ -50,16 +45,6 @@ export const routes = [
component: () => import('@/views/passport/merchant/apply.vue'), component: () => import('@/views/passport/merchant/apply.vue'),
meta: { title: '商家入驻申请' } meta: { title: '商家入驻申请' }
}, },
{
path: '/merchant/success',
component: () => import('@/views/passport/merchant/success.vue'),
meta: { title: '申请提交成功' }
},
{
path: '/led',
component: () => import('@/views/led/index.vue'),
meta: { title: '医生出诊信息表' }
},
// { // {
// path: '/forget', // path: '/forget',
// component: () => import('@/views/passport/forget/index.vue'), // component: () => import('@/views/passport/forget/index.vue'),

View File

@@ -1,199 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑班级' : '添加班级'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="选择年级" name="gradeId">
<a-select
v-model:value="form.gradeName"
show-search
placeholder="选择年级"
style="width: 200px"
:options="options"
@change="handleChange"
></a-select>
</a-form-item>
<a-form-item label="班级" name="name">
<a-input
allow-clear
placeholder="请输入班级"
v-model:value="form.name"
@pressEnter="save"
/>
</a-form-item>
<a-form-item label="排序" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxClass, updateBszxClass } from '@/api/bszx/bszxClass';
import { BszxClass } from '@/api/bszx/bszxClass/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import {BszxGrade} from "@/api/bszx/bszxGrade/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxClass | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const options = ref<BszxGrade[]>([]);
// 用户信息
const form = reactive<BszxClass>({
id: undefined,
name: undefined,
gradeId: undefined,
gradeName: undefined,
branch: 2,
sortNumber: 100,
comments: undefined,
status: undefined,
tenantId: undefined,
createTime: undefined
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxClassName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-班级名称',
trigger: 'blur'
}
]
});
const handleChange = (value: string, item: any) => {
form.gradeName = value;
form.gradeId = item.id;
};
const handleBranch = () => {
getBszxGradeList();
}
const getBszxGradeList = () => {
listBszxGrade({branch: form.branch}).then((list) => {
options.value = list.map(d => {
d.value = d.name;
d.label = d.name;
return d;
});
})
}
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxClass : addBszxClass;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
getBszxGradeList()
images.value = [];
if (props.data) {
assignObject(form, props.data);
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
// resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,98 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined/>
</template>
<span>添加</span>
</a-button>
<a-select
show-search
v-model:value="where.gradeId"
style="width: 240px"
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
<a-input-search
allow-clear
placeholder="请输入关键词"
style="width: 240px"
v-model:value="where.keywords"
@search="handleSearch"
/>
<a-button @click="reset">重置</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {PlusOutlined} from '@ant-design/icons-vue';
import {watch,ref} from 'vue';
import useSearch from "@/utils/use-search";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const gradeList = ref<BszxClassParam[]>([]);
const emit = defineEmits<{
(e: 'search', where?: BszxClassParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where, resetFields} = useSearch<BszxClassParam>({
gradeId: undefined,
eraId: undefined,
branch: undefined,
keywords: ''
});
// 新增
const add = () => {
emit('add');
};
const handleSearch = () => {
emit('search', where);
}
/* 重置 */
const reset = () => {
resetFields();
handleSearch();
};
const onGrade = (gradeId: number) => {
where.gradeId = gradeId;
handleSearch();
}
const reload = () => {
listBszxGrade({}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
}
reload();
watch(
() => props.selection,
() => {
},
{ immediate: true }
);
</script>

View File

@@ -1,237 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<a-button
type="text"
@click="openUrl('/bsyx/grade')"
>年级设置
</a-button
>
<a-button
type="text"
@click="openUrl('/bsyx/class')"
>班级设置
</a-button
>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template v-if="column.key === 'era'">
<span>{{ record.era }}</span>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<BszxClassEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxClassEdit from './components/bszxClassEdit.vue';
import {pageBszxClass, removeBszxClass, removeBatchBszxClass} from '@/api/bszx/bszxClass';
import type {BszxClass, BszxClassParam} from '@/api/bszx/bszxClass/model';
import {getPageTitle, openUrl} from "@/utils/common";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxClass[]>([]);
// 当前编辑数据
const current = ref<BszxClass | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxClass({
...where,
...orders,
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
// {
// title: 'ID',
// dataIndex: 'id',
// key: 'id',
// width: 120,
// },
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
width: 120
},
// {
// title: '年级',
// dataIndex: 'gradeId',
// key: 'gradeId',
// width: 120
// },
{
title: '班级',
dataIndex: 'name',
key: 'name'
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxClassParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxClass) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxClass) => {
const hide = message.loading('请求中..', 0);
removeBszxClass(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxClass(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxClass) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxClass'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,165 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑年级' : '添加年级'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="年级" name="name">
<a-input
allow-clear
placeholder="请输入年级"
v-model:value="form.name"
@pressEnter="save"
/>
</a-form-item>
<a-form-item label="排序" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxGrade, updateBszxGrade } from '@/api/bszx/bszxGrade';
import { BszxGrade } from '@/api/bszx/bszxGrade/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxGrade | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxGrade>({
id: undefined,
branch: 2,
name: undefined,
comments: undefined,
status: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxGradeName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-年级名称',
trigger: 'blur'
}
]
});
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxGrade : addBszxGrade;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,52 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import useSearch from "@/utils/use-search";
import { watch } from 'vue';
import {BszxGradeParam} from "@/api/bszx/bszxGrade/model";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: BszxGradeParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where} = useSearch<BszxGradeParam>({
branch: undefined,
keywords: ''
});
// 新增
const add = () => {
emit('add');
};
const handleSearch = () => {
emit('search', where);
}
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -1,230 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<a-button
type="text"
@click="openUrl('/bsyx/grade')"
>年级设置
</a-button
>
<a-button
type="text"
@click="openUrl('/bsyx/class')"
>班级设置
</a-button
>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="appBszxGradeId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<BszxGradeEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxGradeEdit from './components/bszxGradeEdit.vue';
import { pageBszxGrade, removeBszxGrade, removeBatchBszxGrade } from '@/api/bszx/bszxGrade';
import type { BszxGrade, BszxGradeParam } from '@/api/bszx/bszxGrade/model';
import {getPageTitle, openUrl} from "@/utils/common";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxGrade[]>([]);
// 当前编辑数据
const current = ref<BszxGrade | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxGrade({
...where,
...orders,
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
// {
// title: 'ID',
// dataIndex: 'id',
// key: 'id',
// align: 'center',
// width: 90,
// },
{
title: '年级',
dataIndex: 'name',
key: 'name'
},
{
title: '排序',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
width: 120,
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxGradeParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxGrade) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxGrade) => {
const hide = message.loading('请求中..', 0);
removeBszxGrade(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxGrade(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxGrade) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxGrade'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,249 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑捐款记录' : '添加捐款记录'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="年龄" name="age">
<a-input
allow-clear
placeholder="请输入年龄"
v-model:value="form.age"
/>
</a-form-item>
<a-form-item label="姓名" name="name">
<a-input
allow-clear
placeholder="请输入姓名"
v-model:value="form.name"
/>
</a-form-item>
<a-form-item label="性别 1男 2女" name="sex">
<a-input
allow-clear
placeholder="请输入性别 1男 2女"
v-model:value="form.sex"
/>
</a-form-item>
<a-form-item label="手机号码" name="phone">
<a-input
allow-clear
placeholder="请输入手机号码"
v-model:value="form.phone"
/>
</a-form-item>
<a-form-item label="班级" name="className">
<a-input
allow-clear
placeholder="请输入班级"
v-model:value="form.className"
/>
</a-form-item>
<a-form-item label="年级" name="gradeName">
<a-input
allow-clear
placeholder="请输入年级"
v-model:value="form.gradeName"
/>
</a-form-item>
<a-form-item label="居住地址" name="address">
<a-input
allow-clear
placeholder="请输入居住地址"
v-model:value="form.address"
/>
</a-form-item>
<a-form-item label="工作单位" name="workUnit">
<a-input
allow-clear
placeholder="请输入工作单位"
v-model:value="form.workUnit"
/>
</a-form-item>
<a-form-item label="职务" name="position">
<a-input
allow-clear
placeholder="请输入职务"
v-model:value="form.position"
/>
</a-form-item>
<a-form-item label="捐赠证书" name="certificate">
<a-input
allow-clear
placeholder="请输入捐赠证书"
v-model:value="form.certificate"
/>
</a-form-item>
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
</a-radio-group>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxPay, updateBszxPay } from '@/api/bszx/bszxPay';
import { BszxPay } from '@/api/bszx/bszxPay/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxPay | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxPay>({
id: undefined,
age: undefined,
name: undefined,
sex: undefined,
phone: undefined,
className: undefined,
gradeName: undefined,
address: undefined,
workUnit: undefined,
position: undefined,
number: undefined,
extra: undefined,
dateTime: undefined,
certificate: undefined,
formData: undefined,
formId: undefined,
userId: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxPayName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-捐款记录名称',
trigger: 'blur'
}
]
});
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxPay : addBszxPay;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,566 +0,0 @@
<!-- 用户编辑弹窗 -->
<template>
<ele-modal
:width="`80%`"
:visible="visible"
:confirm-loading="loading"
:maxable="maxAble"
:title="isUpdate ? '编辑订单' : '订单详情'"
:body-style="{ paddingBottom: '8px', background: '#f3f3f3' }"
@update:visible="updateVisible"
:maskClosable="false"
:footer="null"
@ok="save"
>
<a-card style="margin-bottom: 20px" :bordered="false">
<a-descriptions :column="3">
<!-- 第一排-->
<a-descriptions-item
label="订单编号"
span="3"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<span @click="copyText(form.orderNo)">{{ form.orderNo }}</span>
</a-descriptions-item>
<!-- 第二排-->
<a-descriptions-item
label="买家信息"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-space class="flex items-center">
<a-avatar :src="form.avatar" size="small"/>
{{ form.realName }}
</a-space>
</a-descriptions-item>
<a-descriptions-item
label="订单金额"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.totalPrice }}
</a-descriptions-item>
<a-descriptions-item
label="订单状态"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tag v-if="form.orderStatus === 0">未完成</a-tag>
<a-tag v-if="form.orderStatus === 1" color="green">已完成</a-tag>
<a-tag v-if="form.orderStatus === 2" color="red">已取消</a-tag>
<a-tag v-if="form.orderStatus === 3" color="red">取消中</a-tag>
<a-tag v-if="form.orderStatus === 4" color="red">退款申请中</a-tag>
<a-tag v-if="form.orderStatus === 5" color="red">退款被拒绝</a-tag>
<a-tag v-if="form.orderStatus === 6" color="orange">退款成功</a-tag>
<a-tag v-if="form.orderStatus === 7" color="pink">客户端申请退款</a-tag>
</a-descriptions-item>
<!-- 第三排-->
<a-descriptions-item
label="手机号码"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.phone }}
</a-descriptions-item>
<a-descriptions-item
label="实付金额"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.payPrice }}
</a-descriptions-item>
<a-descriptions-item
label="支付状态"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tag v-if="form.payStatus == 1" color="green">已付款</a-tag>
<a-tag v-if="form.payStatus == 0">未付款</a-tag>
<a-tag v-if="form.payStatus == 3">未付款,占场中</a-tag>
</a-descriptions-item>
<!-- 第四排-->
<a-descriptions-item
label="收货地址"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.address }}
</a-descriptions-item>
<a-descriptions-item
label="减少的金额"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.reducePrice }}
</a-descriptions-item>
<a-descriptions-item
label="核销状态"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tag v-if="form.deliveryStatus == 10">未核销</a-tag>
<a-tag v-if="form.deliveryStatus == 20" color="green">已核销</a-tag>
<a-tag v-if="form.deliveryStatus == 30" color="bule">部分核销</a-tag>
</a-descriptions-item>
<!-- 第五排-->
<a-descriptions-item
label="备注信息"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.comments }}
</a-descriptions-item>
<a-descriptions-item
label="支付方式"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tooltip :title="`支付时间:${form.payTime || ''}`">
<template v-if="form.payStatus == 1">
<a-tag v-if="form.payType == 0">余额支付</a-tag>
<a-tag v-if="form.payType == 1">
<WechatOutlined class="tag-icon"/>
微信支付
</a-tag>
<a-tag v-if="form.payType == 2">积分</a-tag>
<a-tag v-if="form.payType == 3">
<AlipayCircleOutlined class="tag-icon"/>
支付宝
</a-tag>
<a-tag v-if="form.payType == 4">
<IdcardOutlined class="tag-icon"/>
现金
</a-tag>
<a-tag v-if="form.payType == 5">
<IdcardOutlined class="tag-icon"/>
POS机
</a-tag>
<a-tag v-if="form.payType == 6">
<IdcardOutlined class="tag-icon"/>
VIP月卡
</a-tag>
<a-tag v-if="form.payType == 7">
<IdcardOutlined class="tag-icon"/>
VIP年卡
</a-tag>
<a-tag v-if="form.payType == 8">
<IdcardOutlined class="tag-icon"/>
VIP次卡
</a-tag>
<a-tag v-if="form.payType == 9">
<IdcardOutlined class="tag-icon"/>
IC月卡
</a-tag>
<a-tag v-if="form.payType == 10">
<IdcardOutlined class="tag-icon"/>
IC年卡
</a-tag>
<a-tag v-if="form.payType == 11">
<IdcardOutlined class="tag-icon"/>
IC次卡
</a-tag>
<a-tag v-if="form.payType == 12">
<IdcardOutlined class="tag-icon"/>
免费
</a-tag>
<a-tag v-if="form.payType == 13">
<IdcardOutlined class="tag-icon"/>
VIP充值卡
</a-tag>
<a-tag v-if="form.payType == 14">
<IdcardOutlined class="tag-icon"/>
IC充值卡
</a-tag>
<a-tag v-if="form.payType == 15">
<IdcardOutlined class="tag-icon"/>
积分支付
</a-tag>
<a-tag v-if="form.payType == 16">
<IdcardOutlined class="tag-icon"/>
VIP季卡
</a-tag>
<a-tag v-if="form.payType == 17">
<IdcardOutlined class="tag-icon"/>
IC季卡
</a-tag>
</template>
</a-tooltip>
</a-descriptions-item>
<a-descriptions-item
label="开票状态"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tag v-if="form.isInvoice == 0">未开具</a-tag>
<a-tag v-if="form.isInvoice == 1" color="green">已开具</a-tag>
<a-tag v-if="form.isInvoice == 2" color="blue">不能开具</a-tag>
</a-descriptions-item>
<!-- 第六排-->
<a-descriptions-item
label="下单时间"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ toDateString(form.createTime, 'yyyy-MM-dd HH:mm') }}
</a-descriptions-item>
<a-descriptions-item
label="交易流水号"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tooltip :title="form.payTime">{{ form.transactionId }}</a-tooltip>
</a-descriptions-item>
<a-descriptions-item
label="结算状态"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tag v-if="form.isSettled == 0">未结算</a-tag>
<a-tag v-if="form.isSettled == 1" color="green">已结算</a-tag>
</a-descriptions-item>
<!-- <a-descriptions-item span="3">-->
<!-- <a-divider/>-->
<!-- </a-descriptions-item>-->
</a-descriptions>
</a-card>
<a-card class="order-card" :bordered="false">
<a-spin :spinning="loading">
<a-table
:data-source="orderInfo"
:columns="columns"
:pagination="false"
/>
</a-spin>
</a-card>
</ele-modal>
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form} from 'ant-design-vue';
import {assignObject} from 'ele-admin-pro';
import {ColumnItem} from 'ele-admin-pro/es/ele-pro-table/types';
import {
CheckOutlined,
CloseOutlined,
CoffeeOutlined
} from '@ant-design/icons-vue';
import {ShopOrder} from '@/api/shop/shopOrder/model';
import {BszxPay} from '@/api/bszx/bszxPay/model';
import {pageBszxPay} from '@/api/bszx/bszxPay';
import {toDateString} from 'ele-admin-pro';
import {copyText} from "@/utils/common";
const useForm = Form.useForm;
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: ShopOrder | null;
}>();
export interface step {
title?: String | undefined;
subTitle?: String | undefined;
description?: String | undefined;
}
// 是否是修改
const isUpdate = ref(false);
// 是否显示最大化切换按钮
const maxAble = ref(true);
// 订单信息
const orderInfo = ref<BszxPay[]>([]);
// 步骤条
const steps = ref<step[]>([
{
title: '报餐',
description: undefined
},
{
title: '付款',
description: undefined
},
{
title: '发餐',
description: undefined
},
{
title: '取餐',
description: undefined
},
{
title: '完成',
description: undefined
}
]);
const active = ref(2);
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 订单信息
const form = reactive<ShopOrder>({
// 订单号
orderId: undefined,
// 订单编号
orderNo: undefined,
// 订单类型0商城订单 1预定订单/外卖 2会员卡
type: undefined,
// 快递/自提
deliveryType: undefined,
// 下单渠道0小程序预定 1俱乐部训练场 3活动订场
channel: undefined,
// 微信支付订单号
transactionId: undefined,
// 微信退款订单号
refundOrder: undefined,
// 商户ID
merchantId: undefined,
// 商户名称
merchantName: undefined,
// 商户编号
merchantCode: undefined,
// 使用的优惠券id
couponId: undefined,
// 使用的会员卡id
cardId: undefined,
// 关联管理员id
adminId: undefined,
// 核销管理员id
confirmId: undefined,
// IC卡号
icCard: undefined,
// 头像
avatar: undefined,
// 真实姓名
realName: undefined,
// 手机号码
phone: undefined,
// 收货地址
address: undefined,
//
addressLat: undefined,
//
addressLng: undefined,
// 自提店铺id
selfTakeMerchantId: undefined,
// 自提店铺
selfTakeMerchantName: undefined,
// 配送开始时间
sendStartTime: undefined,
// 配送结束时间
sendEndTime: undefined,
// 发货店铺id
expressMerchantId: undefined,
// 发货店铺
expressMerchantName: undefined,
// 订单总额
totalPrice: undefined,
// 减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
reducePrice: undefined,
// 实际付款
payPrice: undefined,
// 用于统计
price: undefined,
// 价钱,用于积分赠送
money: undefined,
// 退款金额
refundMoney: undefined,
// 教练价格
coachPrice: undefined,
// 购买数量
totalNum: undefined,
// 教练id
coachId: undefined,
// 支付的用户id
payUserId: undefined,
// 0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
payType: undefined,
// 代付支付方式,0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
friendPayType: undefined,
// 0未付款1已付款
payStatus: undefined,
// 0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款
orderStatus: undefined,
// 发货状态(10未发货 20已发货 30部分发货)
deliveryStatus: undefined,
// 发货时间
deliveryTime: undefined,
// 优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
couponType: undefined,
// 优惠说明
couponDesc: undefined,
// 二维码地址,保存订单号,支付成功后才生成
qrcode: undefined,
// vip月卡年卡、ic月卡年卡回退次数
returnNum: undefined,
// vip充值回退金额
returnMoney: undefined,
// 预约详情开始时间数组
startTime: undefined,
// 是否已开具发票0未开发票1已开发票2不能开具发票
isInvoice: undefined,
// 发票流水号
invoiceNo: undefined,
// 支付时间
payTime: undefined,
// 退款时间
refundTime: undefined,
// 申请退款时间
refundApplyTime: undefined,
// 过期时间
expirationTime: undefined,
// 对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单
checkBill: undefined,
// 订单是否已结算(0未结算 1已结算)
isSettled: undefined,
// 系统版本号 0当前版本 value=其他版本
version: undefined,
// 用户id
userId: undefined,
// 备注
comments: undefined,
// 排序号
sortNumber: undefined,
// 是否删除, 0否, 1是
deleted: undefined,
// 租户id
tenantId: undefined,
// 修改时间
updateTime: undefined,
// 创建时间
createTime: undefined,
// 自提码
selfTakeCode: undefined,
// 是否已收到赠品
hasTakeGift: undefined,
});
// 请求状态
const loading = ref(true);
const {resetFields} = useForm(form);
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const columns = ref<ColumnItem[]>([
{
title: '商品名称',
dataIndex: 'formName',
key: 'formName',
align: 'center',
width: 280
},
{
title: '金额',
dataIndex: 'price',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center'
},
{
title: '操作',
dataIndex: 'isFree',
align: 'center'
}
]);
/* 制作步骤条 */
const loadSteps = (order) => {
steps.value = [];
steps.value.push({
title: '下单'
});
steps.value.push({
title: '付款'
});
steps.value.push({
title: '发货'
});
steps.value.push({
title: '收货'
});
steps.value.push({
title: '完成'
});
// 下单
if (order.payStatus == 10) {
active.value = 0;
steps.value[0].description = order.createTime;
}
// 付款
if (order.payStatus == 20) {
active.value = 1;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
}
// 发货
if (order.payStatus == 20 && order.deliveryStatus == 20) {
active.value = 2;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
}
// 收货
if (order.payStatus == 20 && order.receiptStatus == 20) {
active.value = 3;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 完成
if (order.payStatus == 20 && order.orderStatus == 30) {
active.value = 4;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 已取消
if (order.orderStatus == 20) {
active.value = 4;
}
};
// const getOrderInfo = () => {
// const orderId = props.data?.orderId;
// listOrderInfo({ orderId }).then((data) => {
// orderInfo.value = data.filter((d) => d.totalNum > 0);
// });
// };
/* 保存编辑 */
const save = () => {
};
watch(
() => props.visible,
(visible) => {
if (visible) {
if (props.data) {
loading.value = true;
assignObject(form, props.data);
pageBszxPay({orderNo: form.orderNo}).then((res) => {
if (res?.list) {
orderInfo.value = res?.list;
}
loading.value = false;
});
loadSteps(props.data);
}
} else {
resetFields();
}
}
);
</script>
<script lang="ts">
import * as MenuIcons from '@/layout/menu-icons';
export default {
name: 'BszxOrderInfo',
components: MenuIcons
};
</script>

View File

@@ -1,204 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-select
v-model:value="where.payStatus"
style="width: 150px"
placeholder="付款状态"
@change="search"
>
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1">已付款</a-select-option>
<a-select-option :value="0">未付款</a-select-option>
</a-select>
<a-select
v-model:value="where.orderStatus"
style="width: 150px"
placeholder="订单状态"
@change="search"
>
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1">已完成</a-select-option>
<a-select-option :value="0">未完成</a-select-option>
<a-select-option :value="2">未使用</a-select-option>
<a-select-option :value="3">已取消</a-select-option>
<a-select-option :value="4">退款中</a-select-option>
<a-select-option :value="5">退款被拒</a-select-option>
<a-select-option :value="6">退款成功</a-select-option>
</a-select>
<a-select
:options="getPayType()"
v-model:value="where.payType"
style="width: 150px"
placeholder="付款方式"
@change="search"
/>
<a-select
v-model:value="where.isInvoice"
style="width: 150px"
placeholder="开票状态"
@change="search"
>
<a-select-option :value="1">已开票</a-select-option>
<a-select-option :value="0">未开票</a-select-option>
<a-select-option :value="2">不能开票</a-select-option>
</a-select>
<a-range-picker
v-model:value="dateRange"
@change="search"
value-format="YYYY-MM-DD"
/>
<a-input-search
allow-clear
placeholder="请输入关键词"
style="width: 280px"
v-model:value="where.keywords"
@search="reload"
/>
<a-button @click="reset">重置</a-button>
<a-button @click="handleExport">导出</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
import { utils, writeFile } from 'xlsx';
import { message } from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {ShopOrder, ShopOrderParam} from "@/api/shop/shopOrder/model";
import {listShopOrder} from "@/api/shop/shopOrder";
import {getPayType} from "@/utils/shop";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: ShopOrderParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const { where, resetFields } = useSearch<ShopOrderParam>({
keywords: '',
orderId: undefined,
orderNo: undefined,
createTimeStart: undefined,
createTimeEnd: undefined,
userId: undefined,
phone: undefined,
payStatus: undefined,
orderStatus: undefined,
payType: undefined,
isInvoice: undefined,
});
const reload = () => {
emit('search', where);
};
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
xlsFileName.value = `${d1}${d2}`;
where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
where.createTimeEnd = d2 ? d2 + ' 23:59:59' : undefined;
emit('search', {
...where
});
};
/* 重置 */
const reset = () => {
resetFields();
search();
};
const dateRange = ref<[string, string]>(['', '']);
// 变量
const loading = ref(false);
const orders = ref<ShopOrder[]>([])
const xlsFileName = ref<string>();
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'订单编号',
'订单标题',
'买家姓名',
'手机号码',
'实付金额(元)',
'支付方式',
'付款时间',
'下单时间'
]
];
await listShopOrder(where)
.then((list) => {
orders.value = list;
list?.forEach((d: ShopOrder) => {
array.push([
`${d.orderNo}`,
`${d.comments}`,
`${d.realName}`,
`${d.phone}`,
`${d.payPrice}`,
`${getPayType(d.payType)}`,
`${d.payTime || ''}`,
`${d.createTime}`
]);
});
const sheetName = `订单数据`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{ wch: 10 },
{ wch: 40 },
{ wch: 20 },
{ wch: 20 },
{ wch: 60 },
{ wch: 15 },
{ wch: 10 },
{ wch: 10 },
{ wch: 20 },
{ wch: 10 },
{ wch: 20 }
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {});
};
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -1,307 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="orderId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<div @click="onSearch(record)" class="cursor-pointer">{{ record.name || '匿名' }}</div>
</template>
<template v-if="column.key === 'phone'">
<div v-if="record.mobile" class="text-gray-400">{{ record.mobile }}</div>
<div v-else class="text-gray-600">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'payType'">
<template v-for="item in getPayType()">
<template v-if="record.payStatus == 1">
<span v-if="item.value == record.payType">{{ item.label }}</span>
</template>
<template v-else>
<span></span>
</template>
</template>
</template>
<template v-if="column.key === 'payStatus'">
<a-tag v-if="record.payStatus == 1" color="green" @click="updatePayStatus(record)">已付款</a-tag>
<a-tag v-if="record.payStatus == 0" @click="updatePayStatus(record)">未付款</a-tag>
<a-tag v-if="record.payStatus == 3">未付款,占场中</a-tag>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex === 1"></a-tag>
<a-tag v-if="record.sex === 2"></a-tag>
</template>
<template v-if="column.key === 'deliveryStatus'">
<a-tag v-if="record.deliveryStatus == 10">未核销</a-tag>
<a-tag v-if="record.deliveryStatus == 20" color="green">已核销</a-tag>
<a-tag v-if="record.deliveryStatus == 30" color="bule">部分核销</a-tag>
</template>
<template v-if="column.key === 'orderStatus'">
<a-tag v-if="record.orderStatus === 0">未完成</a-tag>
<a-tag v-if="record.orderStatus === 1" color="green">已完成</a-tag>
<a-tag v-if="record.orderStatus === 2" color="red">已取消</a-tag>
<a-tag v-if="record.orderStatus === 3" color="red">取消中</a-tag>
<a-tag v-if="record.orderStatus === 4" color="red">退款申请中</a-tag>
<a-tag v-if="record.orderStatus === 5" color="red">退款被拒绝</a-tag>
<a-tag v-if="record.orderStatus === 6" color="orange">退款成功</a-tag>
<a-tag v-if="record.orderStatus === 7" color="pink">客户端申请退款</a-tag>
</template>
<template v-if="column.key === 'isInvoice'">
<a-tag v-if="record.isInvoice == 0">未开具</a-tag>
<a-tag v-if="record.isInvoice == 1" color="green">已开具</a-tag>
<a-tag v-if="record.isInvoice == 2" color="blue">不能开具</a-tag>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<OrderInfo v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>
import {ref} from 'vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
import {pageBszxOrder} from "@/api/bszx/bszxOrder";
import OrderInfo from './components/orderInfo.vue';
import {ShopOrder, ShopOrderParam} from "@/api/shop/shopOrder/model";
import {updateShopOrder} from "@/api/shop/shopOrder";
import {message} from "ant-design-vue";
import {updateUser} from "@/api/system/user";
import {getPayType} from '@/utils/shop';
import {repairOrder} from "@/api/bszx/bszxPay";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ShopOrder[]>([]);
// 当前编辑数据
const current = ref<ShopOrder | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxOrder({
...where,
...orders,
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200,
},
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center'
},
{
title: '实付金额',
dataIndex: 'payPrice',
key: 'payPrice',
align: 'center',
customRender: ({text}) => '¥' + text
},
{
title: '支付方式',
dataIndex: 'payType',
key: 'payType',
align: 'center'
},
{
title: '支付状态',
dataIndex: 'payStatus',
key: 'payStatus',
align: 'center'
},
{
title: '核销状态',
dataIndex: 'deliveryStatus',
key: 'deliveryStatus',
align: 'center',
},
{
title: '开票状态',
dataIndex: 'isInvoice',
key: 'isInvoice',
align: 'center',
},
// {
// title: '订单状态',
// dataIndex: 'orderStatus',
// key: 'orderStatus',
// align: 'center',
// },
// {
// title: '支付时间',
// dataIndex: 'payTime',
// key: 'payTime',
// align: 'center',
// width: 180,
// sorter: true,
// ellipsis: true
// },
{
title: '下单时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
},
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: ShopOrderParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
const onSearch = (item: ShopOrder) => {
reload({userId: item.userId})
}
/* 打开编辑弹窗 */
const openEdit = (row?: ShopOrder) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/**
* 修复订单支付状态
*/
const updatePayStatus = (record: ShopOrder) => {
// 修复订单
repairOrder(record).then(() => {
message.success('修复成功');
}).then(() => {
if(record.realName == '' || record.realName == undefined){
// 更新用户真实姓名
updateUser({
userId: record.userId,
realName: record.realName
})
}
reload();
})
}
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ShopOrder) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
import * as MenuIcons from '@/layout/menu-icons';
export default {
name: 'BszxOrder',
components: MenuIcons
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,249 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑捐款记录' : '添加捐款记录'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="年龄" name="age">
<a-input
allow-clear
placeholder="请输入年龄"
v-model:value="form.age"
/>
</a-form-item>
<a-form-item label="姓名" name="name">
<a-input
allow-clear
placeholder="请输入姓名"
v-model:value="form.name"
/>
</a-form-item>
<a-form-item label="性别 1男 2女" name="sex">
<a-input
allow-clear
placeholder="请输入性别 1男 2女"
v-model:value="form.sex"
/>
</a-form-item>
<a-form-item label="手机号码" name="phone">
<a-input
allow-clear
placeholder="请输入手机号码"
v-model:value="form.phone"
/>
</a-form-item>
<a-form-item label="班级" name="className">
<a-input
allow-clear
placeholder="请输入班级"
v-model:value="form.className"
/>
</a-form-item>
<a-form-item label="年级" name="gradeName">
<a-input
allow-clear
placeholder="请输入年级"
v-model:value="form.gradeName"
/>
</a-form-item>
<a-form-item label="居住地址" name="address">
<a-input
allow-clear
placeholder="请输入居住地址"
v-model:value="form.address"
/>
</a-form-item>
<a-form-item label="工作单位" name="workUnit">
<a-input
allow-clear
placeholder="请输入工作单位"
v-model:value="form.workUnit"
/>
</a-form-item>
<a-form-item label="职务" name="position">
<a-input
allow-clear
placeholder="请输入职务"
v-model:value="form.position"
/>
</a-form-item>
<a-form-item label="捐赠证书" name="certificate">
<a-input
allow-clear
placeholder="请输入捐赠证书"
v-model:value="form.certificate"
/>
</a-form-item>
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
</a-radio-group>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxPay, updateBszxPay } from '@/api/bszx/bszxPay';
import { BszxPay } from '@/api/bszx/bszxPay/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxPay | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxPay>({
id: undefined,
age: undefined,
name: undefined,
sex: undefined,
phone: undefined,
className: undefined,
gradeName: undefined,
address: undefined,
workUnit: undefined,
position: undefined,
number: undefined,
extra: undefined,
dateTime: undefined,
certificate: undefined,
formData: undefined,
formId: undefined,
userId: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxPayName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-捐款记录名称',
trigger: 'blur'
}
]
});
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxPay : addBszxPay;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,230 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-select
show-search
v-model:value="where.gradeName"
style="width: 240px"
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
<a-select
v-if="where.gradeName"
show-search
v-model:value="where.className"
style="width: 240px"
placeholder="选择年级"
:options="classList"
@change="onClass"
></a-select>
<a-range-picker
v-model:value="dateRange"
@change="search"
value-format="YYYY-MM-DD"
/>
<a-input-search
allow-clear
placeholder="请输入关键词"
style="width: 220px"
v-model:value="where.keywords"
@search="reload"
/>
<a-button @click="handleExport">导出</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {ref, watch} from 'vue';
import {utils, writeFile} from 'xlsx';
import dayjs from 'dayjs';
import {message} from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {BszxPayParam} from "@/api/bszx/bszxPay/model";
import {BszxBm} from "@/api/bszx/bszxBm/model";
import {listBszxPay} from "@/api/bszx/bszxPay";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import {listBszxClass} from "@/api/bszx/bszxClass";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: BszxPayParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where} = useSearch<BszxPayParam>({
id: undefined,
keywords: '',
gradeName: undefined,
className: undefined,
createTimeStart: undefined,
createTimeEnd: undefined,
userId: undefined
});
const reload = () => {
emit('search', where);
};
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
where.createTimeEnd = d2 ? d2 + ' 23:59:59' : undefined;
emit('search', {
...where
});
};
const dateRange = ref<[string, string]>(['', '']);
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([])
const xlsFileName = ref<string>();
const branchId = ref<number>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
const getGradeList = () => {
listBszxGrade({branch: branchId.value}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
};
const getClassList = () => {
listBszxClass({gradeId: gradeId.value}).then(res => {
classList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
}
const onGrade = (gradeName: number, item: any) => {
where.gradeName = item.name;
if (gradeName) {
console.log(item)
gradeId.value = item.id;
getClassList();
}
emit('search', where);
}
const onBranchId = () => {
getGradeList();
}
const onClass = (classId, item) => {
console.log(classId);
where.className = item.name;
reload();
}
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'订单编号',
'姓名',
'手机号码',
'捐款金额',
'性别',
'年级',
'班级',
'居住地址',
'工作单位',
'职务',
'捐款时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxPay(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.orderNo}`,
`${d.name}`,
`${d.mobile}`,
`${d.price}`,
`${d.sex == 1 ? '男' : ''}${d.sex == 2 ? '女' : '-'}`,
`${d.gradeName ? d.gradeName : '-'}`,
`${d.className ? d.className : '-'}`,
`${d.address ? d.address : '-'}`,
`${d.workUnit ? d.workUnit : '-'}`,
`${d.position ? d.position : '-'}`,
`${d.createTime}`
]);
});
const sheetName = `导出捐款记录${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{wch: 10},
{wch: 40},
{wch: 20},
{wch: 20},
{wch: 60},
{wch: 15},
{wch: 10},
{wch: 10},
{wch: 20},
{wch: 10},
{wch: 20}
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {
});
};
getGradeList();
watch(
() => props.totalPriceAmount,
(totalPriceAmount) => {
console.log(totalPriceAmount, 'totalPriceAmount')
}
);
</script>

View File

@@ -1,336 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
:parse-data="parseData"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<div @click="onSearch(record)" class="cursor-pointer">{{ record.name || '匿名' }}</div>
</template>
<template v-if="column.key === 'phone'">
<div v-if="record.mobile" class="text-gray-400">{{ record.mobile }}</div>
<div v-else class="text-gray-600">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex === 1"></a-tag>
<a-tag v-if="record.sex === 2"></a-tag>
</template>
<template v-if="column.key === 'present'">
<a-tag v-if="record.present"></a-tag>
<a-tag v-else>不能</a-tag>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
<template #footer>
<span v-if="totalPriceAmount" class="text-red-500 font-bold">小计{{ totalPriceAmount.toFixed(2) }}</span>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<BszxPayEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayEdit from './components/bszxPayEdit.vue';
import {pageBszxPay, removeBszxPay, removeBatchBszxPay} from '@/api/bszx/bszxPay';
import type {BszxPay, BszxPayParam} from '@/api/bszx/bszxPay/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bsyx/extra.vue";
import {PageResult} from "@/api";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxPay[]>([]);
// 当前编辑数据
const current = ref<BszxPay | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
const totalPriceAmount = ref<number>(0);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxPay({
...where,
...orders,
page,
limit
});
};
// 整理数据
const parseData = (data: PageResult<BszxPay>) => {
totalPriceAmount.value = 0;
data.list?.map((item) => {
if(item.price){
totalPriceAmount.value += Number(item.price)
}
})
return data;
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200,
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center',
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
width: 120
},
{
title: '捐款金额',
dataIndex: 'price',
key: 'price',
width: 120,
align: 'center',
sorter: true,
customRender: ({text}) => '¥' + text
},
{
title: '性别',
dataIndex: 'sex',
key: 'sex',
align: 'center',
customRender: ({text}) => ['', '男', '女'][text]
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName',
align: 'center',
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center',
},
{
title: '班级',
dataIndex: 'className',
key: 'className',
align: 'center',
},
{
title: '居住地址',
dataIndex: 'address',
key: 'address',
align: 'center',
},
{
title: '工作单位',
dataIndex: 'workUnit',
key: 'workUnit',
align: 'center',
},
{
title: '职务',
dataIndex: 'position',
key: 'position',
align: 'center',
},
// {
// title: '捐赠证书',
// dataIndex: 'certificate',
// key: 'certificate',
// align: 'center',
// },
{
title: '心愿',
dataIndex: 'comments',
key: 'comments',
align: 'center',
},
// {
// title: '状态',
// dataIndex: 'status',
// key: 'status',
// align: 'center',
// },
{
title: '捐款时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
},
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
const onSearch = (item: BszxPay) => {
reload({userId: item.userId})
}
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPay) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPay) => {
const hide = message.loading('请求中..', 0);
removeBszxPay(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPay(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPay) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
// openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxPay'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,214 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑百色中学-捐款排行' : '添加百色中学-捐款排行'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="来源表ID项目名称" name="formId">
<a-input
allow-clear
placeholder="请输入来源表ID项目名称"
v-model:value="form.formId"
/>
</a-form-item>
<a-form-item label="数量" name="number">
<a-input
allow-clear
placeholder="请输入数量"
v-model:value="form.number"
/>
</a-form-item>
<a-form-item label="获得捐款总金额" name="totalPrice">
<a-input
allow-clear
placeholder="请输入获得捐款总金额"
v-model:value="form.totalPrice"
/>
</a-form-item>
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="状态, 0正常, 1冻结" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="是否删除, 0否, 1是" name="deleted">
<a-input
allow-clear
placeholder="请输入是否删除, 0否, 1是"
v-model:value="form.deleted"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxPayRanking, updateBszxPayRanking } from '@/api/bszx/bszxPayRanking';
import { BszxPayRanking } from '@/api/bszx/bszxPayRanking/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxPayRanking | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxPayRanking>({
id: undefined,
formId: undefined,
number: undefined,
totalPrice: undefined,
tenantId: undefined,
createTime: undefined,
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
bszxPayRankingName: [
{
required: true,
type: 'string',
message: '请填写百色中学-捐款排行名称',
trigger: 'blur'
}
]
});
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.image = data.path;
};
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.image = '';
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxPayRanking : addBszxPayRanking;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,86 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-range-picker
v-model:value="dateRange"
@change="search"
value-format="YYYY-MM-DD"
/>
<a-tooltip title="实际订单总金额(来自订单表)" class="flex px-4">
<span class="text-gray-400">实际订单总金额</span>
<span class="text-gray-700 font-bold">{{ formatNumber(bszxTotalPrice) }}</span>
</a-tooltip>
<a-tooltip title="排行榜统计金额(来自排行榜表)" class="flex px-4 ml-4">
<span class="text-gray-400">排行榜统计金额</span>
<span class="text-gray-700 font-bold">{{ formatNumber(rankingTotalPrice) }}</span>
</a-tooltip>
</a-space>
</template>
<script lang="ts" setup>
import useSearch from "@/utils/use-search";
import { watch, ref, computed } from 'vue';
import { formatNumber } from 'ele-admin-pro/es';
import { BszxPayRankingParam } from "@/api/bszx/bszxPayRanking/model";
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
// 使用百色中学统计数据 store
const bszxStatisticsStore = useBszxStatisticsStore();
// 从 store 中获取总金额
const bszxTotalPrice = computed(() => bszxStatisticsStore.bszxTotalPrice);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
// 保留这个属性以保持向后兼容,但不再使用
totalPriceAmount?: number;
// 排行榜统计金额
rankingTotalPrice?: number;
}>(),
{
rankingTotalPrice: 0
}
);
// 日期范围选择
const dateRange = ref<[string, string]>(['', '']);
const emit = defineEmits<{
(e: 'search', where?: BszxPayRankingParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where,resetFields} = useSearch<BszxPayRankingParam>({
id: undefined,
userId: undefined,
createTimeStart: undefined,
createTimeEnd: undefined,
keywords: ''
});
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
emit('search', {
...where,
createTimeStart: d1 ? d1 + ' 00:00:00' : '',
createTimeEnd: d2 ? d2 + ' 23:59:59' : ''
});
};
const onSearch = (text: string) => {
where.sceneType = text
search();
}
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -1,242 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
:rankingTotalPrice="rankingTotalPrice"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<BszxPayRankingEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref, onMounted} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayRankingEdit from './components/bszxPayRankingEdit.vue';
import {removeBszxPayRanking, removeBatchBszxPayRanking, ranking} from '@/api/bszx/bszxPayRanking';
import type {BszxPayRanking, BszxPayRankingParam} from '@/api/bszx/bszxPayRanking/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bsyx/extra.vue";
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
// 使用百色中学统计数据 store
const bszxStatisticsStore = useBszxStatisticsStore();
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxPayRanking[]>([]);
// 当前编辑数据
const current = ref<BszxPayRanking | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 排行榜总金额(本地计算)
const rankingTotalPrice = ref<number>(0);
// 表格数据源
const datasource: DatasourceFunction = ({where}) => {
return ranking({...where}).then(data => {
// 计算排行榜总金额(用于对比显示)
let total = 0;
data.forEach((item) => {
if (item.totalPrice) {
total += item.totalPrice;
}
});
rankingTotalPrice.value = total;
// 不再在这里更新 store 数据,因为这里的数据是排行榜数据,不是真实的订单统计
// store 中的数据应该来自 bszxOrderTotal API代表真实的订单金额
return data;
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
key: 'index',
width: 48,
align: 'center',
fixed: 'left',
hideInSetting: true,
customRender: ({index}) => index + (tableRef.value?.tableIndex ?? 0)
},
{
title: '项目名称',
dataIndex: 'formName',
key: 'formName'
},
{
title: '捐款人数',
dataIndex: 'number',
key: 'number',
align: 'center',
},
{
title: '获得捐款总金额',
dataIndex: 'totalPrice',
key: 'totalPrice',
align: 'center',
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayRankingParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
// 初始化数据
onMounted(async () => {
try {
// 初始化百色中学统计数据
await bszxStatisticsStore.fetchBszxStatistics();
} catch (error) {
console.error('初始化百色中学统计数据失败:', error);
}
});
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPayRanking) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPayRanking) => {
const hide = message.loading('请求中..', 0);
removeBszxPayRanking(row.bszxPayRankingId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPayRanking(selection.value.map((d) => d.bszxPayRankingId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPayRanking) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxPayRanking'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,60 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space style="flex-wrap: wrap" v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')">
<a-button
type="text"
@click="openUrl('/bsyx/ranking')"
>捐款排行榜
</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {watch,nextTick} from 'vue';
import {CmsWebsite} from '@/api/cms/cmsWebsite/model';
import {openUrl} from "@/utils/common";
import {message} from 'ant-design-vue';
import {removeSiteInfoCache} from "@/api/cms/cmsWebsite";
import {hasRole} from "@/utils/permission";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
website?: CmsWebsite;
count?: 0;
}>(),
{}
);
const emit = defineEmits<{
(e: 'add'): void;
}>();
const add = () => {
emit('add');
};
// 清除缓存
const clearSiteInfoCache = () => {
removeSiteInfoCache('SiteInfo:' + localStorage.getItem('TenantId') + "*").then(
(msg) => {
if (msg) {
message.success(msg);
}
}
);
};
nextTick(() => {
if(localStorage.getItem('NotActive')){
// IsActive.value = false
}
})
watch(
() => props.selection,
() => {
}
);
</script>

View File

@@ -1,283 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑报名记录' : '添加报名'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="姓名" name="name">
<a-input
allow-clear
placeholder="请输入姓名"
v-model:value="form.name"
/>
</a-form-item>
<a-form-item label="类型" name="type">
<a-radio-group v-model:value="form.type">
<a-radio :value="0">校友</a-radio>
<a-radio :value="1">单位</a-radio>
<a-radio :value="2">爱心人士</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="性别" name="sex">
<DictSelect
dict-code="sex"
:placeholder="`请选择性别`"
v-model:value="form.sexName"
@done="chooseSex"
/>
</a-form-item>
<a-form-item label="性别" name="sex">
{{ form }}
{{ form.sex == 1 ? '男' : '' }}
{{ form.sex == 2 ? '女' : '' }}
</a-form-item>
<a-form-item label="手机号码" name="mobile">
<a-input
allow-clear
:disabled="form.mobile"
placeholder="请输入手机号码"
v-model:value="form.mobile"
/>
</a-form-item>
<a-form-item label="班级" name="className">
<a-input
allow-clear
disabled
placeholder="请输入班级"
v-model:value="form.className"
/>
</a-form-item>
<a-form-item label="年级" name="gradeName">
<a-input
allow-clear
disabled
placeholder="请输入年级"
v-model:value="form.gradeName"
/>
</a-form-item>
<a-form-item label="居住地址" name="address">
<a-input
allow-clear
placeholder="请输入居住地址"
v-model:value="form.address"
/>
</a-form-item>
<a-form-item label="工作单位" name="workUnit">
<a-input
allow-clear
placeholder="请输入工作单位"
v-model:value="form.workUnit"
/>
</a-form-item>
<a-form-item label="职务" name="position">
<a-input
allow-clear
placeholder="请输入职务"
v-model:value="form.position"
/>
</a-form-item>
<a-form-item label="是否能到场" name="present">
<a-input
allow-clear
placeholder="请输入是否能到场"
v-model:value="form.present"
/>
</a-form-item>
<!-- <a-form-item label="邀请函" name="certificate">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入邀请函"-->
<!-- v-model:value="form.certificate"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="排序" name="sortNumber">-->
<!-- <a-input-number-->
<!-- :min="0"-->
<!-- :max="9999"-->
<!-- class="ele-fluid"-->
<!-- placeholder="请输入排序号"-->
<!-- v-model:value="form.sortNumber"-->
<!-- />-->
<!-- </a-form-item>-->
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<!-- <a-form-item label="状态" name="status">-->
<!-- <a-radio-group v-model:value="form.status">-->
<!-- <a-radio :value="0">显示</a-radio>-->
<!-- <a-radio :value="1">隐藏</a-radio>-->
<!-- </a-radio-group>-->
<!-- </a-form-item>-->
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form, message} from 'ant-design-vue';
import {assignObject, uuid} from 'ele-admin-pro';
import {addBszxBm, updateBszxBm} from '@/api/bszx/bszxBm';
import {BszxBm} from '@/api/bszx/bszxBm/model';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {ItemType} from 'ele-admin-pro/es/ele-image-upload/types';
import {FormInstance} from 'ant-design-vue/es/form';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const {styleResponsive} = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxBm | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxBm>({
id: undefined,
name: undefined,
sex: undefined,
sexName: undefined,
phone: undefined,
mobile: undefined,
className: undefined,
gradeName: undefined,
address: undefined,
workUnit: undefined,
position: undefined,
present: undefined,
age: undefined,
number: undefined,
extra: undefined,
certificate: undefined,
dateTime: undefined,
formData: undefined,
formId: undefined,
userId: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxBmName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-报名记录名称',
trigger: 'blur'
}
]
});
const chooseSex = (data: any) => {
form.sex = data.key;
form.sexName = data.label;
};
const {resetFields} = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxBm : addBszxBm;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {
});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.sex){
form.sexName = props.data.sexName;
}
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{immediate: true}
);
</script>

View File

@@ -1,224 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<a-radio-group v-model:value="where.branchId" @change="reload">
<a-radio-button :value="1">初中部</a-radio-button>
<a-radio-button :value="2">高中部</a-radio-button>
<a-radio-button :value="8">教职员工</a-radio-button>
<a-radio-button :value="9">其他</a-radio-button>
</a-radio-group>
<a-select
show-search
v-model:value="where.gradeName"
style="width: 240px"
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
<a-select
v-if="where.gradeName"
show-search
v-model:value="where.classId"
style="width: 240px"
placeholder="选择年级"
:options="classList"
@change="onClass"
></a-select>
<a-input-search
allow-clear
placeholder="请输入关键词"
style="width: 280px"
v-model:value="where.keywords"
@search="reload"
/>
<a-button type="text" @click="handleExport">导出</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {ref, watch} from 'vue';
import {utils, writeFile} from 'xlsx';
import dayjs from 'dayjs';
import {message} from 'ant-design-vue';
import {BszxBm, BszxBmParam} from "@/api/bszx/bszxBm/model";
import useSearch from "@/utils/use-search";
import {listBszxBm} from "@/api/bszx/bszxBm";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import {listBszxClass} from "@/api/bszx/bszxClass";
import { PlusOutlined } from '@ant-design/icons-vue';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: BszxBmParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where} = useSearch<BszxBmParam>({
id: undefined,
keywords: '',
className: undefined,
classId: undefined,
userId: undefined
});
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([])
const xlsFileName = ref<string>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
const reload = () => {
emit('search', where);
};
// 新增
const add = () => {
emit('add');
};
const getGradeList = () => {
listBszxGrade({branch: where.branchId}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
};
const getClassList = () => {
listBszxClass({gradeId: gradeId.value}).then(res => {
classList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
}
const onGrade = (gradeName: number, item: any) => {
where.gradeName = item.name;
if(gradeName){
console.log(item)
gradeId.value = item.id;
getClassList();
}
emit('search', where);
}
const onClass = (classId,item) => {
console.log(classId);
where.className = item.name;
reload();
}
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'用户ID',
'姓名',
'性别',
'手机号码',
'班级',
'年级',
'居住地址',
'工作单位',
'职务',
'是否能到场',
'邀请函',
'报名时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxBm(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.userId}`,
`${d.name}`,
`${d.sex}`,
`${d.phone}`,
`${d.className}`,
`${d.gradeName}`,
`${d.address}`,
`${d.workUnit}`,
`${d.position}`,
`${d.present}`,
`${d.certificate}`,
`${d.createTime}`
]);
});
const sheetName = `导出报名列表${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{wch: 10},
{wch: 40},
{wch: 20},
{wch: 20},
{wch: 60},
{wch: 15},
{wch: 10},
{wch: 10},
{wch: 20},
{wch: 10},
{wch: 20}
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {
});
};
getGradeList();
watch(
() => props.selection,
() => {
}
);
</script>

View File

@@ -1,306 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<!-- <Extra/>-->
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<a-space>
<a-avatar :src="record.avatar"/>
<span>{{ record.name }}</span>
</a-space>
</template>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex === 1"></a-tag>
<a-tag v-if="record.sex === 2"></a-tag>
</template>
<template v-if="column.key === 'present'">
<a-tag v-if="record.present"></a-tag>
<a-tag v-else>不能</a-tag>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<!-- <a @click="openEdit(record)">修改</a>-->
<!-- <a-divider type="vertical" />-->
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<bszxBmEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxBmEdit from './components/bszxBmEdit.vue';
import {pageBszxBm, removeBszxBm, removeBatchBszxBm} from '@/api/bszx/bszxBm';
import type {BszxBm, BszxBmParam} from '@/api/bszx/bszxBm/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxBm[]>([]);
// 当前编辑数据
const current = ref<BszxBm | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
// if (filters) {
// where.status = filters.status;
// }
return pageBszxBm({
...where,
...orders,
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
key: 'index',
width: 90,
align: 'center',
fixed: 'left',
hideInSetting: true,
customRender: ({index}) => index + (tableRef.value?.tableIndex ?? 0)
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
width: 120,
align: 'center',
customRender: ({text}) => ['校友', '单位', '爱心人士'][text]
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
width: 120
},
{
title: '手机号码',
dataIndex: 'mobile',
key: 'mobile',
width: 130,
align: 'center',
},
{
title: '性别',
dataIndex: 'sex',
key: 'sex',
width: 90,
align: 'center',
customRender: ({text}) => ['', '男', '女'][text]
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName',
align: 'center',
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center',
},
{
title: '班级',
dataIndex: 'className',
key: 'className',
align: 'center',
},
{
title: '居住地址',
dataIndex: 'address',
key: 'address',
align: 'center',
},
{
title: '工作单位',
dataIndex: 'workUnit',
key: 'workUnit',
align: 'center',
},
{
title: '职务',
dataIndex: 'position',
key: 'position',
align: 'center',
},
{
title: '是否能到场',
dataIndex: 'present',
key: 'present',
align: 'center',
},
// {
// title: '状态',
// dataIndex: 'status',
// key: 'status',
// align: 'center',
// },
{
title: '报名时间',
dataIndex: 'createTime',
key: 'createTime',
width: 180,
align: 'center',
sorter: true,
ellipsis: true
},
{
title: '操作',
key: 'action',
width: 120,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxBmParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxBm) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxBm) => {
const hide = message.loading('请求中..', 0);
removeBszxBm(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxBm(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxBm) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxBm'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,179 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑百色中学-分部' : '添加百色中学-分部'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="分部名称 " name="name">
<a-input
allow-clear
placeholder="请输入分部名称 "
v-model:value="form.name"
/>
</a-form-item>
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxBranch, updateBszxBranch } from '@/api/bszx/bszxBranch';
import { BszxBranch } from '@/api/bszx/bszxBranch/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxBranch | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxBranch>({
id: undefined,
name: undefined,
sortNumber: undefined,
tenantId: undefined,
bszxBranchId: undefined,
bszxBranchName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
bszxBranchName: [
{
required: true,
type: 'string',
message: '请填写百色中学-分部名称',
trigger: 'blur'
}
]
});
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.image = data.path;
};
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.image = '';
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxBranch : addBszxBranch;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,42 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import type { GradeParam } from '@/api/user/grade/model';
import { watch } from 'vue';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: GradeParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 新增
const add = () => {
emit('add');
};
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -1,218 +0,0 @@
<template>
<div class="page">
<div class="ele-body">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="bszxBranchId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<BszxBranchEdit v-model:visible="showEdit" :data="current" @done="reload" />
</div>
</div>
</template>
<script lang="ts" setup>
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import { toDateString } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxBranchEdit from './components/bszxBranchEdit.vue';
import { pageBszxBranch, removeBszxBranch, removeBatchBszxBranch } from '@/api/bszx/bszxBranch';
import type { BszxBranch, BszxBranchParam } from '@/api/bszx/bszxBranch/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxBranch[]>([]);
// 当前编辑数据
const current = ref<BszxBranch | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxBranch({
...where,
...orders,
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'id',
key: 'id',
align: 'center',
width: 90,
},
{
title: '分部名称 ',
dataIndex: 'name',
key: 'name',
align: 'center',
},
{
title: '排序(数字越小越靠前)',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxBranchParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxBranch) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxBranch) => {
const hide = message.loading('请求中..', 0);
removeBszxBranch(row.bszxBranchId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxBranch(selection.value.map((d) => d.bszxBranchId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxBranch) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxBranch'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,205 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑班级' : '添加班级'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="初高中部" name="branch">
<a-radio-group v-model:value="form.branch" @change="handleBranch">
<a-radio-button :value="1">初中部</a-radio-button>
<a-radio-button :value="2">高中部</a-radio-button>
</a-radio-group>
</a-form-item>
<a-form-item label="选择年级" name="gradeId">
<a-select
v-model:value="form.gradeName"
show-search
placeholder="选择年级"
style="width: 200px"
:options="options"
@change="handleChange"
></a-select>
</a-form-item>
<a-form-item label="班级" name="name">
<a-input
allow-clear
placeholder="请输入班级"
v-model:value="form.name"
@pressEnter="save"
/>
</a-form-item>
<a-form-item label="排序" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxClass, updateBszxClass } from '@/api/bszx/bszxClass';
import { BszxClass } from '@/api/bszx/bszxClass/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import {BszxGrade} from "@/api/bszx/bszxGrade/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxClass | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const options = ref<BszxGrade[]>([]);
// 用户信息
const form = reactive<BszxClass>({
id: undefined,
name: undefined,
gradeId: undefined,
gradeName: undefined,
branch: 2,
sortNumber: 100,
comments: undefined,
status: undefined,
tenantId: undefined,
createTime: undefined
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxClassName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-班级名称',
trigger: 'blur'
}
]
});
const handleChange = (value: string, item: any) => {
form.gradeName = value;
form.gradeId = item.id;
};
const handleBranch = () => {
getBszxGradeList();
}
const getBszxGradeList = () => {
listBszxGrade({branch: form.branch}).then((list) => {
options.value = list.map(d => {
d.value = d.name;
d.label = d.name;
return d;
});
})
}
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxClass : addBszxClass;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
getBszxGradeList()
images.value = [];
if (props.data) {
assignObject(form, props.data);
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
// resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,102 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined/>
</template>
<span>添加</span>
</a-button>
<a-radio-group v-model:value="where.branch" @change="handleSearch">
<a-radio-button :value="1">初中部</a-radio-button>
<a-radio-button :value="2">高中部</a-radio-button>
</a-radio-group>
<a-select
show-search
v-model:value="where.gradeId"
style="width: 240px"
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
<a-input-search
allow-clear
placeholder="请输入关键词"
style="width: 240px"
v-model:value="where.keywords"
@search="handleSearch"
/>
<a-button @click="reset">重置</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {PlusOutlined} from '@ant-design/icons-vue';
import {watch,ref} from 'vue';
import useSearch from "@/utils/use-search";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const gradeList = ref<BszxClassParam[]>([]);
const emit = defineEmits<{
(e: 'search', where?: BszxClassParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where, resetFields} = useSearch<BszxClassParam>({
gradeId: undefined,
eraId: undefined,
branch: undefined,
keywords: ''
});
// 新增
const add = () => {
emit('add');
};
const handleSearch = () => {
emit('search', where);
}
/* 重置 */
const reset = () => {
resetFields();
handleSearch();
};
const onGrade = (gradeId: number) => {
where.gradeId = gradeId;
handleSearch();
}
const reload = () => {
listBszxGrade({}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
}
reload();
watch(
() => props.selection,
() => {
},
{ immediate: true }
);
</script>

View File

@@ -1,244 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<a-button
type="text"
@click="openUrl('/bszx/grade')"
>年级设置
</a-button
>
<a-button
type="text"
@click="openUrl('/bszx/class')"
>班级设置
</a-button
>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template v-if="column.key === 'era'">
<span>{{ record.era }}</span>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<BszxClassEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxClassEdit from './components/bszxClassEdit.vue';
import {pageBszxClass, removeBszxClass, removeBatchBszxClass} from '@/api/bszx/bszxClass';
import type {BszxClass, BszxClassParam} from '@/api/bszx/bszxClass/model';
import {getPageTitle, openUrl} from "@/utils/common";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxClass[]>([]);
// 当前编辑数据
const current = ref<BszxClass | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxClass({
...where,
...orders,
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'id',
key: 'id',
width: 120,
},
{
title: '初高中',
dataIndex: 'branch',
key: 'branch',
width: 120,
customRender: ({ text }) => ['','初中','高中'][text]
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
width: 120
},
// {
// title: '年级',
// dataIndex: 'gradeId',
// key: 'gradeId',
// width: 120
// },
{
title: '班级',
dataIndex: 'name',
key: 'name'
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxClassParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxClass) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxClass) => {
const hide = message.loading('请求中..', 0);
removeBszxClass(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxClass(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxClass) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxClass'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,170 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑年级' : '添加年级'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="分部" name="branch">
<a-radio-group v-model:value="form.branch">
<a-radio-button :value="1">初中部</a-radio-button>
<a-radio-button :value="2">高中部</a-radio-button>
</a-radio-group>
</a-form-item>
<a-form-item label="年级" name="name">
<a-input
allow-clear
placeholder="请输入年级"
v-model:value="form.name"
/>
</a-form-item>
<a-form-item label="排序" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxGrade, updateBszxGrade } from '@/api/bszx/bszxGrade';
import { BszxGrade } from '@/api/bszx/bszxGrade/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxGrade | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxGrade>({
id: undefined,
branch: 2,
name: undefined,
comments: undefined,
status: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxGradeName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-年级名称',
trigger: 'blur'
}
]
});
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxGrade : addBszxGrade;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,56 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
<a-radio-group v-model:value="where.branch" @change="handleSearch">
<a-radio-button :value="1">初中部</a-radio-button>
<a-radio-button :value="2">高中部</a-radio-button>
</a-radio-group>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import useSearch from "@/utils/use-search";
import { watch } from 'vue';
import {BszxGradeParam} from "@/api/bszx/bszxGrade/model";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: BszxGradeParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where} = useSearch<BszxGradeParam>({
branch: undefined,
keywords: ''
});
// 新增
const add = () => {
emit('add');
};
const handleSearch = () => {
emit('search', where);
}
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -1,237 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<a-button
type="text"
@click="openUrl('/bszx/grade')"
>年级设置
</a-button
>
<a-button
type="text"
@click="openUrl('/bszx/class')"
>班级设置
</a-button
>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="appBszxGradeId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<BszxGradeEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxGradeEdit from './components/bszxGradeEdit.vue';
import { pageBszxGrade, removeBszxGrade, removeBatchBszxGrade } from '@/api/bszx/bszxGrade';
import type { BszxGrade, BszxGradeParam } from '@/api/bszx/bszxGrade/model';
import {getPageTitle, openUrl} from "@/utils/common";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxGrade[]>([]);
// 当前编辑数据
const current = ref<BszxGrade | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxGrade({
...where,
...orders,
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
// {
// title: 'ID',
// dataIndex: 'id',
// key: 'id',
// align: 'center',
// width: 90,
// },
{
title: '初高中',
dataIndex: 'branch',
key: 'branch',
width: 120,
customRender: ({ text }) => ['','初中','高中'][text]
},
{
title: '年级',
dataIndex: 'name',
key: 'name'
},
{
title: '排序',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
width: 120,
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxGradeParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxGrade) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxGrade) => {
const hide = message.loading('请求中..', 0);
removeBszxGrade(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxGrade(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxGrade) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxGrade'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,249 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑捐款记录' : '添加捐款记录'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="年龄" name="age">
<a-input
allow-clear
placeholder="请输入年龄"
v-model:value="form.age"
/>
</a-form-item>
<a-form-item label="姓名" name="name">
<a-input
allow-clear
placeholder="请输入姓名"
v-model:value="form.name"
/>
</a-form-item>
<a-form-item label="性别 1男 2女" name="sex">
<a-input
allow-clear
placeholder="请输入性别 1男 2女"
v-model:value="form.sex"
/>
</a-form-item>
<a-form-item label="手机号码" name="phone">
<a-input
allow-clear
placeholder="请输入手机号码"
v-model:value="form.phone"
/>
</a-form-item>
<a-form-item label="班级" name="className">
<a-input
allow-clear
placeholder="请输入班级"
v-model:value="form.className"
/>
</a-form-item>
<a-form-item label="年级" name="gradeName">
<a-input
allow-clear
placeholder="请输入年级"
v-model:value="form.gradeName"
/>
</a-form-item>
<a-form-item label="居住地址" name="address">
<a-input
allow-clear
placeholder="请输入居住地址"
v-model:value="form.address"
/>
</a-form-item>
<a-form-item label="工作单位" name="workUnit">
<a-input
allow-clear
placeholder="请输入工作单位"
v-model:value="form.workUnit"
/>
</a-form-item>
<a-form-item label="职务" name="position">
<a-input
allow-clear
placeholder="请输入职务"
v-model:value="form.position"
/>
</a-form-item>
<a-form-item label="捐赠证书" name="certificate">
<a-input
allow-clear
placeholder="请输入捐赠证书"
v-model:value="form.certificate"
/>
</a-form-item>
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
</a-radio-group>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxPay, updateBszxPay } from '@/api/bszx/bszxPay';
import { BszxPay } from '@/api/bszx/bszxPay/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxPay | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxPay>({
id: undefined,
age: undefined,
name: undefined,
sex: undefined,
phone: undefined,
className: undefined,
gradeName: undefined,
address: undefined,
workUnit: undefined,
position: undefined,
number: undefined,
extra: undefined,
dateTime: undefined,
certificate: undefined,
formData: undefined,
formId: undefined,
userId: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxPayName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-捐款记录名称',
trigger: 'blur'
}
]
});
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxPay : addBszxPay;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,566 +0,0 @@
<!-- 用户编辑弹窗 -->
<template>
<ele-modal
:width="`80%`"
:visible="visible"
:confirm-loading="loading"
:maxable="maxAble"
:title="isUpdate ? '编辑订单' : '订单详情'"
:body-style="{ paddingBottom: '8px', background: '#f3f3f3' }"
@update:visible="updateVisible"
:maskClosable="false"
:footer="null"
@ok="save"
>
<a-card style="margin-bottom: 20px" :bordered="false">
<a-descriptions :column="3">
<!-- 第一排-->
<a-descriptions-item
label="订单编号"
span="3"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<span @click="copyText(form.orderNo)">{{ form.orderNo }}</span>
</a-descriptions-item>
<!-- 第二排-->
<a-descriptions-item
label="买家信息"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-space class="flex items-center">
<a-avatar :src="form.avatar" size="small"/>
{{ form.realName }}
</a-space>
</a-descriptions-item>
<a-descriptions-item
label="订单金额"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.totalPrice }}
</a-descriptions-item>
<a-descriptions-item
label="订单状态"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tag v-if="form.orderStatus === 0">未完成</a-tag>
<a-tag v-if="form.orderStatus === 1" color="green">已完成</a-tag>
<a-tag v-if="form.orderStatus === 2" color="red">已取消</a-tag>
<a-tag v-if="form.orderStatus === 3" color="red">取消中</a-tag>
<a-tag v-if="form.orderStatus === 4" color="red">退款申请中</a-tag>
<a-tag v-if="form.orderStatus === 5" color="red">退款被拒绝</a-tag>
<a-tag v-if="form.orderStatus === 6" color="orange">退款成功</a-tag>
<a-tag v-if="form.orderStatus === 7" color="pink">客户端申请退款</a-tag>
</a-descriptions-item>
<!-- 第三排-->
<a-descriptions-item
label="手机号码"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.phone }}
</a-descriptions-item>
<a-descriptions-item
label="实付金额"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.payPrice }}
</a-descriptions-item>
<a-descriptions-item
label="支付状态"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tag v-if="form.payStatus == 1" color="green">已付款</a-tag>
<a-tag v-if="form.payStatus == 0">未付款</a-tag>
<a-tag v-if="form.payStatus == 3">未付款,占场中</a-tag>
</a-descriptions-item>
<!-- 第四排-->
<a-descriptions-item
label="收货地址"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.address }}
</a-descriptions-item>
<a-descriptions-item
label="减少的金额"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.reducePrice }}
</a-descriptions-item>
<a-descriptions-item
label="核销状态"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tag v-if="form.deliveryStatus == 10">未核销</a-tag>
<a-tag v-if="form.deliveryStatus == 20" color="green">已核销</a-tag>
<a-tag v-if="form.deliveryStatus == 30" color="bule">部分核销</a-tag>
</a-descriptions-item>
<!-- 第五排-->
<a-descriptions-item
label="备注信息"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ form.comments }}
</a-descriptions-item>
<a-descriptions-item
label="支付方式"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tooltip :title="`支付时间:${form.payTime || ''}`">
<template v-if="form.payStatus == 1">
<a-tag v-if="form.payType == 0">余额支付</a-tag>
<a-tag v-if="form.payType == 1">
<WechatOutlined class="tag-icon"/>
微信支付
</a-tag>
<a-tag v-if="form.payType == 2">积分</a-tag>
<a-tag v-if="form.payType == 3">
<AlipayCircleOutlined class="tag-icon"/>
支付宝
</a-tag>
<a-tag v-if="form.payType == 4">
<IdcardOutlined class="tag-icon"/>
现金
</a-tag>
<a-tag v-if="form.payType == 5">
<IdcardOutlined class="tag-icon"/>
POS机
</a-tag>
<a-tag v-if="form.payType == 6">
<IdcardOutlined class="tag-icon"/>
VIP月卡
</a-tag>
<a-tag v-if="form.payType == 7">
<IdcardOutlined class="tag-icon"/>
VIP年卡
</a-tag>
<a-tag v-if="form.payType == 8">
<IdcardOutlined class="tag-icon"/>
VIP次卡
</a-tag>
<a-tag v-if="form.payType == 9">
<IdcardOutlined class="tag-icon"/>
IC月卡
</a-tag>
<a-tag v-if="form.payType == 10">
<IdcardOutlined class="tag-icon"/>
IC年卡
</a-tag>
<a-tag v-if="form.payType == 11">
<IdcardOutlined class="tag-icon"/>
IC次卡
</a-tag>
<a-tag v-if="form.payType == 12">
<IdcardOutlined class="tag-icon"/>
免费
</a-tag>
<a-tag v-if="form.payType == 13">
<IdcardOutlined class="tag-icon"/>
VIP充值卡
</a-tag>
<a-tag v-if="form.payType == 14">
<IdcardOutlined class="tag-icon"/>
IC充值卡
</a-tag>
<a-tag v-if="form.payType == 15">
<IdcardOutlined class="tag-icon"/>
积分支付
</a-tag>
<a-tag v-if="form.payType == 16">
<IdcardOutlined class="tag-icon"/>
VIP季卡
</a-tag>
<a-tag v-if="form.payType == 17">
<IdcardOutlined class="tag-icon"/>
IC季卡
</a-tag>
</template>
</a-tooltip>
</a-descriptions-item>
<a-descriptions-item
label="开票状态"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tag v-if="form.isInvoice == 0">未开具</a-tag>
<a-tag v-if="form.isInvoice == 1" color="green">已开具</a-tag>
<a-tag v-if="form.isInvoice == 2" color="blue">不能开具</a-tag>
</a-descriptions-item>
<!-- 第六排-->
<a-descriptions-item
label="下单时间"
:labelStyle="{ width: '90px', color: '#808080' }"
>
{{ toDateString(form.createTime, 'yyyy-MM-dd HH:mm') }}
</a-descriptions-item>
<a-descriptions-item
label="交易流水号"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tooltip :title="form.payTime">{{ form.transactionId }}</a-tooltip>
</a-descriptions-item>
<a-descriptions-item
label="结算状态"
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-tag v-if="form.isSettled == 0">未结算</a-tag>
<a-tag v-if="form.isSettled == 1" color="green">已结算</a-tag>
</a-descriptions-item>
<!-- <a-descriptions-item span="3">-->
<!-- <a-divider/>-->
<!-- </a-descriptions-item>-->
</a-descriptions>
</a-card>
<a-card class="order-card" :bordered="false">
<a-spin :spinning="loading">
<a-table
:data-source="orderInfo"
:columns="columns"
:pagination="false"
/>
</a-spin>
</a-card>
</ele-modal>
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form} from 'ant-design-vue';
import {assignObject} from 'ele-admin-pro';
import {ColumnItem} from 'ele-admin-pro/es/ele-pro-table/types';
import {
CheckOutlined,
CloseOutlined,
CoffeeOutlined
} from '@ant-design/icons-vue';
import {ShopOrder} from '@/api/shop/shopOrder/model';
import {BszxPay} from '@/api/bszx/bszxPay/model';
import {pageBszxPay} from '@/api/bszx/bszxPay';
import {toDateString} from 'ele-admin-pro';
import {copyText} from "@/utils/common";
const useForm = Form.useForm;
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: ShopOrder | null;
}>();
export interface step {
title?: String | undefined;
subTitle?: String | undefined;
description?: String | undefined;
}
// 是否是修改
const isUpdate = ref(false);
// 是否显示最大化切换按钮
const maxAble = ref(true);
// 订单信息
const orderInfo = ref<BszxPay[]>([]);
// 步骤条
const steps = ref<step[]>([
{
title: '报餐',
description: undefined
},
{
title: '付款',
description: undefined
},
{
title: '发餐',
description: undefined
},
{
title: '取餐',
description: undefined
},
{
title: '完成',
description: undefined
}
]);
const active = ref(2);
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 订单信息
const form = reactive<ShopOrder>({
// 订单号
orderId: undefined,
// 订单编号
orderNo: undefined,
// 订单类型0商城订单 1预定订单/外卖 2会员卡
type: undefined,
// 快递/自提
deliveryType: undefined,
// 下单渠道0小程序预定 1俱乐部训练场 3活动订场
channel: undefined,
// 微信支付订单号
transactionId: undefined,
// 微信退款订单号
refundOrder: undefined,
// 商户ID
merchantId: undefined,
// 商户名称
merchantName: undefined,
// 商户编号
merchantCode: undefined,
// 使用的优惠券id
couponId: undefined,
// 使用的会员卡id
cardId: undefined,
// 关联管理员id
adminId: undefined,
// 核销管理员id
confirmId: undefined,
// IC卡号
icCard: undefined,
// 头像
avatar: undefined,
// 真实姓名
realName: undefined,
// 手机号码
phone: undefined,
// 收货地址
address: undefined,
//
addressLat: undefined,
//
addressLng: undefined,
// 自提店铺id
selfTakeMerchantId: undefined,
// 自提店铺
selfTakeMerchantName: undefined,
// 配送开始时间
sendStartTime: undefined,
// 配送结束时间
sendEndTime: undefined,
// 发货店铺id
expressMerchantId: undefined,
// 发货店铺
expressMerchantName: undefined,
// 订单总额
totalPrice: undefined,
// 减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
reducePrice: undefined,
// 实际付款
payPrice: undefined,
// 用于统计
price: undefined,
// 价钱,用于积分赠送
money: undefined,
// 退款金额
refundMoney: undefined,
// 教练价格
coachPrice: undefined,
// 购买数量
totalNum: undefined,
// 教练id
coachId: undefined,
// 支付的用户id
payUserId: undefined,
// 0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
payType: undefined,
// 代付支付方式,0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
friendPayType: undefined,
// 0未付款1已付款
payStatus: undefined,
// 0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款
orderStatus: undefined,
// 发货状态(10未发货 20已发货 30部分发货)
deliveryStatus: undefined,
// 发货时间
deliveryTime: undefined,
// 优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
couponType: undefined,
// 优惠说明
couponDesc: undefined,
// 二维码地址,保存订单号,支付成功后才生成
qrcode: undefined,
// vip月卡年卡、ic月卡年卡回退次数
returnNum: undefined,
// vip充值回退金额
returnMoney: undefined,
// 预约详情开始时间数组
startTime: undefined,
// 是否已开具发票0未开发票1已开发票2不能开具发票
isInvoice: undefined,
// 发票流水号
invoiceNo: undefined,
// 支付时间
payTime: undefined,
// 退款时间
refundTime: undefined,
// 申请退款时间
refundApplyTime: undefined,
// 过期时间
expirationTime: undefined,
// 对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单
checkBill: undefined,
// 订单是否已结算(0未结算 1已结算)
isSettled: undefined,
// 系统版本号 0当前版本 value=其他版本
version: undefined,
// 用户id
userId: undefined,
// 备注
comments: undefined,
// 排序号
sortNumber: undefined,
// 是否删除, 0否, 1是
deleted: undefined,
// 租户id
tenantId: undefined,
// 修改时间
updateTime: undefined,
// 创建时间
createTime: undefined,
// 自提码
selfTakeCode: undefined,
// 是否已收到赠品
hasTakeGift: undefined,
});
// 请求状态
const loading = ref(true);
const {resetFields} = useForm(form);
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const columns = ref<ColumnItem[]>([
{
title: '商品名称',
dataIndex: 'formName',
key: 'formName',
align: 'center',
width: 280
},
{
title: '金额',
dataIndex: 'price',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center'
},
{
title: '操作',
dataIndex: 'isFree',
align: 'center'
}
]);
/* 制作步骤条 */
const loadSteps = (order) => {
steps.value = [];
steps.value.push({
title: '下单'
});
steps.value.push({
title: '付款'
});
steps.value.push({
title: '发货'
});
steps.value.push({
title: '收货'
});
steps.value.push({
title: '完成'
});
// 下单
if (order.payStatus == 10) {
active.value = 0;
steps.value[0].description = order.createTime;
}
// 付款
if (order.payStatus == 20) {
active.value = 1;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
}
// 发货
if (order.payStatus == 20 && order.deliveryStatus == 20) {
active.value = 2;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
}
// 收货
if (order.payStatus == 20 && order.receiptStatus == 20) {
active.value = 3;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 完成
if (order.payStatus == 20 && order.orderStatus == 30) {
active.value = 4;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 已取消
if (order.orderStatus == 20) {
active.value = 4;
}
};
// const getOrderInfo = () => {
// const orderId = props.data?.orderId;
// listOrderInfo({ orderId }).then((data) => {
// orderInfo.value = data.filter((d) => d.totalNum > 0);
// });
// };
/* 保存编辑 */
const save = () => {
};
watch(
() => props.visible,
(visible) => {
if (visible) {
if (props.data) {
loading.value = true;
assignObject(form, props.data);
pageBszxPay({orderNo: form.orderNo}).then((res) => {
if (res?.list) {
orderInfo.value = res?.list;
}
loading.value = false;
});
loadSteps(props.data);
}
} else {
resetFields();
}
}
);
</script>
<script lang="ts">
import * as MenuIcons from '@/layout/menu-icons';
export default {
name: 'BszxOrderInfo',
components: MenuIcons
};
</script>

View File

@@ -1,204 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-select
v-model:value="where.payStatus"
style="width: 150px"
placeholder="付款状态"
@change="search"
>
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1">已付款</a-select-option>
<a-select-option :value="0">未付款</a-select-option>
</a-select>
<a-select
v-model:value="where.orderStatus"
style="width: 150px"
placeholder="订单状态"
@change="search"
>
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1">已完成</a-select-option>
<a-select-option :value="0">未完成</a-select-option>
<a-select-option :value="2">未使用</a-select-option>
<a-select-option :value="3">已取消</a-select-option>
<a-select-option :value="4">退款中</a-select-option>
<a-select-option :value="5">退款被拒</a-select-option>
<a-select-option :value="6">退款成功</a-select-option>
</a-select>
<a-select
:options="getPayType()"
v-model:value="where.payType"
style="width: 150px"
placeholder="付款方式"
@change="search"
/>
<a-select
v-model:value="where.isInvoice"
style="width: 150px"
placeholder="开票状态"
@change="search"
>
<a-select-option :value="1">已开票</a-select-option>
<a-select-option :value="0">未开票</a-select-option>
<a-select-option :value="2">不能开票</a-select-option>
</a-select>
<a-range-picker
v-model:value="dateRange"
@change="search"
value-format="YYYY-MM-DD"
/>
<a-input-search
allow-clear
placeholder="请输入关键词"
style="width: 280px"
v-model:value="where.keywords"
@search="reload"
/>
<a-button @click="reset">重置</a-button>
<a-button @click="handleExport">导出</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
import { utils, writeFile } from 'xlsx';
import { message } from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {ShopOrder, ShopOrderParam} from "@/api/shop/shopOrder/model";
import {listShopOrder} from "@/api/shop/shopOrder";
import {getPayType} from "@/utils/shop";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: ShopOrderParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const { where, resetFields } = useSearch<ShopOrderParam>({
keywords: '',
orderId: undefined,
orderNo: undefined,
createTimeStart: undefined,
createTimeEnd: undefined,
userId: undefined,
phone: undefined,
payStatus: undefined,
orderStatus: undefined,
payType: undefined,
isInvoice: undefined,
});
const reload = () => {
emit('search', where);
};
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
xlsFileName.value = `${d1}${d2}`;
where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
where.createTimeEnd = d2 ? d2 + ' 23:59:59' : undefined;
emit('search', {
...where
});
};
/* 重置 */
const reset = () => {
resetFields();
search();
};
const dateRange = ref<[string, string]>(['', '']);
// 变量
const loading = ref(false);
const orders = ref<ShopOrder[]>([])
const xlsFileName = ref<string>();
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'订单编号',
'订单标题',
'买家姓名',
'手机号码',
'实付金额(元)',
'支付方式',
'付款时间',
'下单时间'
]
];
await listShopOrder(where)
.then((list) => {
orders.value = list;
list?.forEach((d: ShopOrder) => {
array.push([
`${d.orderNo}`,
`${d.comments}`,
`${d.realName}`,
`${d.phone}`,
`${d.payPrice}`,
`${getPayType(d.payType)}`,
`${d.payTime || ''}`,
`${d.createTime}`
]);
});
const sheetName = `订单数据`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{ wch: 10 },
{ wch: 40 },
{ wch: 20 },
{ wch: 20 },
{ wch: 60 },
{ wch: 15 },
{ wch: 10 },
{ wch: 10 },
{ wch: 20 },
{ wch: 10 },
{ wch: 20 }
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {});
};
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -1,307 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="orderId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<div @click="onSearch(record)" class="cursor-pointer">{{ record.name || '匿名' }}</div>
</template>
<template v-if="column.key === 'phone'">
<div v-if="record.mobile" class="text-gray-400">{{ record.mobile }}</div>
<div v-else class="text-gray-600">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'payType'">
<template v-for="item in getPayType()">
<template v-if="record.payStatus == 1">
<span v-if="item.value == record.payType">{{ item.label }}</span>
</template>
<template v-else>
<span></span>
</template>
</template>
</template>
<template v-if="column.key === 'payStatus'">
<a-tag v-if="record.payStatus == 1" color="green" @click="updatePayStatus(record)">已付款</a-tag>
<a-tag v-if="record.payStatus == 0" @click="updatePayStatus(record)">未付款</a-tag>
<a-tag v-if="record.payStatus == 3">未付款,占场中</a-tag>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex === 1"></a-tag>
<a-tag v-if="record.sex === 2"></a-tag>
</template>
<template v-if="column.key === 'deliveryStatus'">
<a-tag v-if="record.deliveryStatus == 10">未核销</a-tag>
<a-tag v-if="record.deliveryStatus == 20" color="green">已核销</a-tag>
<a-tag v-if="record.deliveryStatus == 30" color="bule">部分核销</a-tag>
</template>
<template v-if="column.key === 'orderStatus'">
<a-tag v-if="record.orderStatus === 0">未完成</a-tag>
<a-tag v-if="record.orderStatus === 1" color="green">已完成</a-tag>
<a-tag v-if="record.orderStatus === 2" color="red">已取消</a-tag>
<a-tag v-if="record.orderStatus === 3" color="red">取消中</a-tag>
<a-tag v-if="record.orderStatus === 4" color="red">退款申请中</a-tag>
<a-tag v-if="record.orderStatus === 5" color="red">退款被拒绝</a-tag>
<a-tag v-if="record.orderStatus === 6" color="orange">退款成功</a-tag>
<a-tag v-if="record.orderStatus === 7" color="pink">客户端申请退款</a-tag>
</template>
<template v-if="column.key === 'isInvoice'">
<a-tag v-if="record.isInvoice == 0">未开具</a-tag>
<a-tag v-if="record.isInvoice == 1" color="green">已开具</a-tag>
<a-tag v-if="record.isInvoice == 2" color="blue">不能开具</a-tag>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<OrderInfo v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>
import {ref} from 'vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
import {pageBszxOrder} from "@/api/bszx/bszxOrder";
import OrderInfo from './components/orderInfo.vue';
import {ShopOrder, ShopOrderParam} from "@/api/shop/shopOrder/model";
import {updateShopOrder} from "@/api/shop/shopOrder";
import {message} from "ant-design-vue";
import {updateUser} from "@/api/system/user";
import {getPayType} from '@/utils/shop';
import {repairOrder} from "@/api/bszx/bszxPay";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ShopOrder[]>([]);
// 当前编辑数据
const current = ref<ShopOrder | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxOrder({
...where,
...orders,
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200,
},
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center'
},
{
title: '实付金额',
dataIndex: 'payPrice',
key: 'payPrice',
align: 'center',
customRender: ({text}) => '¥' + text
},
{
title: '支付方式',
dataIndex: 'payType',
key: 'payType',
align: 'center'
},
{
title: '支付状态',
dataIndex: 'payStatus',
key: 'payStatus',
align: 'center'
},
{
title: '核销状态',
dataIndex: 'deliveryStatus',
key: 'deliveryStatus',
align: 'center',
},
{
title: '开票状态',
dataIndex: 'isInvoice',
key: 'isInvoice',
align: 'center',
},
{
title: '订单状态',
dataIndex: 'orderStatus',
key: 'orderStatus',
align: 'center',
},
// {
// title: '支付时间',
// dataIndex: 'payTime',
// key: 'payTime',
// align: 'center',
// width: 180,
// sorter: true,
// ellipsis: true
// },
{
title: '下单时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
},
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: ShopOrderParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
const onSearch = (item: ShopOrder) => {
reload({userId: item.userId})
}
/* 打开编辑弹窗 */
const openEdit = (row?: ShopOrder) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/**
* 修复订单支付状态
*/
const updatePayStatus = (record: ShopOrder) => {
// 修复订单
repairOrder(record).then(() => {
message.success('修复成功');
}).then(() => {
if(record.realName == '' || record.realName == undefined){
// 更新用户真实姓名
updateUser({
userId: record.userId,
realName: record.realName
})
}
reload();
})
}
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ShopOrder) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
import * as MenuIcons from '@/layout/menu-icons';
export default {
name: 'BszxOrder',
components: MenuIcons
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,249 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑捐款记录' : '添加捐款记录'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="年龄" name="age">
<a-input
allow-clear
placeholder="请输入年龄"
v-model:value="form.age"
/>
</a-form-item>
<a-form-item label="姓名" name="name">
<a-input
allow-clear
placeholder="请输入姓名"
v-model:value="form.name"
/>
</a-form-item>
<a-form-item label="性别 1男 2女" name="sex">
<a-input
allow-clear
placeholder="请输入性别 1男 2女"
v-model:value="form.sex"
/>
</a-form-item>
<a-form-item label="手机号码" name="phone">
<a-input
allow-clear
placeholder="请输入手机号码"
v-model:value="form.phone"
/>
</a-form-item>
<a-form-item label="班级" name="className">
<a-input
allow-clear
placeholder="请输入班级"
v-model:value="form.className"
/>
</a-form-item>
<a-form-item label="年级" name="gradeName">
<a-input
allow-clear
placeholder="请输入年级"
v-model:value="form.gradeName"
/>
</a-form-item>
<a-form-item label="居住地址" name="address">
<a-input
allow-clear
placeholder="请输入居住地址"
v-model:value="form.address"
/>
</a-form-item>
<a-form-item label="工作单位" name="workUnit">
<a-input
allow-clear
placeholder="请输入工作单位"
v-model:value="form.workUnit"
/>
</a-form-item>
<a-form-item label="职务" name="position">
<a-input
allow-clear
placeholder="请输入职务"
v-model:value="form.position"
/>
</a-form-item>
<a-form-item label="捐赠证书" name="certificate">
<a-input
allow-clear
placeholder="请输入捐赠证书"
v-model:value="form.certificate"
/>
</a-form-item>
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
</a-radio-group>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxPay, updateBszxPay } from '@/api/bszx/bszxPay';
import { BszxPay } from '@/api/bszx/bszxPay/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxPay | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxPay>({
id: undefined,
age: undefined,
name: undefined,
sex: undefined,
phone: undefined,
className: undefined,
gradeName: undefined,
address: undefined,
workUnit: undefined,
position: undefined,
number: undefined,
extra: undefined,
dateTime: undefined,
certificate: undefined,
formData: undefined,
formId: undefined,
userId: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxPayName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-捐款记录名称',
trigger: 'blur'
}
]
});
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxPay : addBszxPay;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,235 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-radio-group v-model:value="branchId" @change="onBranchId">
<a-radio-button :value="1">初中部</a-radio-button>
<a-radio-button :value="2">高中部</a-radio-button>
</a-radio-group>
<a-select
v-if="branchId"
show-search
v-model:value="where.gradeName"
style="width: 240px"
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
<a-select
v-if="where.gradeName"
show-search
v-model:value="where.className"
style="width: 240px"
placeholder="选择年级"
:options="classList"
@change="onClass"
></a-select>
<a-input-search
allow-clear
placeholder="请输入关键词"
style="width: 220px"
v-model:value="where.keywords"
@search="reload"
/>
<a-range-picker
v-model:value="dateRange"
@change="search"
value-format="YYYY-MM-DD"
/>
<a-button @click="handleExport">导出</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {ref, watch} from 'vue';
import {utils, writeFile} from 'xlsx';
import dayjs from 'dayjs';
import {message} from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {BszxPayParam} from "@/api/bszx/bszxPay/model";
import {BszxBm} from "@/api/bszx/bszxBm/model";
import {listBszxPay} from "@/api/bszx/bszxPay";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import {listBszxClass} from "@/api/bszx/bszxClass";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: BszxPayParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where} = useSearch<BszxPayParam>({
id: undefined,
keywords: '',
gradeName: undefined,
className: undefined,
createTimeStart: undefined,
createTimeEnd: undefined,
userId: undefined
});
const reload = () => {
emit('search', where);
};
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
where.createTimeEnd = d2 ? d2 + ' 23:59:59' : undefined;
emit('search', {
...where
});
};
const dateRange = ref<[string, string]>(['', '']);
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([])
const xlsFileName = ref<string>();
const branchId = ref<number>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
const getGradeList = () => {
listBszxGrade({branch: branchId.value}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
};
const getClassList = () => {
listBszxClass({gradeId: gradeId.value}).then(res => {
classList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
}
const onGrade = (gradeName: number, item: any) => {
where.gradeName = item.name;
if (gradeName) {
console.log(item)
gradeId.value = item.id;
getClassList();
}
emit('search', where);
}
const onBranchId = () => {
getGradeList();
}
const onClass = (classId, item) => {
console.log(classId);
where.className = item.name;
reload();
}
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'订单编号',
'姓名',
'手机号码',
'捐款金额',
'性别',
'年级',
'班级',
'居住地址',
'工作单位',
'职务',
'捐款时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxPay(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.orderNo}`,
`${d.name}`,
`${d.mobile}`,
`${d.price}`,
`${d.sex == 1 ? '男' : ''}${d.sex == 2 ? '女' : '-'}`,
`${d.gradeName ? d.gradeName : '-'}`,
`${d.className ? d.className : '-'}`,
`${d.address ? d.address : '-'}`,
`${d.workUnit ? d.workUnit : '-'}`,
`${d.position ? d.position : '-'}`,
`${d.createTime}`
]);
});
const sheetName = `导出捐款记录${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{wch: 10},
{wch: 40},
{wch: 20},
{wch: 20},
{wch: 60},
{wch: 15},
{wch: 10},
{wch: 10},
{wch: 20},
{wch: 10},
{wch: 20}
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {
});
};
getGradeList();
watch(
() => props.totalPriceAmount,
(totalPriceAmount) => {
console.log(totalPriceAmount, 'totalPriceAmount')
}
);
</script>

View File

@@ -1,336 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
:parse-data="parseData"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<div @click="onSearch(record)" class="cursor-pointer">{{ record.name || '匿名' }}</div>
</template>
<template v-if="column.key === 'phone'">
<div v-if="record.mobile" class="text-gray-400">{{ record.mobile }}</div>
<div v-else class="text-gray-600">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex === 1"></a-tag>
<a-tag v-if="record.sex === 2"></a-tag>
</template>
<template v-if="column.key === 'present'">
<a-tag v-if="record.present"></a-tag>
<a-tag v-else>不能</a-tag>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
<template #footer>
<span v-if="totalPriceAmount" class="text-red-500 font-bold">小计{{ totalPriceAmount.toFixed(2) }}</span>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<BszxPayEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayEdit from './components/bszxPayEdit.vue';
import {pageBszxPay, removeBszxPay, removeBatchBszxPay} from '@/api/bszx/bszxPay';
import type {BszxPay, BszxPayParam} from '@/api/bszx/bszxPay/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
import {PageResult} from "@/api";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxPay[]>([]);
// 当前编辑数据
const current = ref<BszxPay | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
const totalPriceAmount = ref<number>(0);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxPay({
...where,
...orders,
page,
limit
});
};
// 整理数据
const parseData = (data: PageResult<BszxPay>) => {
totalPriceAmount.value = 0;
data.list?.map((item) => {
if(item.price){
totalPriceAmount.value += Number(item.price)
}
})
return data;
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200,
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center',
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
width: 120
},
{
title: '捐款金额',
dataIndex: 'price',
key: 'price',
width: 120,
align: 'center',
sorter: true,
customRender: ({text}) => '¥' + text
},
{
title: '性别',
dataIndex: 'sex',
key: 'sex',
align: 'center',
customRender: ({text}) => ['', '男', '女'][text]
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName',
align: 'center',
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center',
},
{
title: '班级',
dataIndex: 'className',
key: 'className',
align: 'center',
},
{
title: '居住地址',
dataIndex: 'address',
key: 'address',
align: 'center',
},
{
title: '工作单位',
dataIndex: 'workUnit',
key: 'workUnit',
align: 'center',
},
{
title: '职务',
dataIndex: 'position',
key: 'position',
align: 'center',
},
// {
// title: '捐赠证书',
// dataIndex: 'certificate',
// key: 'certificate',
// align: 'center',
// },
{
title: '心愿',
dataIndex: 'comments',
key: 'comments',
align: 'center',
},
// {
// title: '状态',
// dataIndex: 'status',
// key: 'status',
// align: 'center',
// },
{
title: '捐款时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
},
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
const onSearch = (item: BszxPay) => {
reload({userId: item.userId})
}
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPay) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPay) => {
const hide = message.loading('请求中..', 0);
removeBszxPay(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPay(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPay) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
// openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxPay'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,270 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑应用-百色中学-捐款记录' : '添加应用-百色中学-捐款记录'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="年龄" name="age">
<a-input
allow-clear
placeholder="请输入年龄"
v-model:value="form.age"
/>
</a-form-item>
<a-form-item label="姓名" name="name">
<a-input
allow-clear
placeholder="请输入姓名"
v-model:value="form.name"
/>
</a-form-item>
<a-form-item label="性别 1男 2女" name="sex">
<a-input
allow-clear
placeholder="请输入性别 1男 2女"
v-model:value="form.sex"
/>
</a-form-item>
<a-form-item label="手机号码" name="phone">
<a-input
allow-clear
placeholder="请输入手机号码"
v-model:value="form.phone"
/>
</a-form-item>
<a-form-item label="班级" name="className">
<a-input
allow-clear
placeholder="请输入班级"
v-model:value="form.className"
/>
</a-form-item>
<a-form-item label="年级" name="gradeName">
<a-input
allow-clear
placeholder="请输入年级"
v-model:value="form.gradeName"
/>
</a-form-item>
<a-form-item label="居住地址" name="address">
<a-input
allow-clear
placeholder="请输入居住地址"
v-model:value="form.address"
/>
</a-form-item>
<a-form-item label="工作单位" name="workUnit">
<a-input
allow-clear
placeholder="请输入工作单位"
v-model:value="form.workUnit"
/>
</a-form-item>
<a-form-item label="职务" name="position">
<a-input
allow-clear
placeholder="请输入职务"
v-model:value="form.position"
/>
</a-form-item>
<a-form-item label="捐赠证书" name="certificate">
<a-input
allow-clear
placeholder="请输入捐赠证书"
v-model:value="form.certificate"
/>
</a-form-item>
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
</a-radio-group>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxPay, updateBszxPay } from '@/api/bszx/bszxPay';
import { BszxPay } from '@/api/bszx/bszxPay/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxPay | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxPay>({
id: undefined,
age: undefined,
name: undefined,
sex: undefined,
phone: undefined,
className: undefined,
gradeName: undefined,
address: undefined,
workUnit: undefined,
position: undefined,
number: undefined,
extra: undefined,
dateTime: undefined,
certificate: undefined,
formData: undefined,
formId: undefined,
userId: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxPayName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-捐款记录名称',
trigger: 'blur'
}
]
});
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.image = data.path;
};
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.image = '';
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxPay : addBszxPay;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,141 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-input-search
allow-clear
placeholder="请输入关键词"
style="width: 280px"
v-model:value="where.keywords"
@search="reload"
/>
<a-button type="text" @click="handleExport">导出</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
import { utils, writeFile } from 'xlsx';
import dayjs from 'dayjs';
import { message } from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {BszxPayParam} from "@/api/bszx/bszxPay/model";
import {BszxBm} from "@/api/bszx/bszxBm/model";
import {listBszxPay} from "@/api/bszx/bszxPay";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: BszxPayParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const { where } = useSearch<BszxPayParam>({
id: undefined,
keywords: '',
userId: undefined
});
const reload = () => {
emit('search', where);
};
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([])
const xlsFileName = ref<string>();
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'用户ID',
'姓名',
'性别',
'手机号码',
'班级',
'年级',
'居住地址',
'工作单位',
'职务',
'是否能到场',
'邀请函',
'捐款时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxPay(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.userId}`,
`${d.name}`,
`${d.sex}`,
`${d.phone}`,
`${d.className}`,
`${d.gradeName}`,
`${d.address}`,
`${d.workUnit}`,
`${d.position}`,
`${d.present}`,
`${d.certificate}`,
`${d.createTime}`
]);
});
const sheetName = `导出捐款记录${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{ wch: 10 },
{ wch: 40 },
{ wch: 20 },
{ wch: 20 },
{ wch: 60 },
{ wch: 15 },
{ wch: 10 },
{ wch: 10 },
{ wch: 20 },
{ wch: 10 },
{ wch: 20 }
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {});
};
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -1,112 +0,0 @@
<template>
<div class="cert-box h-screen">
<div class="cert-content" v-html="article.content"></div>
<div class="create-time text-right">
<span>广西百色中学</span>
<p>{{ toDateString(form.createTime, "YYYY-MM-dd") }}</p>
</div>
<!-- 二维码 -->
<div class="qrcode mt-10 text-center">
<ele-qr-code-svg :value="`${qrcode}`" :size="200" />
</div>
</div>
</template>
<script lang="ts" setup>
import { useRouter } from 'vue-router';
import { onMounted, ref,unref, reactive } from 'vue';
import { assignObject, toDateString } from "ele-admin-pro";
import {getBszxPay} from '@/api/bszx/bszxPay';
import type { BszxPay } from '@/api/bszx/bszxPay/model';
import {getCmsArticle} from "@/api/cms/cmsArticle";
import {CmsArticle} from "@/api/cms/cmsArticle/model";
// 二维码内容
const qrcode = ref('123');
// 当前编辑数据
// 是否显示编辑弹窗
// 是否显示批量移动弹窗
// 加载状态
const loading = ref(true);
// 捐款记录
const form = reactive<BszxPay>({
id: undefined,
age: undefined,
name: undefined,
sex: undefined,
phone: undefined,
className: undefined,
gradeName: undefined,
address: undefined,
workUnit: undefined,
position: undefined,
number: undefined,
price: undefined,
extra: undefined,
dateTime: undefined,
certificate: undefined,
formData: undefined,
formId: undefined,
userId: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
// 文章
const article = reactive<CmsArticle>({
articleId: undefined,
content: undefined,
createTime: undefined
});
/* 查询 */
const query = () => {
loading.value = true;
const { currentRoute } = useRouter();
const { params } = unref(currentRoute);
console.log(params.id,'query')
getBszxPay(Number(params?.id)).then(data => {
assignObject(form, data);
if(data.formId && data.formId > 0){
getCmsArticle(data.formId).then(result => {
if(result.content){
result.content = result?.content.replace('校友', data?.name + '___校友');
result.content = result?.content.replace('人民币', '人民币 ' + data?.price);
qrcode.value = 'https://website.websoft.top/bszx/pay-cert/' + data?.id;
}
assignObject(article, result);
})
}
})
};
onMounted(() => {
query();
})
</script>
<script lang="ts">
export default {
name: 'BszxPay'
};
</script>
<style lang="less" scoped>
.cert-box{
width: 500px;
margin: 10px auto;
padding: 58px;
border-bottom: blue 1px solid;
background: url("https://oss.wsdns.cn/20250127/cb1088c3b1354a118477a0b1a3cdac41.png") no-repeat;
background-size: 100%;
}
.cert-content{
margin-top: 250px;
}
</style>

View File

@@ -1,215 +0,0 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑百色中学-捐款排行' : '添加百色中学-捐款排行'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="来源表ID项目名称" name="formId">
<a-input
allow-clear
placeholder="请输入来源表ID项目名称"
v-model:value="form.formId"
/>
</a-form-item>
<a-form-item label="数量" name="number">
<a-input
allow-clear
placeholder="请输入数量"
v-model:value="form.number"
/>
</a-form-item>
<a-form-item label="获得捐款总金额" name="totalPrice">
<a-input
allow-clear
placeholder="请输入获得捐款总金额"
v-model:value="form.totalPrice"
/>
</a-form-item>
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="状态, 0正常, 1冻结" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="是否删除, 0否, 1是" name="deleted">
<a-input
allow-clear
placeholder="请输入是否删除, 0否, 1是"
v-model:value="form.deleted"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxPayRanking, updateBszxPayRanking } from '@/api/bszx/bszxPayRanking';
import { BszxPayRanking } from '@/api/bszx/bszxPayRanking/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxPayRanking | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxPayRanking>({
id: undefined,
formId: undefined,
number: undefined,
totalPrice: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
bszxPayRankingName: [
{
required: true,
type: 'string',
message: '请填写百色中学-捐款排行名称',
trigger: 'blur'
}
]
});
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.image = data.path;
};
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.image = '';
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxPayRanking : addBszxPayRanking;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,86 +0,0 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-range-picker
v-model:value="dateRange"
@change="search"
value-format="YYYY-MM-DD"
/>
<a-tooltip title="实际订单总金额(来自订单表)" class="flex px-4">
<span class="text-gray-400">实际订单总金额</span>
<span class="text-gray-700 font-bold">{{ formatNumber(bszxTotalPrice) }}</span>
</a-tooltip>
<a-tooltip title="排行榜统计金额(来自排行榜表)" class="flex px-4 ml-4">
<span class="text-gray-400">排行榜统计金额</span>
<span class="text-gray-700 font-bold">{{ formatNumber(rankingTotalPrice) }}</span>
</a-tooltip>
</a-space>
</template>
<script lang="ts" setup>
import useSearch from "@/utils/use-search";
import { watch, ref, computed } from 'vue';
import { formatNumber } from 'ele-admin-pro/es';
import { BszxPayRankingParam } from "@/api/bszx/bszxPayRanking/model";
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
// 使用百色中学统计数据 store
const bszxStatisticsStore = useBszxStatisticsStore();
// 从 store 中获取总金额
const bszxTotalPrice = computed(() => bszxStatisticsStore.bszxTotalPrice);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
// 保留这个属性以保持向后兼容,但不再使用
totalPriceAmount?: number;
// 排行榜统计金额
rankingTotalPrice?: number;
}>(),
{
rankingTotalPrice: 0
}
);
// 日期范围选择
const dateRange = ref<[string, string]>(['', '']);
const emit = defineEmits<{
(e: 'search', where?: BszxPayRankingParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where,resetFields} = useSearch<BszxPayRankingParam>({
id: undefined,
userId: undefined,
createTimeStart: undefined,
createTimeEnd: undefined,
keywords: ''
});
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
emit('search', {
...where,
createTimeStart: d1 ? d1 + ' 00:00:00' : '',
createTimeEnd: d2 ? d2 + ' 23:59:59' : ''
});
};
const onSearch = (text: string) => {
where.sceneType = text
search();
}
watch(
() => props.selection,
() => {}
);
</script>

Some files were not shown because too many files have changed in this diff Show More