fix: 新功能开发完善。
This commit is contained in:
@@ -1,105 +1,163 @@
|
||||
<template>
|
||||
<view class="container" style="paddingBottom:1rpx;">
|
||||
<u-navbar
|
||||
leftIconSize="40rpx"
|
||||
leftIconColor="#333333"
|
||||
title="心路历程"
|
||||
>
|
||||
</u-navbar>
|
||||
<view class="section">
|
||||
<view class="section-title">{{ title}}</view>
|
||||
<view class="form-view">
|
||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
|
||||
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
|
||||
<u-form-item label="标题" prop="name" required >
|
||||
<u--input v-model="form.name" placeholder="请填写标题"
|
||||
<view class="container" style="paddingBottom:1rpx;">
|
||||
<u-navbar
|
||||
leftIconSize="40rpx"
|
||||
leftIconColor="#333333"
|
||||
title="就医记录"
|
||||
>
|
||||
</u-navbar>
|
||||
<view class="section">
|
||||
<view class="section-title">{{ title}}</view>
|
||||
<view class="form-view">
|
||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
|
||||
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
|
||||
<u-form-item label="人员姓名" prop="personName" required @click="handlePerson">
|
||||
<u--input v-model="form.personName" disabled disabledColor="#ffffff" placeholder="请选择人员"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-down"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="健康档案" prop="healthRecordName" required @click="handHealthRecord">
|
||||
<u--input v-model="form.healthRecordName" disabled disabledColor="#ffffff" placeholder="请选择健康档案"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-down"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="医院名称" prop="hospitalName" required >
|
||||
<u--input v-model="form.hospitalName" placeholder="请填写医院名称"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="类型" prop="typeName" required @click="handleShowTeam">
|
||||
<u--input v-model="form.typeName" disabled disabledColor="#ffffff" placeholder="请选择类型"
|
||||
<u-form-item label="科室" prop="departments" required >
|
||||
<u--input v-model="form.departments" placeholder="请填写科室"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-down"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="记录时间" prop="createTime" required @click="selectDate()">
|
||||
<u--input v-model="form.createTime" disabled disabledColor="#ffffff" placeholder="请选择记录时间" inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
<u-form-item label="大夫" prop="doctor" required >
|
||||
<u--input v-model="form.doctor" placeholder="请填写大夫"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="内容" prop="remark" required labelPosition="top">
|
||||
<u--textarea v-model="form.remark" placeholder="请填写内容" border="none" autoHeight inputAlign="right" count
|
||||
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
|
||||
<u-form-item label="就诊时间" prop="visitingTime" required @click="selectDate()">
|
||||
<u--input v-model="form.visitingTime" disabled disabledColor="#ffffff" placeholder="请选择就诊时间" inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="陪同人" prop="partner" required >
|
||||
<u--input v-model="form.partner" placeholder="请填写陪同人"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<view class="form-btn">
|
||||
<u-button type="primary" text="提交" @click="submit"></u-button>
|
||||
</view>
|
||||
<u-form-item label="诊断及开药" prop="prescribe" labelPosition="top">
|
||||
<u--textarea v-model="form.prescribe" placeholder="请填写诊断及开药" border="none" autoHeight inputAlign="right" count
|
||||
maxlength="2000" style="padding:18rpx 0;"></u--textarea>
|
||||
</u-form-item>
|
||||
<u-form-item label="总费用" prop="totalCost" required >
|
||||
<u--input v-model="form.totalCost" placeholder="请填写总费用"
|
||||
inputAlign="right" border="none">
|
||||
<template #suffix>
|
||||
<up-text
|
||||
text="元"
|
||||
></up-text>
|
||||
</template></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="费用明细" prop="costDetail" required >
|
||||
<u--textarea v-model="form.costDetail" placeholder="请填写费用明细" border="none" autoHeight inputAlign="right" count
|
||||
maxlength="2000" style="padding:18rpx 0;"></u--textarea>
|
||||
</u-form-item>
|
||||
<u-form-item label="备注" prop="remark" labelPosition="top">
|
||||
<u--textarea v-model="form.remark" placeholder="请填写备注" border="none" autoHeight inputAlign="right" count
|
||||
maxlength="2000" style="padding:18rpx 0;"></u--textarea>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<view class="form-btn">
|
||||
<u-button type="primary" text="提交" @click="submit"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<u-picker itemHeight="88" :show="showTeam" :columns="journeyTypeList" keyName="dictLabel" @cancel="handleCancel"
|
||||
@confirm="handleConfirm"></u-picker>
|
||||
<u-datetime-picker
|
||||
</view>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<u-picker itemHeight="88" :show="showPerson" :columns="personList" keyName="name" @cancel="handlePersonCancel"
|
||||
@confirm="handlePersonConfirm"></u-picker>
|
||||
<u-picker itemHeight="88" :show="showHealthRecord" :columns="healthRecordList" keyName="name" @cancel="handHealthRecordCancel"
|
||||
@confirm="handHealthRecordConfirm"></u-picker>
|
||||
<u-datetime-picker
|
||||
:show="datePickShow"
|
||||
mode="datetime"
|
||||
ref="createTimeRef"
|
||||
ref="visitingTimeRef"
|
||||
@cancel="datePickShow=false"
|
||||
@confirm="datePickConfirm"
|
||||
itemHeight="88"
|
||||
></u-datetime-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getHeartJourney, addHeartJourney, updateHeartJourney } from '@/api/invest/heartJourney'
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getDoctorRecord, addDoctorRecord, updateDoctorRecord } from '@/api/health/doctorRecord'
|
||||
import { listPerson } from '@/api/health/person'
|
||||
import { listHealthRecord } from '@/api/health/healthRecord'
|
||||
const { proxy } = getCurrentInstance()
|
||||
import { getDicts } from '@/api/system/dict/data.js'
|
||||
const { proxy } = getCurrentInstance()
|
||||
import dayjs from 'dayjs'
|
||||
import {onLoad,onReady} from "@dcloudio/uni-app";
|
||||
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
|
||||
import dayjs from 'dayjs'
|
||||
import {onLoad,onReady} from "@dcloudio/uni-app";
|
||||
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
|
||||
import {reactive ,toRefs,ref,computed ,getCurrentInstance }from "vue";
|
||||
const datePickShow = ref(false)
|
||||
const showTeam = ref(false)
|
||||
const title = ref("心路历程")
|
||||
const journeyTypeList = ref([])
|
||||
const showPerson = ref(false)
|
||||
const showHealthRecord = ref(false)
|
||||
const title = ref("就医记录")
|
||||
const healthRecordList = ref([])
|
||||
const personList = ref([])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
rules: {
|
||||
name: [{ type: 'string', required: true, message: '标题不能为空', trigger: ['change', 'blur'] }],
|
||||
createTime: [{ type: 'string', required: true, message: '记录时间不能为空', trigger: ['change', 'blur'] }],
|
||||
typeName: [{ type: 'string', required: true, message: '类型不能为空', trigger: ['change', 'blur'] }],
|
||||
remark: [{ type: 'string', required: true, message: '内容不能为空', trigger: ['change', 'blur'] }],
|
||||
}
|
||||
form: {
|
||||
id: null,
|
||||
hospitalName: null,
|
||||
departments: null,
|
||||
doctor: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
healthRecordId: null,
|
||||
visitingTime: null,
|
||||
prescribe: null,
|
||||
personId: null,
|
||||
totalCost: null,
|
||||
partner: null,
|
||||
costDetail: null
|
||||
},
|
||||
queryPersonParams: {
|
||||
pageNum: 1,
|
||||
status: '1',
|
||||
pageSize: 1000
|
||||
},
|
||||
queryHealthRecordParams: {
|
||||
pageNum: 1,
|
||||
personId:null,
|
||||
pageSize: 1000
|
||||
},
|
||||
rules: {
|
||||
healthRecordName: [{ required: true, message: '健康档案不能为空', trigger:['change', 'blur'] }],
|
||||
personName: [{ required: true, message: '人员不能为空', trigger: ['change', 'blur'] }],
|
||||
hospitalName: [{ required: true, message: '医院名称不能为空', trigger: ['change', 'blur'] }],
|
||||
departments: [{ required: true, message: '科室不能为空', trigger: ['change', 'blur'] }],
|
||||
doctor: [{ required: true, message: '大夫不能为空', trigger: ['change', 'blur'] }],
|
||||
totalCost: [{ type: 'number', required: true, message: '总费用不能为空', trigger: ['change', 'blur'] }],
|
||||
partner: [{ required: true, message: '陪同人不能为空', trigger: ['change', 'blur'] }],
|
||||
prescribe: [{ required: true, message: '诊断及开药不能为空', trigger: ['change', 'blur'] }],
|
||||
visitingTime: [{ required: true, message: '就诊时间不能为空', trigger: ['change', 'blur'] }]
|
||||
}
|
||||
})
|
||||
const { form, rules} = toRefs(data)
|
||||
const { form, queryPersonParams, queryHealthRecordParams, rules} = toRefs(data)
|
||||
|
||||
|
||||
onLoad((option) => {
|
||||
form.value.id = option.id
|
||||
if(form.value.id!=null){
|
||||
title.value="心路历程-修改"
|
||||
}else{
|
||||
title.value="心路历程-新增"
|
||||
}
|
||||
getDict()
|
||||
})
|
||||
onReady(() => {
|
||||
form.value.createTime = dayjs(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
|
||||
})
|
||||
function getDict() {
|
||||
// 类型
|
||||
getDicts('journey_type').then(res => {
|
||||
journeyTypeList.value =[res.data]
|
||||
})
|
||||
if(form.value.id!=null){
|
||||
getHeartJourney(form.value.id).then(res => {
|
||||
form.value = res.data
|
||||
// 类型
|
||||
getDicts('journey_type').then(result => {
|
||||
form.value.typeName=dictStr(form.value.type, result.data)
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
function dictStr(val, arr) {
|
||||
form.value.id = option.id
|
||||
if(form.value.id!=null){
|
||||
title.value="就医记录-修改"
|
||||
}else{
|
||||
title.value="就医记录-新增"
|
||||
}
|
||||
getData()
|
||||
})
|
||||
onReady(() => {
|
||||
form.value.visitingTime = dayjs(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
|
||||
})
|
||||
function dictStr(val, arr) {
|
||||
let str = ''
|
||||
arr.map(item => {
|
||||
if (item.dictValue === val) {
|
||||
@@ -107,78 +165,133 @@ onLoad((option) => {
|
||||
}
|
||||
})
|
||||
return str
|
||||
}
|
||||
function getData() {
|
||||
listPerson(queryPersonParams.value).then((response) => {
|
||||
personList.value = [response.rows]
|
||||
if(response.rows.length>0){
|
||||
form.value.personName= response.rows[0].name
|
||||
form.value.personId = response.rows[0].id
|
||||
queryHealthRecordParams.value.personId=response.rows[0].id
|
||||
listHealthRecord(queryHealthRecordParams.value).then((response) => {
|
||||
healthRecordList.value = [response.rows]
|
||||
if(response.rows.length>0){
|
||||
form.value.healthRecordName= response.rows[0].name
|
||||
form.value.healthRecordId = response.rows[0].id
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
// 药品来源
|
||||
|
||||
if(form.value.id!=null){
|
||||
getDoctorRecord(form.value.id).then(res => {
|
||||
form.value = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function handleShowTeam() {
|
||||
if (journeyTypeList.value[0].length === 0) {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '类型为空 ', type: 'warning'
|
||||
})
|
||||
} else {
|
||||
showTeam.value = true
|
||||
}
|
||||
}
|
||||
function handleConfirm(e) {
|
||||
form.value.typeName = e.value[0].dictLabel
|
||||
form.value.type = e.value[0].dictValue
|
||||
showTeam.value = false
|
||||
}
|
||||
function handleCancel() {
|
||||
showTeam.value = false
|
||||
}
|
||||
function selectDate() {
|
||||
datePickShow.value = true
|
||||
proxy.$refs['createTimeRef'].innerValue = new Date().getTime()
|
||||
}
|
||||
function datePickConfirm(e) {
|
||||
form.value.createTime = dayjs(e.value).format("YYYY-MM-DD HH:mm:ss")
|
||||
datePickShow.value = false
|
||||
}
|
||||
function submit() {
|
||||
proxy.$refs['uForm'].validate().then(() => {
|
||||
if (form.value.id != null) {
|
||||
updateHeartJourney(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '修改成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
}else {
|
||||
addHeartJourney(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '新增成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
function handlePerson() {
|
||||
if (personList.value[0].length === 0) {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '人员为空 ', type: 'warning'
|
||||
})
|
||||
} else {
|
||||
showPerson.value = true
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.section {
|
||||
margin: 24rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.section-title {
|
||||
width: 360rpx;
|
||||
color: #333333;
|
||||
line-height: 44rpx;
|
||||
font-size: 30rpx;
|
||||
border-left: 6rpx solid #2681FF;
|
||||
padding-left: 26rpx;
|
||||
}
|
||||
function handlePersonConfirm(e) {
|
||||
form.value.personName = e.value[0].name
|
||||
form.value.personId = e.value[0].id
|
||||
form.value.healthRecordName = ''
|
||||
form.value.healthRecordId = ''
|
||||
queryHealthRecordParams.value.personId=e.value[0].id
|
||||
listHealthRecord(queryHealthRecordParams.value).then((response) => {
|
||||
healthRecordList.value = [response.rows]
|
||||
if(response.rows.length>0){
|
||||
form.value.healthRecordName= response.rows[0].name
|
||||
form.value.healthRecordId = response.rows[0].id
|
||||
}
|
||||
|
||||
.form-view {
|
||||
padding: 20rpx 0rpx 0 10rpx;
|
||||
|
||||
.form-btn {
|
||||
padding-top: 20rpx;
|
||||
showPerson.value = false
|
||||
})
|
||||
|
||||
}
|
||||
function handlePersonCancel() {
|
||||
showPerson.value = false
|
||||
}
|
||||
|
||||
function handHealthRecord() {
|
||||
if (healthRecordList.value[0].length === 0) {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '健康档案为空 ', type: 'warning'
|
||||
})
|
||||
} else {
|
||||
showHealthRecord.value = true
|
||||
}
|
||||
}
|
||||
function handHealthRecordConfirm(e) {
|
||||
form.value.healthRecordName = e.value[0].name
|
||||
form.value.healthRecordId = e.value[0].id
|
||||
showHealthRecord.value = false
|
||||
}
|
||||
function handHealthRecordCancel() {
|
||||
showHealthRecord.value = false
|
||||
}
|
||||
|
||||
|
||||
function selectDate() {
|
||||
datePickShow.value = true
|
||||
proxy.$refs['visitingTimeRef'].innerValue = new Date().getTime()
|
||||
}
|
||||
function datePickConfirm(e) {
|
||||
form.value.visitingTime = dayjs(e.value).format("YYYY-MM-DD HH:mm:ss")
|
||||
datePickShow.value = false
|
||||
}
|
||||
function submit() {
|
||||
proxy.$refs['uForm'].validate().then(() => {
|
||||
if (form.value.id != null) {
|
||||
updateDoctorRecord(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '修改成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/health/doctorRecord/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
}else {
|
||||
addDoctorRecord(form.value).then(res => {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '新增成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/health/doctorRecord/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.section {
|
||||
margin: 24rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.section-title {
|
||||
width: 360rpx;
|
||||
color: #333333;
|
||||
line-height: 44rpx;
|
||||
font-size: 30rpx;
|
||||
border-left: 6rpx solid #2681FF;
|
||||
padding-left: 26rpx;
|
||||
}
|
||||
|
||||
.form-view {
|
||||
padding: 20rpx 0rpx 0 10rpx;
|
||||
|
||||
.form-btn {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
}
|
||||
</style>
|
||||
@@ -1,92 +0,0 @@
|
||||
<template>
|
||||
<view class="container" style="paddingBottom:1rpx;">
|
||||
<u-navbar
|
||||
leftIconSize="40rpx"
|
||||
leftIconColor="#333333"
|
||||
title="心路历程详情"
|
||||
>
|
||||
</u-navbar>
|
||||
<view class="section">
|
||||
<u-cell-group>
|
||||
<u-cell title="标题:" titleStyle="font-weight:bolder" :value="detailInfo.name"></u-cell>
|
||||
<u-cell title="类型:" titleStyle="font-weight:bolder" :value="detailInfo.type"></u-cell>
|
||||
<u-cell title="记录时间:" titleStyle="font-weight:bolder" :value="detailInfo.createTime"></u-cell>
|
||||
<u-cell title="内容:" titleStyle="font-weight:bolder" center :value="detailInfo.remark"> </u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getHeartJourney} from '@/api/invest/heartJourney'
|
||||
import { getDicts } from '@/api/system/dict/data.js'
|
||||
import {onLoad} from "@dcloudio/uni-app";
|
||||
import {reactive ,toRefs,ref,computed }from "vue";
|
||||
const id = ref('')
|
||||
const data = reactive({
|
||||
detailInfo: {}
|
||||
})
|
||||
const {detailInfo} = toRefs(data)
|
||||
onLoad((option) => {
|
||||
id.value = option.id
|
||||
getInfo()
|
||||
})
|
||||
function getInfo() {
|
||||
getHeartJourney(id.value).then(res => {
|
||||
detailInfo.value = res.data
|
||||
// 类型
|
||||
getDicts('journey_type').then(result => {
|
||||
detailInfo.value.type=dictStr(detailInfo.value.type, result.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
function dictStr(val, arr) {
|
||||
let str = ''
|
||||
arr.map(item => {
|
||||
if (item.dictValue === val) {
|
||||
str = item.dictLabel
|
||||
}
|
||||
})
|
||||
return str
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.section {
|
||||
margin: 24rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.section-title {
|
||||
width: 280rpx;
|
||||
color: #333333;
|
||||
line-height: 44rpx;
|
||||
font-size: 30rpx;
|
||||
border-left: 6rpx solid #2681FF;
|
||||
padding-left: 26rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 647rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.img-con {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx
|
||||
}
|
||||
.form-view {
|
||||
padding: 20rpx 0rpx 0 10rpx;
|
||||
|
||||
.form-btn {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,27 +1,68 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
|
||||
<view class="search-view">
|
||||
<u-input v-model="queryParams.personName" border="false" type="select" @click="handlePerson" placeholder="请选择人员" suffixIcon="search"
|
||||
suffixIconStyle="color: #909399" class="search-input">
|
||||
</u-input>
|
||||
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
|
||||
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
|
||||
</view>
|
||||
</u-sticky>
|
||||
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
|
||||
<view class="search-view">
|
||||
<u--input v-model="queryParams.name" border="false" placeholder="请输入标题" class="search-input"
|
||||
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
|
||||
</u--input>
|
||||
<u-input v-model="queryParams.time" border="false" type="select" readonly placeholder="请选择就诊时间" suffixIcon="calendar"
|
||||
suffixIconStyle="color: #909399" class="search-input">
|
||||
</u-input>
|
||||
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
|
||||
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
|
||||
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
|
||||
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
|
||||
|
||||
<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 journeyTypeList" :key="item.id" class="state-item"
|
||||
:class="item.selected ? 'active' : ''" @click="selectStatus(item)">{{ item.dictLabel }}</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="select-header">就诊时间</view>
|
||||
<view class="selcet-content" style="padding: 0 24rpx">
|
||||
<u-input
|
||||
:disabled="true"
|
||||
:disabledColor="'#fff'"
|
||||
class="dateInput"
|
||||
border="surround"
|
||||
v-model="queryParams.startTime"
|
||||
placeholder="请选择开始时间"
|
||||
>
|
||||
<template v-slot:suffix>
|
||||
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
|
||||
</template>
|
||||
</u-input>
|
||||
<u-input
|
||||
:disabled="true"
|
||||
:disabledColor="'#fff'"
|
||||
class="dateInput"
|
||||
border="surround"
|
||||
v-model="queryParams.endTime"
|
||||
placeholder="请选择结束时间"
|
||||
>
|
||||
<template v-slot:suffix>
|
||||
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
|
||||
</template>
|
||||
</u-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button text="重置" style="margin-right:20rpx" @click="resetQuery()"></u-button>
|
||||
<u-button type="primary" text="确定" @click="searchSubmit()"></u-button>
|
||||
</view>
|
||||
<u-datetime-picker
|
||||
:closeOnClickOverlay="true"
|
||||
:show="timeShow"
|
||||
v-model="time"
|
||||
mode="datetime"
|
||||
@close="openOrCloseDate"
|
||||
@cancel="openOrCloseDate"
|
||||
@confirm="confirm"
|
||||
></u-datetime-picker>
|
||||
</view>
|
||||
</u-transition>
|
||||
</view>
|
||||
@@ -29,25 +70,49 @@
|
||||
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
|
||||
<u-list-item v-for="(item, index) in listData" :key="index">
|
||||
<view class="list-item">
|
||||
<view class="item-header" @click="enterDetails(item)">
|
||||
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
|
||||
:text="item.name" size="30rpx" color="#333333" :bold="true"></u--text>
|
||||
<view class="item-header">
|
||||
<u--text lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
|
||||
:text="item.healthRecordName +':'+ item.hospitalName" size="30rpx" color="#333333" :bold="true"></u--text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">类型:</text>
|
||||
<text class="row-value">{{ dictStr(item.type, journeyTypeList) }}</text>
|
||||
<text class="row-label">就诊时间:</text>
|
||||
<text class="row-value">{{ item.visitingTime }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">记录时间:</text>
|
||||
<text class="row-value">{{ item.createTime }}</text>
|
||||
<text class="row-label">人员姓名:</text>
|
||||
<text class="row-value">{{ item.personName }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">内容:</text>
|
||||
<text class="row-label">科室:</text>
|
||||
<text class="row-value">{{ item.departments }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">大夫:</text>
|
||||
<text class="row-value">{{ item.doctor }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">陪同人:</text>
|
||||
<text class="row-value">{{ item.partner }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">总费用(元):</text>
|
||||
<text class="row-value">{{ item.totalCost }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">诊断及开药:</text>
|
||||
<text class="row-value">{{ item.prescribe }}</text>
|
||||
</view>
|
||||
|
||||
<view class="item-row">
|
||||
<text class="row-label">费用明细:</text>
|
||||
<text class="row-value">{{ item.costDetail }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">备注:</text>
|
||||
<text class="row-value">{{ item.remark }}</text>
|
||||
</view>
|
||||
<view class="operate" >
|
||||
<!-- <view class="btn filling" @click="enterDetails(item)">查看</view > -->
|
||||
<view class="btn filling" @click="handleEdit(item)">修改</view>
|
||||
<view class="btn filling" @click="handleEdit(item)">修改</view>
|
||||
<view class="btn filling" @click="handleDelete(item)">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -58,35 +123,52 @@
|
||||
</u-list>
|
||||
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
|
||||
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
|
||||
<u-picker itemHeight="88" :show="showPerson" :columns="personList" keyName="name" @cancel="handlePersonCancel"
|
||||
@confirm="handlePersonConfirm"></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listHeartJourney, delHeartJourney } from '@/api/invest/heartJourney'
|
||||
import { listDoctorRecord, delDoctorRecord } from '@/api/health/doctorRecord'
|
||||
import { listPerson } from '@/api/health/person'
|
||||
import { getDicts } from '@/api/system/dict/data.js'
|
||||
import { timeHandler } from '@/utils/common.ts'
|
||||
import {onLoad,onShow} from "@dcloudio/uni-app";
|
||||
import dayjs from 'dayjs'
|
||||
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
|
||||
import {reactive ,toRefs,ref,computed }from "vue";
|
||||
const pageNum = ref(1)
|
||||
const listData = ref([])
|
||||
const isShow = ref(false)
|
||||
const status = ref('loadmore')
|
||||
const journeyTypeList = ref([])
|
||||
const settingPickShow = ref(false)
|
||||
const settingColumns = ref([])
|
||||
const timeShow= ref(false)
|
||||
const showPerson = ref(false)
|
||||
const personList = ref([])
|
||||
|
||||
const flag= ref(true)
|
||||
const time =ref( Number(new Date()))
|
||||
const data = reactive({
|
||||
filterPanel: false,
|
||||
queryPersonParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 100
|
||||
},
|
||||
queryParams: {
|
||||
name: '',
|
||||
type: '',
|
||||
hospitalName: null,
|
||||
departments: null,
|
||||
doctor: null,
|
||||
healthRecordId: null,
|
||||
time: '',
|
||||
personId: null
|
||||
}
|
||||
})
|
||||
const { filterPanel, queryParams} = toRefs(data)
|
||||
const { filterPanel, queryPersonParams, queryParams} = toRefs(data)
|
||||
const windowHeight = computed(() => {
|
||||
uni.getSystemInfoSync().windowHeight - 50
|
||||
})
|
||||
onLoad(() => {
|
||||
getDict()
|
||||
getList()
|
||||
});
|
||||
|
||||
@@ -98,6 +180,11 @@ onLoad(() => {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function openOrCloseDate(data) {
|
||||
timeShow.value = !timeShow.value
|
||||
flag.value = data
|
||||
}
|
||||
function loadmore() {
|
||||
pageNum.value += 1
|
||||
if (status.value == 'loadmore') {
|
||||
@@ -105,8 +192,11 @@ function loadmore() {
|
||||
}
|
||||
}
|
||||
function getList() {
|
||||
listPerson(queryPersonParams.value).then((response) => {
|
||||
personList.value = [response.rows]
|
||||
})
|
||||
status.value = 'loading'
|
||||
listHeartJourney({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
|
||||
listDoctorRecord({ 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'
|
||||
@@ -117,11 +207,16 @@ function getList() {
|
||||
status.value = 'nomore'
|
||||
})
|
||||
}
|
||||
function getDict() {
|
||||
// 类型
|
||||
getDicts('journey_type').then(res => {
|
||||
journeyTypeList.value = res.data
|
||||
})
|
||||
function confirm(e) {
|
||||
const date = timeHandler(new Date(e.value), '-', ':')
|
||||
let formatValue = 'YYYY-MM-DD'
|
||||
dayjs(date).format(formatValue)
|
||||
if (flag.value) {
|
||||
queryParams.value.startTime = dayjs(date).format(formatValue)
|
||||
} else {
|
||||
queryParams.value.endTime = dayjs(date).format(formatValue)
|
||||
}
|
||||
timeShow.value = false
|
||||
}
|
||||
function settingConfirm(e) {
|
||||
queryParams.value.settingId = e.value[0].settingId
|
||||
@@ -131,53 +226,54 @@ function settingConfirm(e) {
|
||||
function settingCancel() {
|
||||
settingPickShow.value = false
|
||||
}
|
||||
function dictStr(val, arr) {
|
||||
let str = ''
|
||||
arr.map(item => {
|
||||
if (item.dictValue === val) {
|
||||
str = item.dictLabel
|
||||
}
|
||||
})
|
||||
return str
|
||||
}
|
||||
function selectStatus(item) {
|
||||
queryParams.value.type = item.dictValue
|
||||
journeyTypeList.value.map(ele => {
|
||||
if (ele.dictValue == item.dictValue) {
|
||||
ele.selected = true
|
||||
Reflect.set(ele, 'selected', true)
|
||||
} else {
|
||||
Reflect.set(ele, 'selected', false)
|
||||
}
|
||||
})
|
||||
}
|
||||
function searchSubmit() {
|
||||
if(queryParams.value.startTime!=''&&queryParams.value.startTime!=undefined&&queryParams.value.endTime!=''&&queryParams.value.endTime!=undefined){
|
||||
queryParams.value.time = queryParams.value.startTime+'-'+queryParams.value.endTime
|
||||
}
|
||||
pageNum.value = 1
|
||||
listData.value = []
|
||||
getList()
|
||||
filterPanel.value = false
|
||||
}
|
||||
function handlePerson() {
|
||||
if (personList.value[0].length === 0) {
|
||||
proxy.$refs['uToast'].show({
|
||||
message: '人员为空 ', type: 'warning'
|
||||
})
|
||||
} else {
|
||||
showPerson.value = true
|
||||
}
|
||||
}
|
||||
function handlePersonConfirm(e) {
|
||||
queryParams.value.personName = e.value[0].name
|
||||
queryParams.value.personId= e.value[0].id
|
||||
showPerson.value = false
|
||||
pageNum.value = 1
|
||||
listData.value = []
|
||||
getList()
|
||||
}
|
||||
function handlePersonCancel() {
|
||||
showPerson.value = false
|
||||
}
|
||||
function searchBlur() {
|
||||
pageNum.value = 1
|
||||
listData.value = []
|
||||
getList()
|
||||
}
|
||||
function resetQuery() {
|
||||
queryParams.value.name = '',
|
||||
queryParams.value.type = ''
|
||||
journeyTypeList.value.map(ele => {
|
||||
Reflect.set(ele, 'selected', false)
|
||||
})
|
||||
}
|
||||
function enterDetails(item) {
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/details?id=${item.id}` })
|
||||
queryParams.value.personName = ''
|
||||
queryParams.value.startTime = ''
|
||||
queryParams.value.time = ''
|
||||
|
||||
queryParams.value.endTime = ''
|
||||
queryParams.value.personId = ''
|
||||
}
|
||||
function handleEdit(item) {
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/addEdit?id=${item.id}` })
|
||||
uni.navigateTo({ url: `/pages/health/doctorRecord/addEdit?id=${item.id}` })
|
||||
isShow.value = true
|
||||
}
|
||||
function handleAdd() {
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/addEdit` })
|
||||
uni.navigateTo({ url: `/pages/health/doctorRecord/addEdit` })
|
||||
isShow.value = true
|
||||
}
|
||||
function handleDelete(item) {
|
||||
@@ -186,8 +282,8 @@ function selectStatus(item) {
|
||||
content: '你确定要删除吗',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
delHeartJourney(item.id)
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/list` })
|
||||
delDoctorRecord(item.id)
|
||||
uni.navigateTo({ url: `/pages/health/doctorRecord/list` })
|
||||
} else if (res.cancel) {
|
||||
console.log('取消');
|
||||
}
|
||||
@@ -214,7 +310,6 @@ function selectStatus(item) {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.search-input {
|
||||
background: #F5F5F5;
|
||||
|
||||
Reference in New Issue
Block a user