|
@@ -8,15 +8,20 @@
|
|
|
label-width="90px"
|
|
label-width="90px"
|
|
|
>
|
|
>
|
|
|
<TenantSelect v-model="queryParams.tenantIds" placeholder="请选择机构名称" prop="tenantIds" />
|
|
<TenantSelect v-model="queryParams.tenantIds" placeholder="请选择机构名称" prop="tenantIds" />
|
|
|
|
|
+ <el-form-item label="长者姓名" prop="elderName">
|
|
|
|
|
+ <el-input v-model="queryParams.elderName" placeholder="请输入长者姓名" class="!w-240px" />
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="记录日期" prop="recordDate">
|
|
<el-form-item label="记录日期" prop="recordDate">
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
type="daterange"
|
|
type="daterange"
|
|
|
- value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
|
+ format="YYYY-MM-DD"
|
|
|
|
|
+ date-format="YYYY-MM-DD"
|
|
|
start-placeholder="开始日期"
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
end-placeholder="结束日期"
|
|
|
- :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
|
|
v-model="queryParams.recordDate"
|
|
v-model="queryParams.recordDate"
|
|
|
class="!w-240px"
|
|
class="!w-240px"
|
|
|
|
|
+ @clear="handleDateClose"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
@@ -29,11 +34,11 @@
|
|
|
<ContentWrap>
|
|
<ContentWrap>
|
|
|
<div class="mb-10px" style="display:flex;align-items:center;justify-content: space-between;gap: 10px;">
|
|
<div class="mb-10px" style="display:flex;align-items:center;justify-content: space-between;gap: 10px;">
|
|
|
<div style="display:flex;align-items:center;gap: 10px;">
|
|
<div style="display:flex;align-items:center;gap: 10px;">
|
|
|
- <el-button type="primary" plain @click="openForm()">
|
|
|
|
|
|
|
+ <el-button type="primary" plain @click="openForm()" v-hasPermi="['elderly:blood-glucose:add']">
|
|
|
<Icon icon="ep:plus" class="mr-5px" />
|
|
<Icon icon="ep:plus" class="mr-5px" />
|
|
|
新增
|
|
新增
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <el-button type="success" plain @click="handleExport">
|
|
|
|
|
|
|
+ <el-button type="warning" plain @click="exportExcel" v-hasPermi="['elderly:blood-glucose:export']">
|
|
|
<Icon icon="ep:download" class="mr-5px" />
|
|
<Icon icon="ep:download" class="mr-5px" />
|
|
|
导出
|
|
导出
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -47,8 +52,8 @@
|
|
|
:queryParams="queryParams"
|
|
:queryParams="queryParams"
|
|
|
>
|
|
>
|
|
|
<template #pre="{scope}">
|
|
<template #pre="{scope}">
|
|
|
- <el-button link type="primary" @click="openForm(scope.row, 2)">编辑</el-button>
|
|
|
|
|
- <el-button link type="primary" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
|
|
|
|
+ <el-button link type="primary" @click="openForm(scope, 2)" v-hasPermi="['elderly:blood-glucose:edit']">编辑</el-button>
|
|
|
|
|
+ <el-button link type="danger" @click="handleDelete(scope)" v-hasPermi="['elderly:blood-glucose:delete']">删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</Table2>
|
|
</Table2>
|
|
|
|
|
|
|
@@ -67,11 +72,13 @@
|
|
|
import { reactive, ref } from 'vue'
|
|
import { reactive, ref } from 'vue'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
import Form from './component/form.vue'
|
|
import Form from './component/form.vue'
|
|
|
|
|
+import { DICT_TYPE } from '@/utils/dict'
|
|
|
import {
|
|
import {
|
|
|
deleteBloodGlucose,
|
|
deleteBloodGlucose,
|
|
|
- exportBloodGlucoseExcel,
|
|
|
|
|
- getBloodGlucosePage
|
|
|
|
|
|
|
+ getBloodGlucosePage,
|
|
|
|
|
+ exportBloodGlucoseExcel
|
|
|
} from '@/api/elderly/assess/blood-glucose'
|
|
} from '@/api/elderly/assess/blood-glucose'
|
|
|
|
|
+import download from '@/utils/download'
|
|
|
|
|
|
|
|
defineOptions({ name: 'BloodGlucose' })
|
|
defineOptions({ name: 'BloodGlucose' })
|
|
|
|
|
|
|
@@ -87,21 +94,26 @@ const queryParams = reactive({
|
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
tenantIds: userStore.orgTenantId,
|
|
tenantIds: userStore.orgTenantId,
|
|
|
- recordDate: undefined
|
|
|
|
|
|
|
+ recordDate: undefined,
|
|
|
|
|
+ elderName: undefined
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const queryFormRef = ref()
|
|
const queryFormRef = ref()
|
|
|
|
|
|
|
|
const columns = reactive([
|
|
const columns = reactive([
|
|
|
- { label: '所属机构', field: 'tenantName', type: '99' },
|
|
|
|
|
{ label: '长者姓名', field: 'elderName' },
|
|
{ label: '长者姓名', field: 'elderName' },
|
|
|
{ label: '房间号', field: 'roomName' },
|
|
{ label: '房间号', field: 'roomName' },
|
|
|
- { label: '性别', field: 'elderSexText' },
|
|
|
|
|
|
|
+ { label: '床位号', field: 'bedName' },
|
|
|
|
|
+ { label: '性别', field: 'elderSex', type: '1', dictArr: DICT_TYPE.SYSTEM_USER_SEX },
|
|
|
{ label: '记录日期', field: 'recordDate' },
|
|
{ label: '记录日期', field: 'recordDate' },
|
|
|
- { label: '血糖值', field: 'bloodGlucoseValue' },
|
|
|
|
|
|
|
+ { label: '血糖值', field: 'bloodSugar' },
|
|
|
{ label: '备注', field: 'remark' },
|
|
{ label: '备注', field: 'remark' },
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
|
|
+const handleDateClose = () => {
|
|
|
|
|
+ queryParams.recordDate = undefined
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
try {
|
|
try {
|
|
@@ -129,9 +141,10 @@ const resetQuery = () => {
|
|
|
const formRef = ref()
|
|
const formRef = ref()
|
|
|
const openForm = (row: any = {}, type: number = 1) => {
|
|
const openForm = (row: any = {}, type: number = 1) => {
|
|
|
if (queryParams.tenantIds.length == 0 || (queryParams.tenantIds.length > 1 && !row.tenantId)) {
|
|
if (queryParams.tenantIds.length == 0 || (queryParams.tenantIds.length > 1 && !row.tenantId)) {
|
|
|
- message.error('新增只能选择一个机构')
|
|
|
|
|
|
|
+ message.error(`${type === 1 ? '新增' : '编辑'}只能选择一个机构`)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log('row', row)
|
|
|
formRef.value.open(row.tenantId || queryParams.tenantIds[0], row.id, type)
|
|
formRef.value.open(row.tenantId || queryParams.tenantIds[0], row.id, type)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -144,8 +157,13 @@ const handleDelete = async (row: any) => {
|
|
|
} catch {}
|
|
} catch {}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const handleExport = async () => {
|
|
|
|
|
- await exportBloodGlucoseExcel(queryParams)
|
|
|
|
|
|
|
+const exportExcel = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await message.exportConfirm()
|
|
|
|
|
+ const data = await exportBloodGlucoseExcel(queryParams)
|
|
|
|
|
+ download.excel(data, '血糖记录.xls')
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|