fix: 健康管理系统,代码修改。
This commit is contained in:
44
src/api/health/doctorRecord.js
Normal file
44
src/api/health/doctorRecord.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询就医记录列表
|
||||
export function listDoctorRecord(query) {
|
||||
return request({
|
||||
url: '/health/doctorRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询就医记录详细
|
||||
export function getDoctorRecord(id) {
|
||||
return request({
|
||||
url: '/health/doctorRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增就医记录
|
||||
export function addDoctorRecord(data) {
|
||||
return request({
|
||||
url: '/health/doctorRecord',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改就医记录
|
||||
export function updateDoctorRecord(data) {
|
||||
return request({
|
||||
url: '/health/doctorRecord',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除就医记录
|
||||
export function delDoctorRecord(id) {
|
||||
return request({
|
||||
url: '/health/doctorRecord/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/health/healthRecord.js
Normal file
44
src/api/health/healthRecord.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询健康档案列表
|
||||
export function listHealthRecord(query) {
|
||||
return request({
|
||||
url: '/health/healthRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询健康档案详细
|
||||
export function getHealthRecord(id) {
|
||||
return request({
|
||||
url: '/health/healthRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增健康档案
|
||||
export function addHealthRecord(data) {
|
||||
return request({
|
||||
url: '/health/healthRecord',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改健康档案
|
||||
export function updateHealthRecord(data) {
|
||||
return request({
|
||||
url: '/health/healthRecord',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除健康档案
|
||||
export function delHealthRecord(id) {
|
||||
return request({
|
||||
url: '/health/healthRecord/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/health/marRecord.js
Normal file
44
src/api/health/marRecord.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询用药记录列表
|
||||
export function listMarRecord(query) {
|
||||
return request({
|
||||
url: '/health/marRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用药记录详细
|
||||
export function getMarRecord(id) {
|
||||
return request({
|
||||
url: '/health/marRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增用药记录
|
||||
export function addMarRecord(data) {
|
||||
return request({
|
||||
url: '/health/marRecord',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用药记录
|
||||
export function updateMarRecord(data) {
|
||||
return request({
|
||||
url: '/health/marRecord',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用药记录
|
||||
export function delMarRecord(id) {
|
||||
return request({
|
||||
url: '/health/marRecord/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/health/person.js
Normal file
44
src/api/health/person.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询成员管理列表
|
||||
export function listPerson(query) {
|
||||
return request({
|
||||
url: '/health/person/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询成员管理详细
|
||||
export function getPerson(id) {
|
||||
return request({
|
||||
url: '/health/person/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增成员管理
|
||||
export function addPerson(data) {
|
||||
return request({
|
||||
url: '/health/person',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改成员管理
|
||||
export function updatePerson(data) {
|
||||
return request({
|
||||
url: '/health/person',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除成员管理
|
||||
export function delPerson(id) {
|
||||
return request({
|
||||
url: '/health/person/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/health/temperatureRecord.js
Normal file
44
src/api/health/temperatureRecord.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询体温记录列表
|
||||
export function listTemperatureRecord(query) {
|
||||
return request({
|
||||
url: '/health/temperatureRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询体温记录详细
|
||||
export function getTemperatureRecord(id) {
|
||||
return request({
|
||||
url: '/health/temperatureRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增体温记录
|
||||
export function addTemperatureRecord(data) {
|
||||
return request({
|
||||
url: '/health/temperatureRecord',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改体温记录
|
||||
export function updateTemperatureRecord(data) {
|
||||
return request({
|
||||
url: '/health/temperatureRecord',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除体温记录
|
||||
export function delTemperatureRecord(id) {
|
||||
return request({
|
||||
url: '/health/temperatureRecord/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/health/weightRecord.js
Normal file
44
src/api/health/weightRecord.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询体重记录列表
|
||||
export function listWeightRecord(query) {
|
||||
return request({
|
||||
url: '/health/weightRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询体重记录详细
|
||||
export function getWeightRecord(id) {
|
||||
return request({
|
||||
url: '/health/weightRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增体重记录
|
||||
export function addWeightRecord(data) {
|
||||
return request({
|
||||
url: '/health/weightRecord',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改体重记录
|
||||
export function updateWeightRecord(data) {
|
||||
return request({
|
||||
url: '/health/weightRecord',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除体重记录
|
||||
export function delWeightRecord(id) {
|
||||
return request({
|
||||
url: '/health/weightRecord/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -52,7 +52,7 @@ getDefaultTitle()
|
||||
|
||||
const title = ref('')
|
||||
function getDefaultTitle() {
|
||||
getConfigKey('defaultTitle').then((res) => {
|
||||
getConfigKey('healthTitle').then((res) => {
|
||||
title.value = res.msg
|
||||
})
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export const constantRoutes = [
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: '/accountCalendar'
|
||||
redirect: '/health/healthRecord'
|
||||
// children: [
|
||||
// {
|
||||
// path: '/index',
|
||||
|
||||
@@ -17,7 +17,7 @@ export function useDynamicTitle() {
|
||||
let title = defaultSettings.title
|
||||
|
||||
function getDefaultTitle() {
|
||||
getConfigKey('defaultTitle').then((res) => {
|
||||
getConfigKey('healthTitle').then((res) => {
|
||||
title = res.msg
|
||||
})
|
||||
}
|
||||
|
||||
331
src/views/health/doctorRecord/index.vue
Normal file
331
src/views/health/doctorRecord/index.vue
Normal file
@@ -0,0 +1,331 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="queryParams.personId" placeholder="请选择人员" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="医院名称" prop="hospitalName">
|
||||
<el-input v-model="queryParams.hospitalName" placeholder="请输入医院名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="科室" prop="departments">
|
||||
<el-input v-model="queryParams.departments" placeholder="请输入科室" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="大夫" prop="doctor">
|
||||
<el-input v-model="queryParams.doctor" placeholder="请输入大夫" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="就诊时间" prop="visitingTime">
|
||||
<el-date-picker clearable v-model="queryParams.visitingTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择就诊时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:doctorRecord:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:doctorRecord:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:doctorRecord:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="doctorRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="人员姓名" align="center" prop="personName" />
|
||||
<el-table-column label="健康档案" align="center" prop="healthRecordName" />
|
||||
<el-table-column label="医院名称" align="center" prop="hospitalName" />
|
||||
<el-table-column label="科室" align="center" prop="departments" />
|
||||
<el-table-column label="大夫" align="center" prop="doctor" />
|
||||
<el-table-column label="就诊时间" align="center" prop="visitingTime" width="180"> </el-table-column>
|
||||
<el-table-column label="诊断及开药" align="center" prop="prescribe" />
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改就医记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="880px" append-to-body>
|
||||
<el-form ref="doctorRecordRef" :model="form" :inline="true" :rules="rules" label-width="120px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="form.personId" placeholder="请选择人员姓名" @change="handlePersonChange" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="健康档案" prop="healthRecordId">
|
||||
<el-select v-model="form.healthRecordId" placeholder="请选择健康档案" clearable>
|
||||
<el-option v-for="health in healthRecordList" :key="health.id" :label="health.name" :value="health.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="医院名称" prop="hospitalName">
|
||||
<el-input v-model="form.hospitalName" placeholder="请输入医院名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="科室" prop="departments">
|
||||
<el-input v-model="form.departments" placeholder="请输入科室" />
|
||||
</el-form-item>
|
||||
<el-form-item label="大夫" prop="doctor">
|
||||
<el-input v-model="form.doctor" placeholder="请输入大夫" />
|
||||
</el-form-item>
|
||||
<el-form-item label="就诊时间" prop="visitingTime">
|
||||
<el-date-picker clearable v-model="form.visitingTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择就诊时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="诊断及开药" style="width: 792px" prop="prescribe">
|
||||
<el-input v-model="form.prescribe" type="textarea" placeholder="请输入诊断及开药" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" style="width: 792px" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看就医记录'" #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DoctorRecord">
|
||||
import { listDoctorRecord, getDoctorRecord, delDoctorRecord, addDoctorRecord, updateDoctorRecord } from '@/api/health/doctorRecord'
|
||||
import { listPerson, getPerson } from '@/api/health/person'
|
||||
import { listHealthRecord } from '@/api/health/healthRecord'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const doctorRecordList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
const personList = ref([])
|
||||
const healthRecordList = ref([])
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:doctorRecord:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:doctorRecord:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:doctorRecord:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
hospitalName: null,
|
||||
departments: null,
|
||||
doctor: null,
|
||||
healthRecordId: null,
|
||||
visitingTime: null,
|
||||
personId: null
|
||||
},
|
||||
queryPersonParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000
|
||||
},
|
||||
queryHealthRecordParams: {
|
||||
pageNum: 1,
|
||||
personId: null,
|
||||
state: '1',
|
||||
pageSize: 1000
|
||||
},
|
||||
rules: {
|
||||
personId: [{ required: true, message: '人员姓名不能为空', trigger: 'blur' }],
|
||||
hospitalName: [{ required: true, message: '医院名称不能为空', trigger: 'blur' }],
|
||||
departments: [{ required: true, message: '科室不能为空', trigger: 'blur' }],
|
||||
doctor: [{ required: true, message: '大夫不能为空', trigger: 'blur' }],
|
||||
// healthRecordId: [
|
||||
// { required: true, message: '健康档案不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
visitingTime: [{ required: true, message: '就诊时间不能为空', trigger: 'blur' }],
|
||||
prescribe: [{ required: true, message: '诊断及开药不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, form, rules, queryPersonParams, queryHealthRecordParams } = toRefs(data)
|
||||
|
||||
const handlePersonChange = (personId) => {
|
||||
queryHealthRecordParams.personId = personId
|
||||
listHealthRecord(queryHealthRecordParams).then((response) => {
|
||||
healthRecordList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询就医记录列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listDoctorRecord(queryParams.value).then((response) => {
|
||||
doctorRecordList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
/** 查询成员管理列表 */
|
||||
function getPersonList() {
|
||||
listPerson(queryPersonParams.value).then((response) => {
|
||||
personList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
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
|
||||
}
|
||||
proxy.resetForm('doctorRecordRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看就医记录'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加就医记录'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getDoctorRecord(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改就医记录'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.doctorRecordRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateDoctorRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addDoctorRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delDoctorRecord(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/doctorRecord/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`doctorRecord_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList()
|
||||
getPersonList()
|
||||
</script>
|
||||
355
src/views/health/healthRecord/index.vue
Normal file
355
src/views/health/healthRecord/index.vue
Normal file
@@ -0,0 +1,355 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="queryParams.personId" placeholder="请选择人员" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="档案名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入档案名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable>
|
||||
<el-option v-for="dict in record_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="发生原因" prop="etiology">
|
||||
<el-select v-model="queryParams.etiology" placeholder="请选择发生原因" clearable>
|
||||
<el-option v-for="dict in etiology" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="档案状态" prop="state">
|
||||
<el-select v-model="queryParams.state" placeholder="请选择档案状态" clearable>
|
||||
<el-option v-for="dict in health_record_state" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:healthRecord:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:healthRecord:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:healthRecord:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="healthRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="人员姓名" align="center" prop="personName" />
|
||||
<el-table-column label="档案名称" align="center" prop="name" />
|
||||
<el-table-column label="类型" align="center" prop="type">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="record_type" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="档案状态" align="center" prop="state">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="health_record_state" :value="scope.row.state" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发生时间" align="center" prop="occurTime" width="180"> </el-table-column>
|
||||
<el-table-column label="发生原因" align="center" prop="etiology">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="etiology" :value="scope.row.etiology" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="初期症状" align="center" prop="initialSymptoms" />
|
||||
<el-table-column label="中期症状" align="center" prop="mediumTermSymptoms" />
|
||||
<el-table-column label="后期症状" align="center" prop="laterStageSymptoms" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改健康档案对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="880px" append-to-body>
|
||||
<el-form ref="healthRecordRef" :model="form" :inline="true" :rules="rules" label-width="120px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="form.personId" placeholder="请选择人员" @change="handlePersonChange" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="档案名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入档案名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择类型">
|
||||
<el-option v-for="dict in record_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="档案状态" prop="state">
|
||||
<el-select v-model="form.state" placeholder="请选择档案状态">
|
||||
<el-option v-for="dict in health_record_state" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="发生时间" prop="occurTime">
|
||||
<el-date-picker clearable v-model="form.occurTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择发生时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="发生原因" prop="etiology">
|
||||
<el-select v-model="form.etiology" placeholder="请选择类型">
|
||||
<el-option v-for="dict in etiology" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="初期症状" style="width: 792px" prop="initialSymptoms">
|
||||
<el-input v-model="form.initialSymptoms" type="textarea" placeholder="请输入初期症状" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="中期症状" style="width: 792px" prop="mediumTermSymptoms">
|
||||
<el-input v-model="form.mediumTermSymptoms" type="textarea" placeholder="请输入中期症状" />
|
||||
</el-form-item>
|
||||
<el-form-item label="后期症状" style="width: 792px" prop="laterStageSymptoms">
|
||||
<el-input v-model="form.laterStageSymptoms" type="textarea" placeholder="请输入后期症状" />
|
||||
</el-form-item>
|
||||
<el-form-item label="康复时间" style="width: 792px" prop="rehabilitationTime">
|
||||
<el-date-picker clearable v-model="form.rehabilitationTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择康复时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" style="width: 792px" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看健康档案'" #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="HealthRecord">
|
||||
import { listHealthRecord, getHealthRecord, delHealthRecord, addHealthRecord, updateHealthRecord } from '@/api/health/healthRecord'
|
||||
import { listPerson, getPerson } from '@/api/health/person'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { record_type, etiology, health_record_state } = proxy.useDict('record_type', 'etiology', 'health_record_state')
|
||||
|
||||
const healthRecordList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
const personList = ref([])
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:healthRecord:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:healthRecord:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:healthRecord:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
type: null,
|
||||
etiology: null,
|
||||
personId: null,
|
||||
state: null
|
||||
},
|
||||
queryPersonParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: '档案名称不能为空', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '类型不能为空', trigger: 'change' }],
|
||||
occurTime: [{ required: true, message: '发生时间不能为空', trigger: 'blur' }],
|
||||
initialSymptoms: [{ required: true, message: '初期症状不能为空', trigger: 'blur' }],
|
||||
etiology: [{ required: true, message: '发生原因不能为空', trigger: 'blur' }],
|
||||
personId: [{ required: true, message: '人员id不能为空', trigger: 'blur' }],
|
||||
state: [{ required: true, message: '档案状态不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, form, rules, queryPersonParams } = toRefs(data)
|
||||
|
||||
const handlePersonChange = (personId) => {
|
||||
getPerson(personId).then((response) => {
|
||||
form.value.name = response.data.name
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询健康档案列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listHealthRecord(queryParams.value).then((response) => {
|
||||
healthRecordList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
/** 查询成员管理列表 */
|
||||
function getPersonList() {
|
||||
listPerson(queryPersonParams.value).then((response) => {
|
||||
personList.value = response.rows
|
||||
})
|
||||
}
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
name: null,
|
||||
type: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
occurTime: null,
|
||||
rehabilitationTime: null,
|
||||
initialSymptoms: null,
|
||||
mediumTermSymptoms: null,
|
||||
laterStageSymptoms: null,
|
||||
etiology: null,
|
||||
personId: null,
|
||||
state: '1'
|
||||
}
|
||||
proxy.resetForm('healthRecordRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看健康档案'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加健康档案'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getHealthRecord(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改健康档案'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.healthRecordRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateHealthRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addHealthRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delHealthRecord(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/healthRecord/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`healthRecord_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList()
|
||||
getPersonList()
|
||||
</script>
|
||||
363
src/views/health/marRecord/index.vue
Normal file
363
src/views/health/marRecord/index.vue
Normal file
@@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="queryParams.personId" placeholder="请选择人员姓名" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用药名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入用药名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用药类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择用药类型" clearable>
|
||||
<el-option v-for="dict in mar_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="药品来源" prop="resource">
|
||||
<el-select v-model="queryParams.resource" placeholder="请选择药品来源" clearable>
|
||||
<el-option v-for="dict in mar_resource" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用药地点" prop="place">
|
||||
<el-select v-model="queryParams.place" placeholder="请选择用药地点" clearable>
|
||||
<el-option v-for="dict in mar_place" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用药时间" prop="dosingTime">
|
||||
<el-date-picker clearable v-model="queryParams.dosingTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择用药时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:marRecord:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:marRecord:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:marRecord:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="marRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="人员姓名" align="center" prop="personName" />
|
||||
<el-table-column label="健康档案" align="center" prop="healthRecordName" />
|
||||
<el-table-column label="用药名称" align="center" prop="name" />
|
||||
<el-table-column label="用药类型" align="center" prop="type">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="mar_type" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="药品来源" align="center" prop="resource">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="mar_resource" :value="scope.row.resource" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用药地点" align="center" prop="place">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="mar_place" :value="scope.row.place" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用药时间" align="center" prop="dosingTime" width="180"> </el-table-column>
|
||||
<el-table-column label="用药剂量" align="center" prop="dosage" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改用药记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="880px" append-to-body>
|
||||
<el-form ref="marRecordRef" :model="form" :inline="true" :rules="rules" label-width="120px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="form.personId" placeholder="请选择人员姓名" @change="handlePersonChange" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="健康档案" prop="healthRecordId">
|
||||
<el-select v-model="form.healthRecordId" placeholder="请选择健康档案" clearable>
|
||||
<el-option v-for="health in healthRecordList" :key="health.id" :label="health.name" :value="health.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用药名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入用药名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用药类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择用药类型">
|
||||
<el-option v-for="dict in mar_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="药品来源" prop="resource">
|
||||
<el-select v-model="form.resource" placeholder="请选择药品来源">
|
||||
<el-option v-for="dict in mar_resource" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用药地点" prop="place">
|
||||
<el-select v-model="form.place" placeholder="请选择用药地点">
|
||||
<el-option v-for="dict in mar_place" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用药时间" prop="dosingTime">
|
||||
<el-date-picker clearable v-model="form.dosingTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择用药时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="用药剂量" prop="dosage">
|
||||
<el-input v-model="form.dosage" placeholder="请输入用药剂量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" style="width: 792px" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看用药记录'" #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MarRecord">
|
||||
import { listMarRecord, getMarRecord, delMarRecord, addMarRecord, updateMarRecord } from '@/api/health/marRecord'
|
||||
import { listPerson, getPerson } from '@/api/health/person'
|
||||
import { listHealthRecord } from '@/api/health/healthRecord'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { mar_type, mar_place, mar_resource } = proxy.useDict('mar_type', 'mar_place', 'mar_resource')
|
||||
|
||||
const marRecordList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
const personList = ref([])
|
||||
const healthRecordList = ref([])
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:marRecord:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:marRecord:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:marRecord:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
type: null,
|
||||
healthRecordId: null,
|
||||
dosingTime: null,
|
||||
dosage: null,
|
||||
personId: null,
|
||||
resource: null,
|
||||
place: null
|
||||
},
|
||||
queryPersonParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000
|
||||
},
|
||||
queryHealthRecordParams: {
|
||||
pageNum: 1,
|
||||
personId: null,
|
||||
state: '1',
|
||||
pageSize: 1000
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: '用药名称不能为空', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '用药类型,1退烧,2消炎,3止咳,4止泻,5抗病毒不能为空', trigger: 'change' }],
|
||||
dosingTime: [{ required: true, message: '用药时间不能为空', trigger: 'blur' }],
|
||||
dosage: [{ required: true, message: '用药剂量不能为空', trigger: 'blur' }],
|
||||
resource: [{ required: true, message: '药品来源不能为空', trigger: 'blur' }],
|
||||
place: [{ required: true, message: '用药地点不能为空', trigger: 'blur' }],
|
||||
personId: [{ required: true, message: '人员姓名不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, form, rules, queryPersonParams, queryHealthRecordParams } = toRefs(data)
|
||||
|
||||
const handlePersonChange = (personId) => {
|
||||
queryHealthRecordParams.personId = personId
|
||||
listHealthRecord(queryHealthRecordParams).then((response) => {
|
||||
healthRecordList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询成员管理列表 */
|
||||
function getPersonList() {
|
||||
listPerson(queryPersonParams.value).then((response) => {
|
||||
personList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询用药记录列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMarRecord(queryParams.value).then((response) => {
|
||||
marRecordList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
name: null,
|
||||
type: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
healthRecordId: null,
|
||||
dosingTime: null,
|
||||
dosage: null,
|
||||
personId: null,
|
||||
resource: '1',
|
||||
place: '1'
|
||||
}
|
||||
proxy.resetForm('marRecordRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看用药记录'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加用药记录'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getMarRecord(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改用药记录'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.marRecordRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateMarRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addMarRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delMarRecord(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/marRecord/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`marRecord_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList()
|
||||
getPersonList()
|
||||
</script>
|
||||
295
src/views/health/person/index.vue
Normal file
295
src/views/health/person/index.vue
Normal file
@@ -0,0 +1,295 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="昵称" prop="nickName">
|
||||
<el-input v-model="queryParams.nickName" placeholder="请输入昵称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable>
|
||||
<el-option v-for="dict in person_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:person:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:person:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:person:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="personList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="姓名" align="center" prop="name" />
|
||||
<el-table-column label="昵称" align="center" prop="nickName" />
|
||||
<el-table-column label="类型" align="center" prop="type">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="person_type" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生日" align="center" prop="birthday" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="年龄" align="center" prop="age" />
|
||||
<el-table-column label="身高(CM)" align="center" prop="height" />
|
||||
<el-table-column label="体重(KG)" align="center" prop="weight" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改成员管理对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="personRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="昵称" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入昵称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择类型">
|
||||
<el-option v-for="dict in person_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="生日" prop="birthday">
|
||||
<el-date-picker clearable v-model="form.birthday" type="date" value-format="YYYY-MM-DD" placeholder="请选择生日"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="身高" prop="height">
|
||||
<el-input v-model="form.height" type="number" placeholder="请输入身高">
|
||||
<template #suffix>CM</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="体重" prop="weight">
|
||||
<el-input v-model="form.weight" type="number" placeholder="请输入体重">
|
||||
<template #suffix>KG</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看成员管理'" #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Person">
|
||||
import { listPerson, getPerson, delPerson, addPerson, updatePerson } from '@/api/health/person'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { person_type } = proxy.useDict('person_type')
|
||||
|
||||
const personList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:person:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:person:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:person:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
type: null,
|
||||
nickName: null
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '类型不能为空', trigger: 'change' }],
|
||||
birthday: [{ required: true, message: '生日不能为空', trigger: 'blur' }],
|
||||
nickName: [{ required: true, message: '昵称不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询成员管理列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listPerson(queryParams.value).then((response) => {
|
||||
personList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
name: null,
|
||||
type: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
birthday: null,
|
||||
nickName: null,
|
||||
height: null,
|
||||
weight: null
|
||||
}
|
||||
proxy.resetForm('personRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看成员管理'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加成员管理'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getPerson(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改成员管理'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.personRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updatePerson(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addPerson(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delPerson(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/person/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`person_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList()
|
||||
</script>
|
||||
308
src/views/health/temperatureRecord/index.vue
Normal file
308
src/views/health/temperatureRecord/index.vue
Normal file
@@ -0,0 +1,308 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="queryParams.personId" placeholder="请选择人员姓名" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="测量时间" prop="measureTime">
|
||||
<el-date-picker clearable v-model="queryParams.measureTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择测量时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:temperatureRecord:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:temperatureRecord:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:temperatureRecord:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="temperatureRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="人员姓名" align="center" prop="personName" />
|
||||
<el-table-column label="健康档案" align="center" prop="healthRecordName" />
|
||||
<el-table-column label="测量时间" align="center" prop="measureTime" width="180"> </el-table-column>
|
||||
<el-table-column label="体温(℃)" align="center" prop="temperature" />
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改体温记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="temperatureRecordRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="form.personId" placeholder="请选择人员姓名" @change="handlePersonChange" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="健康档案" prop="healthRecordId">
|
||||
<el-select v-model="form.healthRecordId" placeholder="请选择健康档案" clearable>
|
||||
<el-option v-for="health in healthRecordList" :key="health.id" :label="health.name" :value="health.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="测量时间" prop="measureTime">
|
||||
<el-date-picker clearable v-model="form.measureTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择测量时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="体温" prop="temperature">
|
||||
<el-input v-model="form.temperature" type="number" placeholder="请输入体温">
|
||||
<template #suffix>℃</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看体温记录'" #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="TemperatureRecord">
|
||||
import {
|
||||
listTemperatureRecord,
|
||||
getTemperatureRecord,
|
||||
delTemperatureRecord,
|
||||
addTemperatureRecord,
|
||||
updateTemperatureRecord
|
||||
} from '@/api/health/temperatureRecord'
|
||||
import { listPerson, getPerson } from '@/api/health/person'
|
||||
import { listHealthRecord } from '@/api/health/healthRecord'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const temperatureRecordList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
const personList = ref([])
|
||||
const healthRecordList = ref([])
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:temperatureRecord:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:temperatureRecord:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:temperatureRecord:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
healthRecordId: null,
|
||||
measureTime: null,
|
||||
temperature: null,
|
||||
personId: null
|
||||
},
|
||||
queryPersonParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000
|
||||
},
|
||||
queryHealthRecordParams: {
|
||||
pageNum: 1,
|
||||
personId: null,
|
||||
state: '1',
|
||||
pageSize: 1000
|
||||
},
|
||||
rules: {
|
||||
personId: [{ required: true, message: '人员姓名不能为空', trigger: 'blur' }],
|
||||
measureTime: [{ required: true, message: '测量时间不能为空', trigger: 'blur' }],
|
||||
temperature: [{ required: true, message: '体温不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, form, rules, queryPersonParams, queryHealthRecordParams } = toRefs(data)
|
||||
|
||||
const handlePersonChange = (personId) => {
|
||||
queryHealthRecordParams.personId = personId
|
||||
listHealthRecord(queryHealthRecordParams).then((response) => {
|
||||
healthRecordList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询成员管理列表 */
|
||||
function getPersonList() {
|
||||
listPerson(queryPersonParams.value).then((response) => {
|
||||
personList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询体温记录列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listTemperatureRecord(queryParams.value).then((response) => {
|
||||
temperatureRecordList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
healthRecordId: null,
|
||||
measureTime: null,
|
||||
temperature: null,
|
||||
personId: null
|
||||
}
|
||||
proxy.resetForm('temperatureRecordRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看体温记录'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加体温记录'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getTemperatureRecord(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改体温记录'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.temperatureRecordRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateTemperatureRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addTemperatureRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delTemperatureRecord(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/temperatureRecord/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`temperatureRecord_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList()
|
||||
getPersonList()
|
||||
</script>
|
||||
274
src/views/health/weightRecord/index.vue
Normal file
274
src/views/health/weightRecord/index.vue
Normal file
@@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="queryParams.personId" placeholder="请选择人员姓名" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="测量时间" prop="measureTime">
|
||||
<el-date-picker clearable v-model="queryParams.measureTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择测量时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['health:weightRecord:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['health:weightRecord:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['health:weightRecord:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="weightRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="人员姓名" align="center" prop="personName" />
|
||||
<el-table-column label="测量时间" align="center" prop="measureTime" width="180"> </el-table-column>
|
||||
<el-table-column label="体重" align="center" prop="weight" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改体重记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="weightRecordRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="人员姓名" prop="personId">
|
||||
<el-select v-model="form.personId" placeholder="请选择人员姓名" @change="handlePersonChange" clearable>
|
||||
<el-option v-for="person in personList" :key="person.id" :label="person.name" :value="person.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="测量时间" prop="measureTime">
|
||||
<el-date-picker clearable v-model="form.measureTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择测量时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="体重" prop="weight">
|
||||
<el-input v-model="form.weight" placeholder="请输入体重" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看体重记录'" #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="WeightRecord">
|
||||
import { listWeightRecord, getWeightRecord, delWeightRecord, addWeightRecord, updateWeightRecord } from '@/api/health/weightRecord'
|
||||
import { listPerson, getPerson } from '@/api/health/person'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const weightRecordList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
const personList = ref([])
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['health:weightRecord:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['health:weightRecord:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['health:weightRecord:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
personId: null
|
||||
},
|
||||
queryPersonParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000
|
||||
},
|
||||
rules: {
|
||||
personId: [{ required: true, message: '人员姓名不能为空', trigger: 'blur' }],
|
||||
measureTime: [{ required: true, message: '测量时间不能为空', trigger: 'blur' }],
|
||||
weight: [{ required: true, message: '体重不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, form, rules, queryPersonParams } = toRefs(data)
|
||||
|
||||
/** 查询成员管理列表 */
|
||||
function getPersonList() {
|
||||
listPerson(queryPersonParams.value).then((response) => {
|
||||
personList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询体重记录列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listWeightRecord(queryParams.value).then((response) => {
|
||||
weightRecordList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
measureTime: null,
|
||||
weight: null,
|
||||
personId: null
|
||||
}
|
||||
proxy.resetForm('weightRecordRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看体重记录'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加体重记录'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getWeightRecord(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改体重记录'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.weightRecordRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateWeightRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addWeightRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delWeightRecord(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'health/weightRecord/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`weightRecord_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList()
|
||||
getPersonList()
|
||||
</script>
|
||||
@@ -130,13 +130,13 @@ function getCode() {
|
||||
}
|
||||
|
||||
function getDefaultBg() {
|
||||
getConfigKey('defaultBg').then((res) => {
|
||||
getConfigKey('healthBg').then((res) => {
|
||||
defaultBg.value = res.msg
|
||||
})
|
||||
}
|
||||
|
||||
function getDefaultTitle() {
|
||||
getConfigKey('defaultTitle').then((res) => {
|
||||
getConfigKey('healthTitle').then((res) => {
|
||||
title.value = res.msg
|
||||
document.title = res.msg
|
||||
})
|
||||
|
||||
@@ -42,8 +42,8 @@ export default defineConfig(({ mode, command }) => {
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
'/dev-api': {
|
||||
// target: 'http://154.8.147.51:8288',
|
||||
target: 'http://127.0.0.1:8080',
|
||||
target: 'http://154.8.147.51:8288',
|
||||
// target: 'http://127.0.0.1:8080',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user