<template>
|
<div class="app-container">
|
<el-form
|
:model="queryParams"
|
ref="queryForm"
|
size="small"
|
:inline="true"
|
label-width="68px"
|
>
|
<el-form-item label="时间" prop="applicationTime">
|
<el-date-picker
|
clearable
|
v-model="createTimeList"
|
@change="dateChangebirthday1"
|
style="width: 240px"
|
value-format="yyyy-MM-dd"
|
type="daterange"
|
range-separator="-"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
:picker-options="pickerOptions"
|
></el-date-picker>
|
</el-form-item>
|
<el-form-item label="单位" prop="compId">
|
<el-select
|
v-model="queryParams.compId"
|
placeholder="请选择单位"
|
clearable
|
style="width: 200px"
|
@change="cmp"
|
>
|
<el-option
|
v-for="dict in compList"
|
:key="dict.drugManufacturerId"
|
:label="dict.cnName"
|
:value="dict.drugManufacturerId"
|
/>
|
</el-select>
|
<!-- <el-input v-model="queryParams.compId" placeholder="请输入单位" clearable @keyup.enter.native="handleQuery" style="width: 170px"/> -->
|
</el-form-item>
|
<el-form-item label="部门" prop="deptName">
|
<el-input
|
v-model="queryParams.deptName"
|
placeholder="请输入部门"
|
clearable
|
@keyup.enter.native="handleQuery"
|
style="width: 200px"
|
/>
|
</el-form-item>
|
<el-form-item label="单位部门" prop="dwDeptId">
|
<el-select
|
v-model="queryParams.dwDeptId"
|
placeholder="请选择单位部门"
|
clearable
|
style="width: 200px"
|
@change="dw"
|
>
|
<el-option
|
v-for="dict in dwList"
|
:key="dict.id"
|
:label="dict.dwDeptName"
|
:value="dict.id"
|
/>
|
</el-select>
|
<!-- <el-input v-model="queryParams.dwDeptId" placeholder="请输入单位部门" clearable @keyup.enter.native="handleQuery" style="width: 110px"/> -->
|
</el-form-item>
|
<el-form-item label="分组" prop="groupingId">
|
<el-select
|
v-model="queryParams.groupingId"
|
placeholder="请选择分组"
|
clearable
|
style="width: 200px"
|
@change="dw"
|
>
|
<el-option
|
v-for="dict in gropList"
|
:key="dict.id"
|
:label="dict.groupingName"
|
:value="dict.id"
|
/>
|
</el-select>
|
<!-- <el-input v-model="queryParams.groupingId" placeholder="请输入分组" clearable @keyup.enter.native="handleQuery" style="width: 110px"/> -->
|
</el-form-item>
|
<!-- <el-form-item label="病种名称" prop="name">
|
<el-input
|
v-model="queryParam.name"
|
placeholder="请输入部门"
|
clearable
|
@keyup.enter.native="handleQuery"
|
style="width: 200px"
|
/>
|
</el-form-item> -->
|
<el-form-item>
|
<el-button
|
type="primary"
|
icon="el-icon-search"
|
size="mini"
|
@click="handleQuery"
|
>查询</el-button
|
>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
>重置</el-button
|
>
|
</el-form-item>
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
<el-col :span="1.5">
|
<el-button type="primary" size="mini" @click="tongji"
|
>统计病种</el-button
|
>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="primary" size="mini" @click="clear"
|
>清空已选输出列</el-button
|
>
|
</el-col>
|
</el-row>
|
|
<div style="width: 100%; margin-left: 10px; display: flex">
|
<div style="width: 40%; margin-right: 30px">
|
<el-table
|
border
|
:data="tableData"
|
style="width: 100%"
|
@selection-change="handleSelectionChanges"
|
>
|
<el-table-column type="selection" width="40" align="center" />
|
<el-table-column
|
prop="tjNumber"
|
label="体检号"
|
width="160"
|
align="center"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="name"
|
label="姓名"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="sex"
|
label="性别"
|
align="center"
|
width="70px"
|
:show-overflow-tooltip="true"
|
>
|
<template slot-scope="scope">{{
|
scope.row.sex === 0 ? "男" : "女"
|
}}</template>
|
</el-table-column>
|
<el-table-column
|
prop="age"
|
label="年龄"
|
align="center"
|
width="70"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="company"
|
label="单位"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="department"
|
label="部门"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div style="width: 50%; display: flex">
|
<el-table
|
border
|
:data="tableData1"
|
style="width: 100%; margin-right: 10px"
|
@selection-change="handleSelectionChange"
|
>
|
<el-table-column type="selection" width="40" align="center" />
|
<el-table-column
|
prop="bingzhong"
|
label="选择输出病种名称"
|
align="center"
|
>
|
</el-table-column>
|
</el-table>
|
<el-table border :data="tableData2" style="width: 100%">
|
<el-table-column type="selection" width="40" align="center" />
|
<el-table-column prop="bingzhong" label="已选病种名称" align="center">
|
</el-table-column>
|
</el-table>
|
</div>
|
</div>
|
<div style="margin-right: 64%">
|
<pagination
|
v-show="total > 0"
|
:total="total"
|
:page.sync="queryParams.page"
|
:limit.sync="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</div>
|
<div style="margin-right: 11%">
|
<pagination
|
v-show="totals > 0"
|
:total="totals"
|
:page.sync="queryParam.page"
|
:limit.sync="queryParam.pageSize"
|
@pagination="geticd"
|
/>
|
</div>
|
<!-- <div style="width: 100%; display: flex">
|
<el-pagination
|
v-show="totals > 0"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page="currentPage4"
|
:page-sizes="[10, 20, 30, 40]"
|
:page-size="10"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="totals"
|
>
|
</el-pagination>
|
</div> -->
|
<!-- 查看统计图 -->
|
<div class="dia">
|
<el-dialog
|
:title="title2"
|
:visible.sync="open"
|
width="1300px"
|
append-to-body
|
>
|
<div style="height: 620px; margin-top: 10px">
|
<div id="main" style="width: 95%; height: 400px"></div>
|
</div>
|
</el-dialog>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
const echarts = require("echarts/lib/echarts");
|
require("echarts/lib/component/title");
|
require("echarts/lib/component/tooltip");
|
require("echarts/lib/component/legend");
|
require("echarts/lib/chart/pie");
|
import {
|
getPeopleList,
|
getDeptAndDwDeptByComp,
|
getDwGroupingByDwDeptId,
|
getTjRules,
|
getStatist,
|
} from "@/api/team/disease";
|
import { listComp } from "@/api/system/comp";
|
export default {
|
data() {
|
return {
|
rongjiList: [],
|
aids: [],
|
tjNums: [],
|
title2: "",
|
open: false,
|
currentPage4: 1,
|
gropList: [],
|
dwList: [],
|
compList: [],
|
total: 0,
|
totals: 0,
|
tableData: [],
|
tableData1: [],
|
tableData2: [],
|
createTimeList: [],
|
queryParam: {
|
name: null,
|
page: 1,
|
pageSize: 10,
|
groupingId: null,
|
},
|
queryParams: {
|
page: 1,
|
pageSize: 10,
|
compId: null,
|
deptName: null,
|
groupingId: null,
|
beginTime: null,
|
endTime: null,
|
dwDeptId: null,
|
},
|
pickerOptions: {
|
shortcuts: [
|
{
|
text: "最近一周",
|
onClick(picker) {
|
const end = new Date();
|
const start = new Date();
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
picker.$emit("pick", [start, end]);
|
},
|
},
|
{
|
text: "最近一个月",
|
onClick(picker) {
|
const end = new Date();
|
const start = new Date();
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
picker.$emit("pick", [start, end]);
|
},
|
},
|
{
|
text: "最近三个月",
|
onClick(picker) {
|
const end = new Date();
|
const start = new Date();
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
picker.$emit("pick", [start, end]);
|
},
|
},
|
],
|
},
|
};
|
},
|
created() {
|
this.getNowTime();
|
this.getList();
|
this.getcomp();
|
this.geticd();
|
},
|
methods: {
|
// / 处理默认选中当前日期
|
getNowTime() {
|
var curDate = new Date().getTime();
|
var dayNum = 7 * 24 * 3600 * 1000;
|
var threeDays = curDate - dayNum;
|
var sDay = this.getLocalTime(threeDays);
|
var end = this.getLocalTime(curDate);
|
this.createTimeList = [sDay, end];
|
},
|
add0(m) {
|
return m < 10 ? "0" + m : m;
|
},
|
getLocalTime(nS) {
|
var time = new Date(nS);
|
var y = time.getFullYear();
|
var m = time.getMonth() + 1;
|
var d = time.getDate();
|
return y + "-" + this.add0(m) + "-" + this.add0(d);
|
},
|
// 团检病种页面查询人员列表
|
getList() {
|
this.queryParams.beginTime = this.createTimeList[0];
|
this.queryParams.endTime = this.createTimeList[1];
|
getPeopleList(this.queryParams).then((res) => {
|
this.tableData = res.data.voList;
|
this.total = res.data.total;
|
});
|
},
|
/** 查询疾病字典列表 */
|
geticd() {
|
// if (this.queryParams.groupingId) {
|
this.queryParam.groupingId = this.queryParams.groupingId;
|
getTjRules(this.queryParam).then((response) => {
|
this.tableData1 = response.data.rulesList;
|
// let index = this.tableData1.findIndex(item =>{
|
// if(item == null){
|
// return true
|
// }
|
// })
|
// this.tableData1.splice(index,1)
|
this.totals = response.data.total;
|
});
|
// }
|
},
|
handleSizeChange(val) {
|
this.queryParam.pageSize = val;
|
this.geticd();
|
},
|
handleCurrentChange(val) {
|
this.queryParam.page = val;
|
this.geticd();
|
},
|
/** 查询体检单位信息维护列表 */
|
getcomp() {
|
listComp().then((response) => {
|
this.compList = response.rows;
|
});
|
},
|
// 根据单位查询部门和单位部门信息
|
cmp(val) {
|
let compId = val;
|
getDeptAndDwDeptByComp(compId).then((res) => {
|
this.dwList = res.data;
|
});
|
},
|
// 根据单位部门查询单位分组信息信息
|
dw(vals) {
|
let dwDeptId = vals;
|
getDwGroupingByDwDeptId(dwDeptId).then((res) => {
|
this.gropList = res.data;
|
});
|
},
|
handleSelectionChanges(selection) {
|
this.tjNums = selection.map((item) => item.tjNumber);
|
},
|
handleSelectionChange(selection) {
|
this.tableData2 = selection;
|
this.aids = selection.map((item) => item.aid);
|
},
|
clear() {
|
this.tableData2 = [];
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.page = 1;
|
this.getList();
|
this.queryParam.page = 1;
|
this.geticd();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.resetForm("queryForm");
|
this.handleQuery();
|
this.loading = true;
|
},
|
dateChangebirthday1(val) {
|
this.createTimeList = val;
|
},
|
tongji() {
|
this.title2 = "统计图表";
|
|
let tjRulesStatisticsDto = {
|
aids: this.aids,
|
tjNums: this.tjNums,
|
};
|
console.log(tjRulesStatisticsDto);
|
if (
|
tjRulesStatisticsDto.aids.length === 0 ||
|
tjRulesStatisticsDto.tjNums.length === 0
|
) {
|
this.$message.warning("请选择人员和病种!");
|
} else {
|
this.open = true;
|
getStatist(tjRulesStatisticsDto).then((res) => {
|
this.rongjiList = res.data;
|
|
this.$nextTick(() => {
|
var chartDom = document.getElementById("main");
|
var myChart = echarts.init(chartDom);
|
var option;
|
|
option = {
|
title: {
|
text: "病种统计",
|
left: "center",
|
},
|
tooltip: {
|
trigger: "item",
|
formatter: "{a} <br/>{b} : {c} ({d}%)",
|
},
|
legend: {
|
// type: 'scroll',
|
orient: "vertical",
|
right: 10,
|
top: 80,
|
bottom: 20,
|
data: this.rongjiList,
|
},
|
series: [
|
{
|
name: "病种名称",
|
type: "pie",
|
radius: "55%",
|
center: ["25%", "60%"],
|
|
data: this.rongjiList,
|
emphasis: {
|
itemStyle: {
|
shadowBlur: 10,
|
shadowOffsetX: 0,
|
shadowColor: "rgba(0, 0, 0, 0.5)",
|
},
|
},
|
},
|
],
|
};
|
|
option && myChart.setOption(option);
|
let sizeFun = function () {
|
myChart.resize();
|
};
|
window.addEventListener("resize", sizeFun);
|
});
|
// let dataValue1 = [];
|
// this.dateAll = [];
|
// this.rongjiList.forEach((item) => {
|
// console.log(item);
|
// this.dateAll.push(item.bingzhong);
|
// dataValue1.push(item.num);
|
// });
|
// let myChart = this.$echarts.init(document.getElementById("main"));
|
// myChart.setOption({
|
// legend: {},
|
|
// tooltip: {},
|
// xAxis: {
|
// type: "category",
|
// name: "病种名称",
|
// data: this.dateAll,
|
// },
|
// yAxis: {
|
// type:'value'
|
// },
|
// series: [
|
// {
|
// name: "人数",
|
// type: "bar",
|
// data: dataValue1,
|
// },
|
// ],
|
// });
|
});
|
}
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.el-pagination {
|
margin-left: 47%;
|
}
|
</style>
|