<template>
|
<div class="app-container">
|
<el-row :gutter="20">
|
<!--用户数据-->
|
<el-col :span="24" :xs="24">
|
<el-form
|
:model="queryParams"
|
ref="queryForm"
|
size="small"
|
:inline="true"
|
v-show="showSearch"
|
label-width="98px"
|
>
|
<el-form-item label="患者姓名" prop="name">
|
<el-input
|
v-model="queryParams.patname"
|
placeholder="请输入姓名"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="主治医生" prop="name">
|
<el-input
|
v-model="queryParams.drname"
|
placeholder="请输入姓名"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="责任护士" prop="name">
|
<el-input
|
v-model="queryParams.nurseName"
|
placeholder="请输入姓名"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="住院号" prop="inhospno">
|
<el-input
|
v-model="queryParams.inhospno"
|
placeholder="请输入患者编号"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
|
<el-form-item label="患者范围" prop="status">
|
<el-cascader
|
v-model="queryParams.scopetype"
|
placeholder="默认全部科室"
|
:options="sourcetype"
|
:props="{ expandTrigger: 'hover' }"
|
@change="handleChange"
|
></el-cascader>
|
</el-form-item>
|
<el-form-item label=" 入院日期 " prop="createTime">
|
<el-date-picker
|
v-model="dateRange"
|
style="width: 240px"
|
value-format="yyyy-MM-dd"
|
type="daterange"
|
range-separator="-"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
></el-date-picker>
|
</el-form-item>
|
|
<el-row>
|
<el-form-item>
|
<el-button
|
type="primary"
|
icon="el-icon-search"
|
size="medium"
|
@click="handleQuery"
|
>搜索</el-button
|
>
|
<el-button
|
icon="el-icon-refresh"
|
size="medium"
|
@click="resetQuery"
|
>重置</el-button
|
>
|
</el-form-item>
|
</el-row>
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
<!-- <el-col :span="1.5">
|
<el-button
|
type="primary"
|
plain
|
icon="el-icon-plus"
|
size="medium"
|
@click="handleAdd"
|
v-hasPermi="['system:user:add']"
|
>新增</el-button
|
>
|
</el-col> -->
|
<!-- 延续护理按钮 -->
|
<el-col :span="1.5">
|
<el-button
|
type="warning"
|
plain
|
icon="el-icon-plus"
|
size="medium"
|
:disabled="multiple"
|
@click="handleBatchAddTask"
|
>
|
添加延续护理任务
|
</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="danger"
|
plain
|
icon="el-icon-delete"
|
size="medium"
|
:disabled="multiple"
|
@click="handleDelete"
|
v-hasPermi="['system:user:remove']"
|
>删除</el-button
|
>
|
</el-col>
|
|
<!-- <el-col :span="1.5"> </el-col> -->
|
</el-row>
|
<el-table
|
v-loading="loading"
|
:data="userList"
|
height="808"
|
@selection-change="handleSelectionChange"
|
>
|
<el-table-column type="selection" width="50" align="center" />
|
<!-- <el-table-column
|
label="序号"
|
fixed
|
align="center"
|
key="id"
|
prop="id"
|
/> -->
|
<el-table-column
|
label="入院日期"
|
align="center"
|
key="starttime"
|
prop="starttime"
|
width="160"
|
>
|
<template slot-scope="scope">
|
<span>{{ formatTime(scope.row.starttime) }}</span>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
label="住院号"
|
align="center"
|
key="inhospno"
|
prop="inhospno"
|
width="120"
|
/>
|
|
<el-table-column
|
label="姓名"
|
width="100"
|
align="center"
|
key="patname"
|
prop="patname"
|
>
|
<template slot-scope="scope">
|
<el-button
|
size="medium"
|
type="text"
|
@click="
|
gettoken360(
|
scope.row.idcardno,
|
scope.row.drcode,
|
scope.row.drname
|
)
|
"
|
><span class="button-textsc">{{
|
scope.row.patname
|
}}</span></el-button
|
>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="性别"
|
width="100"
|
align="center"
|
key="sex"
|
prop="sex"
|
>
|
<template slot-scope="scope">
|
<span>{{ scope.row.sex == 1 ? "男" : "女" }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="年龄"
|
align="center"
|
key="age"
|
prop="age"
|
width="120"
|
/>
|
<el-table-column
|
label="联系电话"
|
align="center"
|
key="telcode"
|
prop="telcode"
|
width="120"
|
/>
|
|
<el-table-column
|
label="入院诊断"
|
align="center"
|
key="diagname"
|
prop="diagname"
|
width="190"
|
/>
|
|
<el-table-column
|
label="科室"
|
align="center"
|
key="deptname"
|
prop="deptname"
|
width="180"
|
/>
|
<el-table-column
|
label="病区"
|
align="center"
|
key="leavehospitaldistrictname"
|
prop="leavehospitaldistrictname"
|
width="180"
|
/>
|
<el-table-column
|
label="床位号"
|
align="center"
|
key="bedNo"
|
prop="bedNo"
|
width="120"
|
/>
|
<el-table-column
|
label="主治医生"
|
align="center"
|
key="drname"
|
prop="drname"
|
width="120"
|
/>
|
<el-table-column
|
label="责任护士"
|
align="center"
|
key="nurseName"
|
prop="nurseName"
|
width="120"
|
/>
|
|
<el-table-column
|
label="操作"
|
fixed="right"
|
align="center"
|
class-name="small-padding fixed-width"
|
>
|
<template slot-scope="scope">
|
<el-button
|
size="medium"
|
type="text"
|
@click="
|
$router.push({
|
path: '/patient/patient/profile/',
|
query: { id: scope.row.patid },
|
})
|
"
|
><span class="button-textsc"
|
><i class="el-icon-zoom-in"></i>查看</span
|
></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-col>
|
</el-row>
|
<!-- 批量添加延续护理任务弹窗 -->
|
<!-- 批量添加延续护理任务弹窗 -->
|
<el-dialog
|
title="批量添加延续护理"
|
:visible.sync="batchTaskVisible"
|
width="90%"
|
append-to-body
|
class="batch-dialog"
|
:close-on-click-modal="false"
|
>
|
<el-row :gutter="20">
|
<!-- 左侧:选中患者列表 -->
|
<el-col :span="12">
|
<div class="batch-patient-section">
|
<div class="section-header">
|
<h4>选中患者</h4>
|
<span class="patient-count">{{ selectedPatients.length }}人</span>
|
</div>
|
<el-table
|
:data="selectedPatients"
|
border
|
style="width: 100%"
|
size="small"
|
:row-class-name="tableRowClassName"
|
:header-cell-style="{ background: '#F5F7FA', color: '#606266' }"
|
>
|
<el-table-column
|
prop="patname"
|
label="姓名"
|
width="100"
|
align="center"
|
/>
|
<el-table-column
|
prop="sex"
|
label="性别"
|
width="80"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<el-tag
|
size="small"
|
:type="scope.row.sex === 1 ? 'primary' : 'danger'"
|
>
|
{{ scope.row.sex === 1 ? "男" : "女" }}
|
</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="入院时间"
|
align="center"
|
key="starttime"
|
prop="starttime"
|
width="120"
|
>
|
<template slot-scope="scope">
|
<span class="time-text">{{
|
formatTime(scope.row.starttime)
|
}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="inhospno"
|
label="住院号"
|
width="120"
|
align="center"
|
/>
|
<el-table-column prop="deptname" label="科室" align="center" />
|
<el-table-column
|
prop="leavehospitaldistrictname"
|
label="病区"
|
align="center"
|
/>
|
</el-table>
|
</div>
|
</el-col>
|
|
<!-- 右侧:任务列表 -->
|
<el-col :span="12">
|
<div class="batch-task-section">
|
<div class="section-header">
|
<h4>延续护理任务</h4>
|
<div v-if="selectedTask" class="task-selected-hint selected">
|
<i class="el-icon-success"></i>
|
<span>已选择:{{ selectedTask.taskName }}</span>
|
</div>
|
<div v-else class="task-selected-hint">
|
<i class="el-icon-info"></i>
|
<span>请点击选择一个任务</span>
|
</div>
|
</div>
|
<el-table
|
:data="taskList"
|
border
|
style="width: 100%"
|
height="680"
|
size="small"
|
@current-change="handleTaskSelectionChange"
|
highlight-current-row
|
:row-class-name="taskRowClassName"
|
:header-cell-style="{ background: '#F5F7FA', color: '#606266' }"
|
:current-row-key="selectedTask ? selectedTask.taskid : ''"
|
>
|
<el-table-column
|
label="任务名称"
|
fixed
|
align="center"
|
key="taskName"
|
prop="taskName"
|
:show-overflow-tooltip="true"
|
width="180"
|
/>
|
|
<el-table-column
|
label="服务项目"
|
align="center"
|
key="templatename"
|
prop="templatename"
|
:show-overflow-tooltip="true"
|
/>
|
|
<el-table-column
|
label="创建人"
|
align="center"
|
key="createBy"
|
prop="createBy"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="创建时间"
|
sortable
|
align="center"
|
prop="createTime"
|
>
|
<template slot-scope="scope">
|
<span class="time-text">{{
|
formatTime(scope.row.createTime)
|
}}</span>
|
</template>
|
</el-table-column>
|
<template #empty>
|
<div class="empty-message">
|
<i class="el-icon-document"></i>
|
<span>暂无可用延续护理任务</span>
|
<span class="empty-tips">请联系管理员创建任务</span>
|
</div>
|
</template>
|
</el-table>
|
</div>
|
</el-col>
|
</el-row>
|
|
<!-- 底部按钮 -->
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="batchTaskVisible = false" :disabled="batchLoading"
|
>取 消</el-button
|
>
|
<el-button
|
type="primary"
|
:loading="batchLoading"
|
@click="submitBatchTask"
|
:disabled="!selectedTask || batchLoading"
|
>
|
{{ batchLoading ? "创建中..." : "创建延续护理任务" }}
|
</el-button>
|
</div>
|
</el-dialog>
|
<!-- 用户导入对话框 -->
|
<el-dialog
|
:title="upload.title"
|
:visible.sync="upload.open"
|
width="70%"
|
append-to-body
|
>
|
<el-steps :active="dractive" simple>
|
<el-step title="上传导入文件" icon="el-icon-upload"></el-step>
|
<el-step title="导入检查" icon="el-icon-picture"></el-step>
|
<el-step title="导入结果" icon="el-icon-picture"></el-step>
|
</el-steps>
|
<!-- 上传导入文件 -->
|
<div class="download" v-if="dractive == 1">
|
<el-upload
|
class="upload-demo"
|
ref="upload"
|
:limit="1"
|
accept=".xlsx, .xls"
|
:headers="upload.headers"
|
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
:disabled="upload.isUploading"
|
:on-progress="handleFileUploadProgress"
|
:on-success="handleFileSuccess"
|
:auto-upload="false"
|
drag
|
>
|
<i class="el-icon-upload"></i>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__tip text-center" slot="tip">
|
<div class="el-upload__tip" slot="tip">
|
<el-checkbox v-model="upload.updateSupport" />
|
是否更新已经存在的用户数据
|
</div>
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
<el-link
|
type="primary"
|
:underline="false"
|
style="font-size: 24px; vertical-align: baseline"
|
@click="importTemplate"
|
>下载模板</el-link
|
>
|
</div>
|
</el-upload>
|
</div>
|
<!-- 导入检查 -->
|
<div class="uploading" v-else-if="dractive == 2">
|
<el-table :data="uploadingData" style="width: 100%">
|
<el-table-column prop="serial" label="序号"> </el-table-column>
|
<el-table-column prop="name" label="姓名" width="100">
|
</el-table-column>
|
<el-table-column prop="sex" label="性别" width="100">
|
</el-table-column>
|
<el-table-column prop="certificate" label="证件类型">
|
</el-table-column>
|
<el-table-column prop="certificatenum" label="证件号码">
|
</el-table-column>
|
<el-table-column prop="goday" label="出生日期"> </el-table-column>
|
<el-table-column prop="menum" label="本人联系方式"> </el-table-column>
|
<el-table-column prop="younum" label="亲属联系方式">
|
</el-table-column>
|
<el-table-column prop="tag" label="患者标签"> </el-table-column>
|
<el-table-column prop="erry" label="错误原因"> </el-table-column>
|
</el-table>
|
<pagination
|
v-show="total > 0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
@pagination="geterryList"
|
/>
|
</div>
|
<!-- 完成 -->
|
<div class="drexamine" v-else-if="dractive == 3">
|
<img
|
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
|
/>
|
<p>导入患者成功!</p>
|
<p>本次共计导入{{ ImportQuantity }}位患者</p>
|
</div>
|
|
<div slot="footer" class="dialog-footer" v-if="dractive == 3">
|
<!-- <el-button type="primary" @click="submitFileForm">下一步</el-button> -->
|
<el-button @click="submitclose">完成</el-button>
|
</div>
|
<div slot="footer" v-else>
|
<el-button type="primary" @click="submitFileForm">下一步</el-button>
|
<el-button @click="submitclose">取 消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { delUser } from "@/api/system/user";
|
import formatTime from "@/filters/index";
|
|
import { listpatient } from "@/api/patient/record";
|
import {
|
messagelistpatient,
|
alterpatient,
|
addpatient,
|
particularpatient,
|
deletepatient,
|
Exporterrorpatient,
|
toleadpatient,
|
} from "@/api/patient/homepage";
|
|
import { listtag } from "@/api/system/label";
|
import { getToken } from "@/utils/auth";
|
import Treeselect from "@riophae/vue-treeselect";
|
import { listDept } from "@/api/system/dept";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import { query360PatInfo, getTasklist, addSubtask } from "@/api/AiCentre/index";
|
|
import store from "@/store";
|
|
export default {
|
name: "behospitalized",
|
dicts: ["sys_normal_disable", "sys_user_sex", "nursinggrade"],
|
components: { Treeselect },
|
data() {
|
return {
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 用户表格数据
|
userList: null,
|
// 弹出层标题
|
title: "",
|
// 部门树选项
|
deptOptions: undefined,
|
// 是否显示弹出层
|
open: false,
|
// 部门名称
|
deptName: undefined,
|
// 默认密码
|
initPassword: undefined,
|
amendtag: false, //是否修改
|
// 批量任务相关数据
|
batchTaskVisible: false, // 弹窗可见性
|
selectedPatients: [], // 选中的患者列表
|
taskList: [], // 任务列表
|
selectedTask: null, // 选中的任务
|
batchLoading: false, // 批量提交加载状态
|
// 日期范围
|
dateRange: [],
|
paperstypes: [
|
{ papersname: "身份证" },
|
{ papersname: "护照" },
|
{ papersname: "中国港澳居民身份证" },
|
{ papersname: "中国台湾居民身份证" },
|
],
|
source: [
|
{
|
value: 0,
|
label: "所属患者",
|
},
|
{
|
value: 1,
|
label: "科室患者",
|
},
|
{
|
value: 2,
|
label: "病区患者",
|
},
|
],
|
postData: {
|
XiaoXiTou: {
|
FaSongFCSJC: "ZJHES",
|
FaSongJGID: localStorage.getItem("orgid"),
|
FaSongJGMC: localStorage.getItem("orgname"),
|
FaSongSJ: "2025-01-09 17:29:36",
|
FaSongXTJC: "SUIFANGXT",
|
FaSongXTMC: "随访系统",
|
XiaoXiID: "5FA92AFB-9833-4608-87C7-F56A654AC171",
|
XiaoXiLX: "SC_LC_360STCX",
|
XiaoXiMC: "360 视图查询",
|
ZuHuID: localStorage.getItem("ZuHuID"),
|
ZuHuMC: localStorage.getItem("orgname"),
|
},
|
YeWuXX: {
|
BingRenXX: {
|
ZhengJianHM: "",
|
ZhengJianLXDM: "01",
|
ZhengJianLXMC: "居民身份证",
|
ZuZhiJGID: localStorage.getItem("orgid"),
|
ZuZhiJGMC: localStorage.getItem("orgname"),
|
},
|
YongHuXX: {
|
XiTongID: "SUIFANGXT",
|
XiTongMC: "随访系统",
|
YongHuID: localStorage.getItem("YongHuID"),
|
YongHuXM: localStorage.getItem("YongHuXM"),
|
ZuZhiJGID: localStorage.getItem("orgid"),
|
ZuZhiJGMC: localStorage.getItem("orgname"),
|
idp: "lyra",
|
},
|
},
|
},
|
sourcetype: [
|
{
|
value: 1,
|
label: "科室",
|
children: [],
|
},
|
{
|
value: 2,
|
label: "病区",
|
children: [],
|
},
|
{
|
value: 3,
|
label: "全部科室",
|
},
|
{
|
value: 4,
|
label: "全部病区",
|
},
|
],
|
// 表单参数
|
form: {
|
name: "",
|
age: "",
|
sex: "",
|
tagList: [],
|
idcardno: "",
|
telcode: "",
|
idcardtype: "",
|
relativetelcode: "",
|
},
|
//导入进度
|
dractive: 1,
|
// 导入展示表单
|
uploadingData: {},
|
total: 0, // 总条数
|
ImportQuantity: 999, //导入患者数量
|
Labelchange: false, //修改新增弹窗
|
propss: { multiple: true },
|
optionstag: [], //标签列表
|
Patientrange: [
|
{
|
name: "全部科室",
|
id: 999,
|
},
|
{
|
name: "当前科室",
|
id: 1,
|
},
|
],
|
defaultProps: {
|
children: "children",
|
label: "label",
|
},
|
// 用户导入参数
|
upload: {
|
// 是否显示弹出层(用户导入)
|
open: false,
|
// 弹出层标题(用户导入)
|
title: "",
|
// 是否禁用上传
|
isUploading: false,
|
// 是否更新已经存在的用户数据
|
updateSupport: 0,
|
// 设置上传的请求头部
|
headers: { Authorization: "Bearer " + getToken() },
|
// 上传的地址
|
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
|
},
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
cry: 0,
|
searchscope: 3,
|
scopetype: [],
|
leaveldeptcodes: [],
|
leavehospitaldistrictcodes: [],
|
},
|
};
|
},
|
watch: {
|
// 根据名称筛选部门树
|
deptName(val) {
|
this.$refs.tree.filter(val);
|
},
|
},
|
created() {
|
this.sourcetype[0].children = store.getters.belongDepts.map((dept) => {
|
return {
|
label: dept.deptName,
|
value: dept.deptCode,
|
};
|
});
|
this.sourcetype[1].children = store.getters.belongWards.map((dept) => {
|
return {
|
label: dept.districtName,
|
value: dept.districtCode,
|
};
|
});
|
this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
|
(obj) => obj.deptCode
|
);
|
this.queryParams.leavehospitaldistrictcodes = store.getters.belongWards.map(
|
(obj) => obj.districtCode
|
);
|
this.getList();
|
// this.listDept();
|
this.gettabList();
|
},
|
methods: {
|
/** 查询患者列表 */
|
getList() {
|
this.loading = true;
|
listpatient(this.queryParams).then((response) => {
|
console.log(response);
|
this.userList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
/** 表格行样式 */
|
tableRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 === 0) {
|
return "even-row";
|
} else {
|
return "odd-row";
|
}
|
},
|
|
/** 任务表格行样式 */
|
taskRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 === 0) {
|
return "task-even-row";
|
} else {
|
return "task-odd-row";
|
}
|
},
|
listDept() {
|
listDept(this.queryParams).then((res) => {
|
this.deptList = res.data;
|
console.log(this.deptList, "this.deptList");
|
});
|
},
|
// 患者范围处理
|
handleChange(value) {
|
let type = value[0];
|
let code = value.slice(-1)[0];
|
this.queryParams.leavehospitaldistrictcodes = [];
|
this.queryParams.leaveldeptcodes = [];
|
|
if (type == 1) {
|
this.queryParams.leaveldeptcodes.push(code);
|
this.queryParams.leavehospitaldistrictcodes = [];
|
this.queryParams.searchscope = 1;
|
} else if (type == 3) {
|
this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
|
(obj) => obj.deptCode
|
);
|
this.queryParams.searchscope = 3;
|
this.queryParams.leavehospitaldistrictcodes = [];
|
} else if (type == 4) {
|
this.queryParams.leaveldeptcodes = [];
|
this.queryParams.leavehospitaldistrictcodes =
|
store.getters.belongWards.map((obj) => obj.districtCode);
|
this.queryParams.searchscope = 4;
|
}
|
},
|
/** 查询标签列表 */
|
gettabList() {
|
const tagqueryParams = {
|
pageNum: 1,
|
pageSize: 1000,
|
tagname: undefined,
|
tagdescription: undefined,
|
tagcategoryid: "0",
|
};
|
listtag(tagqueryParams).then((response) => {
|
console.log(response);
|
this.optionstag = response.rows;
|
});
|
},
|
// 查询导入展示列表
|
geterryList() {
|
this.loading = true;
|
listJob(this.queryParams).then((response) => {
|
this.jobList = 1;
|
this.total = 1;
|
this.loading = false;
|
});
|
},
|
/** 批量添加延续护理任务按钮点击 */
|
handleBatchAddTask() {
|
// 校验是否选中患者
|
if (this.ids.length === 0) {
|
this.$modal.msgWarning("请至少选中1名患者");
|
return;
|
}
|
|
// 获取选中患者的科室信息
|
const patientDepts = new Set();
|
let deptcode = "";
|
this.ids.forEach((patId) => {
|
const patient = this.userList.find((item) => item.patid === patId);
|
if (patient) {
|
patientDepts.add(patient.deptname);
|
deptcode = patient.deptcode;
|
}
|
});
|
|
// 获取选中患者列表
|
this.selectedPatients = this.userList.filter((item) =>
|
this.ids.includes(item.patid)
|
);
|
|
// 显示弹窗
|
this.batchTaskVisible = true;
|
|
// 获取任务列表
|
this.loadTaskList(deptcode);
|
},
|
|
/** 加载任务列表 */
|
loadTaskList(deptcode) {
|
this.batchLoading = true;
|
let topqueryParams = {
|
pageNum: 1,
|
pageSize: 100, // 设置较大的分页获取更多任务
|
type: 2, // 延续护理任务类型
|
};
|
|
getTasklist(topqueryParams)
|
.then((response) => {
|
this.taskList = response.rows;
|
this.batchLoading = false;
|
|
if (this.taskList.length === 0) {
|
this.$modal.msgWarning("当前科室无可用延续护理任务");
|
}
|
})
|
.catch((error) => {
|
this.$modal.msgError("获取任务列表失败:" + error.message);
|
this.batchLoading = false;
|
});
|
},
|
|
/** 处理任务选择变化 */
|
handleTaskSelectionChange(currentRow) {
|
this.selectedTask = currentRow;
|
},
|
|
/** 批量提交延续护理任务 */
|
async submitBatchTask() {
|
// 校验是否选中任务
|
if (!this.selectedTask) {
|
this.$modal.msgWarning("请选择1个任务");
|
return;
|
}
|
|
this.batchLoading = true;
|
const successPatients = [];
|
const failedPatients = [];
|
const errorMessages = [];
|
|
try {
|
// 遍历选中的患者,逐个调用接口
|
for (const patient of this.selectedPatients) {
|
const params = {
|
taskid: this.selectedTask.taskid,
|
type: this.selectedTask.type,
|
taskName: this.selectedTask.taskName,
|
serviceType: 99, // 延续护理服务类型
|
preachform: this.selectedTask.preachform,
|
templateid: this.selectedTask.templateid,
|
libtemplateid: this.selectedTask.libtemplateid,
|
sendstate: 2, // 发送状态
|
continueFlag: 1, // 延续护理标志(在院患者)
|
...patient,
|
sendname: patient.patname,
|
// 在院患者使用当前时间作为任务开始时间
|
starttime: new Date().toISOString().split("T")[0] + " 00:00:00",
|
// 在院患者可能需要设置任务的结束时间(如出院后7天)
|
endtime: this.getFollowUpEndTime(patient.starttime),
|
leavediagname: patient.diagname || "", // 使用入院诊断
|
age: patient.age || "",
|
};
|
|
try {
|
const response = await addSubtask(params);
|
if (response.code === 200) {
|
successPatients.push(patient.patname);
|
} else {
|
failedPatients.push(patient.patname);
|
errorMessages.push(
|
`${patient.patname}: ${response.msg || "添加失败"}`
|
);
|
}
|
} catch (error) {
|
failedPatients.push(patient.patname);
|
errorMessages.push(
|
`${patient.patname}: ${error.message || "网络错误"}`
|
);
|
}
|
}
|
|
// 显示处理结果
|
if (failedPatients.length === 0) {
|
this.$modal.msgSuccess(
|
`成功为 ${successPatients.length} 名患者添加延续护理任务`
|
);
|
} else {
|
this.$modal.msgWarning(
|
`成功添加 ${successPatients.length} 人,失败 ${failedPatients.length} 人。` +
|
(errorMessages.length > 0
|
? `失败原因:${errorMessages.join("; ")}`
|
: "")
|
);
|
}
|
|
this.batchTaskVisible = false;
|
this.getList(); // 刷新患者列表
|
} catch (error) {
|
this.$modal.msgError("批量添加任务过程中出错:" + error.message);
|
} finally {
|
this.batchLoading = false;
|
}
|
},
|
|
/** 计算随访结束时间(在院患者:出院后7天) */
|
getFollowUpEndTime(admitDate) {
|
if (!admitDate) return "";
|
// 假设在院患者的延续护理在出院后7天结束
|
const endDate = new Date(admitDate);
|
endDate.setDate(endDate.getDate() + 7); // 出院后7天
|
return endDate.toISOString().split("T")[0] + " 00:00:00";
|
},
|
// 筛选节点
|
filterNode(value, data) {
|
if (!value) return true;
|
return data.label.indexOf(value) !== -1;
|
},
|
// 节点单击事件
|
handleNodeClick(data) {
|
this.queryParams.deptId = data.id;
|
this.handleQuery();
|
},
|
//患者360跳转
|
gettoken360(sfzh, drcode, drname) {
|
// this.$modal.msgWarning('360功能暂未开通');
|
|
this.postData.YeWuXX.BingRenXX.ZhengJianHM = sfzh;
|
|
query360PatInfo(this.postData).then((res) => {
|
if (res.data.url) {
|
window.open(res.data.url, "_blank");
|
// this.linkUrl = res.data.url;
|
} else {
|
this.$modal.msgWarning("360查询无结果");
|
}
|
});
|
},
|
// 取消按钮
|
cancel() {
|
this.Labelchange = false;
|
this.reset();
|
},
|
// 表单重置
|
reset() {
|
this.form = {
|
name: "",
|
age: "",
|
sex: "",
|
tagList: [],
|
idcardno: "",
|
telcode: "",
|
idcardtype: "",
|
relativetelcode: "",
|
};
|
// this.resetForm("form");
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
if (this.dateRange) {
|
this.queryParams.startInHospTime = this.dateRange[0];
|
this.queryParams.endInHospTime = this.dateRange[1];
|
} else {
|
this.queryParams.startInHospTime = "";
|
this.queryParams.endInHospTime = "";
|
}
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.dateRange = [];
|
this.resetForm("queryForm");
|
this.queryParams = {
|
pageNum: 1,
|
pageSize: 10,
|
cry: 0,
|
searchscope: 3,
|
scopetype: [],
|
leaveldeptcodes: [],
|
leavehospitaldistrictcodes: [],
|
};
|
this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
|
(obj) => obj.deptCode
|
);
|
this.handleQuery();
|
},
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map((item) => item.patid);
|
this.single = selection.length != 1;
|
this.multiple = !selection.length;
|
},
|
|
/** 新增按钮操作 */
|
handleAdd() {
|
this.reset();
|
this.Labelchange = true;
|
this.amendtag = false;
|
},
|
/** 修改按钮操作 */
|
handleUpdate(row) {
|
console.log(row);
|
const userIds = row.patid || this.ids;
|
particularpatient(userIds).then((response) => {
|
console.log(response);
|
this.form = response.data;
|
});
|
this.amendtag = true;
|
this.Labelchange = true;
|
},
|
|
//修改/新增患者
|
submitForm() {
|
if (this.amendtag) {
|
alterpatient(this.form)
|
.then((response) => {
|
console.log(response);
|
})
|
.then(() => {
|
this.getList();
|
this.$modal.msgSuccess("修改成功");
|
});
|
} else {
|
addpatient(this.form)
|
.then((response) => {
|
console.log(response);
|
})
|
.then(() => {
|
this.getList();
|
this.$modal.msgSuccess("添加成功");
|
});
|
}
|
this.reset();
|
// this.idds = "";
|
this.Labelchange = false;
|
},
|
|
/** 删除按钮操作 */
|
handleDelete(row) {
|
const userIds = row.userId || this.ids;
|
this.$modal
|
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
|
.then(function () {
|
return deletepatient(userIds);
|
})
|
.then(() => {
|
this.getList();
|
this.$modal.msgSuccess("删除成功");
|
})
|
.catch(() => {});
|
},
|
/** 导出按钮操作 */
|
handleExport() {
|
this.download(
|
"smartor/patarchive/export",
|
{
|
...this.queryParams,
|
},
|
`user_${new Date().getTime()}.xlsx`
|
);
|
},
|
/** 导入按钮操作 */
|
handleImport() {
|
this.upload.title = "用户导入";
|
this.upload.open = true;
|
},
|
/** 下载模板操作 */
|
importTemplate() {
|
this.download(
|
"smartor/import/getImportPatTemplate",
|
{},
|
`user_template_${new Date().getTime()}.xlsx`
|
);
|
},
|
// 文件上传中处理
|
handleFileUploadProgress(event, file, fileList) {
|
this.upload.isUploading = true;
|
},
|
// 文件上传成功处理
|
handleFileSuccess(response, file, fileList) {
|
this.upload.open = false;
|
this.upload.isUploading = false;
|
this.$refs.upload.clearFiles();
|
this.$alert(
|
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
response.msg +
|
"</div>",
|
"导入结果",
|
{ dangerouslyUseHTMLString: true }
|
);
|
this.getList();
|
},
|
// 提交上传文件
|
submitFileForm() {
|
// 上传
|
if (this.dractive == 1) {
|
this.$refs.upload.submit();
|
this.dractive++;
|
} else {
|
this.dractive++;
|
}
|
},
|
submitclose() {
|
this.upload.open = false;
|
this.dractive = 1;
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.el-button--primary.is-plain {
|
color: #ffffff;
|
background: #409eff;
|
border-color: #4fabe9;
|
}
|
.document {
|
width: 100px;
|
height: 50px;
|
}
|
.documentf {
|
display: flex;
|
justify-content: flex-end;
|
}
|
.download {
|
text-align: center;
|
.el-upload__tip {
|
font-size: 23px;
|
}
|
.el-upload__text {
|
font-size: 23px;
|
}
|
}
|
.uploading {
|
margin-top: 20px;
|
margin: 20px;
|
padding: 30px;
|
background: #ffffff;
|
border: 1px solid #dcdfe6;
|
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
|
0 0 6px 0 rgba(0, 0, 0, 0.04);
|
}
|
.drexamine {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
padding: 30px;
|
background: #daeaf5;
|
img {
|
width: 100px;
|
height: 100px;
|
}
|
}
|
.button-textsc {
|
color: #3664d9;
|
}
|
// 批量任务弹窗优化样式
|
.batch-dialog {
|
.el-dialog__body {
|
padding: 20px 20px 10px;
|
}
|
|
.el-dialog__header {
|
background: linear-gradient(135deg, #5788fe, #7aa1ff);
|
padding: 15px 20px;
|
|
.el-dialog__title {
|
color: white;
|
font-weight: 600;
|
font-size: 16px;
|
}
|
|
.el-dialog__headerbtn {
|
.el-dialog__close {
|
color: white;
|
font-size: 18px;
|
|
&:hover {
|
color: #f0f0f0;
|
}
|
}
|
}
|
}
|
}
|
|
// 弹窗内容区域
|
.batch-patient-section,
|
.batch-task-section {
|
h4 {
|
margin: 0 0 12px 0;
|
color: #333;
|
font-size: 16px;
|
font-weight: 600;
|
padding-left: 8px;
|
border-left: 4px solid #5788fe;
|
display: flex;
|
align-items: center;
|
|
&::before {
|
content: "";
|
display: inline-block;
|
width: 6px;
|
height: 6px;
|
background-color: #5788fe;
|
border-radius: 50%;
|
margin-right: 8px;
|
}
|
}
|
|
.section-header {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
margin-bottom: 12px;
|
|
.patient-count {
|
color: #5788fe;
|
font-weight: 500;
|
background: #f0f5ff;
|
padding: 4px 12px;
|
border-radius: 12px;
|
font-size: 13px;
|
}
|
}
|
}
|
|
// 患者表格优化
|
.batch-patient-section {
|
.el-table {
|
border: 1px solid #e8eaec;
|
border-radius: 6px;
|
overflow: hidden;
|
|
.el-table__header-wrapper {
|
th {
|
background-color: #f5f7fa;
|
color: #606266;
|
font-weight: 600;
|
height: 40px;
|
}
|
}
|
|
.el-table__body-wrapper {
|
tr:hover > td {
|
background-color: #f5f9ff;
|
}
|
}
|
}
|
}
|
|
// 任务表格优化
|
.batch-task-section {
|
.el-table {
|
border: 1px solid #e8eaec;
|
border-radius: 6px;
|
overflow: hidden;
|
|
.el-table__header-wrapper {
|
th {
|
background-color: #f5f7fa;
|
color: #606266;
|
font-weight: 600;
|
height: 40px;
|
}
|
}
|
|
.el-table__body-wrapper {
|
tr {
|
cursor: pointer;
|
transition: all 0.3s;
|
|
&:hover > td {
|
background-color: #f5f9ff;
|
}
|
|
// 选中行样式
|
&.current-row {
|
td {
|
background-color: #e8f1ff !important;
|
border-left: 3px solid #5788fe;
|
|
&:first-child {
|
border-left: none;
|
}
|
}
|
}
|
}
|
|
.selected-row {
|
position: relative;
|
|
&::after {
|
content: "✓";
|
position: absolute;
|
right: 10px;
|
top: 50%;
|
transform: translateY(-50%);
|
color: #5788fe;
|
font-weight: bold;
|
font-size: 16px;
|
}
|
}
|
}
|
|
.el-table__empty-block {
|
min-height: 200px;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
}
|
}
|
|
// 空状态优化
|
.empty-message {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
padding: 40px 20px;
|
color: #909399;
|
|
i {
|
font-size: 48px;
|
margin-bottom: 12px;
|
color: #c0c4cc;
|
}
|
|
span {
|
font-size: 14px;
|
color: #c0c4cc;
|
}
|
|
.empty-tips {
|
margin-top: 8px;
|
font-size: 12px;
|
color: #dcdfe6;
|
}
|
}
|
|
// 底部按钮区域
|
.dialog-footer {
|
display: flex;
|
justify-content: flex-end;
|
padding: 20px 0 0;
|
border-top: 1px solid #f0f0f0;
|
margin-top: 20px;
|
|
.el-button {
|
min-width: 80px;
|
height: 36px;
|
border-radius: 4px;
|
font-size: 14px;
|
|
&.el-button--default {
|
color: #666;
|
border-color: #dcdfe6;
|
|
&:hover {
|
color: #5788fe;
|
border-color: #5788fe;
|
background-color: #f0f5ff;
|
}
|
}
|
|
&.el-button--primary {
|
background: linear-gradient(135deg, #5788fe, #7aa1ff);
|
border-color: #5788fe;
|
|
&:hover {
|
background: linear-gradient(135deg, #4a7cfe, #6b94ff);
|
border-color: #4a7cfe;
|
}
|
|
&:active {
|
background: linear-gradient(135deg, #3d70fe, #5e87ff);
|
border-color: #3d70fe;
|
}
|
|
&.is-loading {
|
position: relative;
|
pointer-events: none;
|
|
&::after {
|
content: "";
|
position: absolute;
|
right: 10px;
|
top: 50%;
|
transform: translateY(-50%);
|
width: 16px;
|
height: 16px;
|
border: 2px solid transparent;
|
border-top-color: white;
|
border-radius: 50%;
|
animation: loading-rotate 1s linear infinite;
|
}
|
}
|
}
|
}
|
}
|
|
// 加载动画
|
@keyframes loading-rotate {
|
0% {
|
transform: translateY(-50%) rotate(0deg);
|
}
|
100% {
|
transform: translateY(-50%) rotate(360deg);
|
}
|
}
|
|
// 响应式调整
|
@media screen and (max-width: 1200px) {
|
.batch-patient-section,
|
.batch-task-section {
|
margin-bottom: 20px;
|
}
|
|
.el-row {
|
flex-wrap: wrap;
|
}
|
|
.el-col-12 {
|
width: 100%;
|
}
|
}
|
|
// 任务列表选中提示
|
.task-selected-hint {
|
margin-top: 8px;
|
font-size: 12px;
|
color: #5788fe;
|
display: flex;
|
align-items: center;
|
|
i {
|
margin-right: 4px;
|
font-size: 14px;
|
}
|
|
&.selected {
|
color: #67c23a;
|
}
|
}
|
|
// 弹窗滚动优化
|
.el-dialog__wrapper {
|
.el-dialog {
|
border-radius: 8px;
|
overflow: hidden;
|
box-shadow: 0 4px 20px rgba(87, 136, 254, 0.1);
|
|
.el-dialog__body {
|
max-height: 70vh;
|
overflow-y: auto;
|
|
&::-webkit-scrollbar {
|
width: 6px;
|
}
|
|
&::-webkit-scrollbar-track {
|
background: #f5f5f5;
|
border-radius: 3px;
|
}
|
|
&::-webkit-scrollbar-thumb {
|
background: #c0c4cc;
|
border-radius: 3px;
|
|
&:hover {
|
background: #a0a4ab;
|
}
|
}
|
}
|
}
|
}
|
</style>
|