fix:问题修复
This commit is contained in:
parent
3af5c6750f
commit
72e132ba8d
4
App.vue
4
App.vue
@ -216,6 +216,10 @@ page {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.ml-10 {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.ml-15 {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
@ -31,8 +31,8 @@
|
||||
</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 class="mr-10 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-success" @click="changeArchive(customer)">完善个人信息</view>
|
||||
<!-- <view class="text-base text-danger" @click="unBindArchive(customer)">删除档案</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
</view>
|
||||
|
||||
<template #footer>
|
||||
<button-footer confirmText="保存" :showCancel="false" @confirm="confirm()" />
|
||||
<button-footer :showCancel="customerId" cancelText="删除" confirmText="保存" @cancel="unBindArchive()"
|
||||
@confirm="confirm()" />
|
||||
</template>
|
||||
</full-page>
|
||||
<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 useAccount from '@/store/account';
|
||||
import api from '@/utils/api';
|
||||
import { toast } from '@/utils/widget';
|
||||
import { toast, confirm as uniConfirm } from '@/utils/widget';
|
||||
import validate from '@/utils/validate';
|
||||
|
||||
import ButtonFooter from '@/components/button-footer.vue';
|
||||
@ -77,7 +78,6 @@ function change({ title, value }) {
|
||||
}
|
||||
|
||||
function confirm() {
|
||||
console.log(formData.value)
|
||||
if (!tempRef.value.verify()) return;
|
||||
if (customerId.value) {
|
||||
updateArchive();
|
||||
@ -101,6 +101,7 @@ async function addArchive() {
|
||||
loading.value = false;
|
||||
const res = await api('addCustomer', { params });
|
||||
if (res && res.success) {
|
||||
uni.$emit('reloadTeamCustomers')
|
||||
uni.redirectTo({
|
||||
url: `/pages/archive/archive-result?corpId=${corpId.value}&teamId=${teamId.value}`
|
||||
})
|
||||
@ -160,7 +161,6 @@ async function getBaseForm() {
|
||||
|
||||
async function getCustomer() {
|
||||
const res = await api('getCustomerByCustomerId', { customerId: customerId.value });
|
||||
console.log(res.data)
|
||||
if (res && res.success && res.data) {
|
||||
customer.value = res.data;
|
||||
} else {
|
||||
@ -172,9 +172,10 @@ async function getCustomer() {
|
||||
|
||||
async function updateArchive() {
|
||||
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) {
|
||||
await toast('修改成功');
|
||||
uni.$emit('reloadTeamCustomers')
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
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() {
|
||||
// if (Object.keys(this.form).length === 0) return this.editMemberId;
|
||||
// const { success, message } = await updateCustomer(
|
||||
@ -200,6 +213,7 @@ onLoad(options => {
|
||||
customerId.value = options.id || '';
|
||||
uni.setNavigationBarTitle({ title: customerId.value ? '编辑档案' : '新增档案' })
|
||||
})
|
||||
|
||||
useLoad(options => {
|
||||
teamId.value = options.teamId;
|
||||
corpId.value = options.corpId;
|
||||
|
||||
@ -15,8 +15,7 @@
|
||||
</view>
|
||||
<scroll-view scroll-x="true">
|
||||
<view class="flex flex-nowrap pb-5 ">
|
||||
<view v-for="i in customers" :key="i._id"
|
||||
class="customer-card flex-shrink-0 mr-15 relative"
|
||||
<view v-for="i in customers" :key="i._id" class="customer-card flex-shrink-0 mr-15 relative"
|
||||
:class="current && i._id === current._id ? 'current-customer' : ''" @click="toggle(i)">
|
||||
<!-- 关系标签 -->
|
||||
<view v-if="i.relationship" class="relationship-tag"
|
||||
@ -29,11 +28,8 @@
|
||||
{{ i.name }}
|
||||
</view>
|
||||
<view class="flex items-center mb-5">
|
||||
<image
|
||||
v-if="i.sex"
|
||||
class="sex-icon mr-5"
|
||||
:src="i.sex === '男' ? '/static/home/male.svg' : '/static/home/female.svg'"
|
||||
/>
|
||||
<image v-if="i.sex" 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">
|
||||
{{ i.age > 0 ? i.age + '岁' : '' }}
|
||||
</view>
|
||||
@ -49,24 +45,25 @@
|
||||
</scroll-view>
|
||||
<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>
|
||||
<view class="px-12 py-5 text-base rounded-sm text-dark bg-white" @click="auth()">
|
||||
授权
|
||||
</view>
|
||||
</view>
|
||||
<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-content">
|
||||
<view class="flex items-center justify-between mb-8">
|
||||
<view class="info-title">个人基本信息</view>
|
||||
<image class="arrow-icon-small" src="/static/home/arrow-right-blue.png" mode="aspectFit"></image>
|
||||
</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 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-content">
|
||||
<view class="flex items-center justify-between mb-8">
|
||||
@ -80,7 +77,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { storeToRefs } from 'pinia'
|
||||
import useAccount from '@/store/account';
|
||||
import api from '@/utils/api';
|
||||
@ -114,6 +111,17 @@ const canAuth = computed(() => {
|
||||
}
|
||||
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() {
|
||||
if (canAuth.value) {
|
||||
@ -161,7 +169,6 @@ async function getCustomers() {
|
||||
customers.value = res && Array.isArray(res.data) ? res.data : [];
|
||||
const customer = customers.value.find(i => current.value && i._id === current.value._id);
|
||||
current.value = customer || customers.value[0] || null;
|
||||
|
||||
// 向父组件传递 customers 数据
|
||||
emit('update:customers', customers.value);
|
||||
} else {
|
||||
@ -169,6 +176,10 @@ async function getCustomers() {
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
uni.$on('reloadTeamCustomers', getCustomers)
|
||||
})
|
||||
|
||||
watch(() => props.corpId, n => {
|
||||
if (n) {
|
||||
getCustomers()
|
||||
|
||||
@ -1,19 +1,11 @@
|
||||
<template>
|
||||
<page-loading v-if="loading" />
|
||||
<full-page
|
||||
v-else-if="teams.length && team"
|
||||
class="home-container"
|
||||
:pageStyle="pageStyle"
|
||||
>
|
||||
<page-loading v-if="loading && teams.length === 0" />
|
||||
<full-page v-else-if="teams.length && team" class="home-container" :pageStyle="pageStyle">
|
||||
<template #header>
|
||||
<team-head :team="team" :teams="teams" @changeTeam="changeTeam" />
|
||||
</template>
|
||||
<view class="home-section home-section--first">
|
||||
<customer-archive
|
||||
:corpId="corpId"
|
||||
:team="team"
|
||||
@update:customers="handleCustomersUpdate"
|
||||
/>
|
||||
<customer-archive :corpId="corpId" :team="team" @update:customers="handleCustomersUpdate" />
|
||||
</view>
|
||||
<view class="home-section">
|
||||
<consult :corpId="corpId" :teamId="team.teamId" :customers="customers" />
|
||||
|
||||
@ -3,70 +3,48 @@
|
||||
<view :style="{ height: statusBarHeight }" class="status-bar"></view>
|
||||
<view class="relative z-3 flex items-center px-15 py-12 header-bar">
|
||||
<view class="flex-shrink-0 mr-5">
|
||||
<group-avatar
|
||||
:size="120"
|
||||
:avatarList="currentTeam ? currentTeam.avatarList : []"
|
||||
/>
|
||||
<group-avatar :size="120" :avatarList="currentTeam ? currentTeam.avatarList : []" />
|
||||
</view>
|
||||
<view class="w-0 flex-grow">
|
||||
<view class="flex items-center mb-10">
|
||||
<view class="team-name flex-shrink-0">{{ team.name }}</view>
|
||||
<view
|
||||
v-if="teams.length > 1"
|
||||
class="flex-shrink-0 flex items-center switch-btn ml-10"
|
||||
@click="showDropDown = true"
|
||||
>
|
||||
<image
|
||||
class="switch-icon"
|
||||
src="/static/home/switch-team.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<view v-if="teams.length > 1" class="flex-shrink-0 flex items-center switch-btn ml-10"
|
||||
@click="showDropDown = true">
|
||||
<image class="switch-icon" src="/static/home/switch-team.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="currentTeam" class="text-base text-white truncate">{{
|
||||
currentTeam.corpName
|
||||
}}</view>
|
||||
<view v-if="currentTeam" class="text-base text-white truncate">
|
||||
{{ currentTeam.corpName }}
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="menuButtonInfo && menuButtonInfo.width > 0"
|
||||
class="flex-shrink-0"
|
||||
:style="{
|
||||
width: menuButtonInfo.width + 'px',
|
||||
height: menuButtonInfo.height + 'px',
|
||||
}"
|
||||
>
|
||||
<view v-if="menuButtonInfo && menuButtonInfo.width > 0" class="flex-shrink-0" :style="{
|
||||
width: menuButtonInfo.width + 'px',
|
||||
height: menuButtonInfo.height + 'px',
|
||||
}">
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative">
|
||||
<view v-if="showDropDown" class="team-dropdown py-12 bg-white shadow-lg">
|
||||
<scroll-view scroll-y="true" style="max-height: 50vh">
|
||||
<view class="px-15">
|
||||
<view
|
||||
v-for="item in teams"
|
||||
:key="item.teamId"
|
||||
class="mb-10 p-10 flex items-center bg-gray rounded-sm"
|
||||
@click="select(item)"
|
||||
>
|
||||
<view v-for="item in teams" :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">
|
||||
<group-avatar :size="96" :avatarList="item.avatarList" />
|
||||
</view>
|
||||
<view class="w-0 flex-grow mr-5">
|
||||
<view class="mb-5 text-lg font-semibold text-dark">{{
|
||||
item.name
|
||||
}}</view>
|
||||
<view class="text-base text-gray leading-normal">{{
|
||||
item.corpName
|
||||
}}</view>
|
||||
<view class="mb-5 text-lg font-semibold text-dark">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view class="text-base text-gray leading-normal">
|
||||
{{ item.corpName }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image
|
||||
class="check-icon"
|
||||
:src="
|
||||
team && team.teamId === item.teamId
|
||||
? '/static/form/checked.svg'
|
||||
: '/static/form/unchecked.svg'
|
||||
"
|
||||
>
|
||||
<image class="check-icon" :src="team && team.teamId === item.teamId
|
||||
? '/static/form/checked.svg'
|
||||
: '/static/form/uncheck.svg'
|
||||
">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
@ -74,20 +52,16 @@
|
||||
</scroll-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="triangle-wrapper">
|
||||
<view class="team-triangle"></view>
|
||||
</view>
|
||||
<image
|
||||
class="laba-icon flex-shrink-0"
|
||||
src="/static/home/speaker-intro.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<view class="introduce-text flex-grow line-clamp-2">{{
|
||||
team.teamTroduce
|
||||
}}</view>
|
||||
<image class="laba-icon flex-shrink-0" src="/static/home/speaker-intro.png" mode="aspectFit"></image>
|
||||
<view class="introduce-text flex-grow line-clamp-2">
|
||||
{{ qrcode.guide }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -117,6 +91,10 @@ const props = defineProps({
|
||||
const currentTeam = computed(() =>
|
||||
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) {
|
||||
emits("changeTeam", team);
|
||||
@ -195,11 +173,9 @@ onMounted(() => {
|
||||
width: 690rpx;
|
||||
min-height: 111rpx;
|
||||
box-sizing: border-box;
|
||||
background: linear-gradient(
|
||||
186deg,
|
||||
rgba(255, 255, 255, 0.4) 13.34%,
|
||||
rgba(255, 255, 255, 0.6) 99.17%
|
||||
);
|
||||
background: linear-gradient(186deg,
|
||||
rgba(255, 255, 255, 0.4) 13.34%,
|
||||
rgba(255, 255, 255, 0.6) 99.17%);
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 20rpx 20rpx 0;
|
||||
position: relative;
|
||||
@ -223,11 +199,9 @@ onMounted(() => {
|
||||
bottom: -10rpx;
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
background: linear-gradient(
|
||||
186deg,
|
||||
rgba(255, 255, 255, 0.4) 13.34%,
|
||||
rgba(255, 255, 255, 0.6) 99.17%
|
||||
);
|
||||
background: linear-gradient(186deg,
|
||||
rgba(255, 255, 255, 0.4) 13.34%,
|
||||
rgba(255, 255, 255, 0.6) 99.17%);
|
||||
transform: translateX(-50%) rotate(45deg);
|
||||
}
|
||||
|
||||
|
||||
@ -63,6 +63,8 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useAccount from "@/store/account";
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import useJob from '@/hooks/useJob';
|
||||
import api from '@/utils/api';
|
||||
@ -75,6 +77,7 @@ const qrcode = ref('')
|
||||
const member = ref(null);
|
||||
const expand = ref(false);
|
||||
const { memberJob, memberList } = useJob();
|
||||
const { account } = storeToRefs(useAccount());
|
||||
|
||||
const corpNames = computed(() => {
|
||||
const corpNames = member.value && Array.isArray(member.value.corpNames) ? member.value.corpNames : [];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user