9.2 zjd提交

This commit is contained in:
zoujiandong
2025-09-02 19:03:45 +08:00
parent 1cc611d68d
commit f89d0e6295
16 changed files with 1338 additions and 301 deletions
+104 -42
View File
@@ -24,20 +24,20 @@
</view>
<!-- 随访申请 -->
<view class="follow-up-section">
<view class="follow-up-section" v-if="applyList.length > 0">
<view class="section-title">随访申请</view>
<view class="pending-request" v-if="pendingRequest">
<view class="pending-request" v-for="(item, index) in applyList" :key="index">
<view class="request-item">
<view class="avatar">
<view class="avatar-icon"></view>
<up-image :src="docUrl+item.photo" radius="10rpx" width="80rpx" height="80rpx" ></up-image>
</view>
<view class="request-content">
<view class="request-time">2025-08-18 15:55:03</view>
<view class="request-text">我是陈新华,在线上和您沟通过,请您同意我作为您的随访患者</view>
<view class="request-time">{{ item.createDate }}</view>
<view class="request-text">{{ item.content }}</view>
<view class="action-buttons">
<button class="reject-btn" @click="rejectRequest">拒绝</button>
<button class="agree-btn" @click="agreeRequest">同意</button>
<button class="reject-btn" @click="applyListOperate(item.uuid,3)">拒绝</button>
<button class="agree-btn" @click="applyListOperate(item.uuid,2)">同意</button>
</view>
</view>
</view>
@@ -45,22 +45,22 @@
</view>
<!-- 申请记录 -->
<view class="history-section">
<view class="history-section" v-if="historyList.length > 0">
<view class="section-title">申请记录(近一月)</view>
<view class="history-list">
<view class="history-item" v-for="(item, index) in historyList" :key="index">
<view class="avatar">
<view class="avatar-icon"></view>
<up-image v-if="docUrl+item.patient_photo" :src="docUrl + item.patient_photo" radius="10rpx" width="80rpx" height="80rpx"></up-image>
</view>
<view class="history-content">
<view class="history-time">{{ item.time }}</view>
<view class="nickname">昵称: {{ item.nickname }}</view>
<view class="history-text">{{ item.message }}</view>
<view class="history-time">{{ formatDate(item.createDate) }}</view>
<view class="nickname">{{ item.nickname || item.patient_name }}</view>
<view class="history-text">{{ item.content}}</view>
<view class="status-info">
<up-image :src="goImg" width="30rpx" height="30rpx" ></up-image>
<text class="status-text">已同意</text>
<up-image :src="goImg" width="30rpx" height="30rpx" v-if="item.status==2"></up-image>
<text class="status-text">{{ getStatusText(item.status) }}</text>
</view>
</view>
</view>
</view>
@@ -75,36 +75,19 @@
<script setup>
import { ref } from 'vue';
import { onLoad,onShow} from '@dcloudio/uni-app';
import goImg from "@/static/go_big.png"
import api from '@/api/api.js'
import docUrl from "@/utils/docUrl"
import navTo from "@/utils/navTo.js"
// 响应式数据
const pendingRequest = ref({
name: '陈新华',
message: '我是陈新华,在线上和您沟通过,请您同意我作为您的随访患者',
time: '2025-08-18 15:55:03'
});
const historyList = ref([
{
nickname: '韩夫臣',
message: '我是韩夫臣,在线上和您沟通过,请您...',
time: '2025-08-19 22:41:35'
},
{
nickname: '鲁保山',
message: '我是鲁保山,在线上和您沟通过,请您...',
time: '2025-08-19 22:41:27'
},
{
nickname: '蒋宁宁',
message: '我是蒋宁宁,在线上和您沟通过,请您...',
time: '2025-08-19 11:25:46'
},
{
nickname: '蒋宁',
message: '我是蒋宁,在线上和您沟通过,请您同...',
time: '2025-08-19 11:25:39'
}
]);
const applyList = ref([]);
const historyList = ref([]);
// 方法
const goBack = () => {
@@ -142,11 +125,90 @@ const agreeRequest = () => {
}
});
};
const getRelationRecordLately = async () => {
const res = await api.relationRecordLately({
page:1,
pageSize:100
});
console.log('随访记录API响应:', res);
if(res.code === 200){
historyList.value = res.data.list;
}
};
const getApplyList = async () => { // 申请列表
try {
let userInfo=uni.getStorageSync('userInfo')
const res = await api.applyList();
console.log('申请列表API响应:', res);
if (res && res.code === 200) {
applyList.value = res.data;
} else {
console.log('申请列表API响应异常:', res);
uni.showToast({
title: res.message || '获取申请列表失败',
icon: 'error',
duration: 2000
});
}
} catch (error) {
console.error('获取申请列表失败:', error);
uni.showToast({
title: '网络请求失败',
icon: 'error',
duration: 2000
});
}
};
const applyListOperate = async (uuid,status) => {
let data = {
uuid: uuid,
status: status
}
const res = await api.applyListOperate(data);
if(res.code === 200){
uni.showToast({
title: '操作成功',
icon: 'none',
duration: 1500
});
getApplyList();
getRelationRecordLately();
}
};
onShow(() => {
getApplyList();
getRelationRecordLately();
});
// 辅助方法
// 格式化日期
const formatDate = (dateString) => {
if (!dateString) return '';
const date = new Date(dateString);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}`;
};
// 获取状态文本
const getStatusText = (status) => {
switch (status) {
case 1: return '待审核';
case 2: return '已同意';
case 3: return '已拒绝';
}
};
const addPatient = () => {
uni.showToast({
title: '跳转到添加患者页面',
icon: 'none'
navTo({
url:'/pages_app/myCode/myCode'
});
// 这里可以跳转到添加患者页面
};
@@ -378,7 +440,7 @@ const addPatient = () => {
}
.history-list {
padding-bottom: 100rpx;
margin-bottom: 100rpx;
.history-item {
display: flex;
gap: 20rpx;