Merge branch 'dev-benefitUP' of http://175.27.226.205:3000/huxuejian/ykt-wxapp into dev-benefitUP
This commit is contained in:
commit
3e387ad687
48
components/ww-user/index.vue
Normal file
48
components/ww-user/index.vue
Normal 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>
|
||||
@ -47,7 +47,7 @@
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<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>
|
||||
</template>
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<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 v-if="item.treatmentRemark" class="remark">{{ item.treatmentRemark }}</view>
|
||||
</template>
|
||||
@ -105,6 +105,7 @@ import { storeToRefs } from 'pinia';
|
||||
import api from '@/utils/api';
|
||||
import useAccountStore from '@/store/account';
|
||||
import { toast } from '@/utils/widget';
|
||||
import WwUser from '@/components/ww-user/index.vue';
|
||||
|
||||
const props = defineProps({
|
||||
data: { type: Object, default: () => ({}) },
|
||||
@ -165,7 +166,7 @@ function mapTreatment(row) {
|
||||
purchaseDate: formatDate(row.billTime || row.createTreatementTime),
|
||||
statusLabel: expired ? '已过期' : row.restUsageCount > 0 ? '可使用' : '已用完',
|
||||
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;
|
||||
justify-content: center;
|
||||
box-shadow: 0 20rpx 36rpx rgba(8, 119, 241, 0.3);
|
||||
z-index: 20;
|
||||
z-index: 1000;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1600,7 +1600,7 @@ watch(
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 10px 18px rgba(79, 110, 247, 0.35);
|
||||
z-index: 20;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.popup {
|
||||
|
||||
@ -893,7 +893,7 @@ watch(
|
||||
right: 32rpx;
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
z-index: 20;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.fab {
|
||||
|
||||
@ -885,7 +885,7 @@ watch(
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 20rpx 36rpx rgba(79, 110, 247, 0.35);
|
||||
z-index: 20;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.popup {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user