Commit 91dbde7452fc45e195806ed7cf33b0ee88bf8022
1 parent
4cd7e7a5
司机健康信息
Showing
3 changed files
with
392 additions
and
1 deletions
.env.development
src/api/driver/healthy/driverHealthy.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | + | |
| 4 | +// 分页查询列表 | |
| 5 | +export function listLimitOfDriverHealthy(params,page,limit) { | |
| 6 | + return request({ | |
| 7 | + url: '/driver/healthy/list/limit/'+page+'/'+limit, | |
| 8 | + method: 'post', | |
| 9 | + refreshTip:false, | |
| 10 | + params | |
| 11 | + }) | |
| 12 | +} | |
| 13 | + | |
| 14 | +// 选择列表 | |
| 15 | +export function selectListOfDriverHealthy(params) { | |
| 16 | + return request({ | |
| 17 | + url: '/driver/healthy/list/select', | |
| 18 | + method: 'post', | |
| 19 | + params | |
| 20 | + }) | |
| 21 | +} | |
| 22 | + | |
| 23 | +// 导出报表列表 | |
| 24 | +export function exportReportList(params) { | |
| 25 | + return request({ | |
| 26 | + url: '/driver/healthy/export', | |
| 27 | + method: 'get', | |
| 28 | + params | |
| 29 | + }) | |
| 30 | +} | |
| 31 | + | |
| 32 | +//查询列表详情 | |
| 33 | +export function viewOfDriverHealthy(id) { | |
| 34 | + return request({ | |
| 35 | + url: '/driver/healthy/view/'+id, | |
| 36 | + method: 'get' | |
| 37 | + }) | |
| 38 | +} | |
| 39 | + | |
| 40 | +// 添加数据 | |
| 41 | +export function addOfDriverHealthy(params) { | |
| 42 | + return request({ | |
| 43 | + url: '/driver/healthy/add', | |
| 44 | + method: 'post', | |
| 45 | + params | |
| 46 | + }) | |
| 47 | +} | |
| 48 | + | |
| 49 | +//修改数据 | |
| 50 | +export function updateOfDriverHealthy(params) { | |
| 51 | + return request({ | |
| 52 | + url: "/driver/healthy/update", | |
| 53 | + method: "post", | |
| 54 | + params | |
| 55 | + }) | |
| 56 | +} | |
| 57 | + | |
| 58 | + | |
| 59 | + //修改状态 | |
| 60 | +export function updateStatusOfDriverHealthy(params) { | |
| 61 | + return request({ | |
| 62 | + url: "/driver/healthy/update/status", | |
| 63 | + method: "post", | |
| 64 | + params | |
| 65 | + }) | |
| 66 | +} | |
| 67 | + | |
| 68 | + //删除数据 | |
| 69 | +export function deleteOfDriverHealthy(id) { | |
| 70 | + return request({ | |
| 71 | + url: "/driver/healthy/del/"+id, | |
| 72 | + method: "get" | |
| 73 | + }) | |
| 74 | +} | ... | ... |
src/views/driver/healthy/driverHealthy.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <div class="query-from"> | |
| 4 | + <el-form :inline="true" :queryOfDriverHealthy="queryOfDriverHealthy" :model="queryParamsOfDriverHealthy" class="demo-form-inline"> | |
| 5 | + <el-form-item label="司机" props="driverId"> | |
| 6 | + <el-select v-model="queryParamsOfDriverHealthy.driverId" > | |
| 7 | + <el-option v-for="item in driverIds" :key="item.id" :label="item.personnelNameAndJobCode" :value="item.id" /> | |
| 8 | + </el-select> | |
| 9 | + </el-form-item> | |
| 10 | + </el-form> | |
| 11 | + | |
| 12 | + <el-row :gutter="10" class="mb8"> | |
| 13 | + <el-col :span="1.5"> | |
| 14 | + <el-button type="primary" plain icon="Plus" @click="handleAddOfDriverHealthy" v-hasPermi="['driver:healthy:add']">新增</el-button> | |
| 15 | + | |
| 16 | + </el-col> | |
| 17 | + <el-col :span="1.5"> | |
| 18 | + <el-button type="success" plain icon="Edit" :disabled="singleDriverHealthy" @click="handleUpdateOfDriverHealthy" v-hasPermi="['driver:healthy:update']">修改</el-button> | |
| 19 | + | |
| 20 | + </el-col> | |
| 21 | + <el-col :span="1.5"> | |
| 22 | + <el-button type="danger" plain icon="Delete" :disabled=multipleDriverHealthy @click="handleDeleteOfDriverHealthy" v-hasPermi="['driver:healthy:del']">删除</el-button> | |
| 23 | + | |
| 24 | + </el-col> | |
| 25 | + <el-col :span="1.5"> | |
| 26 | + <el-button type="warning" plain icon="Download" @click="handleExportOfDriverHealthy" v-hasPermi="['driver:healthy:export']">导出</el-button> | |
| 27 | + | |
| 28 | + </el-col> | |
| 29 | + <right-toolbar v-model:showSearch="showSearchOfDriverHealthy" @queryTable="getListOfDriverHealthy"></right-toolbar> | |
| 30 | + </el-row> | |
| 31 | + </div> | |
| 32 | + | |
| 33 | + <el-table v-loading="loadingOfDriverHealthy" :data="listOfDriverHealthy" @selection-change="handleSelectionChangeOfDriverHealthy" border max-height="600" | |
| 34 | + :default-expand-all="false" :row-class-name="tableRowClassName" @sort-change="sortChangeOfDriverHealthy"> | |
| 35 | + <el-table-column type="selection" width="50" align="center" /> | |
| 36 | + <el-table-column label="序号" type="index" width="60" align="center"> | |
| 37 | + <template #default="scope"> | |
| 38 | + {{ (queryParamsOfDriverHealthy.pageNum - 1) * queryParamsOfDriverHealthy.pageSize + scope.$index + 1 }} | |
| 39 | + </template> | |
| 40 | + </el-table-column> | |
| 41 | + | |
| 42 | + <el-table-column label="ID" align="center" prop="id" sortable /> | |
| 43 | + <el-table-column label="司机ID" align="center" prop="driverId" sortable /> | |
| 44 | + <el-table-column label="血压舒张值" align="center" prop="systolicPressure" sortable /> | |
| 45 | + <el-table-column label="血压收缩值" align="center" prop="diastolicPressure" sortable /> | |
| 46 | + <el-table-column label="血氧值" align="center" prop="oxygenValue" sortable /> | |
| 47 | + <el-table-column label="心率值" align="center" prop="heartRate" sortable /> | |
| 48 | + | |
| 49 | + | |
| 50 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="160"> | |
| 51 | + <template #default="scope"> | |
| 52 | + <el-button type="success" plain icon="Edit" :disabled="singleDriverHealthy" @click="handleUpdateOfDriverHealthy(scope.row)" v-hasPermi="['driver:healthy:update']">修改</el-button> | |
| 53 | + | |
| 54 | + </template> | |
| 55 | + </el-table-column> | |
| 56 | + </el-table> | |
| 57 | + | |
| 58 | + <pagination v-show="totalOfDriverHealthy > 0" :total="totalOfDriverHealthy" v-model:pageOfDriverHealthy="queryParamsOfDriverHealthy.pageNum" v-model:limit="queryParamsOfDriverHealthy.pageSize" | |
| 59 | + @pagination="getListOfDriverHealthy" /> | |
| 60 | + | |
| 61 | + <el-dialog :title="titleOfDriverHealthy" v-model="openOfDriverHealthy" width="500px" append-to-body> | |
| 62 | + <el-form :model="formOfDriverHealthy" ref="rulesOfDriverHealthy" label-width="80px" :rules="checkRulesOfDriverHealthy"> | |
| 63 | + <el-form-item label="ID" prop="id"> | |
| 64 | + <el-input el-input="input" v-model="formOfDriverHealthy.id" placeholder="请输入ID" /> | |
| 65 | + </el-form-item> | |
| 66 | + <el-form-item label="司机" prop="driverId"> | |
| 67 | + <el-select v-model="formOfDriverHealthy.driverId" > | |
| 68 | + <el-option v-for="item in driverIds" :key="item.id" :label="item.personnelNameAndJobCode" :value="item.id" /> | |
| 69 | + </el-select> | |
| 70 | + </el-form-item> | |
| 71 | + <el-form-item label="血压舒张值" prop="systolicPressure"> | |
| 72 | + <el-input el-input="input" v-model="formOfDriverHealthy.systolicPressure" placeholder="请输入血压舒张值" /> | |
| 73 | + </el-form-item> | |
| 74 | + <el-form-item label="血压收缩值" prop="diastolicPressure"> | |
| 75 | + <el-input el-input="input" v-model="formOfDriverHealthy.diastolicPressure" placeholder="请输入血压收缩值" /> | |
| 76 | + </el-form-item> | |
| 77 | + <el-form-item label="血氧值" prop="oxygenValue"> | |
| 78 | + <el-input el-input="input" v-model="formOfDriverHealthy.oxygenValue" placeholder="请输入血氧值" /> | |
| 79 | + </el-form-item> | |
| 80 | + <el-form-item label="心率值" prop="heartRate"> | |
| 81 | + <el-input el-input="input" v-model="formOfDriverHealthy.heartRate" placeholder="请输入心率值" /> | |
| 82 | + </el-form-item> | |
| 83 | + | |
| 84 | + </el-form> | |
| 85 | + | |
| 86 | + <template #footer> | |
| 87 | + <div class="dialog-footer"> | |
| 88 | + <el-button type="primary" @click="submitFormOfDriverHealthy">确 定</el-button> | |
| 89 | + <el-button @click="cancelOfDriverHealthy">取 消</el-button> | |
| 90 | + </div> | |
| 91 | + </template> | |
| 92 | + </el-dialog> | |
| 93 | + </div> | |
| 94 | +</template> | |
| 95 | + | |
| 96 | + | |
| 97 | +<script setup name="DriverHealthy"> | |
| 98 | + import { listLimitOfDriverHealthy, viewOfDriverHealthy, addOfDriverHealthy, updateOfDriverHealthy,updateStatusOfDriverHealthy,deleteOfDriverHealthy } from "@/api/driver/healthy/driverHealthy"; | |
| 99 | + import { selectListOfDriver } from "@/api/driver/driver"; | |
| 100 | + const { proxy } = getCurrentInstance(); | |
| 101 | + | |
| 102 | + const listOfDriverHealthy = ref([]); | |
| 103 | + const openOfDriverHealthy = ref(false); | |
| 104 | + const titleOfDriverHealthy = ref(""); | |
| 105 | + const loadingOfDriverHealthy = ref(true); | |
| 106 | + const showSearchOfDriverHealthy = ref(true); | |
| 107 | + const idsOfDriverHealthy = ref([]); | |
| 108 | + const singleDriverHealthy = ref(true); | |
| 109 | + const multipleDriverHealthy = ref(true); | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + const pageOfDriverHealthy = ref(1) //第几页 | |
| 114 | + const sizeOfDriverHealthy = ref(10) //一页多少条 | |
| 115 | + const totalOfDriverHealthy = ref(0); | |
| 116 | + const pageSizesOfDriverHealthy = [5, 10, 20, 50]; //每页显示多少条 | |
| 117 | + const currentPageOfDriverHealthy = ref(1) // 当前页 | |
| 118 | + const globalRowOfDriverHealthy = ref(null) // 当前行数据 | |
| 119 | + | |
| 120 | + const changeFlagOfDriverHealthy = ref(true) | |
| 121 | + | |
| 122 | + const DriverIds=ref([]); | |
| 123 | + | |
| 124 | + const dataOfDriverHealthy = reactive({ | |
| 125 | + formOfDriverHealthy: {}, | |
| 126 | + queryParamsOfDriverHealthy: { | |
| 127 | + pageNum: 1, | |
| 128 | + pageSize: 10, | |
| 129 | + id : null, | |
| 130 | + driverId : null, | |
| 131 | + systolicPressure : null, | |
| 132 | + diastolicPressure : null, | |
| 133 | + oxygenValue : null, | |
| 134 | + heartRate : null, | |
| 135 | + createBy : null, | |
| 136 | + createTime : null, | |
| 137 | + updateBy : null, | |
| 138 | + updateTime : null, | |
| 139 | + delFlag : null, | |
| 140 | + | |
| 141 | + }, | |
| 142 | + checkRulesOfDriverHealthy: { | |
| 143 | + id : [ | |
| 144 | + { required: true, message: "ID", trigger: "blur" } | |
| 145 | + ], | |
| 146 | + driverId : [ | |
| 147 | + { required: true, message: "司机ID", trigger: "blur" } | |
| 148 | + ], | |
| 149 | + systolicPressure : [ | |
| 150 | + { required: true, message: "血压舒张值", trigger: "blur" } | |
| 151 | + ], | |
| 152 | + diastolicPressure : [ | |
| 153 | + { required: true, message: "血压收缩值", trigger: "blur" } | |
| 154 | + ], | |
| 155 | + oxygenValue : [ | |
| 156 | + { required: true, message: "血氧值", trigger: "blur" } | |
| 157 | + ], | |
| 158 | + heartRate : [ | |
| 159 | + { required: true, message: "心率值", trigger: "blur" } | |
| 160 | + ], | |
| 161 | + createBy : [ | |
| 162 | + { required: true, message: "创建人员", trigger: "blur" } | |
| 163 | + ], | |
| 164 | + createTime : [ | |
| 165 | + { required: true, message: "创建时间", trigger: "blur" } | |
| 166 | + ], | |
| 167 | + updateBy : [ | |
| 168 | + { required: true, message: "修改人员", trigger: "blur" } | |
| 169 | + ], | |
| 170 | + updateTime : [ | |
| 171 | + { required: true, message: "修改时间", trigger: "blur" } | |
| 172 | + ], | |
| 173 | + delFlag : [ | |
| 174 | + { required: true, message: "是否删除;0是不删除;1是删除", trigger: "blur" } | |
| 175 | + ], | |
| 176 | + } | |
| 177 | + }); | |
| 178 | + | |
| 179 | + const { queryParamsOfDriverHealthy, formOfDriverHealthy, checkRulesOfDriverHealthy } = toRefs(dataOfDriverHealthy ); | |
| 180 | + | |
| 181 | + /** 查询设备信息列表 */ | |
| 182 | + function getListOfDriverHealthy() { | |
| 183 | + loadingOfDriverHealthy.value = true; | |
| 184 | + listLimitOfDriverHealthy(queryParamsOfDriverHealthy.value,queryParamsOfDriverHealthy.value.pageNum,queryParamsOfDriverHealthy.value.pageSize).then(response => { | |
| 185 | + listOfDriverHealthy.value = response.records; | |
| 186 | + totalOfDriverHealthy.value = response.total; | |
| 187 | + loadingOfDriverHealthy.value = false; | |
| 188 | + }); | |
| 189 | + } | |
| 190 | + | |
| 191 | + /**排序*/ | |
| 192 | + function sortChangeOfDriverHealthy(data){ | |
| 193 | + queryParamsOfDriverHealthy.value.order=data.order; | |
| 194 | + queryParamsOfDriverHealthy.value.prop=data.prop; | |
| 195 | + getListOfDriverHealthy(); | |
| 196 | + } | |
| 197 | + | |
| 198 | + function selectDrivers(){ | |
| 199 | + selectListOfDriver().then(response=>{DriverIds.value=response.data}) | |
| 200 | + } | |
| 201 | + | |
| 202 | + // 取消按钮 | |
| 203 | + function cancelOfDriverHealthy() { | |
| 204 | + openOfDriverHealthy.value = false; | |
| 205 | + globalRowOfDriverHealthy.value = null | |
| 206 | + resetOfDriverHealthy(); | |
| 207 | + } | |
| 208 | + | |
| 209 | + const handleSizeChange = (val) => { | |
| 210 | + sizeOfDriverHealthy.value = val; | |
| 211 | + } | |
| 212 | + const handleCurrentChange = (val) => { | |
| 213 | + pageOfDriverHealthy.value = val; | |
| 214 | + } | |
| 215 | + | |
| 216 | + | |
| 217 | + // 表单重置 | |
| 218 | + function resetOfDriverHealthy() { | |
| 219 | + formOfDriverHealthy.value = { | |
| 220 | + id : null, | |
| 221 | + driverId : null, | |
| 222 | + systolicPressure : null, | |
| 223 | + diastolicPressure : null, | |
| 224 | + oxygenValue : null, | |
| 225 | + heartRate : null, | |
| 226 | + createBy : null, | |
| 227 | + createTime : null, | |
| 228 | + updateBy : null, | |
| 229 | + updateTime : null, | |
| 230 | + delFlag : null, | |
| 231 | + }; | |
| 232 | + proxy.resetForm("rulesOfDriverHealthy"); | |
| 233 | + } | |
| 234 | + | |
| 235 | + /** 搜索按钮操作 */ | |
| 236 | + function handleQueryOfDriverHealthy() { | |
| 237 | + queryParamsOfDriverHealthy.value.pageNum = 1; | |
| 238 | + getListOfDriverHealthy(); | |
| 239 | + } | |
| 240 | + | |
| 241 | + /** 重置按钮操作 */ | |
| 242 | + function resetQueryOfDriverHealthy() { | |
| 243 | + proxy.resetForm("queryOfDriverHealthy"); | |
| 244 | + handleQueryOfDriverHealthy(); | |
| 245 | + } | |
| 246 | + | |
| 247 | + // 多选框选中数据 | |
| 248 | + function handleSelectionChangeOfDriverHealthy(selection) { | |
| 249 | + idsOfDriverHealthy.value = selection.map(item => item.id); | |
| 250 | + singleDriverHealthy.value = selection.length != 1; | |
| 251 | + multipleDriverHealthy.value = !selection.length; | |
| 252 | + } | |
| 253 | + | |
| 254 | + /** 新增按钮操作 */ | |
| 255 | + function handleAddOfDriverHealthy() { | |
| 256 | + resetOfDriverHealthy(); | |
| 257 | + changeFlagOfDriverHealthy.value = true; | |
| 258 | + openOfDriverHealthy.value = true; | |
| 259 | + titleOfDriverHealthy.value = "添加"; | |
| 260 | + } | |
| 261 | + | |
| 262 | + /** 修改按钮操作 */ | |
| 263 | + function handleUpdateOfDriverHealthy(row) { | |
| 264 | + resetOfDriverHealthy(); | |
| 265 | + const _id = row.id || idsOfDriverHealthy.value | |
| 266 | + viewOfDriverHealthy(_id).then(response => { | |
| 267 | + formOfDriverHealthy.value = response.data; | |
| 268 | + openOfDriverHealthy.value = true; | |
| 269 | + titleOfDriverHealthy.value = "修改"; | |
| 270 | + }); | |
| 271 | + } | |
| 272 | + | |
| 273 | + /** 提交按钮 */ | |
| 274 | + function submitFormOfDriverHealthy() { | |
| 275 | + proxy.$refs["rulesOfDriverHealthy"].validate(valid => { | |
| 276 | + if (valid) { | |
| 277 | + if (formOfDriverHealthy.value.id != null) { | |
| 278 | + updateOfDriverHealthy(formOfDriverHealthy.value).then(response => { | |
| 279 | + proxy.$modal.msgSuccess("修改成功"); | |
| 280 | + openOfDriverHealthy.value = false; | |
| 281 | + getListOfDriverHealthy(); | |
| 282 | + }); | |
| 283 | + } else { | |
| 284 | + addOfDriverHealthy(formOfDriverHealthy.value).then(response => { | |
| 285 | + proxy.$modal.msgSuccess("新增成功"); | |
| 286 | + openOfDriverHealthy.value = false; | |
| 287 | + getListOfDriverHealthy(); | |
| 288 | + }); | |
| 289 | + } | |
| 290 | + } | |
| 291 | + }); | |
| 292 | + } | |
| 293 | + | |
| 294 | + /** 删除按钮操作 */ | |
| 295 | + function handleDeleteOfDriverHealthy(row) { | |
| 296 | + const _idsOfDriverHealthy = row.id || idsOfDriverHealthy.value; | |
| 297 | + proxy.$modal.confirm('是否确认删除 为"' + _idsOfDriverHealthy + '"的数据项?').then(function () { | |
| 298 | + return deleteOfDriverHealthy(_idsOfDriverHealthy); | |
| 299 | + }).then(() => { | |
| 300 | + getListOfDriverHealthy(); | |
| 301 | + proxy.$modal.msgSuccess("删除成功"); | |
| 302 | + }).catch(() => { }); | |
| 303 | + } | |
| 304 | + | |
| 305 | + /** 导出按钮操作 */ | |
| 306 | + function handleExportOfDriverHealthy() { | |
| 307 | + proxy.download('driver/healthy/export', { | |
| 308 | + ...queryParamsOfDriverHealthy.value | |
| 309 | + }, `DriverHealthy_${new Date().getTime()}.xlsx`) | |
| 310 | + } | |
| 311 | + | |
| 312 | + function init_DriverId(){ | |
| 313 | + ().then(res=>{DriverIds.value=res.data}); | |
| 314 | + } | |
| 315 | + | |
| 316 | + getListOfDriverHealthy(); | |
| 317 | +</script> | |
| 0 | 318 | \ No newline at end of file | ... | ... |