feat(clinic): 添加诊所相关API接口和数据模型
- 添加挂号管理接口和数据模型- 添加医生入驻申请接口和数据模型- 添加医疗记录接口和数据模型- 添加分销商用户记录接口和数据模型- 添加病例管理接口和数据模型 - 添加药品库接口和数据模型 - 添加药品出入库接口和数据模型 - 添加药品库存接口和数据模型- 添加处方订单接口和数据模型 - 修改开发环境API基础URL为本地地址
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
export const ENV_CONFIG = {
|
export const ENV_CONFIG = {
|
||||||
// 开发环境
|
// 开发环境
|
||||||
development: {
|
development: {
|
||||||
API_BASE_URL: 'https://cms-api.websoft.top/api',
|
API_BASE_URL: 'http://127.0.0.1:9200/api',
|
||||||
APP_NAME: '开发环境',
|
APP_NAME: '开发环境',
|
||||||
DEBUG: 'true',
|
DEBUG: 'true',
|
||||||
},
|
},
|
||||||
|
|||||||
101
src/api/clinic/clinicAppointment/index.ts
Normal file
101
src/api/clinic/clinicAppointment/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
39
src/api/clinic/clinicAppointment/model/index.ts
Normal file
39
src/api/clinic/clinicAppointment/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicDoctorApply/index.ts
Normal file
101
src/api/clinic/clinicDoctorApply/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
75
src/api/clinic/clinicDoctorApply/model/index.ts
Normal file
75
src/api/clinic/clinicDoctorApply/model/index.ts
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicDoctorMedicalRecord/index.ts
Normal file
101
src/api/clinic/clinicDoctorMedicalRecord/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
61
src/api/clinic/clinicDoctorMedicalRecord/model/index.ts
Normal file
61
src/api/clinic/clinicDoctorMedicalRecord/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicDoctorUser/index.ts
Normal file
101
src/api/clinic/clinicDoctorUser/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
59
src/api/clinic/clinicDoctorUser/model/index.ts
Normal file
59
src/api/clinic/clinicDoctorUser/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicMedicalHistory/index.ts
Normal file
101
src/api/clinic/clinicMedicalHistory/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
61
src/api/clinic/clinicMedicalHistory/model/index.ts
Normal file
61
src/api/clinic/clinicMedicalHistory/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicMedicine/index.ts
Normal file
101
src/api/clinic/clinicMedicine/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
43
src/api/clinic/clinicMedicine/model/index.ts
Normal file
43
src/api/clinic/clinicMedicine/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicMedicineInout/index.ts
Normal file
101
src/api/clinic/clinicMedicineInout/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
61
src/api/clinic/clinicMedicineInout/model/index.ts
Normal file
61
src/api/clinic/clinicMedicineInout/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicMedicineStock/index.ts
Normal file
101
src/api/clinic/clinicMedicineStock/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
35
src/api/clinic/clinicMedicineStock/model/index.ts
Normal file
35
src/api/clinic/clinicMedicineStock/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicOrder/index.ts
Normal file
101
src/api/clinic/clinicOrder/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
167
src/api/clinic/clinicOrder/model/index.ts
Normal file
167
src/api/clinic/clinicOrder/model/index.ts
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicPatientUser/index.ts
Normal file
101
src/api/clinic/clinicPatientUser/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
59
src/api/clinic/clinicPatientUser/model/index.ts
Normal file
59
src/api/clinic/clinicPatientUser/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
108
src/api/clinic/clinicPrescription/index.ts
Normal file
108
src/api/clinic/clinicPrescription/index.ts
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
57
src/api/clinic/clinicPrescription/model/index.ts
Normal file
57
src/api/clinic/clinicPrescription/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
108
src/api/clinic/clinicPrescriptionItem/index.ts
Normal file
108
src/api/clinic/clinicPrescriptionItem/index.ts
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
49
src/api/clinic/clinicPrescriptionItem/model/index.ts
Normal file
49
src/api/clinic/clinicPrescriptionItem/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicReport/index.ts
Normal file
101
src/api/clinic/clinicReport/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
61
src/api/clinic/clinicReport/model/index.ts
Normal file
61
src/api/clinic/clinicReport/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
101
src/api/clinic/clinicVisitRecord/index.ts
Normal file
101
src/api/clinic/clinicVisitRecord/index.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
61
src/api/clinic/clinicVisitRecord/model/index.ts
Normal file
61
src/api/clinic/clinicVisitRecord/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -60,4 +60,5 @@ export interface Config {
|
|||||||
deliveryText?: string;
|
deliveryText?: string;
|
||||||
guaranteeText?: string;
|
guaranteeText?: string;
|
||||||
openComments?: string;
|
openComments?: string;
|
||||||
|
apiUrl?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { PageParam } from '@/api/index';
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分销商订单记录表
|
* 分销商订单记录表
|
||||||
@@ -6,6 +6,8 @@ import type { PageParam } from '@/api/index';
|
|||||||
export interface ShopDealerOrder {
|
export interface ShopDealerOrder {
|
||||||
// 主键ID
|
// 主键ID
|
||||||
id?: number;
|
id?: number;
|
||||||
|
// 订单标题
|
||||||
|
title?: string;
|
||||||
// 买家用户ID
|
// 买家用户ID
|
||||||
userId?: number;
|
userId?: number;
|
||||||
// 订单ID
|
// 订单ID
|
||||||
@@ -14,10 +16,16 @@ export interface ShopDealerOrder {
|
|||||||
orderPrice?: string;
|
orderPrice?: string;
|
||||||
// 分销商用户id(一级)
|
// 分销商用户id(一级)
|
||||||
firstUserId?: number;
|
firstUserId?: number;
|
||||||
|
// 分销商昵称(一级)
|
||||||
|
firstNickname?: string;
|
||||||
// 分销商用户id(二级)
|
// 分销商用户id(二级)
|
||||||
secondUserId?: number;
|
secondUserId?: number;
|
||||||
|
// 分销商昵称(二级)
|
||||||
|
secondNickname?: string;
|
||||||
// 分销商用户id(三级)
|
// 分销商用户id(三级)
|
||||||
thirdUserId?: number;
|
thirdUserId?: number;
|
||||||
|
// 分销商昵称(三级)
|
||||||
|
thirdNickname?: string;
|
||||||
// 分销佣金(一级)
|
// 分销佣金(一级)
|
||||||
firstMoney?: string;
|
firstMoney?: string;
|
||||||
// 分销佣金(二级)
|
// 分销佣金(二级)
|
||||||
@@ -47,5 +55,6 @@ export interface ShopDealerOrderParam extends PageParam {
|
|||||||
secondUserId?: number;
|
secondUserId?: number;
|
||||||
thirdUserId?: number;
|
thirdUserId?: number;
|
||||||
userId?: number;
|
userId?: number;
|
||||||
|
orderNo?: string;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
105
src/api/shop/shopDealerRecord/index.ts
Normal file
105
src/api/shop/shopDealerRecord/index.ts
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { ShopDealerRecord, ShopDealerRecordParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询客户跟进情况
|
||||||
|
*/
|
||||||
|
export async function pageShopDealerRecord(params: ShopDealerRecordParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<ShopDealerRecord>>>(
|
||||||
|
'/shop/shop-dealer-record/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.code === 0) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户跟进情况列表
|
||||||
|
*/
|
||||||
|
export async function listShopDealerRecord(params?: ShopDealerRecordParam) {
|
||||||
|
const res = await request.get<ApiResult<ShopDealerRecord[]>>(
|
||||||
|
'/shop/shop-dealer-record',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加客户跟进情况
|
||||||
|
*/
|
||||||
|
export async function addShopDealerRecord(data: ShopDealerRecord) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/shop/shop-dealer-record',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.code === 0) {
|
||||||
|
return res.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户跟进情况
|
||||||
|
*/
|
||||||
|
export async function updateShopDealerRecord(data: ShopDealerRecord) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/shop/shop-dealer-record',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.code === 0) {
|
||||||
|
return res.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户跟进情况
|
||||||
|
*/
|
||||||
|
export async function removeShopDealerRecord(id?: number) {
|
||||||
|
const res = await request.del<ApiResult<unknown>>(
|
||||||
|
'/shop/shop-dealer-record/' + id
|
||||||
|
);
|
||||||
|
if (res.code === 0) {
|
||||||
|
return res.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户跟进情况
|
||||||
|
*/
|
||||||
|
export async function removeBatchShopDealerRecord(data: (number | undefined)[]) {
|
||||||
|
const res = await request.del<ApiResult<unknown>>(
|
||||||
|
'/shop/shop-dealer-record/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.code === 0) {
|
||||||
|
return res.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询客户跟进情况
|
||||||
|
*/
|
||||||
|
export async function getShopDealerRecord(id: number) {
|
||||||
|
const res = await request.get<ApiResult<ShopDealerRecord>>(
|
||||||
|
'/shop/shop-dealer-record/' + id
|
||||||
|
);
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
39
src/api/shop/shopDealerRecord/model/index.ts
Normal file
39
src/api/shop/shopDealerRecord/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户跟进情况
|
||||||
|
*/
|
||||||
|
export interface ShopDealerRecord {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 上级id, 0是顶级
|
||||||
|
parentId?: number;
|
||||||
|
// 客户ID
|
||||||
|
dealerId?: number;
|
||||||
|
// 内容
|
||||||
|
content?: string;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 状态, 0待处理, 1已完成
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户跟进情况搜索条件
|
||||||
|
*/
|
||||||
|
export interface ShopDealerRecordParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -8,9 +8,7 @@ import type { ShopUser, ShopUserParam } from './model';
|
|||||||
export async function pageShopUser(params: ShopUserParam) {
|
export async function pageShopUser(params: ShopUserParam) {
|
||||||
const res = await request.get<ApiResult<PageResult<ShopUser>>>(
|
const res = await request.get<ApiResult<PageResult<ShopUser>>>(
|
||||||
'/shop/shop-user/page',
|
'/shop/shop-user/page',
|
||||||
{
|
|
||||||
params
|
params
|
||||||
}
|
|
||||||
);
|
);
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -24,9 +22,7 @@ export async function pageShopUser(params: ShopUserParam) {
|
|||||||
export async function listShopUser(params?: ShopUserParam) {
|
export async function listShopUser(params?: ShopUserParam) {
|
||||||
const res = await request.get<ApiResult<ShopUser[]>>(
|
const res = await request.get<ApiResult<ShopUser[]>>(
|
||||||
'/shop/shop-user',
|
'/shop/shop-user',
|
||||||
{
|
|
||||||
params
|
params
|
||||||
}
|
|
||||||
);
|
);
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export default {
|
|||||||
'pages/cart/cart',
|
'pages/cart/cart',
|
||||||
'pages/find/find',
|
'pages/find/find',
|
||||||
'pages/user/user',
|
'pages/user/user',
|
||||||
'pages/category/category'
|
'pages/chat/chat'
|
||||||
],
|
],
|
||||||
"subpackages": [
|
"subpackages": [
|
||||||
{
|
{
|
||||||
@@ -76,6 +76,7 @@ export default {
|
|||||||
"root": "doctor",
|
"root": "doctor",
|
||||||
"pages": [
|
"pages": [
|
||||||
"index",
|
"index",
|
||||||
|
"apply/index",
|
||||||
"apply/add",
|
"apply/add",
|
||||||
"withdraw/index",
|
"withdraw/index",
|
||||||
"orders/index",
|
"orders/index",
|
||||||
@@ -89,6 +90,13 @@ export default {
|
|||||||
"customer/trading",
|
"customer/trading",
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"root": "clinic",
|
||||||
|
"pages": [
|
||||||
|
"clinicPatientUser/add",
|
||||||
|
"clinicDoctorUser/add"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"root": "shop",
|
"root": "shop",
|
||||||
"pages": [
|
"pages": [
|
||||||
@@ -127,10 +135,10 @@ export default {
|
|||||||
text: "首页",
|
text: "首页",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pagePath: "pages/category/category",
|
pagePath: "pages/chat/chat",
|
||||||
iconPath: "assets/tabbar/category.png",
|
iconPath: "assets/tabbar/chat.png",
|
||||||
selectedIconPath: "assets/tabbar/category-active.png",
|
selectedIconPath: "assets/tabbar/chat-active.png",
|
||||||
text: "分类",
|
text: "咨询",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pagePath: "pages/cart/cart",
|
pagePath: "pages/cart/cart",
|
||||||
|
|||||||
20
src/app.ts
20
src/app.ts
@@ -7,7 +7,8 @@ import {loginByOpenId} from "@/api/layout";
|
|||||||
import {TenantId} from "@/config/app";
|
import {TenantId} from "@/config/app";
|
||||||
import {saveStorageByLoginUser} from "@/utils/server";
|
import {saveStorageByLoginUser} from "@/utils/server";
|
||||||
import {parseInviteParams, saveInviteParams, trackInviteSource, handleInviteRelation} from "@/utils/invite";
|
import {parseInviteParams, saveInviteParams, trackInviteSource, handleInviteRelation} from "@/utils/invite";
|
||||||
import { useConfig } from "@/hooks/useConfig"; // 引入新的自定义Hook
|
import {useConfig} from "@/hooks/useConfig";
|
||||||
|
import {addShopUser, getShopUser} from "@/api/shop/shopUser"; // 引入新的自定义Hook
|
||||||
|
|
||||||
function App(props: { children: any; }) {
|
function App(props: { children: any; }) {
|
||||||
const {refetch: handleTheme} = useConfig(); // 使用新的Hook
|
const {refetch: handleTheme} = useConfig(); // 使用新的Hook
|
||||||
@@ -15,6 +16,7 @@ function App(props: { children: any; }) {
|
|||||||
const reload = () => {
|
const reload = () => {
|
||||||
Taro.login({
|
Taro.login({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
// 无感登录
|
||||||
loginByOpenId({
|
loginByOpenId({
|
||||||
code: res.code,
|
code: res.code,
|
||||||
tenantId: TenantId
|
tenantId: TenantId
|
||||||
@@ -33,6 +35,22 @@ function App(props: { children: any; }) {
|
|||||||
console.error('自动登录时处理邀请关系失败:', error)
|
console.error('自动登录时处理邀请关系失败:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 同步注册shopUser
|
||||||
|
getShopUser(data.user.userId).then(shopUser => {
|
||||||
|
console.log(shopUser,'shopUser')
|
||||||
|
}).catch(() => {
|
||||||
|
addShopUser({
|
||||||
|
userId: data.user.userId,
|
||||||
|
username: data.user.username,
|
||||||
|
nickname: data.user.nickname,
|
||||||
|
avatar: data.user.avatarUrl,
|
||||||
|
sex: data.user.gender,
|
||||||
|
country: data.user.country,
|
||||||
|
province: data.user.province,
|
||||||
|
city: data.user.city,
|
||||||
|
phone: data.user.phone
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
src/assets/tabbar/chat-active.png
Normal file
BIN
src/assets/tabbar/chat-active.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
src/assets/tabbar/chat.png
Normal file
BIN
src/assets/tabbar/chat.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
4
src/clinic/clinicAppointment/add.config.ts
Normal file
4
src/clinic/clinicAppointment/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增挂号',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicAppointment/add.tsx
Normal file
98
src/clinic/clinicAppointment/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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>
|
||||||
4
src/clinic/clinicAppointment/index.config.ts
Normal file
4
src/clinic/clinicAppointment/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '挂号管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
64
src/clinic/clinicAppointment/index.tsx
Normal file
64
src/clinic/clinicAppointment/index.tsx
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicAppointment} from "@/api/clinic/clinicAppointment/model";
|
||||||
|
import {listClinicAppointment, removeClinicAppointment, updateClinicAppointment} from "@/api/clinic/clinicAppointment";
|
||||||
|
|
||||||
|
const ClinicAppointmentList = () => {
|
||||||
|
const [list, setList] = useState<ClinicAppointment[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicAppointment({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicAppointment(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicAppointment/add'})}>新增挂号</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
4
src/clinic/clinicDoctorApply/add.config.ts
Normal file
4
src/clinic/clinicDoctorApply/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '账号申请',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
433
src/clinic/clinicDoctorApply/add.tsx
Normal file
433
src/clinic/clinicDoctorApply/add.tsx
Normal file
@@ -0,0 +1,433 @@
|
|||||||
|
import {useEffect, useState, useRef} from "react";
|
||||||
|
import {Loading, CellGroup, Input, Form, Avatar, Button, Space} from '@nutui/nutui-react-taro'
|
||||||
|
import {Edit} from '@nutui/icons-react-taro'
|
||||||
|
import Taro from '@tarojs/taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import FixedButton from "@/components/FixedButton";
|
||||||
|
import {useUser} from "@/hooks/useUser";
|
||||||
|
import {TenantId} from "@/config/app";
|
||||||
|
import {updateUser} from "@/api/system/user";
|
||||||
|
import {User} from "@/api/system/user/model";
|
||||||
|
import {getStoredInviteParams, handleInviteRelation} from "@/utils/invite";
|
||||||
|
import {addShopDealerUser} from "@/api/shop/shopDealerUser";
|
||||||
|
import {listUserRole, updateUserRole} from "@/api/system/userRole";
|
||||||
|
|
||||||
|
// 类型定义
|
||||||
|
interface ChooseAvatarEvent {
|
||||||
|
detail: {
|
||||||
|
avatarUrl: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface InputEvent {
|
||||||
|
detail: {
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddUserAddress = () => {
|
||||||
|
const {user, loginUser} = useUser()
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<User>()
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
const inviteParams = getStoredInviteParams()
|
||||||
|
if (inviteParams?.inviter) {
|
||||||
|
setFormData({
|
||||||
|
...user,
|
||||||
|
refereeId: Number(inviteParams.inviter),
|
||||||
|
// 清空昵称,强制用户手动输入
|
||||||
|
nickname: '',
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 如果没有邀请参数,也要确保昵称为空
|
||||||
|
setFormData({
|
||||||
|
...user,
|
||||||
|
nickname: '',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const uploadAvatar = ({detail}: ChooseAvatarEvent) => {
|
||||||
|
// 先更新本地显示的头像(临时显示)
|
||||||
|
const tempFormData = {
|
||||||
|
...FormData,
|
||||||
|
avatar: `${detail.avatarUrl}`,
|
||||||
|
}
|
||||||
|
setFormData(tempFormData)
|
||||||
|
|
||||||
|
Taro.uploadFile({
|
||||||
|
url: 'https://server.websoft.top/api/oss/upload',
|
||||||
|
filePath: detail.avatarUrl,
|
||||||
|
name: 'file',
|
||||||
|
header: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
TenantId
|
||||||
|
},
|
||||||
|
success: async (res) => {
|
||||||
|
const data = JSON.parse(res.data);
|
||||||
|
if (data.code === 0) {
|
||||||
|
const finalAvatarUrl = `${data.data.thumbnail}`
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 使用 useUser hook 的 updateUser 方法更新头像
|
||||||
|
await updateUser({
|
||||||
|
avatar: finalAvatarUrl
|
||||||
|
})
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: '头像上传成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.error('更新用户头像失败:', error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 无论用户信息更新是否成功,都要更新本地FormData
|
||||||
|
const finalFormData = {
|
||||||
|
...tempFormData,
|
||||||
|
avatar: finalAvatarUrl
|
||||||
|
}
|
||||||
|
setFormData(finalFormData)
|
||||||
|
|
||||||
|
// 同步更新表单字段
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
avatar: finalAvatarUrl
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 上传失败,恢复原来的头像
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
avatar: user?.avatar || ''
|
||||||
|
})
|
||||||
|
Taro.showToast({
|
||||||
|
title: '上传失败',
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('上传头像失败:', error)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '上传失败',
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
// 恢复原来的头像
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
avatar: user?.avatar || ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
// 验证必填字段
|
||||||
|
if (!values.phone && !FormData?.phone) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请先获取手机号',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证昵称:必须填写且不能是默认的微信昵称
|
||||||
|
const nickname = values.realName || FormData?.nickname || '';
|
||||||
|
if (!nickname || nickname.trim() === '') {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写昵称',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否为默认的微信昵称(常见的默认昵称)
|
||||||
|
const defaultNicknames = ['微信用户', 'WeChat User', '微信昵称'];
|
||||||
|
if (defaultNicknames.includes(nickname.trim())) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写真实昵称,不能使用默认昵称',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证昵称长度
|
||||||
|
if (nickname.trim().length < 2) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '昵称至少需要2个字符',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!values.avatar && !FormData?.avatar) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请上传头像',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log(values,FormData)
|
||||||
|
|
||||||
|
const roles = await listUserRole({userId: user?.userId})
|
||||||
|
console.log(roles, 'roles...')
|
||||||
|
|
||||||
|
// 准备提交的数据
|
||||||
|
await updateUser({
|
||||||
|
userId: user?.userId,
|
||||||
|
nickname: values.realName || FormData?.nickname,
|
||||||
|
phone: values.phone || FormData?.phone,
|
||||||
|
avatar: values.avatar || FormData?.avatar,
|
||||||
|
refereeId: values.refereeId || FormData?.refereeId
|
||||||
|
});
|
||||||
|
|
||||||
|
await addShopDealerUser({
|
||||||
|
userId: user?.userId,
|
||||||
|
realName: values.realName || FormData?.nickname,
|
||||||
|
mobile: values.phone || FormData?.phone,
|
||||||
|
refereeId: values.refereeId || FormData?.refereeId
|
||||||
|
})
|
||||||
|
|
||||||
|
if (roles.length > 0) {
|
||||||
|
await updateUserRole({
|
||||||
|
...roles[0],
|
||||||
|
roleId: 1848
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: `注册成功`,
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
Taro.navigateBack();
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('验证邀请人失败:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取微信昵称
|
||||||
|
const getWxNickname = (nickname: string) => {
|
||||||
|
// 更新表单数据
|
||||||
|
const updatedFormData = {
|
||||||
|
...FormData,
|
||||||
|
nickname: nickname
|
||||||
|
}
|
||||||
|
setFormData(updatedFormData);
|
||||||
|
|
||||||
|
// 同步更新表单字段
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
realName: nickname
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 获取用户手机号 */
|
||||||
|
const handleGetPhoneNumber = ({detail}: { detail: { code?: string, encryptedData?: string, iv?: string } }) => {
|
||||||
|
const {code, encryptedData, iv} = detail
|
||||||
|
Taro.login({
|
||||||
|
success: (loginRes) => {
|
||||||
|
if (code) {
|
||||||
|
Taro.request({
|
||||||
|
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
authCode: loginRes.code,
|
||||||
|
code,
|
||||||
|
encryptedData,
|
||||||
|
iv,
|
||||||
|
notVerifyPhone: true,
|
||||||
|
refereeId: 0,
|
||||||
|
sceneType: 'save_referee',
|
||||||
|
tenantId: TenantId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
TenantId
|
||||||
|
},
|
||||||
|
success: async function (res) {
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 登录成功
|
||||||
|
const token = res.data.data.access_token;
|
||||||
|
const userData = res.data.data.user;
|
||||||
|
console.log(userData, 'userData...')
|
||||||
|
// 使用useUser Hook的loginUser方法更新状态
|
||||||
|
loginUser(token, userData);
|
||||||
|
|
||||||
|
if (userData.phone) {
|
||||||
|
console.log('手机号已获取', userData.phone)
|
||||||
|
const updatedFormData = {
|
||||||
|
...FormData,
|
||||||
|
phone: userData.phone,
|
||||||
|
// 不自动填充微信昵称,保持用户已输入的昵称
|
||||||
|
nickname: FormData?.nickname || '',
|
||||||
|
// 只在没有头像时才使用微信头像
|
||||||
|
avatar: FormData?.avatar || userData.avatar
|
||||||
|
}
|
||||||
|
setFormData(updatedFormData)
|
||||||
|
|
||||||
|
// 更新表单字段值
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
phone: userData.phone,
|
||||||
|
// 不覆盖用户已输入的昵称
|
||||||
|
realName: FormData?.nickname || '',
|
||||||
|
avatar: FormData?.avatar || userData.avatar
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: '手机号获取成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 处理邀请关系
|
||||||
|
if (userData?.userId) {
|
||||||
|
try {
|
||||||
|
const inviteSuccess = await handleInviteRelation(userData.userId)
|
||||||
|
if (inviteSuccess) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '邀请关系建立成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('处理邀请关系失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示登录成功提示
|
||||||
|
// Taro.showToast({
|
||||||
|
// title: '注册成功',
|
||||||
|
// icon: 'success',
|
||||||
|
// duration: 1500
|
||||||
|
// })
|
||||||
|
|
||||||
|
// 不需要重新启动小程序,状态已经通过useUser更新
|
||||||
|
// 可以选择性地刷新当前页面数据
|
||||||
|
// await reload();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('登录失败!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理固定按钮点击事件
|
||||||
|
const handleFixedButtonClick = () => {
|
||||||
|
// 触发表单提交
|
||||||
|
formRef.current?.submit();
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitFailed = (error: any) => {
|
||||||
|
console.log(error, 'err...')
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
reload().then(() => {
|
||||||
|
setLoading(false)
|
||||||
|
})
|
||||||
|
}, [user?.userId]); // 依赖用户ID,当用户变化时重新加载
|
||||||
|
|
||||||
|
// 当FormData变化时,同步更新表单字段值
|
||||||
|
useEffect(() => {
|
||||||
|
if (formRef.current && FormData) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
refereeId: FormData.refereeId,
|
||||||
|
phone: FormData.phone,
|
||||||
|
avatar: FormData.avatar,
|
||||||
|
realName: FormData.nickname
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [FormData]);
|
||||||
|
|
||||||
|
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)}
|
||||||
|
>
|
||||||
|
<View className={'bg-gray-100 h-3'}></View>
|
||||||
|
<CellGroup style={{padding: '4px 0'}}>
|
||||||
|
<Form.Item name="refereeId" label="邀请人ID" initialValue={FormData?.refereeId} required>
|
||||||
|
<Input placeholder="邀请人ID" disabled={true}/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item name="phone" label="手机号" initialValue={FormData?.phone} required>
|
||||||
|
<View className="flex items-center justify-between">
|
||||||
|
<Input
|
||||||
|
placeholder="请填写手机号"
|
||||||
|
disabled={true}
|
||||||
|
maxLength={11}
|
||||||
|
value={FormData?.phone || ''}
|
||||||
|
/>
|
||||||
|
<Button style={{color: '#ffffff'}} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
|
||||||
|
<Space>
|
||||||
|
<Button size="small">点击获取</Button>
|
||||||
|
</Space>
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
</Form.Item>
|
||||||
|
{
|
||||||
|
FormData?.phone && <Form.Item name="avatar" label="头像" initialValue={FormData?.avatar} required>
|
||||||
|
<Button open-type="chooseAvatar" style={{height: '58px'}} onChooseAvatar={uploadAvatar}>
|
||||||
|
<Avatar src={FormData?.avatar || user?.avatar} size="54"/>
|
||||||
|
</Button>
|
||||||
|
</Form.Item>
|
||||||
|
}
|
||||||
|
<Form.Item name="realName" label="昵称" initialValue="" required>
|
||||||
|
<Input
|
||||||
|
type="nickname"
|
||||||
|
className="info-content__input"
|
||||||
|
placeholder="请获取微信昵称"
|
||||||
|
value={FormData?.nickname || ''}
|
||||||
|
onInput={(e: InputEvent) => getWxNickname(e.detail.value)}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</CellGroup>
|
||||||
|
</Form>
|
||||||
|
|
||||||
|
{/* 底部浮动按钮 */}
|
||||||
|
<FixedButton
|
||||||
|
icon={<Edit/>}
|
||||||
|
text={'立即注册'}
|
||||||
|
onClick={handleFixedButtonClick}
|
||||||
|
/>
|
||||||
|
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AddUserAddress;
|
||||||
4
src/clinic/clinicDoctorMedicalRecord/add.config.ts
Normal file
4
src/clinic/clinicDoctorMedicalRecord/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增医疗记录',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicDoctorMedicalRecord/add.tsx
Normal file
98
src/clinic/clinicDoctorMedicalRecord/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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 {ClinicDoctorMedicalRecord} from "@/api/clinic/clinicDoctorMedicalRecord/model";
|
||||||
|
import {getClinicDoctorMedicalRecord, listClinicDoctorMedicalRecord, updateClinicDoctorMedicalRecord, addClinicDoctorMedicalRecord} from "@/api/clinic/clinicDoctorMedicalRecord";
|
||||||
|
|
||||||
|
const AddClinicDoctorMedicalRecord = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ClinicDoctorMedicalRecord>({})
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
if (params.id) {
|
||||||
|
const data = await getClinicDoctorMedicalRecord(Number(params.id))
|
||||||
|
setFormData(data)
|
||||||
|
} else {
|
||||||
|
setFormData({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
if (params.id) {
|
||||||
|
// 编辑模式
|
||||||
|
await updateClinicDoctorMedicalRecord({
|
||||||
|
...values,
|
||||||
|
id: Number(params.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addClinicDoctorMedicalRecord(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="userId" label="买家用户ID" initialValue={FormData.userId} required>
|
||||||
4
src/clinic/clinicDoctorMedicalRecord/index.config.ts
Normal file
4
src/clinic/clinicDoctorMedicalRecord/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '医疗记录管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
64
src/clinic/clinicDoctorMedicalRecord/index.tsx
Normal file
64
src/clinic/clinicDoctorMedicalRecord/index.tsx
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicDoctorMedicalRecord} from "@/api/clinic/clinicDoctorMedicalRecord/model";
|
||||||
|
import {listClinicDoctorMedicalRecord, removeClinicDoctorMedicalRecord, updateClinicDoctorMedicalRecord} from "@/api/clinic/clinicDoctorMedicalRecord";
|
||||||
|
|
||||||
|
const ClinicDoctorMedicalRecordList = () => {
|
||||||
|
const [list, setList] = useState<ClinicDoctorMedicalRecord[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicDoctorMedicalRecord({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicDoctorMedicalRecord(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicDoctorMedicalRecord/add'})}>新增医疗记录</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
4
src/clinic/clinicDoctorUser/add.config.ts
Normal file
4
src/clinic/clinicDoctorUser/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '中医师注册',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
325
src/clinic/clinicDoctorUser/add.tsx
Normal file
325
src/clinic/clinicDoctorUser/add.tsx
Normal file
@@ -0,0 +1,325 @@
|
|||||||
|
import {useEffect, useState} from "react";
|
||||||
|
import {Image} from '@nutui/nutui-react-taro'
|
||||||
|
import {ConfigProvider} from '@nutui/nutui-react-taro'
|
||||||
|
import Taro from '@tarojs/taro'
|
||||||
|
|
||||||
|
import {
|
||||||
|
Form,
|
||||||
|
Button,
|
||||||
|
Input,
|
||||||
|
Radio,
|
||||||
|
} from '@nutui/nutui-react-taro'
|
||||||
|
import {UserVerify} from "@/api/system/userVerify/model";
|
||||||
|
import {addUserVerify, myUserVerify, updateUserVerify} from "@/api/system/userVerify";
|
||||||
|
import {uploadFile} from "@/api/system/file";
|
||||||
|
|
||||||
|
function Index() {
|
||||||
|
const [isUpdate, setIsUpdate] = useState<boolean>(false)
|
||||||
|
const [submitText, setSubmitText] = useState<string>('提交')
|
||||||
|
|
||||||
|
const [FormData, setFormData] = useState<UserVerify>({
|
||||||
|
userId: undefined,
|
||||||
|
type: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
avatar: undefined,
|
||||||
|
realName: undefined,
|
||||||
|
idCard: undefined,
|
||||||
|
birthday: undefined,
|
||||||
|
sfz1: undefined,
|
||||||
|
sfz2: undefined,
|
||||||
|
zzCode: undefined,
|
||||||
|
zzImg: undefined,
|
||||||
|
status: undefined,
|
||||||
|
statusText: undefined,
|
||||||
|
comments: undefined
|
||||||
|
})
|
||||||
|
const reload = () => {
|
||||||
|
myUserVerify({}).then(data => {
|
||||||
|
if (data) {
|
||||||
|
setIsUpdate(true);
|
||||||
|
setFormData(data)
|
||||||
|
if(data.status == 2){
|
||||||
|
setSubmitText('重新提交')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setFormData({
|
||||||
|
type: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = (values: any) => {
|
||||||
|
console.log('提交表单', values);
|
||||||
|
if (FormData.status != 2 && FormData.status != undefined) return false;
|
||||||
|
if (FormData.type == 0) {
|
||||||
|
if (!FormData.sfz1 || !FormData.sfz2) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请上传身份证正反面',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!FormData.realName || !FormData.idCard) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写真实姓名和身份证号码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (FormData.type == 1) {
|
||||||
|
if (!FormData.zzImg) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请上传营业执照',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!FormData.name || !FormData.zzCode) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写主体名称和营业执照号码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!FormData.realName){
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写真实姓名',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const saveOrUpdate = isUpdate ? updateUserVerify : addUserVerify;
|
||||||
|
saveOrUpdate({...FormData, status: 0}).then(() => {
|
||||||
|
Taro.showToast({title: `提交成功`, icon: 'success'})
|
||||||
|
setTimeout(() => {
|
||||||
|
return Taro.navigateBack()
|
||||||
|
}, 1000)
|
||||||
|
}).catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '提交失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
}).finally(() => {
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const submitFailed = (error: any) => {
|
||||||
|
console.log(error, 'err...')
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploadSfz1 = () => {
|
||||||
|
if (FormData.status != 2 && FormData.status != undefined) return false;
|
||||||
|
uploadFile().then(data => {
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
sfz1: data.url
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploadSfz2 = () => {
|
||||||
|
if (FormData.status != 2 && FormData.status != undefined) return false;
|
||||||
|
uploadFile().then(data => {
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
sfz2: data.url
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const uploadZzImg = () => {
|
||||||
|
if (FormData.status != 2 && FormData.status != undefined) return false;
|
||||||
|
uploadFile().then(data => {
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
zzImg: data.url
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
reload()
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className={'p-4'}>
|
||||||
|
<ConfigProvider>
|
||||||
|
<Form
|
||||||
|
divider
|
||||||
|
initialValues={FormData}
|
||||||
|
labelPosition="left"
|
||||||
|
onFinish={(values) => submitSucceed(values)}
|
||||||
|
onFinishFailed={(errors) => submitFailed(errors)}
|
||||||
|
footer={
|
||||||
|
FormData.status != 1 && FormData.status != 0 && (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
|
width: '100%'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Button nativeType="submit" block type={'info'}
|
||||||
|
disabled={FormData.status != 2 && FormData.status != undefined}>
|
||||||
|
{submitText}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Form.Item
|
||||||
|
label="类型"
|
||||||
|
name="type"
|
||||||
|
initialValue={FormData.type}
|
||||||
|
required
|
||||||
|
>
|
||||||
|
<Radio.Group value={FormData?.type} direction="horizontal"
|
||||||
|
disabled={FormData.status != 2 && FormData.status != undefined}
|
||||||
|
onChange={(value) => setFormData({...FormData, type: value})}>
|
||||||
|
<Radio key={0} value={0}>
|
||||||
|
我是患者
|
||||||
|
</Radio>
|
||||||
|
<Radio key={1} value={1}>
|
||||||
|
我是医师
|
||||||
|
</Radio>
|
||||||
|
</Radio.Group>
|
||||||
|
</Form.Item>
|
||||||
|
{
|
||||||
|
// 个人类型
|
||||||
|
FormData.type == 0 && (
|
||||||
|
<>
|
||||||
|
<Form.Item
|
||||||
|
label={'真实姓名'}
|
||||||
|
name="realName"
|
||||||
|
required
|
||||||
|
initialValue={FormData.realName}
|
||||||
|
rules={[{message: '请输入真实姓名'}]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
placeholder={'请输入真实姓名'}
|
||||||
|
type="text"
|
||||||
|
disabled={FormData.status != 2 && FormData.status != undefined}
|
||||||
|
value={FormData?.realName}
|
||||||
|
onChange={(value) => setFormData({...FormData, realName: value})}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={'身份证号码'}
|
||||||
|
name="idCard"
|
||||||
|
required
|
||||||
|
initialValue={FormData.idCard}
|
||||||
|
rules={[{message: '请输入身份证号码'}]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
placeholder="请输入身份证号码"
|
||||||
|
type="text"
|
||||||
|
value={FormData?.idCard}
|
||||||
|
disabled={FormData.status != 2 && FormData.status != undefined}
|
||||||
|
maxLength={18}
|
||||||
|
onChange={(value) => setFormData({...FormData, idCard: value})}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={'上传证件'}
|
||||||
|
name="image"
|
||||||
|
required
|
||||||
|
rules={[{message: '请上传身份证正反面'}]}
|
||||||
|
>
|
||||||
|
<div className={'flex gap-2'}>
|
||||||
|
<div onClick={uploadSfz1}>
|
||||||
|
<Image src={FormData.sfz1} lazyLoad={false}
|
||||||
|
radius="10%" width="80" height="80"/>
|
||||||
|
</div>
|
||||||
|
<div onClick={uploadSfz2}>
|
||||||
|
<Image src={FormData.sfz2} mode={'scaleToFill'} lazyLoad={false}
|
||||||
|
radius="10%" width="80" height="80"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Form.Item>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// 企业类型
|
||||||
|
FormData.type == 1 && (
|
||||||
|
<>
|
||||||
|
<Form.Item
|
||||||
|
label={'主体名称'}
|
||||||
|
name="name"
|
||||||
|
required
|
||||||
|
initialValue={FormData.name}
|
||||||
|
rules={[{message: '请输入公司名称或单位名称'}]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
placeholder={'请输入主体名称'}
|
||||||
|
type="text"
|
||||||
|
value={FormData?.name}
|
||||||
|
onChange={(value) => setFormData({...FormData, name: value})}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={'营业执照号码'}
|
||||||
|
name="zzCode"
|
||||||
|
required
|
||||||
|
initialValue={FormData.zzCode}
|
||||||
|
rules={[{message: '请输入营业执照号码'}]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
placeholder="请输入营业执照号码"
|
||||||
|
type="text"
|
||||||
|
value={FormData?.zzCode}
|
||||||
|
maxLength={18}
|
||||||
|
onChange={(value) => setFormData({...FormData, zzCode: value})}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={'上传营业执照'}
|
||||||
|
name="zzImg"
|
||||||
|
required
|
||||||
|
rules={[{message: '请上传营业执照'}
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<div onClick={uploadZzImg}>
|
||||||
|
<Image src={FormData.zzImg} mode={'scaleToFill'} lazyLoad={false}
|
||||||
|
radius="10%" width="80" height="80"/>
|
||||||
|
</div>
|
||||||
|
</Form.Item>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
FormData.status != undefined && (
|
||||||
|
<Form.Item
|
||||||
|
label={'审核状态'}
|
||||||
|
name="status"
|
||||||
|
>
|
||||||
|
<span className={'text-gray-500'}>{FormData.statusText}</span>
|
||||||
|
</Form.Item>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
{FormData.status == 2 && (
|
||||||
|
<Form.Item
|
||||||
|
label={'驳回原因'}
|
||||||
|
name="comments"
|
||||||
|
>
|
||||||
|
<div className={'flex text-orange-500'}>
|
||||||
|
{FormData.comments}
|
||||||
|
</div>
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
|
||||||
|
</Form>
|
||||||
|
</ConfigProvider>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Index
|
||||||
4
src/clinic/clinicMedicalHistory/add.config.ts
Normal file
4
src/clinic/clinicMedicalHistory/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增病例',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicMedicalHistory/add.tsx
Normal file
98
src/clinic/clinicMedicalHistory/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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 {ClinicMedicalHistory} from "@/api/clinic/clinicMedicalHistory/model";
|
||||||
|
import {getClinicMedicalHistory, listClinicMedicalHistory, updateClinicMedicalHistory, addClinicMedicalHistory} from "@/api/clinic/clinicMedicalHistory";
|
||||||
|
|
||||||
|
const AddClinicMedicalHistory = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ClinicMedicalHistory>({})
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
if (params.id) {
|
||||||
|
const data = await getClinicMedicalHistory(Number(params.id))
|
||||||
|
setFormData(data)
|
||||||
|
} else {
|
||||||
|
setFormData({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
if (params.id) {
|
||||||
|
// 编辑模式
|
||||||
|
await updateClinicMedicalHistory({
|
||||||
|
...values,
|
||||||
|
id: Number(params.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addClinicMedicalHistory(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="userId" label="买家用户ID" initialValue={FormData.userId} required>
|
||||||
4
src/clinic/clinicMedicalHistory/index.config.ts
Normal file
4
src/clinic/clinicMedicalHistory/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '病例管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
64
src/clinic/clinicMedicalHistory/index.tsx
Normal file
64
src/clinic/clinicMedicalHistory/index.tsx
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicMedicalHistory} from "@/api/clinic/clinicMedicalHistory/model";
|
||||||
|
import {listClinicMedicalHistory, removeClinicMedicalHistory, updateClinicMedicalHistory} from "@/api/clinic/clinicMedicalHistory";
|
||||||
|
|
||||||
|
const ClinicMedicalHistoryList = () => {
|
||||||
|
const [list, setList] = useState<ClinicMedicalHistory[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicMedicalHistory({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicMedicalHistory(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicMedicalHistory/add'})}>新增病例</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
4
src/clinic/clinicMedicine/add.config.ts
Normal file
4
src/clinic/clinicMedicine/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增药品库',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicMedicine/add.tsx
Normal file
98
src/clinic/clinicMedicine/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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 {ClinicMedicine} from "@/api/clinic/clinicMedicine/model";
|
||||||
|
import {getClinicMedicine, listClinicMedicine, updateClinicMedicine, addClinicMedicine} from "@/api/clinic/clinicMedicine";
|
||||||
|
|
||||||
|
const AddClinicMedicine = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ClinicMedicine>({})
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
if (params.id) {
|
||||||
|
const data = await getClinicMedicine(Number(params.id))
|
||||||
|
setFormData(data)
|
||||||
|
} else {
|
||||||
|
setFormData({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
if (params.id) {
|
||||||
|
// 编辑模式
|
||||||
|
await updateClinicMedicine({
|
||||||
|
...values,
|
||||||
|
id: Number(params.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addClinicMedicine(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="name" label="药名" initialValue={FormData.name} required>
|
||||||
4
src/clinic/clinicMedicine/index.config.ts
Normal file
4
src/clinic/clinicMedicine/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '药品库管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
64
src/clinic/clinicMedicine/index.tsx
Normal file
64
src/clinic/clinicMedicine/index.tsx
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicMedicine} from "@/api/clinic/clinicMedicine/model";
|
||||||
|
import {listClinicMedicine, removeClinicMedicine, updateClinicMedicine} from "@/api/clinic/clinicMedicine";
|
||||||
|
|
||||||
|
const ClinicMedicineList = () => {
|
||||||
|
const [list, setList] = useState<ClinicMedicine[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicMedicine({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicMedicine(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicMedicine/add'})}>新增药品库</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
4
src/clinic/clinicMedicineInout/add.config.ts
Normal file
4
src/clinic/clinicMedicineInout/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增出入库',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicMedicineInout/add.tsx
Normal file
98
src/clinic/clinicMedicineInout/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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 {ClinicMedicineInout} from "@/api/clinic/clinicMedicineInout/model";
|
||||||
|
import {getClinicMedicineInout, listClinicMedicineInout, updateClinicMedicineInout, addClinicMedicineInout} from "@/api/clinic/clinicMedicineInout";
|
||||||
|
|
||||||
|
const AddClinicMedicineInout = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ClinicMedicineInout>({})
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
if (params.id) {
|
||||||
|
const data = await getClinicMedicineInout(Number(params.id))
|
||||||
|
setFormData(data)
|
||||||
|
} else {
|
||||||
|
setFormData({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
if (params.id) {
|
||||||
|
// 编辑模式
|
||||||
|
await updateClinicMedicineInout({
|
||||||
|
...values,
|
||||||
|
id: Number(params.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addClinicMedicineInout(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="userId" label="买家用户ID" initialValue={FormData.userId} required>
|
||||||
4
src/clinic/clinicMedicineInout/index.config.ts
Normal file
4
src/clinic/clinicMedicineInout/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '出入库管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
64
src/clinic/clinicMedicineInout/index.tsx
Normal file
64
src/clinic/clinicMedicineInout/index.tsx
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicMedicineInout} from "@/api/clinic/clinicMedicineInout/model";
|
||||||
|
import {listClinicMedicineInout, removeClinicMedicineInout, updateClinicMedicineInout} from "@/api/clinic/clinicMedicineInout";
|
||||||
|
|
||||||
|
const ClinicMedicineInoutList = () => {
|
||||||
|
const [list, setList] = useState<ClinicMedicineInout[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicMedicineInout({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicMedicineInout(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicMedicineInout/add'})}>新增出入库</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
4
src/clinic/clinicMedicineStock/add.config.ts
Normal file
4
src/clinic/clinicMedicineStock/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增药品库存',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicMedicineStock/add.tsx
Normal file
98
src/clinic/clinicMedicineStock/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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 {ClinicMedicineStock} from "@/api/clinic/clinicMedicineStock/model";
|
||||||
|
import {getClinicMedicineStock, listClinicMedicineStock, updateClinicMedicineStock, addClinicMedicineStock} from "@/api/clinic/clinicMedicineStock";
|
||||||
|
|
||||||
|
const AddClinicMedicineStock = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ClinicMedicineStock>({})
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
if (params.id) {
|
||||||
|
const data = await getClinicMedicineStock(Number(params.id))
|
||||||
|
setFormData(data)
|
||||||
|
} else {
|
||||||
|
setFormData({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
if (params.id) {
|
||||||
|
// 编辑模式
|
||||||
|
await updateClinicMedicineStock({
|
||||||
|
...values,
|
||||||
|
id: Number(params.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addClinicMedicineStock(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="medicineId" label="药品" initialValue={FormData.medicineId} required>
|
||||||
4
src/clinic/clinicMedicineStock/index.config.ts
Normal file
4
src/clinic/clinicMedicineStock/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '药品库存管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
64
src/clinic/clinicMedicineStock/index.tsx
Normal file
64
src/clinic/clinicMedicineStock/index.tsx
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicMedicineStock} from "@/api/clinic/clinicMedicineStock/model";
|
||||||
|
import {listClinicMedicineStock, removeClinicMedicineStock, updateClinicMedicineStock} from "@/api/clinic/clinicMedicineStock";
|
||||||
|
|
||||||
|
const ClinicMedicineStockList = () => {
|
||||||
|
const [list, setList] = useState<ClinicMedicineStock[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicMedicineStock({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicMedicineStock(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicMedicineStock/add'})}>新增药品库存</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
4
src/clinic/clinicOrder/add.config.ts
Normal file
4
src/clinic/clinicOrder/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增处方订单',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicOrder/add.tsx
Normal file
98
src/clinic/clinicOrder/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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 {ClinicOrder} from "@/api/clinic/clinicOrder/model";
|
||||||
|
import {getClinicOrder, listClinicOrder, updateClinicOrder, addClinicOrder} from "@/api/clinic/clinicOrder";
|
||||||
|
|
||||||
|
const AddClinicOrder = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ClinicOrder>({})
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
if (params.id) {
|
||||||
|
const data = await getClinicOrder(Number(params.id))
|
||||||
|
setFormData(data)
|
||||||
|
} else {
|
||||||
|
setFormData({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
if (params.id) {
|
||||||
|
// 编辑模式
|
||||||
|
await updateClinicOrder({
|
||||||
|
...values,
|
||||||
|
id: Number(params.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addClinicOrder(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="orderId" label="订单号" initialValue={FormData.orderId} required>
|
||||||
4
src/clinic/clinicOrder/index.config.ts
Normal file
4
src/clinic/clinicOrder/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '处方订单管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
64
src/clinic/clinicOrder/index.tsx
Normal file
64
src/clinic/clinicOrder/index.tsx
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicOrder} from "@/api/clinic/clinicOrder/model";
|
||||||
|
import {listClinicOrder, removeClinicOrder, updateClinicOrder} from "@/api/clinic/clinicOrder";
|
||||||
|
|
||||||
|
const ClinicOrderList = () => {
|
||||||
|
const [list, setList] = useState<ClinicOrder[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicOrder({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicOrder(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicOrder/add'})}>新增处方订单</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
4
src/clinic/clinicPatientUser/add.config.ts
Normal file
4
src/clinic/clinicPatientUser/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '患者注册',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
325
src/clinic/clinicPatientUser/add.tsx
Normal file
325
src/clinic/clinicPatientUser/add.tsx
Normal file
@@ -0,0 +1,325 @@
|
|||||||
|
import {useEffect, useState} from "react";
|
||||||
|
import {Image} from '@nutui/nutui-react-taro'
|
||||||
|
import {ConfigProvider} from '@nutui/nutui-react-taro'
|
||||||
|
import Taro from '@tarojs/taro'
|
||||||
|
|
||||||
|
import {
|
||||||
|
Form,
|
||||||
|
Button,
|
||||||
|
Input,
|
||||||
|
Radio,
|
||||||
|
} from '@nutui/nutui-react-taro'
|
||||||
|
import {UserVerify} from "@/api/system/userVerify/model";
|
||||||
|
import {addUserVerify, myUserVerify, updateUserVerify} from "@/api/system/userVerify";
|
||||||
|
import {uploadFile} from "@/api/system/file";
|
||||||
|
|
||||||
|
function Index() {
|
||||||
|
const [isUpdate, setIsUpdate] = useState<boolean>(false)
|
||||||
|
const [submitText, setSubmitText] = useState<string>('提交')
|
||||||
|
|
||||||
|
const [FormData, setFormData] = useState<UserVerify>({
|
||||||
|
userId: undefined,
|
||||||
|
type: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
avatar: undefined,
|
||||||
|
realName: undefined,
|
||||||
|
idCard: undefined,
|
||||||
|
birthday: undefined,
|
||||||
|
sfz1: undefined,
|
||||||
|
sfz2: undefined,
|
||||||
|
zzCode: undefined,
|
||||||
|
zzImg: undefined,
|
||||||
|
status: undefined,
|
||||||
|
statusText: undefined,
|
||||||
|
comments: undefined
|
||||||
|
})
|
||||||
|
const reload = () => {
|
||||||
|
myUserVerify({}).then(data => {
|
||||||
|
if (data) {
|
||||||
|
setIsUpdate(true);
|
||||||
|
setFormData(data)
|
||||||
|
if(data.status == 2){
|
||||||
|
setSubmitText('重新提交')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setFormData({
|
||||||
|
type: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = (values: any) => {
|
||||||
|
console.log('提交表单', values);
|
||||||
|
if (FormData.status != 2 && FormData.status != undefined) return false;
|
||||||
|
if (FormData.type == 0) {
|
||||||
|
if (!FormData.sfz1 || !FormData.sfz2) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请上传身份证正反面',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!FormData.realName || !FormData.idCard) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写真实姓名和身份证号码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (FormData.type == 1) {
|
||||||
|
if (!FormData.zzImg) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请上传营业执照',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!FormData.name || !FormData.zzCode) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写主体名称和营业执照号码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!FormData.realName){
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写真实姓名',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const saveOrUpdate = isUpdate ? updateUserVerify : addUserVerify;
|
||||||
|
saveOrUpdate({...FormData, status: 0}).then(() => {
|
||||||
|
Taro.showToast({title: `提交成功`, icon: 'success'})
|
||||||
|
setTimeout(() => {
|
||||||
|
return Taro.navigateBack()
|
||||||
|
}, 1000)
|
||||||
|
}).catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '提交失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
}).finally(() => {
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const submitFailed = (error: any) => {
|
||||||
|
console.log(error, 'err...')
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploadSfz1 = () => {
|
||||||
|
if (FormData.status != 2 && FormData.status != undefined) return false;
|
||||||
|
uploadFile().then(data => {
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
sfz1: data.url
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploadSfz2 = () => {
|
||||||
|
if (FormData.status != 2 && FormData.status != undefined) return false;
|
||||||
|
uploadFile().then(data => {
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
sfz2: data.url
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const uploadZzImg = () => {
|
||||||
|
if (FormData.status != 2 && FormData.status != undefined) return false;
|
||||||
|
uploadFile().then(data => {
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
zzImg: data.url
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
reload()
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className={'p-4'}>
|
||||||
|
<ConfigProvider>
|
||||||
|
<Form
|
||||||
|
divider
|
||||||
|
initialValues={FormData}
|
||||||
|
labelPosition="left"
|
||||||
|
onFinish={(values) => submitSucceed(values)}
|
||||||
|
onFinishFailed={(errors) => submitFailed(errors)}
|
||||||
|
footer={
|
||||||
|
FormData.status != 1 && FormData.status != 0 && (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
|
width: '100%'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Button nativeType="submit" block type={'info'}
|
||||||
|
disabled={FormData.status != 2 && FormData.status != undefined}>
|
||||||
|
{submitText}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Form.Item
|
||||||
|
label="类型"
|
||||||
|
name="type"
|
||||||
|
initialValue={FormData.type}
|
||||||
|
required
|
||||||
|
>
|
||||||
|
<Radio.Group value={FormData?.type} direction="horizontal"
|
||||||
|
disabled={FormData.status != 2 && FormData.status != undefined}
|
||||||
|
onChange={(value) => setFormData({...FormData, type: value})}>
|
||||||
|
<Radio key={0} value={0}>
|
||||||
|
我是患者
|
||||||
|
</Radio>
|
||||||
|
<Radio key={1} value={1}>
|
||||||
|
我是医师
|
||||||
|
</Radio>
|
||||||
|
</Radio.Group>
|
||||||
|
</Form.Item>
|
||||||
|
{
|
||||||
|
// 个人类型
|
||||||
|
FormData.type == 0 && (
|
||||||
|
<>
|
||||||
|
<Form.Item
|
||||||
|
label={'真实姓名'}
|
||||||
|
name="realName"
|
||||||
|
required
|
||||||
|
initialValue={FormData.realName}
|
||||||
|
rules={[{message: '请输入真实姓名'}]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
placeholder={'请输入真实姓名'}
|
||||||
|
type="text"
|
||||||
|
disabled={FormData.status != 2 && FormData.status != undefined}
|
||||||
|
value={FormData?.realName}
|
||||||
|
onChange={(value) => setFormData({...FormData, realName: value})}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={'身份证号码'}
|
||||||
|
name="idCard"
|
||||||
|
required
|
||||||
|
initialValue={FormData.idCard}
|
||||||
|
rules={[{message: '请输入身份证号码'}]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
placeholder="请输入身份证号码"
|
||||||
|
type="text"
|
||||||
|
value={FormData?.idCard}
|
||||||
|
disabled={FormData.status != 2 && FormData.status != undefined}
|
||||||
|
maxLength={18}
|
||||||
|
onChange={(value) => setFormData({...FormData, idCard: value})}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={'上传证件'}
|
||||||
|
name="image"
|
||||||
|
required
|
||||||
|
rules={[{message: '请上传身份证正反面'}]}
|
||||||
|
>
|
||||||
|
<div className={'flex gap-2'}>
|
||||||
|
<div onClick={uploadSfz1}>
|
||||||
|
<Image src={FormData.sfz1} lazyLoad={false}
|
||||||
|
radius="10%" width="80" height="80"/>
|
||||||
|
</div>
|
||||||
|
<div onClick={uploadSfz2}>
|
||||||
|
<Image src={FormData.sfz2} mode={'scaleToFill'} lazyLoad={false}
|
||||||
|
radius="10%" width="80" height="80"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Form.Item>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// 企业类型
|
||||||
|
FormData.type == 1 && (
|
||||||
|
<>
|
||||||
|
<Form.Item
|
||||||
|
label={'主体名称'}
|
||||||
|
name="name"
|
||||||
|
required
|
||||||
|
initialValue={FormData.name}
|
||||||
|
rules={[{message: '请输入公司名称或单位名称'}]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
placeholder={'请输入主体名称'}
|
||||||
|
type="text"
|
||||||
|
value={FormData?.name}
|
||||||
|
onChange={(value) => setFormData({...FormData, name: value})}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={'营业执照号码'}
|
||||||
|
name="zzCode"
|
||||||
|
required
|
||||||
|
initialValue={FormData.zzCode}
|
||||||
|
rules={[{message: '请输入营业执照号码'}]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
placeholder="请输入营业执照号码"
|
||||||
|
type="text"
|
||||||
|
value={FormData?.zzCode}
|
||||||
|
maxLength={18}
|
||||||
|
onChange={(value) => setFormData({...FormData, zzCode: value})}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={'上传营业执照'}
|
||||||
|
name="zzImg"
|
||||||
|
required
|
||||||
|
rules={[{message: '请上传营业执照'}
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<div onClick={uploadZzImg}>
|
||||||
|
<Image src={FormData.zzImg} mode={'scaleToFill'} lazyLoad={false}
|
||||||
|
radius="10%" width="80" height="80"/>
|
||||||
|
</div>
|
||||||
|
</Form.Item>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
FormData.status != undefined && (
|
||||||
|
<Form.Item
|
||||||
|
label={'审核状态'}
|
||||||
|
name="status"
|
||||||
|
>
|
||||||
|
<span className={'text-gray-500'}>{FormData.statusText}</span>
|
||||||
|
</Form.Item>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
{FormData.status == 2 && (
|
||||||
|
<Form.Item
|
||||||
|
label={'驳回原因'}
|
||||||
|
name="comments"
|
||||||
|
>
|
||||||
|
<div className={'flex text-orange-500'}>
|
||||||
|
{FormData.comments}
|
||||||
|
</div>
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
|
||||||
|
</Form>
|
||||||
|
</ConfigProvider>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Index
|
||||||
5
src/clinic/clinicPrescription/add.config.ts
Normal file
5
src/clinic/clinicPrescription/add.config.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增处方主表
|
||||||
|
',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicPrescription/add.tsx
Normal file
98
src/clinic/clinicPrescription/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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 {ClinicPrescription} from "@/api/clinic/clinicPrescription/model";
|
||||||
|
import {getClinicPrescription, listClinicPrescription, updateClinicPrescription, addClinicPrescription} from "@/api/clinic/clinicPrescription";
|
||||||
|
|
||||||
|
const AddClinicPrescription = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ClinicPrescription>({})
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
if (params.id) {
|
||||||
|
const data = await getClinicPrescription(Number(params.id))
|
||||||
|
setFormData(data)
|
||||||
|
} else {
|
||||||
|
setFormData({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
if (params.id) {
|
||||||
|
// 编辑模式
|
||||||
|
await updateClinicPrescription({
|
||||||
|
...values,
|
||||||
|
id: Number(params.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addClinicPrescription(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="userId" label="患者" initialValue={FormData.userId} required>
|
||||||
5
src/clinic/clinicPrescription/index.config.ts
Normal file
5
src/clinic/clinicPrescription/index.config.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '处方主表
|
||||||
|
管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
65
src/clinic/clinicPrescription/index.tsx
Normal file
65
src/clinic/clinicPrescription/index.tsx
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicPrescription} from "@/api/clinic/clinicPrescription/model";
|
||||||
|
import {listClinicPrescription, removeClinicPrescription, updateClinicPrescription} from "@/api/clinic/clinicPrescription";
|
||||||
|
|
||||||
|
const ClinicPrescriptionList = () => {
|
||||||
|
const [list, setList] = useState<ClinicPrescription[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicPrescription({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicPrescription(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicPrescription/add'})}>新增处方主表
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
5
src/clinic/clinicPrescriptionItem/add.config.ts
Normal file
5
src/clinic/clinicPrescriptionItem/add.config.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增处方明细表
|
||||||
|
',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicPrescriptionItem/add.tsx
Normal file
98
src/clinic/clinicPrescriptionItem/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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 {ClinicPrescriptionItem} from "@/api/clinic/clinicPrescriptionItem/model";
|
||||||
|
import {getClinicPrescriptionItem, listClinicPrescriptionItem, updateClinicPrescriptionItem, addClinicPrescriptionItem} from "@/api/clinic/clinicPrescriptionItem";
|
||||||
|
|
||||||
|
const AddClinicPrescriptionItem = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ClinicPrescriptionItem>({})
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
if (params.id) {
|
||||||
|
const data = await getClinicPrescriptionItem(Number(params.id))
|
||||||
|
setFormData(data)
|
||||||
|
} else {
|
||||||
|
setFormData({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
if (params.id) {
|
||||||
|
// 编辑模式
|
||||||
|
await updateClinicPrescriptionItem({
|
||||||
|
...values,
|
||||||
|
id: Number(params.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addClinicPrescriptionItem(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="prescriptionId" label="关联处方" initialValue={FormData.prescriptionId} required>
|
||||||
5
src/clinic/clinicPrescriptionItem/index.config.ts
Normal file
5
src/clinic/clinicPrescriptionItem/index.config.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '处方明细表
|
||||||
|
管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
65
src/clinic/clinicPrescriptionItem/index.tsx
Normal file
65
src/clinic/clinicPrescriptionItem/index.tsx
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicPrescriptionItem} from "@/api/clinic/clinicPrescriptionItem/model";
|
||||||
|
import {listClinicPrescriptionItem, removeClinicPrescriptionItem, updateClinicPrescriptionItem} from "@/api/clinic/clinicPrescriptionItem";
|
||||||
|
|
||||||
|
const ClinicPrescriptionItemList = () => {
|
||||||
|
const [list, setList] = useState<ClinicPrescriptionItem[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicPrescriptionItem({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicPrescriptionItem(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicPrescriptionItem/add'})}>新增处方明细表
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
4
src/clinic/clinicReport/add.config.ts
Normal file
4
src/clinic/clinicReport/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增报告',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicReport/add.tsx
Normal file
98
src/clinic/clinicReport/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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 {ClinicReport} from "@/api/clinic/clinicReport/model";
|
||||||
|
import {getClinicReport, listClinicReport, updateClinicReport, addClinicReport} from "@/api/clinic/clinicReport";
|
||||||
|
|
||||||
|
const AddClinicReport = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ClinicReport>({})
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
if (params.id) {
|
||||||
|
const data = await getClinicReport(Number(params.id))
|
||||||
|
setFormData(data)
|
||||||
|
} else {
|
||||||
|
setFormData({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
if (params.id) {
|
||||||
|
// 编辑模式
|
||||||
|
await updateClinicReport({
|
||||||
|
...values,
|
||||||
|
id: Number(params.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addClinicReport(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="userId" label="买家用户ID" initialValue={FormData.userId} required>
|
||||||
4
src/clinic/clinicReport/index.config.ts
Normal file
4
src/clinic/clinicReport/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '报告管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
64
src/clinic/clinicReport/index.tsx
Normal file
64
src/clinic/clinicReport/index.tsx
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicReport} from "@/api/clinic/clinicReport/model";
|
||||||
|
import {listClinicReport, removeClinicReport, updateClinicReport} from "@/api/clinic/clinicReport";
|
||||||
|
|
||||||
|
const ClinicReportList = () => {
|
||||||
|
const [list, setList] = useState<ClinicReport[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicReport({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicReport(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicReport/add'})}>新增报告</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
4
src/clinic/clinicVisitRecord/add.config.ts
Normal file
4
src/clinic/clinicVisitRecord/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '新增病例',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
98
src/clinic/clinicVisitRecord/add.tsx
Normal file
98
src/clinic/clinicVisitRecord/add.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
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 {ClinicVisitRecord} from "@/api/clinic/clinicVisitRecord/model";
|
||||||
|
import {getClinicVisitRecord, listClinicVisitRecord, updateClinicVisitRecord, addClinicVisitRecord} from "@/api/clinic/clinicVisitRecord";
|
||||||
|
|
||||||
|
const AddClinicVisitRecord = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ClinicVisitRecord>({})
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
if (params.id) {
|
||||||
|
const data = await getClinicVisitRecord(Number(params.id))
|
||||||
|
setFormData(data)
|
||||||
|
} else {
|
||||||
|
setFormData({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
if (params.id) {
|
||||||
|
// 编辑模式
|
||||||
|
await updateClinicVisitRecord({
|
||||||
|
...values,
|
||||||
|
id: Number(params.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增模式
|
||||||
|
await addClinicVisitRecord(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="userId" label="买家用户ID" initialValue={FormData.userId} required>
|
||||||
4
src/clinic/clinicVisitRecord/index.config.ts
Normal file
4
src/clinic/clinicVisitRecord/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '病例管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
64
src/clinic/clinicVisitRecord/index.tsx
Normal file
64
src/clinic/clinicVisitRecord/index.tsx
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
||||||
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ClinicVisitRecord} from "@/api/clinic/clinicVisitRecord/model";
|
||||||
|
import {listClinicVisitRecord, removeClinicVisitRecord, updateClinicVisitRecord} from "@/api/clinic/clinicVisitRecord";
|
||||||
|
|
||||||
|
const ClinicVisitRecordList = () => {
|
||||||
|
const [list, setList] = useState<ClinicVisitRecord[]>([])
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listClinicVisitRecord({
|
||||||
|
// 添加查询条件
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取数据失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeClinicVisitRecord(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/clinic/clinicVisitRecord/add'})}>新增病例</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group key={item.
|
||||||
4
src/dealer/apply/add.config.ts
Normal file
4
src/dealer/apply/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '邀请注册',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
433
src/dealer/apply/add.tsx
Normal file
433
src/dealer/apply/add.tsx
Normal file
@@ -0,0 +1,433 @@
|
|||||||
|
import {useEffect, useState, useRef} from "react";
|
||||||
|
import {Loading, CellGroup, Input, Form, Avatar, Button, Space} from '@nutui/nutui-react-taro'
|
||||||
|
import {Edit} from '@nutui/icons-react-taro'
|
||||||
|
import Taro from '@tarojs/taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import FixedButton from "@/components/FixedButton";
|
||||||
|
import {useUser} from "@/hooks/useUser";
|
||||||
|
import {TenantId} from "@/config/app";
|
||||||
|
import {updateUser} from "@/api/system/user";
|
||||||
|
import {User} from "@/api/system/user/model";
|
||||||
|
import {getStoredInviteParams, handleInviteRelation} from "@/utils/invite";
|
||||||
|
import {addShopDealerUser} from "@/api/shop/shopDealerUser";
|
||||||
|
import {listUserRole, updateUserRole} from "@/api/system/userRole";
|
||||||
|
|
||||||
|
// 类型定义
|
||||||
|
interface ChooseAvatarEvent {
|
||||||
|
detail: {
|
||||||
|
avatarUrl: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface InputEvent {
|
||||||
|
detail: {
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddUserAddress = () => {
|
||||||
|
const {user, loginUser} = useUser()
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<User>()
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
const inviteParams = getStoredInviteParams()
|
||||||
|
if (inviteParams?.inviter) {
|
||||||
|
setFormData({
|
||||||
|
...user,
|
||||||
|
refereeId: Number(inviteParams.inviter),
|
||||||
|
// 清空昵称,强制用户手动输入
|
||||||
|
nickname: '',
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 如果没有邀请参数,也要确保昵称为空
|
||||||
|
setFormData({
|
||||||
|
...user,
|
||||||
|
nickname: '',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const uploadAvatar = ({detail}: ChooseAvatarEvent) => {
|
||||||
|
// 先更新本地显示的头像(临时显示)
|
||||||
|
const tempFormData = {
|
||||||
|
...FormData,
|
||||||
|
avatar: `${detail.avatarUrl}`,
|
||||||
|
}
|
||||||
|
setFormData(tempFormData)
|
||||||
|
|
||||||
|
Taro.uploadFile({
|
||||||
|
url: 'https://server.websoft.top/api/oss/upload',
|
||||||
|
filePath: detail.avatarUrl,
|
||||||
|
name: 'file',
|
||||||
|
header: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
TenantId
|
||||||
|
},
|
||||||
|
success: async (res) => {
|
||||||
|
const data = JSON.parse(res.data);
|
||||||
|
if (data.code === 0) {
|
||||||
|
const finalAvatarUrl = `${data.data.thumbnail}`
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 使用 useUser hook 的 updateUser 方法更新头像
|
||||||
|
await updateUser({
|
||||||
|
avatar: finalAvatarUrl
|
||||||
|
})
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: '头像上传成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.error('更新用户头像失败:', error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 无论用户信息更新是否成功,都要更新本地FormData
|
||||||
|
const finalFormData = {
|
||||||
|
...tempFormData,
|
||||||
|
avatar: finalAvatarUrl
|
||||||
|
}
|
||||||
|
setFormData(finalFormData)
|
||||||
|
|
||||||
|
// 同步更新表单字段
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
avatar: finalAvatarUrl
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 上传失败,恢复原来的头像
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
avatar: user?.avatar || ''
|
||||||
|
})
|
||||||
|
Taro.showToast({
|
||||||
|
title: '上传失败',
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('上传头像失败:', error)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '上传失败',
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
// 恢复原来的头像
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
avatar: user?.avatar || ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
try {
|
||||||
|
// 验证必填字段
|
||||||
|
if (!values.phone && !FormData?.phone) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请先获取手机号',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证昵称:必须填写且不能是默认的微信昵称
|
||||||
|
const nickname = values.realName || FormData?.nickname || '';
|
||||||
|
if (!nickname || nickname.trim() === '') {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写昵称',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否为默认的微信昵称(常见的默认昵称)
|
||||||
|
const defaultNicknames = ['微信用户', 'WeChat User', '微信昵称'];
|
||||||
|
if (defaultNicknames.includes(nickname.trim())) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写真实昵称,不能使用默认昵称',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证昵称长度
|
||||||
|
if (nickname.trim().length < 2) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '昵称至少需要2个字符',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!values.avatar && !FormData?.avatar) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请上传头像',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log(values,FormData)
|
||||||
|
|
||||||
|
const roles = await listUserRole({userId: user?.userId})
|
||||||
|
console.log(roles, 'roles...')
|
||||||
|
|
||||||
|
// 准备提交的数据
|
||||||
|
await updateUser({
|
||||||
|
userId: user?.userId,
|
||||||
|
nickname: values.realName || FormData?.nickname,
|
||||||
|
phone: values.phone || FormData?.phone,
|
||||||
|
avatar: values.avatar || FormData?.avatar,
|
||||||
|
refereeId: values.refereeId || FormData?.refereeId
|
||||||
|
});
|
||||||
|
|
||||||
|
await addShopDealerUser({
|
||||||
|
userId: user?.userId,
|
||||||
|
realName: values.realName || FormData?.nickname,
|
||||||
|
mobile: values.phone || FormData?.phone,
|
||||||
|
refereeId: values.refereeId || FormData?.refereeId
|
||||||
|
})
|
||||||
|
|
||||||
|
if (roles.length > 0) {
|
||||||
|
await updateUserRole({
|
||||||
|
...roles[0],
|
||||||
|
roleId: 1848
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: `注册成功`,
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
Taro.navigateBack();
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('验证邀请人失败:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取微信昵称
|
||||||
|
const getWxNickname = (nickname: string) => {
|
||||||
|
// 更新表单数据
|
||||||
|
const updatedFormData = {
|
||||||
|
...FormData,
|
||||||
|
nickname: nickname
|
||||||
|
}
|
||||||
|
setFormData(updatedFormData);
|
||||||
|
|
||||||
|
// 同步更新表单字段
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
realName: nickname
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 获取用户手机号 */
|
||||||
|
const handleGetPhoneNumber = ({detail}: { detail: { code?: string, encryptedData?: string, iv?: string } }) => {
|
||||||
|
const {code, encryptedData, iv} = detail
|
||||||
|
Taro.login({
|
||||||
|
success: (loginRes) => {
|
||||||
|
if (code) {
|
||||||
|
Taro.request({
|
||||||
|
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
authCode: loginRes.code,
|
||||||
|
code,
|
||||||
|
encryptedData,
|
||||||
|
iv,
|
||||||
|
notVerifyPhone: true,
|
||||||
|
refereeId: 0,
|
||||||
|
sceneType: 'save_referee',
|
||||||
|
tenantId: TenantId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
TenantId
|
||||||
|
},
|
||||||
|
success: async function (res) {
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 登录成功
|
||||||
|
const token = res.data.data.access_token;
|
||||||
|
const userData = res.data.data.user;
|
||||||
|
console.log(userData, 'userData...')
|
||||||
|
// 使用useUser Hook的loginUser方法更新状态
|
||||||
|
loginUser(token, userData);
|
||||||
|
|
||||||
|
if (userData.phone) {
|
||||||
|
console.log('手机号已获取', userData.phone)
|
||||||
|
const updatedFormData = {
|
||||||
|
...FormData,
|
||||||
|
phone: userData.phone,
|
||||||
|
// 不自动填充微信昵称,保持用户已输入的昵称
|
||||||
|
nickname: FormData?.nickname || '',
|
||||||
|
// 只在没有头像时才使用微信头像
|
||||||
|
avatar: FormData?.avatar || userData.avatar
|
||||||
|
}
|
||||||
|
setFormData(updatedFormData)
|
||||||
|
|
||||||
|
// 更新表单字段值
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
phone: userData.phone,
|
||||||
|
// 不覆盖用户已输入的昵称
|
||||||
|
realName: FormData?.nickname || '',
|
||||||
|
avatar: FormData?.avatar || userData.avatar
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: '手机号获取成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 处理邀请关系
|
||||||
|
if (userData?.userId) {
|
||||||
|
try {
|
||||||
|
const inviteSuccess = await handleInviteRelation(userData.userId)
|
||||||
|
if (inviteSuccess) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '邀请关系建立成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('处理邀请关系失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示登录成功提示
|
||||||
|
// Taro.showToast({
|
||||||
|
// title: '注册成功',
|
||||||
|
// icon: 'success',
|
||||||
|
// duration: 1500
|
||||||
|
// })
|
||||||
|
|
||||||
|
// 不需要重新启动小程序,状态已经通过useUser更新
|
||||||
|
// 可以选择性地刷新当前页面数据
|
||||||
|
// await reload();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('登录失败!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理固定按钮点击事件
|
||||||
|
const handleFixedButtonClick = () => {
|
||||||
|
// 触发表单提交
|
||||||
|
formRef.current?.submit();
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitFailed = (error: any) => {
|
||||||
|
console.log(error, 'err...')
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
reload().then(() => {
|
||||||
|
setLoading(false)
|
||||||
|
})
|
||||||
|
}, [user?.userId]); // 依赖用户ID,当用户变化时重新加载
|
||||||
|
|
||||||
|
// 当FormData变化时,同步更新表单字段值
|
||||||
|
useEffect(() => {
|
||||||
|
if (formRef.current && FormData) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
refereeId: FormData.refereeId,
|
||||||
|
phone: FormData.phone,
|
||||||
|
avatar: FormData.avatar,
|
||||||
|
realName: FormData.nickname
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [FormData]);
|
||||||
|
|
||||||
|
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)}
|
||||||
|
>
|
||||||
|
<View className={'bg-gray-100 h-3'}></View>
|
||||||
|
<CellGroup style={{padding: '4px 0'}}>
|
||||||
|
<Form.Item name="refereeId" label="邀请人ID" initialValue={FormData?.refereeId} required>
|
||||||
|
<Input placeholder="邀请人ID" disabled={true}/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item name="phone" label="手机号" initialValue={FormData?.phone} required>
|
||||||
|
<View className="flex items-center justify-between">
|
||||||
|
<Input
|
||||||
|
placeholder="请填写手机号"
|
||||||
|
disabled={true}
|
||||||
|
maxLength={11}
|
||||||
|
value={FormData?.phone || ''}
|
||||||
|
/>
|
||||||
|
<Button style={{color: '#ffffff'}} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
|
||||||
|
<Space>
|
||||||
|
<Button size="small">点击获取</Button>
|
||||||
|
</Space>
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
</Form.Item>
|
||||||
|
{
|
||||||
|
FormData?.phone && <Form.Item name="avatar" label="头像" initialValue={FormData?.avatar} required>
|
||||||
|
<Button open-type="chooseAvatar" style={{height: '58px'}} onChooseAvatar={uploadAvatar}>
|
||||||
|
<Avatar src={FormData?.avatar || user?.avatar} size="54"/>
|
||||||
|
</Button>
|
||||||
|
</Form.Item>
|
||||||
|
}
|
||||||
|
<Form.Item name="realName" label="昵称" initialValue="" required>
|
||||||
|
<Input
|
||||||
|
type="nickname"
|
||||||
|
className="info-content__input"
|
||||||
|
placeholder="请获取微信昵称"
|
||||||
|
value={FormData?.nickname || ''}
|
||||||
|
onInput={(e: InputEvent) => getWxNickname(e.detail.value)}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</CellGroup>
|
||||||
|
</Form>
|
||||||
|
|
||||||
|
{/* 底部浮动按钮 */}
|
||||||
|
<FixedButton
|
||||||
|
icon={<Edit/>}
|
||||||
|
text={'立即注册'}
|
||||||
|
onClick={handleFixedButtonClick}
|
||||||
|
/>
|
||||||
|
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AddUserAddress;
|
||||||
4
src/dealer/bank/add.config.ts
Normal file
4
src/dealer/bank/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '添加银行卡',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
142
src/dealer/bank/add.tsx
Normal file
142
src/dealer/bank/add.tsx
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
import {useEffect, useState, useRef} from "react";
|
||||||
|
import {useRouter} from '@tarojs/taro'
|
||||||
|
import {Loading, CellGroup, Input, Form} from '@nutui/nutui-react-taro'
|
||||||
|
import Taro from '@tarojs/taro'
|
||||||
|
import {
|
||||||
|
getShopDealerBank,
|
||||||
|
listShopDealerBank,
|
||||||
|
updateShopDealerBank,
|
||||||
|
addShopDealerBank
|
||||||
|
} from "@/api/shop/shopDealerBank";
|
||||||
|
import FixedButton from "@/components/FixedButton";
|
||||||
|
import {ShopDealerBank} from "@/api/shop/shopDealerBank/model";
|
||||||
|
|
||||||
|
const AddUserAddress = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ShopDealerBank>()
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
|
// 判断是编辑还是新增模式
|
||||||
|
const isEditMode = !!params.id
|
||||||
|
const bankId = params.id ? Number(params.id) : undefined
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
// 如果是编辑模式,加载地址数据
|
||||||
|
if (isEditMode && bankId) {
|
||||||
|
try {
|
||||||
|
const bank = await getShopDealerBank(bankId)
|
||||||
|
setFormData(bank)
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载地址失败:', error)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '加载地址失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
console.log('.>>>>>>,....')
|
||||||
|
try {
|
||||||
|
// 准备提交的数据
|
||||||
|
const submitData = {
|
||||||
|
...values,
|
||||||
|
isDefault: true // 新增或编辑的地址都设为默认地址
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log('提交数据:', submitData)
|
||||||
|
|
||||||
|
// 如果是编辑模式,添加id
|
||||||
|
if (isEditMode && bankId) {
|
||||||
|
submitData.id = bankId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 先处理默认地址逻辑
|
||||||
|
const defaultAddress = await listShopDealerBank({isDefault: true});
|
||||||
|
if (defaultAddress && defaultAddress.length > 0) {
|
||||||
|
// 如果当前编辑的不是默认地址,或者是新增地址,需要取消其他默认地址
|
||||||
|
if (!isEditMode || (isEditMode && defaultAddress[0].id !== bankId)) {
|
||||||
|
await updateShopDealerBank({
|
||||||
|
...defaultAddress[0],
|
||||||
|
isDefault: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行新增或更新操作
|
||||||
|
if (isEditMode) {
|
||||||
|
await updateShopDealerBank(submitData);
|
||||||
|
} else {
|
||||||
|
await addShopDealerBank(submitData);
|
||||||
|
}
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: `${isEditMode ? '更新' : '保存'}成功`,
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
Taro.navigateBack();
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('保存失败:', error);
|
||||||
|
Taro.showToast({
|
||||||
|
title: `${isEditMode ? '更新' : '保存'}失败`,
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitFailed = (error: any) => {
|
||||||
|
console.log(error, 'err...')
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// 动态设置页面标题
|
||||||
|
Taro.setNavigationBarTitle({
|
||||||
|
title: isEditMode ? '编辑银行卡' : '添加银行卡'
|
||||||
|
});
|
||||||
|
|
||||||
|
reload().then(() => {
|
||||||
|
setLoading(false)
|
||||||
|
})
|
||||||
|
}, [isEditMode]);
|
||||||
|
|
||||||
|
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)}
|
||||||
|
>
|
||||||
|
<CellGroup style={{padding: '4px 0'}}>
|
||||||
|
<Form.Item name="bankName" label="开户行名称" initialValue={FormData?.bankName} required>
|
||||||
|
<Input placeholder="开户行名称" maxLength={10}/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item name="bankAccount" label="银行开户名" initialValue={FormData?.bankAccount} required>
|
||||||
|
<Input placeholder="银行开户名" maxLength={10}/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item name="bankCard" label="银行卡号" initialValue={FormData?.bankCard} required>
|
||||||
|
<Input placeholder="银行卡号" maxLength={11}/>
|
||||||
|
</Form.Item>
|
||||||
|
</CellGroup>
|
||||||
|
</Form>
|
||||||
|
|
||||||
|
{/* 底部浮动按钮 */}
|
||||||
|
<FixedButton text={isEditMode ? '更新地址' : '保存并使用'} onClick={() => formRef.current?.submit()}/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AddUserAddress;
|
||||||
4
src/dealer/bank/index.config.ts
Normal file
4
src/dealer/bank/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '银行卡管理',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
132
src/dealer/bank/index.tsx
Normal file
132
src/dealer/bank/index.tsx
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
import {useState} from "react";
|
||||||
|
import Taro, {useDidShow} from '@tarojs/taro'
|
||||||
|
import {Button, Cell, Space, Empty, ConfigProvider} from '@nutui/nutui-react-taro'
|
||||||
|
import {CheckNormal, Checked} from '@nutui/icons-react-taro'
|
||||||
|
import {View} from '@tarojs/components'
|
||||||
|
import {ShopDealerBank} from "@/api/shop/shopDealerBank/model";
|
||||||
|
import {listShopDealerBank, removeShopDealerBank, updateShopDealerBank} from "@/api/shop/shopDealerBank";
|
||||||
|
import FixedButton from "@/components/FixedButton";
|
||||||
|
|
||||||
|
const DealerBank = () => {
|
||||||
|
const [list, setList] = useState<ShopDealerBank[]>([])
|
||||||
|
const [bank, setAddress] = useState<ShopDealerBank>()
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listShopDealerBank({})
|
||||||
|
.then(data => {
|
||||||
|
setList(data || [])
|
||||||
|
// 默认地址
|
||||||
|
setAddress(data.find(item => item.isDefault))
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取地址失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const onDefault = async (item: ShopDealerBank) => {
|
||||||
|
if (bank) {
|
||||||
|
await updateShopDealerBank({
|
||||||
|
...bank,
|
||||||
|
isDefault: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
await updateShopDealerBank({
|
||||||
|
id: item.id,
|
||||||
|
isDefault: true
|
||||||
|
})
|
||||||
|
Taro.showToast({
|
||||||
|
title: '设置成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
const onDel = async (id?: number) => {
|
||||||
|
await removeShopDealerBank(id)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectAddress = async (item: ShopDealerBank) => {
|
||||||
|
if (bank) {
|
||||||
|
await updateShopDealerBank({
|
||||||
|
...bank,
|
||||||
|
isDefault: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
await updateShopDealerBank({
|
||||||
|
id: item.id,
|
||||||
|
isDefault: true
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
Taro.navigateBack()
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.length == 0) {
|
||||||
|
return (
|
||||||
|
<ConfigProvider>
|
||||||
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
||||||
|
height: 'calc(100vh - 300px)',
|
||||||
|
}}>
|
||||||
|
<Empty
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}
|
||||||
|
description="您还没有银行卡哦"
|
||||||
|
/>
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => Taro.navigateTo({url: '/dealer/bank/add'})}>新增银行卡</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className={'p-3'}>
|
||||||
|
{list.map((item, _) => (
|
||||||
|
<Cell.Group>
|
||||||
|
<Cell className={'flex flex-col gap-1'} extra={item.bankAccount} onClick={() => selectAddress(item)}>
|
||||||
|
<View>
|
||||||
|
<View className={'font-medium text-sm'}>{item.bankName}</View>
|
||||||
|
</View>
|
||||||
|
<View className={'text-xs'}>
|
||||||
|
{item.bankCard} {item.bankAccount}
|
||||||
|
</View>
|
||||||
|
</Cell>
|
||||||
|
<Cell
|
||||||
|
align="center"
|
||||||
|
title={
|
||||||
|
<View className={'flex items-center gap-1'} onClick={() => onDefault(item)}>
|
||||||
|
{item.isDefault ? <Checked className={'text-green-600'} size={16}/> : <CheckNormal size={16}/>}
|
||||||
|
<View className={'text-gray-400'}>选择</View>
|
||||||
|
</View>
|
||||||
|
}
|
||||||
|
extra={
|
||||||
|
<>
|
||||||
|
<View className={'text-gray-400'} onClick={() => onDel(item.id)}>
|
||||||
|
删除
|
||||||
|
</View>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Cell.Group>
|
||||||
|
))}
|
||||||
|
{/* 底部浮动按钮 */}
|
||||||
|
<FixedButton text={'新增银行卡'} onClick={() => Taro.navigateTo({url: '/dealer/bank/add'})} />
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DealerBank;
|
||||||
3
src/dealer/capital/detail.config.ts
Normal file
3
src/dealer/capital/detail.config.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '详情'
|
||||||
|
})
|
||||||
76
src/dealer/capital/detail.tsx
Normal file
76
src/dealer/capital/detail.tsx
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
import {useState, useEffect} from 'react'
|
||||||
|
import {View, Text} from '@tarojs/components'
|
||||||
|
import {Empty, Loading} from '@nutui/nutui-react-taro'
|
||||||
|
import {useRouter} from '@tarojs/taro'
|
||||||
|
import {getShopDealerCapital} from '@/api/shop/shopDealerCapital'
|
||||||
|
import type {ShopDealerCapital} from '@/api/shop/shopDealerCapital/model'
|
||||||
|
|
||||||
|
const DealerCapitalDetail = () => {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(false)
|
||||||
|
const [item, setItem] = useState<ShopDealerCapital>()
|
||||||
|
|
||||||
|
// 获取订单数据
|
||||||
|
const reload = async () => {
|
||||||
|
const data = await getShopDealerCapital(Number(params.id))
|
||||||
|
setItem(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFlowType = (index?: number) => {
|
||||||
|
if (index === 10) return '电费收益'
|
||||||
|
if (index === 20) return '提现支出'
|
||||||
|
if (index === 30) return '转账支出'
|
||||||
|
if (index === 40) return '转账收入'
|
||||||
|
return 'warning'
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化加载数据
|
||||||
|
useEffect(() => {
|
||||||
|
reload().then(() => {
|
||||||
|
setLoading(true)
|
||||||
|
})
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className="min-h-screen bg-gray-50">
|
||||||
|
<View className="p-4">
|
||||||
|
{loading && !item ? (
|
||||||
|
<View className="text-center py-8">
|
||||||
|
<Loading/>
|
||||||
|
<Text className="text-gray-500 mt-2">加载中...</Text>
|
||||||
|
</View>
|
||||||
|
) : item ? (
|
||||||
|
<View key={item.id} className="bg-white rounded-lg p-4 mb-3 shadow-sm">
|
||||||
|
<View className="flex flex-col justify-center items-center py-8">
|
||||||
|
<Text className="text-lg text-gray-300">
|
||||||
|
{getFlowType(item.flowType)}
|
||||||
|
</Text>
|
||||||
|
<View className="text-4xl mt-1 font-semibold flex justify-start">
|
||||||
|
<Text className={'subscript text-xl mt-1'}>¥</Text>
|
||||||
|
<Text className={'text-4xl'}>{Number(item.money).toFixed(2)}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="flex flex-col justify-between mb-1">
|
||||||
|
<Text className="text-sm my-1 text-gray-500">
|
||||||
|
收益描述:{item.comments}
|
||||||
|
</Text>
|
||||||
|
<Text className="text-sm my-1 text-gray-500">
|
||||||
|
订单编号:{item.orderNo}
|
||||||
|
</Text>
|
||||||
|
<Text className="text-sm my-1 text-gray-500">
|
||||||
|
创建时间:{item.createTime}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<Empty description="账单不存在" style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}/>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DealerCapitalDetail
|
||||||
3
src/dealer/capital/index.config.ts
Normal file
3
src/dealer/capital/index.config.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '收益明细'
|
||||||
|
})
|
||||||
202
src/dealer/capital/index.tsx
Normal file
202
src/dealer/capital/index.tsx
Normal file
@@ -0,0 +1,202 @@
|
|||||||
|
import React, {useState, useEffect, useCallback} from 'react'
|
||||||
|
import {View, Text, ScrollView} from '@tarojs/components'
|
||||||
|
import {ArrowDown} from '@nutui/icons-react-taro'
|
||||||
|
import {Empty, PullToRefresh, DatePicker,Space, Loading} from '@nutui/nutui-react-taro'
|
||||||
|
import Taro from '@tarojs/taro'
|
||||||
|
import {pageShopDealerCapital} from '@/api/shop/shopDealerCapital'
|
||||||
|
import {useDealerUser} from '@/hooks/useDealerUser'
|
||||||
|
import type {ShopDealerCapital} from '@/api/shop/shopDealerCapital/model'
|
||||||
|
import navTo from "@/utils/common";
|
||||||
|
|
||||||
|
const DealerCapital: React.FC = () => {
|
||||||
|
const [loading, setLoading] = useState<boolean>(false)
|
||||||
|
const d = new Date()
|
||||||
|
const currDate = `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`;
|
||||||
|
const [date, setDate] = useState(currDate)
|
||||||
|
const [show1, setShow1] = useState(false)
|
||||||
|
const [refreshing, setRefreshing] = useState<boolean>(false)
|
||||||
|
const [loadingMore, setLoadingMore] = useState<boolean>(false)
|
||||||
|
const [capital, setCapital] = useState<ShopDealerCapital[]>([])
|
||||||
|
const [currentPage, setCurrentPage] = useState<number>(1)
|
||||||
|
const [hasMore, setHasMore] = useState<boolean>(true)
|
||||||
|
|
||||||
|
const {dealerUser} = useDealerUser()
|
||||||
|
|
||||||
|
// 获取订单数据
|
||||||
|
const fetchCapital = useCallback(async (page: number = 1, isRefresh: boolean = false) => {
|
||||||
|
if (!dealerUser?.userId) return
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (isRefresh) {
|
||||||
|
setRefreshing(true)
|
||||||
|
} else if (page === 1) {
|
||||||
|
setLoading(true)
|
||||||
|
} else {
|
||||||
|
setLoadingMore(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = await pageShopDealerCapital({
|
||||||
|
page,
|
||||||
|
limit: 10
|
||||||
|
})
|
||||||
|
|
||||||
|
if (result?.list) {
|
||||||
|
const newCapital = result.list.map(item => ({
|
||||||
|
...item,
|
||||||
|
orderNo: item.orderNo
|
||||||
|
}))
|
||||||
|
|
||||||
|
if (page === 1) {
|
||||||
|
setCapital(newCapital)
|
||||||
|
} else {
|
||||||
|
setCapital(prev => [...prev, ...newCapital])
|
||||||
|
}
|
||||||
|
|
||||||
|
setHasMore(newCapital.length === 10)
|
||||||
|
setCurrentPage(page)
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取分销订单失败:', error)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '获取订单失败',
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
|
setRefreshing(false)
|
||||||
|
setLoadingMore(false)
|
||||||
|
}
|
||||||
|
}, [dealerUser?.userId])
|
||||||
|
|
||||||
|
// 下拉刷新
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
await fetchCapital(1, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载更多
|
||||||
|
const handleLoadMore = async () => {
|
||||||
|
if (!loadingMore && hasMore) {
|
||||||
|
await fetchCapital(currentPage + 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFlowType = (index?: number) => {
|
||||||
|
if (index === 10) return '电费收益'
|
||||||
|
if (index === 20) return '提现支出'
|
||||||
|
if (index === 30) return '转账支出'
|
||||||
|
if (index === 40) return '转账收入'
|
||||||
|
return 'warning'
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化加载数据
|
||||||
|
useEffect(() => {
|
||||||
|
if (dealerUser?.userId) {
|
||||||
|
fetchCapital(1)
|
||||||
|
}
|
||||||
|
}, [fetchCapital])
|
||||||
|
|
||||||
|
const renderCapitalItem = (item: ShopDealerCapital) => (
|
||||||
|
<View key={item.id} className="bg-white rounded-lg p-4 mb-3 shadow-sm"
|
||||||
|
onClick={() => navTo(`/dealer/capital/detail?id=${item.id}`)}>
|
||||||
|
<View className="flex justify-between items-start mb-1">
|
||||||
|
<Text className="font-semibold text-gray-800">
|
||||||
|
{getFlowType(item.flowType)}
|
||||||
|
</Text>
|
||||||
|
<Text className="text-lg text-orange-500 font-semibold">
|
||||||
|
¥{Number(item.money).toFixed(2)}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{item.comments && (
|
||||||
|
<View className="flex justify-between items-center mb-1">
|
||||||
|
<Text className="text-sm text-gray-400">
|
||||||
|
{item.comments}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<View className="flex justify-between items-center mb-1">
|
||||||
|
<Text className="text-sm text-gray-400">
|
||||||
|
{item.createTime}
|
||||||
|
</Text>
|
||||||
|
<Text className="text-sm text-gray-400">
|
||||||
|
我的收益:{item.money}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className="min-h-screen bg-gray-50">
|
||||||
|
<PullToRefresh
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
disabled={refreshing}
|
||||||
|
pullingText="下拉刷新"
|
||||||
|
canReleaseText="释放刷新"
|
||||||
|
refreshingText="刷新中..."
|
||||||
|
completeText="刷新完成"
|
||||||
|
>
|
||||||
|
<ScrollView
|
||||||
|
scrollY
|
||||||
|
className={'h-screen'}
|
||||||
|
onScrollToLower={handleLoadMore}
|
||||||
|
lowerThreshold={50}
|
||||||
|
>
|
||||||
|
{/*筛选工具条*/}
|
||||||
|
<Space
|
||||||
|
className={'px-4 mt-4'}
|
||||||
|
>
|
||||||
|
<Text className={'text-sm'} onClick={() => setShow1(true)}>{date ? `${date}` : '请选择'}</Text>
|
||||||
|
<ArrowDown size={10} className={'text-gray-400'} onClick={() => setShow1(true)}/>
|
||||||
|
</Space>
|
||||||
|
{/*账单列表*/}
|
||||||
|
<View className="p-4">
|
||||||
|
{loading && capital.length === 0 ? (
|
||||||
|
<View className="text-center py-8">
|
||||||
|
<Loading/>
|
||||||
|
<Text className="text-gray-500 mt-2">加载中...</Text>
|
||||||
|
</View>
|
||||||
|
) : capital.length > 0 ? (
|
||||||
|
<>
|
||||||
|
{capital.map(renderCapitalItem)}
|
||||||
|
{loadingMore && (
|
||||||
|
<View className="text-center py-4">
|
||||||
|
<Loading/>
|
||||||
|
<Text className="text-gray-500 mt-1 text-sm">加载更多...</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
{!hasMore && capital.length > 0 && (
|
||||||
|
<View className="text-center py-4">
|
||||||
|
<Text className="text-gray-400 text-sm">没有更多数据了</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<Empty description="暂无收益" style={{
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}}/>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</PullToRefresh>
|
||||||
|
<DatePicker
|
||||||
|
title="日期选择"
|
||||||
|
visible={show1}
|
||||||
|
pickerProps={{
|
||||||
|
popupProps: {zIndex: 1220},
|
||||||
|
}}
|
||||||
|
defaultValue={new Date(`${currDate}`)}
|
||||||
|
showChinese
|
||||||
|
onCancel={() => setShow1(false)}
|
||||||
|
onConfirm={(_, values) => {
|
||||||
|
setShow1(false)
|
||||||
|
setDate(`${values[0]}${values[1]}`)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DealerCapital
|
||||||
4
src/dealer/customer/add.config.ts
Normal file
4
src/dealer/customer/add.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '客户报备',
|
||||||
|
navigationBarTextStyle: 'black'
|
||||||
|
})
|
||||||
429
src/dealer/customer/add.tsx
Normal file
429
src/dealer/customer/add.tsx
Normal file
@@ -0,0 +1,429 @@
|
|||||||
|
import {useEffect, useState, useRef} from "react";
|
||||||
|
import {Loading, CellGroup, Cell, Input, Form, Calendar} from '@nutui/nutui-react-taro'
|
||||||
|
import {Edit, Calendar as CalendarIcon} from '@nutui/icons-react-taro'
|
||||||
|
import Taro from '@tarojs/taro'
|
||||||
|
import {useRouter} from '@tarojs/taro'
|
||||||
|
import {View, Text} from '@tarojs/components'
|
||||||
|
import FixedButton from "@/components/FixedButton";
|
||||||
|
import {useUser} from "@/hooks/useUser";
|
||||||
|
import {ShopDealerApply} from "@/api/shop/shopDealerApply/model";
|
||||||
|
import {
|
||||||
|
addShopDealerApply, getShopDealerApply, pageShopDealerApply,
|
||||||
|
updateShopDealerApply
|
||||||
|
} from "@/api/shop/shopDealerApply";
|
||||||
|
import {
|
||||||
|
formatDateForDatabase,
|
||||||
|
extractDateForCalendar, formatDateForDisplay
|
||||||
|
} from "@/utils/dateUtils";
|
||||||
|
import {ShopDealerUser} from "@/api/shop/shopDealerUser/model";
|
||||||
|
import {getShopDealerUser, pageShopDealerUser} from "@/api/shop/shopDealerUser";
|
||||||
|
|
||||||
|
const AddShopDealerApply = () => {
|
||||||
|
const {user} = useUser()
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
|
const [FormData, setFormData] = useState<ShopDealerApply>()
|
||||||
|
const formRef = useRef<any>(null)
|
||||||
|
const [isEditMode, setIsEditMode] = useState<boolean>(false)
|
||||||
|
const [existingApply, setExistingApply] = useState<ShopDealerApply | null>(null)
|
||||||
|
const [referee, setReferee] = useState<ShopDealerUser>()
|
||||||
|
|
||||||
|
// 日期选择器状态
|
||||||
|
const [showApplyTimePicker, setShowApplyTimePicker] = useState<boolean>(false)
|
||||||
|
const [showContractTimePicker, setShowContractTimePicker] = useState<boolean>(false)
|
||||||
|
const [applyTime, setApplyTime] = useState<string>('')
|
||||||
|
const [contractTime, setContractTime] = useState<string>('')
|
||||||
|
|
||||||
|
// 获取审核状态文字
|
||||||
|
const getApplyStatusText = (status?: number) => {
|
||||||
|
switch (status) {
|
||||||
|
case 10:
|
||||||
|
return '待审核'
|
||||||
|
case 20:
|
||||||
|
return '已签约'
|
||||||
|
case 30:
|
||||||
|
return '已取消'
|
||||||
|
default:
|
||||||
|
return '未知状态'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(getApplyStatusText)
|
||||||
|
|
||||||
|
// 处理签约时间选择
|
||||||
|
const handleApplyTimeConfirm = (param: string) => {
|
||||||
|
const selectedDate = param[3] // 选中的日期字符串 (YYYY-M-D)
|
||||||
|
const formattedDate = formatDateForDatabase(selectedDate) // 转换为数据库格式
|
||||||
|
setApplyTime(selectedDate) // 保存原始格式用于显示
|
||||||
|
setShowApplyTimePicker(false)
|
||||||
|
|
||||||
|
// 更新表单数据(使用数据库格式)
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
applyTime: formattedDate
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理合同日期选择
|
||||||
|
const handleContractTimeConfirm = (param: string) => {
|
||||||
|
const selectedDate = param[3] // 选中的日期字符串 (YYYY-M-D)
|
||||||
|
const formattedDate = formatDateForDatabase(selectedDate) // 转换为数据库格式
|
||||||
|
setContractTime(selectedDate) // 保存原始格式用于显示
|
||||||
|
setShowContractTimePicker(false)
|
||||||
|
|
||||||
|
// 更新表单数据(使用数据库格式)
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
contractTime: formattedDate
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const reload = async () => {
|
||||||
|
// 查询推荐人信息
|
||||||
|
const dealerUser = await getShopDealerUser(Number(Taro.getStorageSync('UserId')))
|
||||||
|
setReferee(dealerUser)
|
||||||
|
|
||||||
|
if (!params.id) {
|
||||||
|
setLoading(false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 查询当前用户ID是否已有申请记录
|
||||||
|
try {
|
||||||
|
const dealerApply = await getShopDealerApply(Number(params.id));
|
||||||
|
if (dealerApply) {
|
||||||
|
setFormData(dealerApply)
|
||||||
|
setIsEditMode(true);
|
||||||
|
setExistingApply(dealerApply)
|
||||||
|
|
||||||
|
// 初始化日期数据(从数据库格式转换为Calendar组件格式)
|
||||||
|
if (dealerApply.applyTime) {
|
||||||
|
setApplyTime(extractDateForCalendar(dealerApply.applyTime))
|
||||||
|
}
|
||||||
|
if (dealerApply.contractTime) {
|
||||||
|
setContractTime(extractDateForCalendar(dealerApply.contractTime))
|
||||||
|
}
|
||||||
|
|
||||||
|
Taro.setNavigationBarTitle({title: '签约'})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
setLoading(false)
|
||||||
|
console.error('查询申请记录失败:', error);
|
||||||
|
setIsEditMode(false);
|
||||||
|
setExistingApply(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
// 计算保护期过期时间(7天后)
|
||||||
|
const calculateExpirationTime = (): string => {
|
||||||
|
const now = new Date();
|
||||||
|
const expirationDate = new Date(now);
|
||||||
|
expirationDate.setDate(now.getDate() + 7); // 7天后
|
||||||
|
|
||||||
|
// 格式化为数据库需要的格式:YYYY-MM-DD HH:mm:ss
|
||||||
|
const year = expirationDate.getFullYear();
|
||||||
|
const month = String(expirationDate.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(expirationDate.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(expirationDate.getHours()).padStart(2, '0');
|
||||||
|
const minutes = String(expirationDate.getMinutes()).padStart(2, '0');
|
||||||
|
const seconds = String(expirationDate.getSeconds()).padStart(2, '0');
|
||||||
|
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitSucceed = async (values: any) => {
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 验证必填字段
|
||||||
|
if (!values.mobile || values.mobile.trim() === '') {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写联系方式',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证手机号格式
|
||||||
|
const phoneRegex = /^1[3-9]\d{9}$/;
|
||||||
|
if (!phoneRegex.test(values.mobile)) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写正确的手机号',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证报备人是否存在
|
||||||
|
if (values.userId > 0) {
|
||||||
|
const isExist = await pageShopDealerUser({userId: Number(values.userId)});
|
||||||
|
if(isExist && isExist.count == 0){
|
||||||
|
Taro.showToast({
|
||||||
|
title: '报备人不存在',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查客户是否已存在
|
||||||
|
const res = await pageShopDealerApply({dealerName: values.dealerName, type: 4, applyStatus: 10});
|
||||||
|
|
||||||
|
if (res && res.count > 0) {
|
||||||
|
const existingCustomer = res.list[0];
|
||||||
|
|
||||||
|
// 检查是否在7天保护期内
|
||||||
|
if (!isEditMode && existingCustomer.applyTime) {
|
||||||
|
// 将申请时间字符串转换为时间戳进行比较
|
||||||
|
const applyTimeStamp = new Date(existingCustomer.applyTime).getTime();
|
||||||
|
const currentTimeStamp = new Date().getTime();
|
||||||
|
const sevenDaysInMs = 7 * 24 * 60 * 60 * 1000; // 7天的毫秒数
|
||||||
|
|
||||||
|
// 如果在7天保护期内,不允许重复添加
|
||||||
|
if (currentTimeStamp - applyTimeStamp < sevenDaysInMs) {
|
||||||
|
const remainingDays = Math.ceil((sevenDaysInMs - (currentTimeStamp - applyTimeStamp)) / (24 * 60 * 60 * 1000));
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: `该客户还在保护期,还需等待${remainingDays}天后才能重新添加`,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
// 超过7天保护期,可以重新添加,显示确认对话框
|
||||||
|
const modalResult = await new Promise<boolean>((resolve) => {
|
||||||
|
Taro.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '该客户已超过7天保护期,是否重新添加跟进?',
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '取消',
|
||||||
|
confirmText: '确定',
|
||||||
|
success: (modalRes) => {
|
||||||
|
resolve(modalRes.confirm);
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
resolve(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!modalResult) {
|
||||||
|
return false; // 用户取消,不继续执行
|
||||||
|
}
|
||||||
|
// 用户确认后继续执行添加逻辑
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 计算过期时间
|
||||||
|
const expirationTime = isEditMode ? existingApply?.expirationTime : calculateExpirationTime();
|
||||||
|
|
||||||
|
// 准备提交的数据
|
||||||
|
const submitData = {
|
||||||
|
...values,
|
||||||
|
type: 4,
|
||||||
|
realName: values.realName || user?.nickname,
|
||||||
|
mobile: values.mobile,
|
||||||
|
refereeId: referee?.refereeId,
|
||||||
|
applyStatus: isEditMode ? 20 : 10,
|
||||||
|
auditTime: undefined,
|
||||||
|
// 设置保护期过期时间(7天后)
|
||||||
|
expirationTime: expirationTime,
|
||||||
|
// 确保日期数据正确提交(使用数据库格式)
|
||||||
|
applyTime: values.applyTime || (applyTime ? formatDateForDatabase(applyTime) : ''),
|
||||||
|
contractTime: values.contractTime || (contractTime ? formatDateForDatabase(contractTime) : '')
|
||||||
|
};
|
||||||
|
|
||||||
|
// 调试信息
|
||||||
|
console.log('=== 提交数据调试 ===');
|
||||||
|
console.log('是否编辑模式:', isEditMode);
|
||||||
|
console.log('计算的过期时间:', expirationTime);
|
||||||
|
console.log('提交的数据:', submitData);
|
||||||
|
console.log('==================');
|
||||||
|
|
||||||
|
// 如果是编辑模式,添加现有申请的id
|
||||||
|
if (isEditMode && existingApply?.applyId) {
|
||||||
|
submitData.applyId = existingApply.applyId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行新增或更新操作
|
||||||
|
if (isEditMode) {
|
||||||
|
await updateShopDealerApply(submitData);
|
||||||
|
} else {
|
||||||
|
await addShopDealerApply(submitData);
|
||||||
|
}
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: `${isEditMode ? '更新' : '提交'}成功`,
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
Taro.navigateBack();
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('提交失败:', error);
|
||||||
|
Taro.showToast({
|
||||||
|
title: '提交失败,请重试',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理固定按钮点击事件
|
||||||
|
const handleFixedButtonClick = () => {
|
||||||
|
// 触发表单提交
|
||||||
|
formRef.current?.submit();
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitFailed = (error: any) => {
|
||||||
|
console.log(error, 'err...')
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
reload().then(() => {
|
||||||
|
setLoading(false)
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('页面加载失败:', error);
|
||||||
|
setLoading(false);
|
||||||
|
Taro.showToast({
|
||||||
|
title: '页面加载失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}, []); // 依赖用户ID,当用户变化时重新加载
|
||||||
|
|
||||||
|
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)}
|
||||||
|
>
|
||||||
|
<View className={'bg-gray-100 h-3'}></View>
|
||||||
|
<CellGroup style={{padding: '4px 0'}}>
|
||||||
|
<Form.Item name="dealerName" label="公司名称" initialValue={FormData?.dealerName} required>
|
||||||
|
<Input placeholder="公司名称" maxLength={10} disabled={isEditMode}/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item name="realName" label="联系人" initialValue={FormData?.realName} required>
|
||||||
|
<Input placeholder="请输入联系人" disabled={isEditMode}/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item name="mobile" label="联系方式1" initialValue={FormData?.mobile} required>
|
||||||
|
<Input placeholder="请输入手机号" disabled={isEditMode} maxLength={11}/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item name="address" label="公司地址" initialValue={FormData?.address} required>
|
||||||
|
<Input placeholder="请输入详细地址" disabled={isEditMode}/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item name="dealerCode" label="户号" initialValue={FormData?.dealerCode} required>
|
||||||
|
<Input placeholder="请填写户号" disabled={isEditMode}/>
|
||||||
|
</Form.Item>
|
||||||
|
{isEditMode && (
|
||||||
|
<>
|
||||||
|
<Form.Item name="money" label="签约价格" initialValue={FormData?.money} required>
|
||||||
|
<Input placeholder="(元/兆瓦时)" disabled={false}/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item name="applyTime" label="签约时间" initialValue={FormData?.applyTime}>
|
||||||
|
<View
|
||||||
|
className="flex items-center justify-between py-2"
|
||||||
|
onClick={() => setShowApplyTimePicker(true)}
|
||||||
|
>
|
||||||
|
<View className="flex items-center">
|
||||||
|
<CalendarIcon size={16} color="#999" className="mr-2"/>
|
||||||
|
<Text style={{color: applyTime ? '#333' : '#999'}}>
|
||||||
|
{applyTime ? formatDateForDisplay(applyTime) : '请选择签约时间'}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item name="contractTime" label="合同日期" initialValue={FormData?.contractTime}>
|
||||||
|
<View
|
||||||
|
className="flex items-center justify-between py-2"
|
||||||
|
onClick={() => setShowContractTimePicker(true)}
|
||||||
|
>
|
||||||
|
<View className="flex items-center">
|
||||||
|
<CalendarIcon size={16} color="#999" className="mr-2"/>
|
||||||
|
<Text style={{color: contractTime ? '#333' : '#999'}}>
|
||||||
|
{contractTime ? formatDateForDisplay(contractTime) : '请选择合同生效起止时间'}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</Form.Item>
|
||||||
|
{/*<Form.Item name="refereeId" label="邀请人ID" initialValue={FormData?.refereeId} required>*/}
|
||||||
|
{/* <Input placeholder="邀请人ID"/>*/}
|
||||||
|
{/*</Form.Item>*/}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
<Form.Item name="userId" label="报备人" initialValue={FormData?.userId}>
|
||||||
|
<Input
|
||||||
|
placeholder="自己报备请留空"
|
||||||
|
disabled={isEditMode}
|
||||||
|
value={(FormData?.userId)?.toString() || ''}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</CellGroup>
|
||||||
|
</Form>
|
||||||
|
|
||||||
|
{/* 签约时间选择器 */}
|
||||||
|
<Calendar
|
||||||
|
visible={showApplyTimePicker}
|
||||||
|
defaultValue={applyTime}
|
||||||
|
onClose={() => setShowApplyTimePicker(false)}
|
||||||
|
onConfirm={handleApplyTimeConfirm}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* 合同日期选择器 */}
|
||||||
|
<Calendar
|
||||||
|
visible={showContractTimePicker}
|
||||||
|
defaultValue={contractTime}
|
||||||
|
onClose={() => setShowContractTimePicker(false)}
|
||||||
|
onConfirm={handleContractTimeConfirm}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* 审核状态显示(仅在编辑模式下显示) */}
|
||||||
|
{isEditMode && (
|
||||||
|
<CellGroup>
|
||||||
|
{/*<Cell*/}
|
||||||
|
{/* title={'审核状态'}*/}
|
||||||
|
{/* extra={*/}
|
||||||
|
{/* <span style={{*/}
|
||||||
|
{/* color: FormData?.applyStatus === 20 ? '#52c41a' :*/}
|
||||||
|
{/* FormData?.applyStatus === 30 ? '#ff4d4f' : '#faad14'*/}
|
||||||
|
{/* }}>*/}
|
||||||
|
{/* {getApplyStatusText(FormData?.applyStatus)}*/}
|
||||||
|
{/* </span>*/}
|
||||||
|
{/* }*/}
|
||||||
|
{/*/>*/}
|
||||||
|
{FormData?.applyStatus === 20 && (
|
||||||
|
<Cell title={'签约时间'} extra={FormData?.auditTime || '无'}/>
|
||||||
|
)}
|
||||||
|
{FormData?.applyStatus === 30 && (
|
||||||
|
<Cell title={'驳回原因'} extra={FormData?.rejectReason || '无'}/>
|
||||||
|
)}
|
||||||
|
</CellGroup>
|
||||||
|
)}
|
||||||
|
|
||||||
|
|
||||||
|
{/* 底部浮动按钮 */}
|
||||||
|
{(!isEditMode || FormData?.applyStatus === 10) && (
|
||||||
|
<FixedButton
|
||||||
|
icon={<Edit/>}
|
||||||
|
text={'立即提交'}
|
||||||
|
onClick={handleFixedButtonClick}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AddShopDealerApply;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user