bug修复2

This commit is contained in:
zhanchao 2026-09-01 15:21:46 +08:00
parent c33f9929d1
commit c985379bc8
5 changed files with 56 additions and 7 deletions

View File

@ -0,0 +1,48 @@
<template>
<text>{{ displayName }}</text>
</template>
<script setup>
import { computed, onMounted, reactive } from 'vue';
import api from '@/utils/api';
import useAccountStore from '@/store/account';
const props = defineProps({
openid: { type: String, default: '' },
fallback: { type: String, default: '' },
});
const SPECIAL_NAMES = { system: '系统', none: '咨询公共池', not: '无' };
const sharedUserNameMap = reactive({});
let sharedLoadingPromise = null;
const accountStore = useAccountStore();
const displayName = computed(() => {
const id = String(props.openid || '').trim();
if (!id) return props.fallback || '';
return SPECIAL_NAMES[id] || sharedUserNameMap[id] || props.fallback || id;
});
async function loadMembers() {
if (sharedLoadingPromise) return sharedLoadingPromise;
const team = uni.getStorageSync('ykt_case_current_team') || {};
const corpId = String(team.corpId || accountStore.doctorInfo?.corpId || accountStore.account?.corpId || '');
if (!corpId) return;
sharedLoadingPromise = api('getCorpMember', { corpId, page: 1, pageSize: 1000 }, false)
.then((res) => {
const list = res?.data?.data || res?.data?.list || res?.data || res?.list || [];
if (!Array.isArray(list)) return;
const map = {};
list.forEach((member) => {
const userid = String(member?.userid || member?.userId || member?.corpUserId || '').trim();
const name = String(member?.anotherName || member?.name || '').trim();
if (userid && name) map[userid] = name;
});
Object.assign(sharedUserNameMap, map);
})
.catch(() => {})
.finally(() => { sharedLoadingPromise = null; });
return sharedLoadingPromise;
}
onMounted(loadMembers);
</script>

View File

@ -47,7 +47,7 @@
</view> </view>
<view class="detail-row"> <view class="detail-row">
<text class="detail-label">录单人</text> <text class="detail-label">录单人</text>
<text class="detail-value">{{ item.creatorName || item.billdCreator || '--' }}</text> <text class="detail-value"><WwUser :openid="item.creator || item.billdCreator || item.billDoctorId" :fallback="item.creatorName || item.billdCreatorName || '--'" /></text>
</view> </view>
</template> </template>
@ -70,7 +70,7 @@
</view> </view>
<view class="detail-row"> <view class="detail-row">
<text class="detail-label">治疗医生</text> <text class="detail-label">治疗医生</text>
<text class="detail-value">{{ item.doctorName || item.treatmentDoctorUserId || '--' }}</text> <text class="detail-value"><WwUser :openid="item.treatmentDoctorUserId || item.doctorUserId || item.doctorId || item.executorUserId" :fallback="item.doctorName || item.treatmentDoctorName || '--'" /></text>
</view> </view>
<view v-if="item.treatmentRemark" class="remark">{{ item.treatmentRemark }}</view> <view v-if="item.treatmentRemark" class="remark">{{ item.treatmentRemark }}</view>
</template> </template>
@ -105,6 +105,7 @@ import { storeToRefs } from 'pinia';
import api from '@/utils/api'; import api from '@/utils/api';
import useAccountStore from '@/store/account'; import useAccountStore from '@/store/account';
import { toast } from '@/utils/widget'; import { toast } from '@/utils/widget';
import WwUser from '@/components/ww-user/index.vue';
const props = defineProps({ const props = defineProps({
data: { type: Object, default: () => ({}) }, data: { type: Object, default: () => ({}) },
@ -165,7 +166,7 @@ function mapTreatment(row) {
purchaseDate: formatDate(row.billTime || row.createTreatementTime), purchaseDate: formatDate(row.billTime || row.createTreatementTime),
statusLabel: expired ? '已过期' : row.restUsageCount > 0 ? '可使用' : '已用完', statusLabel: expired ? '已过期' : row.restUsageCount > 0 ? '可使用' : '已用完',
statusClass: expired ? 'status-red' : row.restUsageCount > 0 ? 'status-green' : 'status-gray', statusClass: expired ? 'status-red' : row.restUsageCount > 0 ? 'status-green' : 'status-gray',
creatorName: row.billdCreatorName || row.doctorName || '', creatorName: row.creatorName || row.billdCreatorName || '',
}; };
} }
@ -446,6 +447,6 @@ watch(() => props.archiveId, (value, oldValue) => {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 20rpx 36rpx rgba(8, 119, 241, 0.3); box-shadow: 0 20rpx 36rpx rgba(8, 119, 241, 0.3);
z-index: 20; z-index: 1000;
} }
</style> </style>

View File

@ -1600,7 +1600,7 @@ watch(
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 10px 18px rgba(79, 110, 247, 0.35);
z-index: 20; z-index: 1000;
} }
.popup { .popup {

View File

@ -893,7 +893,7 @@ watch(
right: 32rpx; right: 32rpx;
width: 104rpx; width: 104rpx;
height: 104rpx; height: 104rpx;
z-index: 20; z-index: 1000;
} }
.fab { .fab {

View File

@ -885,7 +885,7 @@ watch(
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 20rpx 36rpx rgba(79, 110, 247, 0.35); box-shadow: 0 20rpx 36rpx rgba(79, 110, 247, 0.35);
z-index: 20; z-index: 1000;
} }
.popup { .popup {