diff --git a/components/archive-detail/customer-profile-tab.vue b/components/archive-detail/customer-profile-tab.vue
index 47ba157..8178965 100644
--- a/components/archive-detail/customer-profile-tab.vue
+++ b/components/archive-detail/customer-profile-tab.vue
@@ -1,18 +1,6 @@
-
-
- {{ t.label }}
-
-
-
基本信息
@@ -55,7 +43,7 @@
院内来源
- {{ forms.creator || '点击查看' }}
+ {{ latestTransferRecord?.executeTeamName || '点击查看' }}
@@ -88,26 +76,32 @@
@@ -115,9 +109,13 @@
diff --git a/components/archive-detail/health-profile-tab.vue b/components/archive-detail/health-profile-tab.vue
index 0a65209..ba41576 100644
--- a/components/archive-detail/health-profile-tab.vue
+++ b/components/archive-detail/health-profile-tab.vue
@@ -381,57 +381,57 @@ watch(
diff --git a/components/archive-detail/service-info-tab.vue b/components/archive-detail/service-info-tab.vue
index e928aae..7f8cf87 100644
--- a/components/archive-detail/service-info-tab.vue
+++ b/components/archive-detail/service-info-tab.vue
@@ -420,16 +420,16 @@ watch(
-
diff --git a/components/form-template/form-cell/form-positive-find.vue b/components/form-template/form-cell/form-positive-find.vue
index 7576ef1..4b25961 100644
--- a/components/form-template/form-cell/form-positive-find.vue
+++ b/components/form-template/form-cell/form-positive-find.vue
@@ -101,8 +101,8 @@ function remove(idx) {
-
diff --git a/components/form-template/form-cell/form-tag-picker.vue b/components/form-template/form-cell/form-tag-picker.vue
new file mode 100644
index 0000000..b863cd2
--- /dev/null
+++ b/components/form-template/form-cell/form-tag-picker.vue
@@ -0,0 +1,100 @@
+
+
+
+
+ {{ displayText || placeholder }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/form-template/form-cell/index.vue b/components/form-template/form-cell/index.vue
index da38666..439fccf 100644
--- a/components/form-template/form-cell/index.vue
+++ b/components/form-template/form-cell/index.vue
@@ -13,6 +13,7 @@
:disableChange="disableChange"
@change="change"
/>
+
+
-
- {{ attrs.name || attrs.title }}(暂不支持:{{ attrs.type }})
-
+
+
+
- {{ patient.createTime || '-' }} / {{ patient.creator || '-' }}
+ {{ patient.createTime || '-' }} / {{ resolveCreatorName(patient) || '-' }}
-
+
{{ patient.record.type }} / {{ patient.record.date }} / {{ patient.record.diagnosis }}
暂无病历记录
@@ -99,7 +99,7 @@
-
+
@@ -163,11 +163,15 @@ const tabs = computed(() => {
const isBatchMode = ref(false);
const selectedItems = ref([]); // Stores patient phone or unique ID
-// 新增流程所需状态(后续接接口替换)
+// Team Members Map
+const userNameMap = ref({});
+
+// 新增流程所需状态(认证相关)
const managedArchiveCountAllTeams = ref(0); // 在管档案数(所有团队)
-const isVerified = ref(true); // 是否已认证
+const verifyStatus = ref(''); // unverified | verifying | verified | failed
+const isVerified = ref(false); // 是否已认证
const hasVerifyFailedHistory = ref(false); // 是否有历史认证失败
-const verifyFailedReason = ref('资料不完整,请补充营业执照/资质证明后重新提交。');
+const verifyFailedReason = ref('');
const DETAIL_STORAGE_KEY = 'ykt_case_archive_detail';
const CURRENT_TEAM_STORAGE_KEY = 'ykt_case_current_team';
@@ -220,6 +224,58 @@ function getTeamId() {
return String(currentTeam.value?.teamId || '') || '';
}
+async function loadTeamMembers() {
+ const corpId = getCorpId();
+ const teamId = getTeamId();
+ if (!corpId || !teamId) return;
+
+ try {
+ const res = await api('getTeamData', { corpId, teamId });
+ if (!res?.success) return;
+ const t = res?.data && typeof res.data === 'object' ? res.data : {};
+ const members = Array.isArray(t.memberList) ? t.memberList : [];
+ // Update map
+ members.forEach(m => {
+ const uid = String(m?.userid || '');
+ if (uid) {
+ userNameMap.value[uid] = String(m?.anotherName || m?.name || m?.userid || '') || uid;
+ }
+ });
+ } catch (e) {
+ console.error('获取团队成员失败', e);
+ }
+}
+
+function resolveCreatorName(patient) {
+ const val = patient.creator;
+ if (!val) return '';
+ return userNameMap.value[val] || val;
+}
+
+
+function applyVerifyStatus(status, reason) {
+ verifyStatus.value = status || '';
+ isVerified.value = verifyStatus.value === 'verified';
+ hasVerifyFailedHistory.value = verifyStatus.value === 'failed';
+ verifyFailedReason.value = hasVerifyFailedHistory.value ? (reason || '') : '';
+}
+
+async function refreshVerifyStatus() {
+ const corpId = String(account.value?.corpId || doctorInfo.value?.corpId || getCorpId() || '');
+ const weChatOpenId = String(account.value?.openid || account.value?.openId || '');
+ const id = String(doctorInfo.value?._id || doctorInfo.value?.id || '');
+ if (!corpId || !weChatOpenId || !id) {
+ applyVerifyStatus(String(doctorInfo.value?.verifyStatus || ''), '');
+ return;
+ }
+ const res = await api('getMemberVerifyStatus', { corpId, weChatOpenId, id });
+ if (res && res.success) {
+ applyVerifyStatus(String(res.data?.verifyStatus || ''), String(res.data?.reason || ''));
+ return;
+ }
+ applyVerifyStatus(String(doctorInfo.value?.verifyStatus || ''), '');
+}
+
function sortGroupList(list) {
const { orderList, corpList, restList } = (Array.isArray(list) ? list : []).reduce(
(p, c) => {
@@ -299,10 +355,32 @@ function formatPatient(raw) {
const createTime = parseCreateTime(raw?.createTime);
const createTimeStr = createTime ? createTime.format('YYYY-MM-DD HH:mm') : '';
- const rawTags = asArray(raw?.tags).filter((i) => typeof i === 'string');
- const rawTagNames = asArray(raw?.tagNames).filter((i) => typeof i === 'string');
-
+ // 优先使用后端返回的 tagNames(标签名称数组)
+ const rawTagNames = asArray(raw?.tagNames).filter((i) => typeof i === 'string' && i.trim());
+ // 其次使用 tags(如果是字符串数组)
+ const rawTags = asArray(raw?.tags).filter((i) => typeof i === 'string' && i.trim());
+ // 最后才使用 tagIds(仅作为兜底,不推荐显示)
const tagIds = asArray(raw?.tagIds).map(String).filter(Boolean);
+
+ // 解析标签:优先 tagNames > tags(字符串) > tagIds
+ const displayTags = rawTagNames.length ? rawTagNames : (rawTags.length ? rawTags : []);
+
+ // 解析病历信息
+ let record = null;
+ if (raw?.latestRecord && typeof raw.latestRecord === 'object') {
+ const lr = raw.latestRecord;
+ const type = lr.type || '';
+ const date = lr.date || '';
+ const diagnosis = lr.diagnosis || '';
+ // 只有存在有效信息时才设置 record
+ if (type || date || diagnosis) {
+ record = {
+ type: type || '-',
+ date: date || '-',
+ diagnosis: diagnosis || '-'
+ };
+ }
+ }
return {
...raw,
@@ -310,13 +388,13 @@ function formatPatient(raw) {
name: String(name || ''),
gender: String(sex || ''),
age,
- tags: rawTags.length ? rawTags : (rawTagNames.length ? rawTagNames : tagIds),
+ tags: displayTags,
mobiles,
mobile,
createTime: createTimeStr,
creator: raw?.creatorName || raw?.creator || '',
hospitalId: raw?.customerNumber || raw?.hospitalId || '',
- record: null,
+ record,
createdByDoctor: raw?.addMethod ? String(raw.addMethod) === 'manual' : Boolean(raw?.createdByDoctor),
hasBindWechat: Boolean(raw?.externalUserId || raw?.unionid || raw?.hasBindWechat),
};
@@ -395,7 +473,8 @@ async function reload(reset = true) {
userId,
teamId,
page: page.value,
- pageSize: pageSize.value,
+ pageSize: 1000, // 按首字母排序时,一次加载更多数据以显示完整的字母分组
+ sortByFirstLetter: true, // 按姓名首字母排序
};
if (currentTab.value.kind === 'group' && currentTab.value.groupId) {
@@ -408,7 +487,7 @@ async function reload(reset = true) {
}
loading.value = true;
- const res = await api('searchCorpCustomerWithFollowTime', query);
+ const res = await api('searchCorpCustomerForCaseList', query);
loading.value = false;
if (!res?.success) {
@@ -523,6 +602,7 @@ const toggleTeamPopup = () => {
if (currentTeam.value) uni.setStorageSync(CURRENT_TEAM_STORAGE_KEY, currentTeam.value);
currentTabKey.value = 'all';
loadGroups();
+ loadTeamMembers();
reload(true);
}
});
@@ -574,6 +654,10 @@ const handleCreate = () => {
// 未认证 + 达到10上限:提示去认证
if (!isVerified.value && managedArchiveCountAllTeams.value >= 10) {
+ if (verifyStatus.value === 'verifying') {
+ toast('信息认证中,请耐心等待!');
+ return;
+ }
uni.showModal({
title: '提示',
content: '当前管理档案数已达上限 10 个,完成认证即可升级至 100 个。',
@@ -603,6 +687,10 @@ const handleCreate = () => {
// 新增流程:认证分支
const startVerifyFlow = () => {
+ if (verifyStatus.value === 'verifying') {
+ toast('信息认证中,请耐心等待!');
+ return;
+ }
// 有历史失败记录 -> 展示失败原因 & 重新认证
if (hasVerifyFailedHistory.value) {
uni.showModal({
@@ -625,7 +713,7 @@ const startVerifyFlow = () => {
// ===== 预留入口(后续对接真实页面/接口) =====
const openVerifyEntry = () => {
- uni.showToast({ title: '认证功能待接入', icon: 'none' });
+ uni.navigateTo({ url: '/pages/work/profile?type=cert' });
};
const openAddCustomerServiceEntry = () => {
@@ -715,8 +803,10 @@ onLoad(async () => {
await loadTeams();
if (currentTeam.value) {
await loadGroups();
+ loadTeamMembers();
await reload(true);
}
+ await refreshVerifyStatus();
});
onShow(async () => {
@@ -737,6 +827,8 @@ onShow(async () => {
} else {
await loadGroups();
}
+ loadTeamMembers();
+ await refreshVerifyStatus();
});
@@ -751,7 +843,7 @@ onShow(async () => {
// Padding for batch footer
/* &.is-batch {
- padding-bottom: 50px;
+ padding-bottom: 100rpx;
} */
// We can't use &.is-batch because scoped style and root element is tricky depending on uni-app version/style
// Instead we handle it in content-body or separate view
@@ -761,25 +853,30 @@ onShow(async () => {
display: flex;
justify-content: space-between;
align-items: center;
- padding: 10px 15px;
+ padding: 20rpx 30rpx;
background-color: #fff;
- border-bottom: 1px solid #f0f0f0;
+ border-bottom: 2rpx solid #f0f0f0;
.team-selector {
display: flex;
align-items: center;
- font-size: 18px;
+ font-size: 32rpx;
font-weight: bold;
color: #333;
.team-name {
- margin-right: 5px;
+ margin-right: 10rpx;
+ }
+
+ .team-icon {
+ font-size: 32rpx;
+ color: #333;
}
}
.header-actions {
display: flex;
- gap: 15px;
+ gap: 30rpx;
.action-item {
display: flex;
@@ -788,9 +885,9 @@ onShow(async () => {
justify-content: center;
.action-text {
- font-size: 10px;
+ font-size: 20rpx;
color: #333;
- margin-top: 2px;
+ margin-top: 4rpx;
}
}
}
@@ -800,8 +897,8 @@ onShow(async () => {
display: flex;
align-items: center;
background-color: #f5f7fa;
- border-bottom: 1px solid #eee;
- padding-right: 15px; // Padding for the count
+ border-bottom: 2rpx solid #eee;
+ padding-right: 30rpx; // Padding for the count
.tabs-scroll {
flex: 1;
@@ -810,15 +907,15 @@ onShow(async () => {
.tabs-container {
display: flex;
- padding: 10px 15px;
+ padding: 20rpx 30rpx;
.tab-item {
- padding: 5px 15px;
- margin-right: 10px;
- font-size: 14px;
+ padding: 10rpx 30rpx;
+ margin-right: 20rpx;
+ font-size: 28rpx;
color: #666;
background-color: #fff;
- border-radius: 4px;
+ border-radius: 8rpx;
flex-shrink: 0;
&.active {
@@ -831,11 +928,11 @@ onShow(async () => {
}
.total-count-inline {
- font-size: 12px;
+ font-size: 24rpx;
color: #666;
white-space: nowrap;
flex-shrink: 0;
- min-width: 50px;
+ min-width: 100rpx;
text-align: right;
}
}
@@ -854,22 +951,22 @@ onShow(async () => {
}
.group-title {
- padding: 5px 15px;
- font-size: 14px;
+ padding: 10rpx 30rpx;
+ font-size: 28rpx;
color: #333;
}
.patient-card {
display: flex;
background-color: #fff;
- padding: 15px;
- margin-bottom: 1px; // Separator line
- border-bottom: 1px solid #f0f0f0;
+ padding: 30rpx;
+ margin-bottom: 2rpx; // Separator line
+ border-bottom: 2rpx solid #f0f0f0;
.checkbox-area {
display: flex;
align-items: center;
- margin-right: 10px;
+ margin-right: 20rpx;
}
.card-content {
@@ -879,51 +976,59 @@ onShow(async () => {
.card-row-top {
display: flex;
align-items: center;
- margin-bottom: 8px;
+ margin-bottom: 16rpx;
flex-wrap: wrap;
.patient-info {
display: flex;
align-items: flex-end;
- margin-right: 10px;
+ margin-right: 20rpx;
.patient-name {
- font-size: 18px;
+ font-size: 32rpx;
font-weight: bold;
color: #333;
- margin-right: 8px;
+ margin-right: 16rpx;
}
.patient-meta {
- font-size: 12px;
+ font-size: 24rpx;
color: #999;
- margin-bottom: 2px;
+ margin-bottom: 4rpx;
}
}
.patient-tags {
display: flex;
- gap: 5px;
+ gap: 10rpx;
.tag {
- font-size: 10px;
+ font-size: 20rpx;
color: #5d8aff;
- border: 1px solid #5d8aff;
- padding: 0 4px;
- border-radius: 8px;
- height: 16px;
- line-height: 14px;
+ border: 2rpx solid #5d8aff;
+ padding: 0 8rpx;
+ border-radius: 16rpx;
+ height: 32rpx;
+ line-height: 28rpx;
}
}
}
.card-row-bottom {
- font-size: 14px;
+ font-size: 28rpx;
.record-text {
color: #666;
}
+ .record-ellipsis {
+ display: block;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ max-width: 100%;
+ }
+
.no-record {
color: #bdc3c7;
}
@@ -935,39 +1040,39 @@ onShow(async () => {
bottom: 0;
left: 0;
right: 0;
- height: 50px;
+ height: 100rpx;
background-color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
- padding: 0 15px;
- box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
+ padding: 0 30rpx;
+ box-shadow: 0 -4rpx 20rpx rgba(0,0,0,0.05);
z-index: 99;
.left-action {
display: flex;
align-items: center;
.footer-text {
- margin-left: 5px;
- font-size: 14px;
+ margin-left: 10rpx;
+ font-size: 28rpx;
color: #333;
}
}
.right-actions {
display: flex;
- gap: 10px;
+ gap: 20rpx;
.footer-btn {
- font-size: 14px;
- padding: 0 15px;
- height: 32px;
- line-height: 32px;
+ font-size: 28rpx;
+ padding: 0 30rpx;
+ height: 64rpx;
+ line-height: 64rpx;
margin: 0;
- border-radius: 4px;
+ border-radius: 8rpx;
&.plain {
- border: 1px solid #ddd;
+ border: 2rpx solid #ddd;
background-color: #fff;
color: #666;
}
@@ -986,11 +1091,11 @@ onShow(async () => {
}
.sidebar-index {
- width: 20px;
+ width: 40rpx;
position: absolute;
right: 0;
- top: 20px;
- bottom: 20px;
+ top: 40rpx;
+ bottom: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
@@ -999,10 +1104,10 @@ onShow(async () => {
z-index: 10;
.index-item {
- font-size: 10px;
+ font-size: 20rpx;
color: #555;
- padding: 2px 0;
- width: 20px;
+ padding: 4rpx 0;
+ width: 40rpx;
text-align: center;
font-weight: 500;
}
diff --git a/pages/case/patient-create.vue b/pages/case/patient-create.vue
index 42ce0aa..e775e91 100644
--- a/pages/case/patient-create.vue
+++ b/pages/case/patient-create.vue
@@ -129,6 +129,15 @@ function normalizeTemplateItem(item) {
return next;
}
+function unwrapTemplate(res) {
+ const d = res?.data;
+ if (d && typeof d === 'object') {
+ if (d.data && typeof d.data === 'object') return d.data;
+ return d;
+ }
+ return res && typeof res === 'object' ? res : {};
+}
+
async function loadBaseTemplate() {
const corpId = String(account.value?.corpId || doctorInfo.value?.corpId || '') || '';
if (!corpId) return;
@@ -142,7 +151,7 @@ async function loadBaseTemplate() {
return;
}
- const temp = res?.data && typeof res.data === 'object' ? res.data : res;
+ const temp = unwrapTemplate(res);
const list = Array.isArray(temp.templateList) ? temp.templateList : [];
baseItems.value = list
.filter((i) => i && i.fieldStatus !== 'disable')
diff --git a/pages/case/patient-inner-info.vue b/pages/case/patient-inner-info.vue
index 08d9b72..c51b1d4 100644
--- a/pages/case/patient-inner-info.vue
+++ b/pages/case/patient-inner-info.vue
@@ -95,7 +95,7 @@ function normalizeTemplateItem(item) {
const customTypeMap = {
customerSource: 'select',
customerStage: 'select',
- tag: 'multiSelectAndOther',
+ tag: 'tagPicker',
reference: 'input',
selectWwuser: 'select',
files: 'files',
@@ -144,12 +144,139 @@ function normalizeTemplateItem(item) {
return next;
}
+function unwrapTemplate(res) {
+ // 兼容后端返回结构:{ success, data: { data: template } } / { success, data: template } / { templateList: [] }
+ const d = res?.data;
+ if (d && typeof d === 'object') {
+ if (d.data && typeof d.data === 'object') return d.data;
+ return d;
+ }
+ return res && typeof res === 'object' ? res : {};
+}
+
+function ensureInternalDefaults(list, { stageOptions = [], tagOptions = [] } = {}) {
+ const items = Array.isArray(list) ? [...list] : [];
+ const has = (title) => items.some((i) => i && String(i.title || '') === title);
+
+ // 与 mobile 内部信息页一致:标签 / 备注 / 阶段
+ if (!has('tagIds')) {
+ items.unshift({
+ title: 'tagIds',
+ name: '标签',
+ type: 'tag',
+ operateType: 'formCell',
+ required: false,
+ wordLimit: 200,
+ range: tagOptions,
+ });
+ }
+ if (!has('notes')) {
+ items.push({
+ title: 'notes',
+ name: '备注',
+ type: 'textarea',
+ operateType: 'formCell',
+ required: false,
+ wordLimit: 200,
+ });
+ }
+ if (!has('customerStage')) {
+ items.push({
+ title: 'customerStage',
+ name: '阶段',
+ type: 'customerStage',
+ operateType: 'formCell',
+ required: false,
+ range: stageOptions,
+ });
+ }
+ return items;
+}
+
+function unwrapListPayload(res) {
+ const root = res && typeof res === 'object' ? res : {};
+ const d = root.data && typeof root.data === 'object' ? root.data : root;
+ if (!d) return [];
+ if (Array.isArray(d)) return d;
+ if (Array.isArray(d.data)) return d.data;
+ if (Array.isArray(d.list)) return d.list;
+ if (d.data && typeof d.data === 'object') {
+ if (Array.isArray(d.data.data)) return d.data.data;
+ if (Array.isArray(d.data.list)) return d.data.list;
+ }
+ return [];
+}
+
+function parseCustomerStageOptions(res) {
+ const list = unwrapListPayload(res);
+ return list
+ .map((i) => {
+ if (typeof i === 'string') return { label: i, value: i };
+ const label = i?.name ?? i?.label ?? '';
+ const value = i?.type ?? i?.value ?? i?.id ?? i?.key ?? label;
+ if (!label && (value === undefined || value === null || value === '')) return null;
+ return { label: String(label || value), value: String(value) };
+ })
+ .filter(Boolean);
+}
+
+function parseTagOptions(res) {
+ const list = unwrapListPayload(res);
+ let flat = [];
+
+ // 形态1:[{ groupName, tag: [{id,name}] }]
+ if (list.length && typeof list[0] === 'object' && Array.isArray(list[0]?.tag)) {
+ flat = list.reduce((acc, g) => {
+ if (Array.isArray(g?.tag)) acc.push(...g.tag);
+ return acc;
+ }, []);
+ } else {
+ flat = list;
+ }
+
+ const options = flat
+ .map((i) => {
+ if (typeof i === 'string') return { label: i, value: i };
+ const label = i?.name ?? i?.label ?? i?.text ?? '';
+ const value = i?.id ?? i?.value ?? i?.key ?? label;
+ if (!label && (value === undefined || value === null || value === '')) return null;
+ return { label: String(label || value), value: String(value) };
+ })
+ .filter(Boolean);
+
+ const seen = new Set();
+ return options.filter((i) => {
+ if (!i?.value) return false;
+ if (seen.has(i.value)) return false;
+ seen.add(i.value);
+ return true;
+ });
+}
+
+function isStageItem(i) {
+ const title = String(i?.title || '');
+ const type = String(i?.type || '');
+ const name = String(i?.name || '');
+ return title === 'customerStage' || type === 'customerStage' || name.includes('阶段');
+}
+
+function isTagItem(i) {
+ const title = String(i?.title || '');
+ const type = String(i?.type || '');
+ const name = String(i?.name || '');
+ return title === 'tagIds' || title === 'tag' || type === 'tag' || name.includes('标签');
+}
+
async function loadInternalTemplate() {
const corpId = String(account.value?.corpId || doctorInfo.value?.corpId || '') || '';
if (!corpId) return;
loading('加载中...');
- const res = await api('getCurrentTemplate', { corpId, templateType: 'internalTemplate' });
+ const [res, stageRes, tagRes] = await Promise.all([
+ api('getCurrentTemplate', { corpId, templateType: 'internalTemplate' }),
+ api('getCustomerType', { corpId }),
+ api('getCorpTags', { corpId }),
+ ]);
hideLoading();
if (!res?.success) {
@@ -157,12 +284,32 @@ async function loadInternalTemplate() {
return;
}
- const temp = res?.data && typeof res.data === 'object' ? res.data : res;
- const list = Array.isArray(temp.templateList) ? temp.templateList : [];
+ console.log('[debug][wxapp][patient-inner-info] corpId:', corpId);
+ console.log('[debug][wxapp][patient-inner-info] getCustomerType:', stageRes);
+ console.log('[debug][wxapp][patient-inner-info] getCorpTags:', tagRes);
+
+ const stageOptions = parseCustomerStageOptions(stageRes);
+ const tagOptions = parseTagOptions(tagRes);
+ console.log('[debug][wxapp][patient-inner-info] parsed stageOptions:', stageOptions.length, stageOptions);
+ console.log('[debug][wxapp][patient-inner-info] parsed tagOptions:', tagOptions.length, tagOptions);
+
+ const temp = unwrapTemplate(res);
+ const list = ensureInternalDefaults(Array.isArray(temp.templateList) ? temp.templateList : [], { stageOptions, tagOptions }).map((i) => {
+ const item = { ...(i || {}) };
+ if (isStageItem(item) && (!Array.isArray(item.range) || item.range.length === 0)) item.range = stageOptions;
+ if (isTagItem(item) && (!Array.isArray(item.range) || item.range.length === 0)) item.range = tagOptions;
+ if (isTagItem(item) && item.title === 'tag') item.title = 'tagIds';
+ return item;
+ });
items.value = list
.filter((i) => i && i.fieldStatus !== 'disable')
.filter((i) => i.operateType !== 'onlyRead')
.map(normalizeTemplateItem);
+
+ const debugStage = items.value.find(isStageItem);
+ const debugTag = items.value.find(isTagItem);
+ console.log('[debug][wxapp][patient-inner-info] final stage item:', debugStage);
+ console.log('[debug][wxapp][patient-inner-info] final tag item:', debugTag);
}
onLoad(async () => {
@@ -235,6 +382,7 @@ function buildPayload(base, inner) {
if (payload.gender && !payload.sex) payload.sex = payload.gender;
if (payload.idNo && !payload.idCard) payload.idCard = payload.idNo;
if (payload.idType && !payload.cardType) payload.cardType = payload.idType;
+ if (payload.tag && !payload.tagIds) payload.tagIds = payload.tag;
if (Array.isArray(payload.teamId)) payload.teamId = payload.teamId[0] || '';
if (payload.customerSource && typeof payload.customerSource === 'string') {
diff --git a/pages/case/search.vue b/pages/case/search.vue
index 3c2ebe7..3824d3a 100644
--- a/pages/case/search.vue
+++ b/pages/case/search.vue
@@ -98,23 +98,45 @@ function getTeamContext() {
}
function formatPatient(raw) {
- const rawTags = asArray(raw?.tags).filter((i) => typeof i === 'string');
- const rawTagNames = asArray(raw?.tagNames).filter((i) => typeof i === 'string');
-
+ // 优先使用后端返回的 tagNames(标签名称数组)
+ const rawTagNames = asArray(raw?.tagNames).filter((i) => typeof i === 'string' && i.trim());
+ // 其次使用 tags(如果是字符串数组)
+ const rawTags = asArray(raw?.tags).filter((i) => typeof i === 'string' && i.trim());
+ // 最后才使用 tagIds(仅作为兜底,不推荐显示)
const tagIds = asArray(raw?.tagIds).map(String).filter(Boolean);
+
+ // 解析标签:优先 tagNames > tags(字符串) > tagIds
+ const displayTags = rawTagNames.length ? rawTagNames : (rawTags.length ? rawTags : []);
+
const mobiles = asArray(raw?.mobiles).map(String).filter(Boolean);
const mobile = raw?.mobile ? String(raw.mobile) : (mobiles[0] || '');
+ // 解析病历信息
+ let record = null;
+ if (raw?.latestRecord && typeof raw.latestRecord === 'object') {
+ const lr = raw.latestRecord;
+ const type = lr.type || '';
+ const date = lr.date || '';
+ const diagnosis = lr.diagnosis || '';
+ if (type || date || diagnosis) {
+ record = {
+ type: type || '-',
+ date: date || '-',
+ diagnosis: diagnosis || '-'
+ };
+ }
+ }
+
return {
...raw,
_id: raw?._id || raw?.id || '',
name: raw?.name || raw?.customerName || '',
gender: raw?.sex || raw?.gender || '',
age: raw?.age ?? '',
- tags: rawTags.length ? rawTags : (rawTagNames.length ? rawTagNames : tagIds),
+ tags: displayTags,
mobiles,
mobile,
- record: null,
+ record,
createTime: raw?.createTime || '',
creator: raw?.creatorName || raw?.creator || '',
hospitalId: raw?.customerNumber || raw?.hospitalId || '',
@@ -142,7 +164,7 @@ const doSearch = useDebounce(async () => {
}
searching.value = true;
- const res = await api('searchCorpCustomerWithFollowTime', {
+ const res = await api('searchCorpCustomerForCaseList', {
corpId,
userId,
teamId,
@@ -315,6 +337,11 @@ const goDetail = (patient) => {
.record-text {
color: #666;
+ display: block;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ max-width: 100%;
}
.no-record {
diff --git a/pages/case/visit-record-detail.vue b/pages/case/visit-record-detail.vue
index 529c736..98f8769 100644
--- a/pages/case/visit-record-detail.vue
+++ b/pages/case/visit-record-detail.vue
@@ -28,7 +28,7 @@
-
+
暂无诊断数据
-
+
-
+