refactor(clinic): 移除诊所模块的控制器和实体类

- 移除 ClinicAppointmentController 挂号控制器
- 移除 ClinicDoctorApplyController 医生入驻申请控制器
- 移除 ClinicDoctorUserController 分销商用户记录表控制器
- 移除 ClinicPatientUserController 患者控制器
- 移除 ClinicPrescriptionController 处方主表控制器
- 移除 ClinicPrescriptionItemController 处方明细表控制器
- 移除 ClinicAppointment 挂号实体类
- 移除 ClinicDoctorApply 医生入驻申请实体类
- 移除 ClinicDoctorUser 分销商用户记录表实体类
- 移除 ClinicPatientUser 患者实体类
This commit is contained in:
2026-01-08 13:56:23 +08:00
parent 8aa814a2a4
commit 2814a4e655
200 changed files with 414 additions and 20478 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,39 +0,0 @@
import type { PageParam } from '@/api';
/**
* 挂号
*/
export interface ClinicAppointment {
// 主键ID
id?: number;
// 类型
type?: number;
// 就诊原因
reason?: string;
// 挂号时间
evaluateTime?: string;
// 医生
doctorId?: number;
// 患者
userId?: number;
// 备注
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,59 +0,0 @@
import type { PageParam } from '@/api';
/**
* 分销商用户记录表
*/
export interface ClinicDoctorUser {
// 主键ID
id?: number;
// 类型 0经销商 1企业 2集团
type?: number;
// 自增ID
userId?: number;
// 姓名
realName?: string;
// 手机号
mobile?: string;
// 支付密码
payPassword?: string;
// 当前可提现佣金
money?: string;
// 已冻结佣金
freezeMoney?: string;
// 累积提现佣金
totalMoney?: string;
// 收益基数
rate?: string;
// 单价
price?: string;
// 推荐人用户ID
refereeId?: number;
// 成员数量(一级)
firstNum?: number;
// 成员数量(二级)
secondNum?: number;
// 成员数量(三级)
thirdNum?: 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,59 +0,0 @@
import type { PageParam } from '@/api';
/**
* 患者
*/
export interface ClinicPatientUser {
// 主键ID
id?: number;
// 类型 0经销商 1企业 2集团
type?: number;
// 自增ID
userId?: number;
// 姓名
realName?: string;
// 手机号
mobile?: string;
// 支付密码
payPassword?: string;
// 当前可提现佣金
money?: string;
// 已冻结佣金
freezeMoney?: string;
// 累积提现佣金
totalMoney?: string;
// 收益基数
rate?: string;
// 单价
price?: string;
// 推荐人用户ID
refereeId?: number;
// 成员数量(一级)
firstNum?: number;
// 成员数量(二级)
secondNum?: number;
// 成员数量(三级)
thirdNum?: number;
// 专属二维码
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,237 +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="type">
<a-input
allow-clear
placeholder="请输入类型"
v-model:value="form.type"
/>
</a-form-item>
<a-form-item label="就诊原因" name="reason">
<a-input
allow-clear
placeholder="请输入就诊原因"
v-model:value="form.reason"
/>
</a-form-item>
<a-form-item label="挂号时间" name="evaluateTime">
<a-input
allow-clear
placeholder="请输入挂号时间"
v-model:value="form.evaluateTime"
/>
</a-form-item>
<a-form-item label="医生" name="doctorId">
<a-input
allow-clear
placeholder="请输入医生"
v-model:value="form.doctorId"
/>
</a-form-item>
<a-form-item label="患者" name="userId">
<a-input
allow-clear
placeholder="请输入患者"
v-model:value="form.userId"
/>
</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="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="isDelete">
<a-input
allow-clear
placeholder="请输入是否删除"
v-model:value="form.isDelete"
/>
</a-form-item>
<a-form-item label="修改时间" name="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicAppointment, updateClinicAppointment } from '@/api/clinic/clinicAppointment';
import { ClinicAppointment } from '@/api/clinic/clinicAppointment/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?: ClinicAppointment | 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<ClinicAppointment>({
id: undefined,
type: undefined,
reason: undefined,
evaluateTime: undefined,
doctorId: undefined,
userId: undefined,
comments: undefined,
sortNumber: undefined,
isDelete: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicAppointmentId: undefined,
clinicAppointmentName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicAppointmentName: [
{
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 ? updateClinicAppointment : addClinicAppointment;
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,286 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicAppointmentId"
: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>
<!-- 编辑弹窗 -->
<ClinicAppointmentEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicAppointmentEdit from './components/clinicAppointmentEdit.vue';
import { pageClinicAppointment, removeClinicAppointment, removeBatchClinicAppointment } from '@/api/clinic/clinicAppointment';
import type { ClinicAppointment, ClinicAppointmentParam } from '@/api/clinic/clinicAppointment/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicAppointment[]>([]);
// 当前编辑数据
const current = ref<ClinicAppointment | 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 pageClinicAppointment({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
width: 120
},
{
title: '就诊原因',
dataIndex: 'reason',
key: 'reason',
ellipsis: true
},
{
title: '挂号时间',
dataIndex: 'evaluateTime',
key: 'evaluateTime',
width: 120
},
{
title: '医生',
dataIndex: 'doctorId',
key: 'doctorId',
width: 120
},
{
title: '患者',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '排序号',
dataIndex: 'sortNumber',
key: 'sortNumber',
width: 120
},
{
title: '是否删除',
dataIndex: 'isDelete',
key: 'isDelete',
width: 120
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicAppointmentParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicAppointment) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicAppointment) => {
const hide = message.loading('请求中..', 0);
removeClinicAppointment(row.clinicAppointmentId)
.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);
removeBatchClinicAppointment(selection.value.map((d) => d.clinicAppointmentId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicAppointment) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicAppointment'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,379 +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="类型 0医生" name="type">
<a-input
allow-clear
placeholder="请输入类型 0医生"
v-model:value="form.type"
/>
</a-form-item>
<a-form-item label="用户ID" name="userId">
<a-input
allow-clear
placeholder="请输入用户ID"
v-model:value="form.userId"
/>
</a-form-item>
<a-form-item label="姓名" name="realName">
<a-input
allow-clear
placeholder="请输入姓名"
v-model:value="form.realName"
/>
</a-form-item>
<a-form-item label="性别 1男 2女" name="gender">
<a-input
allow-clear
placeholder="请输入性别 1男 2女"
v-model:value="form.gender"
/>
</a-form-item>
<a-form-item label="手机号" name="mobile">
<a-input
allow-clear
placeholder="请输入手机号"
v-model:value="form.mobile"
/>
</a-form-item>
<a-form-item label="客户名称" name="dealerName">
<a-input
allow-clear
placeholder="请输入客户名称"
v-model:value="form.dealerName"
/>
</a-form-item>
<a-form-item label="证件号码" name="idCard">
<a-input
allow-clear
placeholder="请输入证件号码"
v-model:value="form.idCard"
/>
</a-form-item>
<a-form-item label="生日" name="birthDate">
<a-input
allow-clear
placeholder="请输入生日"
v-model:value="form.birthDate"
/>
</a-form-item>
<a-form-item label="区分职称等级(如主治医师、副主任医师)" name="professionalTitle">
<a-input
allow-clear
placeholder="请输入区分职称等级(如主治医师、副主任医师)"
v-model:value="form.professionalTitle"
/>
</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="practiceLicense">
<a-input
allow-clear
placeholder="请输入执业资格核心凭证"
v-model:value="form.practiceLicense"
/>
</a-form-item>
<a-form-item label="限定可执业科室或疾病类型" name="practiceScope">
<a-input
allow-clear
placeholder="请输入限定可执业科室或疾病类型"
v-model:value="form.practiceScope"
/>
</a-form-item>
<a-form-item label="开始工作时间" name="startWorkDate">
<a-input
allow-clear
placeholder="请输入开始工作时间"
v-model:value="form.startWorkDate"
/>
</a-form-item>
<a-form-item label="简历" name="resume">
<a-input
allow-clear
placeholder="请输入简历"
v-model:value="form.resume"
/>
</a-form-item>
<a-form-item label="使用 JSON 存储多个证件文件路径(如执业证、学历证)" name="certificationFiles">
<a-input
allow-clear
placeholder="请输入使用 JSON 存储多个证件文件路径(如执业证、学历证)"
v-model:value="form.certificationFiles"
/>
</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="money">
<a-input
allow-clear
placeholder="请输入签约价格"
v-model:value="form.money"
/>
</a-form-item>
<a-form-item label="推荐人用户ID" name="refereeId">
<a-input
allow-clear
placeholder="请输入推荐人用户ID"
v-model:value="form.refereeId"
/>
</a-form-item>
<a-form-item label="申请方式(10需后台审核 20无需审核)" name="applyType">
<a-input
allow-clear
placeholder="请输入申请方式(10需后台审核 20无需审核)"
v-model:value="form.applyType"
/>
</a-form-item>
<a-form-item label="审核状态 (10待审核 20审核通过 30驳回)" name="applyStatus">
<a-input
allow-clear
placeholder="请输入审核状态 (10待审核 20审核通过 30驳回)"
v-model:value="form.applyStatus"
/>
</a-form-item>
<a-form-item label="申请时间" name="applyTime">
<a-input
allow-clear
placeholder="请输入申请时间"
v-model:value="form.applyTime"
/>
</a-form-item>
<a-form-item label="审核时间" name="auditTime">
<a-input
allow-clear
placeholder="请输入审核时间"
v-model:value="form.auditTime"
/>
</a-form-item>
<a-form-item label="合同时间" name="contractTime">
<a-input
allow-clear
placeholder="请输入合同时间"
v-model:value="form.contractTime"
/>
</a-form-item>
<a-form-item label="过期时间" name="expirationTime">
<a-input
allow-clear
placeholder="请输入过期时间"
v-model:value="form.expirationTime"
/>
</a-form-item>
<a-form-item label="驳回原因" name="rejectReason">
<a-input
allow-clear
placeholder="请输入驳回原因"
v-model:value="form.rejectReason"
/>
</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="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicDoctorApply, updateClinicDoctorApply } from '@/api/clinic/clinicDoctorApply';
import { ClinicDoctorApply } from '@/api/clinic/clinicDoctorApply/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?: ClinicDoctorApply | 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<ClinicDoctorApply>({
applyId: undefined,
type: undefined,
userId: undefined,
realName: undefined,
gender: undefined,
mobile: undefined,
dealerName: undefined,
idCard: undefined,
birthDate: undefined,
professionalTitle: undefined,
workUnit: undefined,
practiceLicense: undefined,
practiceScope: undefined,
startWorkDate: undefined,
resume: undefined,
certificationFiles: undefined,
address: undefined,
money: undefined,
refereeId: undefined,
applyType: undefined,
applyStatus: undefined,
applyTime: undefined,
auditTime: undefined,
contractTime: undefined,
expirationTime: undefined,
rejectReason: undefined,
comments: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicDoctorApplyId: undefined,
clinicDoctorApplyName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicDoctorApplyName: [
{
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 ? updateClinicDoctorApply : addClinicDoctorApply;
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,394 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicDoctorApplyId"
: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>
<!-- 编辑弹窗 -->
<ClinicDoctorApplyEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicDoctorApplyEdit from './components/clinicDoctorApplyEdit.vue';
import { pageClinicDoctorApply, removeClinicDoctorApply, removeBatchClinicDoctorApply } from '@/api/clinic/clinicDoctorApply';
import type { ClinicDoctorApply, ClinicDoctorApplyParam } from '@/api/clinic/clinicDoctorApply/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicDoctorApply[]>([]);
// 当前编辑数据
const current = ref<ClinicDoctorApply | 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 pageClinicDoctorApply({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'applyId',
key: 'applyId',
width: 90,
},
{
title: '类型 0医生',
dataIndex: 'type',
key: 'type',
width: 120
},
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
ellipsis: true
},
{
title: '性别 1男 2女',
dataIndex: 'gender',
key: 'gender',
width: 120
},
{
title: '手机号',
dataIndex: 'mobile',
key: 'mobile',
ellipsis: true
},
{
title: '客户名称',
dataIndex: 'dealerName',
key: 'dealerName',
ellipsis: true
},
{
title: '证件号码',
dataIndex: 'idCard',
key: 'idCard',
ellipsis: true
},
{
title: '生日',
dataIndex: 'birthDate',
key: 'birthDate',
width: 120
},
{
title: '区分职称等级(如主治医师、副主任医师)',
dataIndex: 'professionalTitle',
key: 'professionalTitle',
ellipsis: true
},
{
title: '工作单位',
dataIndex: 'workUnit',
key: 'workUnit',
ellipsis: true
},
{
title: '执业资格核心凭证',
dataIndex: 'practiceLicense',
key: 'practiceLicense',
ellipsis: true
},
{
title: '限定可执业科室或疾病类型',
dataIndex: 'practiceScope',
key: 'practiceScope',
ellipsis: true
},
{
title: '开始工作时间',
dataIndex: 'startWorkDate',
key: 'startWorkDate',
width: 120
},
{
title: '简历',
dataIndex: 'resume',
key: 'resume',
ellipsis: true
},
{
title: '使用 JSON 存储多个证件文件路径(如执业证、学历证)',
dataIndex: 'certificationFiles',
key: 'certificationFiles',
ellipsis: true
},
{
title: '详细地址',
dataIndex: 'address',
key: 'address',
ellipsis: true
},
{
title: '签约价格',
dataIndex: 'money',
key: 'money',
width: 120
},
{
title: '推荐人用户ID',
dataIndex: 'refereeId',
key: 'refereeId',
width: 120
},
{
title: '申请方式(10需后台审核 20无需审核)',
dataIndex: 'applyType',
key: 'applyType',
width: 120
},
{
title: '审核状态 (10待审核 20审核通过 30驳回)',
dataIndex: 'applyStatus',
key: 'applyStatus',
width: 120
},
{
title: '申请时间',
dataIndex: 'applyTime',
key: 'applyTime',
width: 120
},
{
title: '审核时间',
dataIndex: 'auditTime',
key: 'auditTime',
width: 120
},
{
title: '合同时间',
dataIndex: 'contractTime',
key: 'contractTime',
width: 120
},
{
title: '过期时间',
dataIndex: 'expirationTime',
key: 'expirationTime',
width: 120
},
{
title: '驳回原因',
dataIndex: 'rejectReason',
key: 'rejectReason',
ellipsis: true
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'applyId',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicDoctorApplyParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicDoctorApply) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicDoctorApply) => {
const hide = message.loading('请求中..', 0);
removeClinicDoctorApply(row.clinicDoctorApplyId)
.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);
removeBatchClinicDoctorApply(selection.value.map((d) => d.clinicDoctorApplyId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicDoctorApply) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicDoctorApply'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,323 +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="userId">
<a-input
allow-clear
placeholder="请输入买家用户ID"
v-model:value="form.userId"
/>
</a-form-item>
<a-form-item label="订单编号" name="orderNo">
<a-input
allow-clear
placeholder="请输入订单编号"
v-model:value="form.orderNo"
/>
</a-form-item>
<a-form-item label="分销商用户id(一级)" name="firstUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(一级)"
v-model:value="form.firstUserId"
/>
</a-form-item>
<a-form-item label="分销商用户id(二级)" name="secondUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(二级)"
v-model:value="form.secondUserId"
/>
</a-form-item>
<a-form-item label="分销商用户id(三级)" name="thirdUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(三级)"
v-model:value="form.thirdUserId"
/>
</a-form-item>
<a-form-item label="分销佣金(一级)" name="firstMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(一级)"
v-model:value="form.firstMoney"
/>
</a-form-item>
<a-form-item label="分销佣金(二级)" name="secondMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(二级)"
v-model:value="form.secondMoney"
/>
</a-form-item>
<a-form-item label="分销佣金(三级)" name="thirdMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(三级)"
v-model:value="form.thirdMoney"
/>
</a-form-item>
<a-form-item label="单价" name="price">
<a-input
allow-clear
placeholder="请输入单价"
v-model:value="form.price"
/>
</a-form-item>
<a-form-item label="订单总金额" name="orderPrice">
<a-input
allow-clear
placeholder="请输入订单总金额"
v-model:value="form.orderPrice"
/>
</a-form-item>
<a-form-item label="结算金额" name="settledPrice">
<a-input
allow-clear
placeholder="请输入结算金额"
v-model:value="form.settledPrice"
/>
</a-form-item>
<a-form-item label="换算成度" name="degreePrice">
<a-input
allow-clear
placeholder="请输入换算成度"
v-model:value="form.degreePrice"
/>
</a-form-item>
<a-form-item label="实发金额" name="payPrice">
<a-input
allow-clear
placeholder="请输入实发金额"
v-model:value="form.payPrice"
/>
</a-form-item>
<a-form-item label="税率" name="rate">
<a-input
allow-clear
placeholder="请输入税率"
v-model:value="form.rate"
/>
</a-form-item>
<a-form-item label="结算月份" name="month">
<a-input
allow-clear
placeholder="请输入结算月份"
v-model:value="form.month"
/>
</a-form-item>
<a-form-item label="订单是否失效(0未失效 1已失效)" name="isInvalid">
<a-input
allow-clear
placeholder="请输入订单是否失效(0未失效 1已失效)"
v-model:value="form.isInvalid"
/>
</a-form-item>
<a-form-item label="佣金结算(0未结算 1已结算)" name="isSettled">
<a-input
allow-clear
placeholder="请输入佣金结算(0未结算 1已结算)"
v-model:value="form.isSettled"
/>
</a-form-item>
<a-form-item label="结算时间" name="settleTime">
<a-input
allow-clear
placeholder="请输入结算时间"
v-model:value="form.settleTime"
/>
</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="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicDoctorMedicalRecord, updateClinicDoctorMedicalRecord } from '@/api/clinic/clinicDoctorMedicalRecord';
import { ClinicDoctorMedicalRecord } from '@/api/clinic/clinicDoctorMedicalRecord/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?: ClinicDoctorMedicalRecord | 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<ClinicDoctorMedicalRecord>({
id: undefined,
userId: undefined,
orderNo: undefined,
firstUserId: undefined,
secondUserId: undefined,
thirdUserId: undefined,
firstMoney: undefined,
secondMoney: undefined,
thirdMoney: undefined,
price: undefined,
orderPrice: undefined,
settledPrice: undefined,
degreePrice: undefined,
payPrice: undefined,
rate: undefined,
month: undefined,
isInvalid: undefined,
isSettled: undefined,
settleTime: undefined,
comments: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicDoctorMedicalRecordId: undefined,
clinicDoctorMedicalRecordName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicDoctorMedicalRecordName: [
{
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 ? updateClinicDoctorMedicalRecord : addClinicDoctorMedicalRecord;
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,352 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicDoctorMedicalRecordId"
: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>
<!-- 编辑弹窗 -->
<ClinicDoctorMedicalRecordEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicDoctorMedicalRecordEdit from './components/clinicDoctorMedicalRecordEdit.vue';
import { pageClinicDoctorMedicalRecord, removeClinicDoctorMedicalRecord, removeBatchClinicDoctorMedicalRecord } from '@/api/clinic/clinicDoctorMedicalRecord';
import type { ClinicDoctorMedicalRecord, ClinicDoctorMedicalRecordParam } from '@/api/clinic/clinicDoctorMedicalRecord/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicDoctorMedicalRecord[]>([]);
// 当前编辑数据
const current = ref<ClinicDoctorMedicalRecord | 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 pageClinicDoctorMedicalRecord({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '买家用户ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
ellipsis: true
},
{
title: '分销商用户id(一级)',
dataIndex: 'firstUserId',
key: 'firstUserId',
width: 120
},
{
title: '分销商用户id(二级)',
dataIndex: 'secondUserId',
key: 'secondUserId',
width: 120
},
{
title: '分销商用户id(三级)',
dataIndex: 'thirdUserId',
key: 'thirdUserId',
width: 120
},
{
title: '分销佣金(一级)',
dataIndex: 'firstMoney',
key: 'firstMoney',
width: 120
},
{
title: '分销佣金(二级)',
dataIndex: 'secondMoney',
key: 'secondMoney',
width: 120
},
{
title: '分销佣金(三级)',
dataIndex: 'thirdMoney',
key: 'thirdMoney',
width: 120
},
{
title: '单价',
dataIndex: 'price',
key: 'price',
width: 120
},
{
title: '订单总金额',
dataIndex: 'orderPrice',
key: 'orderPrice',
width: 120
},
{
title: '结算金额',
dataIndex: 'settledPrice',
key: 'settledPrice',
width: 120
},
{
title: '换算成度',
dataIndex: 'degreePrice',
key: 'degreePrice',
width: 120
},
{
title: '实发金额',
dataIndex: 'payPrice',
key: 'payPrice',
width: 120
},
{
title: '税率',
dataIndex: 'rate',
key: 'rate',
width: 120
},
{
title: '结算月份',
dataIndex: 'month',
key: 'month',
ellipsis: true
},
{
title: '订单是否失效(0未失效 1已失效)',
dataIndex: 'isInvalid',
key: 'isInvalid',
width: 120
},
{
title: '佣金结算(0未结算 1已结算)',
dataIndex: 'isSettled',
key: 'isSettled',
width: 120
},
{
title: '结算时间',
dataIndex: 'settleTime',
key: 'settleTime',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicDoctorMedicalRecordParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicDoctorMedicalRecord) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicDoctorMedicalRecord) => {
const hide = message.loading('请求中..', 0);
removeClinicDoctorMedicalRecord(row.clinicDoctorMedicalRecordId)
.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);
removeBatchClinicDoctorMedicalRecord(selection.value.map((d) => d.clinicDoctorMedicalRecordId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicDoctorMedicalRecord) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicDoctorMedicalRecord'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,317 +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="类型 0经销商 1企业 2集团" name="type">
<a-input
allow-clear
placeholder="请输入类型 0经销商 1企业 2集团"
v-model:value="form.type"
/>
</a-form-item>
<a-form-item label="自增ID" name="userId">
<a-input
allow-clear
placeholder="请输入自增ID"
v-model:value="form.userId"
/>
</a-form-item>
<a-form-item label="姓名" name="realName">
<a-input
allow-clear
placeholder="请输入姓名"
v-model:value="form.realName"
/>
</a-form-item>
<a-form-item label="手机号" name="mobile">
<a-input
allow-clear
placeholder="请输入手机号"
v-model:value="form.mobile"
/>
</a-form-item>
<a-form-item label="支付密码" name="payPassword">
<a-input
allow-clear
placeholder="请输入支付密码"
v-model:value="form.payPassword"
/>
</a-form-item>
<a-form-item label="当前可提现佣金" name="money">
<a-input
allow-clear
placeholder="请输入当前可提现佣金"
v-model:value="form.money"
/>
</a-form-item>
<a-form-item label="已冻结佣金" name="freezeMoney">
<a-input
allow-clear
placeholder="请输入已冻结佣金"
v-model:value="form.freezeMoney"
/>
</a-form-item>
<a-form-item label="累积提现佣金" name="totalMoney">
<a-input
allow-clear
placeholder="请输入累积提现佣金"
v-model:value="form.totalMoney"
/>
</a-form-item>
<a-form-item label="收益基数" name="rate">
<a-input
allow-clear
placeholder="请输入收益基数"
v-model:value="form.rate"
/>
</a-form-item>
<a-form-item label="单价" name="price">
<a-input
allow-clear
placeholder="请输入单价"
v-model:value="form.price"
/>
</a-form-item>
<a-form-item label="推荐人用户ID" name="refereeId">
<a-input
allow-clear
placeholder="请输入推荐人用户ID"
v-model:value="form.refereeId"
/>
</a-form-item>
<a-form-item label="成员数量(一级)" name="firstNum">
<a-input
allow-clear
placeholder="请输入成员数量(一级)"
v-model:value="form.firstNum"
/>
</a-form-item>
<a-form-item label="成员数量(二级)" name="secondNum">
<a-input
allow-clear
placeholder="请输入成员数量(二级)"
v-model:value="form.secondNum"
/>
</a-form-item>
<a-form-item label="成员数量(三级)" name="thirdNum">
<a-input
allow-clear
placeholder="请输入成员数量(三级)"
v-model:value="form.thirdNum"
/>
</a-form-item>
<a-form-item label="专属二维码" name="qrcode">
<a-input
allow-clear
placeholder="请输入专属二维码"
v-model:value="form.qrcode"
/>
</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="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="isDelete">
<a-input
allow-clear
placeholder="请输入是否删除"
v-model:value="form.isDelete"
/>
</a-form-item>
<a-form-item label="修改时间" name="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicDoctorUser, updateClinicDoctorUser } from '@/api/clinic/clinicDoctorUser';
import { ClinicDoctorUser } from '@/api/clinic/clinicDoctorUser/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?: ClinicDoctorUser | 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<ClinicDoctorUser>({
id: undefined,
type: undefined,
userId: undefined,
realName: undefined,
mobile: undefined,
payPassword: undefined,
money: undefined,
freezeMoney: undefined,
totalMoney: undefined,
rate: undefined,
price: undefined,
refereeId: undefined,
firstNum: undefined,
secondNum: undefined,
thirdNum: undefined,
qrcode: undefined,
comments: undefined,
sortNumber: undefined,
isDelete: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicDoctorUserId: undefined,
clinicDoctorUserName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicDoctorUserName: [
{
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 ? updateClinicDoctorUser : addClinicDoctorUser;
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,346 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicDoctorUserId"
: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>
<!-- 编辑弹窗 -->
<ClinicDoctorUserEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicDoctorUserEdit from './components/clinicDoctorUserEdit.vue';
import { pageClinicDoctorUser, removeClinicDoctorUser, removeBatchClinicDoctorUser } from '@/api/clinic/clinicDoctorUser';
import type { ClinicDoctorUser, ClinicDoctorUserParam } from '@/api/clinic/clinicDoctorUser/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicDoctorUser[]>([]);
// 当前编辑数据
const current = ref<ClinicDoctorUser | 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 pageClinicDoctorUser({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '类型 0经销商 1企业 2集团',
dataIndex: 'type',
key: 'type',
width: 120
},
{
title: '自增ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
ellipsis: true
},
{
title: '手机号',
dataIndex: 'mobile',
key: 'mobile',
ellipsis: true
},
{
title: '支付密码',
dataIndex: 'payPassword',
key: 'payPassword',
ellipsis: true
},
{
title: '当前可提现佣金',
dataIndex: 'money',
key: 'money',
width: 120
},
{
title: '已冻结佣金',
dataIndex: 'freezeMoney',
key: 'freezeMoney',
width: 120
},
{
title: '累积提现佣金',
dataIndex: 'totalMoney',
key: 'totalMoney',
width: 120
},
{
title: '收益基数',
dataIndex: 'rate',
key: 'rate',
width: 120
},
{
title: '单价',
dataIndex: 'price',
key: 'price',
width: 120
},
{
title: '推荐人用户ID',
dataIndex: 'refereeId',
key: 'refereeId',
width: 120
},
{
title: '成员数量(一级)',
dataIndex: 'firstNum',
key: 'firstNum',
width: 120
},
{
title: '成员数量(二级)',
dataIndex: 'secondNum',
key: 'secondNum',
width: 120
},
{
title: '成员数量(三级)',
dataIndex: 'thirdNum',
key: 'thirdNum',
width: 120
},
{
title: '专属二维码',
dataIndex: 'qrcode',
key: 'qrcode',
ellipsis: true
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '排序号',
dataIndex: 'sortNumber',
key: 'sortNumber',
width: 120
},
{
title: '是否删除',
dataIndex: 'isDelete',
key: 'isDelete',
width: 120
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicDoctorUserParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicDoctorUser) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicDoctorUser) => {
const hide = message.loading('请求中..', 0);
removeClinicDoctorUser(row.clinicDoctorUserId)
.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);
removeBatchClinicDoctorUser(selection.value.map((d) => d.clinicDoctorUserId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicDoctorUser) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicDoctorUser'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,323 +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="userId">
<a-input
allow-clear
placeholder="请输入买家用户ID"
v-model:value="form.userId"
/>
</a-form-item>
<a-form-item label="订单编号" name="orderNo">
<a-input
allow-clear
placeholder="请输入订单编号"
v-model:value="form.orderNo"
/>
</a-form-item>
<a-form-item label="分销商用户id(一级)" name="firstUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(一级)"
v-model:value="form.firstUserId"
/>
</a-form-item>
<a-form-item label="分销商用户id(二级)" name="secondUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(二级)"
v-model:value="form.secondUserId"
/>
</a-form-item>
<a-form-item label="分销商用户id(三级)" name="thirdUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(三级)"
v-model:value="form.thirdUserId"
/>
</a-form-item>
<a-form-item label="分销佣金(一级)" name="firstMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(一级)"
v-model:value="form.firstMoney"
/>
</a-form-item>
<a-form-item label="分销佣金(二级)" name="secondMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(二级)"
v-model:value="form.secondMoney"
/>
</a-form-item>
<a-form-item label="分销佣金(三级)" name="thirdMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(三级)"
v-model:value="form.thirdMoney"
/>
</a-form-item>
<a-form-item label="单价" name="price">
<a-input
allow-clear
placeholder="请输入单价"
v-model:value="form.price"
/>
</a-form-item>
<a-form-item label="订单总金额" name="orderPrice">
<a-input
allow-clear
placeholder="请输入订单总金额"
v-model:value="form.orderPrice"
/>
</a-form-item>
<a-form-item label="结算金额" name="settledPrice">
<a-input
allow-clear
placeholder="请输入结算金额"
v-model:value="form.settledPrice"
/>
</a-form-item>
<a-form-item label="换算成度" name="degreePrice">
<a-input
allow-clear
placeholder="请输入换算成度"
v-model:value="form.degreePrice"
/>
</a-form-item>
<a-form-item label="实发金额" name="payPrice">
<a-input
allow-clear
placeholder="请输入实发金额"
v-model:value="form.payPrice"
/>
</a-form-item>
<a-form-item label="税率" name="rate">
<a-input
allow-clear
placeholder="请输入税率"
v-model:value="form.rate"
/>
</a-form-item>
<a-form-item label="结算月份" name="month">
<a-input
allow-clear
placeholder="请输入结算月份"
v-model:value="form.month"
/>
</a-form-item>
<a-form-item label="订单是否失效(0未失效 1已失效)" name="isInvalid">
<a-input
allow-clear
placeholder="请输入订单是否失效(0未失效 1已失效)"
v-model:value="form.isInvalid"
/>
</a-form-item>
<a-form-item label="佣金结算(0未结算 1已结算)" name="isSettled">
<a-input
allow-clear
placeholder="请输入佣金结算(0未结算 1已结算)"
v-model:value="form.isSettled"
/>
</a-form-item>
<a-form-item label="结算时间" name="settleTime">
<a-input
allow-clear
placeholder="请输入结算时间"
v-model:value="form.settleTime"
/>
</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="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicMedicalHistory, updateClinicMedicalHistory } from '@/api/clinic/clinicMedicalHistory';
import { ClinicMedicalHistory } from '@/api/clinic/clinicMedicalHistory/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?: ClinicMedicalHistory | 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<ClinicMedicalHistory>({
id: undefined,
userId: undefined,
orderNo: undefined,
firstUserId: undefined,
secondUserId: undefined,
thirdUserId: undefined,
firstMoney: undefined,
secondMoney: undefined,
thirdMoney: undefined,
price: undefined,
orderPrice: undefined,
settledPrice: undefined,
degreePrice: undefined,
payPrice: undefined,
rate: undefined,
month: undefined,
isInvalid: undefined,
isSettled: undefined,
settleTime: undefined,
comments: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicMedicalHistoryId: undefined,
clinicMedicalHistoryName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicMedicalHistoryName: [
{
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 ? updateClinicMedicalHistory : addClinicMedicalHistory;
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,352 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicMedicalHistoryId"
: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>
<!-- 编辑弹窗 -->
<ClinicMedicalHistoryEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicMedicalHistoryEdit from './components/clinicMedicalHistoryEdit.vue';
import { pageClinicMedicalHistory, removeClinicMedicalHistory, removeBatchClinicMedicalHistory } from '@/api/clinic/clinicMedicalHistory';
import type { ClinicMedicalHistory, ClinicMedicalHistoryParam } from '@/api/clinic/clinicMedicalHistory/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicMedicalHistory[]>([]);
// 当前编辑数据
const current = ref<ClinicMedicalHistory | 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 pageClinicMedicalHistory({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '买家用户ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
ellipsis: true
},
{
title: '分销商用户id(一级)',
dataIndex: 'firstUserId',
key: 'firstUserId',
width: 120
},
{
title: '分销商用户id(二级)',
dataIndex: 'secondUserId',
key: 'secondUserId',
width: 120
},
{
title: '分销商用户id(三级)',
dataIndex: 'thirdUserId',
key: 'thirdUserId',
width: 120
},
{
title: '分销佣金(一级)',
dataIndex: 'firstMoney',
key: 'firstMoney',
width: 120
},
{
title: '分销佣金(二级)',
dataIndex: 'secondMoney',
key: 'secondMoney',
width: 120
},
{
title: '分销佣金(三级)',
dataIndex: 'thirdMoney',
key: 'thirdMoney',
width: 120
},
{
title: '单价',
dataIndex: 'price',
key: 'price',
width: 120
},
{
title: '订单总金额',
dataIndex: 'orderPrice',
key: 'orderPrice',
width: 120
},
{
title: '结算金额',
dataIndex: 'settledPrice',
key: 'settledPrice',
width: 120
},
{
title: '换算成度',
dataIndex: 'degreePrice',
key: 'degreePrice',
width: 120
},
{
title: '实发金额',
dataIndex: 'payPrice',
key: 'payPrice',
width: 120
},
{
title: '税率',
dataIndex: 'rate',
key: 'rate',
width: 120
},
{
title: '结算月份',
dataIndex: 'month',
key: 'month',
ellipsis: true
},
{
title: '订单是否失效(0未失效 1已失效)',
dataIndex: 'isInvalid',
key: 'isInvalid',
width: 120
},
{
title: '佣金结算(0未结算 1已结算)',
dataIndex: 'isSettled',
key: 'isSettled',
width: 120
},
{
title: '结算时间',
dataIndex: 'settleTime',
key: 'settleTime',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicMedicalHistoryParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicMedicalHistory) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicMedicalHistory) => {
const hide = message.loading('请求中..', 0);
removeClinicMedicalHistory(row.clinicMedicalHistoryId)
.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);
removeBatchClinicMedicalHistory(selection.value.map((d) => d.clinicMedicalHistoryId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicMedicalHistory) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicMedicalHistory'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,251 +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="pinyin">
<a-input
allow-clear
placeholder="请输入拼音"
v-model:value="form.pinyin"
/>
</a-form-item>
<a-form-item label="分类(如“清热解毒”、“补气养血”)" name="category">
<a-input
allow-clear
placeholder="请输入分类(如“清热解毒”、“补气养血”)"
v-model:value="form.category"
/>
</a-form-item>
<a-form-item label="规格(如“饮片”、“颗粒”)" name="specification">
<a-input
allow-clear
placeholder="请输入规格(如“饮片”、“颗粒”)"
v-model:value="form.specification"
/>
</a-form-item>
<a-form-item label="单位(如“克”、“袋”)" name="unit">
<a-input
allow-clear
placeholder="请输入单位(如“克”、“袋”)"
v-model:value="form.unit"
/>
</a-form-item>
<a-form-item label="描述" name="content">
<a-input
allow-clear
placeholder="请输入描述"
v-model:value="form.content"
/>
</a-form-item>
<a-form-item label="单价" name="pricePerUnit">
<a-input
allow-clear
placeholder="请输入单价"
v-model:value="form.pricePerUnit"
/>
</a-form-item>
<a-form-item label="是否活跃" name="isActive">
<a-input
allow-clear
placeholder="请输入是否活跃"
v-model:value="form.isActive"
/>
</a-form-item>
<a-form-item label="买家用户ID" name="userId">
<a-input
allow-clear
placeholder="请输入买家用户ID"
v-model:value="form.userId"
/>
</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="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicMedicine, updateClinicMedicine } from '@/api/clinic/clinicMedicine';
import { ClinicMedicine } from '@/api/clinic/clinicMedicine/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?: ClinicMedicine | 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<ClinicMedicine>({
id: undefined,
name: undefined,
pinyin: undefined,
category: undefined,
specification: undefined,
unit: undefined,
content: undefined,
pricePerUnit: undefined,
isActive: undefined,
userId: undefined,
comments: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicMedicineId: undefined,
clinicMedicineName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicMedicineName: [
{
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 ? updateClinicMedicine : addClinicMedicine;
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,299 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicMedicineId"
: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>
<!-- 编辑弹窗 -->
<ClinicMedicineEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicMedicineEdit from './components/clinicMedicineEdit.vue';
import { pageClinicMedicine, removeClinicMedicine, removeBatchClinicMedicine } from '@/api/clinic/clinicMedicine';
import type { ClinicMedicine, ClinicMedicineParam } from '@/api/clinic/clinicMedicine/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicMedicine[]>([]);
// 当前编辑数据
const current = ref<ClinicMedicine | 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 pageClinicMedicine({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '药名',
dataIndex: 'name',
key: 'name',
ellipsis: true
},
{
title: '拼音',
dataIndex: 'pinyin',
key: 'pinyin',
ellipsis: true
},
{
title: '分类(如“清热解毒”、“补气养血”)',
dataIndex: 'category',
key: 'category',
ellipsis: true
},
{
title: '规格(如“饮片”、“颗粒”)',
dataIndex: 'specification',
key: 'specification',
ellipsis: true
},
{
title: '单位(如“克”、“袋”)',
dataIndex: 'unit',
key: 'unit',
ellipsis: true
},
{
title: '描述',
dataIndex: 'content',
key: 'content',
ellipsis: true
},
{
title: '单价',
dataIndex: 'pricePerUnit',
key: 'pricePerUnit',
width: 120
},
{
title: '是否活跃',
dataIndex: 'isActive',
key: 'isActive',
width: 120
},
{
title: '买家用户ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'name',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicMedicineParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicMedicine) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicMedicine) => {
const hide = message.loading('请求中..', 0);
removeClinicMedicine(row.clinicMedicineId)
.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);
removeBatchClinicMedicine(selection.value.map((d) => d.clinicMedicineId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicMedicine) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicMedicine'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,323 +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="userId">
<a-input
allow-clear
placeholder="请输入买家用户ID"
v-model:value="form.userId"
/>
</a-form-item>
<a-form-item label="订单编号" name="orderNo">
<a-input
allow-clear
placeholder="请输入订单编号"
v-model:value="form.orderNo"
/>
</a-form-item>
<a-form-item label="分销商用户id(一级)" name="firstUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(一级)"
v-model:value="form.firstUserId"
/>
</a-form-item>
<a-form-item label="分销商用户id(二级)" name="secondUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(二级)"
v-model:value="form.secondUserId"
/>
</a-form-item>
<a-form-item label="分销商用户id(三级)" name="thirdUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(三级)"
v-model:value="form.thirdUserId"
/>
</a-form-item>
<a-form-item label="分销佣金(一级)" name="firstMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(一级)"
v-model:value="form.firstMoney"
/>
</a-form-item>
<a-form-item label="分销佣金(二级)" name="secondMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(二级)"
v-model:value="form.secondMoney"
/>
</a-form-item>
<a-form-item label="分销佣金(三级)" name="thirdMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(三级)"
v-model:value="form.thirdMoney"
/>
</a-form-item>
<a-form-item label="单价" name="price">
<a-input
allow-clear
placeholder="请输入单价"
v-model:value="form.price"
/>
</a-form-item>
<a-form-item label="订单总金额" name="orderPrice">
<a-input
allow-clear
placeholder="请输入订单总金额"
v-model:value="form.orderPrice"
/>
</a-form-item>
<a-form-item label="结算金额" name="settledPrice">
<a-input
allow-clear
placeholder="请输入结算金额"
v-model:value="form.settledPrice"
/>
</a-form-item>
<a-form-item label="换算成度" name="degreePrice">
<a-input
allow-clear
placeholder="请输入换算成度"
v-model:value="form.degreePrice"
/>
</a-form-item>
<a-form-item label="实发金额" name="payPrice">
<a-input
allow-clear
placeholder="请输入实发金额"
v-model:value="form.payPrice"
/>
</a-form-item>
<a-form-item label="税率" name="rate">
<a-input
allow-clear
placeholder="请输入税率"
v-model:value="form.rate"
/>
</a-form-item>
<a-form-item label="结算月份" name="month">
<a-input
allow-clear
placeholder="请输入结算月份"
v-model:value="form.month"
/>
</a-form-item>
<a-form-item label="订单是否失效(0未失效 1已失效)" name="isInvalid">
<a-input
allow-clear
placeholder="请输入订单是否失效(0未失效 1已失效)"
v-model:value="form.isInvalid"
/>
</a-form-item>
<a-form-item label="佣金结算(0未结算 1已结算)" name="isSettled">
<a-input
allow-clear
placeholder="请输入佣金结算(0未结算 1已结算)"
v-model:value="form.isSettled"
/>
</a-form-item>
<a-form-item label="结算时间" name="settleTime">
<a-input
allow-clear
placeholder="请输入结算时间"
v-model:value="form.settleTime"
/>
</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="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicMedicineInout, updateClinicMedicineInout } from '@/api/clinic/clinicMedicineInout';
import { ClinicMedicineInout } from '@/api/clinic/clinicMedicineInout/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?: ClinicMedicineInout | 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<ClinicMedicineInout>({
id: undefined,
userId: undefined,
orderNo: undefined,
firstUserId: undefined,
secondUserId: undefined,
thirdUserId: undefined,
firstMoney: undefined,
secondMoney: undefined,
thirdMoney: undefined,
price: undefined,
orderPrice: undefined,
settledPrice: undefined,
degreePrice: undefined,
payPrice: undefined,
rate: undefined,
month: undefined,
isInvalid: undefined,
isSettled: undefined,
settleTime: undefined,
comments: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicMedicineInoutId: undefined,
clinicMedicineInoutName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicMedicineInoutName: [
{
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 ? updateClinicMedicineInout : addClinicMedicineInout;
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,352 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicMedicineInoutId"
: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>
<!-- 编辑弹窗 -->
<ClinicMedicineInoutEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicMedicineInoutEdit from './components/clinicMedicineInoutEdit.vue';
import { pageClinicMedicineInout, removeClinicMedicineInout, removeBatchClinicMedicineInout } from '@/api/clinic/clinicMedicineInout';
import type { ClinicMedicineInout, ClinicMedicineInoutParam } from '@/api/clinic/clinicMedicineInout/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicMedicineInout[]>([]);
// 当前编辑数据
const current = ref<ClinicMedicineInout | 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 pageClinicMedicineInout({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '买家用户ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
ellipsis: true
},
{
title: '分销商用户id(一级)',
dataIndex: 'firstUserId',
key: 'firstUserId',
width: 120
},
{
title: '分销商用户id(二级)',
dataIndex: 'secondUserId',
key: 'secondUserId',
width: 120
},
{
title: '分销商用户id(三级)',
dataIndex: 'thirdUserId',
key: 'thirdUserId',
width: 120
},
{
title: '分销佣金(一级)',
dataIndex: 'firstMoney',
key: 'firstMoney',
width: 120
},
{
title: '分销佣金(二级)',
dataIndex: 'secondMoney',
key: 'secondMoney',
width: 120
},
{
title: '分销佣金(三级)',
dataIndex: 'thirdMoney',
key: 'thirdMoney',
width: 120
},
{
title: '单价',
dataIndex: 'price',
key: 'price',
width: 120
},
{
title: '订单总金额',
dataIndex: 'orderPrice',
key: 'orderPrice',
width: 120
},
{
title: '结算金额',
dataIndex: 'settledPrice',
key: 'settledPrice',
width: 120
},
{
title: '换算成度',
dataIndex: 'degreePrice',
key: 'degreePrice',
width: 120
},
{
title: '实发金额',
dataIndex: 'payPrice',
key: 'payPrice',
width: 120
},
{
title: '税率',
dataIndex: 'rate',
key: 'rate',
width: 120
},
{
title: '结算月份',
dataIndex: 'month',
key: 'month',
ellipsis: true
},
{
title: '订单是否失效(0未失效 1已失效)',
dataIndex: 'isInvalid',
key: 'isInvalid',
width: 120
},
{
title: '佣金结算(0未结算 1已结算)',
dataIndex: 'isSettled',
key: 'isSettled',
width: 120
},
{
title: '结算时间',
dataIndex: 'settleTime',
key: 'settleTime',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicMedicineInoutParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicMedicineInout) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicMedicineInout) => {
const hide = message.loading('请求中..', 0);
removeClinicMedicineInout(row.clinicMedicineInoutId)
.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);
removeBatchClinicMedicineInout(selection.value.map((d) => d.clinicMedicineInoutId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicMedicineInout) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicMedicineInout'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,219 +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="medicineId">
<a-input
allow-clear
placeholder="请输入药品"
v-model:value="form.medicineId"
/>
</a-form-item>
<a-form-item label="库存数量" name="stockQuantity">
<a-input
allow-clear
placeholder="请输入库存数量"
v-model:value="form.stockQuantity"
/>
</a-form-item>
<a-form-item label="最小库存预警" name="minStockLevel">
<a-input
allow-clear
placeholder="请输入最小库存预警"
v-model:value="form.minStockLevel"
/>
</a-form-item>
<a-form-item label="上次更新时间" name="lastUpdated">
<a-input
allow-clear
placeholder="请输入上次更新时间"
v-model:value="form.lastUpdated"
/>
</a-form-item>
<a-form-item label="买家用户ID" name="userId">
<a-input
allow-clear
placeholder="请输入买家用户ID"
v-model:value="form.userId"
/>
</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="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicMedicineStock, updateClinicMedicineStock } from '@/api/clinic/clinicMedicineStock';
import { ClinicMedicineStock } from '@/api/clinic/clinicMedicineStock/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?: ClinicMedicineStock | 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<ClinicMedicineStock>({
id: undefined,
medicineId: undefined,
stockQuantity: undefined,
minStockLevel: undefined,
lastUpdated: undefined,
userId: undefined,
comments: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicMedicineStockId: undefined,
clinicMedicineStockName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicMedicineStockName: [
{
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 ? updateClinicMedicineStock : addClinicMedicineStock;
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,274 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicMedicineStockId"
: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>
<!-- 编辑弹窗 -->
<ClinicMedicineStockEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicMedicineStockEdit from './components/clinicMedicineStockEdit.vue';
import { pageClinicMedicineStock, removeClinicMedicineStock, removeBatchClinicMedicineStock } from '@/api/clinic/clinicMedicineStock';
import type { ClinicMedicineStock, ClinicMedicineStockParam } from '@/api/clinic/clinicMedicineStock/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicMedicineStock[]>([]);
// 当前编辑数据
const current = ref<ClinicMedicineStock | 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 pageClinicMedicineStock({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '药品',
dataIndex: 'medicineId',
key: 'medicineId',
width: 120
},
{
title: '库存数量',
dataIndex: 'stockQuantity',
key: 'stockQuantity',
width: 120
},
{
title: '最小库存预警',
dataIndex: 'minStockLevel',
key: 'minStockLevel',
width: 120
},
{
title: '上次更新时间',
dataIndex: 'lastUpdated',
key: 'lastUpdated',
width: 120
},
{
title: '买家用户ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicMedicineStockParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicMedicineStock) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicMedicineStock) => {
const hide = message.loading('请求中..', 0);
removeClinicMedicineStock(row.clinicMedicineStockId)
.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);
removeBatchClinicMedicineStock(selection.value.map((d) => d.clinicMedicineStockId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicMedicineStock) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicMedicineStock'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,749 +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="orderNo">
<a-input
allow-clear
placeholder="请输入订单编号"
v-model:value="form.orderNo"
/>
</a-form-item>
<a-form-item label="订单类型0商城订单 1预定订单/外卖 2会员卡" name="type">
<a-input
allow-clear
placeholder="请输入订单类型0商城订单 1预定订单/外卖 2会员卡"
v-model:value="form.type"
/>
</a-form-item>
<a-form-item label="订单标题" name="title">
<a-input
allow-clear
placeholder="请输入订单标题"
v-model:value="form.title"
/>
</a-form-item>
<a-form-item label="快递/自提" name="deliveryType">
<a-input
allow-clear
placeholder="请输入快递/自提"
v-model:value="form.deliveryType"
/>
</a-form-item>
<a-form-item label="下单渠道0小程序预定 1俱乐部训练场 3活动订场" name="channel">
<a-input
allow-clear
placeholder="请输入下单渠道0小程序预定 1俱乐部训练场 3活动订场"
v-model:value="form.channel"
/>
</a-form-item>
<a-form-item label="微信支付交易号号" name="transactionId">
<a-input
allow-clear
placeholder="请输入微信支付交易号号"
v-model:value="form.transactionId"
/>
</a-form-item>
<a-form-item label="微信退款订单号" name="refundOrder">
<a-input
allow-clear
placeholder="请输入微信退款订单号"
v-model:value="form.refundOrder"
/>
</a-form-item>
<a-form-item label="商户ID" name="merchantId">
<a-input
allow-clear
placeholder="请输入商户ID"
v-model:value="form.merchantId"
/>
</a-form-item>
<a-form-item label="商户名称" name="merchantName">
<a-input
allow-clear
placeholder="请输入商户名称"
v-model:value="form.merchantName"
/>
</a-form-item>
<a-form-item label="商户编号" name="merchantCode">
<a-input
allow-clear
placeholder="请输入商户编号"
v-model:value="form.merchantCode"
/>
</a-form-item>
<a-form-item label="使用的优惠券id" name="couponId">
<a-input
allow-clear
placeholder="请输入使用的优惠券id"
v-model:value="form.couponId"
/>
</a-form-item>
<a-form-item label="使用的会员卡id" name="cardId">
<a-input
allow-clear
placeholder="请输入使用的会员卡id"
v-model:value="form.cardId"
/>
</a-form-item>
<a-form-item label="关联管理员id" name="adminId">
<a-input
allow-clear
placeholder="请输入关联管理员id"
v-model:value="form.adminId"
/>
</a-form-item>
<a-form-item label="核销管理员id" name="confirmId">
<a-input
allow-clear
placeholder="请输入核销管理员id"
v-model:value="form.confirmId"
/>
</a-form-item>
<a-form-item label="IC卡号" name="icCard">
<a-input
allow-clear
placeholder="请输入IC卡号"
v-model:value="form.icCard"
/>
</a-form-item>
<a-form-item label="真实姓名" name="realName">
<a-input
allow-clear
placeholder="请输入真实姓名"
v-model:value="form.realName"
/>
</a-form-item>
<a-form-item label="关联收货地址" name="addressId">
<a-input
allow-clear
placeholder="请输入关联收货地址"
v-model:value="form.addressId"
/>
</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="addressLat">
<a-input
allow-clear
placeholder="请输入"
v-model:value="form.addressLat"
/>
</a-form-item>
<a-form-item label="" name="addressLng">
<a-input
allow-clear
placeholder="请输入"
v-model:value="form.addressLng"
/>
</a-form-item>
<a-form-item label="买家留言" name="buyerRemarks">
<a-input
allow-clear
placeholder="请输入买家留言"
v-model:value="form.buyerRemarks"
/>
</a-form-item>
<a-form-item label="自提店铺id" name="selfTakeMerchantId">
<a-input
allow-clear
placeholder="请输入自提店铺id"
v-model:value="form.selfTakeMerchantId"
/>
</a-form-item>
<a-form-item label="自提店铺" name="selfTakeMerchantName">
<a-input
allow-clear
placeholder="请输入自提店铺"
v-model:value="form.selfTakeMerchantName"
/>
</a-form-item>
<a-form-item label="配送开始时间" name="sendStartTime">
<a-input
allow-clear
placeholder="请输入配送开始时间"
v-model:value="form.sendStartTime"
/>
</a-form-item>
<a-form-item label="配送结束时间" name="sendEndTime">
<a-input
allow-clear
placeholder="请输入配送结束时间"
v-model:value="form.sendEndTime"
/>
</a-form-item>
<a-form-item label="发货店铺id" name="expressMerchantId">
<a-input
allow-clear
placeholder="请输入发货店铺id"
v-model:value="form.expressMerchantId"
/>
</a-form-item>
<a-form-item label="发货店铺" name="expressMerchantName">
<a-input
allow-clear
placeholder="请输入发货店铺"
v-model:value="form.expressMerchantName"
/>
</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="减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格" name="reducePrice">
<a-input
allow-clear
placeholder="请输入减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格"
v-model:value="form.reducePrice"
/>
</a-form-item>
<a-form-item label="实际付款" name="payPrice">
<a-input
allow-clear
placeholder="请输入实际付款"
v-model:value="form.payPrice"
/>
</a-form-item>
<a-form-item label="用于统计" name="price">
<a-input
allow-clear
placeholder="请输入用于统计"
v-model:value="form.price"
/>
</a-form-item>
<a-form-item label="价钱,用于积分赠送" name="money">
<a-input
allow-clear
placeholder="请输入价钱,用于积分赠送"
v-model:value="form.money"
/>
</a-form-item>
<a-form-item label="取消时间" name="cancelTime">
<a-input
allow-clear
placeholder="请输入取消时间"
v-model:value="form.cancelTime"
/>
</a-form-item>
<a-form-item label="取消原因" name="cancelReason">
<a-input
allow-clear
placeholder="请输入取消原因"
v-model:value="form.cancelReason"
/>
</a-form-item>
<a-form-item label="退款金额" name="refundMoney">
<a-input
allow-clear
placeholder="请输入退款金额"
v-model:value="form.refundMoney"
/>
</a-form-item>
<a-form-item label="教练价格" name="coachPrice">
<a-input
allow-clear
placeholder="请输入教练价格"
v-model:value="form.coachPrice"
/>
</a-form-item>
<a-form-item label="购买数量" name="totalNum">
<a-input
allow-clear
placeholder="请输入购买数量"
v-model:value="form.totalNum"
/>
</a-form-item>
<a-form-item label="教练id" name="coachId">
<a-input
allow-clear
placeholder="请输入教练id"
v-model:value="form.coachId"
/>
</a-form-item>
<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="支付的用户id" name="payUserId">
<a-input
allow-clear
placeholder="请输入支付的用户id"
v-model:value="form.payUserId"
/>
</a-form-item>
<a-form-item label="0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付" name="payType">
<a-input
allow-clear
placeholder="请输入0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付"
v-model:value="form.payType"
/>
</a-form-item>
<a-form-item label="微信支付子类型JSAPI小程序支付NATIVE扫码支付" name="wechatPayType">
<a-input
allow-clear
placeholder="请输入微信支付子类型JSAPI小程序支付NATIVE扫码支付"
v-model:value="form.wechatPayType"
/>
</a-form-item>
<a-form-item label="0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付" name="friendPayType">
<a-input
allow-clear
placeholder="请输入0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付"
v-model:value="form.friendPayType"
/>
</a-form-item>
<a-form-item label="0未付款1已付款" name="payStatus">
<a-input
allow-clear
placeholder="请输入0未付款1已付款"
v-model:value="form.payStatus"
/>
</a-form-item>
<a-form-item label="0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款" name="orderStatus">
<a-input
allow-clear
placeholder="请输入0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款"
v-model:value="form.orderStatus"
/>
</a-form-item>
<a-form-item label="发货状态(10未发货 20已发货 30部分发货)" name="deliveryStatus">
<a-input
allow-clear
placeholder="请输入发货状态(10未发货 20已发货 30部分发货)"
v-model:value="form.deliveryStatus"
/>
</a-form-item>
<a-form-item label="无需发货备注" name="deliveryNote">
<a-input
allow-clear
placeholder="请输入无需发货备注"
v-model:value="form.deliveryNote"
/>
</a-form-item>
<a-form-item label="发货时间" name="deliveryTime">
<a-input
allow-clear
placeholder="请输入发货时间"
v-model:value="form.deliveryTime"
/>
</a-form-item>
<a-form-item label="评价状态(0未评价 1已评价)" name="evaluateStatus">
<a-input
allow-clear
placeholder="请输入评价状态(0未评价 1已评价)"
v-model:value="form.evaluateStatus"
/>
</a-form-item>
<a-form-item label="评价时间" name="evaluateTime">
<a-input
allow-clear
placeholder="请输入评价时间"
v-model:value="form.evaluateTime"
/>
</a-form-item>
<a-form-item label="优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡" name="couponType">
<a-input
allow-clear
placeholder="请输入优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡"
v-model:value="form.couponType"
/>
</a-form-item>
<a-form-item label="优惠说明" name="couponDesc">
<a-input
allow-clear
placeholder="请输入优惠说明"
v-model:value="form.couponDesc"
/>
</a-form-item>
<a-form-item label="二维码地址,保存订单号,支付成功后才生成" name="qrcode">
<a-input
allow-clear
placeholder="请输入二维码地址,保存订单号,支付成功后才生成"
v-model:value="form.qrcode"
/>
</a-form-item>
<a-form-item label="vip月卡年卡、ic月卡年卡回退次数" name="returnNum">
<a-input
allow-clear
placeholder="请输入vip月卡年卡、ic月卡年卡回退次数"
v-model:value="form.returnNum"
/>
</a-form-item>
<a-form-item label="vip充值回退金额" name="returnMoney">
<a-input
allow-clear
placeholder="请输入vip充值回退金额"
v-model:value="form.returnMoney"
/>
</a-form-item>
<a-form-item label="预约详情开始时间数组" name="startTime">
<a-input
allow-clear
placeholder="请输入预约详情开始时间数组"
v-model:value="form.startTime"
/>
</a-form-item>
<a-form-item label="是否已开具发票0未开发票1已开发票2不能开具发票" name="isInvoice">
<a-input
allow-clear
placeholder="请输入是否已开具发票0未开发票1已开发票2不能开具发票"
v-model:value="form.isInvoice"
/>
</a-form-item>
<a-form-item label="发票流水号" name="invoiceNo">
<a-input
allow-clear
placeholder="请输入发票流水号"
v-model:value="form.invoiceNo"
/>
</a-form-item>
<a-form-item label="商家留言" name="merchantRemarks">
<a-input
allow-clear
placeholder="请输入商家留言"
v-model:value="form.merchantRemarks"
/>
</a-form-item>
<a-form-item label="支付时间" name="payTime">
<a-input
allow-clear
placeholder="请输入支付时间"
v-model:value="form.payTime"
/>
</a-form-item>
<a-form-item label="退款时间" name="refundTime">
<a-input
allow-clear
placeholder="请输入退款时间"
v-model:value="form.refundTime"
/>
</a-form-item>
<a-form-item label="申请退款时间" name="refundApplyTime">
<a-input
allow-clear
placeholder="请输入申请退款时间"
v-model:value="form.refundApplyTime"
/>
</a-form-item>
<a-form-item label="过期时间" name="expirationTime">
<a-input
allow-clear
placeholder="请输入过期时间"
v-model:value="form.expirationTime"
/>
</a-form-item>
<a-form-item label="自提码" name="selfTakeCode">
<a-input
allow-clear
placeholder="请输入自提码"
v-model:value="form.selfTakeCode"
/>
</a-form-item>
<a-form-item label="是否已收到赠品" name="hasTakeGift">
<a-input
allow-clear
placeholder="请输入是否已收到赠品"
v-model:value="form.hasTakeGift"
/>
</a-form-item>
<a-form-item label="对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单" name="checkBill">
<a-input
allow-clear
placeholder="请输入对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单"
v-model:value="form.checkBill"
/>
</a-form-item>
<a-form-item label="订单是否已结算(0未结算 1已结算)" name="isSettled">
<a-input
allow-clear
placeholder="请输入订单是否已结算(0未结算 1已结算)"
v-model:value="form.isSettled"
/>
</a-form-item>
<a-form-item label="系统版本号 0当前版本 value=其他版本" name="version">
<a-input
allow-clear
placeholder="请输入系统版本号 0当前版本 value=其他版本"
v-model:value="form.version"
/>
</a-form-item>
<a-form-item label="用户id" name="userId">
<a-input
allow-clear
placeholder="请输入用户id"
v-model:value="form.userId"
/>
</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="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</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-item label="修改时间" name="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicOrder, updateClinicOrder } from '@/api/clinic/clinicOrder';
import { ClinicOrder } from '@/api/clinic/clinicOrder/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?: ClinicOrder | 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<ClinicOrder>({
orderId: undefined,
orderNo: undefined,
type: undefined,
title: undefined,
deliveryType: undefined,
channel: undefined,
transactionId: undefined,
refundOrder: undefined,
merchantId: undefined,
merchantName: undefined,
merchantCode: undefined,
couponId: undefined,
cardId: undefined,
adminId: undefined,
confirmId: undefined,
icCard: undefined,
realName: undefined,
addressId: undefined,
address: undefined,
addressLat: undefined,
addressLng: undefined,
buyerRemarks: undefined,
selfTakeMerchantId: undefined,
selfTakeMerchantName: undefined,
sendStartTime: undefined,
sendEndTime: undefined,
expressMerchantId: undefined,
expressMerchantName: undefined,
totalPrice: undefined,
reducePrice: undefined,
payPrice: undefined,
price: undefined,
money: undefined,
cancelTime: undefined,
cancelReason: undefined,
refundMoney: undefined,
coachPrice: undefined,
totalNum: undefined,
coachId: undefined,
formId: undefined,
payUserId: undefined,
payType: undefined,
wechatPayType: undefined,
friendPayType: undefined,
payStatus: undefined,
orderStatus: undefined,
deliveryStatus: undefined,
deliveryNote: undefined,
deliveryTime: undefined,
evaluateStatus: undefined,
evaluateTime: undefined,
couponType: undefined,
couponDesc: undefined,
qrcode: undefined,
returnNum: undefined,
returnMoney: undefined,
startTime: undefined,
isInvoice: undefined,
invoiceNo: undefined,
merchantRemarks: undefined,
payTime: undefined,
refundTime: undefined,
refundApplyTime: undefined,
expirationTime: undefined,
selfTakeCode: undefined,
hasTakeGift: undefined,
checkBill: undefined,
isSettled: undefined,
version: undefined,
userId: undefined,
comments: undefined,
sortNumber: undefined,
deleted: undefined,
tenantId: undefined,
updateTime: undefined,
createTime: undefined,
clinicOrderId: undefined,
clinicOrderName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicOrderName: [
{
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 ? updateClinicOrder : addClinicOrder;
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,671 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicOrderId"
: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>
<!-- 编辑弹窗 -->
<ClinicOrderEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicOrderEdit from './components/clinicOrderEdit.vue';
import { pageClinicOrder, removeClinicOrder, removeBatchClinicOrder } from '@/api/clinic/clinicOrder';
import type { ClinicOrder, ClinicOrderParam } from '@/api/clinic/clinicOrder/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicOrder[]>([]);
// 当前编辑数据
const current = ref<ClinicOrder | 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 pageClinicOrder({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '订单号',
dataIndex: 'orderId',
key: 'orderId',
width: 90,
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
ellipsis: true
},
{
title: '订单类型0商城订单 1预定订单/外卖 2会员卡',
dataIndex: 'type',
key: 'type',
width: 120
},
{
title: '订单标题',
dataIndex: 'title',
key: 'title',
ellipsis: true
},
{
title: '快递/自提',
dataIndex: 'deliveryType',
key: 'deliveryType',
width: 120
},
{
title: '下单渠道0小程序预定 1俱乐部训练场 3活动订场',
dataIndex: 'channel',
key: 'channel',
width: 120
},
{
title: '微信支付交易号号',
dataIndex: 'transactionId',
key: 'transactionId',
ellipsis: true
},
{
title: '微信退款订单号',
dataIndex: 'refundOrder',
key: 'refundOrder',
ellipsis: true
},
{
title: '商户ID',
dataIndex: 'merchantId',
key: 'merchantId',
width: 120
},
{
title: '商户名称',
dataIndex: 'merchantName',
key: 'merchantName',
ellipsis: true
},
{
title: '商户编号',
dataIndex: 'merchantCode',
key: 'merchantCode',
ellipsis: true
},
{
title: '使用的优惠券id',
dataIndex: 'couponId',
key: 'couponId',
width: 120
},
{
title: '使用的会员卡id',
dataIndex: 'cardId',
key: 'cardId',
ellipsis: true
},
{
title: '关联管理员id',
dataIndex: 'adminId',
key: 'adminId',
width: 120
},
{
title: '核销管理员id',
dataIndex: 'confirmId',
key: 'confirmId',
width: 120
},
{
title: 'IC卡号',
dataIndex: 'icCard',
key: 'icCard',
ellipsis: true
},
{
title: '真实姓名',
dataIndex: 'realName',
key: 'realName',
ellipsis: true
},
{
title: '关联收货地址',
dataIndex: 'addressId',
key: 'addressId',
width: 120
},
{
title: '收货地址',
dataIndex: 'address',
key: 'address',
ellipsis: true
},
{
title: '',
dataIndex: 'addressLat',
key: 'addressLat',
ellipsis: true
},
{
title: '',
dataIndex: 'addressLng',
key: 'addressLng',
ellipsis: true
},
{
title: '买家留言',
dataIndex: 'buyerRemarks',
key: 'buyerRemarks',
ellipsis: true
},
{
title: '自提店铺id',
dataIndex: 'selfTakeMerchantId',
key: 'selfTakeMerchantId',
width: 120
},
{
title: '自提店铺',
dataIndex: 'selfTakeMerchantName',
key: 'selfTakeMerchantName',
ellipsis: true
},
{
title: '配送开始时间',
dataIndex: 'sendStartTime',
key: 'sendStartTime',
ellipsis: true
},
{
title: '配送结束时间',
dataIndex: 'sendEndTime',
key: 'sendEndTime',
ellipsis: true
},
{
title: '发货店铺id',
dataIndex: 'expressMerchantId',
key: 'expressMerchantId',
width: 120
},
{
title: '发货店铺',
dataIndex: 'expressMerchantName',
key: 'expressMerchantName',
ellipsis: true
},
{
title: '订单总额',
dataIndex: 'totalPrice',
key: 'totalPrice',
width: 120
},
{
title: '减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格',
dataIndex: 'reducePrice',
key: 'reducePrice',
width: 120
},
{
title: '实际付款',
dataIndex: 'payPrice',
key: 'payPrice',
width: 120
},
{
title: '用于统计',
dataIndex: 'price',
key: 'price',
width: 120
},
{
title: '价钱,用于积分赠送',
dataIndex: 'money',
key: 'money',
width: 120
},
{
title: '取消时间',
dataIndex: 'cancelTime',
key: 'cancelTime',
width: 120
},
{
title: '取消原因',
dataIndex: 'cancelReason',
key: 'cancelReason',
ellipsis: true
},
{
title: '退款金额',
dataIndex: 'refundMoney',
key: 'refundMoney',
width: 120
},
{
title: '教练价格',
dataIndex: 'coachPrice',
key: 'coachPrice',
width: 120
},
{
title: '购买数量',
dataIndex: 'totalNum',
key: 'totalNum',
width: 120
},
{
title: '教练id',
dataIndex: 'coachId',
key: 'coachId',
width: 120
},
{
title: '商品ID',
dataIndex: 'formId',
key: 'formId',
width: 120
},
{
title: '支付的用户id',
dataIndex: 'payUserId',
key: 'payUserId',
width: 120
},
{
title: '0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付',
dataIndex: 'payType',
key: 'payType',
width: 120
},
{
title: '微信支付子类型JSAPI小程序支付NATIVE扫码支付',
dataIndex: 'wechatPayType',
key: 'wechatPayType',
ellipsis: true
},
{
title: '0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付',
dataIndex: 'friendPayType',
key: 'friendPayType',
width: 120
},
{
title: '0未付款1已付款',
dataIndex: 'payStatus',
key: 'payStatus',
width: 120
},
{
title: '0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款',
dataIndex: 'orderStatus',
key: 'orderStatus',
width: 120
},
{
title: '发货状态(10未发货 20已发货 30部分发货)',
dataIndex: 'deliveryStatus',
key: 'deliveryStatus',
width: 120
},
{
title: '无需发货备注',
dataIndex: 'deliveryNote',
key: 'deliveryNote',
ellipsis: true
},
{
title: '发货时间',
dataIndex: 'deliveryTime',
key: 'deliveryTime',
width: 120
},
{
title: '评价状态(0未评价 1已评价)',
dataIndex: 'evaluateStatus',
key: 'evaluateStatus',
width: 120
},
{
title: '评价时间',
dataIndex: 'evaluateTime',
key: 'evaluateTime',
width: 120
},
{
title: '优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡',
dataIndex: 'couponType',
key: 'couponType',
width: 120
},
{
title: '优惠说明',
dataIndex: 'couponDesc',
key: 'couponDesc',
ellipsis: true
},
{
title: '二维码地址,保存订单号,支付成功后才生成',
dataIndex: 'qrcode',
key: 'qrcode',
ellipsis: true
},
{
title: 'vip月卡年卡、ic月卡年卡回退次数',
dataIndex: 'returnNum',
key: 'returnNum',
width: 120
},
{
title: 'vip充值回退金额',
dataIndex: 'returnMoney',
key: 'returnMoney',
width: 120
},
{
title: '预约详情开始时间数组',
dataIndex: 'startTime',
key: 'startTime',
ellipsis: true
},
{
title: '是否已开具发票0未开发票1已开发票2不能开具发票',
dataIndex: 'isInvoice',
key: 'isInvoice',
width: 120
},
{
title: '发票流水号',
dataIndex: 'invoiceNo',
key: 'invoiceNo',
ellipsis: true
},
{
title: '商家留言',
dataIndex: 'merchantRemarks',
key: 'merchantRemarks',
ellipsis: true
},
{
title: '支付时间',
dataIndex: 'payTime',
key: 'payTime',
width: 120
},
{
title: '退款时间',
dataIndex: 'refundTime',
key: 'refundTime',
width: 120
},
{
title: '申请退款时间',
dataIndex: 'refundApplyTime',
key: 'refundApplyTime',
width: 120
},
{
title: '过期时间',
dataIndex: 'expirationTime',
key: 'expirationTime',
width: 120
},
{
title: '自提码',
dataIndex: 'selfTakeCode',
key: 'selfTakeCode',
ellipsis: true
},
{
title: '是否已收到赠品',
dataIndex: 'hasTakeGift',
key: 'hasTakeGift',
width: 120
},
{
title: '对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单',
dataIndex: 'checkBill',
key: 'checkBill',
width: 120
},
{
title: '订单是否已结算(0未结算 1已结算)',
dataIndex: 'isSettled',
key: 'isSettled',
width: 120
},
{
title: '系统版本号 0当前版本 value=其他版本',
dataIndex: 'version',
key: 'version',
width: 120
},
{
title: '用户id',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '排序号',
dataIndex: 'sortNumber',
key: 'sortNumber',
width: 120
},
{
title: '是否删除, 0否, 1是',
dataIndex: 'deleted',
key: 'deleted',
width: 120
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'orderId',
'title',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicOrderParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicOrder) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicOrder) => {
const hide = message.loading('请求中..', 0);
removeClinicOrder(row.clinicOrderId)
.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);
removeBatchClinicOrder(selection.value.map((d) => d.clinicOrderId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicOrder) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicOrder'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,317 +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="类型 0经销商 1企业 2集团" name="type">
<a-input
allow-clear
placeholder="请输入类型 0经销商 1企业 2集团"
v-model:value="form.type"
/>
</a-form-item>
<a-form-item label="自增ID" name="userId">
<a-input
allow-clear
placeholder="请输入自增ID"
v-model:value="form.userId"
/>
</a-form-item>
<a-form-item label="姓名" name="realName">
<a-input
allow-clear
placeholder="请输入姓名"
v-model:value="form.realName"
/>
</a-form-item>
<a-form-item label="手机号" name="mobile">
<a-input
allow-clear
placeholder="请输入手机号"
v-model:value="form.mobile"
/>
</a-form-item>
<a-form-item label="支付密码" name="payPassword">
<a-input
allow-clear
placeholder="请输入支付密码"
v-model:value="form.payPassword"
/>
</a-form-item>
<a-form-item label="当前可提现佣金" name="money">
<a-input
allow-clear
placeholder="请输入当前可提现佣金"
v-model:value="form.money"
/>
</a-form-item>
<a-form-item label="已冻结佣金" name="freezeMoney">
<a-input
allow-clear
placeholder="请输入已冻结佣金"
v-model:value="form.freezeMoney"
/>
</a-form-item>
<a-form-item label="累积提现佣金" name="totalMoney">
<a-input
allow-clear
placeholder="请输入累积提现佣金"
v-model:value="form.totalMoney"
/>
</a-form-item>
<a-form-item label="收益基数" name="rate">
<a-input
allow-clear
placeholder="请输入收益基数"
v-model:value="form.rate"
/>
</a-form-item>
<a-form-item label="单价" name="price">
<a-input
allow-clear
placeholder="请输入单价"
v-model:value="form.price"
/>
</a-form-item>
<a-form-item label="推荐人用户ID" name="refereeId">
<a-input
allow-clear
placeholder="请输入推荐人用户ID"
v-model:value="form.refereeId"
/>
</a-form-item>
<a-form-item label="成员数量(一级)" name="firstNum">
<a-input
allow-clear
placeholder="请输入成员数量(一级)"
v-model:value="form.firstNum"
/>
</a-form-item>
<a-form-item label="成员数量(二级)" name="secondNum">
<a-input
allow-clear
placeholder="请输入成员数量(二级)"
v-model:value="form.secondNum"
/>
</a-form-item>
<a-form-item label="成员数量(三级)" name="thirdNum">
<a-input
allow-clear
placeholder="请输入成员数量(三级)"
v-model:value="form.thirdNum"
/>
</a-form-item>
<a-form-item label="专属二维码" name="qrcode">
<a-input
allow-clear
placeholder="请输入专属二维码"
v-model:value="form.qrcode"
/>
</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="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="isDelete">
<a-input
allow-clear
placeholder="请输入是否删除"
v-model:value="form.isDelete"
/>
</a-form-item>
<a-form-item label="修改时间" name="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicPatientUser, updateClinicPatientUser } from '@/api/clinic/clinicPatientUser';
import { ClinicPatientUser } from '@/api/clinic/clinicPatientUser/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?: ClinicPatientUser | 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<ClinicPatientUser>({
id: undefined,
type: undefined,
userId: undefined,
realName: undefined,
mobile: undefined,
payPassword: undefined,
money: undefined,
freezeMoney: undefined,
totalMoney: undefined,
rate: undefined,
price: undefined,
refereeId: undefined,
firstNum: undefined,
secondNum: undefined,
thirdNum: undefined,
qrcode: undefined,
comments: undefined,
sortNumber: undefined,
isDelete: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicPatientUserId: undefined,
clinicPatientUserName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicPatientUserName: [
{
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 ? updateClinicPatientUser : addClinicPatientUser;
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,346 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicPatientUserId"
: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>
<!-- 编辑弹窗 -->
<ClinicPatientUserEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicPatientUserEdit from './components/clinicPatientUserEdit.vue';
import { pageClinicPatientUser, removeClinicPatientUser, removeBatchClinicPatientUser } from '@/api/clinic/clinicPatientUser';
import type { ClinicPatientUser, ClinicPatientUserParam } from '@/api/clinic/clinicPatientUser/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicPatientUser[]>([]);
// 当前编辑数据
const current = ref<ClinicPatientUser | 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 pageClinicPatientUser({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '类型 0经销商 1企业 2集团',
dataIndex: 'type',
key: 'type',
width: 120
},
{
title: '自增ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
ellipsis: true
},
{
title: '手机号',
dataIndex: 'mobile',
key: 'mobile',
ellipsis: true
},
{
title: '支付密码',
dataIndex: 'payPassword',
key: 'payPassword',
ellipsis: true
},
{
title: '当前可提现佣金',
dataIndex: 'money',
key: 'money',
width: 120
},
{
title: '已冻结佣金',
dataIndex: 'freezeMoney',
key: 'freezeMoney',
width: 120
},
{
title: '累积提现佣金',
dataIndex: 'totalMoney',
key: 'totalMoney',
width: 120
},
{
title: '收益基数',
dataIndex: 'rate',
key: 'rate',
width: 120
},
{
title: '单价',
dataIndex: 'price',
key: 'price',
width: 120
},
{
title: '推荐人用户ID',
dataIndex: 'refereeId',
key: 'refereeId',
width: 120
},
{
title: '成员数量(一级)',
dataIndex: 'firstNum',
key: 'firstNum',
width: 120
},
{
title: '成员数量(二级)',
dataIndex: 'secondNum',
key: 'secondNum',
width: 120
},
{
title: '成员数量(三级)',
dataIndex: 'thirdNum',
key: 'thirdNum',
width: 120
},
{
title: '专属二维码',
dataIndex: 'qrcode',
key: 'qrcode',
ellipsis: true
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '排序号',
dataIndex: 'sortNumber',
key: 'sortNumber',
width: 120
},
{
title: '是否删除',
dataIndex: 'isDelete',
key: 'isDelete',
width: 120
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicPatientUserParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicPatientUser) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicPatientUser) => {
const hide = message.loading('请求中..', 0);
removeClinicPatientUser(row.clinicPatientUserId)
.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);
removeBatchClinicPatientUser(selection.value.map((d) => d.clinicPatientUserId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicPatientUser) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicPatientUser'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,301 +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="userId">
<a-input
allow-clear
placeholder="请输入患者"
v-model:value="form.userId"
/>
</a-form-item>
<a-form-item label="医生" name="doctorId">
<a-input
allow-clear
placeholder="请输入医生"
v-model:value="form.doctorId"
/>
</a-form-item>
<a-form-item label="订单编号" name="orderNo">
<a-input
allow-clear
placeholder="请输入订单编号"
v-model:value="form.orderNo"
/>
</a-form-item>
<a-form-item label="关联就诊表" name="visitRecordId">
<a-input
allow-clear
placeholder="请输入关联就诊表"
v-model:value="form.visitRecordId"
/>
</a-form-item>
<a-form-item label="处方类型 0中药 1西药" name="prescriptionType">
<a-input
allow-clear
placeholder="请输入处方类型 0中药 1西药"
v-model:value="form.prescriptionType"
/>
</a-form-item>
<a-form-item label="诊断结果" name="diagnosis">
<a-input
allow-clear
placeholder="请输入诊断结果"
v-model:value="form.diagnosis"
/>
</a-form-item>
<a-form-item label="治疗方案" name="treatmentPlan">
<a-input
allow-clear
placeholder="请输入治疗方案"
v-model:value="form.treatmentPlan"
/>
</a-form-item>
<a-form-item label="煎药说明" name="decoctionInstructions">
<a-input
allow-clear
placeholder="请输入煎药说明"
v-model:value="form.decoctionInstructions"
/>
</a-form-item>
<a-form-item label="订单总金额" name="orderPrice">
<a-input
allow-clear
placeholder="请输入订单总金额"
v-model:value="form.orderPrice"
/>
</a-form-item>
<a-form-item label="单价" name="price">
<a-input
allow-clear
placeholder="请输入单价"
v-model:value="form.price"
/>
</a-form-item>
<a-form-item label="实付金额" name="payPrice">
<a-input
allow-clear
placeholder="请输入实付金额"
v-model:value="form.payPrice"
/>
</a-form-item>
<a-form-item label="订单是否失效(0未失效 1已失效)" name="isInvalid">
<a-input
allow-clear
placeholder="请输入订单是否失效(0未失效 1已失效)"
v-model:value="form.isInvalid"
/>
</a-form-item>
<a-form-item label="结算(0未结算 1已结算)" name="isSettled">
<a-input
allow-clear
placeholder="请输入结算(0未结算 1已结算)"
v-model:value="form.isSettled"
/>
</a-form-item>
<a-form-item label="结算时间" name="settleTime">
<a-input
allow-clear
placeholder="请输入结算时间"
v-model:value="form.settleTime"
/>
</a-form-item>
<a-form-item label="状态, 0正常, 1已完成2已支付3已取消" 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="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="修改时间" name="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicPrescription, updateClinicPrescription } from '@/api/clinic/clinicPrescription';
import { ClinicPrescription } from '@/api/clinic/clinicPrescription/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?: ClinicPrescription | 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<ClinicPrescription>({
id: undefined,
userId: undefined,
doctorId: undefined,
orderNo: undefined,
visitRecordId: undefined,
prescriptionType: undefined,
diagnosis: undefined,
treatmentPlan: undefined,
decoctionInstructions: undefined,
orderPrice: undefined,
price: undefined,
payPrice: undefined,
isInvalid: undefined,
isSettled: undefined,
settleTime: undefined,
status: undefined,
comments: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicPrescriptionId: undefined,
clinicPrescriptionName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicPrescriptionName: [
{
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 ? updateClinicPrescription : addClinicPrescription;
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,335 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<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 === '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>
<!-- 编辑弹窗 -->
<ClinicPrescriptionEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicPrescriptionEdit from './components/clinicPrescriptionEdit.vue';
import { pageClinicPrescription, removeClinicPrescription, removeBatchClinicPrescription } from '@/api/clinic/clinicPrescription';
import type { ClinicPrescription, ClinicPrescriptionParam } from '@/api/clinic/clinicPrescription/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicPrescription[]>([]);
// 当前编辑数据
const current = ref<ClinicPrescription | 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 pageClinicPrescription({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '患者',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '医生',
dataIndex: 'doctorId',
key: 'doctorId',
width: 120
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
ellipsis: true
},
{
title: '关联就诊表',
dataIndex: 'visitRecordId',
key: 'visitRecordId',
width: 120
},
{
title: '处方类型 0中药 1西药',
dataIndex: 'prescriptionType',
key: 'prescriptionType',
width: 120
},
{
title: '诊断结果',
dataIndex: 'diagnosis',
key: 'diagnosis',
ellipsis: true
},
{
title: '治疗方案',
dataIndex: 'treatmentPlan',
key: 'treatmentPlan',
ellipsis: true
},
{
title: '煎药说明',
dataIndex: 'decoctionInstructions',
key: 'decoctionInstructions',
ellipsis: true
},
{
title: '订单总金额',
dataIndex: 'orderPrice',
key: 'orderPrice',
width: 120
},
{
title: '单价',
dataIndex: 'price',
key: 'price',
width: 120
},
{
title: '实付金额',
dataIndex: 'payPrice',
key: 'payPrice',
width: 120
},
{
title: '订单是否失效(0未失效 1已失效)',
dataIndex: 'isInvalid',
key: 'isInvalid',
width: 120
},
{
title: '结算(0未结算 1已结算)',
dataIndex: 'isSettled',
key: 'isSettled',
width: 120
},
{
title: '结算时间',
dataIndex: 'settleTime',
key: 'settleTime',
width: 120
},
{
title: '状态, 0正常, 1已完成2已支付3已取消',
dataIndex: 'status',
key: 'status',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'status',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicPrescriptionParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicPrescription) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicPrescription) => {
const hide = message.loading('请求中..', 0);
removeClinicPrescription(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);
removeBatchClinicPrescription(selection.value.map((d) => d.))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicPrescription) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicPrescription'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,272 +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="prescriptionId">
<a-input
allow-clear
placeholder="请输入关联处方"
v-model:value="form.prescriptionId"
/>
</a-form-item>
<a-form-item label="订单编号" name="prescriptionNo">
<a-input
allow-clear
placeholder="请输入订单编号"
v-model:value="form.prescriptionNo"
/>
</a-form-item>
<a-form-item label="关联药品" name="medicineId">
<a-input
allow-clear
placeholder="请输入关联药品"
v-model:value="form.medicineId"
/>
</a-form-item>
<a-form-item label="剂量如“10g”" name="dosage">
<a-input
allow-clear
placeholder="请输入剂量如“10g”"
v-model:value="form.dosage"
/>
</a-form-item>
<a-form-item label="用法频率(如“每日三次”)" name="usageFrequency">
<a-input
allow-clear
placeholder="请输入用法频率(如“每日三次”)"
v-model:value="form.usageFrequency"
/>
</a-form-item>
<a-form-item label="服用天数" name="days">
<a-input
allow-clear
placeholder="请输入服用天数"
v-model:value="form.days"
/>
</a-form-item>
<a-form-item label="购买数量" name="amount">
<a-input
allow-clear
placeholder="请输入购买数量"
v-model:value="form.amount"
/>
</a-form-item>
<a-form-item label="单价" name="unitPrice">
<a-input
allow-clear
placeholder="请输入单价"
v-model:value="form.unitPrice"
/>
</a-form-item>
<a-form-item label="数量" name="quantity">
<a-input
allow-clear
placeholder="请输入数量"
v-model:value="form.quantity"
/>
</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="用户id" name="userId">
<a-input
allow-clear
placeholder="请输入用户id"
v-model:value="form.userId"
/>
</a-form-item>
<a-form-item label="更新时间" name="updateTime">
<a-input
allow-clear
placeholder="请输入更新时间"
v-model:value="form.updateTime"
/>
</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 { addClinicPrescriptionItem, updateClinicPrescriptionItem } from '@/api/clinic/clinicPrescriptionItem';
import { ClinicPrescriptionItem } from '@/api/clinic/clinicPrescriptionItem/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?: ClinicPrescriptionItem | 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<ClinicPrescriptionItem>({
id: undefined,
prescriptionId: undefined,
prescriptionNo: undefined,
medicineId: undefined,
dosage: undefined,
usageFrequency: undefined,
days: undefined,
amount: undefined,
unitPrice: undefined,
quantity: undefined,
sortNumber: undefined,
comments: undefined,
userId: undefined,
tenantId: undefined,
updateTime: undefined,
createTime: undefined,
clinicPrescriptionItemId: undefined,
clinicPrescriptionItemName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicPrescriptionItemName: [
{
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 ? updateClinicPrescriptionItem : addClinicPrescriptionItem;
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,310 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<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 === '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>
<!-- 编辑弹窗 -->
<ClinicPrescriptionItemEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicPrescriptionItemEdit from './components/clinicPrescriptionItemEdit.vue';
import { pageClinicPrescriptionItem, removeClinicPrescriptionItem, removeBatchClinicPrescriptionItem } from '@/api/clinic/clinicPrescriptionItem';
import type { ClinicPrescriptionItem, ClinicPrescriptionItemParam } from '@/api/clinic/clinicPrescriptionItem/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicPrescriptionItem[]>([]);
// 当前编辑数据
const current = ref<ClinicPrescriptionItem | 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 pageClinicPrescriptionItem({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '自增ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '关联处方',
dataIndex: 'prescriptionId',
key: 'prescriptionId',
width: 120
},
{
title: '订单编号',
dataIndex: 'prescriptionNo',
key: 'prescriptionNo',
ellipsis: true
},
{
title: '关联药品',
dataIndex: 'medicineId',
key: 'medicineId',
width: 120
},
{
title: '剂量如“10g”',
dataIndex: 'dosage',
key: 'dosage',
ellipsis: true
},
{
title: '用法频率(如“每日三次”)',
dataIndex: 'usageFrequency',
key: 'usageFrequency',
ellipsis: true
},
{
title: '服用天数',
dataIndex: 'days',
key: 'days',
width: 120
},
{
title: '购买数量',
dataIndex: 'amount',
key: 'amount',
width: 120
},
{
title: '单价',
dataIndex: 'unitPrice',
key: 'unitPrice',
width: 120
},
{
title: '数量',
dataIndex: 'quantity',
key: 'quantity',
width: 120
},
{
title: '排序号',
dataIndex: 'sortNumber',
key: 'sortNumber',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '用户id',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '更新时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicPrescriptionItemParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicPrescriptionItem) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicPrescriptionItem) => {
const hide = message.loading('请求中..', 0);
removeClinicPrescriptionItem(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);
removeBatchClinicPrescriptionItem(selection.value.map((d) => d.))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicPrescriptionItem) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicPrescriptionItem'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,323 +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="userId">
<a-input
allow-clear
placeholder="请输入买家用户ID"
v-model:value="form.userId"
/>
</a-form-item>
<a-form-item label="订单编号" name="orderNo">
<a-input
allow-clear
placeholder="请输入订单编号"
v-model:value="form.orderNo"
/>
</a-form-item>
<a-form-item label="分销商用户id(一级)" name="firstUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(一级)"
v-model:value="form.firstUserId"
/>
</a-form-item>
<a-form-item label="分销商用户id(二级)" name="secondUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(二级)"
v-model:value="form.secondUserId"
/>
</a-form-item>
<a-form-item label="分销商用户id(三级)" name="thirdUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(三级)"
v-model:value="form.thirdUserId"
/>
</a-form-item>
<a-form-item label="分销佣金(一级)" name="firstMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(一级)"
v-model:value="form.firstMoney"
/>
</a-form-item>
<a-form-item label="分销佣金(二级)" name="secondMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(二级)"
v-model:value="form.secondMoney"
/>
</a-form-item>
<a-form-item label="分销佣金(三级)" name="thirdMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(三级)"
v-model:value="form.thirdMoney"
/>
</a-form-item>
<a-form-item label="单价" name="price">
<a-input
allow-clear
placeholder="请输入单价"
v-model:value="form.price"
/>
</a-form-item>
<a-form-item label="订单总金额" name="orderPrice">
<a-input
allow-clear
placeholder="请输入订单总金额"
v-model:value="form.orderPrice"
/>
</a-form-item>
<a-form-item label="结算金额" name="settledPrice">
<a-input
allow-clear
placeholder="请输入结算金额"
v-model:value="form.settledPrice"
/>
</a-form-item>
<a-form-item label="换算成度" name="degreePrice">
<a-input
allow-clear
placeholder="请输入换算成度"
v-model:value="form.degreePrice"
/>
</a-form-item>
<a-form-item label="实发金额" name="payPrice">
<a-input
allow-clear
placeholder="请输入实发金额"
v-model:value="form.payPrice"
/>
</a-form-item>
<a-form-item label="税率" name="rate">
<a-input
allow-clear
placeholder="请输入税率"
v-model:value="form.rate"
/>
</a-form-item>
<a-form-item label="结算月份" name="month">
<a-input
allow-clear
placeholder="请输入结算月份"
v-model:value="form.month"
/>
</a-form-item>
<a-form-item label="订单是否失效(0未失效 1已失效)" name="isInvalid">
<a-input
allow-clear
placeholder="请输入订单是否失效(0未失效 1已失效)"
v-model:value="form.isInvalid"
/>
</a-form-item>
<a-form-item label="佣金结算(0未结算 1已结算)" name="isSettled">
<a-input
allow-clear
placeholder="请输入佣金结算(0未结算 1已结算)"
v-model:value="form.isSettled"
/>
</a-form-item>
<a-form-item label="结算时间" name="settleTime">
<a-input
allow-clear
placeholder="请输入结算时间"
v-model:value="form.settleTime"
/>
</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="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicReport, updateClinicReport } from '@/api/clinic/clinicReport';
import { ClinicReport } from '@/api/clinic/clinicReport/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?: ClinicReport | 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<ClinicReport>({
id: undefined,
userId: undefined,
orderNo: undefined,
firstUserId: undefined,
secondUserId: undefined,
thirdUserId: undefined,
firstMoney: undefined,
secondMoney: undefined,
thirdMoney: undefined,
price: undefined,
orderPrice: undefined,
settledPrice: undefined,
degreePrice: undefined,
payPrice: undefined,
rate: undefined,
month: undefined,
isInvalid: undefined,
isSettled: undefined,
settleTime: undefined,
comments: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicReportId: undefined,
clinicReportName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicReportName: [
{
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 ? updateClinicReport : addClinicReport;
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,352 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicReportId"
: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>
<!-- 编辑弹窗 -->
<ClinicReportEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicReportEdit from './components/clinicReportEdit.vue';
import { pageClinicReport, removeClinicReport, removeBatchClinicReport } from '@/api/clinic/clinicReport';
import type { ClinicReport, ClinicReportParam } from '@/api/clinic/clinicReport/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicReport[]>([]);
// 当前编辑数据
const current = ref<ClinicReport | 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 pageClinicReport({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '买家用户ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
ellipsis: true
},
{
title: '分销商用户id(一级)',
dataIndex: 'firstUserId',
key: 'firstUserId',
width: 120
},
{
title: '分销商用户id(二级)',
dataIndex: 'secondUserId',
key: 'secondUserId',
width: 120
},
{
title: '分销商用户id(三级)',
dataIndex: 'thirdUserId',
key: 'thirdUserId',
width: 120
},
{
title: '分销佣金(一级)',
dataIndex: 'firstMoney',
key: 'firstMoney',
width: 120
},
{
title: '分销佣金(二级)',
dataIndex: 'secondMoney',
key: 'secondMoney',
width: 120
},
{
title: '分销佣金(三级)',
dataIndex: 'thirdMoney',
key: 'thirdMoney',
width: 120
},
{
title: '单价',
dataIndex: 'price',
key: 'price',
width: 120
},
{
title: '订单总金额',
dataIndex: 'orderPrice',
key: 'orderPrice',
width: 120
},
{
title: '结算金额',
dataIndex: 'settledPrice',
key: 'settledPrice',
width: 120
},
{
title: '换算成度',
dataIndex: 'degreePrice',
key: 'degreePrice',
width: 120
},
{
title: '实发金额',
dataIndex: 'payPrice',
key: 'payPrice',
width: 120
},
{
title: '税率',
dataIndex: 'rate',
key: 'rate',
width: 120
},
{
title: '结算月份',
dataIndex: 'month',
key: 'month',
ellipsis: true
},
{
title: '订单是否失效(0未失效 1已失效)',
dataIndex: 'isInvalid',
key: 'isInvalid',
width: 120
},
{
title: '佣金结算(0未结算 1已结算)',
dataIndex: 'isSettled',
key: 'isSettled',
width: 120
},
{
title: '结算时间',
dataIndex: 'settleTime',
key: 'settleTime',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicReportParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicReport) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicReport) => {
const hide = message.loading('请求中..', 0);
removeClinicReport(row.clinicReportId)
.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);
removeBatchClinicReport(selection.value.map((d) => d.clinicReportId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicReport) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicReport'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,323 +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="userId">
<a-input
allow-clear
placeholder="请输入买家用户ID"
v-model:value="form.userId"
/>
</a-form-item>
<a-form-item label="订单编号" name="orderNo">
<a-input
allow-clear
placeholder="请输入订单编号"
v-model:value="form.orderNo"
/>
</a-form-item>
<a-form-item label="分销商用户id(一级)" name="firstUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(一级)"
v-model:value="form.firstUserId"
/>
</a-form-item>
<a-form-item label="分销商用户id(二级)" name="secondUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(二级)"
v-model:value="form.secondUserId"
/>
</a-form-item>
<a-form-item label="分销商用户id(三级)" name="thirdUserId">
<a-input
allow-clear
placeholder="请输入分销商用户id(三级)"
v-model:value="form.thirdUserId"
/>
</a-form-item>
<a-form-item label="分销佣金(一级)" name="firstMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(一级)"
v-model:value="form.firstMoney"
/>
</a-form-item>
<a-form-item label="分销佣金(二级)" name="secondMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(二级)"
v-model:value="form.secondMoney"
/>
</a-form-item>
<a-form-item label="分销佣金(三级)" name="thirdMoney">
<a-input
allow-clear
placeholder="请输入分销佣金(三级)"
v-model:value="form.thirdMoney"
/>
</a-form-item>
<a-form-item label="单价" name="price">
<a-input
allow-clear
placeholder="请输入单价"
v-model:value="form.price"
/>
</a-form-item>
<a-form-item label="订单总金额" name="orderPrice">
<a-input
allow-clear
placeholder="请输入订单总金额"
v-model:value="form.orderPrice"
/>
</a-form-item>
<a-form-item label="结算金额" name="settledPrice">
<a-input
allow-clear
placeholder="请输入结算金额"
v-model:value="form.settledPrice"
/>
</a-form-item>
<a-form-item label="换算成度" name="degreePrice">
<a-input
allow-clear
placeholder="请输入换算成度"
v-model:value="form.degreePrice"
/>
</a-form-item>
<a-form-item label="实发金额" name="payPrice">
<a-input
allow-clear
placeholder="请输入实发金额"
v-model:value="form.payPrice"
/>
</a-form-item>
<a-form-item label="税率" name="rate">
<a-input
allow-clear
placeholder="请输入税率"
v-model:value="form.rate"
/>
</a-form-item>
<a-form-item label="结算月份" name="month">
<a-input
allow-clear
placeholder="请输入结算月份"
v-model:value="form.month"
/>
</a-form-item>
<a-form-item label="订单是否失效(0未失效 1已失效)" name="isInvalid">
<a-input
allow-clear
placeholder="请输入订单是否失效(0未失效 1已失效)"
v-model:value="form.isInvalid"
/>
</a-form-item>
<a-form-item label="佣金结算(0未结算 1已结算)" name="isSettled">
<a-input
allow-clear
placeholder="请输入佣金结算(0未结算 1已结算)"
v-model:value="form.isSettled"
/>
</a-form-item>
<a-form-item label="结算时间" name="settleTime">
<a-input
allow-clear
placeholder="请输入结算时间"
v-model:value="form.settleTime"
/>
</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="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</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 { addClinicVisitRecord, updateClinicVisitRecord } from '@/api/clinic/clinicVisitRecord';
import { ClinicVisitRecord } from '@/api/clinic/clinicVisitRecord/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?: ClinicVisitRecord | 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<ClinicVisitRecord>({
id: undefined,
userId: undefined,
orderNo: undefined,
firstUserId: undefined,
secondUserId: undefined,
thirdUserId: undefined,
firstMoney: undefined,
secondMoney: undefined,
thirdMoney: undefined,
price: undefined,
orderPrice: undefined,
settledPrice: undefined,
degreePrice: undefined,
payPrice: undefined,
rate: undefined,
month: undefined,
isInvalid: undefined,
isSettled: undefined,
settleTime: undefined,
comments: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
clinicVisitRecordId: undefined,
clinicVisitRecordName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
clinicVisitRecordName: [
{
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 ? updateClinicVisitRecord : addClinicVisitRecord;
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,352 +0,0 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="clinicVisitRecordId"
: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>
<!-- 编辑弹窗 -->
<ClinicVisitRecordEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } 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 {getPageTitle} from '@/utils/common';
import ClinicVisitRecordEdit from './components/clinicVisitRecordEdit.vue';
import { pageClinicVisitRecord, removeClinicVisitRecord, removeBatchClinicVisitRecord } from '@/api/clinic/clinicVisitRecord';
import type { ClinicVisitRecord, ClinicVisitRecordParam } from '@/api/clinic/clinicVisitRecord/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ClinicVisitRecord[]>([]);
// 当前编辑数据
const current = ref<ClinicVisitRecord | 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 pageClinicVisitRecord({
...where,
...orders,
page,
limit
});
};
// 完整的列配置(包含所有字段)
const allColumns = ref<ColumnItem[]>([
{
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '买家用户ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
ellipsis: true
},
{
title: '分销商用户id(一级)',
dataIndex: 'firstUserId',
key: 'firstUserId',
width: 120
},
{
title: '分销商用户id(二级)',
dataIndex: 'secondUserId',
key: 'secondUserId',
width: 120
},
{
title: '分销商用户id(三级)',
dataIndex: 'thirdUserId',
key: 'thirdUserId',
width: 120
},
{
title: '分销佣金(一级)',
dataIndex: 'firstMoney',
key: 'firstMoney',
width: 120
},
{
title: '分销佣金(二级)',
dataIndex: 'secondMoney',
key: 'secondMoney',
width: 120
},
{
title: '分销佣金(三级)',
dataIndex: 'thirdMoney',
key: 'thirdMoney',
width: 120
},
{
title: '单价',
dataIndex: 'price',
key: 'price',
width: 120
},
{
title: '订单总金额',
dataIndex: 'orderPrice',
key: 'orderPrice',
width: 120
},
{
title: '结算金额',
dataIndex: 'settledPrice',
key: 'settledPrice',
width: 120
},
{
title: '换算成度',
dataIndex: 'degreePrice',
key: 'degreePrice',
width: 120
},
{
title: '实发金额',
dataIndex: 'payPrice',
key: 'payPrice',
width: 120
},
{
title: '税率',
dataIndex: 'rate',
key: 'rate',
width: 120
},
{
title: '结算月份',
dataIndex: 'month',
key: 'month',
ellipsis: true
},
{
title: '订单是否失效(0未失效 1已失效)',
dataIndex: 'isInvalid',
key: 'isInvalid',
width: 120
},
{
title: '佣金结算(0未结算 1已结算)',
dataIndex: 'isSettled',
key: 'isSettled',
width: 120
},
{
title: '结算时间',
dataIndex: 'settleTime',
key: 'settleTime',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
// 默认显示的核心列最多5个主要字段
const defaultVisibleColumns = [
'id',
'createTime',
'action'
];
// 根据默认可见列过滤显示的列
const columns = computed(() => {
return allColumns.value.filter(col =>
defaultVisibleColumns.includes(col.dataIndex) || col.key === 'action'
);
});
/* 搜索 */
const reload = (where?: ClinicVisitRecordParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ClinicVisitRecord) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: ClinicVisitRecord) => {
const hide = message.loading('请求中..', 0);
removeClinicVisitRecord(row.clinicVisitRecordId)
.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);
removeBatchClinicVisitRecord(selection.value.map((d) => d.clinicVisitRecordId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ClinicVisitRecord) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'ClinicVisitRecord'
};
</script>
<style lang="less" scoped></style>

View File

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

View File

@@ -1,39 +0,0 @@
import type { PageParam } from '@/api/index';
/**
* 挂号
*/
export interface ClinicAppointment {
// 主键ID
id?: number;
// 类型
type?: number;
// 就诊原因
reason?: string;
// 挂号时间
evaluateTime?: string;
// 医生
doctorId?: number;
// 患者
userId?: number;
// 备注
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,101 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api/index';
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.code === 0) {
return res.data;
}
return Promise.reject(new Error(res.message));
}
/**
* 查询医生入驻申请列表
*/
export async function listClinicDoctorApply(params?: ClinicDoctorApplyParam) {
const res = await request.get<ApiResult<ClinicDoctorApply[]>>(
'/clinic/clinic-doctor-apply',
params
);
if (res.code === 0 && res.data) {
return res.data;
}
return Promise.reject(new Error(res.message));
}
/**
* 添加医生入驻申请
*/
export async function addClinicDoctorApply(data: ClinicDoctorApply) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-doctor-apply',
data
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 修改医生入驻申请
*/
export async function updateClinicDoctorApply(data: ClinicDoctorApply) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-doctor-apply',
data
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 删除医生入驻申请
*/
export async function removeClinicDoctorApply(id?: number) {
const res = await request.del<ApiResult<unknown>>(
'/clinic/clinic-doctor-apply/' + id
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 批量删除医生入驻申请
*/
export async function removeBatchClinicDoctorApply(data: (number | undefined)[]) {
const res = await request.del<ApiResult<unknown>>(
'/clinic/clinic-doctor-apply/batch',
{
data
}
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 根据id查询医生入驻申请
*/
export async function getClinicDoctorApply(id: number) {
const res = await request.get<ApiResult<ClinicDoctorApply>>(
'/clinic/clinic-doctor-apply/' + id
);
if (res.code === 0 && res.data) {
return res.data;
}
return Promise.reject(new Error(res.message));
}

View File

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

View File

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

View File

@@ -1,59 +0,0 @@
import type { PageParam } from '@/api/index';
/**
* 分销商用户记录表
*/
export interface ClinicDoctorUser {
// 主键ID
id?: number;
// 类型 0经销商 1企业 2集团
type?: number;
// 自增ID
userId?: number;
// 姓名
realName?: string;
// 手机号
mobile?: string;
// 支付密码
payPassword?: string;
// 当前可提现佣金
money?: string;
// 已冻结佣金
freezeMoney?: string;
// 累积提现佣金
totalMoney?: string;
// 收益基数
rate?: string;
// 单价
price?: string;
// 推荐人用户ID
refereeId?: number;
// 成员数量(一级)
firstNum?: number;
// 成员数量(二级)
secondNum?: number;
// 成员数量(三级)
thirdNum?: 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,101 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api/index';
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.code === 0) {
return res.data;
}
return Promise.reject(new Error(res.message));
}
/**
* 查询病例列表
*/
export async function listClinicMedicalHistory(params?: ClinicMedicalHistoryParam) {
const res = await request.get<ApiResult<ClinicMedicalHistory[]>>(
'/clinic/clinic-medical-history',
params
);
if (res.code === 0 && res.data) {
return res.data;
}
return Promise.reject(new Error(res.message));
}
/**
* 添加病例
*/
export async function addClinicMedicalHistory(data: ClinicMedicalHistory) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-medical-history',
data
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 修改病例
*/
export async function updateClinicMedicalHistory(data: ClinicMedicalHistory) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-medical-history',
data
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 删除病例
*/
export async function removeClinicMedicalHistory(id?: number) {
const res = await request.del<ApiResult<unknown>>(
'/clinic/clinic-medical-history/' + id
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 批量删除病例
*/
export async function removeBatchClinicMedicalHistory(data: (number | undefined)[]) {
const res = await request.del<ApiResult<unknown>>(
'/clinic/clinic-medical-history/batch',
{
data
}
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 根据id查询病例
*/
export async function getClinicMedicalHistory(id: number) {
const res = await request.get<ApiResult<ClinicMedicalHistory>>(
'/clinic/clinic-medical-history/' + id
);
if (res.code === 0 && res.data) {
return res.data;
}
return Promise.reject(new Error(res.message));
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,59 +0,0 @@
import type { PageParam } from '@/api/index';
/**
* 患者
*/
export interface ClinicPatientUser {
// 主键ID
id?: number;
// 类型 0经销商 1企业 2集团
type?: number;
// 自增ID
userId?: number;
// 姓名
realName?: string;
// 手机号
mobile?: string;
// 支付密码
payPassword?: string;
// 当前可提现佣金
money?: string;
// 已冻结佣金
freezeMoney?: string;
// 累积提现佣金
totalMoney?: string;
// 收益基数
rate?: string;
// 单价
price?: string;
// 推荐人用户ID
refereeId?: number;
// 成员数量(一级)
firstNum?: number;
// 成员数量(二级)
secondNum?: number;
// 成员数量(三级)
thirdNum?: number;
// 专属二维码
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,108 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api/index';
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.code === 0) {
return res.data;
}
return Promise.reject(new Error(res.message));
}
/**
* 查询处方主表
列表
*/
export async function listClinicPrescription(params?: ClinicPrescriptionParam) {
const res = await request.get<ApiResult<ClinicPrescription[]>>(
'/clinic/clinic-prescription',
params
);
if (res.code === 0 && res.data) {
return res.data;
}
return Promise.reject(new Error(res.message));
}
/**
* 添加处方主表
*/
export async function addClinicPrescription(data: ClinicPrescription) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-prescription',
data
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 修改处方主表
*/
export async function updateClinicPrescription(data: ClinicPrescription) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-prescription',
data
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 删除处方主表
*/
export async function removeClinicPrescription(id?: number) {
const res = await request.del<ApiResult<unknown>>(
'/clinic/clinic-prescription/' + id
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 批量删除处方主表
*/
export async function removeBatchClinicPrescription(data: (number | undefined)[]) {
const res = await request.del<ApiResult<unknown>>(
'/clinic/clinic-prescription/batch',
{
data
}
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 根据id查询处方主表
*/
export async function getClinicPrescription(id: number) {
const res = await request.get<ApiResult<ClinicPrescription>>(
'/clinic/clinic-prescription/' + id
);
if (res.code === 0 && res.data) {
return res.data;
}
return Promise.reject(new Error(res.message));
}

View File

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

View File

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

View File

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

View File

@@ -1,61 +0,0 @@
import type { PageParam } from '@/api/index';
/**
* 病例
*/
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,4 +0,0 @@
export default definePageConfig({
navigationBarTitleText: '新增挂号',
navigationBarTextStyle: 'black'
})

View File

@@ -1,98 +0,0 @@
import {useEffect, useState, useRef} from "react";
import {useRouter} from '@tarojs/taro'
import {Button, Loading, CellGroup, Input, TextArea, Form} from '@nutui/nutui-react-taro'
import Taro from '@tarojs/taro'
import {View} from '@tarojs/components'
import {ClinicAppointment} from "@/api/clinic/clinicAppointment/model";
import {getClinicAppointment, listClinicAppointment, updateClinicAppointment, addClinicAppointment} from "@/api/clinic/clinicAppointment";
const AddClinicAppointment = () => {
const {params} = useRouter();
const [loading, setLoading] = useState<boolean>(true)
const [FormData, setFormData] = useState<ClinicAppointment>({})
const formRef = useRef<any>(null)
const reload = async () => {
if (params.id) {
const data = await getClinicAppointment(Number(params.id))
setFormData(data)
} else {
setFormData({})
}
}
// 提交表单
const submitSucceed = async (values: any) => {
try {
if (params.id) {
// 编辑模式
await updateClinicAppointment({
...values,
id: Number(params.id)
})
} else {
// 新增模式
await addClinicAppointment(values)
}
Taro.showToast({
title: `操作成功`,
icon: 'success'
})
setTimeout(() => {
return Taro.navigateBack()
}, 1000)
} catch (error) {
Taro.showToast({
title: `操作失败`,
icon: 'error'
});
}
}
const submitFailed = (error: any) => {
console.log(error, 'err...')
}
useEffect(() => {
reload().then(() => {
setLoading(false)
})
}, []);
if (loading) {
return <Loading className={'px-2'}></Loading>
}
return (
<>
<Form
ref={formRef}
divider
initialValues={FormData}
labelPosition="left"
onFinish={(values) => submitSucceed(values)}
onFinishFailed={(errors) => submitFailed(errors)}
footer={
<div
style={{
display: 'flex',
justifyContent: 'center',
width: '100%'
}}
>
<Button
nativeType="submit"
type="success"
size="large"
className={'w-full'}
block
>
{params.id ? '更新' : '保存'}
</Button>
</div>
}
>
<CellGroup style={{padding: '4px 0'}}>
<Form.Item name="type" label="类型" initialValue={FormData.type} required>

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