feat: 增加管理计划模板库接口和收藏功能接口,优化回访计划页面布局及搜索功能
This commit is contained in:
parent
76c1203731
commit
58401626a6
@ -1158,7 +1158,7 @@ const saveAddGroup = async () => {
|
||||
}
|
||||
|
||||
.tabs-anchor {
|
||||
height: 1px;
|
||||
height: 2rpx;
|
||||
}
|
||||
|
||||
.tab {
|
||||
@ -1166,7 +1166,7 @@ const saveAddGroup = async () => {
|
||||
text-align: center;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 30rpx;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="fab" :style="{ bottom: `${floatingBottom}px` }" @click="add">
|
||||
<view class="fab" :style="{ bottom: `${floatingBottom * 2}rpx` }" @click="add">
|
||||
<uni-icons type="plusempty" size="24" color="#fff" />
|
||||
</view>
|
||||
|
||||
@ -1298,13 +1298,13 @@ watch(
|
||||
|
||||
<style scoped>
|
||||
.wrap {
|
||||
padding: 0 0 96px;
|
||||
padding: 0 0 192rpx;
|
||||
}
|
||||
|
||||
.top {
|
||||
background: #f5f6f8;
|
||||
padding: 10px 14px 8px;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
padding: 20rpx 28rpx 16rpx;
|
||||
border-bottom: 2rpx solid #f2f2f2;
|
||||
}
|
||||
.top-row {
|
||||
display: flex;
|
||||
@ -1316,17 +1316,17 @@ watch(
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.checkbox {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin-right: 6px;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.my-text {
|
||||
font-size: 13px;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.status-scroll {
|
||||
flex: 1;
|
||||
margin-left: 10px;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.status-tabs {
|
||||
display: flex;
|
||||
@ -1334,10 +1334,10 @@ watch(
|
||||
}
|
||||
.status-tab {
|
||||
flex-shrink: 0;
|
||||
padding: 8px 10px;
|
||||
font-size: 12px;
|
||||
border-radius: 6px;
|
||||
margin-right: 8px;
|
||||
padding: 16rpx 20rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-right: 16rpx;
|
||||
background: #eaecef;
|
||||
color: #333;
|
||||
}
|
||||
@ -1347,43 +1347,43 @@ watch(
|
||||
}
|
||||
.filter-btn {
|
||||
flex-shrink: 0;
|
||||
padding-left: 10px;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
.filter-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.total {
|
||||
margin-top: 6px;
|
||||
font-size: 12px;
|
||||
margin-top: 12rpx;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
}
|
||||
.total-num {
|
||||
color: #ff4d4f;
|
||||
margin: 0 4px;
|
||||
margin: 0 8rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
padding: 0 14px;
|
||||
padding: 0 28rpx;
|
||||
}
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
margin-top: 10px;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.head {
|
||||
padding: 12px 12px;
|
||||
padding: 24rpx 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
border-bottom: 2rpx solid #f2f2f2;
|
||||
}
|
||||
.date {
|
||||
font-size: 13px;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
margin-right: 10px;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.date-val {
|
||||
color: #333;
|
||||
@ -1391,7 +1391,7 @@ watch(
|
||||
.executor {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
font-size: 13px;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.truncate {
|
||||
@ -1400,7 +1400,7 @@ watch(
|
||||
white-space: nowrap;
|
||||
}
|
||||
.body {
|
||||
padding: 12px 12px;
|
||||
padding: 24rpx 24rpx;
|
||||
}
|
||||
.title-row {
|
||||
display: flex;
|
||||
@ -1408,14 +1408,14 @@ watch(
|
||||
justify-content: space-between;
|
||||
}
|
||||
.type {
|
||||
font-size: 15px;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #1f1f1f;
|
||||
}
|
||||
.status {
|
||||
font-size: 12px;
|
||||
padding: 6px 10px;
|
||||
border-radius: 6px;
|
||||
font-size: 26rpx;
|
||||
padding: 12rpx 20rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
.st-processing {
|
||||
background: #ffe5e5;
|
||||
@ -1435,28 +1435,28 @@ watch(
|
||||
color: #666;
|
||||
}
|
||||
.content {
|
||||
margin-top: 10px;
|
||||
font-size: 13px;
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
line-height: 18px;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.send-content-wrapper {
|
||||
margin-top: 10px;
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.send-content-section {
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
padding: 20rpx;
|
||||
background: #f9f9f9;
|
||||
border-radius: 6px;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.send-content-label {
|
||||
font-size: 13px;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
font-weight: 500;
|
||||
@ -1467,13 +1467,13 @@ watch(
|
||||
min-width: 0;
|
||||
}
|
||||
.send-text {
|
||||
font-size: 13px;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
line-height: 18px;
|
||||
line-height: 40rpx;
|
||||
word-break: break-word;
|
||||
}
|
||||
.file-list {
|
||||
margin-top: 6px;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.file-list.no-send-text {
|
||||
@ -1482,18 +1482,18 @@ watch(
|
||||
.file-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.file-item + .file-item {
|
||||
margin-top: 4px;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.file-icon {
|
||||
font-size: 14px;
|
||||
font-size: 28rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.file-name {
|
||||
font-size: 12px;
|
||||
font-size: 26rpx;
|
||||
color: #0877f1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@ -1511,47 +1511,47 @@ watch(
|
||||
color: #f59e0b;
|
||||
}
|
||||
.result {
|
||||
margin-top: 10px;
|
||||
font-size: 13px;
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
.footer-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 10px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid #f2f2f2;
|
||||
gap: 10px;
|
||||
margin-top: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
border-top: 2rpx solid #f2f2f2;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.footer {
|
||||
font-size: 12px;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
flex: 1;
|
||||
}
|
||||
.footer-row .send-btn {
|
||||
flex: 0 0 auto;
|
||||
width: 60px;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
width: 120rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid #f2f2f2;
|
||||
gap: 20rpx;
|
||||
margin-top: 24rpx;
|
||||
padding-top: 24rpx;
|
||||
border-top: 2rpx solid #f2f2f2;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
border-radius: 12rpx;
|
||||
font-size: 26rpx;
|
||||
border: none;
|
||||
background: #f5f6f8;
|
||||
color: #333;
|
||||
@ -1568,7 +1568,7 @@ watch(
|
||||
|
||||
.send-btn {
|
||||
flex: 0 0 auto;
|
||||
width: 60px;
|
||||
width: 120rpx;
|
||||
background: #0877f1;
|
||||
color: #fff;
|
||||
}
|
||||
@ -1582,47 +1582,47 @@ watch(
|
||||
}
|
||||
|
||||
.empty {
|
||||
padding: 120px 0;
|
||||
padding: 240rpx 0;
|
||||
text-align: center;
|
||||
color: #9aa0a6;
|
||||
font-size: 13px;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
|
||||
.fab {
|
||||
position: fixed;
|
||||
right: 16px;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border-radius: 26px;
|
||||
right: 32rpx;
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
border-radius: 52rpx;
|
||||
background: #0877f1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 10px 18px rgba(79, 110, 247, 0.35);
|
||||
box-shadow: 0 20rpx 36rpx rgba(79, 110, 247, 0.35);
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
.popup {
|
||||
background: #fff;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
border-top-left-radius: 20rpx;
|
||||
border-top-right-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-title {
|
||||
position: relative;
|
||||
padding: 14px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
padding: 28rpx;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
}
|
||||
.popup-title-text {
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
.popup-close {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
right: 24rpx;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
@ -1632,26 +1632,26 @@ watch(
|
||||
max-height: 70vh;
|
||||
}
|
||||
.section {
|
||||
padding: 14px;
|
||||
padding: 28rpx;
|
||||
}
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.chip-wrap {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.chip {
|
||||
width: 110px;
|
||||
width: 220rpx;
|
||||
text-align: center;
|
||||
padding: 8px 0;
|
||||
border: 1px solid #e6e6e6;
|
||||
border-radius: 8px;
|
||||
font-size: 12px;
|
||||
padding: 16rpx 0;
|
||||
border: 2rpx solid #e6e6e6;
|
||||
border-radius: 16rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
.chip.active {
|
||||
@ -1660,18 +1660,18 @@ watch(
|
||||
color: #fff;
|
||||
}
|
||||
.select-row {
|
||||
height: 40px;
|
||||
border: 1px solid #e6e6e6;
|
||||
border-radius: 8px;
|
||||
padding: 0 10px;
|
||||
height: 80rpx;
|
||||
border: 2rpx solid #e6e6e6;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.select-text {
|
||||
font-size: 12px;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
max-width: 250px;
|
||||
max-width: 500rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
@ -1682,16 +1682,16 @@ watch(
|
||||
.range-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.range-pill {
|
||||
width: 110px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
width: 220rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
border: 1px solid #e6e6e6;
|
||||
border-radius: 8px;
|
||||
font-size: 12px;
|
||||
border: 2rpx solid #e6e6e6;
|
||||
border-radius: 16rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
.range-pill.muted {
|
||||
@ -1701,19 +1701,19 @@ watch(
|
||||
color: #999;
|
||||
}
|
||||
.clear {
|
||||
padding: 6px;
|
||||
padding: 12rpx;
|
||||
}
|
||||
.actions {
|
||||
padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
|
||||
padding: 24rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
gap: 24rpx;
|
||||
}
|
||||
.btn {
|
||||
flex: 1;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
border-radius: 6px;
|
||||
font-size: 15px;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
border-radius: 12rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.btn::after {
|
||||
border: none;
|
||||
@ -1721,7 +1721,7 @@ watch(
|
||||
.btn.plain {
|
||||
background: #fff;
|
||||
color: #0877f1;
|
||||
border: 1px solid #0877f1;
|
||||
border: 2rpx solid #0877f1;
|
||||
}
|
||||
.btn.primary {
|
||||
background: #0877f1;
|
||||
|
||||
@ -1,28 +1,67 @@
|
||||
<template>
|
||||
<full-page :customScroll="list.length === 0" pageStyle="background:#fff">
|
||||
<view v-if="list.length === 0" class="h-full flex flex-col items-center justify-center">
|
||||
<view v-if="loading" class="text-base text-center text-dark">加载中...</view>
|
||||
<empty-data v-else text="暂无回访计划" />
|
||||
</view>
|
||||
<template v-else>
|
||||
<view v-for="(p, idx) in list" :key="p.id" class="item">
|
||||
<view class="left">
|
||||
<view class="name-row">
|
||||
<view class="name">{{ p.planName }}</view>
|
||||
<view v-if="p.planType === 'corp'" class="tag corp">机构</view>
|
||||
<view class="tag outline" @click.stop="preview(p)">详情</view>
|
||||
</view>
|
||||
<view class="desc">应用范围:{{ p.planDetail }}</view>
|
||||
</view>
|
||||
<view class="btn" @click="select(p)">选择</view>
|
||||
</view>
|
||||
<template>
|
||||
<full-page customScroll pageStyle="background:#f4f5f7">
|
||||
<template #header>
|
||||
<view class="search-bar">
|
||||
<input
|
||||
v-model="keyword"
|
||||
class="search-input"
|
||||
placeholder="搜索"
|
||||
confirm-type="search"
|
||||
@input="onSearchInput"
|
||||
@confirm="loadList"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view class="template-page">
|
||||
<scroll-view scroll-y class="category-panel">
|
||||
<view
|
||||
v-for="item in categoryList"
|
||||
:key="item.viewType"
|
||||
class="category-item"
|
||||
:class="{ active: activeViewType === item.viewType }"
|
||||
@click="changeCategory(item.viewType)"
|
||||
>
|
||||
<text class="category-text">{{ item.label }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="content-panel">
|
||||
<view v-if="loading" class="state-text">加载中...</view>
|
||||
<empty-data v-else-if="list.length === 0" fullCenter :text="emptyText" />
|
||||
<scroll-view v-else scroll-y class="list-scroll">
|
||||
<view v-for="p in list" :key="p.id" class="template-card">
|
||||
<view class="card-header">
|
||||
<view class="plan-name">{{ p.planName || '--' }}</view>
|
||||
<view
|
||||
v-if="canToggleFavorite(p)"
|
||||
class="favorite-btn"
|
||||
:class="{ collected: p.isFavorite }"
|
||||
@click.stop="toggleFavorite(p)"
|
||||
>
|
||||
<uni-icons
|
||||
class="favorite-icon"
|
||||
:type="p.isFavorite ? 'star-filled' : 'star'"
|
||||
size="18"
|
||||
:color="p.isFavorite ? '#1f5cff' : '#667085'"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="creator" v-if="getCreatorText(p)">{{ getCreatorText(p) }}</view>
|
||||
<view class="card-footer">
|
||||
<view class="task-link" @click.stop="preview(p)">任务详情 〉</view>
|
||||
<view class="select-btn" @click="select(p)">选择</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<template #footer>
|
||||
<view class="relative shadow-up bg-white">
|
||||
<view class="p-15 text-center" @click="toService()">
|
||||
<text class="mr-5 text-base text-gray">如没有符合的内容,请</text>
|
||||
<text class="text-base text-primary">联系客服</text>
|
||||
<view class="footer">
|
||||
<view class="service-entry" @click="toService">
|
||||
<text class="service-muted">如没有符合的内容,请</text>
|
||||
<text class="service-link">联系客服</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -38,20 +77,31 @@ import useAccountStore from '@/store/account';
|
||||
import { toast } from '@/utils/widget';
|
||||
import { getTodoEventTypeLabel } from '@/utils/todo-const';
|
||||
|
||||
import EmptyData from "@/components/empty-data.vue";
|
||||
import EmptyData from '@/components/empty-data.vue';
|
||||
import fullPage from '@/components/full-page.vue';
|
||||
|
||||
const archiveId = ref('');
|
||||
const loading = ref(false);
|
||||
|
||||
const keyword = ref('');
|
||||
const activeViewType = ref('my');
|
||||
const emptyText = ref('暂无回访计划');
|
||||
const list = ref([]);
|
||||
const categoryList = ref([
|
||||
{ label: '我的回访', viewType: 'my' },
|
||||
{ label: '团队回访', viewType: 'team' },
|
||||
{ label: '柚助手', viewType: 'doctorMiniapp' },
|
||||
]);
|
||||
|
||||
let searchTimer = null;
|
||||
|
||||
const accountStore = useAccountStore();
|
||||
const { account, doctorInfo } = storeToRefs(accountStore);
|
||||
const { getDoctorInfo } = accountStore;
|
||||
|
||||
onLoad((options) => {
|
||||
onLoad(async (options) => {
|
||||
archiveId.value = options?.archiveId ? String(options.archiveId) : '';
|
||||
await ensureDoctor();
|
||||
buildCategoryList();
|
||||
loadList();
|
||||
});
|
||||
|
||||
@ -78,15 +128,36 @@ function getCorpId() {
|
||||
return String(t.corpId || a.corpId || d.corpId || '') || '';
|
||||
}
|
||||
|
||||
function getTeamId() {
|
||||
const t = uni.getStorageSync('ykt_case_current_team') || {};
|
||||
return String(t.teamId || '') || '';
|
||||
function buildCategoryList() {
|
||||
const d = doctorInfo.value || {};
|
||||
const categories = [
|
||||
{ label: '我的回访', viewType: 'my' },
|
||||
{ label: '团队回访', viewType: 'team' },
|
||||
];
|
||||
if (d.hospitalId || d.hospitalName) {
|
||||
categories.push({
|
||||
label: String(d.hospitalName || '第一执业点'),
|
||||
viewType: 'firstHospital',
|
||||
});
|
||||
}
|
||||
if (d.secondPracticeHospitalId || d.secondPracticeHospitalName) {
|
||||
categories.push({
|
||||
label: String(d.secondPracticeHospitalName || '第二执业点'),
|
||||
viewType: 'secondHospital',
|
||||
});
|
||||
}
|
||||
categories.push({ label: '柚助手', viewType: 'doctorMiniapp' });
|
||||
categoryList.value = categories;
|
||||
if (!categories.some((item) => item.viewType === activeViewType.value)) {
|
||||
activeViewType.value = categories[0]?.viewType || 'my';
|
||||
}
|
||||
}
|
||||
|
||||
function normalizePlan(raw) {
|
||||
if (!raw || typeof raw !== 'object') return null;
|
||||
const id = String(raw.planId || raw._id || '');
|
||||
const id = String(raw._id || raw.planId || '');
|
||||
if (!id) return null;
|
||||
const planId = String(raw.planId || raw._id || '');
|
||||
const taskList = Array.isArray(raw.taskList) ? raw.taskList : [];
|
||||
const first = taskList[0] && typeof taskList[0] === 'object' ? taskList[0] : {};
|
||||
const eventType = String(first.eventType || '');
|
||||
@ -94,6 +165,10 @@ function normalizePlan(raw) {
|
||||
return {
|
||||
...raw,
|
||||
id,
|
||||
_id: String(raw._id || id),
|
||||
planId,
|
||||
sourceTemplateId: String(raw.sourceTemplateId || raw._id || id),
|
||||
sourceTemplatePlanId: String(raw.sourceTemplatePlanId || planId),
|
||||
planName: String(raw.planName || ''),
|
||||
planType: String(raw.planType || ''),
|
||||
planDetail: String(raw.planDetail || ''),
|
||||
@ -102,13 +177,16 @@ function normalizePlan(raw) {
|
||||
taskContent,
|
||||
taskCount: taskList.length,
|
||||
taskList,
|
||||
isFavorite: Boolean(raw.isFavorite),
|
||||
};
|
||||
}
|
||||
|
||||
function toService() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/work/service/contact-service'
|
||||
})
|
||||
function unwrapLibraryData(res) {
|
||||
const data = res?.data;
|
||||
if (data && typeof data === 'object' && data.data && typeof data.data === 'object') {
|
||||
return data.data;
|
||||
}
|
||||
return data && typeof data === 'object' ? data : {};
|
||||
}
|
||||
|
||||
async function loadList() {
|
||||
@ -116,19 +194,19 @@ async function loadList() {
|
||||
loading.value = true;
|
||||
try {
|
||||
await ensureDoctor();
|
||||
buildCategoryList();
|
||||
const corpId = getCorpId();
|
||||
const userId = getUserId();
|
||||
const teamId = getTeamId();
|
||||
if (!corpId || !userId || !teamId) {
|
||||
if (!corpId || !userId) {
|
||||
list.value = [];
|
||||
toast('缺少用户/团队信息');
|
||||
toast('缺少用户信息');
|
||||
return;
|
||||
}
|
||||
const res = await api('getManagementPlan', {
|
||||
const res = await api('getMyManagementPlanTemplateLibrary', {
|
||||
corpId,
|
||||
userId,
|
||||
planType: 'team',
|
||||
teamId,
|
||||
viewType: activeViewType.value,
|
||||
keyword: keyword.value.trim(),
|
||||
page: 1,
|
||||
pageSize: 999,
|
||||
});
|
||||
@ -137,13 +215,72 @@ async function loadList() {
|
||||
toast(res?.message || '获取回访计划失败');
|
||||
return;
|
||||
}
|
||||
const arr = Array.isArray(res.data) ? res.data : [];
|
||||
list.value = arr.filter((p) => p && p.planStatus === true).map(normalizePlan).filter(Boolean);
|
||||
const payload = unwrapLibraryData(res);
|
||||
const arr = Array.isArray(payload.list) ? payload.list : [];
|
||||
list.value = arr.map(normalizePlan).filter(Boolean);
|
||||
emptyText.value = payload.emptyState || '暂无回访计划';
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function changeCategory(viewType) {
|
||||
if (activeViewType.value === viewType) return;
|
||||
activeViewType.value = viewType;
|
||||
list.value = [];
|
||||
loadList();
|
||||
}
|
||||
|
||||
function onSearchInput() {
|
||||
if (searchTimer) clearTimeout(searchTimer);
|
||||
searchTimer = setTimeout(() => {
|
||||
loadList();
|
||||
}, 400);
|
||||
}
|
||||
|
||||
function canToggleFavorite(plan) {
|
||||
if (!plan || !plan._id) return false;
|
||||
if (activeViewType.value !== 'my') return true;
|
||||
return Boolean(plan.isFavorite);
|
||||
}
|
||||
|
||||
async function toggleFavorite(plan) {
|
||||
const corpId = getCorpId();
|
||||
const userId = getUserId();
|
||||
const managementPlanId = String(plan?._id || '');
|
||||
if (!corpId || !userId || !managementPlanId) return toast('缺少收藏信息');
|
||||
const res = await api('toggleMyFollowupFavorite', {
|
||||
corpId,
|
||||
userId,
|
||||
managementPlanId,
|
||||
});
|
||||
if (!res?.success) return toast(res?.message || '操作失败');
|
||||
toast(res.message || '操作成功');
|
||||
loadList();
|
||||
}
|
||||
|
||||
function getCreatorText(plan = {}) {
|
||||
const signature = plan.creatorSignature && typeof plan.creatorSignature === 'object'
|
||||
? plan.creatorSignature
|
||||
: null;
|
||||
if (signature?.type === 'institution') {
|
||||
return signature.institution?.name || '';
|
||||
}
|
||||
if (signature?.type === 'department') {
|
||||
return signature.department?.name || '';
|
||||
}
|
||||
if (signature?.type === 'personal') {
|
||||
return signature.person?.userName || '';
|
||||
}
|
||||
return String(plan.createorName || plan.creatorName || plan.teamName || plan.teanName || plan.createor || '');
|
||||
}
|
||||
|
||||
function toService() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/work/service/contact-service',
|
||||
});
|
||||
}
|
||||
|
||||
function select(plan) {
|
||||
uni.setStorageSync('select-mamagement-plan', plan);
|
||||
uni.navigateTo({ url: `/pages/case/plan-execute?archiveId=${encodeURIComponent(archiveId.value)}` });
|
||||
@ -156,97 +293,196 @@ function preview(plan) {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.scroll {
|
||||
height: 100vh;
|
||||
.search-bar {
|
||||
padding: 14rpx 18rpx 12rpx;
|
||||
background: #fff;
|
||||
border-bottom: 1rpx solid #edf0f2;
|
||||
}
|
||||
|
||||
.loading {
|
||||
padding: 16px;
|
||||
font-size: 13px;
|
||||
color: #9aa0a6;
|
||||
.search-input {
|
||||
height: 68rpx;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #f3f5f8;
|
||||
color: #111827;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.item {
|
||||
.template-page {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.category-panel {
|
||||
width: 210rpx;
|
||||
height: 100%;
|
||||
flex-shrink: 0;
|
||||
background: #fbfcfe;
|
||||
border-right: 1rpx solid #edf0f2;
|
||||
}
|
||||
|
||||
.category-item {
|
||||
position: relative;
|
||||
min-height: 88rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 14px;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
margin: 8rpx 10rpx;
|
||||
padding: 14rpx 12rpx 14rpx 16rpx;
|
||||
border-radius: 12rpx;
|
||||
color: #374151;
|
||||
font-size: 30rpx;
|
||||
line-height: 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.left {
|
||||
.category-item.active {
|
||||
color: #1667e8;
|
||||
background: #eef5ff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.category-item.active::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 18rpx;
|
||||
bottom: 18rpx;
|
||||
width: 6rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #1667e8;
|
||||
}
|
||||
|
||||
.category-text {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.content-panel {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-right: 10px;
|
||||
height: 100%;
|
||||
background: #f5f6f8;
|
||||
}
|
||||
|
||||
.name-row {
|
||||
.list-scroll {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.state-text {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
max-width: 220px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tag {
|
||||
font-size: 12px;
|
||||
padding: 4px 8px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.tag.corp {
|
||||
background: #0877F1;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tag.outline {
|
||||
border: 1px solid #0877F1;
|
||||
color: #0877F1;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.desc {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.btn {
|
||||
flex-shrink: 0;
|
||||
padding: 8px 12px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid #0877F1;
|
||||
color: #0877F1;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.empty {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #6b7280;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.empty-img {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
opacity: 0.9;
|
||||
.template-card {
|
||||
position: relative;
|
||||
margin: 16rpx 16rpx 0;
|
||||
padding: 26rpx 24rpx 24rpx;
|
||||
border: 1rpx solid #eef1f4;
|
||||
border-radius: 14rpx;
|
||||
background: #fff;
|
||||
box-shadow: 0 4rpx 14rpx rgba(17, 24, 39, 0.04);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
margin-top: 10px;
|
||||
font-size: 13px;
|
||||
color: #9aa0a6;
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.plan-name {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
color: #111827;
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
line-height: 46rpx;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.favorite-btn {
|
||||
flex-shrink: 0;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.favorite-icon {
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.creator {
|
||||
margin-top: 12rpx;
|
||||
color: #6b7280;
|
||||
font-size: 30rpx;
|
||||
line-height: 40rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.task-link {
|
||||
display: inline-flex;
|
||||
color: #1667e8;
|
||||
font-size: 30rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 18rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.select-btn {
|
||||
flex-shrink: 0;
|
||||
min-width: 76rpx;
|
||||
height: 48rpx;
|
||||
line-height: 46rpx;
|
||||
padding: 0 18rpx;
|
||||
border: 1rpx solid #1667e8;
|
||||
border-radius: 999rpx;
|
||||
color: #1667e8;
|
||||
background: #fff;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: relative;
|
||||
background: #fff;
|
||||
box-shadow: 0 -6rpx 18rpx rgba(15, 23, 42, 0.06);
|
||||
}
|
||||
|
||||
.service-entry {
|
||||
padding: 24rpx 30rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.service-muted {
|
||||
color: #6b7280;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.service-link {
|
||||
color: #0877f1;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -131,6 +131,8 @@ const urlsConfig = {
|
||||
executeManagementPlanTodo: 'executeManagementPlanTodo',
|
||||
getManagementPlan: 'getManagementPlan',
|
||||
getManagementPlanById: 'getManagementPlanById',
|
||||
getMyManagementPlanTemplateLibrary: 'getMyManagementPlanTemplateLibrary',
|
||||
toggleMyFollowupFavorite: 'toggleMyFollowupFavorite',
|
||||
getNextFollowUpTime: 'getNextFollowUpTime',
|
||||
// 服务记录相关接口
|
||||
getServiceRecord: 'getServiceRecord',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user