Merge commit '4e0bbbf3e36ad79e0865a365f94c1c06e8f59577' into dev-wdb

This commit is contained in:
wangdongbo 2026-01-30 13:52:59 +08:00
commit 7b222b6143
25 changed files with 1452 additions and 531 deletions

View File

@ -1,18 +1,6 @@
<template> <template>
<!-- Mobile 来源: ykt-management-mobile/src/pages/customer/customer-detail/customer-profile.vue --> <!-- Mobile 来源: ykt-management-mobile/src/pages/customer/customer-detail/customer-profile.vue -->
<view class="wrap"> <view class="wrap">
<view class="sub-tabs">
<view
v-for="t in anchors"
:key="t.value"
class="sub-tab"
:class="{ active: activeAnchor === t.value }"
@click="scrollToAnchor(t.value)"
>
{{ t.label }}
</view>
</view>
<view class="card"> <view class="card">
<view id="anchor-base" class="section-title" @click="startEdit"> <view id="anchor-base" class="section-title" @click="startEdit">
<text>基本信息</text> <text>基本信息</text>
@ -55,7 +43,7 @@
<view class="row" @click="openTransferRecord"> <view class="row" @click="openTransferRecord">
<view class="label">院内来源</view> <view class="label">院内来源</view>
<view class="val link"> <view class="val link">
{{ forms.creator || '点击查看' }} {{ latestTransferRecord?.executeTeamName || '点击查看' }}
<uni-icons type="arrowright" size="14" color="#4f6ef7" /> <uni-icons type="arrowright" size="14" color="#4f6ef7" />
</view> </view>
</view> </view>
@ -88,26 +76,32 @@
<uni-popup ref="transferPopupRef" type="bottom" :mask-click="true"> <uni-popup ref="transferPopupRef" type="bottom" :mask-click="true">
<view class="popup"> <view class="popup">
<view class="popup-title"> <view class="popup-title">
<view class="popup-title-text">院内流转记录mock</view> <view class="popup-title-text">院内流转记录</view>
<view class="popup-close" @click="closeTransferRecord"> <view class="popup-close" @click="closeTransferRecord">
<uni-icons type="closeempty" size="18" color="#666" /> <uni-icons type="closeempty" size="18" color="#666" />
</view> </view>
</view> </view>
<scroll-view scroll-y class="popup-body"> <scroll-view scroll-y class="popup-body">
<view class="timeline"> <view v-if="transferRecords.length" class="timeline">
<view class="line"></view> <view class="line"></view>
<view v-for="r in transferRecords" :key="r._id" class="item"> <view v-for="r in transferRecords" :key="r._id" class="item">
<view class="dot"></view> <view class="dot"></view>
<view class="content"> <view class="content">
<view class="time">{{ r.time }}</view> <view class="time">{{ r.createTime }}</view>
<view class="card2"> <view class="card2">
<view class="trow"><text class="tlabel">转入团队:</text>{{ r.team }}</view> <view v-if="r.executeTeamName" class="trow"><text class="tlabel">转入团队:</text>{{ r.executeTeamName }}</view>
<view class="trow"><text class="tlabel">转入方式:</text>{{ r.type }}</view> <view v-if="r.eventTypeName" class="trow"><text class="tlabel">转入方式:</text>{{ r.eventTypeName }}</view>
<view class="trow"><text class="tlabel">操作人:</text>{{ r.user }}</view> <view v-if="r.creatorUserName" class="trow">
<text class="tlabel">操作人:</text>
<text>{{ r.creatorUserName }}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-else class="empty-state">
<text class="empty-text">暂无流转记录</text>
</view>
</scroll-view> </scroll-view>
</view> </view>
</uni-popup> </uni-popup>
@ -115,9 +109,13 @@
</template> </template>
<script setup> <script setup>
import { computed, reactive, ref, watch } from 'vue'; import { computed, reactive, ref, watch, onMounted } from 'vue';
import { storeToRefs } from 'pinia';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import FormTemplate from '@/components/form-template/index.vue'; import FormTemplate from '@/components/form-template/index.vue';
import api from '@/utils/api';
import useAccountStore from '@/store/account';
import useTeamStore from '@/store/team';
const props = defineProps({ const props = defineProps({
data: { type: Object, default: () => ({}) }, data: { type: Object, default: () => ({}) },
@ -127,11 +125,10 @@ const props = defineProps({
}); });
const emit = defineEmits(['save']); const emit = defineEmits(['save']);
const anchors = [ const accountStore = useAccountStore();
{ label: '基本信息', value: 'base' }, const teamStore = useTeamStore();
{ label: '内部信息', value: 'internal' }, const { account, doctorInfo } = storeToRefs(accountStore);
]; const { teams } = storeToRefs(teamStore);
const activeAnchor = ref('base');
const editing = ref(false); const editing = ref(false);
const baseFormRef = ref(null); const baseFormRef = ref(null);
@ -224,7 +221,21 @@ function displayValue(item) {
return list.length ? `已上传${list.length}` : '-'; return list.length ? `已上传${list.length}` : '-';
} }
if (Array.isArray(v)) return v.filter(Boolean).join('、') || '-'; if (Array.isArray(v)) {
// rangelabel
if (type === 'select' || type === 'radio' || type === 'selectAndImage' || type === 'tagPicker' || item.__originType === 'tag') {
const range = Array.isArray(item?.range) ? item.range : [];
if (range.length && typeof range[0] === 'object') {
const labels = v.map((val) => {
const found = range.find((i) => String(i?.value) === String(val));
return found ? String(found.label || found.value || val) : String(val);
}).filter(Boolean);
return labels.length ? labels.join('、') : '-';
}
}
return v.filter(Boolean).join('、') || '-';
}
if (typeof v === 'object') { if (typeof v === 'object') {
if ('label' in v) return String(v.label || '-'); if ('label' in v) return String(v.label || '-');
if ('name' in v) return String(v.name || '-'); if ('name' in v) return String(v.name || '-');
@ -258,82 +269,154 @@ function scrollToAnchor(key) {
const transferPopupRef = ref(null); const transferPopupRef = ref(null);
const transferRecords = ref([]); const transferRecords = ref([]);
const latestTransferRecord = computed(() => transferRecords.value[0]);
const userNameMap = ref({});
function openTransferRecord() { const CURRENT_TEAM_STORAGE_KEY = 'ykt_case_current_team';
transferRecords.value = [
{ _id: 't1', time: dayjs().subtract(120, 'day').format('YYYY-MM-DD HH:mm'), team: '口腔一科(示例)', type: '系统建档', user: '系统' }, function getCorpId() {
{ _id: 't2', time: dayjs().subtract(30, 'day').format('YYYY-MM-DD HH:mm'), team: '正畸团队(示例)', type: '团队流转', user: '管理员A' }, const d = doctorInfo.value || {};
]; const a = account.value || {};
const team = uni.getStorageSync(CURRENT_TEAM_STORAGE_KEY) || {};
return String(d.corpId || a.corpId || team.corpId || '') || '';
}
async function loadTeamMembers() {
const corpId = getCorpId();
const team = uni.getStorageSync(CURRENT_TEAM_STORAGE_KEY) || {};
const teamId = team?.teamId ? String(team.teamId) : '';
if (!corpId || !teamId) return;
if (Object.keys(userNameMap.value || {}).length > 0) 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 : [];
userNameMap.value = members.reduce((acc, m) => {
const uid = String(m?.userid || '');
if (!uid) return acc;
acc[uid] = String(m?.anotherName || m?.name || m?.userid || '') || uid;
return acc;
}, {});
} catch (e) {
console.error('获取团队成员失败', e);
}
}
function resolveUserName(userId) {
const id = String(userId || '');
if (!id) return '';
const map = userNameMap.value || {};
return String(map[id] || id) || id;
}
const ServiceType = {
remindFiling: '自主开拓',
adminTransferTeams: '团队流转',
adminRemoveTeams: '移出团队',
systemAutoDistribute: '系统分配',
bindWechatCustomer: '绑定企业微信',
share: '共享',
transfer: '转移',
importCustomer: '导入客户',
addCustomer: '新增客户',
};
async function fetchTransferRecords() {
const customerId = props.data?._id;
if (!customerId) return;
//
await loadTeamMembers();
try {
const res = await api('customerTransferRecord', { customerId });
if (res?.success && res.list) {
const allTeams = Array.isArray(teams.value) ? teams.value : [];
transferRecords.value = res.list.map((item) => {
const record = { ...item };
record.createTime = dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss');
record.executeTeamName = allTeams.find((team) => team.teamId === item.executeTeamId)?.name || item.executeTeamName;
record.eventTypeName = ServiceType[item.eventType] || item.eventType;
record.creatorUserName = item.creatorUserId === 'system' ? '系统自动建档' : resolveUserName(item.creatorUserId);
if (item.transferToTeamIds && Array.isArray(item.transferToTeamIds)) {
record.teamName = item.transferToTeamIds.map((teamId) => allTeams.find((team) => team.teamId === teamId)?.name).join('、');
}
if (item.removeTeamIds && Array.isArray(item.removeTeamIds)) {
record.teamName = item.removeTeamIds.map((teamId) => allTeams.find((team) => team.teamId === teamId)?.name).join('、');
}
if (item.eventType === 'remindFiling') record.eventTypeName = '自主开拓';
return record;
});
}
} catch (e) {
console.error('获取流转记录失败', e);
}
}
async function openTransferRecord() {
await fetchTransferRecords();
transferPopupRef.value?.open?.(); transferPopupRef.value?.open?.();
} }
function closeTransferRecord() { function closeTransferRecord() {
transferPopupRef.value?.close?.(); transferPopupRef.value?.close?.();
} }
onMounted(() => {
fetchTransferRecords();
});
watch(() => props.data?._id, () => {
if (props.data?._id) fetchTransferRecords();
});
</script> </script>
<style scoped> <style scoped>
.wrap { .wrap {
padding: 12px 0 96px; padding: 24rpx 0 192rpx;
}
.sub-tabs {
display: flex;
background: #f5f6f8;
border-bottom: 1px solid #f2f2f2;
}
.sub-tab {
flex: 1;
text-align: center;
height: 40px;
line-height: 40px;
font-size: 13px;
color: #666;
}
.sub-tab.active {
color: #4f6ef7;
font-weight: 600;
} }
.card { .card {
background: #fff; background: #fff;
margin-top: 10px; margin-top: 20rpx;
} }
.section-title { .section-title {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 12px 14px; padding: 24rpx 28rpx;
font-size: 15px; font-size: 30rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
border-bottom: 1px solid #f2f2f2; border-bottom: 2rpx solid #f2f2f2;
} }
.pen { .pen {
width: 18px; width: 36rpx;
height: 18px; height: 36rpx;
} }
.rows { .rows {
padding: 2px 14px; padding: 4rpx 28rpx;
} }
.row { .row {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 12px 0; padding: 24rpx 0;
border-bottom: 1px solid #f6f6f6; border-bottom: 2rpx solid #f6f6f6;
} }
.row:last-child { .row:last-child {
border-bottom: none; border-bottom: none;
} }
.label { .label {
width: 90px; width: 180rpx;
font-size: 14px; font-size: 28rpx;
color: #666; color: #666;
} }
.val { .val {
flex: 1; flex: 1;
text-align: right; text-align: right;
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
} }
.val.link { .val.link {
@ -341,13 +424,13 @@ function closeTransferRecord() {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
gap: 6px; gap: 12rpx;
} }
.input, .input,
.picker { .picker {
flex: 1; flex: 1;
text-align: right; text-align: right;
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
} }
@ -356,18 +439,18 @@ function closeTransferRecord() {
left: 0; left: 0;
right: 0; right: 0;
background: #fff; background: #fff;
padding: 12px 14px; padding: 24rpx 28rpx;
display: flex; display: flex;
gap: 12px; gap: 24rpx;
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
z-index: 30; z-index: 30;
} }
.btn { .btn {
flex: 1; flex: 1;
height: 44px; height: 88rpx;
line-height: 44px; line-height: 88rpx;
border-radius: 6px; border-radius: 12rpx;
font-size: 15px; font-size: 30rpx;
} }
.btn::after { .btn::after {
border: none; border: none;
@ -375,7 +458,7 @@ function closeTransferRecord() {
.btn.plain { .btn.plain {
background: #fff; background: #fff;
color: #4f6ef7; color: #4f6ef7;
border: 1px solid #4f6ef7; border: 2rpx solid #4f6ef7;
} }
.btn.primary { .btn.primary {
background: #4f6ef7; background: #4f6ef7;
@ -384,24 +467,24 @@ function closeTransferRecord() {
.popup { .popup {
background: #fff; background: #fff;
border-top-left-radius: 10px; border-top-left-radius: 20rpx;
border-top-right-radius: 10px; border-top-right-radius: 20rpx;
overflow: hidden; overflow: hidden;
} }
.popup-title { .popup-title {
position: relative; position: relative;
padding: 14px; padding: 28rpx;
border-bottom: 1px solid #f0f0f0; border-bottom: 2rpx solid #f0f0f0;
} }
.popup-title-text { .popup-title-text {
text-align: center; text-align: center;
font-size: 16px; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
} }
.popup-close { .popup-close {
position: absolute; position: absolute;
right: 12px; right: 24rpx;
top: 0; top: 0;
height: 100%; height: 100%;
display: flex; display: flex;
@ -412,47 +495,63 @@ function closeTransferRecord() {
} }
.timeline { .timeline {
position: relative; position: relative;
padding: 14px 14px 18px; padding: 40rpx 28rpx 36rpx 28rpx;
} }
.line { .line {
position: absolute; position: absolute;
left: 22px; left: 48rpx;
top: 18px; top: 56rpx;
bottom: 18px; bottom: 36rpx;
width: 2px; width: 4rpx;
background: #4f6ef7; background: #4f6ef7;
} }
.item { .item {
position: relative; position: relative;
padding-left: 32px; padding-left: 80rpx;
margin-bottom: 14px; margin-bottom: 40rpx;
}
.item:last-child {
margin-bottom: 0;
} }
.dot { .dot {
position: absolute; position: absolute;
left: 16px; left: 6rpx;
top: 6px; top: 8rpx;
width: 10px; width: 24rpx;
height: 10px; height: 24rpx;
border-radius: 50%; border-radius: 50%;
background: #4f6ef7; background: #4f6ef7;
border: 4rpx solid #fff;
box-shadow: 0 0 0 4rpx #4f6ef7;
} }
.time { .time {
font-size: 12px; font-size: 24rpx;
color: #999; color: #999;
margin-bottom: 8px; margin-bottom: 16rpx;
} }
.card2 { .card2 {
border: 1px solid #f0f0f0; border: 2rpx solid #f0f0f0;
border-radius: 8px; border-radius: 16rpx;
padding: 10px; padding: 24rpx;
background: #fafafa;
} }
.trow { .trow {
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
line-height: 20px; line-height: 40rpx;
} }
.tlabel { .tlabel {
color: #666; color: #666;
margin-right: 6px; margin-right: 12rpx;
}
.empty-state {
padding: 80rpx 40rpx;
text-align: center;
}
.empty-text {
font-size: 28rpx;
color: #999;
} }
</style> </style>

View File

@ -381,57 +381,57 @@ watch(
<style scoped> <style scoped>
.wrap { .wrap {
padding: 12px 0 96px; padding: 24rpx 0 192rpx;
} }
.filters { .filters {
display: flex; display: flex;
gap: 10px; gap: 20rpx;
padding: 10px 14px; padding: 20rpx 28rpx;
background: #f5f6f8; background: #f5f6f8;
border-bottom: 1px solid #f2f2f2; border-bottom: 2rpx solid #f2f2f2;
} }
.filter-pill { .filter-pill {
background: #fff; background: #fff;
border: 1px solid #e6e6e6; border: 2rpx solid #e6e6e6;
border-radius: 6px; border-radius: 12rpx;
padding: 10px 12px; padding: 20rpx 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: 10px; gap: 20rpx;
flex: 1; flex: 1;
} }
.pill-text { .pill-text {
font-size: 13px; font-size: 26rpx;
color: #333; color: #333;
max-width: 180px; max-width: 360rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.share-tip { .share-tip {
padding: 10px 14px 0; padding: 20rpx 28rpx 0;
} }
.share-tip-text { .share-tip-text {
display: inline-block; display: inline-block;
background: #eef2ff; background: #eef2ff;
color: #4338ca; color: #4338ca;
font-size: 12px; font-size: 24rpx;
padding: 6px 10px; padding: 12rpx 20rpx;
border-radius: 6px; border-radius: 12rpx;
} }
.list { .list {
padding: 0 14px; padding: 0 28rpx;
} }
.card { .card {
background: #fff; background: #fff;
border-radius: 10px; border-radius: 20rpx;
margin-top: 10px; margin-top: 20rpx;
overflow: hidden; overflow: hidden;
box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06); box-shadow: 0 12rpx 28rpx rgba(0, 0, 0, 0.06);
} }
.record { .record {
padding: 0; padding: 0;
@ -439,28 +439,28 @@ watch(
.record-head { .record-head {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 12px 12px 10px; padding: 24rpx 24rpx 20rpx;
gap: 8px; gap: 16rpx;
} }
.record-title { .record-title {
font-size: 15px; font-size: 30rpx;
font-weight: 600; font-weight: 600;
color: #1f1f1f; color: #1f1f1f;
} }
.record-date { .record-date {
font-size: 14px; font-size: 28rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
} }
.record-body { .record-body {
padding: 0 12px 12px; padding: 0 24rpx 24rpx;
} }
.line { .line {
display: flex; display: flex;
padding-top: 10px; padding-top: 20rpx;
font-size: 13px; font-size: 26rpx;
color: #333; color: #333;
line-height: 18px; line-height: 36rpx;
} }
.line-label { .line-label {
flex-shrink: 0; flex-shrink: 0;
@ -475,47 +475,47 @@ watch(
} }
.thumbs { .thumbs {
padding-top: 10px; padding-top: 20rpx;
display: flex; display: flex;
gap: 10px; gap: 20rpx;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
} }
.thumb { .thumb {
width: 84px; width: 168rpx;
height: 64px; height: 128rpx;
border-radius: 6px; border-radius: 12rpx;
overflow: hidden; overflow: hidden;
background: #f3f4f6; background: #f3f4f6;
border: 1px solid #e5e7eb; border: 2rpx solid #e5e7eb;
} }
.thumb-img { .thumb-img {
width: 84px; width: 168rpx;
height: 64px; height: 128rpx;
} }
.thumb-more { .thumb-more {
font-size: 12px; font-size: 24rpx;
color: #6b7280; color: #6b7280;
} }
.record-foot { .record-foot {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 12px 12px; padding: 24rpx 24rpx;
border-top: 1px solid #f2f2f2; border-top: 2rpx solid #f2f2f2;
font-size: 12px; font-size: 24rpx;
color: #999; color: #999;
} }
.foot-left { .foot-left {
flex-shrink: 0; flex-shrink: 0;
margin-right: 10px; margin-right: 20rpx;
} }
.record-tag { .record-tag {
font-size: 12px; font-size: 24rpx;
color: #fff; color: #fff;
padding: 4px 8px; padding: 8rpx 16rpx;
border-radius: 8px; border-radius: 16rpx;
} }
.bg-blue { .bg-blue {
background: #4f6ef7; background: #4f6ef7;
@ -537,23 +537,23 @@ watch(
} }
.empty { .empty {
padding: 120px 0; padding: 240rpx 0;
text-align: center; text-align: center;
color: #9aa0a6; color: #9aa0a6;
font-size: 13px; font-size: 26rpx;
} }
.fab { .fab {
position: fixed; position: fixed;
right: 16px; right: 32rpx;
width: 52px; width: 104rpx;
height: 52px; height: 104rpx;
border-radius: 26px; border-radius: 52rpx;
background: #4f6ef7; background: #4f6ef7;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 10px 18px rgba(79, 110, 247, 0.35); box-shadow: 0 20rpx 36rpx rgba(79, 110, 247, 0.35);
z-index: 20; z-index: 20;
} }
</style> </style>

View File

@ -420,16 +420,16 @@ watch(
<style scoped> <style scoped>
.wrap { .wrap {
padding: 8px 0 96px; padding: 16rpx 0 192rpx;
} }
.filters { .filters {
padding: 10px 14px; padding: 20rpx 28rpx;
background: #fff; background: #fff;
border-bottom: 1px solid #f0f0f0; border-bottom: 2rpx solid #f0f0f0;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: 24rpx;
} }
.filter-item { .filter-item {
display: block; display: block;
@ -442,18 +442,18 @@ watch(
/* Removed old deep selectors */ /* Removed old deep selectors */
.filter-pill { .filter-pill {
background: #f7f8fa; background: #f7f8fa;
border: 1px solid #e5e7eb; border: 2rpx solid #e5e7eb;
border-radius: 6px; border-radius: 12rpx;
padding: 10px 12px; padding: 20rpx 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 16rpx;
width: 100%; width: 100%;
min-width: 0; min-width: 0;
box-sizing: border-box; /* Ensure padding doesn't overflow width */ box-sizing: border-box; /* Ensure padding doesn't overflow width */
} }
.pill-text { .pill-text {
font-size: 13px; font-size: 26rpx;
color: #333; color: #333;
flex: 1; flex: 1;
min-width: 0; min-width: 0;
@ -478,11 +478,11 @@ watch(
.timeline { .timeline {
background: #fff; background: #fff;
margin-top: 6px; margin-top: 12rpx;
padding: 10px 0 70px; padding: 20rpx 0 140rpx;
} }
.cell { .cell {
padding: 0 14px; padding: 0 28rpx;
position: relative; position: relative;
} }
.head { .head {
@ -490,48 +490,48 @@ watch(
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
height: 44px; height: 88rpx;
padding-left: 18px; padding-left: 36rpx;
} }
.dot { .dot {
position: absolute; position: absolute;
left: 0; left: 0;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
width: 8px; width: 16rpx;
height: 8px; height: 16rpx;
border-radius: 50%; border-radius: 50%;
background: #4f6ef7; background: #4f6ef7;
} }
.time { .time {
font-size: 14px; font-size: 28rpx;
font-weight: 600; font-weight: 600;
color: #1f1f1f; color: #1f1f1f;
} }
.file-link { .file-link {
font-size: 13px; font-size: 26rpx;
color: #4f6ef7; color: #4f6ef7;
} }
.meta { .meta {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 20rpx;
padding-left: 18px; padding-left: 36rpx;
margin-bottom: 6px; margin-bottom: 12rpx;
} }
.tag { .tag {
font-size: 12px; font-size: 24rpx;
color: #4f6ef7; color: #4f6ef7;
border: 1px solid #4f6ef7; border: 2rpx solid #4f6ef7;
border-radius: 999px; border-radius: 999rpx;
padding: 4px 8px; padding: 8rpx 16rpx;
} }
.meta-text { .meta-text {
font-size: 13px; font-size: 26rpx;
color: #333; color: #333;
} }
.truncate { .truncate {
max-width: 160px; max-width: 320rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@ -540,15 +540,15 @@ watch(
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
padding-left: 18px; padding-left: 36rpx;
padding-bottom: 12px; padding-bottom: 24rpx;
} }
.content { .content {
flex: 1; flex: 1;
font-size: 13px; font-size: 26rpx;
color: #666; color: #666;
line-height: 18px; line-height: 36rpx;
margin-right: 10px; margin-right: 20rpx;
} }
.content.clamp { .content.clamp {
display: -webkit-box; display: -webkit-box;
@ -557,81 +557,81 @@ watch(
overflow: hidden; overflow: hidden;
} }
.pen { .pen {
width: 18px; width: 36rpx;
height: 18px; height: 36rpx;
margin-top: 2px; margin-top: 4rpx;
} }
.line { .line {
position: absolute; position: absolute;
left: 18px; left: 36rpx;
top: 34px; top: 68rpx;
bottom: 0; bottom: 0;
width: 2px; width: 4rpx;
background: #4f6ef7; background: #4f6ef7;
opacity: 0.6; opacity: 0.6;
} }
.empty { .empty {
padding: 120px 0; padding: 240rpx 0;
text-align: center; text-align: center;
color: #9aa0a6; color: #9aa0a6;
font-size: 13px; font-size: 26rpx;
} }
.fab { .fab {
position: fixed; position: fixed;
right: 16px; right: 32rpx;
width: 52px; width: 104rpx;
height: 52px; height: 104rpx;
border-radius: 26px; border-radius: 52rpx;
background: #4f6ef7; background: #4f6ef7;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 10px 18px rgba(79, 110, 247, 0.35); box-shadow: 0 20rpx 36rpx rgba(79, 110, 247, 0.35);
z-index: 20; z-index: 20;
} }
.popup { .popup {
background: #fff; background: #fff;
border-top-left-radius: 10px; border-top-left-radius: 20rpx;
border-top-right-radius: 10px; border-top-right-radius: 20rpx;
overflow: hidden; overflow: hidden;
} }
.popup-title { .popup-title {
position: relative; position: relative;
padding: 14px; padding: 28rpx;
border-bottom: 1px solid #f0f0f0; border-bottom: 2rpx solid #f0f0f0;
} }
.popup-title-text { .popup-title-text {
text-align: center; text-align: center;
font-size: 16px; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
} }
.popup-close { .popup-close {
position: absolute; position: absolute;
right: 12px; right: 24rpx;
top: 0; top: 0;
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.popup-body2 { .popup-body2 {
padding: 14px; padding: 28rpx;
} }
.desc { .desc {
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
line-height: 20px; line-height: 40rpx;
word-break: break-all; word-break: break-all;
margin-bottom: 14px; margin-bottom: 28rpx;
} }
.btn { .btn {
width: 100%; width: 100%;
height: 44px; height: 88rpx;
line-height: 44px; line-height: 88rpx;
border-radius: 6px; border-radius: 12rpx;
font-size: 15px; font-size: 30rpx;
} }
.btn::after { .btn::after {
border: none; border: none;

View File

@ -1,5 +1,5 @@
<template> <template>
<view class="form-row" title=""> <view class="form-row" @click="handleClick">
<view class="form-row__label"> <view class="form-row__label">
{{ name }}<text v-if="required" class="form-cell--required"></text> {{ name }}<text v-if="required" class="form-cell--required"></text>
</view> </view>
@ -10,6 +10,8 @@
</template> </template>
<script setup> <script setup>
const emit = defineEmits(['click'])
defineProps({ defineProps({
name: { name: {
default: '' default: ''
@ -22,6 +24,10 @@ defineProps({
default: '' default: ''
} }
}) })
function handleClick(e) {
emit('click', e)
}
</script> </script>
<style> <style>
@import url(./cell-style.css); @import url(./cell-style.css);

View File

@ -64,34 +64,34 @@ function open() {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 12px 14px; padding: 24rpx 28rpx;
border-bottom: 1px solid #eee; border-bottom: 2rpx solid #eee;
} }
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 6px; gap: 12rpx;
} }
.label { .label {
font-size: 14px; font-size: 28rpx;
color: #111827; color: #111827;
font-weight: 700; font-weight: 700;
} }
.required { .required {
color: #ff4d4f; color: #ff4d4f;
font-size: 14px; font-size: 28rpx;
} }
.right { .right {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 16rpx;
min-width: 120px; min-width: 240rpx;
justify-content: flex-end; justify-content: flex-end;
} }
.value { .value {
font-size: 14px; font-size: 28rpx;
color: #111827; color: #111827;
max-width: 220px; max-width: 440rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@ -100,4 +100,3 @@ function open() {
color: #9aa0a6; color: #9aa0a6;
} }
</style> </style>

View File

@ -101,8 +101,8 @@ function remove(idx) {
<style scoped> <style scoped>
.wrap { .wrap {
padding: 12px 14px; padding: 24rpx 28rpx;
border-bottom: 1px solid #eee; border-bottom: 2rpx solid #eee;
} }
.head { .head {
display: flex; display: flex;
@ -112,31 +112,31 @@ function remove(idx) {
.head-left { .head-left {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 6px; gap: 12rpx;
} }
.label { .label {
font-size: 14px; font-size: 28rpx;
font-weight: 700; font-weight: 700;
color: #111827; color: #111827;
} }
.required { .required {
color: #ff4d4f; color: #ff4d4f;
font-size: 14px; font-size: 28rpx;
} }
.list { .list {
margin-top: 10px; margin-top: 20rpx;
} }
.item { .item {
padding: 10px 0; padding: 20rpx 0;
} }
.item-title { .item-title {
font-size: 14px; font-size: 28rpx;
color: #111827; color: #111827;
font-weight: 600; font-weight: 600;
} }
.item-sub { .item-sub {
margin-top: 6px; margin-top: 12rpx;
font-size: 13px; font-size: 26rpx;
color: #6b7280; color: #6b7280;
white-space: pre-wrap; white-space: pre-wrap;
} }
@ -146,11 +146,11 @@ function remove(idx) {
align-items: stretch; align-items: stretch;
} }
.action { .action {
width: 70px; width: 140rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 13px; font-size: 26rpx;
color: #fff; color: #fff;
} }
.action.edit { .action.edit {
@ -160,9 +160,8 @@ function remove(idx) {
background: #ff4d4f; background: #ff4d4f;
} }
.empty { .empty {
margin-top: 10px; margin-top: 20rpx;
font-size: 13px; font-size: 26rpx;
color: #9aa0a6; color: #9aa0a6;
} }
</style> </style>

View File

@ -0,0 +1,100 @@
<template>
<common-cell :name="name" :required="required" @click="open">
<view class="form-content__wrapper">
<view class="flex-main-content truncate" :class="displayText ? '' : 'form__placeholder'">
{{ displayText || placeholder }}
</view>
<view v-if="displayText && !disableChange" class="form-arrow" @click.stop="clear">
<uni-icons type="closeempty" size="18" color="#bbb" />
</view>
<uni-icons class="form-arrow" type="arrowright"></uni-icons>
</view>
</common-cell>
</template>
<script setup>
import { computed, onBeforeUnmount, onMounted } from 'vue';
import commonCell from '../common-cell.vue';
const emits = defineEmits(['change']);
const props = defineProps({
form: { type: Object, default: () => ({}) },
name: { default: '' },
required: { type: Boolean, default: false },
title: { default: '' },
range: { type: Array, default: () => [] },
disableChange: { type: Boolean, default: false },
});
const placeholder = computed(() => `请选择${props.name || ''}`);
const value = computed(() => {
const v = props.form?.[props.title];
return Array.isArray(v) ? v.map(String).filter(Boolean) : [];
});
const valueToLabel = computed(() => {
const map = new Map();
const r = Array.isArray(props.range) ? props.range : [];
r.forEach((i) => {
if (typeof i === 'string') map.set(String(i), String(i));
else if (i && typeof i === 'object') {
const val = i.value ?? i.id ?? i.key ?? i.label ?? i.name ?? '';
const label = i.label ?? i.name ?? i.text ?? String(val);
if (val) map.set(String(val), String(label || val));
}
});
return map;
});
const displayText = computed(() => {
if (!value.value.length) return '';
const labels = value.value.map((id) => valueToLabel.value.get(id) || id);
return labels.join('、');
});
const eventName = `select_tag_${Date.now()}_${Math.random().toString(16).slice(2)}`;
function open() {
if (props.disableChange) return;
console.log('[debug][wxapp][tagPicker] open click');
uni.setStorageSync('ykt_tag_list_selections', value.value);
const url = `/pages/library/tag-list/tag-list?eventName=${eventName}`;
uni.navigateTo({
url,
fail: (e) => {
console.error('[debug][wxapp][tagPicker] navigateTo fail:', url, e);
const msg = e && typeof e === 'object' && e.errMsg ? e.errMsg : '跳转失败';
uni.showToast({ title: msg, icon: 'none' });
},
});
}
function clear() {
emits('change', { title: props.title, value: [] });
}
onMounted(() => {
console.log('[debug][wxapp][tagPicker] mounted:', props.title);
uni.$on(eventName, (data) => {
const next = Array.isArray(data) ? data.map(String).filter(Boolean) : [];
emits('change', { title: props.title, value: next });
});
});
onBeforeUnmount(() => {
uni.$off(eventName);
});
</script>
<style lang="scss" scoped>
@import '../cell-style.css';
.form-content__wrapper {
line-height: 42rpx;
}
.flex-main-content {
line-height: 42rpx;
}
</style>

View File

@ -13,6 +13,7 @@
:disableChange="disableChange" :disableChange="disableChange"
@change="change" @change="change"
/> />
<form-input v-else-if="attrs.type === 'hisCardNo' || attrs.title === 'hisCardNo'" v-bind="attrs" :form="form" :disableChange="disableChange" @change="change" />
<form-surgical-history <form-surgical-history
v-else-if="attrs.title === 'surgicalHistory'" v-else-if="attrs.title === 'surgicalHistory'"
v-bind="attrs" v-bind="attrs"
@ -37,11 +38,36 @@
:disableChange="disableChange" :disableChange="disableChange"
@change="change" @change="change"
/> />
<form-tag-picker
v-else-if="attrs.type === 'tagPicker'"
v-bind="attrs"
:form="form"
:disableChange="disableChange"
@change="change"
/>
<form-run-time v-else-if="attrs.type === 'runTime'" v-bind="attrs" :form="form" :disableChange="disableChange" @change="change" /> <form-run-time v-else-if="attrs.type === 'runTime'" v-bind="attrs" :form="form" :disableChange="disableChange" @change="change" />
<form-files v-else-if="attrs.type === 'files'" v-bind="attrs" :form="form" :disableChange="disableChange" @change="change" /> <form-files v-else-if="attrs.type === 'files'" v-bind="attrs" :form="form" :disableChange="disableChange" @change="change" />
<view v-else-if="attrs.type || attrs.name || attrs.title" class="py-20rpx px-30rpx border-bottom text-28rpx text-gray-500"> <form-select
{{ attrs.name || attrs.title }}暂不支持{{ attrs.type }} v-else-if="Array.isArray(attrs.range) && attrs.range.length"
</view> v-bind="attrs"
:form="form"
:disableChange="disableChange"
@change="change"
/>
<form-textarea
v-else-if="String(attrs.type || '').toLowerCase().includes('textarea')"
v-bind="attrs"
:form="form"
:disableChange="disableChange"
@change="change"
/>
<form-input
v-else-if="attrs.type || attrs.name || attrs.title"
v-bind="attrs"
:form="form"
:disableChange="disableChange"
@change="change"
/>
<!-- <!--
<form-operation v-else-if="attrs.title === 'surgicalHistory'" v-bind="attrs" :form="form" @change="change" <form-operation v-else-if="attrs.title === 'surgicalHistory'" v-bind="attrs" :form="form" @change="change"
@ -70,6 +96,7 @@ import formSelectImage from './form-select-image.vue';
import formSurgicalHistory from './form-surgical-history.vue'; import formSurgicalHistory from './form-surgical-history.vue';
import formPositiveFind from './form-positive-find.vue'; import formPositiveFind from './form-positive-find.vue';
import formDiagnosisPicker from './form-diagnosis-picker.vue'; import formDiagnosisPicker from './form-diagnosis-picker.vue';
import formTagPicker from './form-tag-picker.vue';
defineProps({ defineProps({
form: { form: {

View File

@ -1,11 +1,12 @@
<template> <template>
<template v-for="item in formItems" :key="item.title"> <template v-for="item in formItems" :key="item.title">
<form-cell v-bind="item" :form="form" :disableChange="disabledMap[item.title]" @change="change" /> <form-cell v-bind="item" :form="formModel" :disableChange="disabledMap[item.title]" @change="change" />
</template> </template>
</template> </template>
<script setup> <script setup>
import { computed, provide, ref } from 'vue'; import { computed, provide, ref } from 'vue';
import verifyForm from './verify.js'; import verifyForm from './verify.js';
import { createAliasedForm } from '@/utils/form-alias';
import FormCell from './form-cell/index.vue'; import FormCell from './form-cell/index.vue';
@ -54,6 +55,8 @@ const formItems = computed(() => {
.map((i) => ({ ...i })); .map((i) => ({ ...i }));
}) })
const formModel = computed(() => createAliasedForm(props.form, props.items));
const rules = computed(() => ({ ...customRule.value, ...props.rule })); const rules = computed(() => ({ ...customRule.value, ...props.rule }));
function addRule(arg1, arg2) { function addRule(arg1, arg2) {
@ -78,7 +81,7 @@ function change(data) {
function verify() { function verify() {
const visible = formItems.value.filter((i) => i && !i.hidden); const visible = formItems.value.filter((i) => i && !i.hidden);
return verifyForm(visible, rules.value, props.form) return verifyForm(visible, rules.value, formModel.value)
} }
defineExpose({ verify }) defineExpose({ verify })

View File

@ -12,6 +12,7 @@ const FormRule = {
selectAndOther: checkInput, selectAndOther: checkInput,
selectAndImage: checkListItem, selectAndImage: checkListItem,
multiSelectAndOther: checkMultiList, multiSelectAndOther: checkMultiList,
tagPicker: checkMultiList,
files: checkFiles, files: checkFiles,
runTime: checkInput, runTime: checkInput,
} }

View File

@ -169,6 +169,12 @@
"navigationBarTitleText": "诊断" "navigationBarTitleText": "诊断"
} }
}, },
{
"path": "pages/library/tag-list/tag-list",
"style": {
"navigationBarTitleText": "标签"
}
},
{ {
"path": "pages/others/edit-positive-find", "path": "pages/others/edit-positive-find",
"style": { "style": {

View File

@ -249,11 +249,7 @@ function switchTab(key) {
currentTab.value = key; currentTab.value = key;
// tab tab // tab tab
nextTick(() => { nextTick(() => {
// tabs uni.pageScrollTo({ scrollTop: tabsScrollTop.value || 0, duration: 300 });
measureTabsTop();
setTimeout(() => {
uni.pageScrollTo({ scrollTop: tabsScrollTop.value || 0, duration: 0 });
}, 0);
}); });
} }
@ -303,6 +299,9 @@ function normalizeArchiveFromApi(raw) {
outpatientNo: r.outpatientNo || '', outpatientNo: r.outpatientNo || '',
inpatientNo: r.inpatientNo || '', inpatientNo: r.inpatientNo || '',
medicalRecordNo: r.medicalRecordNo || '', medicalRecordNo: r.medicalRecordNo || '',
customerNumber: r.customerNumber || '',
customerProfileNo2: r.customerProfileNo2 || '',
customerProfileNo3: r.customerProfileNo3 || '',
createTime: r.createTime || '', createTime: r.createTime || '',
creator: r.creator || '', creator: r.creator || '',
notes: r.notes || r.remark || '', notes: r.notes || r.remark || '',
@ -548,9 +547,9 @@ const sexOrAge = computed(() => {
const idRows = computed(() => { const idRows = computed(() => {
const rows = []; const rows = [];
if (archive.value.outpatientNo) rows.push({ label: '门诊号', value: String(archive.value.outpatientNo) }); if (archive.value.customerNumber) rows.push({ label: '病案号1', value: String(archive.value.customerNumber) });
if (archive.value.inpatientNo) rows.push({ label: '住院号', value: String(archive.value.inpatientNo) }); if (archive.value.customerProfileNo2) rows.push({ label: '病案号2', value: String(archive.value.customerProfileNo2) });
if (archive.value.medicalRecordNo) rows.push({ label: '病案号', value: String(archive.value.medicalRecordNo) }); if (archive.value.customerProfileNo3) rows.push({ label: '病案号3', value: String(archive.value.customerProfileNo3) });
return rows; return rows;
}); });
@ -762,7 +761,7 @@ const saveAddGroup = async () => {
.page { .page {
min-height: 100vh; min-height: 100vh;
background: #f5f6f8; background: #f5f6f8;
padding-bottom: calc(80px + env(safe-area-inset-bottom)); padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
} }
.card { .card {
@ -772,69 +771,69 @@ const saveAddGroup = async () => {
.header { .header {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
padding: 14px 14px 10px; padding: 28rpx 28rpx 20rpx;
border-bottom: 1px solid #f2f2f2; border-bottom: 2rpx solid #f2f2f2;
} }
.avatar { .avatar {
width: 56px; width: 112rpx;
height: 56px; height: 112rpx;
border-radius: 6px; border-radius: 12rpx;
border: 1px solid #e8e8e8; border: 2rpx solid #e8e8e8;
background: #fafafa; background: #fafafa;
overflow: hidden; overflow: hidden;
flex-shrink: 0; flex-shrink: 0;
} }
.avatar-img { .avatar-img {
width: 56px; width: 112rpx;
height: 56px; height: 112rpx;
} }
.header-main { .header-main {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
padding: 0 10px; padding: 0 20rpx;
} }
.name-row { .name-row {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 16rpx;
padding-top: 2px; padding-top: 4rpx;
} }
.name { .name {
font-size: 18px; font-size: 36rpx;
font-weight: 600; font-weight: 600;
color: #1f1f1f; color: #1f1f1f;
max-width: 220px; max-width: 440rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.meta { .meta {
font-size: 13px; font-size: 26rpx;
color: #666; color: #666;
} }
.sub-line { .sub-line {
margin-top: 6px; margin-top: 12rpx;
font-size: 12px; font-size: 24rpx;
color: #666; color: #666;
} }
.id-rows { .id-rows {
margin-top: 6px; margin-top: 12rpx;
} }
.id-row { .id-row {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 12px; font-size: 24rpx;
color: #666; color: #666;
line-height: 18px; line-height: 36rpx;
} }
.id-label { .id-label {
@ -849,58 +848,58 @@ const saveAddGroup = async () => {
} }
.create-row { .create-row {
margin-top: 6px; margin-top: 12rpx;
} }
.create-text { .create-text {
font-size: 12px; font-size: 24rpx;
color: #999; color: #999;
} }
.header-right { .header-right {
width: 28px; width: 56rpx;
height: 28px; height: 56rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-shrink: 0; flex-shrink: 0;
margin-top: 6px; margin-top: 12rpx;
} }
.cells { .cells {
background: #fff; background: #fff;
padding: 0 14px; padding: 0 28rpx;
} }
.border-bottom { .border-bottom {
border-bottom: 1px solid #f2f2f2; border-bottom: 2rpx solid #f2f2f2;
} }
.info-row { .info-row {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 16px 0; padding: 32rpx 0;
min-height: 24px; min-height: 48rpx;
} }
.info-block { .info-block {
padding: 16px 0; padding: 32rpx 0;
} }
.block-header { .block-header {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-bottom: 8px; margin-bottom: 16rpx;
} }
.block-content { .block-content {
min-height: 20px; min-height: 40rpx;
} }
.input-label { .input-label {
font-size: 15px; font-size: 30rpx;
color: #666; color: #666;
} }
@ -912,15 +911,15 @@ const saveAddGroup = async () => {
.phone-area { .phone-area {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 12px; margin-right: 24rpx;
} }
.mr-4 { .mr-4 {
margin-right: 4px; margin-right: 8rpx;
} }
.phone-text { .phone-text {
font-size: 16px; font-size: 32rpx;
color: #4f6ef7; color: #4f6ef7;
font-weight: 500; font-weight: 500;
} }
@ -929,17 +928,17 @@ const saveAddGroup = async () => {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 24px; width: 48rpx;
height: 24px; height: 48rpx;
} }
.placeholder { .placeholder {
font-size: 14px; font-size: 28rpx;
color: #999; color: #999;
} }
.note-content { .note-content {
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
line-height: 1.5; line-height: 1.5;
word-break: break-all; word-break: break-all;
@ -948,16 +947,16 @@ const saveAddGroup = async () => {
.tags-wrap { .tags-wrap {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px; gap: 16rpx;
} }
.tag-item { .tag-item {
height: 24px; height: 48rpx;
line-height: 22px; line-height: 44rpx;
padding: 0 10px; padding: 0 20rpx;
border: 1px solid #4f6ef7; border: 2rpx solid #4f6ef7;
border-radius: 12px; border-radius: 24rpx;
font-size: 12px; font-size: 24rpx;
color: #4f6ef7; color: #4f6ef7;
box-sizing: border-box; box-sizing: border-box;
} }
@ -968,11 +967,11 @@ const saveAddGroup = async () => {
} }
.tabs { .tabs {
margin-top: 10px; margin-top: 20rpx;
background: #fff; background: #fff;
display: flex; display: flex;
border-top: 1px solid #f2f2f2; border-top: 2rpx solid #f2f2f2;
border-bottom: 1px solid #f2f2f2; border-bottom: 2rpx solid #f2f2f2;
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 30; z-index: 30;
@ -981,9 +980,9 @@ const saveAddGroup = async () => {
.tab { .tab {
flex: 1; flex: 1;
text-align: center; text-align: center;
height: 44px; height: 88rpx;
line-height: 44px; line-height: 88rpx;
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
position: relative; position: relative;
} }
@ -998,11 +997,11 @@ const saveAddGroup = async () => {
position: absolute; position: absolute;
left: 50%; left: 50%;
bottom: 0; bottom: 0;
width: 32px; width: 64rpx;
height: 3px; height: 6rpx;
background: #4f6ef7; background: #4f6ef7;
transform: translateX(-50%); transform: translateX(-50%);
border-radius: 2px; border-radius: 4rpx;
} }
.content { .content {
@ -1017,14 +1016,14 @@ const saveAddGroup = async () => {
} }
.empty-img { .empty-img {
width: 160px; width: 320rpx;
height: 160px; height: 320rpx;
opacity: 0.9; opacity: 0.9;
} }
.empty-text { .empty-text {
margin-top: 10px; margin-top: 20rpx;
font-size: 13px; font-size: 26rpx;
color: #9aa0a6; color: #9aa0a6;
} }
@ -1034,21 +1033,21 @@ const saveAddGroup = async () => {
right: 0; right: 0;
bottom: 0; bottom: 0;
background: #fff; background: #fff;
padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); padding: 24rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
} }
.bind-btn { .bind-btn {
width: 100%; width: 100%;
height: 44px; height: 88rpx;
background: #4f6ef7; background: #4f6ef7;
color: #fff; color: #fff;
border-radius: 6px; border-radius: 12rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 8px; gap: 16rpx;
font-size: 15px; font-size: 30rpx;
} }
.bind-text { .bind-text {
@ -1057,52 +1056,52 @@ const saveAddGroup = async () => {
/* ===== 弹窗样式(居中) ===== */ /* ===== 弹窗样式(居中) ===== */
.modal { .modal {
width: 320px; width: 640rpx;
background: #fff; background: #fff;
border-radius: 8px; border-radius: 16rpx;
overflow: hidden; overflow: hidden;
} }
.modal-title { .modal-title {
font-size: 16px; font-size: 32rpx;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
padding: 14px 12px; padding: 28rpx 24rpx;
color: #333; color: #333;
border-bottom: 1px solid #f0f0f0; border-bottom: 2rpx solid #f0f0f0;
} }
.modal-body { .modal-body {
padding: 14px 14px 8px; padding: 28rpx 28rpx 16rpx;
} }
.modal-input { .modal-input {
width: 100%; width: 100%;
height: 40px; height: 80rpx;
border: 1px solid #e6e6e6; border: 2rpx solid #e6e6e6;
border-radius: 4px; border-radius: 8rpx;
padding: 0 10px; padding: 0 20rpx;
font-size: 14px; font-size: 28rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.modal-actions { .modal-actions {
display: flex; display: flex;
gap: 12px; gap: 24rpx;
padding: 12px 14px 14px; padding: 24rpx 28rpx 28rpx;
} }
.modal-btn { .modal-btn {
flex: 1; flex: 1;
height: 40px; height: 80rpx;
line-height: 40px; line-height: 80rpx;
text-align: center; text-align: center;
border-radius: 4px; border-radius: 8rpx;
font-size: 14px; font-size: 28rpx;
} }
.modal-btn.cancel { .modal-btn.cancel {
border: 1px solid #4f6ef7; border: 2rpx solid #4f6ef7;
color: #4f6ef7; color: #4f6ef7;
background: #fff; background: #fff;
} }
@ -1115,69 +1114,69 @@ const saveAddGroup = async () => {
/* ===== 底部弹层样式 ===== */ /* ===== 底部弹层样式 ===== */
.sheet { .sheet {
background: #fff; background: #fff;
border-top-left-radius: 10px; border-top-left-radius: 20rpx;
border-top-right-radius: 10px; border-top-right-radius: 20rpx;
overflow: hidden; overflow: hidden;
} }
.sheet-header { .sheet-header {
height: 48px; height: 96rpx;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 14px; padding: 0 28rpx;
border-bottom: 1px solid #f0f0f0; border-bottom: 2rpx solid #f0f0f0;
} }
.sheet-title { .sheet-title {
flex: 1; flex: 1;
text-align: center; text-align: center;
font-size: 16px; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
} }
.sheet-close { .sheet-close {
width: 24px; width: 48rpx;
height: 24px; height: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.sheet-header-left { .sheet-header-left {
width: 24px; width: 48rpx;
} }
.sheet-link { .sheet-link {
min-width: 60px; min-width: 120rpx;
text-align: right; text-align: right;
font-size: 14px; font-size: 28rpx;
color: #4f6ef7; color: #4f6ef7;
} }
.sheet-body { .sheet-body {
padding: 14px; padding: 28rpx;
} }
.notes-textarea { .notes-textarea {
width: 100%; width: 100%;
height: 140px; height: 280rpx;
border: 1px solid #e6e6e6; border: 2rpx solid #e6e6e6;
border-radius: 4px; border-radius: 8rpx;
padding: 10px; padding: 20rpx;
font-size: 14px; font-size: 28rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.counter { .counter {
text-align: right; text-align: right;
margin-top: 8px; margin-top: 16rpx;
font-size: 12px; font-size: 24rpx;
color: #999; color: #999;
} }
.group-list { .group-list {
padding: 8px 14px 14px; padding: 16rpx 28rpx 28rpx;
max-height: 55vh; max-height: 55vh;
overflow: auto; overflow: auto;
} }
@ -1185,26 +1184,26 @@ const saveAddGroup = async () => {
.group-item { .group-item {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 12px 0; padding: 24rpx 0;
} }
.group-name { .group-name {
margin-left: 10px; margin-left: 20rpx;
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
} }
.sheet-footer { .sheet-footer {
padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); padding: 24rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
} }
.primary-btn { .primary-btn {
width: 100%; width: 100%;
height: 44px; height: 88rpx;
background: #4f6ef7; background: #4f6ef7;
color: #fff; color: #fff;
border-radius: 4px; border-radius: 8rpx;
font-size: 15px; font-size: 30rpx;
line-height: 44px; line-height: 88rpx;
} }
</style> </style>

View File

@ -74,7 +74,7 @@ function normalizeTemplateItem(item) {
const customTypeMap = { const customTypeMap = {
customerSource: 'select', customerSource: 'select',
customerStage: 'select', customerStage: 'select',
tag: 'multiSelectAndOther', tag: 'tagPicker',
reference: 'input', reference: 'input',
selectWwuser: 'select', selectWwuser: 'select',
files: 'files', files: 'files',
@ -121,6 +121,87 @@ function normalizeTemplateItem(item) {
return next; 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 : {};
}
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 = [];
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('标签');
}
function getUserId() { function getUserId() {
const d = doctorInfo.value || {}; const d = doctorInfo.value || {};
const a = account.value || {}; const a = account.value || {};
@ -159,13 +240,17 @@ function loadFromStorage() {
async function loadTemplates() { async function loadTemplates() {
const corpId = getCorpId(); const corpId = getCorpId();
if (!corpId) return; if (!corpId) return;
const [baseRes, internalRes] = await Promise.all([ const [baseRes, internalRes, stageRes, tagRes] = await Promise.all([
api('getCurrentTemplate', { corpId, templateType: 'baseTemplate' }), api('getCurrentTemplate', { corpId, templateType: 'baseTemplate' }),
api('getCurrentTemplate', { corpId, templateType: 'internalTemplate' }), api('getCurrentTemplate', { corpId, templateType: 'internalTemplate' }),
api('getCustomerType', { corpId }),
api('getCorpTags', { corpId }),
]); ]);
const stageOptions = parseCustomerStageOptions(stageRes);
const tagOptions = parseTagOptions(tagRes);
if (baseRes?.success) { if (baseRes?.success) {
const temp = baseRes?.data && typeof baseRes.data === 'object' ? baseRes.data : baseRes; const temp = unwrapTemplate(baseRes);
const list = Array.isArray(temp.templateList) ? temp.templateList : []; const list = Array.isArray(temp.templateList) ? temp.templateList : [];
baseItems.value = list baseItems.value = list
.filter((i) => i && i.fieldStatus !== 'disable') .filter((i) => i && i.fieldStatus !== 'disable')
@ -174,8 +259,14 @@ async function loadTemplates() {
} }
if (internalRes?.success) { if (internalRes?.success) {
const temp = internalRes?.data && typeof internalRes.data === 'object' ? internalRes.data : internalRes; const temp = unwrapTemplate(internalRes);
const list = Array.isArray(temp.templateList) ? temp.templateList : []; const list = (Array.isArray(temp.templateList) ? temp.templateList : []).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;
});
internalItems.value = list internalItems.value = list
.filter((i) => i && i.fieldStatus !== 'disable') .filter((i) => i && i.fieldStatus !== 'disable')
.filter((i) => i.operateType !== 'onlyRead') .filter((i) => i.operateType !== 'onlyRead')

View File

@ -4,7 +4,7 @@
<view class="header"> <view class="header">
<view class="team-selector" @click="toggleTeamPopup"> <view class="team-selector" @click="toggleTeamPopup">
<text class="team-name">{{ teamDisplay }}</text> <text class="team-name">{{ teamDisplay }}</text>
<uni-icons type="loop" size="18" color="#333" class="team-icon"></uni-icons> <text class="team-icon"></text>
</view> </view>
<view class="header-actions"> <view class="header-actions">
<view class="action-item" @click="goToSearch"> <view class="action-item" @click="goToSearch">
@ -85,11 +85,11 @@
<view class="card-row-bottom"> <view class="card-row-bottom">
<template v-if="currentTabKey === 'new'"> <!-- New Patient Tab --> <template v-if="currentTabKey === 'new'"> <!-- New Patient Tab -->
<text class="record-text"> <text class="record-text">
{{ patient.createTime || '-' }} / {{ patient.creator || '-' }} {{ patient.createTime || '-' }} / {{ resolveCreatorName(patient) || '-' }}
</text> </text>
</template> </template>
<template v-else> <template v-else>
<text v-if="patient.record" class="record-text"> <text v-if="patient.record" class="record-text record-ellipsis">
{{ patient.record.type }} / {{ patient.record.date }} / {{ patient.record.diagnosis }} {{ patient.record.type }} / {{ patient.record.date }} / {{ patient.record.diagnosis }}
</text> </text>
<text v-else class="no-record">暂无病历记录</text> <text v-else class="no-record">暂无病历记录</text>
@ -99,7 +99,7 @@
</view> </view>
</view> </view>
<!-- Bottom padding for tabbar --> <!-- Bottom padding for tabbar -->
<view style="height: 100px;"></view> <!-- Increased padding --> <view style="height: 200rpx;"></view> <!-- Increased padding -->
</scroll-view> </scroll-view>
<!-- Sidebar Index --> <!-- Sidebar Index -->
@ -163,11 +163,15 @@ const tabs = computed(() => {
const isBatchMode = ref(false); const isBatchMode = ref(false);
const selectedItems = ref([]); // Stores patient phone or unique ID const selectedItems = ref([]); // Stores patient phone or unique ID
// // Team Members Map
const userNameMap = ref({});
//
const managedArchiveCountAllTeams = ref(0); // const managedArchiveCountAllTeams = ref(0); //
const isVerified = ref(true); // const verifyStatus = ref(''); // unverified | verifying | verified | failed
const isVerified = ref(false); //
const hasVerifyFailedHistory = ref(false); // const hasVerifyFailedHistory = ref(false); //
const verifyFailedReason = ref('资料不完整,请补充营业执照/资质证明后重新提交。'); const verifyFailedReason = ref('');
const DETAIL_STORAGE_KEY = 'ykt_case_archive_detail'; const DETAIL_STORAGE_KEY = 'ykt_case_archive_detail';
const CURRENT_TEAM_STORAGE_KEY = 'ykt_case_current_team'; const CURRENT_TEAM_STORAGE_KEY = 'ykt_case_current_team';
@ -220,6 +224,58 @@ function getTeamId() {
return String(currentTeam.value?.teamId || '') || ''; 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) { function sortGroupList(list) {
const { orderList, corpList, restList } = (Array.isArray(list) ? list : []).reduce( const { orderList, corpList, restList } = (Array.isArray(list) ? list : []).reduce(
(p, c) => { (p, c) => {
@ -299,10 +355,32 @@ function formatPatient(raw) {
const createTime = parseCreateTime(raw?.createTime); const createTime = parseCreateTime(raw?.createTime);
const createTimeStr = createTime ? createTime.format('YYYY-MM-DD HH:mm') : ''; const createTimeStr = createTime ? createTime.format('YYYY-MM-DD HH:mm') : '';
const rawTags = asArray(raw?.tags).filter((i) => typeof i === 'string'); // 使 tagNames
const rawTagNames = asArray(raw?.tagNames).filter((i) => typeof i === 'string'); 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); 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 { return {
...raw, ...raw,
@ -310,13 +388,13 @@ function formatPatient(raw) {
name: String(name || ''), name: String(name || ''),
gender: String(sex || ''), gender: String(sex || ''),
age, age,
tags: rawTags.length ? rawTags : (rawTagNames.length ? rawTagNames : tagIds), tags: displayTags,
mobiles, mobiles,
mobile, mobile,
createTime: createTimeStr, createTime: createTimeStr,
creator: raw?.creatorName || raw?.creator || '', creator: raw?.creatorName || raw?.creator || '',
hospitalId: raw?.customerNumber || raw?.hospitalId || '', hospitalId: raw?.customerNumber || raw?.hospitalId || '',
record: null, record,
createdByDoctor: raw?.addMethod ? String(raw.addMethod) === 'manual' : Boolean(raw?.createdByDoctor), createdByDoctor: raw?.addMethod ? String(raw.addMethod) === 'manual' : Boolean(raw?.createdByDoctor),
hasBindWechat: Boolean(raw?.externalUserId || raw?.unionid || raw?.hasBindWechat), hasBindWechat: Boolean(raw?.externalUserId || raw?.unionid || raw?.hasBindWechat),
}; };
@ -395,7 +473,8 @@ async function reload(reset = true) {
userId, userId,
teamId, teamId,
page: page.value, page: page.value,
pageSize: pageSize.value, pageSize: 1000, //
sortByFirstLetter: true, //
}; };
if (currentTab.value.kind === 'group' && currentTab.value.groupId) { if (currentTab.value.kind === 'group' && currentTab.value.groupId) {
@ -408,7 +487,7 @@ async function reload(reset = true) {
} }
loading.value = true; loading.value = true;
const res = await api('searchCorpCustomerWithFollowTime', query); const res = await api('searchCorpCustomerForCaseList', query);
loading.value = false; loading.value = false;
if (!res?.success) { if (!res?.success) {
@ -523,6 +602,7 @@ const toggleTeamPopup = () => {
if (currentTeam.value) uni.setStorageSync(CURRENT_TEAM_STORAGE_KEY, currentTeam.value); if (currentTeam.value) uni.setStorageSync(CURRENT_TEAM_STORAGE_KEY, currentTeam.value);
currentTabKey.value = 'all'; currentTabKey.value = 'all';
loadGroups(); loadGroups();
loadTeamMembers();
reload(true); reload(true);
} }
}); });
@ -574,6 +654,10 @@ const handleCreate = () => {
// + 10 // + 10
if (!isVerified.value && managedArchiveCountAllTeams.value >= 10) { if (!isVerified.value && managedArchiveCountAllTeams.value >= 10) {
if (verifyStatus.value === 'verifying') {
toast('信息认证中,请耐心等待!');
return;
}
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '当前管理档案数已达上限 10 个,完成认证即可升级至 100 个。', content: '当前管理档案数已达上限 10 个,完成认证即可升级至 100 个。',
@ -603,6 +687,10 @@ const handleCreate = () => {
// //
const startVerifyFlow = () => { const startVerifyFlow = () => {
if (verifyStatus.value === 'verifying') {
toast('信息认证中,请耐心等待!');
return;
}
// -> & // -> &
if (hasVerifyFailedHistory.value) { if (hasVerifyFailedHistory.value) {
uni.showModal({ uni.showModal({
@ -625,7 +713,7 @@ const startVerifyFlow = () => {
// ===== / ===== // ===== / =====
const openVerifyEntry = () => { const openVerifyEntry = () => {
uni.showToast({ title: '认证功能待接入', icon: 'none' }); uni.navigateTo({ url: '/pages/work/profile?type=cert' });
}; };
const openAddCustomerServiceEntry = () => { const openAddCustomerServiceEntry = () => {
@ -715,8 +803,10 @@ onLoad(async () => {
await loadTeams(); await loadTeams();
if (currentTeam.value) { if (currentTeam.value) {
await loadGroups(); await loadGroups();
loadTeamMembers();
await reload(true); await reload(true);
} }
await refreshVerifyStatus();
}); });
onShow(async () => { onShow(async () => {
@ -737,6 +827,8 @@ onShow(async () => {
} else { } else {
await loadGroups(); await loadGroups();
} }
loadTeamMembers();
await refreshVerifyStatus();
}); });
</script> </script>
@ -751,7 +843,7 @@ onShow(async () => {
// Padding for batch footer // Padding for batch footer
/* &.is-batch { /* &.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 // 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 // Instead we handle it in content-body or separate view
@ -761,25 +853,30 @@ onShow(async () => {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 10px 15px; padding: 20rpx 30rpx;
background-color: #fff; background-color: #fff;
border-bottom: 1px solid #f0f0f0; border-bottom: 2rpx solid #f0f0f0;
.team-selector { .team-selector {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 18px; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
.team-name { .team-name {
margin-right: 5px; margin-right: 10rpx;
}
.team-icon {
font-size: 32rpx;
color: #333;
} }
} }
.header-actions { .header-actions {
display: flex; display: flex;
gap: 15px; gap: 30rpx;
.action-item { .action-item {
display: flex; display: flex;
@ -788,9 +885,9 @@ onShow(async () => {
justify-content: center; justify-content: center;
.action-text { .action-text {
font-size: 10px; font-size: 20rpx;
color: #333; color: #333;
margin-top: 2px; margin-top: 4rpx;
} }
} }
} }
@ -800,8 +897,8 @@ onShow(async () => {
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #f5f7fa; background-color: #f5f7fa;
border-bottom: 1px solid #eee; border-bottom: 2rpx solid #eee;
padding-right: 15px; // Padding for the count padding-right: 30rpx; // Padding for the count
.tabs-scroll { .tabs-scroll {
flex: 1; flex: 1;
@ -810,15 +907,15 @@ onShow(async () => {
.tabs-container { .tabs-container {
display: flex; display: flex;
padding: 10px 15px; padding: 20rpx 30rpx;
.tab-item { .tab-item {
padding: 5px 15px; padding: 10rpx 30rpx;
margin-right: 10px; margin-right: 20rpx;
font-size: 14px; font-size: 28rpx;
color: #666; color: #666;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 8rpx;
flex-shrink: 0; flex-shrink: 0;
&.active { &.active {
@ -831,11 +928,11 @@ onShow(async () => {
} }
.total-count-inline { .total-count-inline {
font-size: 12px; font-size: 24rpx;
color: #666; color: #666;
white-space: nowrap; white-space: nowrap;
flex-shrink: 0; flex-shrink: 0;
min-width: 50px; min-width: 100rpx;
text-align: right; text-align: right;
} }
} }
@ -854,22 +951,22 @@ onShow(async () => {
} }
.group-title { .group-title {
padding: 5px 15px; padding: 10rpx 30rpx;
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
} }
.patient-card { .patient-card {
display: flex; display: flex;
background-color: #fff; background-color: #fff;
padding: 15px; padding: 30rpx;
margin-bottom: 1px; // Separator line margin-bottom: 2rpx; // Separator line
border-bottom: 1px solid #f0f0f0; border-bottom: 2rpx solid #f0f0f0;
.checkbox-area { .checkbox-area {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 10px; margin-right: 20rpx;
} }
.card-content { .card-content {
@ -879,51 +976,59 @@ onShow(async () => {
.card-row-top { .card-row-top {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 8px; margin-bottom: 16rpx;
flex-wrap: wrap; flex-wrap: wrap;
.patient-info { .patient-info {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
margin-right: 10px; margin-right: 20rpx;
.patient-name { .patient-name {
font-size: 18px; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
margin-right: 8px; margin-right: 16rpx;
} }
.patient-meta { .patient-meta {
font-size: 12px; font-size: 24rpx;
color: #999; color: #999;
margin-bottom: 2px; margin-bottom: 4rpx;
} }
} }
.patient-tags { .patient-tags {
display: flex; display: flex;
gap: 5px; gap: 10rpx;
.tag { .tag {
font-size: 10px; font-size: 20rpx;
color: #5d8aff; color: #5d8aff;
border: 1px solid #5d8aff; border: 2rpx solid #5d8aff;
padding: 0 4px; padding: 0 8rpx;
border-radius: 8px; border-radius: 16rpx;
height: 16px; height: 32rpx;
line-height: 14px; line-height: 28rpx;
} }
} }
} }
.card-row-bottom { .card-row-bottom {
font-size: 14px; font-size: 28rpx;
.record-text { .record-text {
color: #666; color: #666;
} }
.record-ellipsis {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}
.no-record { .no-record {
color: #bdc3c7; color: #bdc3c7;
} }
@ -935,39 +1040,39 @@ onShow(async () => {
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
height: 50px; height: 100rpx;
background-color: #fff; background-color: #fff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 15px; padding: 0 30rpx;
box-shadow: 0 -2px 10px rgba(0,0,0,0.05); box-shadow: 0 -4rpx 20rpx rgba(0,0,0,0.05);
z-index: 99; z-index: 99;
.left-action { .left-action {
display: flex; display: flex;
align-items: center; align-items: center;
.footer-text { .footer-text {
margin-left: 5px; margin-left: 10rpx;
font-size: 14px; font-size: 28rpx;
color: #333; color: #333;
} }
} }
.right-actions { .right-actions {
display: flex; display: flex;
gap: 10px; gap: 20rpx;
.footer-btn { .footer-btn {
font-size: 14px; font-size: 28rpx;
padding: 0 15px; padding: 0 30rpx;
height: 32px; height: 64rpx;
line-height: 32px; line-height: 64rpx;
margin: 0; margin: 0;
border-radius: 4px; border-radius: 8rpx;
&.plain { &.plain {
border: 1px solid #ddd; border: 2rpx solid #ddd;
background-color: #fff; background-color: #fff;
color: #666; color: #666;
} }
@ -986,11 +1091,11 @@ onShow(async () => {
} }
.sidebar-index { .sidebar-index {
width: 20px; width: 40rpx;
position: absolute; position: absolute;
right: 0; right: 0;
top: 20px; top: 40rpx;
bottom: 20px; bottom: 40rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -999,10 +1104,10 @@ onShow(async () => {
z-index: 10; z-index: 10;
.index-item { .index-item {
font-size: 10px; font-size: 20rpx;
color: #555; color: #555;
padding: 2px 0; padding: 4rpx 0;
width: 20px; width: 40rpx;
text-align: center; text-align: center;
font-weight: 500; font-weight: 500;
} }

View File

@ -129,6 +129,15 @@ function normalizeTemplateItem(item) {
return next; 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() { async function loadBaseTemplate() {
const corpId = String(account.value?.corpId || doctorInfo.value?.corpId || '') || ''; const corpId = String(account.value?.corpId || doctorInfo.value?.corpId || '') || '';
if (!corpId) return; if (!corpId) return;
@ -142,7 +151,7 @@ async function loadBaseTemplate() {
return; return;
} }
const temp = res?.data && typeof res.data === 'object' ? res.data : res; const temp = unwrapTemplate(res);
const list = Array.isArray(temp.templateList) ? temp.templateList : []; const list = Array.isArray(temp.templateList) ? temp.templateList : [];
baseItems.value = list baseItems.value = list
.filter((i) => i && i.fieldStatus !== 'disable') .filter((i) => i && i.fieldStatus !== 'disable')

View File

@ -95,7 +95,7 @@ function normalizeTemplateItem(item) {
const customTypeMap = { const customTypeMap = {
customerSource: 'select', customerSource: 'select',
customerStage: 'select', customerStage: 'select',
tag: 'multiSelectAndOther', tag: 'tagPicker',
reference: 'input', reference: 'input',
selectWwuser: 'select', selectWwuser: 'select',
files: 'files', files: 'files',
@ -144,12 +144,139 @@ function normalizeTemplateItem(item) {
return next; 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() { async function loadInternalTemplate() {
const corpId = String(account.value?.corpId || doctorInfo.value?.corpId || '') || ''; const corpId = String(account.value?.corpId || doctorInfo.value?.corpId || '') || '';
if (!corpId) return; if (!corpId) return;
loading('加载中...'); 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(); hideLoading();
if (!res?.success) { if (!res?.success) {
@ -157,12 +284,32 @@ async function loadInternalTemplate() {
return; return;
} }
const temp = res?.data && typeof res.data === 'object' ? res.data : res; console.log('[debug][wxapp][patient-inner-info] corpId:', corpId);
const list = Array.isArray(temp.templateList) ? temp.templateList : []; 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 items.value = list
.filter((i) => i && i.fieldStatus !== 'disable') .filter((i) => i && i.fieldStatus !== 'disable')
.filter((i) => i.operateType !== 'onlyRead') .filter((i) => i.operateType !== 'onlyRead')
.map(normalizeTemplateItem); .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 () => { onLoad(async () => {
@ -235,6 +382,7 @@ function buildPayload(base, inner) {
if (payload.gender && !payload.sex) payload.sex = payload.gender; if (payload.gender && !payload.sex) payload.sex = payload.gender;
if (payload.idNo && !payload.idCard) payload.idCard = payload.idNo; if (payload.idNo && !payload.idCard) payload.idCard = payload.idNo;
if (payload.idType && !payload.cardType) payload.cardType = payload.idType; 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 (Array.isArray(payload.teamId)) payload.teamId = payload.teamId[0] || '';
if (payload.customerSource && typeof payload.customerSource === 'string') { if (payload.customerSource && typeof payload.customerSource === 'string') {

View File

@ -98,23 +98,45 @@ function getTeamContext() {
} }
function formatPatient(raw) { function formatPatient(raw) {
const rawTags = asArray(raw?.tags).filter((i) => typeof i === 'string'); // 使 tagNames
const rawTagNames = asArray(raw?.tagNames).filter((i) => typeof i === 'string'); 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); 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 mobiles = asArray(raw?.mobiles).map(String).filter(Boolean);
const mobile = raw?.mobile ? String(raw.mobile) : (mobiles[0] || ''); 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 { return {
...raw, ...raw,
_id: raw?._id || raw?.id || '', _id: raw?._id || raw?.id || '',
name: raw?.name || raw?.customerName || '', name: raw?.name || raw?.customerName || '',
gender: raw?.sex || raw?.gender || '', gender: raw?.sex || raw?.gender || '',
age: raw?.age ?? '', age: raw?.age ?? '',
tags: rawTags.length ? rawTags : (rawTagNames.length ? rawTagNames : tagIds), tags: displayTags,
mobiles, mobiles,
mobile, mobile,
record: null, record,
createTime: raw?.createTime || '', createTime: raw?.createTime || '',
creator: raw?.creatorName || raw?.creator || '', creator: raw?.creatorName || raw?.creator || '',
hospitalId: raw?.customerNumber || raw?.hospitalId || '', hospitalId: raw?.customerNumber || raw?.hospitalId || '',
@ -142,7 +164,7 @@ const doSearch = useDebounce(async () => {
} }
searching.value = true; searching.value = true;
const res = await api('searchCorpCustomerWithFollowTime', { const res = await api('searchCorpCustomerForCaseList', {
corpId, corpId,
userId, userId,
teamId, teamId,
@ -315,6 +337,11 @@ const goDetail = (patient) => {
.record-text { .record-text {
color: #666; color: #666;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
} }
.no-record { .no-record {

View File

@ -28,7 +28,7 @@
</view> </view>
</view> </view>
<view style="height: 120px;"></view> <view style="height: 240rpx;"></view>
</scroll-view> </scroll-view>
<view class="footer"> <view class="footer">
@ -328,7 +328,7 @@ function previewFile(idx) {
.page { .page {
min-height: 100vh; min-height: 100vh;
background: #f5f6f8; background: #f5f6f8;
padding-bottom: calc(76px + env(safe-area-inset-bottom)); padding-bottom: calc(152rpx + env(safe-area-inset-bottom));
} }
.body { .body {
height: 100vh; height: 100vh;
@ -340,24 +340,24 @@ function previewFile(idx) {
} }
.header { .header {
background: #fff; background: #fff;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
} }
.header-title { .header-title {
padding: 14px 14px; padding: 28rpx 28rpx;
font-size: 16px; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
} }
.form-wrap { .form-wrap {
background: #fff; background: #fff;
margin-top: 10px; margin-top: 20rpx;
padding: 4px 0; padding: 8rpx 0;
} }
.upload-wrap { .upload-wrap {
background: #fff; background: #fff;
padding: 24rpx 30rpx; padding: 24rpx 30rpx;
border-bottom: 1px solid #eee; border-bottom: 2rpx solid #eee;
} }
.upload-row { .upload-row {
display: flex; display: flex;
@ -384,7 +384,7 @@ function previewFile(idx) {
width: 180rpx; width: 180rpx;
height: 140rpx; height: 140rpx;
position: relative; position: relative;
border: 1px solid #e5e7eb; border: 2rpx solid #e5e7eb;
border-radius: 8rpx; border-radius: 8rpx;
overflow: hidden; overflow: hidden;
background: #f9fafb; background: #f9fafb;
@ -408,7 +408,7 @@ function previewFile(idx) {
.upload-add { .upload-add {
width: 180rpx; width: 180rpx;
height: 140rpx; height: 140rpx;
border: 1px dashed #d1d5db; border: 2rpx dashed #d1d5db;
border-radius: 8rpx; border-radius: 8rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@ -425,17 +425,17 @@ function previewFile(idx) {
right: 0; right: 0;
bottom: 0; bottom: 0;
background: #fff; background: #fff;
padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); padding: 24rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
display: flex; display: flex;
gap: 12px; gap: 24rpx;
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
} }
.btn { .btn {
flex: 1; flex: 1;
height: 44px; height: 88rpx;
line-height: 44px; line-height: 88rpx;
border-radius: 6px; border-radius: 12rpx;
font-size: 15px; font-size: 30rpx;
} }
.btn::after { .btn::after {
border: none; border: none;
@ -443,7 +443,7 @@ function previewFile(idx) {
.btn.plain { .btn.plain {
background: #fff; background: #fff;
color: #4f6ef7; color: #4f6ef7;
border: 1px solid #4f6ef7; border: 2rpx solid #4f6ef7;
} }
.btn.primary { .btn.primary {
background: #4f6ef7; background: #4f6ef7;
@ -452,16 +452,16 @@ function previewFile(idx) {
.delete-fab { .delete-fab {
position: fixed; position: fixed;
right: 16px; right: 32rpx;
bottom: calc(96px + env(safe-area-inset-bottom)); bottom: calc(192rpx + env(safe-area-inset-bottom));
width: 52px; width: 104rpx;
height: 52px; height: 104rpx;
border-radius: 26px; border-radius: 52rpx;
background: #fff; background: #fff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12); box-shadow: 0 20rpx 36rpx rgba(0, 0, 0, 0.12);
z-index: 30; z-index: 30;
} }
</style> </style>

View File

@ -267,70 +267,70 @@ function remove() {
.page { .page {
min-height: 100vh; min-height: 100vh;
background: #fff; background: #fff;
padding-bottom: calc(76px + env(safe-area-inset-bottom)); padding-bottom: calc(152rpx + env(safe-area-inset-bottom));
} }
.topbar { .topbar {
background: #5d6df0; background: #5d6df0;
padding: 10px 14px; padding: 20rpx 28rpx;
} }
.topbar-text { .topbar-text {
color: #fff; color: #fff;
font-size: 14px; font-size: 28rpx;
text-align: center; text-align: center;
} }
.content { .content {
padding: 14px 14px 0; padding: 28rpx 28rpx 0;
} }
.section { .section {
margin-bottom: 14px; margin-bottom: 28rpx;
} }
.row { .row {
display: flex; display: flex;
padding: 10px 0; padding: 20rpx 0;
} }
.label { .label {
width: 90px; width: 180rpx;
font-size: 14px; font-size: 28rpx;
font-weight: 600; font-weight: 600;
color: #111827; color: #111827;
} }
.value { .value {
flex: 1; flex: 1;
font-size: 14px; font-size: 28rpx;
color: #111827; color: #111827;
word-break: break-all; word-break: break-all;
} }
.h2 { .h2 {
font-size: 14px; font-size: 28rpx;
font-weight: 700; font-weight: 700;
color: #111827; color: #111827;
padding: 8px 0; padding: 16rpx 0;
} }
.p { .p {
font-size: 14px; font-size: 28rpx;
color: #111827; color: #111827;
line-height: 20px; line-height: 40rpx;
white-space: pre-wrap; white-space: pre-wrap;
} }
.files { .files {
display: flex; display: flex;
gap: 10px; gap: 20rpx;
flex-wrap: wrap; flex-wrap: wrap;
} }
.file { .file {
width: 90px; width: 180rpx;
height: 70px; height: 140rpx;
border: 1px solid #d1d5db; border: 2rpx solid #d1d5db;
background: #f9fafb; background: #f9fafb;
} }
.thumb { .thumb {
width: 90px; width: 180rpx;
height: 70px; height: 140rpx;
} }
.files-empty { .files-empty {
font-size: 13px; font-size: 26rpx;
color: #9aa0a6; color: #9aa0a6;
padding: 8px 0; padding: 16rpx 0;
} }
.footer { .footer {
position: fixed; position: fixed;
@ -338,18 +338,18 @@ function remove() {
right: 0; right: 0;
bottom: 0; bottom: 0;
background: #fff; background: #fff;
padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); padding: 24rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: 14px; gap: 28rpx;
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
} }
.btn { .btn {
width: 120px; width: 240rpx;
height: 44px; height: 88rpx;
line-height: 44px; line-height: 88rpx;
border-radius: 6px; border-radius: 12rpx;
font-size: 15px; font-size: 30rpx;
} }
.btn::after { .btn::after {
border: none; border: none;
@ -357,7 +357,7 @@ function remove() {
.btn.danger { .btn.danger {
background: #fff; background: #fff;
color: #ff4d4f; color: #ff4d4f;
border: 1px solid #ff4d4f; border: 2rpx solid #ff4d4f;
} }
.btn.primary { .btn.primary {
background: #4f6ef7; background: #4f6ef7;

View File

@ -10,7 +10,7 @@
<uni-icons :type="selectedMap[item.label] ? 'checkmarkempty' : ''" size="22" color="#007aff" /> <uni-icons :type="selectedMap[item.label] ? 'checkmarkempty' : ''" size="22" color="#007aff" />
</view> </view>
<view v-if="showList.length === 0" class="empty">暂无诊断数据</view> <view v-if="showList.length === 0" class="empty">暂无诊断数据</view>
<view style="height: 120px;"></view> <view style="height: 240rpx;"></view>
</scroll-view> </scroll-view>
<view class="footer"> <view class="footer">
@ -132,32 +132,32 @@ function save() {
.page { .page {
min-height: 100vh; min-height: 100vh;
background: #fff; background: #fff;
padding-bottom: calc(76px + env(safe-area-inset-bottom)); padding-bottom: calc(152rpx + env(safe-area-inset-bottom));
} }
.top { .top {
padding: 12px 14px; padding: 24rpx 28rpx;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
} }
.scroll { .scroll {
height: calc(100vh - 140px); height: calc(100vh - 280rpx);
} }
.row { .row {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 14px 14px; padding: 28rpx 28rpx;
border-bottom: 1px solid #f2f2f2; border-bottom: 2rpx solid #f2f2f2;
} }
.label { .label {
font-size: 14px; font-size: 28rpx;
color: #111827; color: #111827;
margin-right: 10px; margin-right: 20rpx;
} }
.empty { .empty {
padding: 60px 0; padding: 120rpx 0;
text-align: center; text-align: center;
color: #9aa0a6; color: #9aa0a6;
font-size: 13px; font-size: 26rpx;
} }
.footer { .footer {
position: fixed; position: fixed;
@ -165,15 +165,15 @@ function save() {
right: 0; right: 0;
bottom: 0; bottom: 0;
background: #fff; background: #fff;
padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); padding: 24rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
} }
.btn { .btn {
width: 100%; width: 100%;
height: 44px; height: 88rpx;
line-height: 44px; line-height: 88rpx;
border-radius: 6px; border-radius: 12rpx;
font-size: 15px; font-size: 30rpx;
} }
.btn::after { .btn::after {
border: none; border: none;

View File

@ -0,0 +1,224 @@
<template>
<view class="page">
<scroll-view scroll-y class="scroll">
<view v-for="(group, idx) in tagGroups" :key="group.id || idx" class="group">
<view class="group-title">
<text>{{ group.groupName || '标签' }}</text>
<text v-if="group.createType === 'corpAsync'" class="hint">(企微标签)</text>
</view>
<view class="tags">
<view
v-for="tag in group.tag"
:key="tag.id"
class="tag"
:class="selectedMap[tag.id] ? 'active' : ''"
@click="toggle(tag.id)"
>
{{ tag.name }}
</view>
</view>
</view>
<view class="spacer" />
</scroll-view>
<view class="footer">
<view class="btn plain" @click="cancel">取消</view>
<view class="btn primary" @click="save">确定</view>
</view>
</view>
</template>
<script setup>
import { computed, ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import api from '@/utils/api';
import useAccountStore from '@/store/account';
import { hideLoading, loading, toast } from '@/utils/widget';
const accountStore = useAccountStore();
const account = computed(() => accountStore.account);
const doctorInfo = computed(() => accountStore.doctorInfo);
const eventName = ref('change-tag-list');
const selections = ref([]);
const tagGroups = ref([]);
const selectedMap = computed(() =>
selections.value.reduce((m, id) => {
m[String(id)] = true;
return m;
}, {})
);
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.list)) return d.list;
if (Array.isArray(d.data)) return d.data;
if (d.data && typeof d.data === 'object') {
if (Array.isArray(d.data.list)) return d.data.list;
if (Array.isArray(d.data.data)) return d.data.data;
}
return [];
}
function normalizeGroups(list) {
const groups = Array.isArray(list) ? list : [];
return groups
.map((g) => {
const tag = Array.isArray(g?.tag) ? g.tag : Array.isArray(g?.tags) ? g.tags : [];
return {
id: g?.id || g?._id || g?.groupId || '',
groupName: g?.groupName || g?.name || '',
createType: g?.createType || '',
tag: (Array.isArray(tag) ? tag : [])
.map((t) => ({
id: String(t?.id || t?._id || t?.tagId || ''),
name: String(t?.name || t?.label || ''),
}))
.filter((t) => t.id && t.name),
};
})
.filter((g) => g.tag.length > 0);
}
function getCorpId() {
const env = __VITE_ENV__;
return String(account.value?.corpId || doctorInfo.value?.corpId || env.MP_CORP_ID || '');
}
async function loadTags() {
const corpId = getCorpId();
if (!corpId) return;
loading('加载中...');
const res = await api('getCorpTags', { corpId });
hideLoading();
if (!res?.success) {
toast(res?.message || '获取标签失败');
tagGroups.value = [];
return;
}
const list = unwrapListPayload(res);
tagGroups.value = normalizeGroups(list);
}
function toggle(id) {
const key = String(id);
if (!key) return;
if (selectedMap.value[key]) {
selections.value = selections.value.filter((i) => String(i) !== key);
} else {
selections.value = [...selections.value, key];
}
}
function cancel() {
uni.navigateBack();
}
function save() {
const list = selections.value.map(String).filter(Boolean);
uni.$emit(eventName.value, list);
uni.navigateBack();
}
onLoad(async (query) => {
if (query?.eventName) eventName.value = String(query.eventName);
const cached = uni.getStorageSync('ykt_tag_list_selections');
uni.removeStorageSync('ykt_tag_list_selections');
selections.value = Array.isArray(cached) ? cached.map(String).filter(Boolean) : [];
await loadTags();
});
</script>
<style lang="scss" scoped>
.page {
height: 100vh;
background: #fff;
display: flex;
flex-direction: column;
}
.scroll {
flex: 1;
min-height: 0;
}
.group {
padding: 30rpx;
}
.group-title {
font-size: 28rpx;
font-weight: 600;
margin-bottom: 20rpx;
display: flex;
align-items: center;
gap: 10rpx;
}
.hint {
font-size: 22rpx;
color: #5d8aff;
}
.tags {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
}
.tag {
max-width: 100%;
padding: 12rpx 20rpx;
border: 1px solid #ddd;
border-radius: 16rpx;
font-size: 24rpx;
line-height: 1.2em;
color: #333;
background: #fff;
word-break: break-all;
}
.tag.active {
color: #fff;
border-color: #5d8aff;
background: #5d8aff;
}
.spacer {
height: 120rpx;
}
.footer {
padding: 24rpx 30rpx calc(24rpx + env(safe-area-inset-bottom));
display: flex;
gap: 20rpx;
border-top: 1px solid #eee;
background: #fff;
}
.btn {
flex: 1;
height: 88rpx;
line-height: 88rpx;
border-radius: 12rpx;
font-size: 30rpx;
text-align: center;
}
.btn.plain {
background: #fff;
color: #666;
border: 1px solid #ddd;
}
.btn.primary {
background: #5d8aff;
color: #fff;
}
</style>

View File

@ -23,7 +23,7 @@
/> />
</view> </view>
<view style="height: 120px;"></view> <view style="height: 240rpx;"></view>
</scroll-view> </scroll-view>
<view class="footer"> <view class="footer">
@ -68,28 +68,28 @@ function save() {
.page { .page {
min-height: 100vh; min-height: 100vh;
background: #fff; background: #fff;
padding-bottom: calc(76px + env(safe-area-inset-bottom)); padding-bottom: calc(152rpx + env(safe-area-inset-bottom));
} }
.scroll { .scroll {
height: 100vh; height: 100vh;
} }
.section { .section {
padding: 16px 14px 0; padding: 32rpx 28rpx 0;
} }
.title { .title {
font-size: 15px; font-size: 30rpx;
font-weight: 700; font-weight: 700;
color: #111827; color: #111827;
margin-bottom: 10px; margin-bottom: 20rpx;
} }
.textarea { .textarea {
width: 100%; width: 100%;
min-height: 120px; min-height: 240rpx;
border: 1px solid #e5e7eb; border: 2rpx solid #e5e7eb;
border-radius: 8px; border-radius: 16rpx;
padding: 10px; padding: 20rpx;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 28rpx;
color: #111827; color: #111827;
} }
.placeholder { .placeholder {
@ -101,17 +101,17 @@ function save() {
right: 0; right: 0;
bottom: 0; bottom: 0;
background: #fff; background: #fff;
padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); padding: 24rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
display: flex; display: flex;
gap: 12px; gap: 24rpx;
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
} }
.btn { .btn {
flex: 1; flex: 1;
height: 44px; height: 88rpx;
line-height: 44px; line-height: 88rpx;
border-radius: 6px; border-radius: 12rpx;
font-size: 15px; font-size: 30rpx;
} }
.btn::after { .btn::after {
border: none; border: none;
@ -119,7 +119,7 @@ function save() {
.btn.plain { .btn.plain {
background: #fff; background: #fff;
color: #4f6ef7; color: #4f6ef7;
border: 1px solid #4f6ef7; border: 2rpx solid #4f6ef7;
} }
.btn.primary { .btn.primary {
background: #4f6ef7; background: #4f6ef7;

View File

@ -125,6 +125,10 @@ export default [
path: 'pages/library/diagnosis-list', path: 'pages/library/diagnosis-list',
meta: { title: '诊断', login: false }, meta: { title: '诊断', login: false },
}, },
{
path: 'pages/library/tag-list/tag-list',
meta: { title: '标签', login: false },
},
{ {
path: 'pages/others/edit-positive-find', path: 'pages/others/edit-positive-find',
meta: { title: '阳性发现', login: false }, meta: { title: '阳性发现', login: false },

View File

@ -3,6 +3,9 @@ import request from "./http";
const urlsConfig = { const urlsConfig = {
corp: { corp: {
getCorpMemberHomepageInfo: 'getCorpMemberHomepageInfo', getCorpMemberHomepageInfo: 'getCorpMemberHomepageInfo',
// 企业信息/标签
getCorpInfo: 'getCorpInfo',
getCorpTags: 'getCorpTags',
getTeamBaseInfo: 'getTeamBaseInfo', getTeamBaseInfo: 'getTeamBaseInfo',
getTeamData: 'getTeamData', getTeamData: 'getTeamData',
getTeamBymember: 'getTeamBymember', getTeamBymember: 'getTeamBymember',
@ -70,6 +73,7 @@ const urlsConfig = {
getUnbindMiniAppCustomers: 'getUnbindMiniAppCustomers', getUnbindMiniAppCustomers: 'getUnbindMiniAppCustomers',
searchCorpCustomer: 'searchCorpCustomer', searchCorpCustomer: 'searchCorpCustomer',
searchCorpCustomerWithFollowTime: 'searchCorpCustomerWithFollowTime', searchCorpCustomerWithFollowTime: 'searchCorpCustomerWithFollowTime',
searchCorpCustomerForCaseList: 'searchCorpCustomerForCaseList', // 档案列表专用接口
unbindMiniAppArchive: 'unbindMiniAppArchive', unbindMiniAppArchive: 'unbindMiniAppArchive',
// 健康档案相关接口 // 健康档案相关接口
addMedicalRecord: 'addMedicalRecord', addMedicalRecord: 'addMedicalRecord',
@ -77,6 +81,8 @@ const urlsConfig = {
updateMedicalRecord: 'updateMedicalRecord', updateMedicalRecord: 'updateMedicalRecord',
removeMedicalRecord: 'removeMedicalRecord', removeMedicalRecord: 'removeMedicalRecord',
getCustomerMedicalRecord: 'getCustomerMedicalRecord', getCustomerMedicalRecord: 'getCustomerMedicalRecord',
// 客户阶段
getCustomerType: 'getCustomerType',
}, },
wecom: { wecom: {
addContactWay: 'addContactWay' addContactWay: 'addContactWay'
@ -112,6 +118,8 @@ const urlsConfig = {
addServiceRecord: 'addServiceRecord', addServiceRecord: 'addServiceRecord',
updateServiceRecord: 'updateServiceRecord', updateServiceRecord: 'updateServiceRecord',
removeServiceRecord: 'removeServiceRecord', removeServiceRecord: 'removeServiceRecord',
// 客户流转记录
customerTransferRecord: 'customerTransferRecord',
// sendConsultRejectedMessage: "sendConsultRejectedMessage" // sendConsultRejectedMessage: "sendConsultRejectedMessage"
} }

66
utils/form-alias.js Normal file
View File

@ -0,0 +1,66 @@
export const GLOBAL_FIELD_ALIASES = {
// 内部信息 / HIS 相关字段可能后续改名:这里做最小兜底,保证“有值就能显示”
hisCardNo: ['hisOutpatientNo', 'hisClinicNo', 'hisCardNumber'],
idCard: ['idNo', 'idNumber'],
sex: ['gender'],
cardType: ['idType'],
};
function isEmpty(v) {
if (v === null || v === undefined) return true;
if (Array.isArray(v)) return v.length === 0;
if (typeof v === 'string') return v.trim() === '';
return false;
}
function buildAliasCandidates(items) {
const itemList = Array.isArray(items) ? items : [];
const map = {};
// 支持模板项自带别名aliasTitles / aliases
itemList.forEach((it) => {
const title = it?.title;
if (!title) return;
const aliases = Array.isArray(it?.aliasTitles)
? it.aliasTitles
: Array.isArray(it?.aliases)
? it.aliases
: [];
if (!aliases.length) return;
map[String(title)] = aliases.map((i) => String(i)).filter(Boolean);
});
return map;
}
function uniq(arr) {
const out = [];
const seen = new Set();
arr.forEach((i) => {
const v = String(i || '');
if (!v || seen.has(v)) return;
seen.add(v);
out.push(v);
});
return out;
}
export function createAliasedForm(form, items) {
const local = buildAliasCandidates(items);
return new Proxy(form || {}, {
get(target, prop) {
if (typeof prop !== 'string') return target[prop];
const direct = target[prop];
if (!isEmpty(direct)) return direct;
const candidates = uniq([...(local[prop] || []), ...(GLOBAL_FIELD_ALIASES[prop] || [])]);
for (const k of candidates) {
const v = target[k];
if (!isEmpty(v)) return v;
}
return direct;
},
});
}