feat: 绑定his档案
This commit is contained in:
parent
17c6f0f671
commit
d18838e852
@ -14,9 +14,10 @@
|
|||||||
<view class="flex-grow mr-5"></view>
|
<view class="flex-grow mr-5"></view>
|
||||||
<view v-if="enableHis && customer.isConnectHis"
|
<view v-if="enableHis && customer.isConnectHis"
|
||||||
class="px-15 py-5 text-sm leading-normal bg-success text-white rounded-sm">
|
class="px-15 py-5 text-sm leading-normal bg-success text-white rounded-sm">
|
||||||
未关联档案
|
已关联院内档案
|
||||||
</view>
|
</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>
|
</view>
|
||||||
<view class="px-15 py-12 border-b">
|
<view class="px-15 py-12 border-b">
|
||||||
@ -30,7 +31,9 @@
|
|||||||
<view class="text-base leading-normal">证件号:{{ customer.idCard || '--' }}</view>
|
<view class="text-base leading-normal">证件号:{{ customer.idCard || '--' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="px-15 py-12 flex justify-end">
|
<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-success" @click="changeArchive(customer)">完善个人信息</view>
|
||||||
<!-- <view class="text-base text-danger" @click="unBindArchive(customer)">删除档案</view> -->
|
<!-- <view class="text-base text-danger" @click="unBindArchive(customer)">删除档案</view> -->
|
||||||
</view>
|
</view>
|
||||||
@ -40,6 +43,8 @@
|
|||||||
<button-footer confirmText="新增档案" :showCancel="false" @confirm="addArchive()" />
|
<button-footer confirmText="新增档案" :showCancel="false" @confirm="addArchive()" />
|
||||||
</template>
|
</template>
|
||||||
</full-page>
|
</full-page>
|
||||||
|
<bind-his-popup :corpId="corpId" :corpName="corpName" :openid="account.openid" :customer="customer" :hisArchive="hisArchive"
|
||||||
|
:visible="showBindHisPopup" @close="showBindHisPopup = false" @confirm="confirmBindHisPopup" />
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
@ -47,11 +52,12 @@ import { storeToRefs } from 'pinia'
|
|||||||
import useGuard from '@/hooks/useGuard';
|
import useGuard from '@/hooks/useGuard';
|
||||||
import useAccount from '@/store/account';
|
import useAccount from '@/store/account';
|
||||||
import api from '@/utils/api';
|
import api from '@/utils/api';
|
||||||
|
import { confirm, toast } from '@/utils/widget';
|
||||||
|
|
||||||
import ButtonFooter from '@/components/button-footer.vue';
|
import ButtonFooter from '@/components/button-footer.vue';
|
||||||
import EmptyData from '@/components/empty-data.vue';
|
import EmptyData from '@/components/empty-data.vue';
|
||||||
import FullPage from '@/components/full-page.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 empty = ref(false)
|
||||||
const { useLoad, useShow } = useGuard();
|
const { useLoad, useShow } = useGuard();
|
||||||
@ -62,6 +68,10 @@ const corpUserId = ref('');
|
|||||||
const referenceCustomerId = ref('');
|
const referenceCustomerId = ref('');
|
||||||
const enableHis = ref(false);
|
const enableHis = ref(false);
|
||||||
const customers = ref([]);
|
const customers = ref([]);
|
||||||
|
const showBindHisPopup = ref(false);
|
||||||
|
const corpName = ref('');
|
||||||
|
const hisArchive = ref({});
|
||||||
|
const customer = ref({})
|
||||||
|
|
||||||
function addArchive() {
|
function addArchive() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -75,6 +85,14 @@ 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() {
|
async function getMembers() {
|
||||||
const res = await api('getTeamCustomers', { corpId: corpId.value, teamId: teamId.value, miniAppId: account.value.openid });
|
const res = await api('getTeamCustomers', { corpId: corpId.value, teamId: teamId.value, miniAppId: account.value.openid });
|
||||||
customers.value = res && Array.isArray(res.data) ? res.data : [];
|
customers.value = res && Array.isArray(res.data) ? res.data : [];
|
||||||
@ -84,6 +102,18 @@ async function getMembers() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
async function unBindArchive(customer) {
|
||||||
await confirm('确定删除档案吗?')
|
await confirm('确定删除档案吗?')
|
||||||
const res = await api('unbindMiniAppArchive', { id: customer._id, corpId: corpId.value, teamId: teamId.value, miniAppId: account.value.openid });
|
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 class="flex-shrink-0 min-w-60">姓名:</view>
|
||||||
<view>{{ customer.maskName }}</view>
|
<view>{{ customer.maskName }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="flex items-center">
|
<!-- <view class="flex items-center">
|
||||||
<view class="flex-shrink-0 min-w-60">性别:</view>
|
<view class="flex-shrink-0 min-w-60">性别:</view>
|
||||||
<view>{{ customer.sex || '--' }}</view>
|
<view>{{ customer.sex || '--' }}</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
@ -33,18 +33,15 @@
|
|||||||
<view class="footer-buttons">
|
<view class="footer-buttons">
|
||||||
<button-footer hideden-shadow confirmText="确定" :showCancel="false" @confirm="confirm()" />
|
<button-footer hideden-shadow confirmText="确定" :showCancel="false" @confirm="confirm()" />
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-end px-15 pb-10">
|
<view class="flex justify-end px-15 pb-10">
|
||||||
<view class="mr-5 text-base text-dark">以上档案都不对,可以:</view>
|
<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 class="px-10 text-base leading-normal text-primary border-auto rounded-sm" @click="close()">新增档案</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
<verify-name-popup
|
<verify-name-popup :visible="showVerifyPopup" :customer="customer" @close="onVerifyClose"
|
||||||
:visible="showVerifyPopup"
|
@confirm="onVerifyConfirm" />
|
||||||
:customer="customer"
|
<verify-popup :visible="showIdNoPopup" :customer="customer" @close="showIdNoPopup = false" @confirm="onVerifyConfirm" />
|
||||||
@close="onVerifyClose"
|
|
||||||
@confirm="onVerifyConfirm"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -53,6 +50,7 @@ import { toast } from '@/utils/widget';
|
|||||||
|
|
||||||
import ButtonFooter from '@/components/button-footer.vue';
|
import ButtonFooter from '@/components/button-footer.vue';
|
||||||
import VerifyNamePopup from './verify-name-popup.vue';
|
import VerifyNamePopup from './verify-name-popup.vue';
|
||||||
|
import verifyPopup from './verify-popup.vue';
|
||||||
|
|
||||||
const emits = defineEmits(['close', 'confirm'])
|
const emits = defineEmits(['close', 'confirm'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -64,6 +62,10 @@ const props = defineProps({
|
|||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
},
|
},
|
||||||
|
enableHis: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
@ -72,6 +74,7 @@ const props = defineProps({
|
|||||||
const popup = ref()
|
const popup = ref()
|
||||||
const id = ref('')
|
const id = ref('')
|
||||||
const showVerifyPopup = ref(false)
|
const showVerifyPopup = ref(false)
|
||||||
|
const showIdNoPopup = ref(false)
|
||||||
const list = computed(() => props.customers.map(i => {
|
const list = computed(() => props.customers.map(i => {
|
||||||
const name = typeof i.name === 'string' ? i.name.trim() : '';
|
const name = typeof i.name === 'string' ? i.name.trim() : '';
|
||||||
const maskName = name.length > 1 ? name.slice(0, 1) + '*'.repeat(name.length - 1) : '*';
|
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 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 : {}
|
return selected ? selected : {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -91,10 +94,14 @@ function close() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function confirm() {
|
function confirm() {
|
||||||
if (props.customers.some(i => i._id === id.value && id.value)) {
|
const selected = props.customers.find(i => i._id === id.value && id.value);
|
||||||
showVerifyPopup.value = true
|
if (!selected) {
|
||||||
|
return toast('请选择档案')
|
||||||
|
}
|
||||||
|
if (props.enableHis && selected.idNo && selected.isConnectHis) {
|
||||||
|
showIdNoPopup.value = true
|
||||||
} else {
|
} else {
|
||||||
toast('请选择档案')
|
showVerifyPopup.value = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,9 +116,9 @@ function onVerifyConfirm() {
|
|||||||
watch(() => props.visible, n => {
|
watch(() => props.visible, n => {
|
||||||
if (n) {
|
if (n) {
|
||||||
popup.value && popup.value.open();
|
popup.value && popup.value.open();
|
||||||
if(props.customers && props.customers.length === 1 && props.customers[0] && props.customers[0]._id){
|
if (props.customers && props.customers.length === 1 && props.customers[0] && props.customers[0]._id) {
|
||||||
id.value = props.customers[0]._id
|
id.value = props.customers[0]._id
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
popup.value && popup.value.close()
|
popup.value && popup.value.close()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,9 +35,9 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
customers: {
|
customer: {
|
||||||
type: Array,
|
type: Object,
|
||||||
default: () => []
|
default: () => { }
|
||||||
},
|
},
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -57,10 +57,12 @@ function close() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function confirm() {
|
function confirm() {
|
||||||
if (props.customers.some(i => i._id === id.value && id.value)) {
|
const data = props.customer && typeof props.customer.idNo === 'string' ? props.customer.idNo.slice(-4).toUpperCase() : '';
|
||||||
emits('confirm', id.value)
|
const last4 = codeStr.value.toUpperCase();
|
||||||
|
if (data.length === 4 && data === last4) {
|
||||||
|
emits('confirm')
|
||||||
} else {
|
} else {
|
||||||
toast('请选择档案')
|
toast('请输入正确的身份证号后四位')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<view class="module-title flex-shrink-0 truncate"> 成员档案 </view>
|
<view class="module-title flex-shrink-0 truncate"> 成员档案 </view>
|
||||||
<view class="flex items-center leading-normal rounded-sm" style="padding-right: 0" @click="toManagePage()">
|
<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>
|
<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>
|
</view>
|
||||||
<view v-if="customers.length === 0" class="add-archive-card" @click="toManagePage()">
|
<view v-if="customers.length === 0" class="add-archive-card" @click="toManagePage()">
|
||||||
|
|||||||
@ -63,6 +63,8 @@ const urlsConfig = {
|
|||||||
getWxAppCustomerCount: "getWxAppCustomerCount",
|
getWxAppCustomerCount: "getWxAppCustomerCount",
|
||||||
updateCustomer: 'update',
|
updateCustomer: 'update',
|
||||||
getRefrencePeople: 'getRefrencePeople',
|
getRefrencePeople: 'getRefrencePeople',
|
||||||
|
bindHisArchive: 'bindHisArchive',
|
||||||
|
getMatchedHisArchive: 'getMatchedHisArchive',
|
||||||
},
|
},
|
||||||
wecom: {
|
wecom: {
|
||||||
addContactWay: 'getCorpFriendQrcode'
|
addContactWay: 'getCorpFriendQrcode'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user