Compare commits
3 Commits
main
...
dev-his-ar
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c03acbccba | ||
|
|
d18838e852 | ||
|
|
17c6f0f671 |
@ -14,9 +14,10 @@
|
||||
<view class="flex-grow mr-5"></view>
|
||||
<view v-if="enableHis && customer.isConnectHis"
|
||||
class="px-15 py-5 text-sm leading-normal bg-success text-white rounded-sm">
|
||||
未关联档案
|
||||
已关联院内档案
|
||||
</view>
|
||||
<view v-else-if="enableHis" class="px-15 py-5 text-sm leading-normal bg-warning text-white rounded-sm">未关联档案
|
||||
<view v-else-if="enableHis" class="px-15 py-5 text-sm leading-normal bg-warning text-white rounded-sm">
|
||||
未关联院内档案
|
||||
</view>
|
||||
</view>
|
||||
<view class="px-15 py-12 border-b">
|
||||
@ -30,7 +31,9 @@
|
||||
<view class="text-base leading-normal">证件号:{{ customer.idCard || '--' }}</view>
|
||||
</view>
|
||||
<view class="px-15 py-12 flex justify-end">
|
||||
<view v-if="enableHis && !customer.isConnectHis" class="mr-10 text-base text-primary">关联档案</view>
|
||||
<view v-if="enableHis && !customer.isConnectHis" class="mr-10 text-base text-primary"
|
||||
@click="getMatchedHisArchive(customer)">关联档案
|
||||
</view>
|
||||
<view class="text-base text-success" @click="changeArchive(customer)">完善个人信息</view>
|
||||
<!-- <view class="text-base text-danger" @click="unBindArchive(customer)">删除档案</view> -->
|
||||
</view>
|
||||
@ -40,6 +43,8 @@
|
||||
<button-footer confirmText="新增档案" :showCancel="false" @confirm="addArchive()" />
|
||||
</template>
|
||||
</full-page>
|
||||
<bind-his-popup :corpId="corpId" :corpName="corpName" :openid="account.openid" :customer="customer" :hisArchive="hisArchive"
|
||||
:visible="showBindHisPopup" @close="showBindHisPopup = false" @confirm="confirmBindHisPopup" />
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
@ -47,11 +52,12 @@ import { storeToRefs } from 'pinia'
|
||||
import useGuard from '@/hooks/useGuard';
|
||||
import useAccount from '@/store/account';
|
||||
import api from '@/utils/api';
|
||||
import { confirm, toast } from '@/utils/widget';
|
||||
|
||||
import ButtonFooter from '@/components/button-footer.vue';
|
||||
import EmptyData from '@/components/empty-data.vue';
|
||||
import FullPage from '@/components/full-page.vue';
|
||||
import { confirm, toast } from '../../utils/widget';
|
||||
import BindHisPopup from './bind-his-popup.vue';
|
||||
|
||||
const empty = ref(false)
|
||||
const { useLoad, useShow } = useGuard();
|
||||
@ -62,6 +68,10 @@ const corpUserId = ref('');
|
||||
const referenceCustomerId = ref('');
|
||||
const enableHis = ref(false);
|
||||
const customers = ref([]);
|
||||
const showBindHisPopup = ref(false);
|
||||
const corpName = ref('');
|
||||
const hisArchive = ref({});
|
||||
const customer = ref({})
|
||||
|
||||
function addArchive() {
|
||||
uni.navigateTo({
|
||||
@ -75,15 +85,35 @@ function changeArchive(customer) {
|
||||
})
|
||||
}
|
||||
|
||||
function confirmBindHisPopup() {
|
||||
showBindHisPopup.value = false;
|
||||
getMembers();
|
||||
uni.navigateTo({
|
||||
url: `/pages/archive/archive-result?corpId=${corpId.value}&teamId=${teamId.value}&customerId=${customer.value._id}`
|
||||
})
|
||||
}
|
||||
|
||||
async function getMembers() {
|
||||
const res = await api('getTeamCustomers', { corpId: corpId.value, teamId: teamId.value, miniAppId: account.value.openid });
|
||||
customers.value = res && Array.isArray(res.data) ? res.data : [];
|
||||
// enableHis.value = res && typeof res.enableHis === 'boolean' ? res.enableHis : false;
|
||||
enableHis.value = res && typeof res.enableHis === 'boolean' ? res.enableHis : false;
|
||||
if (!res || !res.data) {
|
||||
toast(res?.message || '获取档案信息失败')
|
||||
}
|
||||
}
|
||||
|
||||
async function getMatchedHisArchive(data) {
|
||||
const res = await api('getMatchedHisArchive', { id: data._id, corpId: corpId.value, miniAppId: account.value.openid });
|
||||
if (res && res.success) {
|
||||
hisArchive.value = res.data || {};
|
||||
customer.value = data;
|
||||
corpName.value = res.corpName || '';
|
||||
showBindHisPopup.value = true;
|
||||
} else {
|
||||
confirm(res?.message || '获取档案信息失败', { showCancel: false })
|
||||
}
|
||||
}
|
||||
|
||||
async function unBindArchive(customer) {
|
||||
await confirm('确定删除档案吗?')
|
||||
const res = await api('unbindMiniAppArchive', { id: customer._id, corpId: corpId.value, teamId: teamId.value, miniAppId: account.value.openid });
|
||||
|
||||
110
pages/archive/bind-his-popup.vue
Normal file
110
pages/archive/bind-his-popup.vue
Normal file
@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<uni-popup ref="popup" type="center" :mask-click="false">
|
||||
<view class="bg-white rounded overflow-hidden" style="width: 690rpx;">
|
||||
<view class="flex items-center justify-between px-15 py-12 border-b">
|
||||
<view class="text-lg font-semibold text-dark">档案绑定验证</view>
|
||||
<uni-icons type="closeempty" :size="24" color="#999" @click="close"></uni-icons>
|
||||
</view>
|
||||
<view class="px-15 pt-15 text-base text-dark">
|
||||
您在"{{ corpName }}"医客通平台已存在档案,请选择档案绑定。
|
||||
</view>
|
||||
<!-- <scroll-view scroll-y="true" class="popup-content-scroll"> -->
|
||||
<view class="px-15 py-12">
|
||||
<view class="flex items-center p-10 mb-10 rounded-sm bg-gray">
|
||||
<view class="flex-grow w-0 mr-5 text-base leading-normal text-dark">
|
||||
<view class="flex items-center">
|
||||
<view class="flex-shrink-0 min-w-60">姓名:</view>
|
||||
<view>{{ hisArchive.name }}</view>
|
||||
</view>
|
||||
<view class="flex items-center">
|
||||
<view class="flex-shrink-0 min-w-60">手机号:</view>
|
||||
<view>{{ hisArchive.mobile }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer-buttons">
|
||||
<button-footer hideden-shadow confirmText="确定" :showCancel="false" @confirm="confirm()" />
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import api from '@/utils/api';
|
||||
import { toast } from '@/utils/widget';
|
||||
|
||||
import ButtonFooter from '@/components/button-footer.vue';
|
||||
|
||||
const emits = defineEmits(['close', 'confirm'])
|
||||
const props = defineProps({
|
||||
corpId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
corpName: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
customer: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
hisArchive: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
openid: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
const popup = ref()
|
||||
const loading = ref(false);
|
||||
|
||||
function close() {
|
||||
emits('close')
|
||||
}
|
||||
|
||||
async function confirm() {
|
||||
if (loading.value) return;
|
||||
loading.value = true;
|
||||
const res = await api('bindHisArchive', { id: props.customer._id, corpId: props.corpId, miniAppId: props.openid });
|
||||
if (res && res.success) {
|
||||
await toast('绑定成功');
|
||||
emits('confirm');
|
||||
} else {
|
||||
toast(res?.message || '绑定失败')
|
||||
}
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
|
||||
watch(() => props.visible, n => {
|
||||
if (n) {
|
||||
popup.value && popup.value.open();
|
||||
} else {
|
||||
popup.value && popup.value.close()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.min-w-60 {
|
||||
min-width: 120rpx;
|
||||
}
|
||||
|
||||
.check-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
.popup-content-scroll {
|
||||
max-height: 50vh;
|
||||
}
|
||||
</style>
|
||||
@ -17,7 +17,7 @@
|
||||
<view class="flex-shrink-0 min-w-60">姓名:</view>
|
||||
<view>{{ customer.maskName }}</view>
|
||||
</view>
|
||||
<!-- <view class="flex items-center">
|
||||
<!-- <view class="flex items-center">
|
||||
<view class="flex-shrink-0 min-w-60">性别:</view>
|
||||
<view>{{ customer.sex || '--' }}</view>
|
||||
</view> -->
|
||||
@ -33,18 +33,15 @@
|
||||
<view class="footer-buttons">
|
||||
<button-footer hideden-shadow confirmText="确定" :showCancel="false" @confirm="confirm()" />
|
||||
</view>
|
||||
<view class="flex justify-end px-15 pb-10">
|
||||
<view class="mr-5 text-base text-dark">以上档案都不对,可以:</view>
|
||||
<view class="px-10 text-base leading-normal text-primary border-auto rounded-sm" @click="close()">新增档案</view>
|
||||
</view>
|
||||
<view class="flex justify-end px-15 pb-10">
|
||||
<view class="mr-5 text-base text-dark">以上档案都不对,可以:</view>
|
||||
<view class="px-10 text-base leading-normal text-primary border-auto rounded-sm" @click="close()">新增档案</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<verify-name-popup
|
||||
:visible="showVerifyPopup"
|
||||
:customer="customer"
|
||||
@close="onVerifyClose"
|
||||
@confirm="onVerifyConfirm"
|
||||
/>
|
||||
<verify-name-popup :visible="showVerifyPopup" :customer="customer" @close="onVerifyClose"
|
||||
@confirm="onVerifyConfirm" />
|
||||
<verify-popup :visible="showIdNoPopup" :customer="customer" @close="showIdNoPopup = false" @confirm="onVerifyConfirm" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -53,6 +50,7 @@ import { toast } from '@/utils/widget';
|
||||
|
||||
import ButtonFooter from '@/components/button-footer.vue';
|
||||
import VerifyNamePopup from './verify-name-popup.vue';
|
||||
import verifyPopup from './verify-popup.vue';
|
||||
|
||||
const emits = defineEmits(['close', 'confirm'])
|
||||
const props = defineProps({
|
||||
@ -64,6 +62,10 @@ const props = defineProps({
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
enableHis: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@ -72,6 +74,7 @@ const props = defineProps({
|
||||
const popup = ref()
|
||||
const id = ref('')
|
||||
const showVerifyPopup = ref(false)
|
||||
const showIdNoPopup = ref(false)
|
||||
const list = computed(() => props.customers.map(i => {
|
||||
const name = typeof i.name === 'string' ? i.name.trim() : '';
|
||||
const maskName = name.length > 1 ? name.slice(0, 1) + '*'.repeat(name.length - 1) : '*';
|
||||
@ -82,7 +85,7 @@ const list = computed(() => props.customers.map(i => {
|
||||
}))
|
||||
|
||||
const customer = computed(() => {
|
||||
const selected = list.value.find(i => i._id === id.value)
|
||||
const selected = list.value.find(i => i._id === id.value && i.idNo)
|
||||
return selected ? selected : {}
|
||||
})
|
||||
|
||||
@ -91,10 +94,14 @@ function close() {
|
||||
}
|
||||
|
||||
function confirm() {
|
||||
if (props.customers.some(i => i._id === id.value && id.value)) {
|
||||
showVerifyPopup.value = true
|
||||
const selected = props.customers.find(i => i._id === id.value && id.value);
|
||||
if (!selected) {
|
||||
return toast('请选择档案')
|
||||
}
|
||||
if (props.enableHis && selected.idNo && selected.isConnectHis) {
|
||||
showIdNoPopup.value = true
|
||||
} else {
|
||||
toast('请选择档案')
|
||||
showVerifyPopup.value = true
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,9 +116,9 @@ function onVerifyConfirm() {
|
||||
watch(() => props.visible, n => {
|
||||
if (n) {
|
||||
popup.value && popup.value.open();
|
||||
if(props.customers && props.customers.length === 1 && props.customers[0] && props.customers[0]._id){
|
||||
id.value = props.customers[0]._id
|
||||
}
|
||||
if (props.customers && props.customers.length === 1 && props.customers[0] && props.customers[0]._id) {
|
||||
id.value = props.customers[0]._id
|
||||
}
|
||||
} else {
|
||||
popup.value && popup.value.close()
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
@confirm="confirm()" />
|
||||
</template>
|
||||
</full-page>
|
||||
<bind-popup :customers="customers" :corpName="corpName" :visible="visible" @close="visible = false"
|
||||
<bind-popup :customers="customers" :corpName="corpName" :enableHis="enableHis" :visible="visible" @close="visible = false"
|
||||
@confirm="bindArchive($event)" />
|
||||
<verify-popup :visible="verifyVisible" @close="verifyVisible = false" />
|
||||
</template>
|
||||
@ -58,6 +58,7 @@ const verifyVisible = ref(false);
|
||||
const visible = ref(false);
|
||||
const referenceCustomer = ref(null)
|
||||
const healthTypes = ref([]);
|
||||
const enableHis = ref(false);
|
||||
|
||||
const formData = computed(() => {
|
||||
return { ...customer.value, ...form.value, mobile: account.value?.mobile }
|
||||
@ -199,12 +200,9 @@ async function bindArchive(customerId) {
|
||||
uni.switchTab({
|
||||
url: '/pages/home/home'
|
||||
})
|
||||
// uni.reLaunch({ url: `/pages/home/home?corpId=${corpId.value}&teamId=${teamId.value}` })
|
||||
} else {
|
||||
toast(res?.message || '绑定失败');
|
||||
}
|
||||
// customerArchive.value = customers.value.find(item => item.customerId === customerId);
|
||||
// verifyVisible.value = true;
|
||||
}
|
||||
|
||||
async function init() {
|
||||
@ -229,6 +227,7 @@ async function getArchives() {
|
||||
const res = await api('getUnbindMiniAppCustomers', { corpId: corpId.value, mobile: account.value?.mobile || '' });
|
||||
customers.value = res && Array.isArray(res.data) ? res.data : [];
|
||||
corpName.value = res && res.corpName ? res.corpName : '';
|
||||
enableHis.value = res && res.enableHis ? res.enableHis : false;
|
||||
return customers.value
|
||||
}
|
||||
|
||||
@ -298,17 +297,7 @@ async function getTeam(corpId, teamId, customerId) {
|
||||
const qrcode = team && Array.isArray(team.qrcodes) ? team.qrcodes[0] : null;
|
||||
const healthTempList = qrcode && Array.isArray(qrcode.healthTempList) ? qrcode.healthTempList : [];
|
||||
healthTypes.value = healthTempList.filter(i => typeof i.templateType === 'string' && i.templateType.trim() && i.archiveRecommend === true).map(i => i.templateType);
|
||||
// if (types.length && customerId) {
|
||||
// const nextType = types[0];
|
||||
// const nextTypes = types.slice(1);
|
||||
// const url = `/pages/health/record?type=${nextType}&teamId=${teamId}&corpId=${corpId}&customerId=${customerId}&nextTypes=${nextTypes.join(',')}&source=afterArchive`
|
||||
// uni.redirectTo({ url });
|
||||
// return
|
||||
// }
|
||||
}
|
||||
// uni.redirectTo({
|
||||
// url: `/pages/archive/archive-result?corpId=${corpId}&teamId=${teamId}&customerId=${customerId}`
|
||||
// })
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -35,9 +35,9 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
customers: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
customer: {
|
||||
type: Object,
|
||||
default: () => { }
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
@ -57,10 +57,12 @@ function close() {
|
||||
}
|
||||
|
||||
function confirm() {
|
||||
if (props.customers.some(i => i._id === id.value && id.value)) {
|
||||
emits('confirm', id.value)
|
||||
const data = props.customer && typeof props.customer.idNo === 'string' ? props.customer.idNo.slice(-4).toUpperCase() : '';
|
||||
const last4 = codeStr.value.toUpperCase();
|
||||
if (data.length === 4 && data === last4) {
|
||||
emits('confirm')
|
||||
} else {
|
||||
toast('请选择档案')
|
||||
toast('请输入正确的身份证号后四位')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<view class="module-title flex-shrink-0 truncate"> 成员档案 </view>
|
||||
<view class="flex items-center leading-normal rounded-sm" style="padding-right: 0" @click="toManagePage()">
|
||||
<image class="manage-icon mr-5" src="/static/home/archive-manage.png" mode="aspectFit"></image>
|
||||
<view style="font-size: 30rpx; color: #065bd6">档案管理</view>
|
||||
<view style="font-size: 30rpx; color: #065bd6">已授权档案管理</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="customers.length === 0" class="add-archive-card" @click="toManagePage()">
|
||||
|
||||
@ -63,6 +63,8 @@ const urlsConfig = {
|
||||
getWxAppCustomerCount: "getWxAppCustomerCount",
|
||||
updateCustomer: 'update',
|
||||
getRefrencePeople: 'getRefrencePeople',
|
||||
bindHisArchive: 'bindHisArchive',
|
||||
getMatchedHisArchive: 'getMatchedHisArchive',
|
||||
},
|
||||
wecom: {
|
||||
addContactWay: 'getCorpFriendQrcode'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user