diff --git a/pages.json b/pages.json index 5008e0b..6096297 100644 --- a/pages.json +++ b/pages.json @@ -190,12 +190,6 @@ "navigationBarTitleText": "共享客户" } }, - { - "path": "patient-invite", - "style": { - "navigationBarTitleText": "邀请患者" - } - }, { "path": "patient-create", "style": { diff --git a/pages/case/case.vue b/pages/case/case.vue deleted file mode 100644 index 8613350..0000000 --- a/pages/case/case.vue +++ /dev/null @@ -1,1115 +0,0 @@ - - - - - diff --git a/pages/case/group-manage.vue b/pages/case/group-manage.vue index cdc290e..5af53c5 100644 --- a/pages/case/group-manage.vue +++ b/pages/case/group-manage.vue @@ -1,35 +1,67 @@  - - diff --git a/pages/home/case-home.vue b/pages/home/case-home.vue index 49472f3..3941d0a 100644 --- a/pages/home/case-home.vue +++ b/pages/home/case-home.vue @@ -75,7 +75,7 @@ {{ patient.gender }}/{{ patient.age }}岁 - + {{ tag }} @@ -163,6 +163,16 @@ const tabs = computed(() => { const isBatchMode = ref(false); const selectedItems = ref([]); // Stores patient phone or unique ID +const groupNameMap = computed(() => { + const map = new Map(); + (Array.isArray(teamGroups.value) ? teamGroups.value : []).forEach((g) => { + const id = g && g._id ? String(g._id) : ''; + const name = g && g.groupName ? String(g.groupName) : ''; + if (id && name) map.set(id, name); + }); + return map; +}); + // Team Members Map const userNameMap = ref({}); @@ -329,6 +339,20 @@ function getSelectId(patient) { return patient?._id || patient?.id || patient?.phone || patient?.mobile || ''; } +function getPatientGroupIds(patient) { + const raw = patient?.groupIds ?? patient?.groupIdList ?? patient?.groupId ?? patient?.groups; + if (Array.isArray(raw)) return raw.map(String).filter(Boolean); + if (typeof raw === 'string' || typeof raw === 'number') return [String(raw)].filter(Boolean); + return []; +} + +function resolveGroupTags(patient) { + const ids = getPatientGroupIds(patient); + if (!ids.length) return []; + const map = groupNameMap.value; + return ids.map((id) => map.get(String(id))).filter(Boolean); +} + function parseCreateTime(value) { if (!value) return null; if (typeof value === 'number') return dayjs(value); @@ -354,6 +378,7 @@ function formatPatient(raw) { const createTime = parseCreateTime(raw?.createTime); const createTimeStr = createTime ? createTime.format('YYYY-MM-DD HH:mm') : ''; + const createTimeTs = createTime ? createTime.valueOf() : 0; // 优先使用后端返回的 tagNames(标签名称数组) const rawTagNames = asArray(raw?.tagNames).filter((i) => typeof i === 'string' && i.trim()); @@ -392,6 +417,7 @@ function formatPatient(raw) { mobiles, mobile, createTime: createTimeStr, + createTimeTs, creator: raw?.creatorName || raw?.creator || '', hospitalId: raw?.customerNumber || raw?.hospitalId || '', record, @@ -548,16 +574,11 @@ const patientList = computed(() => { // New Patient Filter (Last 7 days) if (currentTab.value.kind === 'new') { - const now = dayjs(); - const sevenDaysAgo = now.subtract(7, 'day').valueOf(); + const sevenDaysAgo = dayjs().subtract(7, 'day').startOf('day').valueOf(); const flatList = all - .map((p) => { - const t = parseCreateTime(p.createTime)?.valueOf(); - return t ? { ...p, _ts: t } : null; - }) - .filter(Boolean) - .filter((p) => p._ts >= sevenDaysAgo) - .sort((a, b) => b._ts - a._ts); + .filter((p) => Number(p?.createTimeTs || 0) >= sevenDaysAgo) + .slice() + .sort((a, b) => Number(b?.createTimeTs || 0) - Number(a?.createTimeTs || 0)); return [{ letter: '最近新增', data: flatList }]; } @@ -717,11 +738,11 @@ const openVerifyEntry = () => { }; const openAddCustomerServiceEntry = () => { - uni.showToast({ title: '添加客服功能待接入', icon: 'none' }); + uni.navigateTo({ url: '/pages/work/service/contact-service' }); }; const openInvitePatientEntry = () => { - uni.navigateTo({ url: '/pages/case/patient-invite' }); + uni.navigateTo({ url: '/pages/work/team/invite/invite-patient' }); }; const openCreatePatientEntry = () => { diff --git a/routes/index.js b/routes/index.js index 227dae5..9068a4f 100644 --- a/routes/index.js +++ b/routes/index.js @@ -65,10 +65,6 @@ export default [ path: 'pages/case/batch-share', meta: { title: '共享客户', login: false }, }, - { - path: 'pages/case/patient-invite', - meta: { title: '邀请患者', login: false }, - }, { path: 'pages/case/patient-create', meta: { title: '新增患者', login: false },