Merge remote-tracking branch 'origin/dev-wdb' into dev-hjf
20
App.vue
@ -154,6 +154,26 @@ uni-button[type="primary"]:not([disabled]):active {
|
||||
background: rgb(248 113 113);
|
||||
}
|
||||
|
||||
.bg-light-text-color {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.bg-light-text-color::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0.2;
|
||||
background: currentColor;
|
||||
}
|
||||
|
||||
.py-3 {
|
||||
padding-top: 6rpx;
|
||||
padding-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.py-5 {
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: 10rpx;
|
||||
|
||||
@ -36,4 +36,4 @@ export const statusClassNames = {
|
||||
processing: "text-danger",
|
||||
cancelled: "text-gray",
|
||||
expired: "text-gray",
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "ykt-wxapp",
|
||||
"appid" : "__UNI__06F5B0E",
|
||||
"appid" : "__UNI__705E300",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
@ -54,7 +54,8 @@
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
"usingComponents" : true,
|
||||
"lazyCodeLoading" : "requiredComponents"
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
|
||||
441
pages.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/message/message",
|
||||
"path": "pages/home/message-home",
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息"
|
||||
}
|
||||
@ -13,27 +13,15 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/common-phrases",
|
||||
"path": "pages/home/work-home",
|
||||
"style": {
|
||||
"navigationBarTitleText": "常用语"
|
||||
"navigationBarTitleText": "工作台"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/article-list",
|
||||
"path": "pages/home/case-home",
|
||||
"style": {
|
||||
"navigationBarTitleText": "宣教文章"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/article-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "宣教文章"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/survey-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "问卷列表"
|
||||
"navigationBarTitleText": "病例"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -42,127 +30,6 @@
|
||||
"navigationBarTitleText": "预览"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "聊天",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/search",
|
||||
"style": {
|
||||
"navigationBarTitleText": "搜索患者"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/group-manage",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分组管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/batch-transfer",
|
||||
"style": {
|
||||
"navigationBarTitleText": "转移客户给其他团队"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/batch-share",
|
||||
"style": {
|
||||
"navigationBarTitleText": "共享客户"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/patient-invite",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请患者"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/patient-create",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增患者"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/patient-inner-info",
|
||||
"style": {
|
||||
"navigationBarTitleText": "内部信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/archive-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "档案详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/archive-edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "档案编辑"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/visit-record-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "健康档案"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/visit-record-view",
|
||||
"style": {
|
||||
"navigationBarTitleText": "病历详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/medical-case-form",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加病历"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/service-record-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/followup-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "回访详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/new-followup",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增回访"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/new-followup-record",
|
||||
"style": {
|
||||
"navigationBarTitleText": "回访记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/plan-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "回访计划"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/plan-preview",
|
||||
"style": {
|
||||
"navigationBarTitleText": "回访计划详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/plan-execute",
|
||||
"style": {
|
||||
"navigationBarTitleText": "执行回访计划"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/library/diagnosis-list",
|
||||
"style": {
|
||||
@ -181,83 +48,239 @@
|
||||
"navigationBarTitleText": "阳性发现"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/work",
|
||||
"style": {
|
||||
"navigationBarTitleText": "工作台"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/case/case",
|
||||
"style": {
|
||||
"navigationBarTitleText": "病例"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/profile",
|
||||
"style": {
|
||||
"navigationBarTitleText": "完善个人信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/department-select",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择科室"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/verify/assistant",
|
||||
"style": {
|
||||
"navigationBarTitleText": "上传证照"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/verify/doctor",
|
||||
"style": {
|
||||
"navigationBarTitleText": "上传证照"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/login/login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "授权登录"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "pages/message",
|
||||
"pages": [
|
||||
{
|
||||
"path": "common-phrases",
|
||||
"style": {
|
||||
"navigationBarTitleText": "常用语"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "article-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "宣教文章"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "article-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "宣教文章"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "survey-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "问卷列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "聊天",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "pages/work/team/invite/invite-patient",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请患者"
|
||||
}
|
||||
"root": "pages/work",
|
||||
"pages": [
|
||||
{
|
||||
"path": "profile",
|
||||
"style": {
|
||||
"navigationBarTitleText": "完善个人信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "department-select",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择科室"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "verify/assistant",
|
||||
"style": {
|
||||
"navigationBarTitleText": "上传证照"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "verify/doctor",
|
||||
"style": {
|
||||
"navigationBarTitleText": "上传证照"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "team/invite/invite-patient",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请患者"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "team/invite/invite-teammate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请成员"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "team/list/team-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的团队"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "team/edit/team-edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改团队信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "team/detail/team-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "团队信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "service/contact-service",
|
||||
"style": {
|
||||
"navigationBarTitleText": "联系企微客服"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "/todo/todo-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "待办详情"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "pages/work/team/invite/invite-teammate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请成员"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/team/list/team-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的团队"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/team/edit/team-edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改团队信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/team/detail/team-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "团队信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/service/contact-service",
|
||||
"style": {
|
||||
"navigationBarTitleText": "联系企微客服"
|
||||
}
|
||||
"root": "pages/case",
|
||||
"pages": [
|
||||
{
|
||||
"path": "search",
|
||||
"style": {
|
||||
"navigationBarTitleText": "搜索患者"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "group-manage",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分组管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "batch-transfer",
|
||||
"style": {
|
||||
"navigationBarTitleText": "转移客户给其他团队"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "batch-share",
|
||||
"style": {
|
||||
"navigationBarTitleText": "共享客户"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "patient-invite",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请患者"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "patient-create",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增患者"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "patient-inner-info",
|
||||
"style": {
|
||||
"navigationBarTitleText": "内部信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "archive-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "档案详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "archive-edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "档案编辑"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "visit-record-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "健康档案"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "visit-record-view",
|
||||
"style": {
|
||||
"navigationBarTitleText": "病历详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "medical-case-form",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加病历"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "service-record-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "followup-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "回访详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "new-followup",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增回访"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "new-followup-record",
|
||||
"style": {
|
||||
"navigationBarTitleText": "回访记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "plan-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "回访计划"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "plan-preview",
|
||||
"style": {
|
||||
"navigationBarTitleText": "回访计划详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "plan-execute",
|
||||
"style": {
|
||||
"navigationBarTitleText": "执行回访计划"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
@ -273,19 +296,19 @@
|
||||
"borderStyle": "white",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/message/message",
|
||||
"pagePath": "pages/home/message-home",
|
||||
"iconPath": "static/tabbar/home.png",
|
||||
"selectedIconPath": "static/tabbar/home_selected.png",
|
||||
"text": "消息"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/case/case",
|
||||
"pagePath": "pages/home/case-home",
|
||||
"iconPath": "static/tabbar/cart.png",
|
||||
"selectedIconPath": "static/tabbar/cart_selected.png",
|
||||
"text": "病例"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/work/work",
|
||||
"pagePath": "pages/home/work-home",
|
||||
"iconPath": "static/tabbar/center.png",
|
||||
"selectedIconPath": "static/tabbar/center_selected.png",
|
||||
"text": "工作台"
|
||||
|
||||
@ -222,9 +222,9 @@ import { onLoad, onPullDownRefresh, onReachBottom, onReady, onShow } from '@dclo
|
||||
import { storeToRefs } from 'pinia';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import HealthProfileTab from '@/components/archive-detail/health-profile-tab.vue';
|
||||
import ServiceInfoTab from '@/components/archive-detail/service-info-tab.vue';
|
||||
import FollowUpManageTab from '@/components/archive-detail/follow-up-manage-tab.vue';
|
||||
import HealthProfileTab from './components/archive-detail/health-profile-tab.vue';
|
||||
import ServiceInfoTab from './components/archive-detail/service-info-tab.vue';
|
||||
import FollowUpManageTab from './components/archive-detail/follow-up-manage-tab.vue';
|
||||
import api from '@/utils/api';
|
||||
import useAccountStore from '@/store/account';
|
||||
import { hideLoading, loading, toast } from '@/utils/widget';
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
import { ref } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import CustomerProfileTab from '@/components/archive-detail/customer-profile-tab.vue';
|
||||
import CustomerProfileTab from './components/archive-detail/customer-profile-tab.vue';
|
||||
import api from '@/utils/api';
|
||||
import useAccountStore from '@/store/account';
|
||||
import { hideLoading, loading, toast } from '@/utils/widget';
|
||||
|
||||
@ -76,7 +76,7 @@ import dayjs from 'dayjs';
|
||||
import api from '@/utils/api';
|
||||
import useAccountStore from '@/store/account';
|
||||
import { toast } from '@/utils/widget';
|
||||
import planNodeList from '@/components/manage-plan/plan-node-list.vue';
|
||||
import planNodeList from './components/manage-plan/plan-node-list.vue';
|
||||
|
||||
const archiveId = ref('');
|
||||
const plan = ref({});
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import planNodeList from '@/components/manage-plan/plan-node-list.vue';
|
||||
import planNodeList from './components/manage-plan/plan-node-list.vue';
|
||||
|
||||
const plan = ref({});
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ import { onLoad } from '@dcloudio/uni-app';
|
||||
import dayjs from 'dayjs';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import FormTemplate from '@/components/form-template/index.vue';
|
||||
import { getVisitRecordTemplate } from '@/components/archive-detail/templates';
|
||||
import { getVisitRecordTemplate } from './components/archive-detail/templates';
|
||||
import api from '@/utils/api';
|
||||
import useAccountStore from '@/store/account';
|
||||
import { toast, confirm, loading as uniLoading, hideLoading } from '@/utils/widget';
|
||||
|
||||
@ -54,7 +54,7 @@ import { onLoad } from '@dcloudio/uni-app';
|
||||
import dayjs from 'dayjs';
|
||||
import api from '@/utils/api';
|
||||
import { loading, hideLoading, toast } from '@/utils/widget';
|
||||
import { getVisitRecordTemplate } from '@/components/archive-detail/templates';
|
||||
import { getVisitRecordTemplate } from './components/archive-detail/templates';
|
||||
|
||||
const archiveId = ref('');
|
||||
const id = ref('');
|
||||
|
||||
1115
pages/home/case-home.vue
Normal file
696
pages/home/message-home.vue
Normal file
@ -0,0 +1,696 @@
|
||||
<template>
|
||||
<view class="message-page">
|
||||
<!-- 头部组件 -->
|
||||
<message-header v-model:activeTab="activeTab" @team-change="handleTeamChange" @add-patient="handleAddPatient" />
|
||||
|
||||
<!-- 消息列表 -->
|
||||
<scroll-view class="message-list" scroll-y="true" refresher-enabled :refresher-triggered="refreshing"
|
||||
@refresherrefresh="handleRefresh" @scrolltolower="handleLoadMore">
|
||||
<!-- 消息列表项 -->
|
||||
<view v-for="conversation in filteredConversationList"
|
||||
:key="conversation.groupID || conversation.conversationID" class="message-item"
|
||||
@click="handleClickConversation(conversation)">
|
||||
<view class="avatar-container">
|
||||
<image class="avatar" :src="conversation.avatar || '/static/default-avatar.png'"
|
||||
mode="aspectFill" />
|
||||
<view v-if="conversation.unreadCount > 0" class="unread-badge">
|
||||
<text class="unread-text">{{
|
||||
conversation.unreadCount > 99 ? "99+" : conversation.unreadCount
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content">
|
||||
<view class="header">
|
||||
<view class="name-info">
|
||||
<text class="name">{{ formatPatientName(conversation) }}</text>
|
||||
<text v-if="conversation.patientSex || conversation.patientAge" class="patient-info">
|
||||
{{ formatPatientInfo(conversation) }}
|
||||
</text>
|
||||
</view>
|
||||
<text class="time">{{
|
||||
formatMessageTime(conversation.lastMessageTime)
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="message-preview">
|
||||
<text class="preview-text">{{
|
||||
conversation.lastMessage || "暂无消息"
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-if="!loading && filteredConversationList.length === 0" class="empty-container">
|
||||
<image class="empty-image" src="/static/empty.svg" mode="aspectFit" />
|
||||
<text class="empty-text">{{
|
||||
activeTab === "processing" ? "暂无处理中的会话" : "暂无已结束的会话"
|
||||
}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 加载更多 -->
|
||||
<view v-if="hasMore && filteredConversationList.length > 0" class="load-more">
|
||||
<text class="load-more-text">{{
|
||||
loadingMore ? "加载中..." : "上拉加载更多"
|
||||
}}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
computed
|
||||
} from "vue";
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onHide
|
||||
} from "@dcloudio/uni-app";
|
||||
import {
|
||||
storeToRefs
|
||||
} from "pinia";
|
||||
import useAccountStore from "@/store/account.js";
|
||||
import useTeamStore from "@/store/team.js";
|
||||
import useInfoCheck from "@/hooks/useInfoCheck.js";
|
||||
import {
|
||||
globalTimChatManager
|
||||
} from "@/utils/tim-chat.js";
|
||||
import {
|
||||
mergeConversationWithGroupDetails
|
||||
} from "@/utils/conversation-merger.js";
|
||||
import MessageHeader from "./components/message-header.vue";
|
||||
|
||||
// 获取登录状态
|
||||
const {
|
||||
account,
|
||||
openid,
|
||||
isIMInitialized
|
||||
} = storeToRefs(useAccountStore());
|
||||
const {
|
||||
initIMAfterLogin
|
||||
} = useAccountStore();
|
||||
|
||||
// 获取团队信息
|
||||
const teamStore = useTeamStore();
|
||||
const {
|
||||
getTeams
|
||||
} = teamStore;
|
||||
|
||||
// 信息完善检查
|
||||
const {
|
||||
withInfo
|
||||
} = useInfoCheck();
|
||||
|
||||
// 团队相关状态
|
||||
const currentTeamId = ref(""); // 空字符串表示"全部会话消息"
|
||||
|
||||
// 状态
|
||||
const conversationList = ref([]);
|
||||
const loading = ref(false);
|
||||
const loadingMore = ref(false);
|
||||
const hasMore = ref(false);
|
||||
const refreshing = ref(false);
|
||||
const activeTab = ref("processing");
|
||||
|
||||
// 根据 orderStatus 过滤会话列表
|
||||
const filteredConversationList = computed(() => {
|
||||
let filtered = [];
|
||||
|
||||
if (activeTab.value === "processing") {
|
||||
// 处理中:pending(待处理) 和 processing(处理中)
|
||||
filtered = conversationList.value.filter(
|
||||
(conv) =>
|
||||
conv.orderStatus === "pending" || conv.orderStatus === "processing"
|
||||
);
|
||||
} else {
|
||||
// 已结束:cancelled(已取消)、completed(已完成)、finished(已结束)
|
||||
filtered = conversationList.value.filter(
|
||||
(conv) =>
|
||||
conv.orderStatus === "cancelled" ||
|
||||
conv.orderStatus === "completed" ||
|
||||
conv.orderStatus === "finished"
|
||||
);
|
||||
}
|
||||
|
||||
// 如果选择了团队,进一步过滤
|
||||
if (currentTeamId.value) {
|
||||
filtered = filtered.filter((conv) => conv.teamId === currentTeamId.value);
|
||||
}
|
||||
return filtered;
|
||||
});
|
||||
|
||||
// 处理团队切换
|
||||
const handleTeamChange = (teamId) => {
|
||||
currentTeamId.value = teamId;
|
||||
console.log("切换到团队ID:", teamId);
|
||||
};
|
||||
|
||||
// 邀请患者 - 使用 withInfo 包装,确保信息完善后才能使用
|
||||
const handleAddPatient = withInfo(() => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/work/team/invite/invite-patient",
|
||||
});
|
||||
});
|
||||
|
||||
// 初始化IM
|
||||
const initIM = async () => {
|
||||
if (!isIMInitialized.value) {
|
||||
uni.showLoading({
|
||||
title: "连接中...",
|
||||
});
|
||||
const success = await initIMAfterLogin();
|
||||
uni.hideLoading();
|
||||
|
||||
if (!success) {
|
||||
uni.showToast({
|
||||
title: "IM连接失败,请重试",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
} else if (globalTimChatManager && !globalTimChatManager.isLoggedIn) {
|
||||
uni.showLoading({
|
||||
title: "重连中...",
|
||||
});
|
||||
const reconnected = await globalTimChatManager.ensureIMConnection();
|
||||
uni.hideLoading();
|
||||
|
||||
if (!reconnected) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// 加载会话列表
|
||||
const loadConversationList = async () => {
|
||||
if (loading.value) return;
|
||||
loading.value = true;
|
||||
try {
|
||||
console.log("开始加载群聊列表");
|
||||
if (!globalTimChatManager || !globalTimChatManager.getGroupList) {
|
||||
throw new Error("IM管理器未初始化");
|
||||
}
|
||||
const result = await globalTimChatManager.getGroupList();
|
||||
if (result && result.success && result.groupList) {
|
||||
// 合并后端群组详细信息(已包含格式化和排序)
|
||||
conversationList.value = await mergeConversationWithGroupDetails(
|
||||
result.groupList
|
||||
);
|
||||
|
||||
console.log("=== 会话列表加载完成 ===");
|
||||
console.log("总会话数:", conversationList.value.length);
|
||||
// 打印前3个会话的 orderStatus
|
||||
conversationList.value.slice(0, 3).forEach((conv, index) => {
|
||||
console.log(
|
||||
`会话 ${index} - orderStatus: ${conv.orderStatus}, 名称: ${conv.name}`
|
||||
);
|
||||
});
|
||||
|
||||
console.log(
|
||||
"群聊列表加载成功,共",
|
||||
conversationList.value.length,
|
||||
"个会话"
|
||||
);
|
||||
} else {
|
||||
console.error("加载群聊列表失败:", result);
|
||||
uni.showToast({
|
||||
title: "加载失败,请重试",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("加载会话列表失败:", error);
|
||||
uni.showToast({
|
||||
title: error.message || "加载失败,请重试",
|
||||
icon: "none",
|
||||
});
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 防抖更新定时器
|
||||
let updateTimer = null;
|
||||
|
||||
// 设置会话列表监听,实时更新列表
|
||||
const setupConversationListener = () => {
|
||||
if (!globalTimChatManager) return;
|
||||
|
||||
// 监听会话列表更新事件
|
||||
globalTimChatManager.setCallback("onConversationListUpdated", (eventData) => {
|
||||
console.log("会话列表更新事件:", eventData);
|
||||
|
||||
// 处理单个会话更新(标记已读的情况)
|
||||
if (eventData && !Array.isArray(eventData) && eventData.conversationID) {
|
||||
const conversationID = eventData.conversationID;
|
||||
const existingIndex = conversationList.value.findIndex(
|
||||
(conv) => conv.conversationID === conversationID
|
||||
);
|
||||
|
||||
if (existingIndex !== -1) {
|
||||
// 直接更新未读数,避免触发整个对象的响应式更新
|
||||
if (eventData.unreadCount !== undefined) {
|
||||
conversationList.value[existingIndex].unreadCount =
|
||||
eventData.unreadCount;
|
||||
console.log(
|
||||
`已清空会话未读数: ${conversationList.value[existingIndex].name}, unreadCount: ${eventData.unreadCount}`
|
||||
);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!eventData || !Array.isArray(eventData)) {
|
||||
console.warn("会话列表更新事件数据格式错误");
|
||||
return;
|
||||
}
|
||||
|
||||
// 防抖处理:避免频繁更新导致闪动
|
||||
if (updateTimer) {
|
||||
clearTimeout(updateTimer);
|
||||
}
|
||||
|
||||
updateTimer = setTimeout(async () => {
|
||||
// 过滤出群聊会话
|
||||
const groupConversations = eventData.filter(
|
||||
(conv) => conv.conversationID && conv.conversationID.startsWith("GROUP")
|
||||
);
|
||||
|
||||
console.log(`收到 ${groupConversations.length} 个群聊会话更新`);
|
||||
|
||||
// 使用 TimChatManager 的格式化方法转换为标准格式
|
||||
const formattedConversations = groupConversations.map((conv) =>
|
||||
globalTimChatManager.formatConversationData(conv)
|
||||
);
|
||||
|
||||
// 合并后端群组详细信息(已包含格式化和排序)
|
||||
const mergedConversations = await mergeConversationWithGroupDetails(
|
||||
formattedConversations
|
||||
);
|
||||
|
||||
if (!mergedConversations || mergedConversations.length === 0) {
|
||||
console.log("合并后的会话数据为空,跳过更新");
|
||||
return;
|
||||
}
|
||||
let needSort = false;
|
||||
// 更新会话列表
|
||||
mergedConversations.forEach((conversationData) => {
|
||||
const conversationID = conversationData.conversationID;
|
||||
const existingIndex = conversationList.value.findIndex(
|
||||
(conv) => conv.conversationID === conversationID
|
||||
);
|
||||
|
||||
if (existingIndex !== -1) {
|
||||
const existing = conversationList.value[existingIndex];
|
||||
if (
|
||||
existing.lastMessage !== conversationData.lastMessage ||
|
||||
existing.lastMessageTime !== conversationData
|
||||
.lastMessageTime ||
|
||||
existing.unreadCount !== conversationData.unreadCount ||
|
||||
existing.patientName !== conversationData.patientName ||
|
||||
existing.patientSex !== conversationData.patientSex ||
|
||||
existing.patientAge !== conversationData.patientAge
|
||||
) {
|
||||
// 只更新变化的字段,保持头像和未读数稳定
|
||||
conversationList.value[existingIndex] = {
|
||||
...conversationData,
|
||||
// 保持原有头像,避免闪动
|
||||
avatar: existing.avatar || conversationData.avatar,
|
||||
// 保留较大的未读数(避免被后端数据覆盖)
|
||||
unreadCount: Math.max(
|
||||
existing.unreadCount || 0,
|
||||
conversationData.unreadCount || 0
|
||||
),
|
||||
};
|
||||
needSort = true;
|
||||
console.log(
|
||||
`已更新会话: ${conversationData.name}, unreadCount: ${conversationList.value[existingIndex].unreadCount}`
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// 添加新会话
|
||||
conversationList.value.push(conversationData);
|
||||
needSort = true;
|
||||
console.log(`已添加新会话: ${conversationData.name}`);
|
||||
}
|
||||
});
|
||||
|
||||
// 只在需要时才排序
|
||||
if (needSort) {
|
||||
conversationList.value.sort(
|
||||
(a, b) => b.lastMessageTime - a.lastMessageTime
|
||||
);
|
||||
}
|
||||
}, 100); // 100ms 防抖延迟
|
||||
});
|
||||
|
||||
// 监听消息接收事件(用于更新未读数)
|
||||
globalTimChatManager.setCallback("onMessageReceived", (message) => {
|
||||
console.log("消息列表页面收到新消息:", message);
|
||||
|
||||
// 找到对应的会话
|
||||
const conversationID = message.conversationID;
|
||||
const conversationIndex = conversationList.value.findIndex(
|
||||
(conv) => conv.conversationID === conversationID
|
||||
);
|
||||
|
||||
if (conversationIndex !== -1) {
|
||||
const conversation = conversationList.value[conversationIndex];
|
||||
|
||||
// 检查当前页面栈,判断用户是否正在查看该会话的聊天详情页
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
|
||||
// 获取当前页面的 groupID 参数(如果在聊天详情页)
|
||||
const currentGroupID = currentPage?.options?.groupID;
|
||||
const isViewingThisConversation =
|
||||
currentPage?.route === "pages/message/index" &&
|
||||
currentGroupID === conversation.groupID;
|
||||
|
||||
// 如果用户正在查看这个具体的会话,不增加未读数
|
||||
if (isViewingThisConversation) {
|
||||
console.log("用户正在查看该会话,不增加未读数");
|
||||
return;
|
||||
}
|
||||
|
||||
// 只在用户不在该会话的聊天页面时才增加未读数
|
||||
conversation.unreadCount = (conversation.unreadCount || 0) + 1;
|
||||
console.log(
|
||||
"已更新会话未读数:",
|
||||
conversation.name,
|
||||
"unreadCount:",
|
||||
conversation.unreadCount
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 格式化患者姓名
|
||||
const formatPatientName = (conversation) => {
|
||||
return conversation.patientName || "未知患者";
|
||||
};
|
||||
|
||||
// 格式化患者信息(性别 + 年龄)
|
||||
const formatPatientInfo = (conversation) => {
|
||||
const parts = [];
|
||||
|
||||
// 性别
|
||||
if (conversation.patientSex === "男") {
|
||||
parts.push("男");
|
||||
} else if (conversation.patientSex === "女") {
|
||||
parts.push("女");
|
||||
}
|
||||
|
||||
// 年龄
|
||||
if (conversation.patientAge) {
|
||||
parts.push(`${conversation.patientAge}岁`);
|
||||
}
|
||||
|
||||
return parts.join(" ");
|
||||
};
|
||||
|
||||
// 格式化消息时间
|
||||
const formatMessageTime = (timestamp) => {
|
||||
if (!timestamp) return "";
|
||||
|
||||
const now = Date.now();
|
||||
const diff = now - timestamp;
|
||||
const date = new Date(timestamp);
|
||||
|
||||
// 1分钟内
|
||||
if (diff < 60 * 1000) {
|
||||
return "刚刚";
|
||||
}
|
||||
|
||||
// 1小时内
|
||||
if (diff < 60 * 60 * 1000) {
|
||||
return `${Math.floor(diff / (60 * 1000))}分钟前`;
|
||||
}
|
||||
|
||||
// 今天
|
||||
const today = new Date();
|
||||
if (date.toDateString() === today.toDateString()) {
|
||||
return `${String(date.getHours()).padStart(2, "0")}:${String(
|
||||
date.getMinutes()
|
||||
).padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
// 昨天
|
||||
const yesterday = new Date(today);
|
||||
yesterday.setDate(yesterday.getDate() - 1);
|
||||
if (date.toDateString() === yesterday.toDateString()) {
|
||||
return "昨天";
|
||||
}
|
||||
|
||||
// 今年
|
||||
if (date.getFullYear() === today.getFullYear()) {
|
||||
return `${date.getMonth() + 1}月${date.getDate()}日`;
|
||||
}
|
||||
|
||||
// 其他
|
||||
return `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}日`;
|
||||
};
|
||||
|
||||
// 点击会话
|
||||
const handleClickConversation = (conversation) => {
|
||||
console.log("点击会话:", conversation);
|
||||
|
||||
// 立即清空本地未读数(优化用户体验)
|
||||
const conversationIndex = conversationList.value.findIndex(
|
||||
(conv) => conv.conversationID === conversation.conversationID
|
||||
);
|
||||
if (conversationIndex !== -1) {
|
||||
conversationList.value[conversationIndex].unreadCount = 0;
|
||||
console.log("已清空本地未读数:", conversation.name);
|
||||
}
|
||||
|
||||
// 跳转到聊天页面
|
||||
uni.navigateTo({
|
||||
url: `/pages/message/index?conversationID=${conversation.conversationID}&groupID=${conversation.groupID}`,
|
||||
});
|
||||
};
|
||||
|
||||
// 加载更多
|
||||
const handleLoadMore = () => {
|
||||
if (loadingMore.value || !hasMore.value) return;
|
||||
|
||||
loadingMore.value = true;
|
||||
// TODO: 实现分页加载
|
||||
setTimeout(() => {
|
||||
loadingMore.value = false;
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
// 下拉刷新
|
||||
const handleRefresh = async () => {
|
||||
refreshing.value = true;
|
||||
try {
|
||||
await loadConversationList();
|
||||
} finally {
|
||||
refreshing.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 页面加载
|
||||
onLoad(() => {
|
||||
console.log("消息列表页面加载");
|
||||
});
|
||||
|
||||
// 页面显示
|
||||
onShow(async () => {
|
||||
try {
|
||||
// 加载团队列表
|
||||
await getTeams();
|
||||
|
||||
// 初始化IM
|
||||
const imReady = await initIM();
|
||||
if (!imReady) {
|
||||
console.error("IM初始化失败");
|
||||
return;
|
||||
}
|
||||
|
||||
// 加载会话列表
|
||||
await loadConversationList();
|
||||
|
||||
// 设置监听器,后续通过事件更新列表
|
||||
setupConversationListener();
|
||||
} catch (error) {
|
||||
console.error("页面初始化失败:", error);
|
||||
uni.showToast({
|
||||
title: "初始化失败,请重试",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 页面隐藏
|
||||
onHide(() => {
|
||||
// 清除防抖定时器
|
||||
if (updateTimer) {
|
||||
clearTimeout(updateTimer);
|
||||
updateTimer = null;
|
||||
}
|
||||
|
||||
// 移除消息监听
|
||||
if (globalTimChatManager) {
|
||||
globalTimChatManager.setCallback("onConversationListUpdated", null);
|
||||
globalTimChatManager.setCallback("onMessageReceived", null);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.message-page {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.message-list {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.loading-container,
|
||||
.empty-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.empty-image {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.message-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 24rpx 32rpx;
|
||||
background-color: #fff;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
|
||||
&:active {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
}
|
||||
|
||||
.avatar-container {
|
||||
position: relative;
|
||||
margin-right: 24rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.unread-badge {
|
||||
position: absolute;
|
||||
top: -8rpx;
|
||||
right: -8rpx;
|
||||
min-width: 32rpx;
|
||||
height: 32rpx;
|
||||
padding: 0 8rpx;
|
||||
background-color: #ff4d4f;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.unread-text {
|
||||
font-size: 20rpx;
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.name-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 1;
|
||||
}
|
||||
|
||||
.patient-info {
|
||||
font-size: 26rpx;
|
||||
padding-left: 12rpx;
|
||||
color: #999;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-left: 16rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.message-preview {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.preview-text {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.load-more {
|
||||
padding: 20rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.load-more-text {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
384
pages/home/work-home.vue
Normal file
@ -0,0 +1,384 @@
|
||||
<template>
|
||||
<full-page :showSafeArea="false" :customScroll="true">
|
||||
<template #header>
|
||||
<view class="user-header bg-white px-15 py-15">
|
||||
<view class="flex items-center justify-between">
|
||||
<view class="flex items-center flex-grow">
|
||||
<view class="relative user-avatar mr-10" @click="editProfile()">
|
||||
<image v-if="doctorInfo && doctorInfo.avatar" class="avatar-img rounded-full overflow-hidden"
|
||||
:src="doctorInfo.avatar" mode="aspectFill" />
|
||||
<image v-else class="avatar-img rounded-full overflow-hidden" src="/static/home/avatar.svg"
|
||||
mode="aspectFill" />
|
||||
<view v-if="doctorInfo" class="edit-sub flex items-center justify-center rounded-full bg-primary">
|
||||
<image class="edit-icon" src="/static/work/pen.svg" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-col">
|
||||
<text v-if="doctorInfo && doctorInfo.anotherName" class="user-name text-dark text-lg font-semibold">
|
||||
{{ doctorInfo.anotherName }}
|
||||
</text>
|
||||
<text v-else class="user-name text-black text-lg font-semibold" @click="editProfile()">请完善信息</text>
|
||||
<view class="flex items-center mt-5">
|
||||
<view v-if="!doctorInfo || !doctorInfo.anotherName" class="status-tag tag-orange mr-10">
|
||||
<text class="tag-text text-white">信息待完善</text>
|
||||
</view>
|
||||
<view v-if="certStatus" class="px-10 py-3 text-sm rounded-full" :class="certStatus.classnames"
|
||||
@click.stop="handleCert()">
|
||||
{{ certStatus.text }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 右侧:操作按钮 -->
|
||||
<view class="flex items-center">
|
||||
<view class="action-btn flex-col items-center mr-10" @click="invitePatient()">
|
||||
<image class="mb-5 qrcode-icon" src="/static/work/qrcode.svg" />
|
||||
<text class="action-text text-dark text-sm">邀请</text>
|
||||
</view>
|
||||
<view class="action-btn flex-col items-center" @click="handleMore">
|
||||
<image class="mb-5 qrcode-icon" src="/static/work/more.svg" />
|
||||
<text class="action-text text-dark text-sm">更多</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-15 px-15 py-12 flex items-center justify-between bg-white">
|
||||
<view class="text-dark text-lg font-semibold">待办列表</view>
|
||||
<view class="flex text-base rounded-full bg-gray">
|
||||
<view class="py-5 px-15 rounded-full" :class="followUpType === 'person' ? 'bg-primary text-white' : ''"
|
||||
@click="changeFollowType('person')">
|
||||
个人
|
||||
</view>
|
||||
<view class="py-5 px-15 rounded-full" :class="followUpType === 'team' ? 'bg-primary text-white' : ''"
|
||||
@click="changeFollowType('team')">
|
||||
团队
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="py-10 px-15 flex items-center">
|
||||
<view class="flex-shrink-0 text-sm mr-10">
|
||||
<text class="text-dark">共</text>
|
||||
<text class="text-danger">{{ total }}</text>
|
||||
<text class="text-dark">条</text>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<view v-for="i in statusList" :key="i.value" class="mr-5 py-5 px-10 bg-white text-sm rounded-sm"
|
||||
:class="filterData.eventStatus == i.value ? 'text-primary' : 'text-dark'" @click="changeStatus(i.value)">
|
||||
{{ i.label }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-shrink-0 flex-grow flex justify-end" @click="filterVisible = !filterVisible">
|
||||
<image class="icon-filter" :src="`/static/work/icon-filter${filtered ? 'ed' : ''}.svg`" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<scroll-view v-if="list.length" scroll-y="true" class="h-full">
|
||||
<view v-for="i in list" :key="i._id" class="mb-10 shadow-lg bg-white">
|
||||
<view class="flex items-center justify-between px-15 py-10 border-b">
|
||||
<view class="text-base text-dark">计划执行: {{ i.planDate }}</view>
|
||||
<view class="flex items-center">
|
||||
<view class="text-base text-dark">患者: {{ i.customerName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="py-10 px-15 flex items-center">
|
||||
<view class="mr-5 text-lg font-semibold">{{ i.eventTypeLabel }}</view>
|
||||
<view class="bg-opacity px-10 py-3 leading-normal text-base rounded overflow-hidden"
|
||||
:class="statusClassNames[i.eventStatus] || 'text-gray'">
|
||||
{{ i.eventStatusLabel }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="i.sendContent" class="px-15 text-base leading-normal text-gray">{{ i.sendContent }}</view>
|
||||
<view v-if="i.enableSend && i.fileList.length" class="mt-10 px-15 flex items-center">
|
||||
<view class="mr-5 w-0 flex-grow">
|
||||
<view v-for="(file, idx) in i.fileList" :key="idx" class="truncate text-base leading-normal text-dark">
|
||||
发送内容:{{ file.file.name }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-primary px-10 py-3 text-base text-white rounded-sm">发送</view>
|
||||
</view>
|
||||
<view class="mt-10 px-15 text-base leading-normal text-gray truncate">
|
||||
{{ i.executorUserName }}({{ i.executeTeamName }})
|
||||
</view>
|
||||
<view class="px-15 pb-10 text-base leading-normal text-gray truncate">
|
||||
创建:{{ i.createTime }} {{ i.creatorUserName }}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view v-else class="flex flex-col items-center justify-center h-full bg-white">
|
||||
<empty-data text="暂无记录" />
|
||||
</view>
|
||||
<template #footer>
|
||||
<view class="border-b"></view>
|
||||
</template>
|
||||
</full-page>
|
||||
<cert-popup :visible="visible" @close="visible = false" />
|
||||
<filter-popup :data="filterData" :visible="filterVisible" @close="filterVisible = false"
|
||||
@confirm="changeFilterData($event)" />
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { storeToRefs } from "pinia";
|
||||
import { statusNames, ToDoEventType, statusClassNames } from '@/baseData';
|
||||
import useGuard from "@/hooks/useGuard.js";
|
||||
import useInfoCheck from '@/hooks/useInfoCheck';
|
||||
import usePageList from '@/hooks/usePageList';
|
||||
import useAccountStore from "@/store/account.js";
|
||||
import useTeamStore from "@/store/team.js";
|
||||
import api from '@/utils/api';
|
||||
import { toast } from '@/utils/widget';
|
||||
|
||||
import certPopup from "./components/cert-popup.vue";
|
||||
import filterPopup from './components/filter-popup.vue';
|
||||
import EmptyData from "@/components/empty-data.vue";
|
||||
import fullPage from '@/components/full-page.vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const certConfig = {
|
||||
failed: { text: '认证失败', classnames: 'bg-danger text-white' },
|
||||
verified: { text: '已认证', classnames: 'bg-success text-white' },
|
||||
verifying: { text: '认证中', classnames: 'bg-warning text-white' },
|
||||
unverified: { text: '未认证', classnames: 'bg-gray text-dark' },
|
||||
};
|
||||
|
||||
const statusList = [{ label: '全部', value: 'all' }, { label: '待处理', value: 'processing' }, { label: '未开始', value: 'notStart' }]
|
||||
const { useLoad, useShow } = useGuard();
|
||||
const { getDoctorInfo } = useAccountStore();
|
||||
const { account, doctorInfo } = storeToRefs(useAccountStore());
|
||||
const { chargeTeams } = storeToRefs(useTeamStore());
|
||||
const { getTeams } = useTeamStore();
|
||||
|
||||
const { withInfo } = useInfoCheck();
|
||||
const visible = ref(false);
|
||||
const filtered = ref(false);
|
||||
const filterVisible = ref(false);
|
||||
const filterData = ref({ eventStatus: 'processing' });
|
||||
const followUpType = ref('person') // person team
|
||||
const { total, list, page, pages, pageSize, changePage } = usePageList(getList)
|
||||
|
||||
const certStatus = computed(() => doctorInfo.value?.verifyStatus ? certConfig[doctorInfo.value.verifyStatus] : null)
|
||||
|
||||
// 邀请患者
|
||||
const invitePatient = withInfo(() => uni.navigateTo({ url: '/pages/work/team/invite/invite-patient' }));
|
||||
|
||||
const handleMore = withInfo(() => {
|
||||
uni.showActionSheet({
|
||||
itemList: ["我的团队", "联系客服"], //, "关于"
|
||||
success: (res) => {
|
||||
const url = res.tapIndex === 0 ? '/pages/work/team/list/team-list' : '/pages/work/service/contact-service';
|
||||
uni.navigateTo({ url });
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
function changeFilterData(data) {
|
||||
filterData.value = data;
|
||||
const case1 = Object.keys(data).filter(i => i != 'eventStatus').length > 0;
|
||||
const case2 = statusList.some(i => i.value === data.eventStatus);
|
||||
filtered.value = case1 || !case2;
|
||||
changePage(1);
|
||||
}
|
||||
|
||||
function changeFollowType(type) {
|
||||
if (followUpType.value === type) return;
|
||||
followUpType.value = type;
|
||||
changePage(1);
|
||||
}
|
||||
|
||||
function changeStatus(val) {
|
||||
if (filterData.value.eventStatus === val) return;
|
||||
filterData.value.eventStatus = val;
|
||||
changePage(1);
|
||||
}
|
||||
|
||||
function editProfile() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/work/profile",
|
||||
});
|
||||
}
|
||||
|
||||
function handleCert() {
|
||||
if (doctorInfo.value.verifyStatus === 'verifying') {
|
||||
toast('信息认证中,请耐心等待!')
|
||||
} else {
|
||||
visible.value = true
|
||||
}
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
if (!doctorInfo.value || !doctorInfo.value.userid) {
|
||||
return
|
||||
}
|
||||
const data = {
|
||||
corpId: account.value.corpId,
|
||||
startDate: filterData.value.startDate,
|
||||
endDate: filterData.value.endDate,
|
||||
page: page.value,
|
||||
pageSize: pageSize.value
|
||||
}
|
||||
if (followUpType.value === 'person') {
|
||||
data.executorUserId = doctorInfo.value.userid;
|
||||
} else {
|
||||
data.teamIds = chargeTeams.value.map(i => i.teamId);
|
||||
}
|
||||
if (filterData.value.eventStatus !== 'all') {
|
||||
data.statusList = [filterData.value.eventStatus]
|
||||
}
|
||||
if (filterData.value.eventType) {
|
||||
data.eventType = filterData.value.eventType;
|
||||
}
|
||||
const res = await api('getTeamTodos', data);
|
||||
const arr = res && Array.isArray(res.data) ? res.data.map(i => ({
|
||||
...i,
|
||||
eventTypeLabel: ToDoEventType[i.eventType],
|
||||
planDate: i.plannedExecutionTime && dayjs(i.plannedExecutionTime).isValid() ? dayjs(i.plannedExecutionTime).format("YYYY-MM-DD") : "",
|
||||
endTime: i.endTime && dayjs(i.endTime).isValid() ? dayjs(i.endTime).format("YYYY-MM-DD HH:mm") : "",
|
||||
createTime: i.createTime && dayjs(i.createTime).isValid() ? dayjs(i.createTime).format("YYYY-MM-DD HH:mm") : "",
|
||||
eventStatusLabel: statusNames[i.eventStatus],
|
||||
fileList: Array.isArray(i.fileList) ? i.fileList.filter(i => i && i.file && i.file.name) : []
|
||||
})) : [];
|
||||
list.value = page.value === 1 ? arr : [...list.value, ...arr];
|
||||
total.value = res && res.total > 0 ? res.total : 0;
|
||||
pages.value = res && res.pages > 0 ? res.pages : 0;
|
||||
if (!res && !res.success) {
|
||||
toast(res?.message || '查询待办失败')
|
||||
}
|
||||
}
|
||||
|
||||
useLoad(() => {
|
||||
console.log("工作台页面加载");
|
||||
});
|
||||
|
||||
useShow(async () => {
|
||||
console.log("工作台页面加!!!@@@载");
|
||||
await getDoctorInfo();
|
||||
changePage(1)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.edit-sub {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.edit-icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
.user-header {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.user-avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
|
||||
.avatar-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.user-name {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.py-3 {
|
||||
padding-top: 6rpx;
|
||||
padding-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 20rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
&.tag-orange {
|
||||
background: #ff6b35;
|
||||
border: 1px solid #fff;
|
||||
}
|
||||
|
||||
&.tag-gray {
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.tag-text {
|
||||
font-size: 22rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.qrcode-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.action-text {
|
||||
line-height: 1.2;
|
||||
}
|
||||
}
|
||||
|
||||
.more-btn {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.more-icon {
|
||||
font-size: 48rpx;
|
||||
color: #333;
|
||||
line-height: 1;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.todo-section {
|
||||
.section-title {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-filter {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.bg-opacity {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.bg-opacity::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0.2;
|
||||
background: currentColor;
|
||||
}
|
||||
|
||||
.py-3 {
|
||||
padding-top: 6rpx;
|
||||
padding-bottom: 6rpx;
|
||||
}
|
||||
</style>
|
||||
@ -80,7 +80,7 @@
|
||||
import {
|
||||
mergeConversationWithGroupDetails
|
||||
} from "@/utils/conversation-merger.js";
|
||||
import MessageHeader from "./components/message-header.vue";
|
||||
import MessageHeader from "../home/components/message-header.vue";
|
||||
|
||||
// 获取登录状态
|
||||
const {
|
||||
|
||||
313
pages/work/todo/todo-detail.vue
Normal file
@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<full-page v-if="todo" pageClass="bg-white">
|
||||
<view class="px-15 py-12 border-b">
|
||||
<view class="flex items-center">
|
||||
<view class="mr-5 text-lg text-dark font-semibold">{{ todo.eventTypeLabel }}</view>
|
||||
<view class="bg-light-text-color px-10 py-3 leading-normal text-base rounded overflow-hidden"
|
||||
:class="statusClassNames[todo.eventStatus] || 'text-gray'">
|
||||
{{ todo.eventStatusLabel }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!canEdit" class="mt-5 text-base text-gray break-all">
|
||||
{{ todo.taskContent || "暂无任务内容" }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="px-15 py-12 border-b">
|
||||
<view class="text-lg text-dark font-semibold">发送内容</view>
|
||||
<view class="mt-5 text-base text-gray break-all">
|
||||
{{ todo.sendContent }}
|
||||
</view>
|
||||
<view v-for="(file, idx) in todo.fileList" :key="idx" class="mt-5 text-base text-gray break-all">
|
||||
【附件】{{ file.file.name }}
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="canEdit">
|
||||
<picker mode="date" :value="formData.planDate" @change="changePlanDate($event)">
|
||||
<view class="flex items-center py-10 px-15 border-b">
|
||||
<view class="text-base text-gray">计划执行时间</view>
|
||||
<view class="flex-grow"></view>
|
||||
<view class="text-base text-dark">{{ formData.planDate }}</view>
|
||||
<view class="flex-shrink-0">
|
||||
<uni-icons type="right" size="16" color="#999999" />
|
||||
</view>
|
||||
</view>
|
||||
</picker>
|
||||
<picker mode="selector" :range="memberList" range-key="name" :value="formData.executorUserId"
|
||||
@change="changeExecutorUserId($event)">
|
||||
<view class="flex items-center py-10 px-15 border-b">
|
||||
<view class="text-base text-gray">执行人</view>
|
||||
<view class="flex-grow"></view>
|
||||
<view class="text-base text-dark">{{ memberMap[formData.executorUserId] || '' }}</view>
|
||||
<view class="flex-shrink-0">
|
||||
<uni-icons type="right" size="16" color="#999999" />
|
||||
</view>
|
||||
</view>
|
||||
</picker>
|
||||
<picker mode="selector" :range="eventTypeList" range-key="label" :value="formData.eventType"
|
||||
@change="changeEventType($event)">
|
||||
<view class="flex items-center py-10 px-15 border-b">
|
||||
<view class="text-base text-gray">回访类型</view>
|
||||
<view class="flex-grow"></view>
|
||||
<view class="text-base text-dark">{{ ToDoEventType[formData.eventType] || '' }}</view>
|
||||
<view class="flex-shrink-0">
|
||||
<uni-icons type="right" size="16" color="#999999" />
|
||||
</view>
|
||||
</view>
|
||||
</picker>
|
||||
<view class="px-15 py-12 border-b">
|
||||
<view class="text-lg text-dark font-semibold">任务内容</view>
|
||||
<view class="mt-5 p-10 border rounded">
|
||||
<textarea :value="formData.taskContent" class="w-full h-120 text-base text-dark" @input="changeTaskContent($event)" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- v-else -->
|
||||
<template v-else>
|
||||
<view class="flex items-center justify-between py-10 px-15 border-b">
|
||||
<view class="text-base text-gray">计划执行时间</view>
|
||||
<view class="text-base text-dark">{{ todo.planDate }}</view>
|
||||
</view>
|
||||
<view class="flex items-center justify-between py-10 px-15 border-b">
|
||||
<view class="text-base text-gray">执行人</view>
|
||||
<view class="text-base text-dark">{{ memberMap[todo.executorUserId] || '' }}</view>
|
||||
</view>
|
||||
<view class="px-15 py-12 border-b">
|
||||
<view class="text-lg text-dark font-semibold">回访结果</view>
|
||||
<view class="mt-5 p-10 border rounded">
|
||||
<textarea :value="formData.result" class="w-full h-120 text-base text-dark" @input="changeResult($event)" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="px-15 py-12 border-b">
|
||||
<view class="text-base text-gray">创建人:{{ todo.creatorUserId }}</view>
|
||||
<view class="text-base text-gray">创建时间:{{ todo.createTime }}</view>
|
||||
<view v-if="todo.endTime" class="text-base text-gray">执行时间:{{ todo.endTime }}</view>
|
||||
</view>
|
||||
<template #footer>
|
||||
<button-footer v-if="canEdit" confirmText="保存" :showCancel="false" @confirm="save()" />
|
||||
<button-footer v-else-if="editable" cancelText="取消任务" confirmText="设为完成" @cancel="cancelTask()"
|
||||
@confirm="completeTask()" />
|
||||
<button-footer v-else-if="canWriteResult" confirmText="保存" :showCancel="false" @confirm="saveResult()" />
|
||||
</template>
|
||||
</full-page>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import dayjs from "dayjs";
|
||||
import { statusNames, ToDoEventType, statusClassNames } from '@/baseData';
|
||||
import useGuard from "@/hooks/useGuard.js";
|
||||
import useAccountStore from "@/store/account.js";
|
||||
import api from "@/utils/api.js";
|
||||
import { confirm, toast } from "@/utils/widget";
|
||||
|
||||
import buttonFooter from '@/components/button-footer.vue';
|
||||
import fullPage from '@/components/full-page.vue';
|
||||
|
||||
const { useLoad } = useGuard();
|
||||
const { doctorInfo, account } = storeToRefs(useAccountStore());
|
||||
const todo = ref(null);
|
||||
const team = ref(null);
|
||||
const form = ref({});
|
||||
const isEditTodo = ref(false);
|
||||
const formData = computed(() => ({ ...(todo.value || {}), ...form.value }));
|
||||
|
||||
const teamManager = computed(() => {
|
||||
const memberLeaderList = team.value && Array.isArray(team.value.memberLeaderList) ? team.value.memberLeaderList : [];
|
||||
return doctorInfo.value && memberLeaderList.includes(doctorInfo.value.userid);
|
||||
})
|
||||
const hasPermission = computed(() => {
|
||||
const userid = doctorInfo.value && doctorInfo.value.userid;
|
||||
return userid && todo.value && (userid === todo.value.executorUserId || teamManager.value);
|
||||
})
|
||||
|
||||
const memberList = computed(() => {
|
||||
const memberList = team.value && Array.isArray(team.value.memberList) ? team.value.memberList : [];
|
||||
return memberList.map(i => ({ name: i.anotherName, value: i.userid }))
|
||||
})
|
||||
const memberMap = computed(() => memberList.value.reduce((m, item) => {
|
||||
m[item.value] = item.name;
|
||||
return m
|
||||
}, {}))
|
||||
|
||||
const canEdit = computed(() => isEditTodo.value && ['notStart', 'processing'].includes(todo.value?.eventStatus))
|
||||
|
||||
const canWriteResult = computed(() => {
|
||||
return hasPermission.value && 'treated' === todo.value?.eventStatus;
|
||||
})
|
||||
const editable = computed(() => {
|
||||
const statusRight = ['notStart', 'processing'].includes(todo.value?.eventStatus);
|
||||
return hasPermission.value && statusRight;
|
||||
})
|
||||
|
||||
const eventTypeList = computed(() => Object.keys(ToDoEventType).map((key) => ({ label: ToDoEventType[key], value: key })));
|
||||
|
||||
|
||||
function getVisitPlanStatus(row) {
|
||||
if (row.eventStatus === "untreated" && dayjs().isBefore(dayjs(row.plannedExecutionTime))) {
|
||||
return "notStart";
|
||||
} else if (row.eventStatus === "untreated" && dayjs().isAfter(dayjs(row.plannedExecutionTime)) && dayjs().isBefore(dayjs(row.expireTime))) {
|
||||
return "processing";
|
||||
} else if (row.eventStatus === "treated") {
|
||||
return "treated";
|
||||
} else if (row.eventStatus === "closed") {
|
||||
return "cancelled";
|
||||
} else if (row.eventStatus === "expired" || dayjs().isAfter(row.expireTime)) {
|
||||
return "expired";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function changePlanDate(e) {
|
||||
form.value.planDate = e.detail.value;
|
||||
}
|
||||
|
||||
function changeExecutorUserId(e) {
|
||||
const idx = e.detail.value;
|
||||
const user = memberList[idx];
|
||||
form.value.executorUserId = user.value;
|
||||
}
|
||||
|
||||
function changeEventType(e) {
|
||||
const idx = e.detail.value;
|
||||
const type = eventTypeList[idx];
|
||||
form.value.eventType = type.value;
|
||||
}
|
||||
|
||||
function changeTaskContent(e) {
|
||||
form.value.taskContent = e.detail.value;
|
||||
}
|
||||
|
||||
function changeResult(e) {
|
||||
form.value.result = e.detail.value;
|
||||
}
|
||||
|
||||
async function save() {
|
||||
if (!formData.value.eventType) {
|
||||
return toast('请选择回访类型');
|
||||
}
|
||||
if (!formData.value.planDate) {
|
||||
return toast("请选择执行时间");
|
||||
}
|
||||
if (!formData.value.executorUserId) {
|
||||
return toast("请选择处理人");
|
||||
}
|
||||
const taskParams = {
|
||||
eventType: formData.value.eventType,
|
||||
planExecutionTime: dayjs(formData.value.planDate).valueOf(),
|
||||
executorUserId: formData.value.executorUserId,
|
||||
executorTeamId: formData.value.executorTeamId || undefined,
|
||||
executeTeamName: formData.value.executeTeamName || undefined,
|
||||
taskContent: formData.value.taskContent || undefined,
|
||||
}
|
||||
const params = {
|
||||
id: todo.value._id,
|
||||
task: taskParams,
|
||||
corpId: account.value.corpId
|
||||
}
|
||||
const res = await api('updateTaskTodo', params);
|
||||
if (res && res.success) {
|
||||
await toast('保存成功');
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
toast(res?.message || '保存失败')
|
||||
}
|
||||
}
|
||||
|
||||
async function cancelTask() {
|
||||
await confirm('确定取消该回访任务吗');
|
||||
const res = await api('setTodoStatus', {
|
||||
id: todo.value._id,
|
||||
eventStatus: 'closed',
|
||||
result: formData.value.result || '已取消',
|
||||
userId: doctorInfo.value.userid,
|
||||
})
|
||||
if (res && res.success) {
|
||||
await toast('取消成功');
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
toast(res?.message || '取消失败')
|
||||
}
|
||||
}
|
||||
|
||||
async function completeTask() {
|
||||
await confirm('确定完成该回访任务吗');
|
||||
const res = await api('setTodoStatus', {
|
||||
id: todo.value._id,
|
||||
eventStatus: 'treated',
|
||||
result: formData.value.result || '已完成',
|
||||
userId: doctorInfo.value.userid,
|
||||
})
|
||||
if (res && res.success) {
|
||||
await toast('操作成功');
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
toast(res?.message || '操作失败')
|
||||
}
|
||||
}
|
||||
|
||||
async function saveResult() {
|
||||
if (typeof formData.value.result !== 'string' || formData.value.result.trim() === '') {
|
||||
return toast('请填写回访结果')
|
||||
}
|
||||
const res = await api('updateTaskTodoResult', {
|
||||
id: todo.value._id,
|
||||
result: formData.value.result.trim(),
|
||||
})
|
||||
if (res && res.success) {
|
||||
await toast('操作成功');
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
toast(res?.message || '操作失败')
|
||||
}
|
||||
}
|
||||
|
||||
async function getDetail(id) {
|
||||
const res = await api('getTodoById', { id, corpId: account.value.corpId });
|
||||
if (res && res.success) {
|
||||
const eventStatus = getVisitPlanStatus(res.data);
|
||||
todo.value = {
|
||||
...res.data,
|
||||
eventTypeLabel: ToDoEventType[res.data.eventType],
|
||||
planDate: res.data.plannedExecutionTime && dayjs(res.data.plannedExecutionTime).isValid() ? dayjs(res.data.plannedExecutionTime).format("YYYY-MM-DD") : "",
|
||||
endTime: res.data.endTime && dayjs(res.data.endTime).isValid() ? dayjs(res.data.endTime).format("YYYY-MM-DD HH:mm") : "",
|
||||
createTime: res.data.createTime && dayjs(res.data.createTime).isValid() ? dayjs(res.data.createTime).format("YYYY-MM-DD HH:mm") : "",
|
||||
eventStatus,
|
||||
eventStatusLabel: statusNames[eventStatus],
|
||||
fileList: Array.isArray(res.data.fileList) ? res.data.fileList.filter(i => i && i.file && i.file.name) : []
|
||||
};
|
||||
if (todo.value.executeTeamId) {
|
||||
getTeamDetail(todo.value.executeTeamId)
|
||||
}
|
||||
console.log(ToDoEventType, res.data.eventType, ToDoEventType[res.data.eventType])
|
||||
} else {
|
||||
toast(res?.message || '获取数据失败')
|
||||
}
|
||||
}
|
||||
|
||||
async function getTeamDetail(teamId) {
|
||||
const res = await api('getTeamData', { teamId, corpId: account.value.corpId });
|
||||
if (res && res.success) {
|
||||
team.value = res.data;
|
||||
} else {
|
||||
await toast(res.message || '获取团队信息失败')
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
|
||||
useLoad(opts => {
|
||||
console.clear()
|
||||
isEditTodo.value = opts.editMode === 'YES';
|
||||
getDetail(opts.id);
|
||||
})
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.mt-5 {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.h-120 {
|
||||
height: 240rpx;
|
||||
}
|
||||
</style>
|
||||
@ -76,16 +76,17 @@
|
||||
</template>
|
||||
|
||||
<scroll-view v-if="list.length" scroll-y="true" class="h-full">
|
||||
<view v-for="i in list" :key="i._id" class="mb-10 shadow-lg bg-white">
|
||||
<view v-for="i in list" :key="i._id" class="mb-10 shadow-lg bg-white" @click="toTodoDetail(i._id)">
|
||||
<view class="flex items-center justify-between px-15 py-10 border-b">
|
||||
<view class="text-base text-dark">计划执行: {{ i.planDate }}</view>
|
||||
<view class="flex items-center">
|
||||
<view class="text-base text-dark">患者: {{ i.customerName }}</view>
|
||||
<view class="flex items-center" @click.stop="toTodoDetail(i._id, true)">
|
||||
<view class="mr-5 text-base text-dark">患者: {{ i.customerName }}</view>
|
||||
<image class="icon-edit" src="/static/work/edit-pen.svg" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="py-10 px-15 flex items-center">
|
||||
<view class="mr-5 text-lg font-semibold">{{ i.eventTypeLabel }}</view>
|
||||
<view class="bg-opacity px-10 py-3 leading-normal text-base rounded overflow-hidden"
|
||||
<view class="bg-light-text-color px-10 py-3 leading-normal text-base rounded overflow-hidden"
|
||||
:class="statusClassNames[i.eventStatus] || 'text-gray'">
|
||||
{{ i.eventStatusLabel }}
|
||||
</view>
|
||||
@ -97,7 +98,8 @@
|
||||
发送内容:{{ file.file.name }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-primary px-10 py-3 text-base text-white rounded-sm">发送</view>
|
||||
<view v-if="doctorInfo && doctorInfo.userid && i.executorUserId && doctorInfo.userid === i.executorUserId"
|
||||
class="bg-primary px-10 py-3 text-base text-white rounded-sm">发送</view>
|
||||
</view>
|
||||
<view class="mt-10 px-15 text-base leading-normal text-gray truncate">
|
||||
{{ i.executorUserName }}({{ i.executeTeamName }})
|
||||
@ -133,8 +135,8 @@ import useTeamStore from "@/store/team.js";
|
||||
import api from '@/utils/api';
|
||||
import { toast } from '@/utils/widget';
|
||||
|
||||
import certPopup from "./components/cert-popup.vue";
|
||||
import filterPopup from './components/filter-popup.vue';
|
||||
import certPopup from "../home/components/cert-popup.vue";
|
||||
import filterPopup from '../home/components/filter-popup.vue';
|
||||
import EmptyData from "@/components/empty-data.vue";
|
||||
import fullPage from '@/components/full-page.vue';
|
||||
import dayjs from 'dayjs';
|
||||
@ -210,6 +212,12 @@ function handleCert() {
|
||||
}
|
||||
}
|
||||
|
||||
function toTodoDetail(id, editMode = false) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/work/todo/todo-detail?id=${id}&editMode=${editMode ? 'YES' : ''}`
|
||||
})
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
if (!doctorInfo.value || !doctorInfo.value.userid) {
|
||||
return
|
||||
@ -255,7 +263,6 @@ useLoad(() => {
|
||||
});
|
||||
|
||||
useShow(async () => {
|
||||
console.log("工作台页面加!!!@@@载");
|
||||
await getDoctorInfo();
|
||||
changePage(1)
|
||||
})
|
||||
@ -362,23 +369,8 @@ useShow(async () => {
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.bg-opacity {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.bg-opacity::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0.2;
|
||||
background: currentColor;
|
||||
}
|
||||
|
||||
.py-3 {
|
||||
padding-top: 6rpx;
|
||||
padding-bottom: 6rpx;
|
||||
.icon-edit {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
</style>
|
||||
@ -13,27 +13,27 @@ export default [
|
||||
},
|
||||
{
|
||||
path: 'pages/message/message',
|
||||
meta: { title: '消息', login: false }
|
||||
meta: { title: '消息', login: false }
|
||||
},
|
||||
{
|
||||
path: 'pages/message/common-phrases',
|
||||
meta: { title: '常用语', login: false }
|
||||
meta: { title: '常用语', login: false }
|
||||
},
|
||||
{
|
||||
path: 'pages/message/article-list',
|
||||
meta: { title: '宣教文章', login: false }
|
||||
meta: { title: '宣教文章', login: false }
|
||||
},
|
||||
{
|
||||
path: 'pages/message/article-detail',
|
||||
meta: { title: '宣教文章', login: false }
|
||||
meta: { title: '宣教文章', login: false }
|
||||
},
|
||||
{
|
||||
path: 'pages/message/survey-list',
|
||||
meta: { title: '问卷列表', login: false }
|
||||
meta: { title: '问卷列表', login: false }
|
||||
},
|
||||
{
|
||||
path: 'pages/webview/webview',
|
||||
meta: { title: '预览', login: false }
|
||||
meta: { title: '预览', login: false }
|
||||
},
|
||||
{
|
||||
path: 'pages/message/index',
|
||||
@ -46,7 +46,7 @@ export default [
|
||||
style: { enablePullDownRefresh: false },
|
||||
},
|
||||
{
|
||||
path: 'pages/case/case',
|
||||
path: 'pages/home/case-home',
|
||||
meta: { title: '病例', login: false },
|
||||
},
|
||||
{
|
||||
@ -134,13 +134,9 @@ export default [
|
||||
meta: { title: '阳性发现', login: false },
|
||||
},
|
||||
{
|
||||
path: 'pages/work/work',
|
||||
path: 'pages/home/work-home',
|
||||
meta: { title: '工作台' }
|
||||
},
|
||||
{
|
||||
path: 'pages/case/case',
|
||||
meta: { title: '病例' }
|
||||
},
|
||||
{
|
||||
path: 'pages/work/profile',
|
||||
meta: { title: '完善个人信息', login: true }
|
||||
@ -176,9 +172,13 @@ export default [
|
||||
{
|
||||
path: 'pages/work/team/detail/team-detail',
|
||||
meta: { title: '团队信息', login: true }
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'pages/work/service/contact-service',
|
||||
meta: { title: '联系企微客服' }
|
||||
},
|
||||
{
|
||||
path: 'pages/work/todo/todo-detail',
|
||||
meta: { title: '待办详情' }
|
||||
}
|
||||
]
|
||||
|
||||
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 218 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 208 KiB After Width: | Height: | Size: 50 KiB |
1
static/work/edit-pen.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1770024483535" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4801" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M958.171429 950.857143H62.902857a36.571429 36.571429 0 1 0 0 73.142857h895.268572a36.571429 36.571429 0 1 0 0-73.142857zM84.845714 917.211429h10.971429l292.571428-87.771429a34.377143 34.377143 0 0 0 15.36-9.508571L976.457143 249.417143a68.754286 68.754286 0 0 0 0-98.011429L844.068571 19.748571a73.142857 73.142857 0 0 0-99.474285 0L171.885714 585.142857a35.108571 35.108571 0 0 0-8.045714 11.702857L50.468571 866.011429a37.302857 37.302857 0 0 0 34.377143 51.2zM795.062857 73.142857l125.805714 125.074286L830.171429 288.914286 705.097143 163.108571zM228.205714 635.611429l424.96-419.84 126.537143 125.074285-422.765714 418.377143-206.994286 62.902857z" fill="#0074ff" p-id="4802"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 960 B After Width: | Height: | Size: 363 B |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 869 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 434 B |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 784 B |
@ -122,7 +122,8 @@ const urlsConfig = {
|
||||
// 客户流转记录
|
||||
customerTransferRecord: 'customerTransferRecord',
|
||||
// sendConsultRejectedMessage: "sendConsultRejectedMessage"
|
||||
getTeamTodos: 'getTeamTodos'
|
||||
getTeamTodos: 'getTeamTodos',
|
||||
updateTaskTodo:'updateTaskTodo'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||