|
|
@@ -11,12 +11,14 @@
|
|
|
<el-form-item label="记录日期" prop="recordDate">
|
|
|
<el-date-picker
|
|
|
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="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
- :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
v-model="queryParams.recordDate"
|
|
|
class="!w-240px"
|
|
|
+ @clear="handleDateClose"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
@@ -27,16 +29,12 @@
|
|
|
</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;" v-hasPermi="['elderly:blood-glucose:add']">
|
|
|
<div style="display:flex;align-items:center;gap: 10px;">
|
|
|
<el-button type="primary" plain @click="openForm()">
|
|
|
<Icon icon="ep:plus" class="mr-5px" />
|
|
|
新增
|
|
|
</el-button>
|
|
|
- <el-button type="success" plain @click="handleExport">
|
|
|
- <Icon icon="ep:download" class="mr-5px" />
|
|
|
- 导出
|
|
|
- </el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -47,8 +45,8 @@
|
|
|
:queryParams="queryParams"
|
|
|
>
|
|
|
<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>
|
|
|
</Table2>
|
|
|
|
|
|
@@ -67,9 +65,9 @@
|
|
|
import { reactive, ref } from 'vue'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
import Form from './component/form.vue'
|
|
|
+import { DICT_TYPE } from '@/utils/dict'
|
|
|
import {
|
|
|
deleteBloodGlucose,
|
|
|
- exportBloodGlucoseExcel,
|
|
|
getBloodGlucosePage
|
|
|
} from '@/api/elderly/assess/blood-glucose'
|
|
|
|
|
|
@@ -93,15 +91,19 @@ const queryParams = reactive({
|
|
|
const queryFormRef = ref()
|
|
|
|
|
|
const columns = reactive([
|
|
|
- { label: '所属机构', field: 'tenantName', type: '99' },
|
|
|
{ label: '长者姓名', field: 'elderName' },
|
|
|
{ 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: 'bloodGlucoseValue' },
|
|
|
+ { label: '血糖值', field: 'bloodSugar' },
|
|
|
{ label: '备注', field: 'remark' },
|
|
|
])
|
|
|
|
|
|
+const handleDateClose = () => {
|
|
|
+ queryParams.recordDate = undefined
|
|
|
+}
|
|
|
+
|
|
|
const getList = async () => {
|
|
|
loading.value = true
|
|
|
try {
|
|
|
@@ -129,9 +131,10 @@ const resetQuery = () => {
|
|
|
const formRef = ref()
|
|
|
const openForm = (row: any = {}, type: number = 1) => {
|
|
|
if (queryParams.tenantIds.length == 0 || (queryParams.tenantIds.length > 1 && !row.tenantId)) {
|
|
|
- message.error('新增只能选择一个机构')
|
|
|
+ message.error(`${type === 1 ? '新增' : '编辑'}只能选择一个机构`)
|
|
|
return
|
|
|
}
|
|
|
+ console.log('row', row)
|
|
|
formRef.value.open(row.tenantId || queryParams.tenantIds[0], row.id, type)
|
|
|
}
|
|
|
|
|
|
@@ -144,10 +147,6 @@ const handleDelete = async (row: any) => {
|
|
|
} catch {}
|
|
|
}
|
|
|
|
|
|
-const handleExport = async () => {
|
|
|
- await exportBloodGlucoseExcel(queryParams)
|
|
|
-}
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
getList()
|
|
|
})
|