|
@@ -22,7 +22,10 @@ export namespace PersonnelQualificationModel {
|
|
|
attachments: CertificateAttachment[];
|
|
attachments: CertificateAttachment[];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ export type OrganizationType = 'enterprise' | 'medicalInstitution';
|
|
|
|
|
+
|
|
|
export interface Personnel extends TransformRecord {
|
|
export interface Personnel extends TransformRecord {
|
|
|
|
|
+ organizationType?: OrganizationType;
|
|
|
enterpriseId?: string;
|
|
enterpriseId?: string;
|
|
|
enterpriseName: string;
|
|
enterpriseName: string;
|
|
|
decoctionCenterId?: string;
|
|
decoctionCenterId?: string;
|
|
@@ -48,6 +51,8 @@ export namespace PersonnelQualificationModel {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export interface ListQuery {
|
|
export interface ListQuery {
|
|
|
|
|
+ organizationType?: OrganizationType;
|
|
|
|
|
+ organizationId?: string;
|
|
|
enterpriseId?: string;
|
|
enterpriseId?: string;
|
|
|
decoctionCenterId?: string;
|
|
decoctionCenterId?: string;
|
|
|
position?: string;
|
|
position?: string;
|
|
@@ -83,6 +88,14 @@ export const QUALIFICATION_STATUS_OPTIONS = [
|
|
|
{ label: '过期', value: 'expired' },
|
|
{ label: '过期', value: 'expired' },
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
|
|
+export const ORGANIZATION_TYPE_OPTIONS: Array<{
|
|
|
|
|
+ label: string;
|
|
|
|
|
+ value: PersonnelQualificationModel.OrganizationType;
|
|
|
|
|
+}> = [
|
|
|
|
|
+ { label: '煎药企业', value: 'enterprise' },
|
|
|
|
|
+ { label: '医疗机构', value: 'medicalInstitution' },
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
export const QUALIFICATION_STATUS_LABELS: Record<
|
|
export const QUALIFICATION_STATUS_LABELS: Record<
|
|
|
PersonnelQualificationModel.QualificationStatus,
|
|
PersonnelQualificationModel.QualificationStatus,
|
|
|
string
|
|
string
|
|
@@ -210,6 +223,7 @@ function buildPersonnel(
|
|
|
const MOCK_PERSONNEL: PersonnelQualificationModel.Personnel[] = [
|
|
const MOCK_PERSONNEL: PersonnelQualificationModel.Personnel[] = [
|
|
|
buildPersonnel({
|
|
buildPersonnel({
|
|
|
id: '1',
|
|
id: '1',
|
|
|
|
|
+ organizationType: 'enterprise',
|
|
|
enterpriseId: 'e1',
|
|
enterpriseId: 'e1',
|
|
|
enterpriseName: '重药煎药中心',
|
|
enterpriseName: '重药煎药中心',
|
|
|
decoctionCenterId: 'c1',
|
|
decoctionCenterId: 'c1',
|
|
@@ -370,6 +384,7 @@ const MOCK_PERSONNEL: PersonnelQualificationModel.Personnel[] = [
|
|
|
}),
|
|
}),
|
|
|
buildPersonnel({
|
|
buildPersonnel({
|
|
|
id: '8',
|
|
id: '8',
|
|
|
|
|
+ organizationType: 'enterprise',
|
|
|
enterpriseId: 'e2',
|
|
enterpriseId: 'e2',
|
|
|
enterpriseName: '杭州中药煎配中心',
|
|
enterpriseName: '杭州中药煎配中心',
|
|
|
decoctionCenterId: 'c2',
|
|
decoctionCenterId: 'c2',
|
|
@@ -387,6 +402,52 @@ const MOCK_PERSONNEL: PersonnelQualificationModel.Personnel[] = [
|
|
|
},
|
|
},
|
|
|
]),
|
|
]),
|
|
|
}),
|
|
}),
|
|
|
|
|
+ buildPersonnel({
|
|
|
|
|
+ id: '9',
|
|
|
|
|
+ organizationType: 'medicalInstitution',
|
|
|
|
|
+ enterpriseId: 'm1',
|
|
|
|
|
+ enterpriseName: '蒋村社区卫生服务中心',
|
|
|
|
|
+ decoctionCenterId: 'c3',
|
|
|
|
|
+ decoctionCenterName: '蒋村煎药中心',
|
|
|
|
|
+ name: '王芳',
|
|
|
|
|
+ positions: ['接方、审方'],
|
|
|
|
|
+ employeeNo: '48473',
|
|
|
|
|
+ idNumber: '330110199001011234',
|
|
|
|
|
+ certificates: buildCertificates([
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '健康证',
|
|
|
|
|
+ number: '944895756806594360',
|
|
|
|
|
+ expiryDate: '2027-5-20',
|
|
|
|
|
+ status: 'valid',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '执业中药师',
|
|
|
|
|
+ number: '944895756806594361',
|
|
|
|
|
+ expiryDate: '2026-2-10',
|
|
|
|
|
+ status: 'expiring',
|
|
|
|
|
+ },
|
|
|
|
|
+ ]),
|
|
|
|
|
+ }),
|
|
|
|
|
+ buildPersonnel({
|
|
|
|
|
+ id: '10',
|
|
|
|
|
+ organizationType: 'medicalInstitution',
|
|
|
|
|
+ enterpriseId: 'm2',
|
|
|
|
|
+ enterpriseName: '西湖区中医院',
|
|
|
|
|
+ decoctionCenterId: 'c4',
|
|
|
|
|
+ decoctionCenterName: '西湖区中医院煎药室',
|
|
|
|
|
+ name: '赵强',
|
|
|
|
|
+ positions: ['配药'],
|
|
|
|
|
+ employeeNo: '48474',
|
|
|
|
|
+ idNumber: '330111198803022345',
|
|
|
|
|
+ certificates: buildCertificates([
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '中药调剂员',
|
|
|
|
|
+ number: '944895756806594362',
|
|
|
|
|
+ expiryDate: '2027-8-1',
|
|
|
|
|
+ status: 'valid',
|
|
|
|
|
+ },
|
|
|
|
|
+ ]),
|
|
|
|
|
+ }),
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
let mockStore = [...MOCK_PERSONNEL];
|
|
let mockStore = [...MOCK_PERSONNEL];
|
|
@@ -398,8 +459,17 @@ function filterPersonnel(
|
|
|
if (!query) return list;
|
|
if (!query) return list;
|
|
|
|
|
|
|
|
return list.filter((item) => {
|
|
return list.filter((item) => {
|
|
|
- if (query.enterpriseId && item.enterpriseId !== query.enterpriseId) {
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+ const organizationId = query.organizationId ?? query.enterpriseId;
|
|
|
|
|
+ const organizationType = query.organizationType ?? 'enterprise';
|
|
|
|
|
+
|
|
|
|
|
+ if (organizationId) {
|
|
|
|
|
+ const itemType = item.organizationType ?? 'enterprise';
|
|
|
|
|
+ if (itemType !== organizationType) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.enterpriseId !== organizationId) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (
|
|
if (
|
|
|
query.decoctionCenterId &&
|
|
query.decoctionCenterId &&
|
|
@@ -533,6 +603,21 @@ export function deletePersonnelQualificationMethod(id: string) {
|
|
|
export function optionsPersonnelEnterpriseMethod() {
|
|
export function optionsPersonnelEnterpriseMethod() {
|
|
|
const map = new Map<string, string>();
|
|
const map = new Map<string, string>();
|
|
|
for (const item of mockStore) {
|
|
for (const item of mockStore) {
|
|
|
|
|
+ if ((item.organizationType ?? 'enterprise') !== 'enterprise') continue;
|
|
|
|
|
+ if (item.enterpriseId) {
|
|
|
|
|
+ map.set(item.enterpriseId, item.enterpriseName);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return Promise.resolve(
|
|
|
|
|
+ [...map.entries()].map(([value, label]) => ({ label, value })),
|
|
|
|
|
+ );
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 医疗机构选项(mock) */
|
|
|
|
|
+export function optionsPersonnelMedicalInstitutionMethod() {
|
|
|
|
|
+ const map = new Map<string, string>();
|
|
|
|
|
+ for (const item of mockStore) {
|
|
|
|
|
+ if (item.organizationType !== 'medicalInstitution') continue;
|
|
|
if (item.enterpriseId) {
|
|
if (item.enterpriseId) {
|
|
|
map.set(item.enterpriseId, item.enterpriseName);
|
|
map.set(item.enterpriseId, item.enterpriseName);
|
|
|
}
|
|
}
|
|
@@ -544,11 +629,14 @@ export function optionsPersonnelEnterpriseMethod() {
|
|
|
|
|
|
|
|
/** 煎药中心选项(mock) */
|
|
/** 煎药中心选项(mock) */
|
|
|
export function optionsPersonnelDecoctionCenterMethod(
|
|
export function optionsPersonnelDecoctionCenterMethod(
|
|
|
- enterpriseId?: string,
|
|
|
|
|
|
|
+ organizationId?: string,
|
|
|
|
|
+ organizationType: PersonnelQualificationModel.OrganizationType = 'enterprise',
|
|
|
) {
|
|
) {
|
|
|
const map = new Map<string, string>();
|
|
const map = new Map<string, string>();
|
|
|
for (const item of mockStore) {
|
|
for (const item of mockStore) {
|
|
|
- if (enterpriseId && item.enterpriseId !== enterpriseId) continue;
|
|
|
|
|
|
|
+ const itemType = item.organizationType ?? 'enterprise';
|
|
|
|
|
+ if (itemType !== organizationType) continue;
|
|
|
|
|
+ if (organizationId && item.enterpriseId !== organizationId) continue;
|
|
|
if (item.decoctionCenterId) {
|
|
if (item.decoctionCenterId) {
|
|
|
map.set(item.decoctionCenterId, item.decoctionCenterName);
|
|
map.set(item.decoctionCenterId, item.decoctionCenterName);
|
|
|
}
|
|
}
|