fix:问题修复

This commit is contained in:
huxuejian 2026-02-04 15:23:57 +08:00
parent 3af5c6750f
commit 72e132ba8d
7 changed files with 93 additions and 95 deletions

View File

@ -216,6 +216,10 @@ page {
margin-right: 20rpx; margin-right: 20rpx;
} }
.ml-10 {
margin-left: 30rpx;
}
.ml-15 { .ml-15 {
margin-left: 30rpx; margin-left: 30rpx;
} }

View File

@ -31,8 +31,8 @@
</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">关联档案</view>
<view class="mr-10 text-base text-success" @click="changeArchive(customer)">完善个人信息</view> <view class="text-base text-success" @click="changeArchive(customer)">完善个人信息</view>
<view class="mr-10 text-base text-danger" @click="unBindArchive(customer)">删除档案</view> <!-- <view class="text-base text-danger" @click="unBindArchive(customer)">删除档案</view> -->
</view> </view>
</view> </view>
</view> </view>

View File

@ -11,7 +11,8 @@
</view> </view>
<template #footer> <template #footer>
<button-footer confirmText="保存" :showCancel="false" @confirm="confirm()" /> <button-footer :showCancel="customerId" cancelText="删除" confirmText="保存" @cancel="unBindArchive()"
@confirm="confirm()" />
</template> </template>
</full-page> </full-page>
<bind-popup :customers="customers" :corpName="corpName" :visible="visible" @close="visible = false" <bind-popup :customers="customers" :corpName="corpName" :visible="visible" @close="visible = false"
@ -26,7 +27,7 @@ import dayjs from 'dayjs';
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 { toast } from '@/utils/widget'; import { toast, confirm as uniConfirm } from '@/utils/widget';
import validate from '@/utils/validate'; import validate from '@/utils/validate';
import ButtonFooter from '@/components/button-footer.vue'; import ButtonFooter from '@/components/button-footer.vue';
@ -77,7 +78,6 @@ function change({ title, value }) {
} }
function confirm() { function confirm() {
console.log(formData.value)
if (!tempRef.value.verify()) return; if (!tempRef.value.verify()) return;
if (customerId.value) { if (customerId.value) {
updateArchive(); updateArchive();
@ -101,6 +101,7 @@ async function addArchive() {
loading.value = false; loading.value = false;
const res = await api('addCustomer', { params }); const res = await api('addCustomer', { params });
if (res && res.success) { if (res && res.success) {
uni.$emit('reloadTeamCustomers')
uni.redirectTo({ uni.redirectTo({
url: `/pages/archive/archive-result?corpId=${corpId.value}&teamId=${teamId.value}` url: `/pages/archive/archive-result?corpId=${corpId.value}&teamId=${teamId.value}`
}) })
@ -160,7 +161,6 @@ async function getBaseForm() {
async function getCustomer() { async function getCustomer() {
const res = await api('getCustomerByCustomerId', { customerId: customerId.value }); const res = await api('getCustomerByCustomerId', { customerId: customerId.value });
console.log(res.data)
if (res && res.success && res.data) { if (res && res.success && res.data) {
customer.value = res.data; customer.value = res.data;
} else { } else {
@ -172,9 +172,10 @@ async function getCustomer() {
async function updateArchive() { async function updateArchive() {
if (Object.keys(form.value).length > 0) { if (Object.keys(form.value).length > 0) {
const res = await api('updateCustomer', { id: customerId.value, ...form.value }); const res = await api('updateCustomer', { id: customerId.value, params: { ...form.value } });
if (res && res.success) { if (res && res.success) {
await toast('修改成功'); await toast('修改成功');
uni.$emit('reloadTeamCustomers')
uni.navigateBack(); uni.navigateBack();
} else { } else {
toast(res?.message || '修改失败'); toast(res?.message || '修改失败');
@ -184,6 +185,18 @@ async function updateArchive() {
} }
} }
async function unBindArchive() {
await uniConfirm('确定删除档案吗?')
const res = await api('unbindMiniAppArchive', { id: customer.value._id, corpId: corpId.value, teamId: teamId.value, miniAppId: account.value.openid });
if (res && res.success) {
await toast('删除成功');
uni.$emit('reloadTeamCustomers')
uni.navigateBack();
} else {
toast(res?.message || '删除失败')
}
}
// async updateCustomer() { // async updateCustomer() {
// if (Object.keys(this.form).length === 0) return this.editMemberId; // if (Object.keys(this.form).length === 0) return this.editMemberId;
// const { success, message } = await updateCustomer( // const { success, message } = await updateCustomer(
@ -200,6 +213,7 @@ onLoad(options => {
customerId.value = options.id || ''; customerId.value = options.id || '';
uni.setNavigationBarTitle({ title: customerId.value ? '编辑档案' : '新增档案' }) uni.setNavigationBarTitle({ title: customerId.value ? '编辑档案' : '新增档案' })
}) })
useLoad(options => { useLoad(options => {
teamId.value = options.teamId; teamId.value = options.teamId;
corpId.value = options.corpId; corpId.value = options.corpId;

View File

@ -15,8 +15,7 @@
</view> </view>
<scroll-view scroll-x="true"> <scroll-view scroll-x="true">
<view class="flex flex-nowrap pb-5 "> <view class="flex flex-nowrap pb-5 ">
<view v-for="i in customers" :key="i._id" <view v-for="i in customers" :key="i._id" class="customer-card flex-shrink-0 mr-15 relative"
class="customer-card flex-shrink-0 mr-15 relative"
:class="current && i._id === current._id ? 'current-customer' : ''" @click="toggle(i)"> :class="current && i._id === current._id ? 'current-customer' : ''" @click="toggle(i)">
<!-- 关系标签 --> <!-- 关系标签 -->
<view v-if="i.relationship" class="relationship-tag" <view v-if="i.relationship" class="relationship-tag"
@ -29,11 +28,8 @@
{{ i.name }} {{ i.name }}
</view> </view>
<view class="flex items-center mb-5"> <view class="flex items-center mb-5">
<image <image v-if="i.sex" class="sex-icon mr-5"
v-if="i.sex" :src="i.sex === '男' ? '/static/home/male.svg' : '/static/home/female.svg'" />
class="sex-icon mr-5"
:src="i.sex === '男' ? '/static/home/male.svg' : '/static/home/female.svg'"
/>
<view class="customer-age text-base leading-normal text-gray"> <view class="customer-age text-base leading-normal text-gray">
{{ i.age > 0 ? i.age + '岁' : '' }} {{ i.age > 0 ? i.age + '岁' : '' }}
</view> </view>
@ -49,24 +45,25 @@
</scroll-view> </scroll-view>
<view v-if="canAuth" class="px-10 py-5 mt-5 flex items-center bg-danger rounded-sm"> <view v-if="canAuth" class="px-10 py-5 mt-5 flex items-center bg-danger rounded-sm">
<view class="mr-5 w-0 flex-grow text-base text-white"> <view class="mr-5 w-0 flex-grow text-base text-white">
该档案还未授权本服务团队点击右侧授权按钮我们将更精准的为您服务 点击右侧授权按钮, 我们将更精准的为您服务
</view> </view>
<view class="px-12 py-5 text-base rounded-sm text-dark bg-white" @click="auth()"> <view class="px-12 py-5 text-base rounded-sm text-dark bg-white" @click="auth()">
授权 授权
</view> </view>
</view> </view>
<view v-if="current" class="flex mt-15"> <view v-if="current" class="flex mt-15">
<view class="info-card-new flex-grow mr-10" @click="fillBaseInfo()"> <view class="info-card-new flex-grow" @click="fillBaseInfo()">
<view class="info-bg info-bg-base"></view> <view class="info-bg info-bg-base"></view>
<view class="info-content"> <view class="info-content">
<view class="flex items-center justify-between mb-8"> <view class="flex items-center justify-between mb-8">
<view class="info-title">个人基本信息</view> <view class="info-title">个人基本信息</view>
<image class="arrow-icon-small" src="/static/home/arrow-right-blue.png" mode="aspectFit"></image> <image class="arrow-icon-small" src="/static/home/arrow-right-blue.png" mode="aspectFit"></image>
</view> </view>
<view class="info-subtitle">完善个人信息</view> <view v-if="baseInfoError" class="text-sm text-danger">请完善您的个人信息</view>
<view v-else class="info-subtitle">完善个人信息</view>
</view> </view>
</view> </view>
<view class="info-card-new flex-grow" @click="toHealthList()"> <view v-if="hasHealthTemp" class="ml-10 info-card-new flex-grow" @click="toHealthList()">
<view class="info-bg info-bg-health"></view> <view class="info-bg info-bg-health"></view>
<view class="info-content"> <view class="info-content">
<view class="flex items-center justify-between mb-8"> <view class="flex items-center justify-between mb-8">
@ -80,7 +77,7 @@
</view> </view>
</template> </template>
<script setup> <script setup>
import { computed, ref, watch } from 'vue'; import { computed, onMounted, ref, watch } from 'vue';
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import useAccount from '@/store/account'; import useAccount from '@/store/account';
import api from '@/utils/api'; import api from '@/utils/api';
@ -114,6 +111,17 @@ const canAuth = computed(() => {
} }
return false return false
}) })
const qrcode = computed(() => {
const qrcodes = props.team && Array.isArray(props.team.qrcodes) ? props.team.qrcodes : [];
return qrcodes[0] || ''
})
const hasHealthTemp = computed(() => qrcode.value && Array.isArray(qrcode.value.healthTempList) && qrcode.value.healthTempList.length > 0)
const baseInfo = computed(() => qrcode.value && qrcode.value.teamFileds && Array.isArray(qrcode.value.teamFileds.baseInfo) ? qrcode.value.teamFileds.baseInfo : [])
const baseInfoError = computed(() => {
const requiredTitles = baseInfo.value.filter(i => i.required).map(i => i.title);
return current.value && requiredTitles.some(i => !current.value[i]);
})
function fillBaseInfo() { function fillBaseInfo() {
if (canAuth.value) { if (canAuth.value) {
@ -161,7 +169,6 @@ async function getCustomers() {
customers.value = res && Array.isArray(res.data) ? res.data : []; customers.value = res && Array.isArray(res.data) ? res.data : [];
const customer = customers.value.find(i => current.value && i._id === current.value._id); const customer = customers.value.find(i => current.value && i._id === current.value._id);
current.value = customer || customers.value[0] || null; current.value = customer || customers.value[0] || null;
// customers // customers
emit('update:customers', customers.value); emit('update:customers', customers.value);
} else { } else {
@ -169,6 +176,10 @@ async function getCustomers() {
} }
} }
onMounted(() => {
uni.$on('reloadTeamCustomers', getCustomers)
})
watch(() => props.corpId, n => { watch(() => props.corpId, n => {
if (n) { if (n) {
getCustomers() getCustomers()

View File

@ -1,19 +1,11 @@
<template> <template>
<page-loading v-if="loading" /> <page-loading v-if="loading && teams.length === 0" />
<full-page <full-page v-else-if="teams.length && team" class="home-container" :pageStyle="pageStyle">
v-else-if="teams.length && team"
class="home-container"
:pageStyle="pageStyle"
>
<template #header> <template #header>
<team-head :team="team" :teams="teams" @changeTeam="changeTeam" /> <team-head :team="team" :teams="teams" @changeTeam="changeTeam" />
</template> </template>
<view class="home-section home-section--first"> <view class="home-section home-section--first">
<customer-archive <customer-archive :corpId="corpId" :team="team" @update:customers="handleCustomersUpdate" />
:corpId="corpId"
:team="team"
@update:customers="handleCustomersUpdate"
/>
</view> </view>
<view class="home-section"> <view class="home-section">
<consult :corpId="corpId" :teamId="team.teamId" :customers="customers" /> <consult :corpId="corpId" :teamId="team.teamId" :customers="customers" />

View File

@ -3,70 +3,48 @@
<view :style="{ height: statusBarHeight }" class="status-bar"></view> <view :style="{ height: statusBarHeight }" class="status-bar"></view>
<view class="relative z-3 flex items-center px-15 py-12 header-bar"> <view class="relative z-3 flex items-center px-15 py-12 header-bar">
<view class="flex-shrink-0 mr-5"> <view class="flex-shrink-0 mr-5">
<group-avatar <group-avatar :size="120" :avatarList="currentTeam ? currentTeam.avatarList : []" />
:size="120"
:avatarList="currentTeam ? currentTeam.avatarList : []"
/>
</view> </view>
<view class="w-0 flex-grow"> <view class="w-0 flex-grow">
<view class="flex items-center mb-10"> <view class="flex items-center mb-10">
<view class="team-name flex-shrink-0">{{ team.name }}</view> <view class="team-name flex-shrink-0">{{ team.name }}</view>
<view <view v-if="teams.length > 1" class="flex-shrink-0 flex items-center switch-btn ml-10"
v-if="teams.length > 1" @click="showDropDown = true">
class="flex-shrink-0 flex items-center switch-btn ml-10" <image class="switch-icon" src="/static/home/switch-team.png" mode="aspectFit"></image>
@click="showDropDown = true"
>
<image
class="switch-icon"
src="/static/home/switch-team.png"
mode="aspectFit"
></image>
</view> </view>
</view> </view>
<view v-if="currentTeam" class="text-base text-white truncate">{{ <view v-if="currentTeam" class="text-base text-white truncate">
currentTeam.corpName {{ currentTeam.corpName }}
}}</view>
</view> </view>
<view </view>
v-if="menuButtonInfo && menuButtonInfo.width > 0" <view v-if="menuButtonInfo && menuButtonInfo.width > 0" class="flex-shrink-0" :style="{
class="flex-shrink-0"
:style="{
width: menuButtonInfo.width + 'px', width: menuButtonInfo.width + 'px',
height: menuButtonInfo.height + 'px', height: menuButtonInfo.height + 'px',
}" }">
>
</view> </view>
</view> </view>
<view class="relative"> <view class="relative">
<view v-if="showDropDown" class="team-dropdown py-12 bg-white shadow-lg"> <view v-if="showDropDown" class="team-dropdown py-12 bg-white shadow-lg">
<scroll-view scroll-y="true" style="max-height: 50vh"> <scroll-view scroll-y="true" style="max-height: 50vh">
<view class="px-15"> <view class="px-15">
<view <view v-for="item in teams" :key="item.teamId" class="mb-10 p-10 flex items-center bg-gray rounded-sm"
v-for="item in teams" @click="select(item)">
:key="item.teamId"
class="mb-10 p-10 flex items-center bg-gray rounded-sm"
@click="select(item)"
>
<view class="flex-shrink-0 mr-5 rounded-circle"> <view class="flex-shrink-0 mr-5 rounded-circle">
<group-avatar :size="96" :avatarList="item.avatarList" /> <group-avatar :size="96" :avatarList="item.avatarList" />
</view> </view>
<view class="w-0 flex-grow mr-5"> <view class="w-0 flex-grow mr-5">
<view class="mb-5 text-lg font-semibold text-dark">{{ <view class="mb-5 text-lg font-semibold text-dark">
item.name {{ item.name }}
}}</view> </view>
<view class="text-base text-gray leading-normal">{{ <view class="text-base text-gray leading-normal">
item.corpName {{ item.corpName }}
}}</view> </view>
</view> </view>
<view class="flex"> <view class="flex">
<image <image class="check-icon" :src="team && team.teamId === item.teamId
class="check-icon"
:src="
team && team.teamId === item.teamId
? '/static/form/checked.svg' ? '/static/form/checked.svg'
: '/static/form/unchecked.svg' : '/static/form/uncheck.svg'
" ">
>
</image> </image>
</view> </view>
</view> </view>
@ -74,20 +52,16 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<view v-if="team.teamTroduce" class="team-introduce-wrapper"> <view v-if="qrcode && qrcode.guide" class="team-introduce-wrapper">
<view class="team-introduce flex items-center"> <view class="team-introduce flex items-center">
<!-- 顶部小三角形 --> <!-- 顶部小三角形 -->
<view class="triangle-wrapper"> <view class="triangle-wrapper">
<view class="team-triangle"></view> <view class="team-triangle"></view>
</view> </view>
<image <image class="laba-icon flex-shrink-0" src="/static/home/speaker-intro.png" mode="aspectFit"></image>
class="laba-icon flex-shrink-0" <view class="introduce-text flex-grow line-clamp-2">
src="/static/home/speaker-intro.png" {{ qrcode.guide }}
mode="aspectFit" </view>
></image>
<view class="introduce-text flex-grow line-clamp-2">{{
team.teamTroduce
}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -117,6 +91,10 @@ const props = defineProps({
const currentTeam = computed(() => const currentTeam = computed(() =>
props.teams.find((i) => props.team && i.teamId === props.team.teamId) props.teams.find((i) => props.team && i.teamId === props.team.teamId)
); );
const qrcode = computed(() => {
const qrcodes = props.team && Array.isArray(props.team.qrcodes) ? props.team.qrcodes : [];
return qrcodes[0] || ''
})
function select(team) { function select(team) {
emits("changeTeam", team); emits("changeTeam", team);
@ -195,11 +173,9 @@ onMounted(() => {
width: 690rpx; width: 690rpx;
min-height: 111rpx; min-height: 111rpx;
box-sizing: border-box; box-sizing: border-box;
background: linear-gradient( background: linear-gradient(186deg,
186deg,
rgba(255, 255, 255, 0.4) 13.34%, rgba(255, 255, 255, 0.4) 13.34%,
rgba(255, 255, 255, 0.6) 99.17% rgba(255, 255, 255, 0.6) 99.17%);
);
border-radius: 16rpx; border-radius: 16rpx;
padding: 20rpx 20rpx 20rpx 0; padding: 20rpx 20rpx 20rpx 0;
position: relative; position: relative;
@ -223,11 +199,9 @@ onMounted(() => {
bottom: -10rpx; bottom: -10rpx;
width: 16rpx; width: 16rpx;
height: 16rpx; height: 16rpx;
background: linear-gradient( background: linear-gradient(186deg,
186deg,
rgba(255, 255, 255, 0.4) 13.34%, rgba(255, 255, 255, 0.4) 13.34%,
rgba(255, 255, 255, 0.6) 99.17% rgba(255, 255, 255, 0.6) 99.17%);
);
transform: translateX(-50%) rotate(45deg); transform: translateX(-50%) rotate(45deg);
} }

View File

@ -63,6 +63,8 @@
</template> </template>
<script setup> <script setup>
import { computed, ref, watch } from 'vue'; import { computed, ref, watch } from 'vue';
import { storeToRefs } from 'pinia';
import useAccount from "@/store/account";
import { onLoad, onShow } from '@dcloudio/uni-app'; import { onLoad, onShow } from '@dcloudio/uni-app';
import useJob from '@/hooks/useJob'; import useJob from '@/hooks/useJob';
import api from '@/utils/api'; import api from '@/utils/api';
@ -75,6 +77,7 @@ const qrcode = ref('')
const member = ref(null); const member = ref(null);
const expand = ref(false); const expand = ref(false);
const { memberJob, memberList } = useJob(); const { memberJob, memberList } = useJob();
const { account } = storeToRefs(useAccount());
const corpNames = computed(() => { const corpNames = computed(() => {
const corpNames = member.value && Array.isArray(member.value.corpNames) ? member.value.corpNames : []; const corpNames = member.value && Array.isArray(member.value.corpNames) ? member.value.corpNames : [];