Compare commits
No commits in common. "dev-his-archive" and "main" have entirely different histories.
dev-his-ar
...
main
@ -14,10 +14,9 @@
|
|||||||
<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">
|
||||||
@ -31,9 +30,7 @@
|
|||||||
<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 v-if="enableHis && !customer.isConnectHis" class="mr-10 text-base text-primary">关联档案</view>
|
||||||
@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>
|
||||||
@ -43,8 +40,6 @@
|
|||||||
<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';
|
||||||
@ -52,12 +47,11 @@ 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 BindHisPopup from './bind-his-popup.vue';
|
import { confirm, toast } from '../../utils/widget';
|
||||||
|
|
||||||
const empty = ref(false)
|
const empty = ref(false)
|
||||||
const { useLoad, useShow } = useGuard();
|
const { useLoad, useShow } = useGuard();
|
||||||
@ -68,10 +62,6 @@ 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({
|
||||||
@ -85,35 +75,15 @@ 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 : [];
|
||||||
enableHis.value = res && typeof res.enableHis === 'boolean' ? res.enableHis : false;
|
// enableHis.value = res && typeof res.enableHis === 'boolean' ? res.enableHis : false;
|
||||||
if (!res || !res.data) {
|
if (!res || !res.data) {
|
||||||
toast(res?.message || '获取档案信息失败')
|
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) {
|
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 });
|
||||||
|
|||||||
@ -1,110 +0,0 @@
|
|||||||
<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>
|
|
||||||
@ -39,9 +39,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
<verify-name-popup :visible="showVerifyPopup" :customer="customer" @close="onVerifyClose"
|
<verify-name-popup
|
||||||
@confirm="onVerifyConfirm" />
|
:visible="showVerifyPopup"
|
||||||
<verify-popup :visible="showIdNoPopup" :customer="customer" @close="showIdNoPopup = false" @confirm="onVerifyConfirm" />
|
:customer="customer"
|
||||||
|
@close="onVerifyClose"
|
||||||
|
@confirm="onVerifyConfirm"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -50,7 +53,6 @@ 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({
|
||||||
@ -62,10 +64,6 @@ const props = defineProps({
|
|||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
},
|
},
|
||||||
enableHis: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
@ -74,7 +72,6 @@ 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) : '*';
|
||||||
@ -85,7 +82,7 @@ const list = computed(() => props.customers.map(i => {
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
const customer = computed(() => {
|
const customer = computed(() => {
|
||||||
const selected = list.value.find(i => i._id === id.value && i.idNo)
|
const selected = list.value.find(i => i._id === id.value)
|
||||||
return selected ? selected : {}
|
return selected ? selected : {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -94,14 +91,10 @@ function close() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function confirm() {
|
function confirm() {
|
||||||
const selected = props.customers.find(i => i._id === id.value && id.value);
|
if (props.customers.some(i => i._id === id.value && id.value)) {
|
||||||
if (!selected) {
|
|
||||||
return toast('请选择档案')
|
|
||||||
}
|
|
||||||
if (props.enableHis && selected.idNo && selected.isConnectHis) {
|
|
||||||
showIdNoPopup.value = true
|
|
||||||
} else {
|
|
||||||
showVerifyPopup.value = true
|
showVerifyPopup.value = true
|
||||||
|
} else {
|
||||||
|
toast('请选择档案')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
@confirm="confirm()" />
|
@confirm="confirm()" />
|
||||||
</template>
|
</template>
|
||||||
</full-page>
|
</full-page>
|
||||||
<bind-popup :customers="customers" :corpName="corpName" :enableHis="enableHis" :visible="visible" @close="visible = false"
|
<bind-popup :customers="customers" :corpName="corpName" :visible="visible" @close="visible = false"
|
||||||
@confirm="bindArchive($event)" />
|
@confirm="bindArchive($event)" />
|
||||||
<verify-popup :visible="verifyVisible" @close="verifyVisible = false" />
|
<verify-popup :visible="verifyVisible" @close="verifyVisible = false" />
|
||||||
</template>
|
</template>
|
||||||
@ -58,7 +58,6 @@ const verifyVisible = ref(false);
|
|||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const referenceCustomer = ref(null)
|
const referenceCustomer = ref(null)
|
||||||
const healthTypes = ref([]);
|
const healthTypes = ref([]);
|
||||||
const enableHis = ref(false);
|
|
||||||
|
|
||||||
const formData = computed(() => {
|
const formData = computed(() => {
|
||||||
return { ...customer.value, ...form.value, mobile: account.value?.mobile }
|
return { ...customer.value, ...form.value, mobile: account.value?.mobile }
|
||||||
@ -200,9 +199,12 @@ async function bindArchive(customerId) {
|
|||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/home/home'
|
url: '/pages/home/home'
|
||||||
})
|
})
|
||||||
|
// uni.reLaunch({ url: `/pages/home/home?corpId=${corpId.value}&teamId=${teamId.value}` })
|
||||||
} else {
|
} else {
|
||||||
toast(res?.message || '绑定失败');
|
toast(res?.message || '绑定失败');
|
||||||
}
|
}
|
||||||
|
// customerArchive.value = customers.value.find(item => item.customerId === customerId);
|
||||||
|
// verifyVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
@ -227,7 +229,6 @@ async function getArchives() {
|
|||||||
const res = await api('getUnbindMiniAppCustomers', { corpId: corpId.value, mobile: account.value?.mobile || '' });
|
const res = await api('getUnbindMiniAppCustomers', { corpId: corpId.value, mobile: account.value?.mobile || '' });
|
||||||
customers.value = res && Array.isArray(res.data) ? res.data : [];
|
customers.value = res && Array.isArray(res.data) ? res.data : [];
|
||||||
corpName.value = res && res.corpName ? res.corpName : '';
|
corpName.value = res && res.corpName ? res.corpName : '';
|
||||||
enableHis.value = res && res.enableHis ? res.enableHis : false;
|
|
||||||
return customers.value
|
return customers.value
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,7 +298,17 @@ async function getTeam(corpId, teamId, customerId) {
|
|||||||
const qrcode = team && Array.isArray(team.qrcodes) ? team.qrcodes[0] : null;
|
const qrcode = team && Array.isArray(team.qrcodes) ? team.qrcodes[0] : null;
|
||||||
const healthTempList = qrcode && Array.isArray(qrcode.healthTempList) ? qrcode.healthTempList : [];
|
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);
|
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,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
customer: {
|
customers: {
|
||||||
type: Object,
|
type: Array,
|
||||||
default: () => { }
|
default: () => []
|
||||||
},
|
},
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -57,12 +57,10 @@ function close() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function confirm() {
|
function confirm() {
|
||||||
const data = props.customer && typeof props.customer.idNo === 'string' ? props.customer.idNo.slice(-4).toUpperCase() : '';
|
if (props.customers.some(i => i._id === id.value && id.value)) {
|
||||||
const last4 = codeStr.value.toUpperCase();
|
emits('confirm', id.value)
|
||||||
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,8 +63,6 @@ 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