|
@@ -203,9 +203,23 @@
|
|
|
>
|
|
>
|
|
|
<el-button slot="append" icon="el-icon-search" @click="searchIndicators"></el-button>
|
|
<el-button slot="append" icon="el-icon-search" @click="searchIndicators"></el-button>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="indicatorCateId"
|
|
|
|
|
+ placeholder="选择指标分类"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ style="width: 180px; margin-right: 10px;"
|
|
|
|
|
+ @change="handleIndicatorCateChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in indicatorCateOptions"
|
|
|
|
|
+ :key="item.dictValue"
|
|
|
|
|
+ :label="item.dictLabel"
|
|
|
|
|
+ :value="item.dictValue">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddIndicator">添加指标</el-button>
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddIndicator">添加指标</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-table :data="indicatorList" style="width: 100%">
|
|
|
|
|
|
|
+ <el-table :data="indicatorList" style="width: 100%" v-loading="indicatorLoading">
|
|
|
<el-table-column prop="indicatorName" label="指标名称" />
|
|
<el-table-column prop="indicatorName" label="指标名称" />
|
|
|
<el-table-column prop="testValue" label="检测值" />
|
|
<el-table-column prop="testValue" label="检测值" />
|
|
|
<el-table-column prop="refRange" label="参考范围" />
|
|
<el-table-column prop="refRange" label="参考范围" />
|
|
@@ -225,60 +239,16 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
- </el-tab-pane>
|
|
|
|
|
-
|
|
|
|
|
- <el-tab-pane label="查体" name="examination">
|
|
|
|
|
- <el-form :model="form" label-width="120px">
|
|
|
|
|
- <el-form-item label="一般情况" prop="generalCondition">
|
|
|
|
|
- <el-input v-model="form.generalCondition" type="textarea" rows="2" placeholder="请输入一般情况"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="皮肤粘膜" prop="skinAndMucosa">
|
|
|
|
|
- <el-input v-model="form.skinAndMucosa" type="textarea" rows="2" placeholder="请输入皮肤粘膜情况"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="淋巴结" prop="lymphNodes">
|
|
|
|
|
- <el-input v-model="form.lymphNodes" type="textarea" rows="2" placeholder="请输入淋巴结情况"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="头颈" prop="head">
|
|
|
|
|
- <el-input v-model="form.head" type="textarea" rows="2" placeholder="请输入头颈检查情况"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="颈部" prop="neck">
|
|
|
|
|
- <el-input v-model="form.neck" type="textarea" rows="2" placeholder="请输入颈部情况"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="胸部" prop="chest">
|
|
|
|
|
- <el-input v-model="form.chest" type="textarea" rows="2" placeholder="请输入胸部情况"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="心脏" prop="heart">
|
|
|
|
|
- <el-input v-model="form.heart" type="textarea" rows="2" placeholder="请输入心脏情况"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="肺部" prop="lungs">
|
|
|
|
|
- <el-input v-model="form.lungs" type="textarea" rows="2" placeholder="请输入肺部情况"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="腹部" prop="abdomen">
|
|
|
|
|
- <el-input v-model="form.abdomen" type="textarea" rows="2" placeholder="请输入腹部情况"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- </el-tab-pane>
|
|
|
|
|
-
|
|
|
|
|
- <el-tab-pane label="肝脏功能" name="liverFunction">
|
|
|
|
|
- <el-table :data="liverFunctionList" style="width: 100%">
|
|
|
|
|
- <el-table-column prop="indicatorName" label="检测项目" />
|
|
|
|
|
- <el-table-column prop="testValue" label="检测值" />
|
|
|
|
|
- <el-table-column prop="refRange" label="参考范围" />
|
|
|
|
|
- <el-table-column label="结果评价" align="center">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <el-tag v-if="scope.row.isAbnormal === 0" type="success">正常</el-tag>
|
|
|
|
|
- <el-tag v-else-if="scope.row.abnormalType === '偏高'" type="danger">偏高</el-tag>
|
|
|
|
|
- <el-tag v-else-if="scope.row.abnormalType === '偏低'" type="warning">偏低</el-tag>
|
|
|
|
|
- <el-tag v-else-if="scope.row.isAbnormal === 1" type="danger">异常</el-tag>
|
|
|
|
|
- <span v-else>-</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="操作" width="100">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <el-button type="text" size="small" @click="editIndicator(scope.row)">编辑</el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 指标检查分页 -->
|
|
|
|
|
+ <pagination
|
|
|
|
|
+ v-show="indicatorTotal > 0"
|
|
|
|
|
+ :total="indicatorTotal"
|
|
|
|
|
+ :page.sync="indicatorQueryParams.pageNum"
|
|
|
|
|
+ :limit.sync="indicatorQueryParams.pageSize"
|
|
|
|
|
+ @pagination="loadIndicators"
|
|
|
|
|
+ style="margin-top: 15px;"
|
|
|
|
|
+ />
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
|
|
|
|
@@ -403,6 +373,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import { listReport, getReport, delReport, addReport, updateReport } from "@/api/medical/report";
|
|
import { listReport, getReport, delReport, addReport, updateReport } from "@/api/medical/report";
|
|
|
import { parseTime } from "@/utils/common";
|
|
import { parseTime } from "@/utils/common";
|
|
|
|
|
+import { getDicts } from "@/api/system/dict/data";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "Report",
|
|
name: "Report",
|
|
@@ -422,6 +393,8 @@ export default {
|
|
|
total: 0,
|
|
total: 0,
|
|
|
// 体检报告表格数据
|
|
// 体检报告表格数据
|
|
|
reportList: [],
|
|
reportList: [],
|
|
|
|
|
+ indicatorCateId: '', // 选中的指标分类ID
|
|
|
|
|
+ indicatorCateOptions: [], // 指标分类选项列表
|
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
|
title: "",
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
@@ -505,13 +478,39 @@ export default {
|
|
|
abnormalType: [
|
|
abnormalType: [
|
|
|
{ required: true, message: "异常类型不能为空", trigger: "blur" }
|
|
{ required: true, message: "异常类型不能为空", trigger: "blur" }
|
|
|
]
|
|
]
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ // 指标检查分页参数
|
|
|
|
|
+ indicatorQueryParams: {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ reportId: null, // 报告ID
|
|
|
|
|
+ indicatorName: '', // 指标名称
|
|
|
|
|
+ indicatorCateId: '', // 指标分类ID
|
|
|
|
|
+ isAbnormal: null // 是否异常
|
|
|
|
|
+ },
|
|
|
|
|
+ // 指标检查加载状态
|
|
|
|
|
+ indicatorLoading: false,
|
|
|
|
|
+ // 指标检查总条数
|
|
|
|
|
+ indicatorTotal: 0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
this.getList();
|
|
this.getList();
|
|
|
|
|
+ this.loadIndicatorCateDict(); // 加载指标分类字典
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 加载指标分类字典数据
|
|
|
|
|
+ */
|
|
|
|
|
+ loadIndicatorCateDict() {
|
|
|
|
|
+ getDicts('user_custom_type').then(response => {
|
|
|
|
|
+ this.indicatorCateOptions = response.data || [];
|
|
|
|
|
+ console.log('指标分类字典加载成功:', this.indicatorCateOptions);
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ console.error("加载指标分类字典失败", error);
|
|
|
|
|
+ this.$message.error("加载指标分类字典失败");
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
parseTime,
|
|
parseTime,
|
|
|
/** 查询体检报告列表 */
|
|
/** 查询体检报告列表 */
|
|
|
getList() {
|
|
getList() {
|
|
@@ -561,12 +560,44 @@ export default {
|
|
|
this.liverFunctionList = [];
|
|
this.liverFunctionList = [];
|
|
|
// 重置当前tab
|
|
// 重置当前tab
|
|
|
this.activeTab = 'bodyInfo';
|
|
this.activeTab = 'bodyInfo';
|
|
|
|
|
+ // 重置指标查询参数
|
|
|
|
|
+ this.indicatorQueryParams = {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ reportId: null,
|
|
|
|
|
+ indicatorName: '',
|
|
|
|
|
+ indicatorCateId: '',
|
|
|
|
|
+ isAbnormal: null
|
|
|
|
|
+ };
|
|
|
|
|
+ this.indicatorSearch = '';
|
|
|
|
|
+ this.indicatorCateId = '';
|
|
|
|
|
+ this.indicatorTotal = 0;
|
|
|
},
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
|
|
|
+ // 搜索指标
|
|
|
|
|
+ searchIndicators() {
|
|
|
|
|
+ if (!this.form.reportId) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 重置到第一页
|
|
|
|
|
+ this.indicatorQueryParams.pageNum = 1;
|
|
|
|
|
+ this.indicatorQueryParams.reportId = this.form.reportId;
|
|
|
|
|
+ this.loadIndicators(this.form.reportId);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 指标分类筛选变化处理
|
|
|
|
|
+ */
|
|
|
|
|
+ handleIndicatorCateChange(value) {
|
|
|
|
|
+ this.indicatorCateId = value;
|
|
|
|
|
+ this.searchIndicators();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
resetQuery() {
|
|
|
this.resetForm("queryForm");
|
|
this.resetForm("queryForm");
|
|
@@ -592,6 +623,11 @@ export default {
|
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
this.title = "修改体检报告";
|
|
this.title = "修改体检报告";
|
|
|
|
|
+
|
|
|
|
|
+ // 设置指标查询参数
|
|
|
|
|
+ this.indicatorQueryParams.reportId = reportId;
|
|
|
|
|
+ this.indicatorQueryParams.pageNum = 1;
|
|
|
|
|
+
|
|
|
// 获取指标数据
|
|
// 获取指标数据
|
|
|
this.loadIndicators(reportId);
|
|
this.loadIndicators(reportId);
|
|
|
// 获取肝功能数据
|
|
// 获取肝功能数据
|
|
@@ -642,51 +678,80 @@ export default {
|
|
|
|
|
|
|
|
// 加载指标数据
|
|
// 加载指标数据
|
|
|
loadIndicators(reportId) {
|
|
loadIndicators(reportId) {
|
|
|
|
|
+ this.indicatorLoading = true; // 开始加载
|
|
|
|
|
+
|
|
|
|
|
+ // 如果有reportId参数,更新查询参数
|
|
|
|
|
+ if (reportId) {
|
|
|
|
|
+ this.indicatorQueryParams.reportId = reportId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 调用API从后端获取报告相关的指标检查结果
|
|
// 调用API从后端获取报告相关的指标检查结果
|
|
|
- import('@/api/medical/reportIndicator').then(module => {
|
|
|
|
|
- const { listByReportId } = module;
|
|
|
|
|
- listByReportId(reportId).then(response => {
|
|
|
|
|
- // 过滤出非肝功能相关的指标
|
|
|
|
|
- this.indicatorList = response.data.filter(item => item.category !== '肝脏' && item.indicatorCategory !== '肝脏');
|
|
|
|
|
|
|
+ return import('@/api/medical/reportIndicator').then(module => {
|
|
|
|
|
+ const { listResult } = module;
|
|
|
|
|
+ const query = {
|
|
|
|
|
+ reportId: this.indicatorQueryParams.reportId,
|
|
|
|
|
+ pageNum: this.indicatorQueryParams.pageNum,
|
|
|
|
|
+ pageSize: this.indicatorQueryParams.pageSize,
|
|
|
|
|
+ indicatorName: this.indicatorSearch || undefined,
|
|
|
|
|
+ indicatorCateId: this.indicatorCateId || undefined,
|
|
|
|
|
+ isAbnormal: this.indicatorQueryParams.isAbnormal || undefined
|
|
|
|
|
+ };
|
|
|
|
|
+ return listResult(query).then(response => {
|
|
|
|
|
+ this.indicatorList = response.data.list;
|
|
|
|
|
+ this.indicatorTotal = response.data.total;
|
|
|
|
|
+ this.indicatorLoading = false; // 结束加载
|
|
|
|
|
+ return this.indicatorList; // 返回过滤后的数据
|
|
|
});
|
|
});
|
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
|
console.error("加载指标数据失败", error);
|
|
console.error("加载指标数据失败", error);
|
|
|
this.$message.error("加载指标数据失败");
|
|
this.$message.error("加载指标数据失败");
|
|
|
|
|
+ this.indicatorLoading = false; // 结束加载
|
|
|
|
|
+ throw error; // 重新抛出错误
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 加载肝功能数据
|
|
// 加载肝功能数据
|
|
|
loadLiverFunction(reportId) {
|
|
loadLiverFunction(reportId) {
|
|
|
// 调用API从后端获取报告相关的肝功能检查结果
|
|
// 调用API从后端获取报告相关的肝功能检查结果
|
|
|
- import('@/api/medical/reportIndicator').then(module => {
|
|
|
|
|
- const { listByReportId } = module;
|
|
|
|
|
- listByReportId(reportId).then(response => {
|
|
|
|
|
|
|
+ return import('@/api/medical/reportIndicator').then(module => {
|
|
|
|
|
+ const { listResult } = module;
|
|
|
|
|
+ const query = {
|
|
|
|
|
+ reportId: reportId,
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 1000 // 获取足够多的数据
|
|
|
|
|
+ };
|
|
|
|
|
+ return listResult(query).then(response => {
|
|
|
// 过滤出肝功能相关的指标
|
|
// 过滤出肝功能相关的指标
|
|
|
- this.liverFunctionList = response.data.filter(item => item.category === '肝脏' || item.indicatorCategory === '肝脏');
|
|
|
|
|
|
|
+ this.liverFunctionList = response.data.list.filter(item => item.category === '肝脏' || item.indicatorCategory === '肝脏');
|
|
|
|
|
+ return this.liverFunctionList; // 返回过滤后的数据
|
|
|
});
|
|
});
|
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
|
console.error("加载肝功能数据失败", error);
|
|
console.error("加载肝功能数据失败", error);
|
|
|
this.$message.error("加载肝功能数据失败");
|
|
this.$message.error("加载肝功能数据失败");
|
|
|
|
|
+ throw error; // 重新抛出错误
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 搜索指标
|
|
// 搜索指标
|
|
|
searchIndicators() {
|
|
searchIndicators() {
|
|
|
- if (!this.indicatorSearch) {
|
|
|
|
|
- // 如果搜索框为空,重新加载所有指标
|
|
|
|
|
- this.loadIndicators(this.form.reportId);
|
|
|
|
|
|
|
+ if (!this.form.reportId) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 根据搜索条件过滤指标
|
|
|
|
|
- const keyword = this.indicatorSearch.toLowerCase();
|
|
|
|
|
- this.indicatorList = this.indicatorList.filter(item => {
|
|
|
|
|
- return (item.indicatorName && item.indicatorName.toLowerCase().includes(keyword)) ||
|
|
|
|
|
- (item.testValue && String(item.testValue).toLowerCase().includes(keyword)) ||
|
|
|
|
|
- (item.testResult && item.testResult.toLowerCase().includes(keyword));
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 重置到第一页
|
|
|
|
|
+ this.indicatorQueryParams.pageNum = 1;
|
|
|
|
|
+ this.indicatorQueryParams.reportId = this.form.reportId;
|
|
|
|
|
+ this.loadIndicators(this.form.reportId);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 重置指标筛选条件
|
|
|
|
|
+ */
|
|
|
|
|
+ resetIndicatorFilter() {
|
|
|
|
|
+ this.indicatorSearch = '';
|
|
|
|
|
+ this.indicatorCateId = '';
|
|
|
|
|
+ this.searchIndicators();
|
|
|
|
|
+ },
|
|
|
// 查看指标详情
|
|
// 查看指标详情
|
|
|
viewIndicatorDetail(indicator) {
|
|
viewIndicatorDetail(indicator) {
|
|
|
this.currentIndicator = indicator;
|
|
this.currentIndicator = indicator;
|
|
@@ -770,7 +835,7 @@ export default {
|
|
|
this.$message.success("添加指标成功");
|
|
this.$message.success("添加指标成功");
|
|
|
this.indicatorSelectVisible = false;
|
|
this.indicatorSelectVisible = false;
|
|
|
// 重新加载指标数据
|
|
// 重新加载指标数据
|
|
|
- this.loadIndicators(this.form.reportId);
|
|
|
|
|
|
|
+ this.loadIndicators();
|
|
|
// 重新加载肝功能数据
|
|
// 重新加载肝功能数据
|
|
|
this.loadLiverFunction(this.form.reportId);
|
|
this.loadLiverFunction(this.form.reportId);
|
|
|
});
|
|
});
|
|
@@ -829,7 +894,7 @@ export default {
|
|
|
this.$message.success("更新指标结果成功");
|
|
this.$message.success("更新指标结果成功");
|
|
|
this.indicatorResultDialogVisible = false;
|
|
this.indicatorResultDialogVisible = false;
|
|
|
// 重新加载指标数据
|
|
// 重新加载指标数据
|
|
|
- this.loadIndicators(this.form.reportId);
|
|
|
|
|
|
|
+ this.loadIndicators();
|
|
|
// 重新加载肝功能数据
|
|
// 重新加载肝功能数据
|
|
|
this.loadLiverFunction(this.form.reportId);
|
|
this.loadLiverFunction(this.form.reportId);
|
|
|
});
|
|
});
|