postdischarge-ui/src/views/manage/patientInfoImport/index.vue

428 lines
13 KiB
Vue
Raw Normal View History

2024-12-05 09:14:53 +08:00
<template>
<div class="app-container" ref="layout">
<div ref="topform" class="form">
2024-12-30 10:04:16 +08:00
<SearchFilter
labelWidth="90px"
:labelWidths="310"
size="small"
@search="handleQuery"
@handleRules="handleRules"
patientUploadButtonVisible="true"
@reset="resetQuery"
@minShowCtrol="getMaxTableHeight"
>
2024-12-05 09:14:53 +08:00
<el-form-item label="导入日期" prop="" label-width="120px">
2024-12-30 10:04:16 +08:00
<el-date-picker
v-model="createTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
style="width: 220px"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
>
2024-12-05 09:14:53 +08:00
</el-date-picker>
</el-form-item>
<el-form-item label="医院" prop="">
2024-12-30 10:04:16 +08:00
<el-select
v-model="queryParams.hospitalAgencyId"
filterable
placeholder="请选择医院"
style="width: 220px"
clearable
@clear="clearhospitalAgency"
@change="changehospitalAgency"
>
<el-option
v-for="item in hospitalAgencylist"
:key="item.id"
:label="item.agencyName"
:value="item.id"
>
2024-12-05 09:14:53 +08:00
</el-option>
</el-select>
</el-form-item>
<el-form-item label="院区" prop="">
2024-12-30 10:04:16 +08:00
<el-select
v-model="queryParams.campusAgencyId"
filterable
placeholder="请选择院区"
style="width: 220px"
clearable
@clear="clearcampusAgency"
>
<el-option
v-for="item in campusAgencylist"
:key="item.id"
:label="item.agencyName"
:value="item.id"
>
2024-12-05 09:14:53 +08:00
</el-option>
</el-select>
</el-form-item>
</SearchFilter>
</div>
<!-- <div ref="mb8" class="mb8">
<el-row :gutter="10" class="">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['manage:blacklist:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['manage:blacklist:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['manage:blacklist:remove']">删除</el-button>
</el-col> -->
2024-12-30 10:04:16 +08:00
<!-- <el-col :span="1.5">
2024-12-05 09:14:53 +08:00
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['manage:blacklist:export']">导出</el-button>
</el-col> -->
2024-12-30 10:04:16 +08:00
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
2024-12-05 09:14:53 +08:00
</el-row>
</div> -->
<div ref="table">
2024-12-30 10:04:16 +08:00
<el-table
:max-height="maxTableHeight"
v-loading="loading"
:data="PatientInfoImportBatchlist"
@selection-change="handleSelectionChange"
>
2024-12-05 09:14:53 +08:00
<el-table-column type="selection" width="55" />
2024-12-30 10:04:16 +08:00
<el-table-column label="序号" type="index" width="48" align="center" />
<el-table-column label="流水号" prop="sn" align="center">
2024-12-09 14:27:30 +08:00
<template slot-scope="scope">
2024-12-30 10:04:16 +08:00
<el-button size="mini" type="text" @click="handsn(scope.row)">{{
scope.row.sn
}}</el-button>
2024-12-09 14:27:30 +08:00
</template>
</el-table-column>
2024-12-30 10:04:16 +08:00
<el-table-column
label="患者数"
align="center"
prop="patientCount"
width="150"
/>
<el-table-column label="操作人" align="center" prop="createBy" />
<el-table-column label="导入日期" align="center" prop="createTime">
2024-12-05 09:14:53 +08:00
<template slot-scope="scope">
2024-12-30 10:04:16 +08:00
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
2024-12-05 09:14:53 +08:00
</template>
</el-table-column>
2024-12-30 10:04:16 +08:00
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
2024-12-05 09:14:53 +08:00
<template slot-scope="scope">
2024-12-06 11:57:18 +08:00
<!-- <el-button size="mini" type="text" @click="handleUpdate(scope.row)"
2024-12-05 09:14:53 +08:00
v-hasPermi="['manage:blacklist:edit']">修改</el-button>
<el-button size="mini" type="text" @click="handleDelete(scope.row)"
2024-12-06 11:57:18 +08:00
v-hasPermi="['manage:blacklist:remove']">删除</el-button> -->
2024-12-30 10:04:16 +08:00
<el-button size="mini" type="text" @click="handOutbound(scope.row)"
>外呼</el-button
>
<el-button size="mini" type="text" @click="handsn(scope.row)"
>明细</el-button
>
<el-button size="mini" type="text" @click="handleDelete(scope.row)"
>删除</el-button
>
2024-12-05 09:14:53 +08:00
</template>
</el-table-column>
</el-table>
</div>
<!-- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" /> -->
2024-12-30 10:04:16 +08:00
<myPagination
v-show="total > 0"
:total="total"
:pageSize="queryParams.pageSize"
:indexFromWrap="queryParams.pageNum"
@updateCPage="updateCPage"
></myPagination>
2024-12-05 09:14:53 +08:00
</div>
</template>
<script>
2024-12-30 10:04:16 +08:00
import { patientInfoImportBatchlist, updateSn } from "@/api/manage/patientInfoImport";
2024-12-05 09:14:53 +08:00
import { selectAgencyList, getDepartmentList, getAgencyList } from "@/api/manage/selectAgencyList";
import SearchFilter from '../../components/SearchForm.vue'
export default {
name: "Importlist",
components: { SearchFilter },
data() {
return {
maxTableHeight: undefined,
//医院list
hospitalAgencylist: [],
// 院区list
campusAgencylist: [],
2024-12-30 10:04:16 +08:00
2024-12-05 09:14:53 +08:00
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 导入列表
PatientInfoImportBatchlist: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
2024-12-30 10:04:16 +08:00
createTime: "",
2024-12-05 09:14:53 +08:00
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
hospitalAgencyId: null,
importTimeStart: "",
importTimeEnd: "",
campusAgencyId: null,
},
// 表单参数
form: {},
// 表单校验
rules: {}
};
},
created() {
this.selectAgencyinfo();
this.getList();
},
mounted() {
this.getMaxTableHeight()
this.screenChange()
},
methods: {
2024-12-30 10:04:16 +08:00
handleRules() {
this.getList()
},
2024-12-06 11:57:18 +08:00
2024-12-05 09:14:53 +08:00
// 导入成功
2024-12-30 10:04:16 +08:00
handleRules() {
console.log('this.patientInfoImportList')
this.getList()
},
// 流水号/明细
handsn(row) {
this.$router.push({
path: "/patient/ImportDetails",
query: {
path: "/patient/patientinfoimport",
sn: row.sn,
Timeimport: row.createTime,
},
});
2024-12-09 14:27:30 +08:00
2024-12-30 10:04:16 +08:00
},
2024-12-09 14:27:30 +08:00
// 外呼
2024-12-30 10:04:16 +08:00
handOutbound(row) {
this.$router.push({
path: "/patient/ManuallyCreatingTasks",
query: {
path: "/patient/patientinfoimport",
// signPatientRecordId: row.id,
sn: row.sn ? row.sn : '',
patientName: row.patientName ? row.patientName : '',
departmentId: row.departmentId ? row.departmentId : '',
departmentName: row.departmentName ? row.departmentName : '',
},
});
2024-12-06 11:57:18 +08:00
2024-12-30 10:04:16 +08:00
},
/** 删除按钮操作 */
handleDelete(row) {
// const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除?').then(function () {
return updateSn(row.sn);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
2024-12-05 09:14:53 +08:00
updateCPage(index, size) {
this.queryParams.pageNum = index
this.queryParams.pageSize = size
this.getList();
},
/** 查询 */
getList() {
this.loading = true;
patientInfoImportBatchlist(this.queryParams).then(response => {
this.PatientInfoImportBatchlist = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
campusAgencyId: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
if (this.createTime?.length > 0) {
this.queryParams.importTimeStart = this.createTime[0];
this.queryParams.importTimeEnd = this.createTime[1];
} else {
this.queryParams.importTimeStart = null;
this.queryParams.importTimeEnd = null;
}
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10
}
2024-12-30 10:04:16 +08:00
this.createTime = '';
2024-12-05 09:14:53 +08:00
// this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 导出按钮操作 */
handleExport() {
this.download('manage/blacklist/export', {
...this.queryParams
}, `blacklist_${new Date().getTime()}.xlsx`)
},
//获取医院list
selectAgencyinfo() {
let query = {
agencyStatus: 'ON',
nodeType: 'HOSPITAL',
}
selectAgencyList(query).then(res => {
this.hospitalAgencylist = res.data
})
},
//获取下级单位
getAgencyListinfo(nodeType, id, type) {
let query = {
nodeType: nodeType,
}
if (nodeType == 'HOSPITAL') {
query.hospitalId = id
} else if (nodeType == 'CAMPUS') {
query.campusId = id
2024-12-30 10:04:16 +08:00
}
2024-12-05 09:14:53 +08:00
getAgencyList(query).then(res => {
// if (type)
2024-12-30 10:04:16 +08:00
console.log(nodeType);
2024-12-05 09:14:53 +08:00
console.log(res.data.campusList);
{
if (nodeType == 'HOSPITAL') {
this.campusAgencylist = res.data.campusList;
2024-12-30 10:04:16 +08:00
}
}
2024-12-05 09:14:53 +08:00
})
},
//选中医院获取院区
changehospitalAgency(id, type, typetwo) {
this.getAgencyListinfo('HOSPITAL', id, type)
// let query = {
// agencyStatus: 'ON',
// nodeType: 'CAMPUS',
// parentId: id,
// }
// selectAgencyList(query).then(res => {
if (type) {
if (!typetwo) {
this.form.campusAgencyId = null
}
} else {
this.queryParams.campusAgencyId = null
}
// })
},
//选中院区获取科室
changecampusAgency(id, type, typetwo) {
this.getAgencyListinfo('CAMPUS', id, type)
},
//清空医院
clearhospitalAgency(type) {
if (type) {
this.form.campusAgencyId = null
this.form.departmentId = null
this.form.wardId = null
} else {
this.queryParams.campusAgencyId = null
this.queryParams.departmentId = null
this.queryParams.wardId = null
}
},
//清空院区
clearcampusAgency(type) {
if (type) {
this.form.departmentId = null
this.form.wardId = null
this.getAgencyListinfo('HOSPITAL', this.form.hospitalAgencyId, type)
} else {
this.queryParams.departmentId = null
this.queryParams.wardId = null
this.getAgencyListinfo('HOSPITAL', this.queryParams.hospitalAgencyId)
}
},
2024-12-30 10:04:16 +08:00
2024-12-05 09:14:53 +08:00
// 获取表格最高高度
getMaxTableHeight() {
const windowInnerHeight = window.innerHeight // 屏幕可视高度
const layoutDiv = this.$refs.layout
const formDiv = this.$refs.topform
const mb8Div = this.$refs.mb8
this.maxTableHeight =
windowInnerHeight - 134 -
this.getBoxPadding(layoutDiv) -
this.getBoxHeight(mb8Div) -
this.getBoxHeight(formDiv)
},
// 屏幕resize监听
screenChange() {
// 屏幕resize监听事件:一旦屏幕宽高发生变化,就会执行resize
window.addEventListener('resize', this.getMaxTableHeight, true)
// 将屏幕监听事件移除
// 这步是必须的。离开页面时不移除,再返回,或者进入到别的有相同元素的页面会报错
// 或者将这里的方法直接写在beforeDestroy函数中也可以
this.$once('hook:beforeDestroy', () => {
window.removeEventListener('resize', this.getMaxTableHeight, true)
})
},
}
};
</script>