<template>
|
<div class="ethics-review-list">
|
<!-- 查询条件 -->
|
<el-card class="search-card">
|
<el-form
|
:model="queryParams"
|
ref="queryForm"
|
:inline="true"
|
label-width="100px"
|
>
|
<el-form-item label="住院号" prop="hospitalNo">
|
<el-input
|
v-model="queryParams.hospitalNo"
|
placeholder="请输入住院号"
|
clearable
|
style="width: 200px"
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="捐献者姓名" prop="donorName">
|
<el-input
|
v-model="queryParams.donorName"
|
placeholder="请输入捐献者姓名"
|
clearable
|
style="width: 200px"
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="伦理结论" prop="ethicsConclusion">
|
<el-select
|
v-model="queryParams.ethicsConclusion"
|
placeholder="请选择伦理结论"
|
clearable
|
style="width: 200px"
|
>
|
<el-option label="审查中" value="reviewing" />
|
<el-option label="同意" value="approved" />
|
<el-option label="修改后同意" value="approved_with_modifications" />
|
<el-option label="修改后重审" value="re-review" />
|
<el-option label="不同意" value="disapproved" />
|
<el-option label="终止审查" value="terminated" />
|
</el-select>
|
</el-form-item>
|
<el-form-item label="审查时间范围" prop="reviewTimeRange">
|
<el-date-picker
|
v-model="queryParams.reviewTimeRange"
|
type="daterange"
|
range-separator="至"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
value-format="yyyy-MM-dd"
|
style="width: 240px"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery"
|
>搜索</el-button
|
>
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
</el-form-item>
|
</el-form>
|
</el-card>
|
|
<!-- 操作按钮 -->
|
<el-card class="tool-card">
|
<el-row :gutter="10">
|
<el-col :span="16">
|
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
>新建审查</el-button
|
>
|
<el-button
|
type="success"
|
icon="el-icon-edit"
|
:disabled="single"
|
@click="handleUpdate"
|
>修改</el-button
|
>
|
<el-button
|
type="danger"
|
icon="el-icon-delete"
|
:disabled="multiple"
|
@click="handleDelete"
|
>删除</el-button
|
>
|
<el-button
|
type="warning"
|
icon="el-icon-download"
|
@click="handleExport"
|
>导出</el-button
|
>
|
<el-button
|
type="info"
|
icon="el-icon-check"
|
:disabled="multiple"
|
@click="handleEndReview"
|
>结束审查</el-button
|
>
|
</el-col>
|
<el-col :span="8" style="text-align: right">
|
<el-tooltip content="刷新" placement="top">
|
<el-button icon="el-icon-refresh" circle @click="getList" />
|
</el-tooltip>
|
</el-col>
|
</el-row>
|
</el-card>
|
|
<!-- 数据表格 -->
|
<el-card>
|
<el-table
|
v-loading="loading"
|
:data="ethicsReviewList"
|
@selection-change="handleSelectionChange"
|
>
|
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column
|
label="住院号"
|
align="center"
|
prop="hospitalNo"
|
width="120"
|
/>
|
<el-table-column
|
label="捐献者姓名"
|
align="center"
|
prop="donorName"
|
width="120"
|
/>
|
<el-table-column label="性别" align="center" prop="gender" width="80">
|
<template slot-scope="scope">
|
<dict-tag
|
:options="dict.type.sys_user_sex"
|
:value="parseInt(scope.row.gender)"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column label="年龄" align="center" prop="age" width="80" />
|
<el-table-column
|
label="疾病诊断"
|
align="center"
|
prop="diagnosis"
|
min-width="180"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="伦理结论"
|
align="center"
|
prop="ethicsConclusion"
|
width="120"
|
>
|
<template slot-scope="scope">
|
<el-tag :type="conclusionFilter(scope.row.ethicsConclusion)">
|
{{ conclusionTextFilter(scope.row.ethicsConclusion) }}
|
</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="伦理意见"
|
align="center"
|
prop="ethicsOpinion"
|
min-width="200"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="审查时间"
|
align="center"
|
prop="reviewTime"
|
width="160"
|
>
|
<template slot-scope="scope">
|
<span>{{
|
scope.row.reviewTime
|
? parseTime(scope.row.reviewTime, "{y}-{m}-{d} {h}:{i}")
|
: "-"
|
}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="登记时间"
|
align="center"
|
prop="registrationTime"
|
width="160"
|
>
|
<template slot-scope="scope">
|
<span>{{
|
scope.row.registrationTime
|
? parseTime(scope.row.registrationTime, "{y}-{m}-{d} {h}:{i}")
|
: "-"
|
}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="登记人"
|
align="center"
|
prop="registrant"
|
width="100"
|
/>
|
<el-table-column
|
label="操作"
|
align="center"
|
width="260"
|
class-name="small-padding fixed-width"
|
>
|
<template slot-scope="scope">
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-view"
|
@click="handleView(scope.row)"
|
>详情</el-button
|
>
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-edit"
|
@click="handleUpdate(scope.row)"
|
>修改</el-button
|
>
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-check"
|
@click="handleEndReview(scope.row)"
|
:disabled="scope.row.ethicsConclusion === 'terminated'"
|
>结束</el-button
|
>
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-delete"
|
style="color: #F56C6C"
|
@click="handleDelete(scope.row)"
|
>删除</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<!-- 分页组件 -->
|
<pagination
|
v-show="total > 0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</el-card>
|
</div>
|
</template>
|
|
<script>
|
import { listEthicsReview, delEthicsReview, exportEthicsReview, endEthicsReview } from "./ethicsReview";
|
import Pagination from "@/components/Pagination";
|
|
export default {
|
name: "EthicsReviewList",
|
components: { Pagination },
|
dicts: ["sys_user_sex"],
|
data() {
|
return {
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 总条数
|
total: 0,
|
// 伦理审查表格数据
|
ethicsReviewList: [],
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
hospitalNo: undefined,
|
donorName: undefined,
|
ethicsConclusion: undefined,
|
reviewTimeRange: []
|
}
|
};
|
},
|
created() {
|
this.getList();
|
},
|
methods: {
|
// 伦理结论过滤器
|
conclusionFilter(conclusion) {
|
const conclusionMap = {
|
"reviewing": "warning", // 审查中
|
"approved": "success", // 同意
|
"approved_with_modifications": "primary", // 修改后同意
|
"re-review": "info", // 修改后重审
|
"disapproved": "danger", // 不同意
|
"terminated": "info" // 终止审查
|
};
|
return conclusionMap[conclusion] || "info";
|
},
|
conclusionTextFilter(conclusion) {
|
const conclusionMap = {
|
"reviewing": "审查中",
|
"approved": "同意",
|
"approved_with_modifications": "修改后同意",
|
"re-review": "修改后重审",
|
"disapproved": "不同意",
|
"terminated": "终止审查"
|
};
|
return conclusionMap[conclusion] || "未知";
|
},
|
// 查询伦理审查列表
|
getList() {
|
this.loading = true;
|
listEthicsReview(this.queryParams)
|
.then(response => {
|
if (response.code === 200) {
|
this.ethicsReviewList = response.data.rows;
|
this.total = response.data.total;
|
} else {
|
this.$message.error("获取数据失败");
|
}
|
this.loading = false;
|
})
|
.catch(error => {
|
console.error("获取伦理审查列表失败:", error);
|
this.loading = false;
|
this.$message.error("获取数据失败");
|
});
|
},
|
// 搜索按钮操作
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
// 重置按钮操作
|
resetQuery() {
|
this.$refs.queryForm.resetFields();
|
this.handleQuery();
|
},
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map(item => item.id);
|
this.single = selection.length !== 1;
|
this.multiple = !selection.length;
|
},
|
// 查看详情
|
handleView(row) {
|
this.$router.push({
|
path: "/case/ethicalReviewInfo",
|
query: { id: row.id }
|
});
|
},
|
// 新增按钮操作
|
handleCreate() {
|
this.$router.push("/case/ethicalReviewInfo");
|
},
|
// 修改按钮操作
|
handleUpdate(row) {
|
const id = row.id || this.ids[0];
|
this.$router.push({
|
path: "/case/ethicalReviewInfo",
|
query: { id: id }
|
});
|
},
|
// 删除按钮操作
|
handleDelete(row) {
|
const ids = row.id ? [row.id] : this.ids;
|
this.$confirm("是否确认删除选中的数据项?", "警告", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
return delEthicsReview(ids);
|
})
|
.then(response => {
|
if (response.code === 200) {
|
this.$message.success("删除成功");
|
this.getList();
|
}
|
})
|
.catch(() => {});
|
},
|
// 结束审查操作
|
handleEndReview(row) {
|
const ids = row.id ? [row.id] : this.ids;
|
this.$confirm("是否确认结束选中的审查项目?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
return endEthicsReview(ids);
|
})
|
.then(response => {
|
if (response.code === 200) {
|
this.$message.success("审查已结束");
|
this.getList();
|
}
|
})
|
.catch(() => {});
|
},
|
// 导出按钮操作
|
handleExport() {
|
const queryParams = this.queryParams;
|
this.$confirm("是否确认导出所有伦理审查数据?", "警告", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
this.loading = true;
|
return exportEthicsReview(queryParams);
|
})
|
.then(response => {
|
if (response.code === 200) {
|
this.$message.success("导出成功");
|
}
|
this.loading = false;
|
})
|
.catch(() => {
|
this.loading = false;
|
});
|
},
|
// 时间格式化
|
parseTime(time, pattern) {
|
if (!time) return "";
|
const format = pattern || "{y}-{m}-{d} {h}:{i}:{s}";
|
let date;
|
if (typeof time === "object") {
|
date = time;
|
} else {
|
if (typeof time === "string" && /^[0-9]+$/.test(time)) {
|
time = parseInt(time);
|
}
|
if (typeof time === "number" && time.toString().length === 10) {
|
time = time * 1000;
|
}
|
date = new Date(time);
|
}
|
const formatObj = {
|
y: date.getFullYear(),
|
m: date.getMonth() + 1,
|
d: date.getDate(),
|
h: date.getHours(),
|
i: date.getMinutes(),
|
s: date.getSeconds(),
|
a: date.getDay()
|
};
|
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
let value = formatObj[key];
|
if (key === "a") {
|
return ["日", "一", "二", "三", "四", "五", "六"][value];
|
}
|
if (result.length > 0 && value < 10) {
|
value = "0" + value;
|
}
|
return value || 0;
|
});
|
return time_str;
|
}
|
}
|
};
|
</script>
|
|
<style scoped>
|
.ethics-review-list {
|
padding: 20px;
|
}
|
|
.search-card {
|
margin-bottom: 20px;
|
}
|
|
.tool-card {
|
margin-bottom: 20px;
|
}
|
|
.fixed-width .el-button {
|
margin: 0 5px;
|
}
|
</style>
|