251229
This commit is contained in:
@@ -1,12 +1,7 @@
|
||||
VITE_APP_NAME=后台管理系统
|
||||
VITE_SOCKET_URL=wss://server.gxwebsoft.com
|
||||
VITE_THINK_URL=https://gxtyzx-api.websoft.top/api
|
||||
#VITE_API_URL=https://ngb-service-api.websoft.top/api
|
||||
VITE_SOCKET_URL=wss://shop-server-api.ggsxiangan.com
|
||||
VITE_THINK_URL=https://server.websoft.top/api
|
||||
#VITE_API_URL=https://shop-api.ggsxiangan.com/api
|
||||
VITE_API_URL=http://127.0.0.1:9013/api
|
||||
|
||||
|
||||
VITE_SERVER_URL=https://server.gxwebsoft.com/api
|
||||
#VITE_SERVER_URL=http://127.0.0.1:9090/api
|
||||
VITE_API_URL=http://127.0.0.1:9002/api
|
||||
#VITE_THINK_URL=http://127.0.0.1:9099/api
|
||||
#/booking/bookingItem
|
||||
F
|
||||
VITE_SERVER_URL=https://server.websoft.top/api
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
VITE_APP_NAME=后台管理系统
|
||||
VITE_SOCKET_URL=wss://server.gxwebsoft.com
|
||||
VITE_SERVER_URL=https://server.gxwebsoft.com/api
|
||||
VITE_THINK_URL=https://gxtyzx-api.websoft.top/api
|
||||
VITE_API_URL=https://ngb-service-api.websoft.top/api
|
||||
VITE_SOCKET_URL=wss://clinic-api.websoft.top
|
||||
VITE_THINK_URL=https://clinic-api.websoft.top/api
|
||||
VITE_API_URL=https://clinic-api.websoft.top/api
|
||||
VITE_SERVER_URL=https://server.websoft.top/api
|
||||
|
||||
106
src/api/clinic/case/index.ts
Normal file
106
src/api/clinic/case/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Case, CaseParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询病例列表
|
||||
*/
|
||||
export async function pageCase(params: CaseParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Case>>>(
|
||||
MODULES_API_URL + '/clinic/case/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询病例列表列表
|
||||
*/
|
||||
export async function listCase(params?: CaseParam) {
|
||||
const res = await request.get<ApiResult<Case[]>>(
|
||||
MODULES_API_URL + '/clinic/case',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加病例列表
|
||||
*/
|
||||
export async function addCase(data: Case) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/case',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改病例列表
|
||||
*/
|
||||
export async function updateCase(data: Case) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/case',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除病例列表
|
||||
*/
|
||||
export async function removeCase(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/case/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除病例列表
|
||||
*/
|
||||
export async function removeBatchCase(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/case/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询病例列表
|
||||
*/
|
||||
export async function getCase(id: number) {
|
||||
const res = await request.get<ApiResult<Case>>(
|
||||
MODULES_API_URL + '/clinic/case/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
src/api/clinic/case/model/index.ts
Normal file
47
src/api/clinic/case/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 病例列表
|
||||
*/
|
||||
export interface Case {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
userId?: number;
|
||||
// 医生用户id
|
||||
doctorUserId?: number;
|
||||
// 病情主诉
|
||||
patientCondition?: string;
|
||||
// 既往史
|
||||
pastHistory?: string;
|
||||
// 过敏史
|
||||
allergyHistory?: string;
|
||||
// 诊断
|
||||
diagnostic?: string;
|
||||
// 治疗方案
|
||||
plan?: string;
|
||||
// 照片
|
||||
photoList?: string;
|
||||
// 0待审核 1通过 2拒绝
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 病例列表搜索条件
|
||||
*/
|
||||
export interface CaseParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/clinic/clinicAppointment/index.ts
Normal file
105
src/api/clinic/clinicAppointment/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicAppointment, ClinicAppointmentParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询挂号
|
||||
*/
|
||||
export async function pageClinicAppointment(params: ClinicAppointmentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicAppointment>>>(
|
||||
'/clinic/clinic-appointment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询挂号列表
|
||||
*/
|
||||
export async function listClinicAppointment(params?: ClinicAppointmentParam) {
|
||||
const res = await request.get<ApiResult<ClinicAppointment[]>>(
|
||||
'/clinic/clinic-appointment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加挂号
|
||||
*/
|
||||
export async function addClinicAppointment(data: ClinicAppointment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-appointment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改挂号
|
||||
*/
|
||||
export async function updateClinicAppointment(data: ClinicAppointment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-appointment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除挂号
|
||||
*/
|
||||
export async function removeClinicAppointment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-appointment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除挂号
|
||||
*/
|
||||
export async function removeBatchClinicAppointment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-appointment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询挂号
|
||||
*/
|
||||
export async function getClinicAppointment(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicAppointment>>(
|
||||
'/clinic/clinic-appointment/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
src/api/clinic/clinicAppointment/model/index.ts
Normal file
47
src/api/clinic/clinicAppointment/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 挂号
|
||||
*/
|
||||
export interface ClinicAppointment {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 类型
|
||||
type?: number;
|
||||
// 就诊原因
|
||||
reason?: string;
|
||||
// 挂号时间
|
||||
evaluateTime?: string;
|
||||
// 医生
|
||||
doctorId?: number;
|
||||
// 医生名称
|
||||
doctorName?: string;
|
||||
// 医生职位
|
||||
doctorPosition?: string;
|
||||
// 患者
|
||||
userId?: number;
|
||||
// 患者名称
|
||||
nickname?: string;
|
||||
// 患者联系电话
|
||||
phone?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除
|
||||
isDelete?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂号搜索条件
|
||||
*/
|
||||
export interface ClinicAppointmentParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/clinic/clinicCase/index.ts
Normal file
106
src/api/clinic/clinicCase/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicCase, ClinicCaseParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询病例列表
|
||||
*/
|
||||
export async function pageClinicCase(params: ClinicCaseParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicCase>>>(
|
||||
MODULES_API_URL + '/clinic/clinic-case/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询病例列表列表
|
||||
*/
|
||||
export async function listClinicCase(params?: ClinicCaseParam) {
|
||||
const res = await request.get<ApiResult<ClinicCase[]>>(
|
||||
MODULES_API_URL + '/clinic/clinic-case',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加病例列表
|
||||
*/
|
||||
export async function addClinicCase(data: ClinicCase) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/clinic-case',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改病例列表
|
||||
*/
|
||||
export async function updateClinicCase(data: ClinicCase) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/clinic-case',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除病例列表
|
||||
*/
|
||||
export async function removeClinicCase(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/clinic-case/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除病例列表
|
||||
*/
|
||||
export async function removeBatchClinicCase(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/clinic-case/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询病例列表
|
||||
*/
|
||||
export async function getClinicCase(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicCase>>(
|
||||
MODULES_API_URL + '/clinic/clinic-case/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
src/api/clinic/clinicCase/model/index.ts
Normal file
47
src/api/clinic/clinicCase/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 病例列表
|
||||
*/
|
||||
export interface ClinicCase {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
userId?: number;
|
||||
// 医生用户id
|
||||
doctorUserId?: number;
|
||||
// 病情主诉
|
||||
patientCondition?: string;
|
||||
// 既往史
|
||||
pastHistory?: string;
|
||||
// 过敏史
|
||||
allergyHistory?: string;
|
||||
// 诊断
|
||||
diagnostic?: string;
|
||||
// 治疗方案
|
||||
plan?: string;
|
||||
// 照片
|
||||
photoList?: string;
|
||||
// 0待审核 1通过 2拒绝
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 病例列表搜索条件
|
||||
*/
|
||||
export interface ClinicCaseParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/clinic/clinicDoctorApply/index.ts
Normal file
105
src/api/clinic/clinicDoctorApply/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicDoctorApply, ClinicDoctorApplyParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询医生入驻申请
|
||||
*/
|
||||
export async function pageClinicDoctorApply(params: ClinicDoctorApplyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicDoctorApply>>>(
|
||||
'/clinic/clinic-doctor-apply/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询医生入驻申请列表
|
||||
*/
|
||||
export async function listClinicDoctorApply(params?: ClinicDoctorApplyParam) {
|
||||
const res = await request.get<ApiResult<ClinicDoctorApply[]>>(
|
||||
'/clinic/clinic-doctor-apply',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加医生入驻申请
|
||||
*/
|
||||
export async function addClinicDoctorApply(data: ClinicDoctorApply) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改医生入驻申请
|
||||
*/
|
||||
export async function updateClinicDoctorApply(data: ClinicDoctorApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除医生入驻申请
|
||||
*/
|
||||
export async function removeClinicDoctorApply(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除医生入驻申请
|
||||
*/
|
||||
export async function removeBatchClinicDoctorApply(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-apply/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询医生入驻申请
|
||||
*/
|
||||
export async function getClinicDoctorApply(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicDoctorApply>>(
|
||||
'/clinic/clinic-doctor-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
* 医生入驻申请
|
||||
*/
|
||||
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;
|
||||
}
|
||||
105
src/api/clinic/clinicDoctorMedicalRecord/index.ts
Normal file
105
src/api/clinic/clinicDoctorMedicalRecord/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicDoctorMedicalRecord, ClinicDoctorMedicalRecordParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询医疗记录
|
||||
*/
|
||||
export async function pageClinicDoctorMedicalRecord(params: ClinicDoctorMedicalRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicDoctorMedicalRecord>>>(
|
||||
'/clinic/clinic-doctor-medical-record/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询医疗记录列表
|
||||
*/
|
||||
export async function listClinicDoctorMedicalRecord(params?: ClinicDoctorMedicalRecordParam) {
|
||||
const res = await request.get<ApiResult<ClinicDoctorMedicalRecord[]>>(
|
||||
'/clinic/clinic-doctor-medical-record',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加医疗记录
|
||||
*/
|
||||
export async function addClinicDoctorMedicalRecord(data: ClinicDoctorMedicalRecord) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-medical-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改医疗记录
|
||||
*/
|
||||
export async function updateClinicDoctorMedicalRecord(data: ClinicDoctorMedicalRecord) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-medical-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除医疗记录
|
||||
*/
|
||||
export async function removeClinicDoctorMedicalRecord(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-medical-record/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除医疗记录
|
||||
*/
|
||||
export async function removeBatchClinicDoctorMedicalRecord(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-medical-record/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询医疗记录
|
||||
*/
|
||||
export async function getClinicDoctorMedicalRecord(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicDoctorMedicalRecord>>(
|
||||
'/clinic/clinic-doctor-medical-record/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
* 医疗记录
|
||||
*/
|
||||
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;
|
||||
}
|
||||
105
src/api/clinic/clinicDoctorUser/index.ts
Normal file
105
src/api/clinic/clinicDoctorUser/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicDoctorUser, ClinicDoctorUserParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商用户记录表
|
||||
*/
|
||||
export async function pageClinicDoctorUser(params: ClinicDoctorUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicDoctorUser>>>(
|
||||
'/clinic/clinic-doctor-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商用户记录表列表
|
||||
*/
|
||||
export async function listClinicDoctorUser(params?: ClinicDoctorUserParam) {
|
||||
const res = await request.get<ApiResult<ClinicDoctorUser[]>>(
|
||||
'/clinic/clinic-doctor-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商用户记录表
|
||||
*/
|
||||
export async function addClinicDoctorUser(data: ClinicDoctorUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商用户记录表
|
||||
*/
|
||||
export async function updateClinicDoctorUser(data: ClinicDoctorUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商用户记录表
|
||||
*/
|
||||
export async function removeClinicDoctorUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商用户记录表
|
||||
*/
|
||||
export async function removeBatchClinicDoctorUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-doctor-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商用户记录表
|
||||
*/
|
||||
export async function getClinicDoctorUser(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicDoctorUser>>(
|
||||
'/clinic/clinic-doctor-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
src/api/clinic/clinicDoctorUser/model/index.ts
Normal file
55
src/api/clinic/clinicDoctorUser/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商用户记录表
|
||||
*/
|
||||
export interface ClinicDoctorUser {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 类型 0经销商 1企业 2集团
|
||||
type?: number;
|
||||
// 自增ID
|
||||
userId?: number;
|
||||
// 姓名
|
||||
realName?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 部门
|
||||
departmentId?: number;
|
||||
// 专业领域
|
||||
specialty?: string;
|
||||
// 职务级别
|
||||
position?: string;
|
||||
// 执业资格
|
||||
qualification?: string;
|
||||
// 医生简介
|
||||
introduction?: string;
|
||||
// 挂号费
|
||||
consultationFee?: string;
|
||||
// 工作年限
|
||||
workYears?: number;
|
||||
// 问诊人数
|
||||
consultationCount?: number;
|
||||
// 专属二维码
|
||||
qrcode?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除
|
||||
isDelete?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商用户记录表搜索条件
|
||||
*/
|
||||
export interface ClinicDoctorUserParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/clinic/clinicList/index.ts
Normal file
106
src/api/clinic/clinicList/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicList, ClinicListParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询诊所列表
|
||||
*/
|
||||
export async function pageClinicList(params: ClinicListParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicList>>>(
|
||||
MODULES_API_URL + '/clinic/clinic-list/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询诊所列表列表
|
||||
*/
|
||||
export async function listClinicList(params?: ClinicListParam) {
|
||||
const res = await request.get<ApiResult<ClinicList[]>>(
|
||||
MODULES_API_URL + '/clinic/clinic-list',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加诊所列表
|
||||
*/
|
||||
export async function addClinicList(data: ClinicList) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/clinic-list',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改诊所列表
|
||||
*/
|
||||
export async function updateClinicList(data: ClinicList) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/clinic-list',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除诊所列表
|
||||
*/
|
||||
export async function removeClinicList(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/clinic-list/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除诊所列表
|
||||
*/
|
||||
export async function removeBatchClinicList(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/clinic-list/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询诊所列表
|
||||
*/
|
||||
export async function getClinicList(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicList>>(
|
||||
MODULES_API_URL + '/clinic/clinic-list/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
53
src/api/clinic/clinicList/model/index.ts
Normal file
53
src/api/clinic/clinicList/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 诊所列表
|
||||
*/
|
||||
export interface ClinicList {
|
||||
//
|
||||
id?: number;
|
||||
// 名称
|
||||
name?: string;
|
||||
// 省份id
|
||||
provinceId?: number;
|
||||
// 城市id
|
||||
cityId?: number;
|
||||
// 区域id
|
||||
regionId?: number;
|
||||
// 管理员id
|
||||
userId?: number;
|
||||
// 详细地址
|
||||
address?: string;
|
||||
// 联系方式
|
||||
contact?: string;
|
||||
// logo
|
||||
logo?: string;
|
||||
// 资质
|
||||
qualify?: string;
|
||||
// 0待审核 1通过 2拒绝
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
//
|
||||
lat?: string;
|
||||
//
|
||||
lng?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 诊所列表搜索条件
|
||||
*/
|
||||
export interface ClinicListParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/clinic/clinicMedicalHistory/index.ts
Normal file
105
src/api/clinic/clinicMedicalHistory/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicMedicalHistory, ClinicMedicalHistoryParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询病例
|
||||
*/
|
||||
export async function pageClinicMedicalHistory(params: ClinicMedicalHistoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicMedicalHistory>>>(
|
||||
'/clinic/clinic-medical-history/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询病例列表
|
||||
*/
|
||||
export async function listClinicMedicalHistory(params?: ClinicMedicalHistoryParam) {
|
||||
const res = await request.get<ApiResult<ClinicMedicalHistory[]>>(
|
||||
'/clinic/clinic-medical-history',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加病例
|
||||
*/
|
||||
export async function addClinicMedicalHistory(data: ClinicMedicalHistory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medical-history',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改病例
|
||||
*/
|
||||
export async function updateClinicMedicalHistory(data: ClinicMedicalHistory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medical-history',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除病例
|
||||
*/
|
||||
export async function removeClinicMedicalHistory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medical-history/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除病例
|
||||
*/
|
||||
export async function removeBatchClinicMedicalHistory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medical-history/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询病例
|
||||
*/
|
||||
export async function getClinicMedicalHistory(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicMedicalHistory>>(
|
||||
'/clinic/clinic-medical-history/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
* 病例
|
||||
*/
|
||||
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;
|
||||
}
|
||||
105
src/api/clinic/clinicMedicine/index.ts
Normal file
105
src/api/clinic/clinicMedicine/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicMedicine, ClinicMedicineParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询药品库
|
||||
*/
|
||||
export async function pageClinicMedicine(params: ClinicMedicineParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicMedicine>>>(
|
||||
'/clinic/clinic-medicine/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询药品库列表
|
||||
*/
|
||||
export async function listClinicMedicine(params?: ClinicMedicineParam) {
|
||||
const res = await request.get<ApiResult<ClinicMedicine[]>>(
|
||||
'/clinic/clinic-medicine',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加药品库
|
||||
*/
|
||||
export async function addClinicMedicine(data: ClinicMedicine) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改药品库
|
||||
*/
|
||||
export async function updateClinicMedicine(data: ClinicMedicine) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除药品库
|
||||
*/
|
||||
export async function removeClinicMedicine(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除药品库
|
||||
*/
|
||||
export async function removeBatchClinicMedicine(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询药品库
|
||||
*/
|
||||
export async function getClinicMedicine(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicMedicine>>(
|
||||
'/clinic/clinic-medicine/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
* 药品库
|
||||
*/
|
||||
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;
|
||||
}
|
||||
105
src/api/clinic/clinicMedicineInout/index.ts
Normal file
105
src/api/clinic/clinicMedicineInout/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicMedicineInout, ClinicMedicineInoutParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询出入库
|
||||
*/
|
||||
export async function pageClinicMedicineInout(params: ClinicMedicineInoutParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicMedicineInout>>>(
|
||||
'/clinic/clinic-medicine-inout/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出入库列表
|
||||
*/
|
||||
export async function listClinicMedicineInout(params?: ClinicMedicineInoutParam) {
|
||||
const res = await request.get<ApiResult<ClinicMedicineInout[]>>(
|
||||
'/clinic/clinic-medicine-inout',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加出入库
|
||||
*/
|
||||
export async function addClinicMedicineInout(data: ClinicMedicineInout) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine-inout',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出入库
|
||||
*/
|
||||
export async function updateClinicMedicineInout(data: ClinicMedicineInout) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine-inout',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出入库
|
||||
*/
|
||||
export async function removeClinicMedicineInout(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine-inout/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除出入库
|
||||
*/
|
||||
export async function removeBatchClinicMedicineInout(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine-inout/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询出入库
|
||||
*/
|
||||
export async function getClinicMedicineInout(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicMedicineInout>>(
|
||||
'/clinic/clinic-medicine-inout/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
* 出入库
|
||||
*/
|
||||
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;
|
||||
}
|
||||
105
src/api/clinic/clinicMedicineStock/index.ts
Normal file
105
src/api/clinic/clinicMedicineStock/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicMedicineStock, ClinicMedicineStockParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询药品库存
|
||||
*/
|
||||
export async function pageClinicMedicineStock(params: ClinicMedicineStockParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicMedicineStock>>>(
|
||||
'/clinic/clinic-medicine-stock/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询药品库存列表
|
||||
*/
|
||||
export async function listClinicMedicineStock(params?: ClinicMedicineStockParam) {
|
||||
const res = await request.get<ApiResult<ClinicMedicineStock[]>>(
|
||||
'/clinic/clinic-medicine-stock',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加药品库存
|
||||
*/
|
||||
export async function addClinicMedicineStock(data: ClinicMedicineStock) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine-stock',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改药品库存
|
||||
*/
|
||||
export async function updateClinicMedicineStock(data: ClinicMedicineStock) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine-stock',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除药品库存
|
||||
*/
|
||||
export async function removeClinicMedicineStock(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine-stock/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除药品库存
|
||||
*/
|
||||
export async function removeBatchClinicMedicineStock(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-medicine-stock/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询药品库存
|
||||
*/
|
||||
export async function getClinicMedicineStock(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicMedicineStock>>(
|
||||
'/clinic/clinic-medicine-stock/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
* 药品库存
|
||||
*/
|
||||
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;
|
||||
}
|
||||
105
src/api/clinic/clinicOrder/index.ts
Normal file
105
src/api/clinic/clinicOrder/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicOrder, ClinicOrderParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询处方订单
|
||||
*/
|
||||
export async function pageClinicOrder(params: ClinicOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicOrder>>>(
|
||||
'/clinic/clinic-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询处方订单列表
|
||||
*/
|
||||
export async function listClinicOrder(params?: ClinicOrderParam) {
|
||||
const res = await request.get<ApiResult<ClinicOrder[]>>(
|
||||
'/clinic/clinic-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加处方订单
|
||||
*/
|
||||
export async function addClinicOrder(data: ClinicOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改处方订单
|
||||
*/
|
||||
export async function updateClinicOrder(data: ClinicOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除处方订单
|
||||
*/
|
||||
export async function removeClinicOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除处方订单
|
||||
*/
|
||||
export async function removeBatchClinicOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询处方订单
|
||||
*/
|
||||
export async function getClinicOrder(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicOrder>>(
|
||||
'/clinic/clinic-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
* 处方订单
|
||||
*/
|
||||
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;
|
||||
}
|
||||
105
src/api/clinic/clinicPatientUser/index.ts
Normal file
105
src/api/clinic/clinicPatientUser/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicPatientUser, ClinicPatientUserParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询患者
|
||||
*/
|
||||
export async function pageClinicPatientUser(params: ClinicPatientUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicPatientUser>>>(
|
||||
'/clinic/clinic-patient-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询患者列表
|
||||
*/
|
||||
export async function listClinicPatientUser(params?: ClinicPatientUserParam) {
|
||||
const res = await request.get<ApiResult<ClinicPatientUser[]>>(
|
||||
'/clinic/clinic-patient-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加患者
|
||||
*/
|
||||
export async function addClinicPatientUser(data: ClinicPatientUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-patient-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改患者
|
||||
*/
|
||||
export async function updateClinicPatientUser(data: ClinicPatientUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-patient-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除患者
|
||||
*/
|
||||
export async function removeClinicPatientUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-patient-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除患者
|
||||
*/
|
||||
export async function removeBatchClinicPatientUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-patient-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询患者
|
||||
*/
|
||||
export async function getClinicPatientUser(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicPatientUser>>(
|
||||
'/clinic/clinic-patient-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
49
src/api/clinic/clinicPatientUser/model/index.ts
Normal file
49
src/api/clinic/clinicPatientUser/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 患者
|
||||
*/
|
||||
export interface ClinicPatientUser {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 类型 0经销商 1企业 2集团
|
||||
type?: number;
|
||||
// 自增ID
|
||||
userId?: number;
|
||||
// 姓名
|
||||
realName?: string;
|
||||
// 性别
|
||||
sex?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 年龄
|
||||
age?: number;
|
||||
// 身高
|
||||
height?: number;
|
||||
// 体重
|
||||
weight?: number;
|
||||
// 过敏史
|
||||
allergyHistory?: string;
|
||||
// 专属二维码
|
||||
qrcode?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除
|
||||
isDelete?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 患者搜索条件
|
||||
*/
|
||||
export interface ClinicPatientUserParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
112
src/api/clinic/clinicPrescription/index.ts
Normal file
112
src/api/clinic/clinicPrescription/index.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicPrescription, ClinicPrescriptionParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询处方主表
|
||||
|
||||
*/
|
||||
export async function pageClinicPrescription(params: ClinicPrescriptionParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicPrescription>>>(
|
||||
'/clinic/clinic-prescription/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询处方主表
|
||||
列表
|
||||
*/
|
||||
export async function listClinicPrescription(params?: ClinicPrescriptionParam) {
|
||||
const res = await request.get<ApiResult<ClinicPrescription[]>>(
|
||||
'/clinic/clinic-prescription',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加处方主表
|
||||
|
||||
*/
|
||||
export async function addClinicPrescription(data: ClinicPrescription) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-prescription',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改处方主表
|
||||
|
||||
*/
|
||||
export async function updateClinicPrescription(data: ClinicPrescription) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-prescription',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除处方主表
|
||||
|
||||
*/
|
||||
export async function removeClinicPrescription(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-prescription/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除处方主表
|
||||
|
||||
*/
|
||||
export async function removeBatchClinicPrescription(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-prescription/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询处方主表
|
||||
|
||||
*/
|
||||
export async function getClinicPrescription(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicPrescription>>(
|
||||
'/clinic/clinic-prescription/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
60
src/api/clinic/clinicPrescription/model/index.ts
Normal file
60
src/api/clinic/clinicPrescription/model/index.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { ClinicPrescriptionItem } from '../../clinicPrescriptionItem/model';
|
||||
|
||||
/**
|
||||
* 处方主表
|
||||
|
||||
*/
|
||||
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;
|
||||
// 处方药品
|
||||
items?: ClinicPrescriptionItem[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 处方主表
|
||||
搜索条件
|
||||
*/
|
||||
export interface ClinicPrescriptionParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
112
src/api/clinic/clinicPrescriptionItem/index.ts
Normal file
112
src/api/clinic/clinicPrescriptionItem/index.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicPrescriptionItem, ClinicPrescriptionItemParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询处方明细表
|
||||
|
||||
*/
|
||||
export async function pageClinicPrescriptionItem(params: ClinicPrescriptionItemParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicPrescriptionItem>>>(
|
||||
'/clinic/clinic-prescription-item/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询处方明细表
|
||||
列表
|
||||
*/
|
||||
export async function listClinicPrescriptionItem(params?: ClinicPrescriptionItemParam) {
|
||||
const res = await request.get<ApiResult<ClinicPrescriptionItem[]>>(
|
||||
'/clinic/clinic-prescription-item',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加处方明细表
|
||||
|
||||
*/
|
||||
export async function addClinicPrescriptionItem(data: ClinicPrescriptionItem) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-prescription-item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改处方明细表
|
||||
|
||||
*/
|
||||
export async function updateClinicPrescriptionItem(data: ClinicPrescriptionItem) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-prescription-item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除处方明细表
|
||||
|
||||
*/
|
||||
export async function removeClinicPrescriptionItem(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-prescription-item/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除处方明细表
|
||||
|
||||
*/
|
||||
export async function removeBatchClinicPrescriptionItem(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-prescription-item/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询处方明细表
|
||||
|
||||
*/
|
||||
export async function getClinicPrescriptionItem(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicPrescriptionItem>>(
|
||||
'/clinic/clinic-prescription-item/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
* 处方明细表
|
||||
|
||||
*/
|
||||
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;
|
||||
}
|
||||
105
src/api/clinic/clinicReport/index.ts
Normal file
105
src/api/clinic/clinicReport/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicReport, ClinicReportParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询报告
|
||||
*/
|
||||
export async function pageClinicReport(params: ClinicReportParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicReport>>>(
|
||||
'/clinic/clinic-report/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报告列表
|
||||
*/
|
||||
export async function listClinicReport(params?: ClinicReportParam) {
|
||||
const res = await request.get<ApiResult<ClinicReport[]>>(
|
||||
'/clinic/clinic-report',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加报告
|
||||
*/
|
||||
export async function addClinicReport(data: ClinicReport) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-report',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报告
|
||||
*/
|
||||
export async function updateClinicReport(data: ClinicReport) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-report',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报告
|
||||
*/
|
||||
export async function removeClinicReport(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-report/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除报告
|
||||
*/
|
||||
export async function removeBatchClinicReport(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-report/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询报告
|
||||
*/
|
||||
export async function getClinicReport(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicReport>>(
|
||||
'/clinic/clinic-report/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
* 报告
|
||||
*/
|
||||
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;
|
||||
}
|
||||
105
src/api/clinic/clinicVisitRecord/index.ts
Normal file
105
src/api/clinic/clinicVisitRecord/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ClinicVisitRecord, ClinicVisitRecordParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询病例
|
||||
*/
|
||||
export async function pageClinicVisitRecord(params: ClinicVisitRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ClinicVisitRecord>>>(
|
||||
'/clinic/clinic-visit-record/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询病例列表
|
||||
*/
|
||||
export async function listClinicVisitRecord(params?: ClinicVisitRecordParam) {
|
||||
const res = await request.get<ApiResult<ClinicVisitRecord[]>>(
|
||||
'/clinic/clinic-visit-record',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加病例
|
||||
*/
|
||||
export async function addClinicVisitRecord(data: ClinicVisitRecord) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/clinic/clinic-visit-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改病例
|
||||
*/
|
||||
export async function updateClinicVisitRecord(data: ClinicVisitRecord) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/clinic/clinic-visit-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除病例
|
||||
*/
|
||||
export async function removeClinicVisitRecord(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-visit-record/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除病例
|
||||
*/
|
||||
export async function removeBatchClinicVisitRecord(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/clinic/clinic-visit-record/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询病例
|
||||
*/
|
||||
export async function getClinicVisitRecord(id: number) {
|
||||
const res = await request.get<ApiResult<ClinicVisitRecord>>(
|
||||
'/clinic/clinic-visit-record/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
* 病例
|
||||
*/
|
||||
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;
|
||||
}
|
||||
113
src/api/clinic/prescriptionOrder/index.ts
Normal file
113
src/api/clinic/prescriptionOrder/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { PrescriptionOrder, PrescriptionOrderParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询处方主表
|
||||
|
||||
*/
|
||||
export async function pagePrescriptionOrder(params: PrescriptionOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<PrescriptionOrder>>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询处方主表
|
||||
列表
|
||||
*/
|
||||
export async function listPrescriptionOrder(params?: PrescriptionOrderParam) {
|
||||
const res = await request.get<ApiResult<PrescriptionOrder[]>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加处方主表
|
||||
|
||||
*/
|
||||
export async function addPrescriptionOrder(data: PrescriptionOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改处方主表
|
||||
|
||||
*/
|
||||
export async function updatePrescriptionOrder(data: PrescriptionOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除处方主表
|
||||
|
||||
*/
|
||||
export async function removePrescriptionOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除处方主表
|
||||
|
||||
*/
|
||||
export async function removeBatchPrescriptionOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询处方主表
|
||||
|
||||
*/
|
||||
export async function getPrescriptionOrder(id: number) {
|
||||
const res = await request.get<ApiResult<PrescriptionOrder>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
65
src/api/clinic/prescriptionOrder/model/index.ts
Normal file
65
src/api/clinic/prescriptionOrder/model/index.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 处方主表
|
||||
|
||||
*/
|
||||
export interface PrescriptionOrder {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
//
|
||||
clinicId?: number;
|
||||
// 患者
|
||||
userId?: number;
|
||||
// 医生
|
||||
doctorId?: number;
|
||||
//
|
||||
orderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 关联就诊表
|
||||
visitRecordId?: number;
|
||||
// 处方类型 0中药 1西药
|
||||
prescriptionType?: number;
|
||||
// 诊断结果
|
||||
diagnosis?: string;
|
||||
// 治疗方案
|
||||
treatmentPlan?: string;
|
||||
// 煎药说明
|
||||
decoctionInstructions?: string;
|
||||
// 上传照片
|
||||
image?: string;
|
||||
// 订单总金额
|
||||
orderPrice?: string;
|
||||
// 单价
|
||||
price?: string;
|
||||
// 实付金额
|
||||
payPrice?: string;
|
||||
// 订单是否失效(0未失效 1已失效)
|
||||
isInvalid?: number;
|
||||
// 结算(0未结算 1已结算)
|
||||
isSettled?: number;
|
||||
// 结算时间
|
||||
settleTime?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1已完成,2已支付,3已取消
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处方主表
|
||||
搜索条件
|
||||
*/
|
||||
export interface PrescriptionOrderParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
113
src/api/clinic/prescriptionOrderItem/index.ts
Normal file
113
src/api/clinic/prescriptionOrderItem/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { PrescriptionOrderItem, PrescriptionOrderItemParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询处方明细表
|
||||
|
||||
*/
|
||||
export async function pagePrescriptionOrderItem(params: PrescriptionOrderItemParam) {
|
||||
const res = await request.get<ApiResult<PageResult<PrescriptionOrderItem>>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询处方明细表
|
||||
列表
|
||||
*/
|
||||
export async function listPrescriptionOrderItem(params?: PrescriptionOrderItemParam) {
|
||||
const res = await request.get<ApiResult<PrescriptionOrderItem[]>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加处方明细表
|
||||
|
||||
*/
|
||||
export async function addPrescriptionOrderItem(data: PrescriptionOrderItem) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改处方明细表
|
||||
|
||||
*/
|
||||
export async function updatePrescriptionOrderItem(data: PrescriptionOrderItem) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除处方明细表
|
||||
|
||||
*/
|
||||
export async function removePrescriptionOrderItem(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除处方明细表
|
||||
|
||||
*/
|
||||
export async function removeBatchPrescriptionOrderItem(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询处方明细表
|
||||
|
||||
*/
|
||||
export async function getPrescriptionOrderItem(id: number) {
|
||||
const res = await request.get<ApiResult<PrescriptionOrderItem>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
49
src/api/clinic/prescriptionOrderItem/model/index.ts
Normal file
49
src/api/clinic/prescriptionOrderItem/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 处方明细表
|
||||
|
||||
*/
|
||||
export interface PrescriptionOrderItem {
|
||||
// 自增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 PrescriptionOrderItemParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/coupon/index.ts
Normal file
106
src/api/shop/coupon/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Coupon, CouponParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageCoupon(params: CouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Coupon>>>(
|
||||
MODULES_API_URL + '/shop/coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listCoupon(params?: CouponParam) {
|
||||
const res = await request.get<ApiResult<Coupon[]>>(
|
||||
MODULES_API_URL + '/shop/coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addCoupon(data: Coupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateCoupon(data: Coupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<Coupon>>(
|
||||
MODULES_API_URL + '/shop/coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
src/api/shop/coupon/model/index.ts
Normal file
43
src/api/shop/coupon/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface Coupon {
|
||||
//
|
||||
id?: number;
|
||||
// 0满减 1折扣
|
||||
type?: number;
|
||||
// 过期类型0领取计算 1固定时间
|
||||
expireType?: number;
|
||||
// 起始金额
|
||||
startAmount?: string;
|
||||
// 抵扣金额
|
||||
reduceAmount?: string;
|
||||
// 折扣比例
|
||||
reduceRate?: string;
|
||||
// 过期天数
|
||||
expireDay?: number;
|
||||
// 过期时间(固定)
|
||||
expireEndDate?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface CouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -104,3 +104,14 @@ export async function getDealerWithdraw(id: number) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
|
||||
export async function getDealerWithdrawUnCheckNum() {
|
||||
const res = await request.get<ApiResult<number>>(
|
||||
MODULES_API_URL + '/shop/dealer-withdraw/uncheck-num'
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ export interface Goods {
|
||||
memberStoreRate?: string;
|
||||
memberMarketRate?: string;
|
||||
memberStoreCommission?: string;
|
||||
shareIncome?: string;
|
||||
supplierCommission?: string;
|
||||
coopCommission?: string;
|
||||
memberStorePrice?: string;
|
||||
|
||||
106
src/api/shop/merchantCollect/index.ts
Normal file
106
src/api/shop/merchantCollect/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MerchantCollect, MerchantCollectParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageMerchantCollect(params: MerchantCollectParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MerchantCollect>>>(
|
||||
MODULES_API_URL + '/shop/merchant-collect/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listMerchantCollect(params?: MerchantCollectParam) {
|
||||
const res = await request.get<ApiResult<MerchantCollect[]>>(
|
||||
MODULES_API_URL + '/shop/merchant-collect',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addMerchantCollect(data: MerchantCollect) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-collect',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateMerchantCollect(data: MerchantCollect) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-collect',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeMerchantCollect(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-collect/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchMerchantCollect(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-collect/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getMerchantCollect(id: number) {
|
||||
const res = await request.get<ApiResult<MerchantCollect>>(
|
||||
MODULES_API_URL + '/shop/merchant-collect/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/shop/merchantCollect/model/index.ts
Normal file
31
src/api/shop/merchantCollect/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface MerchantCollect {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
merchantId?: number;
|
||||
//
|
||||
userId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface MerchantCollectParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/merchantOfflinePay/index.ts
Normal file
106
src/api/shop/merchantOfflinePay/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MerchantOfflinePay, MerchantOfflinePayParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商铺线下支付
|
||||
*/
|
||||
export async function pageMerchantOfflinePay(params: MerchantOfflinePayParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MerchantOfflinePay>>>(
|
||||
MODULES_API_URL + '/shop/merchant-offline-pay/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商铺线下支付列表
|
||||
*/
|
||||
export async function listMerchantOfflinePay(params?: MerchantOfflinePayParam) {
|
||||
const res = await request.get<ApiResult<MerchantOfflinePay[]>>(
|
||||
MODULES_API_URL + '/shop/merchant-offline-pay',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商铺线下支付
|
||||
*/
|
||||
export async function addMerchantOfflinePay(data: MerchantOfflinePay) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-offline-pay',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商铺线下支付
|
||||
*/
|
||||
export async function updateMerchantOfflinePay(data: MerchantOfflinePay) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-offline-pay',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商铺线下支付
|
||||
*/
|
||||
export async function removeMerchantOfflinePay(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-offline-pay/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商铺线下支付
|
||||
*/
|
||||
export async function removeBatchMerchantOfflinePay(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-offline-pay/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商铺线下支付
|
||||
*/
|
||||
export async function getMerchantOfflinePay(id: number) {
|
||||
const res = await request.get<ApiResult<MerchantOfflinePay>>(
|
||||
MODULES_API_URL + '/shop/merchant-offline-pay/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/shop/merchantOfflinePay/model/index.ts
Normal file
31
src/api/shop/merchantOfflinePay/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商铺线下支付
|
||||
*/
|
||||
export interface MerchantOfflinePay {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
merchantId?: number;
|
||||
//
|
||||
amount?: string;
|
||||
//
|
||||
isPaid?: number;
|
||||
//
|
||||
userId?: number;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商铺线下支付搜索条件
|
||||
*/
|
||||
export interface MerchantOfflinePayParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/merchantVoiceDevice/index.ts
Normal file
106
src/api/shop/merchantVoiceDevice/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MerchantVoiceDevice, MerchantVoiceDeviceParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商铺播报设备
|
||||
*/
|
||||
export async function pageMerchantVoiceDevice(params: MerchantVoiceDeviceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MerchantVoiceDevice>>>(
|
||||
MODULES_API_URL + '/shop/merchant-voice-device/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商铺播报设备列表
|
||||
*/
|
||||
export async function listMerchantVoiceDevice(params?: MerchantVoiceDeviceParam) {
|
||||
const res = await request.get<ApiResult<MerchantVoiceDevice[]>>(
|
||||
MODULES_API_URL + '/shop/merchant-voice-device',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商铺播报设备
|
||||
*/
|
||||
export async function addMerchantVoiceDevice(data: MerchantVoiceDevice) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-voice-device',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商铺播报设备
|
||||
*/
|
||||
export async function updateMerchantVoiceDevice(data: MerchantVoiceDevice) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-voice-device',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商铺播报设备
|
||||
*/
|
||||
export async function removeMerchantVoiceDevice(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-voice-device/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商铺播报设备
|
||||
*/
|
||||
export async function removeBatchMerchantVoiceDevice(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-voice-device/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商铺播报设备
|
||||
*/
|
||||
export async function getMerchantVoiceDevice(id: number) {
|
||||
const res = await request.get<ApiResult<MerchantVoiceDevice>>(
|
||||
MODULES_API_URL + '/shop/merchant-voice-device/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/shop/merchantVoiceDevice/model/index.ts
Normal file
31
src/api/shop/merchantVoiceDevice/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商铺播报设备
|
||||
*/
|
||||
export interface MerchantVoiceDevice {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
merchantId?: number;
|
||||
//
|
||||
sbxId?: string;
|
||||
//
|
||||
deleted?: string;
|
||||
//
|
||||
userId?: number;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商铺播报设备搜索条件
|
||||
*/
|
||||
export interface MerchantVoiceDeviceParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -17,3 +17,14 @@ export async function addOrderDelivery(data: OrderDelivery) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function updateOrderDelivery(data: OrderDelivery) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-delivery',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
106
src/api/shop/orderRefund/index.ts
Normal file
106
src/api/shop/orderRefund/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderRefund, OrderRefundParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageOrderRefund(params: OrderRefundParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderRefund>>>(
|
||||
MODULES_API_URL + '/shop/order-refund/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listOrderRefund(params?: OrderRefundParam) {
|
||||
const res = await request.get<ApiResult<OrderRefund[]>>(
|
||||
MODULES_API_URL + '/shop/order-refund',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addOrderRefund(data: OrderRefund) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-refund',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateOrderRefund(data: OrderRefund) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-refund',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeOrderRefund(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-refund/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchOrderRefund(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-refund/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getOrderRefund(id: number) {
|
||||
const res = await request.get<ApiResult<OrderRefund>>(
|
||||
MODULES_API_URL + '/shop/order-refund/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
41
src/api/shop/orderRefund/model/index.ts
Normal file
41
src/api/shop/orderRefund/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface OrderRefund {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
orderId?: number;
|
||||
// 退款单号
|
||||
orderRefundNo?: string;
|
||||
// 第三方退款单号
|
||||
refundTradeNo?: string;
|
||||
// 0退款中1成功2失败
|
||||
refundStatus?: number;
|
||||
//
|
||||
userId?: number;
|
||||
// 商家审核状态(0待审核 10已同意 20已拒绝)
|
||||
auditStatus?: number;
|
||||
// 退款金额
|
||||
refundMoney?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface OrderRefundParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/selfTake/index.ts
Normal file
106
src/api/shop/selfTake/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { SelfTake, SelfTakeParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询自提点
|
||||
*/
|
||||
export async function pageSelfTake(params: SelfTakeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<SelfTake>>>(
|
||||
MODULES_API_URL + '/shop/self-take/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询自提点列表
|
||||
*/
|
||||
export async function listSelfTake(params?: SelfTakeParam) {
|
||||
const res = await request.get<ApiResult<SelfTake[]>>(
|
||||
MODULES_API_URL + '/shop/self-take',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加自提点
|
||||
*/
|
||||
export async function addSelfTake(data: SelfTake) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/self-take',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改自提点
|
||||
*/
|
||||
export async function updateSelfTake(data: SelfTake) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/self-take',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除自提点
|
||||
*/
|
||||
export async function removeSelfTake(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/self-take/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除自提点
|
||||
*/
|
||||
export async function removeBatchSelfTake(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/self-take/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询自提点
|
||||
*/
|
||||
export async function getSelfTake(id: number) {
|
||||
const res = await request.get<ApiResult<SelfTake>>(
|
||||
MODULES_API_URL + '/shop/self-take/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
src/api/shop/selfTake/model/index.ts
Normal file
37
src/api/shop/selfTake/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 自提点
|
||||
*/
|
||||
export interface SelfTake {
|
||||
//
|
||||
id?: number;
|
||||
// 主键ID
|
||||
selfTakeId?: number;
|
||||
// 名称
|
||||
title?: string;
|
||||
// 地址
|
||||
address?: string;
|
||||
// 联系方式
|
||||
phone?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自提点搜索条件
|
||||
*/
|
||||
export interface SelfTakeParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/selfTakeUser/index.ts
Normal file
106
src/api/shop/selfTakeUser/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { SelfTakeUser, SelfTakeUserParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询自提点人员
|
||||
*/
|
||||
export async function pageSelfTakeUser(params: SelfTakeUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<SelfTakeUser>>>(
|
||||
MODULES_API_URL + '/shop/self-take-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询自提点人员列表
|
||||
*/
|
||||
export async function listSelfTakeUser(params?: SelfTakeUserParam) {
|
||||
const res = await request.get<ApiResult<SelfTakeUser[]>>(
|
||||
MODULES_API_URL + '/shop/self-take-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加自提点人员
|
||||
*/
|
||||
export async function addSelfTakeUser(data: SelfTakeUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/self-take-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改自提点人员
|
||||
*/
|
||||
export async function updateSelfTakeUser(data: SelfTakeUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/self-take-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除自提点人员
|
||||
*/
|
||||
export async function removeSelfTakeUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/self-take-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除自提点人员
|
||||
*/
|
||||
export async function removeBatchSelfTakeUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/self-take-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询自提点人员
|
||||
*/
|
||||
export async function getSelfTakeUser(id: number) {
|
||||
const res = await request.get<ApiResult<SelfTakeUser>>(
|
||||
MODULES_API_URL + '/shop/self-take-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
40
src/api/shop/selfTakeUser/model/index.ts
Normal file
40
src/api/shop/selfTakeUser/model/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 自提点人员
|
||||
*/
|
||||
export interface SelfTakeUser {
|
||||
//
|
||||
id?: number;
|
||||
// 自提点人员id
|
||||
selfTakeUserId?: number;
|
||||
// 自提点id
|
||||
selfTakeId?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 用户名
|
||||
username?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自提点人员搜索条件
|
||||
*/
|
||||
export interface SelfTakeUserParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
selfTakeId?: number;
|
||||
phone?: string;
|
||||
userId?: number;
|
||||
}
|
||||
106
src/api/shop/userCoupon/index.ts
Normal file
106
src/api/shop/userCoupon/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserCoupon, UserCouponParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageUserCoupon(params: UserCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserCoupon>>>(
|
||||
MODULES_API_URL + '/shop/user-coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listUserCoupon(params?: UserCouponParam) {
|
||||
const res = await request.get<ApiResult<UserCoupon[]>>(
|
||||
MODULES_API_URL + '/shop/user-coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addUserCoupon(data: UserCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateUserCoupon(data: UserCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeUserCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchUserCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/user-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getUserCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<UserCoupon>>(
|
||||
MODULES_API_URL + '/shop/user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
src/api/shop/userCoupon/model/index.ts
Normal file
37
src/api/shop/userCoupon/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface UserCoupon {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
couponId?: number;
|
||||
//
|
||||
orderId?: number;
|
||||
//
|
||||
used?: number;
|
||||
// 使用时间
|
||||
usedTime?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface UserCouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Users, UsersParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import {MODULES_API_URL, SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageUsers(params: UsersParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Users>>>(
|
||||
MODULES_API_URL + '/shop/users/page',
|
||||
SERVER_API_URL + '/system/user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { PageParam } from '@/api';
|
||||
*/
|
||||
export interface Users {
|
||||
//
|
||||
id?: number;
|
||||
userId?: number;
|
||||
// 用户唯一小程序id
|
||||
openId?: string;
|
||||
// 小程序用户秘钥
|
||||
|
||||
@@ -121,6 +121,7 @@ import {
|
||||
import type {TabCtxMenuOption} from 'ele-admin-pro/es/ele-pro-layout/types';
|
||||
import {hasPermission} from "@/utils/permission";
|
||||
import {getMerchantApplyUnCheckNum} from "@/api/shop/merchantApply";
|
||||
import {getDealerWithdrawUnCheckNum} from "@/api/shop/dealerWithdraw";
|
||||
|
||||
const {push} = useRouter();
|
||||
const {t, locale} = useI18n();
|
||||
@@ -163,6 +164,25 @@ const getUncheckNum = async () => {
|
||||
}
|
||||
getUncheckNum()
|
||||
|
||||
const cashUnCheckNum = ref<number>();
|
||||
const getCashUncheckNum = async () => {
|
||||
cashUnCheckNum.value = await getDealerWithdrawUnCheckNum();
|
||||
menus.value = menus.value?.map(menu => {
|
||||
console.log(menu.path)
|
||||
if (menu.path === '/shop') {
|
||||
menu.children.map(child => {
|
||||
console.log(child.path)
|
||||
if (child.path === '/shop/dealerWithdraw') {
|
||||
child.meta.badge = cashUnCheckNum.value
|
||||
}
|
||||
return child
|
||||
})
|
||||
}
|
||||
return menu
|
||||
})
|
||||
}
|
||||
getCashUncheckNum()
|
||||
|
||||
// 布局风格
|
||||
const {
|
||||
tabs,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 获取商户ID
|
||||
export const getMerchantId = () => {
|
||||
const merchantId = localStorage.getItem('MerchantId');
|
||||
if (merchantId) {
|
||||
if (merchantId && merchantId !== 'null') {
|
||||
return Number(merchantId);
|
||||
}
|
||||
return undefined;
|
||||
|
||||
@@ -10,8 +10,6 @@ import { API_BASE_URL, TOKEN_HEADER_NAME, LAYOUT_PATH } from '@/config/setting';
|
||||
import { getToken, setToken } from './token-util';
|
||||
import { logout } from './page-tab-util';
|
||||
import type { ApiResult } from '@/api';
|
||||
import { getHostname, getTenantId } from '@/utils/domain';
|
||||
import { getMerchantId } from "@/utils/merchant";
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: API_BASE_URL
|
||||
@@ -22,7 +20,7 @@ const service = axios.create({
|
||||
*/
|
||||
service.interceptors.request.use(
|
||||
(config) => {
|
||||
const TENANT_ID = localStorage.getItem('TenantId');
|
||||
// const TENANT_ID = localStorage.getItem('TenantId');
|
||||
const token = getToken();
|
||||
// 添加 token 到 header
|
||||
if (token && config.headers) {
|
||||
@@ -30,28 +28,29 @@ service.interceptors.request.use(
|
||||
}
|
||||
// 获取租户ID
|
||||
if (config.headers) {
|
||||
config.headers.common['TenantId'] = 10559;
|
||||
// 附加企业ID
|
||||
const companyId = localStorage.getItem('CompanyId');
|
||||
if (companyId) {
|
||||
config.headers.common['CompanyId'] = companyId;
|
||||
}
|
||||
// 附加商户ID
|
||||
if (getMerchantId()) {
|
||||
config.headers.common['MerchantId'] = getMerchantId();
|
||||
}
|
||||
// 通过网站域名获取租户ID
|
||||
if (getHostname()) {
|
||||
config.headers.common['Domain'] = getHostname();
|
||||
}
|
||||
// 解析二级域名获取租户ID
|
||||
if (getTenantId()) {
|
||||
config.headers.common['TenantId'] = getTenantId();
|
||||
return config;
|
||||
}
|
||||
if (TENANT_ID) {
|
||||
config.headers.common['TenantId'] = TENANT_ID;
|
||||
return config;
|
||||
}
|
||||
// const companyId = localStorage.getItem('CompanyId');
|
||||
// if (companyId) {
|
||||
// config.headers.common['CompanyId'] = companyId;
|
||||
// }
|
||||
// // 附加商户ID
|
||||
// if (getMerchantId()) {
|
||||
// config.headers.common['MerchantId'] = getMerchantId();
|
||||
// }
|
||||
// // 通过网站域名获取租户ID
|
||||
// if (getHostname()) {
|
||||
// config.headers.common['Domain'] = getHostname();
|
||||
// }
|
||||
// // 解析二级域名获取租户ID
|
||||
// if (getTenantId()) {
|
||||
// config.headers.common['TenantId'] = getTenantId();
|
||||
// return config;
|
||||
// }
|
||||
// if (TENANT_ID) {
|
||||
// config.headers.common['TenantId'] = TENANT_ID;
|
||||
// return config;
|
||||
// }
|
||||
}
|
||||
return config;
|
||||
},
|
||||
|
||||
268
src/views/clinic/case/components/caseEdit.vue
Normal file
268
src/views/clinic/case/components/caseEdit.vue
Normal file
@@ -0,0 +1,268 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑病例列表' : '添加病例列表'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="医生用户id" name="doctorUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入医生用户id"
|
||||
v-model:value="form.doctorUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="病情主诉" name="patientCondition">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入病情主诉"
|
||||
v-model:value="form.patientCondition"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="既往史" name="pastHistory">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入既往史"
|
||||
v-model:value="form.pastHistory"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="过敏史" name="allergyHistory">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入过敏史"
|
||||
v-model:value="form.allergyHistory"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="诊断" name="diagnostic">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入诊断"
|
||||
v-model:value="form.diagnostic"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="治疗方案" name="plan">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入治疗方案"
|
||||
v-model:value="form.plan"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="照片" name="photoList">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入照片"
|
||||
v-model:value="form.photoList"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="0待审核 1通过 2拒绝" name="status">
|
||||
<a-radio-group v-model:value="form.status">
|
||||
<a-radio :value="0">显示</a-radio>
|
||||
<a-radio :value="1">隐藏</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序号" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入是否删除, 0否, 1是"
|
||||
v-model:value="form.deleted"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="修改时间" name="updateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入修改时间"
|
||||
v-model:value="form.updateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addCase, updateCase } from '@/api/clinic/case';
|
||||
import { Case } from '@/api/clinic/case/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: Case | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<Case>({
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
doctorUserId: undefined,
|
||||
patientCondition: undefined,
|
||||
pastHistory: undefined,
|
||||
allergyHistory: undefined,
|
||||
diagnostic: undefined,
|
||||
plan: undefined,
|
||||
photoList: undefined,
|
||||
status: undefined,
|
||||
comments: undefined,
|
||||
sortNumber: undefined,
|
||||
deleted: undefined,
|
||||
tenantId: undefined,
|
||||
updateTime: undefined,
|
||||
createTime: undefined,
|
||||
caseId: undefined,
|
||||
caseName: '',
|
||||
status: 0,
|
||||
comments: '',
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
caseName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写病例列表名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateCase : addCase;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/case/components/search.vue
Normal file
42
src/views/clinic/case/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
293
src/views/clinic/case/index.vue
Normal file
293
src/views/clinic/case/index.vue
Normal file
@@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="caseId"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<CaseEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import CaseEdit from './components/caseEdit.vue';
|
||||
import { pageCase, removeCase, removeBatchCase } from '@/api/clinic/case';
|
||||
import type { Case, CaseParam } from '@/api/clinic/case/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<Case[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<Case | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageCase({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '医生用户id',
|
||||
dataIndex: 'doctorUserId',
|
||||
key: 'doctorUserId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '病情主诉',
|
||||
dataIndex: 'patientCondition',
|
||||
key: 'patientCondition',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '既往史',
|
||||
dataIndex: 'pastHistory',
|
||||
key: 'pastHistory',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '过敏史',
|
||||
dataIndex: 'allergyHistory',
|
||||
key: 'allergyHistory',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '诊断',
|
||||
dataIndex: 'diagnostic',
|
||||
key: 'diagnostic',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '治疗方案',
|
||||
dataIndex: 'plan',
|
||||
key: 'plan',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '照片',
|
||||
dataIndex: 'photoList',
|
||||
key: 'photoList',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '0待审核 1通过 2拒绝',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '排序号',
|
||||
dataIndex: 'sortNumber',
|
||||
key: 'sortNumber',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '是否删除, 0否, 1是',
|
||||
dataIndex: 'deleted',
|
||||
key: 'deleted',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updateTime',
|
||||
key: 'updateTime',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: CaseParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: Case) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: Case) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeCase(row.caseId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchCase(selection.value.map((d) => d.caseId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: Case) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Case'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,234 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑挂号' : '添加挂号'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<!-- <a-form-item label="类型" name="type">-->
|
||||
<!-- <a-input-->
|
||||
<!-- allow-clear-->
|
||||
<!-- placeholder="请输入类型"-->
|
||||
<!-- v-model:value="form.type"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="就诊原因" name="reason">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
disabled
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.reason"
|
||||
/>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="挂号时间" name="evaluateTime">-->
|
||||
<!-- <a-input-->
|
||||
<!-- allow-clear-->
|
||||
<!-- placeholder="请输入挂号时间"-->
|
||||
<!-- v-model:value="form.evaluateTime"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="医生" name="doctorId">-->
|
||||
<!-- <a-input-->
|
||||
<!-- allow-clear-->
|
||||
<!-- placeholder="请输入医生"-->
|
||||
<!-- v-model:value="form.doctorId"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="患者" name="userId">-->
|
||||
<!-- <a-input-->
|
||||
<!-- allow-clear-->
|
||||
<!-- placeholder="请输入患者"-->
|
||||
<!-- v-model:value="form.userId"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序号" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
/>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="是否删除" name="isDelete">-->
|
||||
<!-- <a-input-->
|
||||
<!-- allow-clear-->
|
||||
<!-- placeholder="请输入是否删除"-->
|
||||
<!-- v-model:value="form.isDelete"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="修改时间" name="updateTime">-->
|
||||
<!-- <a-input-->
|
||||
<!-- allow-clear-->
|
||||
<!-- placeholder="请输入修改时间"-->
|
||||
<!-- v-model:value="form.updateTime"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addClinicAppointment, updateClinicAppointment } from '@/api/clinic/clinicAppointment';
|
||||
import { ClinicAppointment } from '@/api/clinic/clinicAppointment/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicAppointment | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicAppointment>({
|
||||
id: undefined,
|
||||
type: undefined,
|
||||
reason: undefined,
|
||||
evaluateTime: undefined,
|
||||
doctorId: undefined,
|
||||
userId: undefined,
|
||||
comments: undefined,
|
||||
isDelete: undefined,
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicAppointmentName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写挂号名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicAppointment : addClinicAppointment;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/clinicAppointment/components/search.vue
Normal file
42
src/views/clinic/clinicAppointment/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
262
src/views/clinic/clinicAppointment/index.vue
Normal file
262
src/views/clinic/clinicAppointment/index.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'userId'">
|
||||
<div>{{ record.nickname }}</div>
|
||||
<div class="text-gray-400">{{ record.phone }}</div>
|
||||
</template>
|
||||
<template v-if="column.key === 'doctorId'">
|
||||
<div>{{ record.doctorName }}</div>
|
||||
<div class="text-gray-400">{{ record.doctorPosition }}</div>
|
||||
</template>
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicAppointmentEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import ClinicAppointmentEdit from './components/clinicAppointmentEdit.vue';
|
||||
import { pageClinicAppointment, removeClinicAppointment, removeBatchClinicAppointment } from '@/api/clinic/clinicAppointment';
|
||||
import type { ClinicAppointment, ClinicAppointmentParam } from '@/api/clinic/clinicAppointment/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicAppointment[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicAppointment | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicAppointment({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 完整的列配置(包含所有字段)
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '主键ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '患者',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId'
|
||||
},
|
||||
{
|
||||
title: '挂号医生',
|
||||
dataIndex: 'doctorId',
|
||||
key: 'doctorId'
|
||||
},
|
||||
// {
|
||||
// title: '类型',
|
||||
// dataIndex: 'type',
|
||||
// key: 'type',
|
||||
// width: 120
|
||||
// },
|
||||
{
|
||||
title: '就诊原因',
|
||||
dataIndex: 'reason',
|
||||
key: 'reason',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '排序号',
|
||||
dataIndex: 'sortNumber',
|
||||
key: 'sortNumber',
|
||||
width: 120
|
||||
},
|
||||
// {
|
||||
// title: '挂号时间',
|
||||
// dataIndex: 'evaluateTime',
|
||||
// key: 'evaluateTime',
|
||||
// width: 120
|
||||
// },
|
||||
{
|
||||
title: '挂号时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicAppointmentParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicAppointment) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicAppointment) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicAppointment(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicAppointment(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicAppointment) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicAppointment'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
268
src/views/clinic/clinicCase/components/clinicCaseEdit.vue
Normal file
268
src/views/clinic/clinicCase/components/clinicCaseEdit.vue
Normal file
@@ -0,0 +1,268 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑病例列表' : '添加病例列表'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="医生用户id" name="doctorUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入医生用户id"
|
||||
v-model:value="form.doctorUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="病情主诉" name="patientCondition">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入病情主诉"
|
||||
v-model:value="form.patientCondition"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="既往史" name="pastHistory">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入既往史"
|
||||
v-model:value="form.pastHistory"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="过敏史" name="allergyHistory">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入过敏史"
|
||||
v-model:value="form.allergyHistory"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="诊断" name="diagnostic">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入诊断"
|
||||
v-model:value="form.diagnostic"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="治疗方案" name="plan">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入治疗方案"
|
||||
v-model:value="form.plan"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="照片" name="photoList">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入照片"
|
||||
v-model:value="form.photoList"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="0待审核 1通过 2拒绝" name="status">
|
||||
<a-radio-group v-model:value="form.status">
|
||||
<a-radio :value="0">显示</a-radio>
|
||||
<a-radio :value="1">隐藏</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序号" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入是否删除, 0否, 1是"
|
||||
v-model:value="form.deleted"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="修改时间" name="updateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入修改时间"
|
||||
v-model:value="form.updateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addClinicCase, updateClinicCase } from '@/api/clinic/clinicCase';
|
||||
import { ClinicCase } from '@/api/clinic/clinicCase/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicCase | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicCase>({
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
doctorUserId: undefined,
|
||||
patientCondition: undefined,
|
||||
pastHistory: undefined,
|
||||
allergyHistory: undefined,
|
||||
diagnostic: undefined,
|
||||
plan: undefined,
|
||||
photoList: undefined,
|
||||
status: undefined,
|
||||
comments: undefined,
|
||||
sortNumber: undefined,
|
||||
deleted: undefined,
|
||||
tenantId: undefined,
|
||||
updateTime: undefined,
|
||||
createTime: undefined,
|
||||
clinicCaseId: undefined,
|
||||
clinicCaseName: '',
|
||||
status: 0,
|
||||
comments: '',
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicCaseName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写病例列表名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicCase : addClinicCase;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/clinicCase/components/search.vue
Normal file
42
src/views/clinic/clinicCase/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
293
src/views/clinic/clinicCase/index.vue
Normal file
293
src/views/clinic/clinicCase/index.vue
Normal file
@@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="clinicCaseId"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicCaseEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import ClinicCaseEdit from './components/clinicCaseEdit.vue';
|
||||
import { pageClinicCase, removeClinicCase, removeBatchClinicCase } from '@/api/clinic/clinicCase';
|
||||
import type { ClinicCase, ClinicCaseParam } from '@/api/clinic/clinicCase/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicCase[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicCase | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicCase({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '医生用户id',
|
||||
dataIndex: 'doctorUserId',
|
||||
key: 'doctorUserId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '病情主诉',
|
||||
dataIndex: 'patientCondition',
|
||||
key: 'patientCondition',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '既往史',
|
||||
dataIndex: 'pastHistory',
|
||||
key: 'pastHistory',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '过敏史',
|
||||
dataIndex: 'allergyHistory',
|
||||
key: 'allergyHistory',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '诊断',
|
||||
dataIndex: 'diagnostic',
|
||||
key: 'diagnostic',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '治疗方案',
|
||||
dataIndex: 'plan',
|
||||
key: 'plan',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '照片',
|
||||
dataIndex: 'photoList',
|
||||
key: 'photoList',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '0待审核 1通过 2拒绝',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '排序号',
|
||||
dataIndex: 'sortNumber',
|
||||
key: 'sortNumber',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '是否删除, 0否, 1是',
|
||||
dataIndex: 'deleted',
|
||||
key: 'deleted',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updateTime',
|
||||
key: 'updateTime',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicCaseParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicCase) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicCase) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicCase(row.clinicCaseId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicCase(selection.value.map((d) => d.clinicCaseId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicCase) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicCase'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,375 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑医生入驻申请' : '添加医生入驻申请'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="类型 0医生" name="type">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入类型 0医生"
|
||||
v-model:value="form.type"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="用户ID" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入用户ID"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="姓名" name="realName">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入姓名"
|
||||
v-model:value="form.realName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="性别 1男 2女" name="gender">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入性别 1男 2女"
|
||||
v-model:value="form.gender"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="手机号" name="mobile">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入手机号"
|
||||
v-model:value="form.mobile"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="客户名称" name="dealerName">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入客户名称"
|
||||
v-model:value="form.dealerName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="证件号码" name="idCard">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入证件号码"
|
||||
v-model:value="form.idCard"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="生日" name="birthDate">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入生日"
|
||||
v-model:value="form.birthDate"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="区分职称等级(如主治医师、副主任医师)" name="professionalTitle">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入区分职称等级(如主治医师、副主任医师)"
|
||||
v-model:value="form.professionalTitle"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="工作单位" name="workUnit">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入工作单位"
|
||||
v-model:value="form.workUnit"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="执业资格核心凭证" name="practiceLicense">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入执业资格核心凭证"
|
||||
v-model:value="form.practiceLicense"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="限定可执业科室或疾病类型" name="practiceScope">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入限定可执业科室或疾病类型"
|
||||
v-model:value="form.practiceScope"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="开始工作时间" name="startWorkDate">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入开始工作时间"
|
||||
v-model:value="form.startWorkDate"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="简历" name="resume">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入简历"
|
||||
v-model:value="form.resume"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="使用 JSON 存储多个证件文件路径(如执业证、学历证)" name="certificationFiles">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入使用 JSON 存储多个证件文件路径(如执业证、学历证)"
|
||||
v-model:value="form.certificationFiles"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="详细地址" name="address">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入详细地址"
|
||||
v-model:value="form.address"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="签约价格" name="money">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入签约价格"
|
||||
v-model:value="form.money"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="推荐人用户ID" name="refereeId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入推荐人用户ID"
|
||||
v-model:value="form.refereeId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="申请方式(10需后台审核 20无需审核)" name="applyType">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入申请方式(10需后台审核 20无需审核)"
|
||||
v-model:value="form.applyType"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="审核状态 (10待审核 20审核通过 30驳回)" name="applyStatus">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入审核状态 (10待审核 20审核通过 30驳回)"
|
||||
v-model:value="form.applyStatus"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="申请时间" name="applyTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入申请时间"
|
||||
v-model:value="form.applyTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="审核时间" name="auditTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入审核时间"
|
||||
v-model:value="form.auditTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="合同时间" name="contractTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入合同时间"
|
||||
v-model:value="form.contractTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="过期时间" name="expirationTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入过期时间"
|
||||
v-model:value="form.expirationTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="驳回原因" name="rejectReason">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入驳回原因"
|
||||
v-model:value="form.rejectReason"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="修改时间" name="updateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入修改时间"
|
||||
v-model:value="form.updateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addClinicDoctorApply, updateClinicDoctorApply } from '@/api/clinic/clinicDoctorApply';
|
||||
import { ClinicDoctorApply } from '@/api/clinic/clinicDoctorApply/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicDoctorApply | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicDoctorApply>({
|
||||
applyId: undefined,
|
||||
type: undefined,
|
||||
userId: undefined,
|
||||
realName: undefined,
|
||||
gender: undefined,
|
||||
mobile: undefined,
|
||||
dealerName: undefined,
|
||||
idCard: undefined,
|
||||
birthDate: undefined,
|
||||
professionalTitle: undefined,
|
||||
workUnit: undefined,
|
||||
practiceLicense: undefined,
|
||||
practiceScope: undefined,
|
||||
startWorkDate: undefined,
|
||||
resume: undefined,
|
||||
certificationFiles: undefined,
|
||||
address: undefined,
|
||||
money: undefined,
|
||||
refereeId: undefined,
|
||||
applyType: undefined,
|
||||
applyStatus: undefined,
|
||||
applyTime: undefined,
|
||||
auditTime: undefined,
|
||||
contractTime: undefined,
|
||||
expirationTime: undefined,
|
||||
rejectReason: undefined,
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
comments: '',
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicDoctorApplyName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写医生入驻申请名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicDoctorApply : addClinicDoctorApply;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/clinicDoctorApply/components/search.vue
Normal file
42
src/views/clinic/clinicDoctorApply/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
380
src/views/clinic/clinicDoctorApply/index.vue
Normal file
380
src/views/clinic/clinicDoctorApply/index.vue
Normal file
@@ -0,0 +1,380 @@
|
||||
<template>
|
||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicDoctorApplyEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref, computed } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import ClinicDoctorApplyEdit from './components/clinicDoctorApplyEdit.vue';
|
||||
import { pageClinicDoctorApply, removeClinicDoctorApply, removeBatchClinicDoctorApply } from '@/api/clinic/clinicDoctorApply';
|
||||
import type { ClinicDoctorApply, ClinicDoctorApplyParam } from '@/api/clinic/clinicDoctorApply/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicDoctorApply[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicDoctorApply | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicDoctorApply({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 完整的列配置(包含所有字段)
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '主键ID',
|
||||
dataIndex: 'applyId',
|
||||
key: 'applyId',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '类型 0医生',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '用户ID',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'realName',
|
||||
key: 'realName',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '性别 1男 2女',
|
||||
dataIndex: 'gender',
|
||||
key: 'gender',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'mobile',
|
||||
key: 'mobile',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '客户名称',
|
||||
dataIndex: 'dealerName',
|
||||
key: 'dealerName',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'idCard',
|
||||
key: 'idCard',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '生日',
|
||||
dataIndex: 'birthDate',
|
||||
key: 'birthDate',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '区分职称等级(如主治医师、副主任医师)',
|
||||
dataIndex: 'professionalTitle',
|
||||
key: 'professionalTitle',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '工作单位',
|
||||
dataIndex: 'workUnit',
|
||||
key: 'workUnit',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '执业资格核心凭证',
|
||||
dataIndex: 'practiceLicense',
|
||||
key: 'practiceLicense',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '限定可执业科室或疾病类型',
|
||||
dataIndex: 'practiceScope',
|
||||
key: 'practiceScope',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '开始工作时间',
|
||||
dataIndex: 'startWorkDate',
|
||||
key: 'startWorkDate',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '简历',
|
||||
dataIndex: 'resume',
|
||||
key: 'resume',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '使用 JSON 存储多个证件文件路径(如执业证、学历证)',
|
||||
dataIndex: 'certificationFiles',
|
||||
key: 'certificationFiles',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '详细地址',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '签约价格',
|
||||
dataIndex: 'money',
|
||||
key: 'money',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '推荐人用户ID',
|
||||
dataIndex: 'refereeId',
|
||||
key: 'refereeId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '申请方式(10需后台审核 20无需审核)',
|
||||
dataIndex: 'applyType',
|
||||
key: 'applyType',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '审核状态 (10待审核 20审核通过 30驳回)',
|
||||
dataIndex: 'applyStatus',
|
||||
key: 'applyStatus',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '申请时间',
|
||||
dataIndex: 'applyTime',
|
||||
key: 'applyTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '审核时间',
|
||||
dataIndex: 'auditTime',
|
||||
key: 'auditTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '合同时间',
|
||||
dataIndex: 'contractTime',
|
||||
key: 'contractTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '过期时间',
|
||||
dataIndex: 'expirationTime',
|
||||
key: 'expirationTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '驳回原因',
|
||||
dataIndex: 'rejectReason',
|
||||
key: 'rejectReason',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updateTime',
|
||||
key: 'updateTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicDoctorApplyParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicDoctorApply) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicDoctorApply) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicDoctorApply(row.applyId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicDoctorApply(selection.value.map((d) => d.applyId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicDoctorApply) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicDoctorApply'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,318 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑医疗记录' : '添加医疗记录'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="买家用户ID" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入买家用户ID"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单编号" name="orderNo">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单编号"
|
||||
v-model:value="form.orderNo"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销商用户id(一级)" name="firstUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销商用户id(一级)"
|
||||
v-model:value="form.firstUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销商用户id(二级)" name="secondUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销商用户id(二级)"
|
||||
v-model:value="form.secondUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销商用户id(三级)" name="thirdUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销商用户id(三级)"
|
||||
v-model:value="form.thirdUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销佣金(一级)" name="firstMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销佣金(一级)"
|
||||
v-model:value="form.firstMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销佣金(二级)" name="secondMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销佣金(二级)"
|
||||
v-model:value="form.secondMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销佣金(三级)" name="thirdMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销佣金(三级)"
|
||||
v-model:value="form.thirdMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单价" name="price">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入单价"
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单总金额" name="orderPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单总金额"
|
||||
v-model:value="form.orderPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="结算金额" name="settledPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入结算金额"
|
||||
v-model:value="form.settledPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="换算成度" name="degreePrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入换算成度"
|
||||
v-model:value="form.degreePrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="实发金额" name="payPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入实发金额"
|
||||
v-model:value="form.payPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="税率" name="rate">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入税率"
|
||||
v-model:value="form.rate"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="结算月份" name="month">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入结算月份"
|
||||
v-model:value="form.month"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单是否失效(0未失效 1已失效)" name="isInvalid">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单是否失效(0未失效 1已失效)"
|
||||
v-model:value="form.isInvalid"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="佣金结算(0未结算 1已结算)" name="isSettled">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入佣金结算(0未结算 1已结算)"
|
||||
v-model:value="form.isSettled"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="结算时间" name="settleTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入结算时间"
|
||||
v-model:value="form.settleTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="修改时间" name="updateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入修改时间"
|
||||
v-model:value="form.updateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addClinicDoctorMedicalRecord, updateClinicDoctorMedicalRecord } from '@/api/clinic/clinicDoctorMedicalRecord';
|
||||
import { ClinicDoctorMedicalRecord } from '@/api/clinic/clinicDoctorMedicalRecord/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicDoctorMedicalRecord | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicDoctorMedicalRecord>({
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
orderNo: undefined,
|
||||
firstUserId: undefined,
|
||||
secondUserId: undefined,
|
||||
thirdUserId: undefined,
|
||||
firstMoney: undefined,
|
||||
secondMoney: undefined,
|
||||
thirdMoney: undefined,
|
||||
price: undefined,
|
||||
orderPrice: undefined,
|
||||
settledPrice: undefined,
|
||||
degreePrice: undefined,
|
||||
payPrice: undefined,
|
||||
rate: undefined,
|
||||
month: undefined,
|
||||
isInvalid: undefined,
|
||||
isSettled: undefined,
|
||||
settleTime: undefined,
|
||||
comments: undefined,
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicDoctorMedicalRecordName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写医疗记录名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicDoctorMedicalRecord : addClinicDoctorMedicalRecord;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
232
src/views/clinic/clinicDoctorMedicalRecord/index.vue
Normal file
232
src/views/clinic/clinicDoctorMedicalRecord/index.vue
Normal file
@@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicDoctorMedicalRecordEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref, computed } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import ClinicDoctorMedicalRecordEdit from './components/clinicDoctorMedicalRecordEdit.vue';
|
||||
import { pageClinicDoctorMedicalRecord, removeClinicDoctorMedicalRecord, removeBatchClinicDoctorMedicalRecord } from '@/api/clinic/clinicDoctorMedicalRecord';
|
||||
import type { ClinicDoctorMedicalRecord, ClinicDoctorMedicalRecordParam } from '@/api/clinic/clinicDoctorMedicalRecord/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicDoctorMedicalRecord[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicDoctorMedicalRecord | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicDoctorMedicalRecord({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 完整的列配置(包含所有字段)
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '主键ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '买家用户ID',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '订单编号',
|
||||
dataIndex: 'orderNo',
|
||||
key: 'orderNo',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicDoctorMedicalRecordParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicDoctorMedicalRecord) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicDoctorMedicalRecord) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicDoctorMedicalRecord(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicDoctorMedicalRecord(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicDoctorMedicalRecord) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicDoctorMedicalRecord'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,274 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑医生' : '添加医生'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<!-- <a-form-item label="类型 0经销商 1企业 2集团" name="type">-->
|
||||
<!-- <a-input-->
|
||||
<!-- allow-clear-->
|
||||
<!-- placeholder="请输入类型 0经销商 1企业 2集团"-->
|
||||
<!-- v-model:value="form.type"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="自增ID" name="userId">-->
|
||||
<!-- <a-input-->
|
||||
<!-- allow-clear-->
|
||||
<!-- placeholder="请输入自增ID"-->
|
||||
<!-- v-model:value="form.userId"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="姓名" name="realName">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入姓名"
|
||||
v-model:value="form.realName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="部门" name="departmentId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入部门"
|
||||
v-model:value="form.departmentId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="专业领域" name="specialty">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入专业领域"
|
||||
v-model:value="form.specialty"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="职务级别" name="position">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入职务级别"
|
||||
v-model:value="form.position"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="执业资格" name="qualification">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入执业资格"
|
||||
v-model:value="form.qualification"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="医生简介" name="introduction">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入医生简介"
|
||||
v-model:value="form.introduction"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="挂号费" name="consultationFee">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入挂号费"
|
||||
v-model:value="form.consultationFee"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="工作年限" name="workYears">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入工作年限"
|
||||
v-model:value="form.workYears"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="问诊人数" name="consultationCount">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入问诊人数"
|
||||
v-model:value="form.consultationCount"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="专属二维码" name="qrcode">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入专属二维码"
|
||||
v-model:value="form.qrcode"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序号" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addClinicDoctorUser, updateClinicDoctorUser } from '@/api/clinic/clinicDoctorUser';
|
||||
import { ClinicDoctorUser } from '@/api/clinic/clinicDoctorUser/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicDoctorUser | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicDoctorUser>({
|
||||
id: undefined,
|
||||
type: undefined,
|
||||
userId: undefined,
|
||||
realName: undefined,
|
||||
departmentId: undefined,
|
||||
specialty: undefined,
|
||||
position: undefined,
|
||||
qualification: undefined,
|
||||
introduction: undefined,
|
||||
consultationFee: undefined,
|
||||
workYears: undefined,
|
||||
consultationCount: undefined,
|
||||
qrcode: undefined,
|
||||
comments: undefined,
|
||||
isDelete: undefined,
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicDoctorUserName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写医生名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicDoctorUser : addClinicDoctorUser;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/clinicDoctorUser/components/search.vue
Normal file
42
src/views/clinic/clinicDoctorUser/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
280
src/views/clinic/clinicDoctorUser/index.vue
Normal file
280
src/views/clinic/clinicDoctorUser/index.vue
Normal file
@@ -0,0 +1,280 @@
|
||||
<template>
|
||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicDoctorUserEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref, computed } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import ClinicDoctorUserEdit from './components/clinicDoctorUserEdit.vue';
|
||||
import { pageClinicDoctorUser, removeClinicDoctorUser, removeBatchClinicDoctorUser } from '@/api/clinic/clinicDoctorUser';
|
||||
import type { ClinicDoctorUser, ClinicDoctorUserParam } from '@/api/clinic/clinicDoctorUser/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicDoctorUser[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicDoctorUser | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicDoctorUser({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 完整的列配置(包含所有字段)
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '用户ID',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'realName',
|
||||
key: 'realName',
|
||||
ellipsis: true
|
||||
},
|
||||
// {
|
||||
// title: '部门',
|
||||
// dataIndex: 'departmentId',
|
||||
// key: 'departmentId',
|
||||
// width: 120
|
||||
// },
|
||||
{
|
||||
title: '专业领域',
|
||||
dataIndex: 'specialty',
|
||||
key: 'specialty',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '职务级别',
|
||||
dataIndex: 'position',
|
||||
key: 'position',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '执业资格',
|
||||
dataIndex: 'qualification',
|
||||
key: 'qualification',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '挂号费',
|
||||
dataIndex: 'consultationFee',
|
||||
key: 'consultationFee',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '工作年限',
|
||||
dataIndex: 'workYears',
|
||||
key: 'workYears',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '问诊人数',
|
||||
dataIndex: 'consultationCount',
|
||||
key: 'consultationCount',
|
||||
width: 120
|
||||
},
|
||||
// {
|
||||
// title: '专属二维码',
|
||||
// dataIndex: 'qrcode',
|
||||
// key: 'qrcode',
|
||||
// ellipsis: true
|
||||
// },
|
||||
// {
|
||||
// title: '备注',
|
||||
// dataIndex: 'comments',
|
||||
// key: 'comments',
|
||||
// ellipsis: true
|
||||
// },
|
||||
{
|
||||
title: '排序号',
|
||||
dataIndex: 'sortNumber',
|
||||
key: 'sortNumber',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicDoctorUserParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicDoctorUser) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicDoctorUser) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicDoctorUser(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicDoctorUser(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicDoctorUser) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicDoctorUser'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
292
src/views/clinic/clinicList/components/clinicListEdit.vue
Normal file
292
src/views/clinic/clinicList/components/clinicListEdit.vue
Normal file
@@ -0,0 +1,292 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑诊所列表' : '添加诊所列表'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="名称" name="name">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入名称"
|
||||
v-model:value="form.name"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="省份id" name="provinceId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入省份id"
|
||||
v-model:value="form.provinceId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="城市id" name="cityId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入城市id"
|
||||
v-model:value="form.cityId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="区域id" name="regionId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入区域id"
|
||||
v-model:value="form.regionId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="管理员id" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入管理员id"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="详细地址" name="address">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入详细地址"
|
||||
v-model:value="form.address"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="联系方式" name="contact">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入联系方式"
|
||||
v-model:value="form.contact"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="logo" name="logo">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入logo"
|
||||
v-model:value="form.logo"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="资质" name="qualify">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入资质"
|
||||
v-model:value="form.qualify"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="0待审核 1通过 2拒绝" name="status">
|
||||
<a-radio-group v-model:value="form.status">
|
||||
<a-radio :value="0">显示</a-radio>
|
||||
<a-radio :value="1">隐藏</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序号" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入是否删除, 0否, 1是"
|
||||
v-model:value="form.deleted"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="修改时间" name="updateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入修改时间"
|
||||
v-model:value="form.updateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="" name="lat">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入"
|
||||
v-model:value="form.lat"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="" name="lng">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入"
|
||||
v-model:value="form.lng"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addClinicList, updateClinicList } from '@/api/clinic/clinicList';
|
||||
import { ClinicList } from '@/api/clinic/clinicList/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicList | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicList>({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
regionId: undefined,
|
||||
userId: undefined,
|
||||
address: undefined,
|
||||
contact: undefined,
|
||||
logo: undefined,
|
||||
qualify: undefined,
|
||||
status: undefined,
|
||||
comments: undefined,
|
||||
sortNumber: undefined,
|
||||
deleted: undefined,
|
||||
tenantId: undefined,
|
||||
updateTime: undefined,
|
||||
createTime: undefined,
|
||||
lat: undefined,
|
||||
lng: undefined,
|
||||
clinicListId: undefined,
|
||||
clinicListName: '',
|
||||
status: 0,
|
||||
comments: '',
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicListName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写诊所列表名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicList : addClinicList;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/clinicList/components/search.vue
Normal file
42
src/views/clinic/clinicList/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
292
src/views/clinic/clinicList/index.vue
Normal file
292
src/views/clinic/clinicList/index.vue
Normal file
@@ -0,0 +1,292 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="clinicListId"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'logo'">
|
||||
<a-image :src="record.logo" :width="50"/>
|
||||
</template>
|
||||
<template v-if="column.key === 'qualify'">
|
||||
<a-space v-if="record.qualify">
|
||||
<a-image :src="item" :width="50" v-for="(item, index) in JSON.parse(record.qualify)" :key="index"/>
|
||||
</a-space>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<template v-if="record.status === 0">
|
||||
<a @click="changeStatus(record, 1)" class="text-green-400">通过</a>
|
||||
<a @click="changeStatus(record, 2)" class="text-red-400">拒绝</a>
|
||||
<a-divider type="vertical"/>
|
||||
</template>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical"/>
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicListEdit v-model:visible="showEdit" :data="current" @done="reload"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {createVNode, ref} from 'vue';
|
||||
import {message, Modal} from 'ant-design-vue';
|
||||
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
|
||||
import type {EleProTable} from 'ele-admin-pro';
|
||||
import {toDateString} from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import ClinicListEdit from './components/clinicListEdit.vue';
|
||||
import {pageClinicList, removeClinicList, removeBatchClinicList, updateClinicList} from '@/api/clinic/clinicList';
|
||||
import type {ClinicList, ClinicListParam} from '@/api/clinic/clinicList/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicList[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicList | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicList({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '省份',
|
||||
dataIndex: ['province', 'name'],
|
||||
key: 'provinceId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '城市',
|
||||
dataIndex: ['city', 'name'],
|
||||
key: 'cityId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '区域',
|
||||
dataIndex: ['region', 'name'],
|
||||
key: 'regionId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '详细地址',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '联系方式',
|
||||
dataIndex: 'contact',
|
||||
key: 'contact',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: 'logo',
|
||||
dataIndex: 'logo',
|
||||
key: 'logo',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '资质',
|
||||
dataIndex: 'qualify',
|
||||
key: 'qualify',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({text}) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicListParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({where: where});
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicList) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
const changeStatus = (row: ClinicList, status: number) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
updateClinicList({
|
||||
id: row.id,
|
||||
status
|
||||
})
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicList) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicList(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicList(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicList) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicList'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,319 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑病例' : '添加病例'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="买家用户ID" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入买家用户ID"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单编号" name="orderNo">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单编号"
|
||||
v-model:value="form.orderNo"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销商用户id(一级)" name="firstUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销商用户id(一级)"
|
||||
v-model:value="form.firstUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销商用户id(二级)" name="secondUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销商用户id(二级)"
|
||||
v-model:value="form.secondUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销商用户id(三级)" name="thirdUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销商用户id(三级)"
|
||||
v-model:value="form.thirdUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销佣金(一级)" name="firstMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销佣金(一级)"
|
||||
v-model:value="form.firstMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销佣金(二级)" name="secondMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销佣金(二级)"
|
||||
v-model:value="form.secondMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销佣金(三级)" name="thirdMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销佣金(三级)"
|
||||
v-model:value="form.thirdMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单价" name="price">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入单价"
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单总金额" name="orderPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单总金额"
|
||||
v-model:value="form.orderPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="结算金额" name="settledPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入结算金额"
|
||||
v-model:value="form.settledPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="换算成度" name="degreePrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入换算成度"
|
||||
v-model:value="form.degreePrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="实发金额" name="payPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入实发金额"
|
||||
v-model:value="form.payPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="税率" name="rate">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入税率"
|
||||
v-model:value="form.rate"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="结算月份" name="month">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入结算月份"
|
||||
v-model:value="form.month"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单是否失效(0未失效 1已失效)" name="isInvalid">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单是否失效(0未失效 1已失效)"
|
||||
v-model:value="form.isInvalid"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="佣金结算(0未结算 1已结算)" name="isSettled">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入佣金结算(0未结算 1已结算)"
|
||||
v-model:value="form.isSettled"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="结算时间" name="settleTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入结算时间"
|
||||
v-model:value="form.settleTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="修改时间" name="updateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入修改时间"
|
||||
v-model:value="form.updateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addClinicMedicalHistory, updateClinicMedicalHistory } from '@/api/clinic/clinicMedicalHistory';
|
||||
import { ClinicMedicalHistory } from '@/api/clinic/clinicMedicalHistory/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicMedicalHistory | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicMedicalHistory>({
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
orderNo: undefined,
|
||||
firstUserId: undefined,
|
||||
secondUserId: undefined,
|
||||
thirdUserId: undefined,
|
||||
firstMoney: undefined,
|
||||
secondMoney: undefined,
|
||||
thirdMoney: undefined,
|
||||
price: undefined,
|
||||
orderPrice: undefined,
|
||||
settledPrice: undefined,
|
||||
degreePrice: undefined,
|
||||
payPrice: undefined,
|
||||
rate: undefined,
|
||||
month: undefined,
|
||||
isInvalid: undefined,
|
||||
isSettled: undefined,
|
||||
settleTime: undefined,
|
||||
comments: undefined,
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicMedicalHistoryName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写病例名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicMedicalHistory : addClinicMedicalHistory;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/clinicMedicalHistory/components/search.vue
Normal file
42
src/views/clinic/clinicMedicalHistory/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
338
src/views/clinic/clinicMedicalHistory/index.vue
Normal file
338
src/views/clinic/clinicMedicalHistory/index.vue
Normal file
@@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicMedicalHistoryEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref, computed } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import ClinicMedicalHistoryEdit from './components/clinicMedicalHistoryEdit.vue';
|
||||
import { pageClinicMedicalHistory, removeClinicMedicalHistory, removeBatchClinicMedicalHistory } from '@/api/clinic/clinicMedicalHistory';
|
||||
import type { ClinicMedicalHistory, ClinicMedicalHistoryParam } from '@/api/clinic/clinicMedicalHistory/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicMedicalHistory[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicMedicalHistory | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicMedicalHistory({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 完整的列配置(包含所有字段)
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '主键ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '买家用户ID',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '订单编号',
|
||||
dataIndex: 'orderNo',
|
||||
key: 'orderNo',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '分销商用户id(一级)',
|
||||
dataIndex: 'firstUserId',
|
||||
key: 'firstUserId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分销商用户id(二级)',
|
||||
dataIndex: 'secondUserId',
|
||||
key: 'secondUserId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分销商用户id(三级)',
|
||||
dataIndex: 'thirdUserId',
|
||||
key: 'thirdUserId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分销佣金(一级)',
|
||||
dataIndex: 'firstMoney',
|
||||
key: 'firstMoney',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分销佣金(二级)',
|
||||
dataIndex: 'secondMoney',
|
||||
key: 'secondMoney',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分销佣金(三级)',
|
||||
dataIndex: 'thirdMoney',
|
||||
key: 'thirdMoney',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '单价',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '订单总金额',
|
||||
dataIndex: 'orderPrice',
|
||||
key: 'orderPrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '结算金额',
|
||||
dataIndex: 'settledPrice',
|
||||
key: 'settledPrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '换算成度',
|
||||
dataIndex: 'degreePrice',
|
||||
key: 'degreePrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '实发金额',
|
||||
dataIndex: 'payPrice',
|
||||
key: 'payPrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '税率',
|
||||
dataIndex: 'rate',
|
||||
key: 'rate',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '结算月份',
|
||||
dataIndex: 'month',
|
||||
key: 'month',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '订单是否失效(0未失效 1已失效)',
|
||||
dataIndex: 'isInvalid',
|
||||
key: 'isInvalid',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '佣金结算(0未结算 1已结算)',
|
||||
dataIndex: 'isSettled',
|
||||
key: 'isSettled',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '结算时间',
|
||||
dataIndex: 'settleTime',
|
||||
key: 'settleTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updateTime',
|
||||
key: 'updateTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicMedicalHistoryParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicMedicalHistory) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicMedicalHistory) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicMedicalHistory(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicMedicalHistory(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicMedicalHistory) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicMedicalHistory'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,211 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑药品库' : '添加药品库'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="药名" name="name">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入药名"
|
||||
v-model:value="form.name"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="拼音" name="pinyin">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入拼音"
|
||||
v-model:value="form.pinyin"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分类" name="category">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分类"
|
||||
v-model:value="form.category"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="规格" name="specification">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入规格"
|
||||
v-model:value="form.specification"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单位" name="unit">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入单位(如“克”、“袋”)"
|
||||
v-model:value="form.unit"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="描述" name="content">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.content"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单价" name="pricePerUnit">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入单价"
|
||||
v-model:value="form.pricePerUnit"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否活跃" name="isActive">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入是否活跃"
|
||||
v-model:value="form.isActive"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject } from 'ele-admin-pro';
|
||||
import { addClinicMedicine, updateClinicMedicine } from '@/api/clinic/clinicMedicine';
|
||||
import { ClinicMedicine } from '@/api/clinic/clinicMedicine/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicMedicine | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicMedicine>({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
pinyin: undefined,
|
||||
category: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
content: undefined,
|
||||
pricePerUnit: undefined,
|
||||
isActive: undefined,
|
||||
userId: undefined,
|
||||
comments: undefined,
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicMedicineName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写药品库名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicMedicine : addClinicMedicine;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/clinicMedicine/components/search.vue
Normal file
42
src/views/clinic/clinicMedicine/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
268
src/views/clinic/clinicMedicine/index.vue
Normal file
268
src/views/clinic/clinicMedicine/index.vue
Normal file
@@ -0,0 +1,268 @@
|
||||
<template>
|
||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicMedicineEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref, computed } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import ClinicMedicineEdit from './components/clinicMedicineEdit.vue';
|
||||
import { pageClinicMedicine, removeClinicMedicine, removeBatchClinicMedicine } from '@/api/clinic/clinicMedicine';
|
||||
import type { ClinicMedicine, ClinicMedicineParam } from '@/api/clinic/clinicMedicine/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicMedicine[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicMedicine | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicMedicine({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 完整的列配置(包含所有字段)
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '主键ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '药名',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '拼音',
|
||||
dataIndex: 'pinyin',
|
||||
key: 'pinyin',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '分类',
|
||||
dataIndex: 'category',
|
||||
key: 'category',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '规格',
|
||||
dataIndex: 'specification',
|
||||
key: 'specification',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '单位',
|
||||
dataIndex: 'unit',
|
||||
key: 'unit',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
dataIndex: 'content',
|
||||
key: 'content',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '单价',
|
||||
dataIndex: 'pricePerUnit',
|
||||
key: 'pricePerUnit',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '是否活跃',
|
||||
dataIndex: 'isActive',
|
||||
key: 'isActive',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicMedicineParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicMedicine) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicMedicine) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicMedicine(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicMedicine(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicMedicine) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicMedicine'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,318 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑出入库' : '添加出入库'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="买家用户ID" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入买家用户ID"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单编号" name="orderNo">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单编号"
|
||||
v-model:value="form.orderNo"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销商用户id(一级)" name="firstUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销商用户id(一级)"
|
||||
v-model:value="form.firstUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销商用户id(二级)" name="secondUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销商用户id(二级)"
|
||||
v-model:value="form.secondUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销商用户id(三级)" name="thirdUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销商用户id(三级)"
|
||||
v-model:value="form.thirdUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销佣金(一级)" name="firstMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销佣金(一级)"
|
||||
v-model:value="form.firstMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销佣金(二级)" name="secondMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销佣金(二级)"
|
||||
v-model:value="form.secondMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分销佣金(三级)" name="thirdMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分销佣金(三级)"
|
||||
v-model:value="form.thirdMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单价" name="price">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入单价"
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单总金额" name="orderPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单总金额"
|
||||
v-model:value="form.orderPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="结算金额" name="settledPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入结算金额"
|
||||
v-model:value="form.settledPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="换算成度" name="degreePrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入换算成度"
|
||||
v-model:value="form.degreePrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="实发金额" name="payPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入实发金额"
|
||||
v-model:value="form.payPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="税率" name="rate">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入税率"
|
||||
v-model:value="form.rate"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="结算月份" name="month">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入结算月份"
|
||||
v-model:value="form.month"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单是否失效(0未失效 1已失效)" name="isInvalid">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单是否失效(0未失效 1已失效)"
|
||||
v-model:value="form.isInvalid"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="佣金结算(0未结算 1已结算)" name="isSettled">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入佣金结算(0未结算 1已结算)"
|
||||
v-model:value="form.isSettled"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="结算时间" name="settleTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入结算时间"
|
||||
v-model:value="form.settleTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="修改时间" name="updateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入修改时间"
|
||||
v-model:value="form.updateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addClinicMedicineInout, updateClinicMedicineInout } from '@/api/clinic/clinicMedicineInout';
|
||||
import { ClinicMedicineInout } from '@/api/clinic/clinicMedicineInout/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicMedicineInout | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicMedicineInout>({
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
orderNo: undefined,
|
||||
firstUserId: undefined,
|
||||
secondUserId: undefined,
|
||||
thirdUserId: undefined,
|
||||
firstMoney: undefined,
|
||||
secondMoney: undefined,
|
||||
thirdMoney: undefined,
|
||||
price: undefined,
|
||||
orderPrice: undefined,
|
||||
settledPrice: undefined,
|
||||
degreePrice: undefined,
|
||||
payPrice: undefined,
|
||||
rate: undefined,
|
||||
month: undefined,
|
||||
isInvalid: undefined,
|
||||
isSettled: undefined,
|
||||
settleTime: undefined,
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
comments: ''
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicMedicineInoutName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写出入库名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicMedicineInout : addClinicMedicineInout;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/clinicMedicineInout/components/search.vue
Normal file
42
src/views/clinic/clinicMedicineInout/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
338
src/views/clinic/clinicMedicineInout/index.vue
Normal file
338
src/views/clinic/clinicMedicineInout/index.vue
Normal file
@@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicMedicineInoutEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref, computed } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import ClinicMedicineInoutEdit from './components/clinicMedicineInoutEdit.vue';
|
||||
import { pageClinicMedicineInout, removeClinicMedicineInout, removeBatchClinicMedicineInout } from '@/api/clinic/clinicMedicineInout';
|
||||
import type { ClinicMedicineInout, ClinicMedicineInoutParam } from '@/api/clinic/clinicMedicineInout/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicMedicineInout[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicMedicineInout | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicMedicineInout({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 完整的列配置(包含所有字段)
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '主键ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '买家用户ID',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '订单编号',
|
||||
dataIndex: 'orderNo',
|
||||
key: 'orderNo',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '分销商用户id(一级)',
|
||||
dataIndex: 'firstUserId',
|
||||
key: 'firstUserId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分销商用户id(二级)',
|
||||
dataIndex: 'secondUserId',
|
||||
key: 'secondUserId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分销商用户id(三级)',
|
||||
dataIndex: 'thirdUserId',
|
||||
key: 'thirdUserId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分销佣金(一级)',
|
||||
dataIndex: 'firstMoney',
|
||||
key: 'firstMoney',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分销佣金(二级)',
|
||||
dataIndex: 'secondMoney',
|
||||
key: 'secondMoney',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分销佣金(三级)',
|
||||
dataIndex: 'thirdMoney',
|
||||
key: 'thirdMoney',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '单价',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '订单总金额',
|
||||
dataIndex: 'orderPrice',
|
||||
key: 'orderPrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '结算金额',
|
||||
dataIndex: 'settledPrice',
|
||||
key: 'settledPrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '换算成度',
|
||||
dataIndex: 'degreePrice',
|
||||
key: 'degreePrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '实发金额',
|
||||
dataIndex: 'payPrice',
|
||||
key: 'payPrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '税率',
|
||||
dataIndex: 'rate',
|
||||
key: 'rate',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '结算月份',
|
||||
dataIndex: 'month',
|
||||
key: 'month',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '订单是否失效(0未失效 1已失效)',
|
||||
dataIndex: 'isInvalid',
|
||||
key: 'isInvalid',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '佣金结算(0未结算 1已结算)',
|
||||
dataIndex: 'isSettled',
|
||||
key: 'isSettled',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '结算时间',
|
||||
dataIndex: 'settleTime',
|
||||
key: 'settleTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updateTime',
|
||||
key: 'updateTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicMedicineInoutParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicMedicineInout) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicMedicineInout) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicMedicineInout(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicMedicineInout(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicMedicineInout) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicMedicineInout'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,214 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑药品库存' : '添加药品库存'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="药品" name="medicineId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入药品"
|
||||
v-model:value="form.medicineId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="库存数量" name="stockQuantity">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入库存数量"
|
||||
v-model:value="form.stockQuantity"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="最小库存预警" name="minStockLevel">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入最小库存预警"
|
||||
v-model:value="form.minStockLevel"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="上次更新时间" name="lastUpdated">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入上次更新时间"
|
||||
v-model:value="form.lastUpdated"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="买家用户ID" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入买家用户ID"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="修改时间" name="updateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入修改时间"
|
||||
v-model:value="form.updateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addClinicMedicineStock, updateClinicMedicineStock } from '@/api/clinic/clinicMedicineStock';
|
||||
import { ClinicMedicineStock } from '@/api/clinic/clinicMedicineStock/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicMedicineStock | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicMedicineStock>({
|
||||
id: undefined,
|
||||
medicineId: undefined,
|
||||
stockQuantity: undefined,
|
||||
minStockLevel: undefined,
|
||||
lastUpdated: undefined,
|
||||
userId: undefined,
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
comments: ''
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicMedicineStockName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写药品库存名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicMedicineStock : addClinicMedicineStock;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/clinicMedicineStock/components/search.vue
Normal file
42
src/views/clinic/clinicMedicineStock/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
260
src/views/clinic/clinicMedicineStock/index.vue
Normal file
260
src/views/clinic/clinicMedicineStock/index.vue
Normal file
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicMedicineStockEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref, computed } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import ClinicMedicineStockEdit from './components/clinicMedicineStockEdit.vue';
|
||||
import { pageClinicMedicineStock, removeClinicMedicineStock, removeBatchClinicMedicineStock } from '@/api/clinic/clinicMedicineStock';
|
||||
import type { ClinicMedicineStock, ClinicMedicineStockParam } from '@/api/clinic/clinicMedicineStock/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicMedicineStock[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicMedicineStock | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicMedicineStock({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 完整的列配置(包含所有字段)
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '主键ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '药品',
|
||||
dataIndex: 'medicineId',
|
||||
key: 'medicineId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '库存数量',
|
||||
dataIndex: 'stockQuantity',
|
||||
key: 'stockQuantity',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '最小库存预警',
|
||||
dataIndex: 'minStockLevel',
|
||||
key: 'minStockLevel',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '上次更新时间',
|
||||
dataIndex: 'lastUpdated',
|
||||
key: 'lastUpdated',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '买家用户ID',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updateTime',
|
||||
key: 'updateTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicMedicineStockParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicMedicineStock) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicMedicineStock) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicMedicineStock(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicMedicineStock(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicMedicineStock) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicMedicineStock'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
744
src/views/clinic/clinicOrder/components/clinicOrderEdit.vue
Normal file
744
src/views/clinic/clinicOrder/components/clinicOrderEdit.vue
Normal file
@@ -0,0 +1,744 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑处方订单' : '添加处方订单'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="订单编号" name="orderNo">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单编号"
|
||||
v-model:value="form.orderNo"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单类型,0商城订单 1预定订单/外卖 2会员卡" name="type">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单类型,0商城订单 1预定订单/外卖 2会员卡"
|
||||
v-model:value="form.type"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单标题" name="title">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单标题"
|
||||
v-model:value="form.title"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="快递/自提" name="deliveryType">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入快递/自提"
|
||||
v-model:value="form.deliveryType"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="下单渠道,0小程序预定 1俱乐部训练场 3活动订场" name="channel">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入下单渠道,0小程序预定 1俱乐部训练场 3活动订场"
|
||||
v-model:value="form.channel"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="微信支付交易号号" name="transactionId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入微信支付交易号号"
|
||||
v-model:value="form.transactionId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="微信退款订单号" name="refundOrder">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入微信退款订单号"
|
||||
v-model:value="form.refundOrder"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商户ID" name="merchantId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商户ID"
|
||||
v-model:value="form.merchantId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商户名称" name="merchantName">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商户名称"
|
||||
v-model:value="form.merchantName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商户编号" name="merchantCode">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商户编号"
|
||||
v-model:value="form.merchantCode"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="使用的优惠券id" name="couponId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入使用的优惠券id"
|
||||
v-model:value="form.couponId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="使用的会员卡id" name="cardId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入使用的会员卡id"
|
||||
v-model:value="form.cardId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="关联管理员id" name="adminId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入关联管理员id"
|
||||
v-model:value="form.adminId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="核销管理员id" name="confirmId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入核销管理员id"
|
||||
v-model:value="form.confirmId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="IC卡号" name="icCard">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入IC卡号"
|
||||
v-model:value="form.icCard"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="真实姓名" name="realName">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入真实姓名"
|
||||
v-model:value="form.realName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="关联收货地址" name="addressId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入关联收货地址"
|
||||
v-model:value="form.addressId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="收货地址" name="address">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入收货地址"
|
||||
v-model:value="form.address"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="" name="addressLat">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入"
|
||||
v-model:value="form.addressLat"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="" name="addressLng">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入"
|
||||
v-model:value="form.addressLng"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="买家留言" name="buyerRemarks">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入买家留言"
|
||||
v-model:value="form.buyerRemarks"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="自提店铺id" name="selfTakeMerchantId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入自提店铺id"
|
||||
v-model:value="form.selfTakeMerchantId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="自提店铺" name="selfTakeMerchantName">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入自提店铺"
|
||||
v-model:value="form.selfTakeMerchantName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="配送开始时间" name="sendStartTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入配送开始时间"
|
||||
v-model:value="form.sendStartTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="配送结束时间" name="sendEndTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入配送结束时间"
|
||||
v-model:value="form.sendEndTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="发货店铺id" name="expressMerchantId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入发货店铺id"
|
||||
v-model:value="form.expressMerchantId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="发货店铺" name="expressMerchantName">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入发货店铺"
|
||||
v-model:value="form.expressMerchantName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单总额" name="totalPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单总额"
|
||||
v-model:value="form.totalPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格" name="reducePrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格"
|
||||
v-model:value="form.reducePrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="实际付款" name="payPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入实际付款"
|
||||
v-model:value="form.payPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="用于统计" name="price">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入用于统计"
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="价钱,用于积分赠送" name="money">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入价钱,用于积分赠送"
|
||||
v-model:value="form.money"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="取消时间" name="cancelTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入取消时间"
|
||||
v-model:value="form.cancelTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="取消原因" name="cancelReason">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入取消原因"
|
||||
v-model:value="form.cancelReason"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="退款金额" name="refundMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入退款金额"
|
||||
v-model:value="form.refundMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="教练价格" name="coachPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入教练价格"
|
||||
v-model:value="form.coachPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="购买数量" name="totalNum">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入购买数量"
|
||||
v-model:value="form.totalNum"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="教练id" name="coachId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入教练id"
|
||||
v-model:value="form.coachId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商品ID" name="formId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商品ID"
|
||||
v-model:value="form.formId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="支付的用户id" name="payUserId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入支付的用户id"
|
||||
v-model:value="form.payUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付" name="payType">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付"
|
||||
v-model:value="form.payType"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="微信支付子类型:JSAPI小程序支付,NATIVE扫码支付" name="wechatPayType">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入微信支付子类型:JSAPI小程序支付,NATIVE扫码支付"
|
||||
v-model:value="form.wechatPayType"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付" name="friendPayType">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付"
|
||||
v-model:value="form.friendPayType"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="0未付款,1已付款" name="payStatus">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入0未付款,1已付款"
|
||||
v-model:value="form.payStatus"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款" name="orderStatus">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款"
|
||||
v-model:value="form.orderStatus"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="发货状态(10未发货 20已发货 30部分发货)" name="deliveryStatus">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入发货状态(10未发货 20已发货 30部分发货)"
|
||||
v-model:value="form.deliveryStatus"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="无需发货备注" name="deliveryNote">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入无需发货备注"
|
||||
v-model:value="form.deliveryNote"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="发货时间" name="deliveryTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入发货时间"
|
||||
v-model:value="form.deliveryTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="评价状态(0未评价 1已评价)" name="evaluateStatus">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入评价状态(0未评价 1已评价)"
|
||||
v-model:value="form.evaluateStatus"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="评价时间" name="evaluateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入评价时间"
|
||||
v-model:value="form.evaluateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡" name="couponType">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡"
|
||||
v-model:value="form.couponType"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="优惠说明" name="couponDesc">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入优惠说明"
|
||||
v-model:value="form.couponDesc"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="二维码地址,保存订单号,支付成功后才生成" name="qrcode">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入二维码地址,保存订单号,支付成功后才生成"
|
||||
v-model:value="form.qrcode"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="vip月卡年卡、ic月卡年卡回退次数" name="returnNum">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入vip月卡年卡、ic月卡年卡回退次数"
|
||||
v-model:value="form.returnNum"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="vip充值回退金额" name="returnMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入vip充值回退金额"
|
||||
v-model:value="form.returnMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="预约详情开始时间数组" name="startTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入预约详情开始时间数组"
|
||||
v-model:value="form.startTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否已开具发票:0未开发票,1已开发票,2不能开具发票" name="isInvoice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入是否已开具发票:0未开发票,1已开发票,2不能开具发票"
|
||||
v-model:value="form.isInvoice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="发票流水号" name="invoiceNo">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入发票流水号"
|
||||
v-model:value="form.invoiceNo"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商家留言" name="merchantRemarks">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商家留言"
|
||||
v-model:value="form.merchantRemarks"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="支付时间" name="payTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入支付时间"
|
||||
v-model:value="form.payTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="退款时间" name="refundTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入退款时间"
|
||||
v-model:value="form.refundTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="申请退款时间" name="refundApplyTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入申请退款时间"
|
||||
v-model:value="form.refundApplyTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="过期时间" name="expirationTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入过期时间"
|
||||
v-model:value="form.expirationTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="自提码" name="selfTakeCode">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入自提码"
|
||||
v-model:value="form.selfTakeCode"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否已收到赠品" name="hasTakeGift">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入是否已收到赠品"
|
||||
v-model:value="form.hasTakeGift"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单" name="checkBill">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单"
|
||||
v-model:value="form.checkBill"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单是否已结算(0未结算 1已结算)" name="isSettled">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单是否已结算(0未结算 1已结算)"
|
||||
v-model:value="form.isSettled"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="系统版本号 0当前版本 value=其他版本" name="version">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入系统版本号 0当前版本 value=其他版本"
|
||||
v-model:value="form.version"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="用户id" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入用户id"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序号" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入是否删除, 0否, 1是"
|
||||
v-model:value="form.deleted"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="修改时间" name="updateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入修改时间"
|
||||
v-model:value="form.updateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addClinicOrder, updateClinicOrder } from '@/api/clinic/clinicOrder';
|
||||
import { ClinicOrder } from '@/api/clinic/clinicOrder/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ClinicOrder | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<ClinicOrder>({
|
||||
orderId: undefined,
|
||||
orderNo: undefined,
|
||||
type: undefined,
|
||||
title: undefined,
|
||||
deliveryType: undefined,
|
||||
channel: undefined,
|
||||
transactionId: undefined,
|
||||
refundOrder: undefined,
|
||||
merchantId: undefined,
|
||||
merchantName: undefined,
|
||||
merchantCode: undefined,
|
||||
couponId: undefined,
|
||||
cardId: undefined,
|
||||
adminId: undefined,
|
||||
confirmId: undefined,
|
||||
icCard: undefined,
|
||||
realName: undefined,
|
||||
addressId: undefined,
|
||||
address: undefined,
|
||||
addressLat: undefined,
|
||||
addressLng: undefined,
|
||||
buyerRemarks: undefined,
|
||||
selfTakeMerchantId: undefined,
|
||||
selfTakeMerchantName: undefined,
|
||||
sendStartTime: undefined,
|
||||
sendEndTime: undefined,
|
||||
expressMerchantId: undefined,
|
||||
expressMerchantName: undefined,
|
||||
totalPrice: undefined,
|
||||
reducePrice: undefined,
|
||||
payPrice: undefined,
|
||||
price: undefined,
|
||||
money: undefined,
|
||||
cancelTime: undefined,
|
||||
cancelReason: undefined,
|
||||
refundMoney: undefined,
|
||||
coachPrice: undefined,
|
||||
totalNum: undefined,
|
||||
coachId: undefined,
|
||||
formId: undefined,
|
||||
payUserId: undefined,
|
||||
payType: undefined,
|
||||
wechatPayType: undefined,
|
||||
friendPayType: undefined,
|
||||
payStatus: undefined,
|
||||
orderStatus: undefined,
|
||||
deliveryStatus: undefined,
|
||||
deliveryNote: undefined,
|
||||
deliveryTime: undefined,
|
||||
evaluateStatus: undefined,
|
||||
evaluateTime: undefined,
|
||||
couponType: undefined,
|
||||
couponDesc: undefined,
|
||||
qrcode: undefined,
|
||||
returnNum: undefined,
|
||||
returnMoney: undefined,
|
||||
startTime: undefined,
|
||||
isInvoice: undefined,
|
||||
invoiceNo: undefined,
|
||||
merchantRemarks: undefined,
|
||||
payTime: undefined,
|
||||
refundTime: undefined,
|
||||
refundApplyTime: undefined,
|
||||
expirationTime: undefined,
|
||||
selfTakeCode: undefined,
|
||||
hasTakeGift: undefined,
|
||||
checkBill: undefined,
|
||||
isSettled: undefined,
|
||||
version: undefined,
|
||||
userId: undefined,
|
||||
comments: undefined,
|
||||
deleted: undefined,
|
||||
tenantId: undefined,
|
||||
updateTime: undefined,
|
||||
createTime: undefined,
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
clinicOrderName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写处方订单名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateClinicOrder : addClinicOrder;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/clinic/clinicOrder/components/search.vue
Normal file
42
src/views/clinic/clinicOrder/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
656
src/views/clinic/clinicOrder/index.vue
Normal file
656
src/views/clinic/clinicOrder/index.vue
Normal file
@@ -0,0 +1,656 @@
|
||||
<template>
|
||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ClinicOrderEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import ClinicOrderEdit from './components/clinicOrderEdit.vue';
|
||||
import { pageClinicOrder, removeClinicOrder, removeBatchClinicOrder } from '@/api/clinic/clinicOrder';
|
||||
import type { ClinicOrder, ClinicOrderParam } from '@/api/clinic/clinicOrder/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ClinicOrder[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ClinicOrder | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageClinicOrder({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 完整的列配置(包含所有字段)
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '订单号',
|
||||
dataIndex: 'orderId',
|
||||
key: 'orderId',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '订单编号',
|
||||
dataIndex: 'orderNo',
|
||||
key: 'orderNo',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '订单类型,0商城订单 1预定订单/外卖 2会员卡',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '订单标题',
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '快递/自提',
|
||||
dataIndex: 'deliveryType',
|
||||
key: 'deliveryType',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '下单渠道,0小程序预定 1俱乐部训练场 3活动订场',
|
||||
dataIndex: 'channel',
|
||||
key: 'channel',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '微信支付交易号号',
|
||||
dataIndex: 'transactionId',
|
||||
key: 'transactionId',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '微信退款订单号',
|
||||
dataIndex: 'refundOrder',
|
||||
key: 'refundOrder',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '商户ID',
|
||||
dataIndex: 'merchantId',
|
||||
key: 'merchantId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '商户名称',
|
||||
dataIndex: 'merchantName',
|
||||
key: 'merchantName',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '商户编号',
|
||||
dataIndex: 'merchantCode',
|
||||
key: 'merchantCode',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '使用的优惠券id',
|
||||
dataIndex: 'couponId',
|
||||
key: 'couponId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '使用的会员卡id',
|
||||
dataIndex: 'cardId',
|
||||
key: 'cardId',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '关联管理员id',
|
||||
dataIndex: 'adminId',
|
||||
key: 'adminId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '核销管理员id',
|
||||
dataIndex: 'confirmId',
|
||||
key: 'confirmId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: 'IC卡号',
|
||||
dataIndex: 'icCard',
|
||||
key: 'icCard',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '真实姓名',
|
||||
dataIndex: 'realName',
|
||||
key: 'realName',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '关联收货地址',
|
||||
dataIndex: 'addressId',
|
||||
key: 'addressId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '收货地址',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '',
|
||||
dataIndex: 'addressLat',
|
||||
key: 'addressLat',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '',
|
||||
dataIndex: 'addressLng',
|
||||
key: 'addressLng',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '买家留言',
|
||||
dataIndex: 'buyerRemarks',
|
||||
key: 'buyerRemarks',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '自提店铺id',
|
||||
dataIndex: 'selfTakeMerchantId',
|
||||
key: 'selfTakeMerchantId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '自提店铺',
|
||||
dataIndex: 'selfTakeMerchantName',
|
||||
key: 'selfTakeMerchantName',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '配送开始时间',
|
||||
dataIndex: 'sendStartTime',
|
||||
key: 'sendStartTime',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '配送结束时间',
|
||||
dataIndex: 'sendEndTime',
|
||||
key: 'sendEndTime',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '发货店铺id',
|
||||
dataIndex: 'expressMerchantId',
|
||||
key: 'expressMerchantId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '发货店铺',
|
||||
dataIndex: 'expressMerchantName',
|
||||
key: 'expressMerchantName',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '订单总额',
|
||||
dataIndex: 'totalPrice',
|
||||
key: 'totalPrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格',
|
||||
dataIndex: 'reducePrice',
|
||||
key: 'reducePrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '实际付款',
|
||||
dataIndex: 'payPrice',
|
||||
key: 'payPrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '用于统计',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '价钱,用于积分赠送',
|
||||
dataIndex: 'money',
|
||||
key: 'money',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '取消时间',
|
||||
dataIndex: 'cancelTime',
|
||||
key: 'cancelTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '取消原因',
|
||||
dataIndex: 'cancelReason',
|
||||
key: 'cancelReason',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '退款金额',
|
||||
dataIndex: 'refundMoney',
|
||||
key: 'refundMoney',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '教练价格',
|
||||
dataIndex: 'coachPrice',
|
||||
key: 'coachPrice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '购买数量',
|
||||
dataIndex: 'totalNum',
|
||||
key: 'totalNum',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '教练id',
|
||||
dataIndex: 'coachId',
|
||||
key: 'coachId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '商品ID',
|
||||
dataIndex: 'formId',
|
||||
key: 'formId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '支付的用户id',
|
||||
dataIndex: 'payUserId',
|
||||
key: 'payUserId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付',
|
||||
dataIndex: 'payType',
|
||||
key: 'payType',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '微信支付子类型:JSAPI小程序支付,NATIVE扫码支付',
|
||||
dataIndex: 'wechatPayType',
|
||||
key: 'wechatPayType',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付',
|
||||
dataIndex: 'friendPayType',
|
||||
key: 'friendPayType',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '0未付款,1已付款',
|
||||
dataIndex: 'payStatus',
|
||||
key: 'payStatus',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款',
|
||||
dataIndex: 'orderStatus',
|
||||
key: 'orderStatus',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '发货状态(10未发货 20已发货 30部分发货)',
|
||||
dataIndex: 'deliveryStatus',
|
||||
key: 'deliveryStatus',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '无需发货备注',
|
||||
dataIndex: 'deliveryNote',
|
||||
key: 'deliveryNote',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '发货时间',
|
||||
dataIndex: 'deliveryTime',
|
||||
key: 'deliveryTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '评价状态(0未评价 1已评价)',
|
||||
dataIndex: 'evaluateStatus',
|
||||
key: 'evaluateStatus',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '评价时间',
|
||||
dataIndex: 'evaluateTime',
|
||||
key: 'evaluateTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡',
|
||||
dataIndex: 'couponType',
|
||||
key: 'couponType',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '优惠说明',
|
||||
dataIndex: 'couponDesc',
|
||||
key: 'couponDesc',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '二维码地址,保存订单号,支付成功后才生成',
|
||||
dataIndex: 'qrcode',
|
||||
key: 'qrcode',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: 'vip月卡年卡、ic月卡年卡回退次数',
|
||||
dataIndex: 'returnNum',
|
||||
key: 'returnNum',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: 'vip充值回退金额',
|
||||
dataIndex: 'returnMoney',
|
||||
key: 'returnMoney',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '预约详情开始时间数组',
|
||||
dataIndex: 'startTime',
|
||||
key: 'startTime',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '是否已开具发票:0未开发票,1已开发票,2不能开具发票',
|
||||
dataIndex: 'isInvoice',
|
||||
key: 'isInvoice',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '发票流水号',
|
||||
dataIndex: 'invoiceNo',
|
||||
key: 'invoiceNo',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '商家留言',
|
||||
dataIndex: 'merchantRemarks',
|
||||
key: 'merchantRemarks',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '支付时间',
|
||||
dataIndex: 'payTime',
|
||||
key: 'payTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '退款时间',
|
||||
dataIndex: 'refundTime',
|
||||
key: 'refundTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '申请退款时间',
|
||||
dataIndex: 'refundApplyTime',
|
||||
key: 'refundApplyTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '过期时间',
|
||||
dataIndex: 'expirationTime',
|
||||
key: 'expirationTime',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '自提码',
|
||||
dataIndex: 'selfTakeCode',
|
||||
key: 'selfTakeCode',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '是否已收到赠品',
|
||||
dataIndex: 'hasTakeGift',
|
||||
key: 'hasTakeGift',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单',
|
||||
dataIndex: 'checkBill',
|
||||
key: 'checkBill',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '订单是否已结算(0未结算 1已结算)',
|
||||
dataIndex: 'isSettled',
|
||||
key: 'isSettled',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '系统版本号 0当前版本 value=其他版本',
|
||||
dataIndex: 'version',
|
||||
key: 'version',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '用户id',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '排序号',
|
||||
dataIndex: 'sortNumber',
|
||||
key: 'sortNumber',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '是否删除, 0否, 1是',
|
||||
dataIndex: 'deleted',
|
||||
key: 'deleted',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updateTime',
|
||||
key: 'updateTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ClinicOrderParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ClinicOrder) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ClinicOrder) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeClinicOrder(row.orderId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchClinicOrder(selection.value.map((d) => d.orderId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ClinicOrder) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ClinicOrder'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user