<template>
|
<el-dialog
|
title="临近超时任务"
|
:visible.sync="visible"
|
width="78%"
|
:close-on-click-modal="false"
|
append-to-body
|
class="near-timeout-dialog"
|
>
|
<el-alert
|
v-if="taskList.length > 0"
|
type="warning"
|
:closable="false"
|
show-icon
|
:title="'共有 ' + taskList.length + ' 条任务在未来48小时内到期,请及时处理'"
|
/>
|
|
<el-table
|
v-loading="loading"
|
:data="taskList"
|
border
|
stripe
|
class="near-timeout-table"
|
style="width: 100%"
|
>
|
<el-table-column
|
label="任务名称"
|
prop="taskName"
|
min-width="140"
|
show-overflow-tooltip
|
align="center"
|
/>
|
<el-table-column label="姓名" prop="sendname" width="90" align="center" />
|
<el-table-column
|
label="诊断名称"
|
prop="leavediagname"
|
min-width="140"
|
show-overflow-tooltip
|
align="center"
|
/>
|
<el-table-column label="随访状态" width="100" align="center">
|
<template slot-scope="scope">
|
<el-tag
|
v-if="scope.row.sendstate == 2"
|
type="primary"
|
:disable-transitions="false"
|
>待随访</el-tag
|
>
|
<el-tag v-else type="info" :disable-transitions="false">--</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column label="应随访日期" width="150" align="center">
|
<template slot-scope="scope">
|
<span>{{ formatTime(scope.row.visitTime) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="科室" prop="deptname" width="120" align="center" />
|
<el-table-column
|
label="病区"
|
prop="leavehospitaldistrictname"
|
width="140"
|
align="center"
|
/>
|
<el-table-column label="联系电话" prop="phone" width="130" align="center" />
|
<el-table-column label="操作" width="110" align="center" fixed="right">
|
<template slot-scope="scope">
|
<el-button size="medium" type="text" @click="handleDetail(scope.row)">
|
<i class="el-icon-s-order"></i>查看详情
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" @click="visible = false">关 闭</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
|
<script>
|
import { getNearTimeoutList } from "@/api/AiCentre/index";
|
|
// 登录后自动弹出临近超时任务的机构白名单
|
const TARGET_ORGS = ["景宁畲族自治县人民医院", "浙江省新华医院"];
|
|
export default {
|
name: "NearTimeoutDialog",
|
data() {
|
return {
|
visible: false,
|
loading: false,
|
taskList: [],
|
};
|
},
|
computed: {
|
isTargetOrg() {
|
const orgname = localStorage.getItem("orgname") || "";
|
return TARGET_ORGS.indexOf(orgname) !== -1;
|
},
|
},
|
mounted() {
|
// 供随访工作台卡片点击打开
|
this.$root.$on("open-near-timeout", this.open);
|
|
// 登录后(非登录页)自动弹出
|
if (this.isTargetOrg) {
|
this.open();
|
}
|
},
|
beforeDestroy() {
|
this.$root.$off("open-near-timeout", this.open);
|
},
|
methods: {
|
async open() {
|
if (!this.isTargetOrg) {
|
this.$modal.msgWarning("当前机构暂未开通临近超时任务");
|
return;
|
}
|
this.visible = true;
|
await this.loadList();
|
},
|
async loadList() {
|
this.loading = true;
|
try {
|
const res = await getNearTimeoutList({ pageNum: 1, pageSize: 100 });
|
this.taskList = res.rows || [];
|
} catch (e) {
|
console.error("加载临近超时任务失败:", e);
|
this.taskList = [];
|
} finally {
|
this.loading = false;
|
}
|
},
|
// 跳转详情页(与出院随访列表 Seedetails 保持一致)
|
handleDetail(row) {
|
let type = "";
|
if (row.type == 1) {
|
type = 1;
|
}
|
this.$router.push({
|
path: "/followvisit/record/detailpage/",
|
query: {
|
taskid: row.taskid,
|
patid: row.patid,
|
id: row.id,
|
Voicetype: type,
|
visitCount: row.visitCount || 1,
|
},
|
});
|
this.visible = false;
|
},
|
formatTime(value) {
|
if (value === null || value === undefined || value === "") {
|
return "";
|
}
|
if (typeof value === "number") {
|
const d = new Date(value);
|
const pad = (n) => (n < 10 ? "0" + n : "" + n);
|
return (
|
d.getFullYear() +
|
"-" +
|
pad(d.getMonth() + 1) +
|
"-" +
|
pad(d.getDate()) +
|
" " +
|
pad(d.getHours()) +
|
":" +
|
pad(d.getMinutes())
|
);
|
}
|
return String(value);
|
},
|
},
|
};
|
</script>
|
|
<style scoped>
|
.near-timeout-table {
|
margin-top: 12px;
|
}
|
</style>
|