feat(health): 新增慢性疾病档案H5模块
- 新增慢性疾病档案API接口 - 新增慢性疾病档案列表页 - 新增慢性疾病档案详情页 - 新增慢性疾病档案新增/编辑页 - 支持成员、疾病关联选择 - 支持疾病状态管理
This commit is contained in:
70
src/api/health/chronicDisease.js
Normal file
70
src/api/health/chronicDisease.js
Normal file
@@ -0,0 +1,70 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询慢性疾病档案列表
|
||||
export function listChronicDisease(query) {
|
||||
return request({
|
||||
url: '/health/chronicDisease/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询慢性疾病档案详细
|
||||
export function getChronicDisease(id) {
|
||||
return request({
|
||||
url: '/health/chronicDisease/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增慢性疾病档案
|
||||
export function addChronicDisease(data) {
|
||||
return request({
|
||||
url: '/health/chronicDisease',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改慢性疾病档案
|
||||
export function updateChronicDisease(data) {
|
||||
return request({
|
||||
url: '/health/chronicDisease',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除慢性疾病档案
|
||||
export function delChronicDisease(id) {
|
||||
return request({
|
||||
url: '/health/chronicDisease/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据成员ID查询慢性疾病档案列表
|
||||
export function listChronicDiseaseByMember(memberId) {
|
||||
return request({
|
||||
url: '/health/chronicDisease/listByMember/' + memberId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询成员列表
|
||||
export function listPerson(query) {
|
||||
return request({
|
||||
url: '/health/person/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询疾病列表
|
||||
export function listHealthDiseases(query) {
|
||||
return request({
|
||||
url: '/health/HealthDiseases/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@@ -798,6 +798,24 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "投资交易记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/health/chronicDisease/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "慢性疾病档案"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/health/chronicDisease/details",
|
||||
"style": {
|
||||
"navigationBarTitleText": "慢性疾病详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/health/chronicDisease/addEdit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "慢性疾病档案"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
|
||||
262
src/pages/work/health/chronicDisease/addEdit.vue
Normal file
262
src/pages/work/health/chronicDisease/addEdit.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u-navbar
|
||||
leftIconSize="40rpx"
|
||||
leftIconColor="#333333"
|
||||
:title="isEdit ? '编辑慢性疾病' : '新增慢性疾病'"
|
||||
>
|
||||
</u-navbar>
|
||||
|
||||
<view class="form-card">
|
||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="formRef" labelWidth="160rpx">
|
||||
<u-form-item label="成员" prop="memberId" @click="showMemberPicker = true">
|
||||
<u--input v-model="form.memberName" disabled placeholder="请选择成员" border="none"></u--input>
|
||||
<template #right>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="关联疾病" prop="diseaseId" @click="showDiseasePicker = true">
|
||||
<u--input v-model="form.diseaseName" disabled placeholder="请选择疾病(可选)" border="none"></u--input>
|
||||
<template #right>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="疾病名称" prop="diseaseName">
|
||||
<u--input v-model="form.diseaseName" placeholder="请输入疾病名称" border="none"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="疾病编码" prop="diseaseCode">
|
||||
<u--input v-model="form.diseaseCode" placeholder="ICD-10编码(可选)" border="none"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="确诊日期" prop="diagnosisDate" @click="showDatePicker = true">
|
||||
<u--input v-model="form.diagnosisDate" disabled placeholder="请选择确诊日期" border="none"></u--input>
|
||||
<template #right>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="疾病状态" prop="diseaseStatus" @click="showStatusPicker = true">
|
||||
<u--input v-model="diseaseStatusText" disabled placeholder="请选择状态" border="none"></u--input>
|
||||
<template #right>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="主治医生" prop="mainDoctor">
|
||||
<u--input v-model="form.mainDoctor" placeholder="请输入主治医生" border="none"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="就诊医院" prop="hospital">
|
||||
<u--input v-model="form.hospital" placeholder="请输入就诊医院" border="none"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="科室" prop="department">
|
||||
<u--input v-model="form.department" placeholder="请输入科室" border="none"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="是否启用" prop="isActive">
|
||||
<u-switch v-model="isActiveSwitch" activeColor="#667eea" @change="handleActiveChange"></u-switch>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="备注说明" prop="notes">
|
||||
<u--textarea v-model="form.notes" placeholder="请输入备注说明" count maxlength="500"></u--textarea>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="备注" prop="remark">
|
||||
<u--textarea v-model="form.remark" placeholder="请输入备注" count maxlength="500"></u--textarea>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
</view>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view class="submit-btn" @click="handleSubmit">
|
||||
<text>提交</text>
|
||||
</view>
|
||||
|
||||
<!-- 选择器 -->
|
||||
<u-picker :show="showMemberPicker" :columns="memberColumns" keyName="name" @confirm="onMemberConfirm" @cancel="showMemberPicker = false"></u-picker>
|
||||
<u-picker :show="showDiseasePicker" :columns="diseaseColumns" keyName="name" @confirm="onDiseaseConfirm" @cancel="showDiseasePicker = false"></u-picker>
|
||||
<u-picker :show="showStatusPicker" :columns="statusColumns" keyName="label" @confirm="onStatusConfirm" @cancel="showStatusPicker = false"></u-picker>
|
||||
<u-datetime-picker :show="showDatePicker" mode="date" @confirm="onDateConfirm" @cancel="showDatePicker = false" :maxDate="maxDate"></u-datetime-picker>
|
||||
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getChronicDisease, addChronicDisease, updateChronicDisease, listPerson, listHealthDiseases } from '@/api/health/chronicDisease'
|
||||
import { onLoad } from "@dcloudio/uni-app"
|
||||
import { reactive, toRefs, ref, computed } from "vue"
|
||||
|
||||
const id = ref('')
|
||||
const isEdit = ref(false)
|
||||
const formRef = ref(null)
|
||||
const showMemberPicker = ref(false)
|
||||
const showDiseasePicker = ref(false)
|
||||
const showStatusPicker = ref(false)
|
||||
const showDatePicker = ref(false)
|
||||
|
||||
const memberList = ref([])
|
||||
const diseaseList = ref([])
|
||||
|
||||
const memberColumns = computed(() => [memberList.value])
|
||||
const diseaseColumns = computed(() => [diseaseList.value])
|
||||
|
||||
const statusColumns = ref([
|
||||
[
|
||||
{ value: 1, label: '稳定' },
|
||||
{ value: 2, label: '需关注' },
|
||||
{ value: 3, label: '急性期' }
|
||||
]
|
||||
])
|
||||
|
||||
const maxDate = ref(Date.now())
|
||||
|
||||
const data = reactive({
|
||||
form: {
|
||||
id: null,
|
||||
memberId: null,
|
||||
memberName: '',
|
||||
diseaseId: null,
|
||||
diseaseName: '',
|
||||
diseaseCode: '',
|
||||
diagnosisDate: '',
|
||||
diseaseStatus: 1,
|
||||
mainDoctor: '',
|
||||
hospital: '',
|
||||
department: '',
|
||||
isActive: 1,
|
||||
notes: '',
|
||||
remark: ''
|
||||
},
|
||||
rules: {
|
||||
memberId: [{ required: true, message: '请选择成员', trigger: ['blur', 'change'] }],
|
||||
diseaseName: [{ required: true, message: '请输入疾病名称', trigger: 'blur' }],
|
||||
diseaseStatus: [{ required: true, message: '请选择疾病状态', trigger: 'change' }]
|
||||
}
|
||||
})
|
||||
|
||||
const { form, rules } = toRefs(data)
|
||||
|
||||
const diseaseStatusText = computed(() => {
|
||||
const item = statusColumns.value[0].find(s => s.value === form.value.diseaseStatus)
|
||||
return item ? item.label : ''
|
||||
})
|
||||
|
||||
const isActiveSwitch = computed({
|
||||
get: () => form.value.isActive === 1,
|
||||
set: (val) => { form.value.isActive = val ? 1 : 0 }
|
||||
})
|
||||
|
||||
onLoad((option) => {
|
||||
getMemberList()
|
||||
getDiseaseList()
|
||||
if (option.id) {
|
||||
id.value = option.id
|
||||
isEdit.value = true
|
||||
getInfo()
|
||||
}
|
||||
})
|
||||
|
||||
function getInfo() {
|
||||
getChronicDisease(id.value).then(res => {
|
||||
form.value = { ...form.value, ...res.data }
|
||||
})
|
||||
}
|
||||
|
||||
function getMemberList() {
|
||||
listPerson({ pageNum: 1, pageSize: 100 }).then(res => {
|
||||
memberList.value = res.rows || []
|
||||
})
|
||||
}
|
||||
|
||||
function getDiseaseList() {
|
||||
listHealthDiseases({ pageNum: 1, pageSize: 100 }).then(res => {
|
||||
diseaseList.value = res.rows || []
|
||||
})
|
||||
}
|
||||
|
||||
function onMemberConfirm(e) {
|
||||
const selected = e.value[0]
|
||||
form.value.memberId = selected.id
|
||||
form.value.memberName = selected.name
|
||||
showMemberPicker.value = false
|
||||
}
|
||||
|
||||
function onDiseaseConfirm(e) {
|
||||
const selected = e.value[0]
|
||||
form.value.diseaseId = selected.id
|
||||
form.value.diseaseName = selected.name
|
||||
showDiseasePicker.value = false
|
||||
}
|
||||
|
||||
function onStatusConfirm(e) {
|
||||
const selected = e.value[0]
|
||||
form.value.diseaseStatus = selected.value
|
||||
showStatusPicker.value = false
|
||||
}
|
||||
|
||||
function onDateConfirm(e) {
|
||||
const date = new Date(e.value)
|
||||
form.value.diagnosisDate = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
|
||||
showDatePicker.value = false
|
||||
}
|
||||
|
||||
function handleActiveChange(val) {
|
||||
form.value.isActive = val ? 1 : 0
|
||||
}
|
||||
|
||||
function handleSubmit() {
|
||||
formRef.value.validate().then(() => {
|
||||
const api = isEdit.value ? updateChronicDisease : addChronicDisease
|
||||
api(form.value).then(() => {
|
||||
uni.showToast({ title: isEdit.value ? '修改成功' : '新增成功', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
})
|
||||
}).catch(() => {
|
||||
uni.showToast({ title: '请完善表单信息', icon: 'none' })
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
background: #f5f7fa;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 140rpx;
|
||||
}
|
||||
|
||||
.form-card {
|
||||
margin: 24rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 20rpx 32rpx;
|
||||
height: 88rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 4rpx 16rpx rgba(102, 126, 234, 0.4);
|
||||
|
||||
text {
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
325
src/pages/work/health/chronicDisease/details.vue
Normal file
325
src/pages/work/health/chronicDisease/details.vue
Normal file
@@ -0,0 +1,325 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u-navbar
|
||||
leftIconSize="40rpx"
|
||||
leftIconColor="#333333"
|
||||
title="慢性疾病详情"
|
||||
>
|
||||
</u-navbar>
|
||||
|
||||
<view class="detail-card">
|
||||
<view class="card-header">
|
||||
<view class="header-icon">
|
||||
<uni-icons type="heart" size="24" color="#ffffff"></uni-icons>
|
||||
</view>
|
||||
<view class="header-info">
|
||||
<text class="disease-name">{{ detailInfo.diseaseName }}<text class="disease-code" v-if="detailInfo.diseaseCode">({{ detailInfo.diseaseCode }})</text></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-body">
|
||||
<view class="info-section">
|
||||
<view class="section-title">
|
||||
<view class="title-icon"></view>
|
||||
<text>基本信息</text>
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="list-item">
|
||||
<text class="item-label">成员</text>
|
||||
<text class="item-value">{{ detailInfo.memberName || '--' }}</text>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<text class="item-label">疾病状态</text>
|
||||
<text class="item-value" :class="getStatusClass(detailInfo.diseaseStatus)">{{ getStatusText(detailInfo.diseaseStatus) }}</text>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<text class="item-label">确诊日期</text>
|
||||
<text class="item-value">{{ detailInfo.diagnosisDate || '--' }}</text>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<text class="item-label">是否启用</text>
|
||||
<text class="item-value" :class="detailInfo.isActive === 1 ? 'active' : 'inactive'">{{ detailInfo.isActive === 1 ? '启用' : '停用' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info-section">
|
||||
<view class="section-title">
|
||||
<view class="title-icon"></view>
|
||||
<text>就医信息</text>
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view class="list-item">
|
||||
<text class="item-label">主治医生</text>
|
||||
<text class="item-value">{{ detailInfo.mainDoctor || '--' }}</text>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<text class="item-label">就诊医院</text>
|
||||
<text class="item-value">{{ detailInfo.hospital || '--' }}</text>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<text class="item-label">科室</text>
|
||||
<text class="item-value">{{ detailInfo.department || '--' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info-section" v-if="detailInfo.notes">
|
||||
<view class="section-title">
|
||||
<view class="title-icon"></view>
|
||||
<text>备注说明</text>
|
||||
</view>
|
||||
<view class="remark-content">
|
||||
<text>{{ detailInfo.notes }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info-section" v-if="detailInfo.remark">
|
||||
<view class="section-title">
|
||||
<view class="title-icon"></view>
|
||||
<text>备注</text>
|
||||
</view>
|
||||
<view class="remark-content">
|
||||
<text>{{ detailInfo.remark }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="operate-btns">
|
||||
<view class="btn-edit" @click="handleEdit">
|
||||
<uni-icons type="compose" size="18" color="#667eea"></uni-icons>
|
||||
<text>编辑</text>
|
||||
</view>
|
||||
<view class="btn-delete" @click="handleDelete">
|
||||
<uni-icons type="trash" size="18" color="#f5576c"></uni-icons>
|
||||
<text>删除</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getChronicDisease, delChronicDisease } from '@/api/health/chronicDisease'
|
||||
import { onLoad } from "@dcloudio/uni-app"
|
||||
import { reactive, toRefs, ref } from "vue"
|
||||
|
||||
const id = ref('')
|
||||
const data = reactive({
|
||||
detailInfo: {}
|
||||
})
|
||||
const { detailInfo } = toRefs(data)
|
||||
|
||||
onLoad((option) => {
|
||||
id.value = option.id
|
||||
getInfo()
|
||||
})
|
||||
|
||||
function getInfo() {
|
||||
getChronicDisease(id.value).then(res => {
|
||||
detailInfo.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
function handleEdit() {
|
||||
uni.navigateTo({ url: `/pages/work/health/chronicDisease/addEdit?id=${id.value}` })
|
||||
}
|
||||
|
||||
function handleDelete() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要删除该慢性疾病档案吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
delChronicDisease(id.value).then(() => {
|
||||
uni.showToast({ title: '删除成功', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getStatusClass(status) {
|
||||
const classes = { 1: 'status-normal', 2: 'status-warning', 3: 'status-danger' }
|
||||
return classes[status] || 'status-default'
|
||||
}
|
||||
|
||||
function getStatusText(status) {
|
||||
const texts = { 1: '稳定', 2: '需关注', 3: '急性期' }
|
||||
return texts[status] || '未知'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
background: #f5f7fa;
|
||||
padding-bottom: 140rpx;
|
||||
}
|
||||
|
||||
.detail-card {
|
||||
margin: 24rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 20rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 80rpx;
|
||||
|
||||
.header-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.header-info {
|
||||
flex: 1;
|
||||
|
||||
.disease-name {
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
|
||||
.disease-code {
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: 24rpx;
|
||||
background: #fafbfc;
|
||||
border: 2rpx solid #f0f2f5;
|
||||
margin: 15rpx 16rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.info-section {
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.title-icon {
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border-radius: 3rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
color: #2c3e50;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.info-list {
|
||||
.list-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.item-label {
|
||||
color: #7f8c8d;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.item-value {
|
||||
color: #2c3e50;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
|
||||
&.active { color: #52c41a; }
|
||||
&.inactive { color: #ff4d4f; }
|
||||
&.status-normal { color: #52c41a; }
|
||||
&.status-warning { color: #faad14; }
|
||||
&.status-danger { color: #ff4d4f; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.remark-content {
|
||||
padding: 20rpx;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8rpx;
|
||||
|
||||
text {
|
||||
color: #2c3e50;
|
||||
font-size: 26rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.operate-btns {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
padding: 20rpx 32rpx;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 -4rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
|
||||
.btn-edit, .btn-delete {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 12rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.btn-edit {
|
||||
background: rgba(102, 126, 234, 0.1);
|
||||
color: #667eea;
|
||||
border: 2rpx solid rgba(102, 126, 234, 0.3);
|
||||
}
|
||||
|
||||
.btn-delete {
|
||||
background: rgba(245, 87, 108, 0.1);
|
||||
color: #f5576c;
|
||||
border: 2rpx solid rgba(245, 87, 108, 0.3);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
522
src/pages/work/health/chronicDisease/list.vue
Normal file
522
src/pages/work/health/chronicDisease/list.vue
Normal file
@@ -0,0 +1,522 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
|
||||
<view class="search-view">
|
||||
<u--input v-model="queryParams.diseaseName" border="false" placeholder="请输入疾病名称" class="search-input"
|
||||
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
|
||||
</u--input>
|
||||
<view class="filter-btn" @click="filterPanel = !filterPanel">
|
||||
<uni-icons type="list" size="18" color="#667eea"></uni-icons>
|
||||
<text>筛选</text>
|
||||
</view>
|
||||
<u-transition :show="filterPanel" mode="fade">
|
||||
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
|
||||
<view class="filter-panel-content">
|
||||
<view class="filter-title">成员</view>
|
||||
<view class="state-list">
|
||||
<view v-for="item in memberList" :key="item.id" class="state-item"
|
||||
:class="item.selected ? 'active' : ''" @click="selectMember(item)">{{ item.name }}</view>
|
||||
</view>
|
||||
<view class="filter-title">疾病状态</view>
|
||||
<view class="state-list">
|
||||
<view v-for="item in diseaseStatusList" :key="item.value" class="state-item"
|
||||
:class="item.selected ? 'active' : ''" @click="selectStatus(item)">{{ item.label }}</view>
|
||||
</view>
|
||||
<view class="filter-title">是否启用</view>
|
||||
<view class="state-list">
|
||||
<view v-for="item in isActiveList" :key="item.value" class="state-item"
|
||||
:class="item.selected ? 'active' : ''" @click="selectActive(item)">{{ item.label }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<view class="btn-reset" @click="resetQuery()">
|
||||
<uni-icons type="reload" size="16" color="#909399"></uni-icons>
|
||||
<text>重置</text>
|
||||
</view>
|
||||
<view class="btn-confirm" @click="searchSubmit()">
|
||||
<uni-icons type="checkmarkempty" size="16" color="#ffffff"></uni-icons>
|
||||
<text>确定</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-transition>
|
||||
</view>
|
||||
</u-sticky>
|
||||
|
||||
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
|
||||
<u-list-item v-for="(item, index) in listData" :key="index">
|
||||
<view class="list-item" @click="enterDetails(item)">
|
||||
<view class="item-header">
|
||||
<view class="header-row">
|
||||
<view class="disease-icon">
|
||||
<uni-icons type="heart" size="20" color="#ffffff"></uni-icons>
|
||||
</view>
|
||||
<text class="disease-name">{{ item.diseaseName }}</text>
|
||||
<text class="disease-code" v-if="item.diseaseCode">{{ item.diseaseCode }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="member-name">{{ item.memberName || '--' }}</text>
|
||||
<text class="disease-status" :class="getStatusClass(item.diseaseStatus)">{{ getStatusText(item.diseaseStatus) }}</text>
|
||||
<view class="diagnosis-date">
|
||||
<text class="date-label">确诊</text>
|
||||
<text class="date-value">{{ item.diagnosisDate || '--' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-body">
|
||||
<view class="info-row">
|
||||
<view class="info-item">
|
||||
<text class="info-label">主治医生</text>
|
||||
<text class="info-value">{{ item.mainDoctor || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">就诊医院</text>
|
||||
<text class="info-value">{{ item.hospital || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">科室</text>
|
||||
<text class="info-value">{{ item.department || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">状态</text>
|
||||
<text class="info-value" :class="item.isActive === 1 ? 'active' : 'inactive'">{{ item.isActive === 1 ? '启用' : '停用' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-list-item>
|
||||
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
|
||||
</u-list>
|
||||
|
||||
<!-- 新增按钮 -->
|
||||
<view class="add-btn" @click="handleAdd">
|
||||
<uni-icons type="plus" size="24" color="#ffffff"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<suspend></suspend>
|
||||
<refresh></refresh>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listChronicDisease, listPerson } from '@/api/health/chronicDisease'
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import { reactive, toRefs, ref, computed } from "vue"
|
||||
|
||||
const pageNum = ref(1)
|
||||
const listData = ref([])
|
||||
const isShow = ref(false)
|
||||
const status = ref('loadmore')
|
||||
const memberList = ref([])
|
||||
const filterPanel = ref(false)
|
||||
|
||||
const diseaseStatusList = ref([
|
||||
{ value: 1, label: '稳定', selected: false },
|
||||
{ value: 2, label: '需关注', selected: false },
|
||||
{ value: 3, label: '急性期', selected: false }
|
||||
])
|
||||
|
||||
const isActiveList = ref([
|
||||
{ value: 1, label: '启用', selected: false },
|
||||
{ value: 0, label: '停用', selected: false }
|
||||
])
|
||||
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
diseaseName: null,
|
||||
memberId: null,
|
||||
diseaseStatus: null,
|
||||
isActive: null
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams } = toRefs(data)
|
||||
|
||||
const windowHeight = computed(() => {
|
||||
return uni.getSystemInfoSync().windowHeight - 50
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
getMemberList()
|
||||
getList()
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
if (isShow.value) {
|
||||
listData.value = []
|
||||
pageNum.value = 1
|
||||
getList()
|
||||
isShow.value = false
|
||||
}
|
||||
})
|
||||
|
||||
function loadmore() {
|
||||
pageNum.value += 1
|
||||
if (status.value == 'loadmore') {
|
||||
getList()
|
||||
}
|
||||
}
|
||||
|
||||
function getList() {
|
||||
status.value = 'loading'
|
||||
listChronicDisease({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
|
||||
listData.value = listData.value.concat(res.rows)
|
||||
if (listData.value.length < res.total) {
|
||||
status.value = 'loadmore'
|
||||
} else {
|
||||
status.value = 'nomore'
|
||||
}
|
||||
}).catch(() => {
|
||||
status.value = 'nomore'
|
||||
})
|
||||
}
|
||||
|
||||
function getMemberList() {
|
||||
listPerson({ pageNum: 1, pageSize: 100 }).then(res => {
|
||||
memberList.value = res.rows.map(item => ({
|
||||
...item,
|
||||
selected: false
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
function selectMember(item) {
|
||||
queryParams.value.memberId = item.selected ? null : item.id
|
||||
memberList.value.forEach(ele => {
|
||||
ele.selected = ele.id === item.id && !item.selected
|
||||
})
|
||||
}
|
||||
|
||||
function selectStatus(item) {
|
||||
queryParams.value.diseaseStatus = item.selected ? null : item.value
|
||||
diseaseStatusList.value.forEach(ele => {
|
||||
ele.selected = ele.value === item.value && !item.selected
|
||||
})
|
||||
}
|
||||
|
||||
function selectActive(item) {
|
||||
queryParams.value.isActive = item.selected ? null : item.value
|
||||
isActiveList.value.forEach(ele => {
|
||||
ele.selected = ele.value === item.value && !item.selected
|
||||
})
|
||||
}
|
||||
|
||||
function searchSubmit() {
|
||||
pageNum.value = 1
|
||||
listData.value = []
|
||||
getList()
|
||||
filterPanel.value = false
|
||||
}
|
||||
|
||||
function searchBlur() {
|
||||
pageNum.value = 1
|
||||
listData.value = []
|
||||
getList()
|
||||
}
|
||||
|
||||
function resetQuery() {
|
||||
queryParams.value.diseaseName = null
|
||||
queryParams.value.memberId = null
|
||||
queryParams.value.diseaseStatus = null
|
||||
queryParams.value.isActive = null
|
||||
memberList.value.forEach(ele => ele.selected = false)
|
||||
diseaseStatusList.value.forEach(ele => ele.selected = false)
|
||||
isActiveList.value.forEach(ele => ele.selected = false)
|
||||
}
|
||||
|
||||
function enterDetails(item) {
|
||||
uni.navigateTo({ url: `/pages/work/health/chronicDisease/details?id=${item.id}` })
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
uni.navigateTo({ url: '/pages/work/health/chronicDisease/addEdit' })
|
||||
isShow.value = true
|
||||
}
|
||||
|
||||
function getStatusClass(status) {
|
||||
const classes = { 1: 'status-normal', 2: 'status-warning', 3: 'status-danger' }
|
||||
return classes[status] || 'status-default'
|
||||
}
|
||||
|
||||
function getStatusText(status) {
|
||||
const texts = { 1: '稳定', 2: '需关注', 3: '急性期' }
|
||||
return texts[status] || '未知'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.search-view {
|
||||
padding: 12rpx 32rpx;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
.search-input {
|
||||
background: rgba(102, 126, 234, 0.08);
|
||||
color: #333333;
|
||||
flex: 1;
|
||||
margin-right: 16rpx;
|
||||
border-radius: 24rpx;
|
||||
border: 2rpx solid rgba(102, 126, 234, 0.3);
|
||||
height: 66rpx !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.filter-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
padding: 12rpx 24rpx;
|
||||
background: rgba(102, 126, 234, 0.08);
|
||||
border-radius: 24rpx;
|
||||
border: 2rpx solid rgba(102, 126, 234, 0.3);
|
||||
|
||||
text {
|
||||
color: #667eea;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.filter-panel {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 96rpx;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 999;
|
||||
|
||||
.filter-panel-content {
|
||||
background-color: #ffffff;
|
||||
padding: 0 30rpx 30rpx;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
|
||||
.filter-title {
|
||||
color: #2c3e50;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
padding: 32rpx 0 24rpx 20rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
width: 6rpx;
|
||||
height: 32rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border-radius: 3rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.state-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
|
||||
.state-item {
|
||||
padding: 0 32rpx;
|
||||
height: 68rpx;
|
||||
border: 2rpx solid #e8edf3;
|
||||
border-radius: 34rpx;
|
||||
text-align: center;
|
||||
line-height: 68rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.active {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border: 2rpx solid transparent;
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
padding: 24rpx 30rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.btn-reset, .btn-confirm {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 12rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.btn-reset {
|
||||
background: #f5f7fa;
|
||||
border: 2rpx solid #dcdfe6;
|
||||
text { color: #606266; }
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
background: #667eea;
|
||||
text { color: #ffffff; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-item {
|
||||
margin: 10rpx 24rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
|
||||
.item-header {
|
||||
padding: 16rpx 24rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
|
||||
.header-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
}
|
||||
|
||||
.disease-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.disease-name {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #ffffff;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.disease-code {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
padding-top: 12rpx;
|
||||
border-top: 1rpx solid rgba(255, 255, 255, 0.2);
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.member-name {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
}
|
||||
|
||||
.disease-status {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
|
||||
&.status-normal { color: #52c41a; }
|
||||
&.status-warning { color: #faad14; }
|
||||
&.status-danger { color: #ff4d4f; }
|
||||
}
|
||||
|
||||
.diagnosis-date {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 6rpx;
|
||||
|
||||
.date-label {
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
}
|
||||
|
||||
.date-value {
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: 24rpx;
|
||||
background: #fafbfc;
|
||||
border: 2rpx solid #f0f2f5;
|
||||
margin: 15rpx 16rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 24rpx;
|
||||
|
||||
.info-item {
|
||||
flex: 0 0 calc(50% - 12rpx);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4rpx;
|
||||
|
||||
.info-label {
|
||||
font-size: 24rpx;
|
||||
color: #667eea;
|
||||
font-weight: 500;
|
||||
background: rgba(102, 126, 234, 0.08);
|
||||
padding: 6rpx 12rpx;
|
||||
border-radius: 8rpx;
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
|
||||
&.active { color: #52c41a; }
|
||||
&.inactive { color: #ff4d4f; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
position: fixed;
|
||||
right: 32rpx;
|
||||
bottom: 120rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 4rpx 16rpx rgba(102, 126, 234, 0.4);
|
||||
z-index: 100;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user