| | |
| | | <template> |
| | | <div class="Questionnairemanagement"> |
| | | <!-- 左侧栏 --> |
| | | <!-- <div class="sidecolumn"> |
| | | <div class="sidecolumn-top"> |
| | | <div class="top-wj">患者范围</div> |
| | | </div> |
| | | |
| | | <div class="bottom-fl"> |
| | | <el-tabs |
| | | tab-position="right" |
| | | v-model="activeName" |
| | | @tab-click="handleClick" |
| | | > |
| | | <el-tab-pane label="全部" name="first"></el-tab-pane> |
| | | <el-tab-pane label="住院" name="bhospitalized"></el-tab-pane> |
| | | <el-tab-pane label="在院" name="Inhospital"></el-tab-pane> |
| | | <el-tab-pane label="门诊" name="outpatient"></el-tab-pane> |
| | | <el-tab-pane label="体检" name="physical"></el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </div> --> |
| | | <!-- 右侧数据 --> |
| | | <div class="leftvlue"> |
| | | <!-- <div class="leftvlue-top"> |
| | | <el-tabs v-model="topactiveName" @tab-click="tophandleClick"> |
| | | <el-tab-pane name="Local"> |
| | | <span class="mulsz" slot="label">按出院病区统计 </span> |
| | | </el-tab-pane> |
| | | <el-tab-pane name="sharing"> |
| | | <span class="mulsz" slot="label">按出院科室统计 </span> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> --> |
| | | <div class="leftvlue-bg"> |
| | | <el-row :gutter="20"> |
| | | <!--标签数据--> |
| | |
| | | v-show="showSearch" |
| | | label-width="98px" |
| | | > |
| | | <!-- <el-form-item label="责任医生" prop="userName"> |
| | | <el-input |
| | | v-model="queryParams.drname" |
| | | placeholder="请输入主治医生" |
| | | ></el-input> |
| | | </el-form-item> --> |
| | | <el-form-item label="统计类型" prop="userName"> |
| | | <el-select |
| | | v-model="queryParams.statisticaltype" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | <el-select |
| | | style="margin-left: 10px" |
| | | v-if="queryParams.statisticaltype == 1" |
| | | v-model="queryParams.leavehospitaldistrictcodes" |
| | | v-model="queryParams.leavehospitaldistrictcode" |
| | | size="medium" |
| | | multiple |
| | | filterable |
| | | placeholder="请选择病区" |
| | | > |
| | | <el-option |
| | | v-for="item in flatArrayhospit" |
| | | :key="item.value" |
| | | v-for="item in flatArray" |
| | | :key="item.deptCode" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :value="item.deptCode" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <el-select |
| | | v-else-if="queryParams.statisticaltype == 2" |
| | | v-model="queryParams.deptcodes" |
| | | v-model="queryParams.deptCode" |
| | | size="medium" |
| | | multiple |
| | | filterable |
| | | placeholder="请选择科室" |
| | | > |
| | | <el-option |
| | | v-for="item in flatArraydept" |
| | | :key="item.value" |
| | | v-for="item in flatArray" |
| | | :key="item.deptCode" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :value="item.deptCode" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | > |
| | | <el-date-picker |
| | | v-model="queryParams.dateRange" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | |
| | | >重置</el-button |
| | | > |
| | | </el-form-item> |
| | | <el-col :span="19"> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-download" |
| | | icon="el-icon-plus" |
| | | size="medium" |
| | | @click="handleExport" |
| | | >导出</el-button |
| | | @click="addladeltag" |
| | | v-hasPermi="['system:user:add']" |
| | | >新增</el-button |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-data-line" |
| | | size="medium" |
| | | @click="showChartDialog" |
| | | >统计趋势图</el-button |
| | | > |
| | | </el-col> |
| | | </el-form> |
| | | </el-row> |
| | | |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="userList" |
| | |
| | | /> |
| | | <el-table-column |
| | | label="科室" |
| | | width="120" |
| | | width="120" |
| | | prop="deptname" |
| | | align="center" |
| | | /> |
| | |
| | | <el-table-column |
| | | label="出院病区" |
| | | align="center" |
| | | sortable |
| | | key="leavehospitaldistrictname" |
| | | prop="leavehospitaldistrictname" |
| | | width="150" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | label="科室" |
| | | align="center" |
| | | key="deptname" |
| | | prop="deptname" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | |
| | | }}%</span |
| | | > |
| | | </template> --> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="及时率" |
| | | align="center" |
| | | width="120" |
| | | key="rate" |
| | | prop="rate" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click="Seedetails(scope.row)" |
| | | ><span class="button-zx" |
| | | >{{ (Number(scope.row.rate) * 100).toFixed(2) }}%</span |
| | | ></el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="人工" |
| | |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | <!-- 统计趋势图弹窗 --> |
| | | <el-dialog |
| | | title="随访统计趋势图" |
| | | :visible.sync="chartDialogVisible" |
| | | width="80%" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <div class="chart-container"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="chart-title">随访状态分布</div> |
| | | <div id="pieChart" style="width: 100%; height: 400px"></div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="chart-title">随访趋势分析</div> |
| | | <div id="barLineChart" style="width: 100%; height: 400px"></div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="未及时随访患者服务" |
| | | :visible.sync="SeedetailsVisible" |
| | |
| | | import { |
| | | toamendtag, |
| | | addapitag, |
| | | detailstag, |
| | | deletetag, |
| | | changetagcategory, |
| | | toamendtagcategory, |
| | | addtagcategory, |
| | | deletetagcategory, |
| | | listtag, |
| | | tagclassifylist, |
| | | } from "@/api/system/label"; |
| | | import { getSfStatistics, deptTreeSelect } from "@/api/system/user"; |
| | | import store from "@/store"; |
| | | import { getSfStatistics, selectTimelyRate } from "@/api/system/user"; |
| | | |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | |
| | | }, |
| | | ]; |
| | | export default { |
| | | name: "Percentage", |
| | | name: "questionnaire", |
| | | dicts: ["sys_normal_disable", "sys_user_sex"], |
| | | components: { Treeselect }, |
| | | data() { |
| | |
| | | // 遮罩层 |
| | | loading: false, |
| | | Seedloading: false, |
| | | chartDialogVisible: false, |
| | | pieChart: null, |
| | | barLineChart: null, |
| | | // 选中数组 |
| | | ids: [], |
| | | // 非单个禁用 |
| | |
| | | idds: "", //分类id |
| | | // 总条数 |
| | | total: 0, |
| | | flatArrayhospit: [], |
| | | flatArraydept: [], |
| | | patienttotal: 0, |
| | | logsheetlist: [], |
| | | flatArray: [], |
| | | deptflatArray: [], |
| | | |
| | | Statisticallist: [ |
| | | { |
| | | label: "病区统计", |
| | |
| | | value: 2, |
| | | }, |
| | | ], |
| | | patientqueryParams: { |
| | | pn: 1, |
| | | ps: 10, |
| | | }, |
| | | amendtag: false, //是否修改类别 |
| | | lstamendtag: false, //是否修改标签 |
| | | scavisible: false, //删除弹框 |
| | |
| | | postOptions: [], |
| | | // 角色选项 |
| | | roleOptions: [], |
| | | // 存储所有科室代码 |
| | | allDeptCodes: [], |
| | | // 存储所有病区代码 |
| | | allWardCodes: [], |
| | | // 表单参数 |
| | | form: {}, |
| | | forms: { |
| | |
| | | goQRCodeVisible: false, //二维码弹框 |
| | | sidecolumnval: "", //类别搜索 |
| | | propss: { multiple: true }, |
| | | SeedetailsVisible: false, |
| | | |
| | | options: [ |
| | | { |
| | | value: 1, |
| | |
| | | }, |
| | | watch: {}, |
| | | created() { |
| | | this.getDeptTree(); |
| | | this.getList(); |
| | | this.getDeptTree(); |
| | | }, |
| | | |
| | | methods: { |
| | | /** 查询标签列表 */ |
| | | getList() { |
| | | // 处理查询参数 |
| | | const params = { |
| | | ...this.queryParams, |
| | | // 如果选择了"全部",则传所有病区/科室代码 |
| | | leavehospitaldistrictcodes: |
| | | this.queryParams.leavehospitaldistrictcodes.includes("all") |
| | | ? this.allWardCodes |
| | | : this.queryParams.leavehospitaldistrictcodes, |
| | | deptcodes: this.queryParams.deptcodes.includes("all") |
| | | ? this.allDeptCodes |
| | | : this.queryParams.deptcodes, |
| | | }; |
| | | |
| | | // 移除可能存在的"all"值 |
| | | delete params.leavehospitaldistrictcodes.all; |
| | | delete params.deptcodes.all; |
| | | getSfStatistics(params).then((response) => { |
| | | getSfStatistics(this.queryParams).then((response) => { |
| | | console.log(response); |
| | | // this.total = response.total; |
| | | this.userList = response.data; |
| | |
| | | |
| | | // 处理行点击展开 |
| | | handleRowClick(row) { |
| | | console.log(row,'row'); |
| | | console.log(row, "row"); |
| | | |
| | | // 如果已经展开则收起 |
| | | if (this.expands.includes(this.getRowKey(row))) { |
| | |
| | | // 获取科室树 |
| | | getDeptTree() { |
| | | // 科室列表 |
| | | this.flatArraydept = store.getters.belongDepts.map((dept) => { |
| | | return { |
| | | label: dept.deptName, |
| | | value: dept.deptCode, |
| | | }; |
| | | deptTreeSelect().then((response) => { |
| | | this.deptOptions = response.data; |
| | | console.log(this.deptOptions, " this.deptOptions"); |
| | | |
| | | this.flatArray = this.flattenArray(response.data); |
| | | console.log(this.flatArray, "this.flatArray"); |
| | | }); |
| | | // 存储所有科室代码 |
| | | this.allDeptCodes = store.getters.belongDepts.map( |
| | |
| | | tagdescription: "", |
| | | tagid: "", |
| | | }; |
| | | }, |
| | | Seedetails(row) { |
| | | this.SeedetailsVisible = true; |
| | | this.Seedloading = true; |
| | | this.patientqueryParams.starttime = this.parseTime( |
| | | this.queryParams.dateRange[0] |
| | | ); |
| | | this.patientqueryParams.endtime = this.parseTime( |
| | | this.queryParams.dateRange[1] |
| | | ); |
| | | this.patientqueryParams.deptcode = row.deptcode; |
| | | selectTimelyRate(this.patientqueryParams).then((response) => { |
| | | this.logsheetlist = response.data.detail; |
| | | this.patienttotal = response.data.total; |
| | | this.Seedloading = false; |
| | | }); |
| | | }, |
| | | SeedetailsgGo(row) { |
| | | this.SeedetailsVisible = false; |
| | | let type = ""; |
| | | if (row.preachformson && row.preachformson.includes("3")) { |
| | | type = 1; |
| | | } |
| | | setTimeout(() => { |
| | | this.$router.push({ |
| | | path: "/followvisit/record/detailpage/", |
| | | query: { |
| | | taskid: row.taskid, |
| | | patid: row.patid, |
| | | id: row.id, |
| | | Voicetype: type, |
| | | // visitCount: this.topqueryParams.visitCount, |
| | | }, |
| | | }); |
| | | }, 300); |
| | | }, |
| | | // 添加/修改标签 |
| | | Maintenancetag() { |
| | |
| | | /** 搜索按钮操作 */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | if (!this.queryParams.dateRange) this.queryParams.dateRange = []; |
| | | if (this.queryParams.statisticaltype == 1) { |
| | | this.queryParams.deptcodes = []; |
| | | } else if (this.queryParams.statisticaltype == 2) { |
| | | this.queryParams.leavehospitaldistrictcodes = []; |
| | | } |
| | | console.log(this.queryParams.dateRange); |
| | | |
| | | console.log(); |
| | | this.queryParams.startTime = this.parseTime( |
| | | this.queryParams.dateRange[0] |
| | | ); |
| | |
| | | `user_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }, |
| | | // 显示图表弹窗 |
| | | |
| | | showChartDialog() { |
| | | this.chartDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.initPieChart(); |
| | | this.initBarLineChart(); |
| | | }); |
| | | }, |
| | | // 在methods中修改统计方法 |
| | | showChartDialog() { |
| | | this.chartDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | console.log(this.userList, "this.userList"); |
| | | |
| | | this.initCharts(); |
| | | }); |
| | | }, |
| | | |
| | | // 新增初始化图表方法 |
| | | initCharts() { |
| | | this.initPieChart(); |
| | | this.initBarLineChart(); |
| | | }, |
| | | |
| | | // 初始化饼图 |
| | | initPieChart() { |
| | | const echarts = require("echarts"); |
| | | const pieDom = document.getElementById("pieChart"); |
| | | if (!pieDom) return; |
| | | |
| | | if (this.pieChart) { |
| | | this.pieChart.dispose(); |
| | | } |
| | | |
| | | this.pieChart = echarts.init(pieDom); |
| | | |
| | | // 计算饼图数据 |
| | | const followUpData = { |
| | | pending: 0, |
| | | success: 0, |
| | | fail: 0, |
| | | }; |
| | | |
| | | this.userList.forEach((item) => { |
| | | followUpData.pending += item.pendingFollowUp || 0; |
| | | followUpData.success += item.followUpSuccess || 0; |
| | | followUpData.fail += item.followUpFail || 0; |
| | | }); |
| | | |
| | | // 使用更美观的颜色方案 |
| | | const pieOption = { |
| | | title: { |
| | | text: "随访状态分布", |
| | | left: "center", |
| | | textStyle: { |
| | | color: '#333', |
| | | fontSize: 16 |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: "item", |
| | | formatter: "{a} <br/>{b}: {c} ({d}%)", |
| | | }, |
| | | legend: { |
| | | orient: "vertical", |
| | | left: "left", |
| | | data: ["待随访", "随访成功", "随访失败"], |
| | | textStyle: { |
| | | color: '#666' |
| | | } |
| | | }, |
| | | color: ['#FF9D4D', '#36B37E', '#FF5C5C'], // 新的配色方案 |
| | | series: [ |
| | | { |
| | | name: "随访状态", |
| | | type: "pie", |
| | | radius: ["40%", "70%"], |
| | | avoidLabelOverlap: true, |
| | | itemStyle: { |
| | | borderRadius: 10, |
| | | borderColor: "#fff", |
| | | borderWidth: 2 |
| | | }, |
| | | label: { |
| | | show: true, |
| | | formatter: "{b}: {c} ({d}%)", |
| | | color: '#333' |
| | | }, |
| | | emphasis: { |
| | | label: { |
| | | show: true, |
| | | fontSize: "18", |
| | | fontWeight: "bold" |
| | | }, |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | }, |
| | | data: [ |
| | | { |
| | | value: followUpData.pending, |
| | | name: "待随访" |
| | | }, |
| | | { |
| | | value: followUpData.success, |
| | | name: "随访成功" |
| | | }, |
| | | { |
| | | value: followUpData.fail, |
| | | name: "随访失败" |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | this.pieChart.setOption(pieOption); |
| | | window.addEventListener("resize", this.resizePieChart); |
| | | }, |
| | | |
| | | // 初始化柱状折线图 |
| | | initBarLineChart() { |
| | | const echarts = require("echarts"); |
| | | const barDom = document.getElementById("barLineChart"); |
| | | if (!barDom) return; |
| | | |
| | | if (this.barLineChart) { |
| | | this.barLineChart.dispose(); |
| | | } |
| | | |
| | | this.barLineChart = echarts.init(barDom); |
| | | |
| | | // 准备数据 |
| | | const categories = this.userList.map( |
| | | (item) => item.leavehospitaldistrictname || item.deptname |
| | | ); |
| | | |
| | | const dischargeData = this.userList.map( |
| | | (item) => item.dischargeCount || 0 |
| | | ); |
| | | const followUpData = this.userList.map( |
| | | (item) => item.followUpNeeded || 0 |
| | | ); |
| | | |
| | | // 新增两条折线数据 |
| | | const followUpRateData = this.userList.map(item => { |
| | | if (!item.followUpRate) return 0; |
| | | // 去掉百分号并转为数字 |
| | | const rateStr = String(item.followUpRate).replace('%', ''); |
| | | return parseFloat(rateStr) || 0; |
| | | }); |
| | | |
| | | const timelyRateData = this.userList.map(item => |
| | | item.rate ? (Number(item.rate) * 100).toFixed(2) : 0 |
| | | ); |
| | | |
| | | const option = { |
| | | title: { |
| | | text: "科室/病区随访趋势", |
| | | left: "center", |
| | | textStyle: { |
| | | color: '#333', |
| | | fontSize: 16 |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | type: "cross", |
| | | crossStyle: { |
| | | color: "#999", |
| | | }, |
| | | }, |
| | | }, |
| | | legend: { |
| | | data: ["出院人次", "应随访人次", "随访率(%)", "及时率(%)"], |
| | | top: "bottom", |
| | | textStyle: { |
| | | color: '#666' |
| | | } |
| | | }, |
| | | color: ['#5470C6', '#91CC75', '#EE6666', '#9A60B4'], // 新增紫色用于及时率 |
| | | xAxis: { |
| | | type: "category", |
| | | data: categories, |
| | | axisLabel: { |
| | | interval: 0, |
| | | rotate: 30, |
| | | color: '#666' |
| | | }, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#ddd' |
| | | } |
| | | } |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | type: "value", |
| | | name: "人次", |
| | | min: 0, |
| | | axisLabel: { |
| | | color: '#666' |
| | | }, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#ddd' |
| | | } |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: '#f0f0f0' |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | type: "value", |
| | | name: "百分比(%)", |
| | | min: 0, |
| | | max: 100, |
| | | axisLabel: { |
| | | color: '#666', |
| | | formatter: '{value}%' |
| | | }, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#ddd' |
| | | } |
| | | }, |
| | | splitLine: { |
| | | show: false |
| | | } |
| | | } |
| | | ], |
| | | series: [ |
| | | { |
| | | name: "出院人次", |
| | | type: "bar", |
| | | barWidth: "25%", |
| | | data: dischargeData, |
| | | itemStyle: { |
| | | borderRadius: [4, 4, 0, 0] |
| | | } |
| | | }, |
| | | { |
| | | name: "应随访人次", |
| | | type: "bar", |
| | | barWidth: "25%", |
| | | data: followUpData, |
| | | itemStyle: { |
| | | borderRadius: [4, 4, 0, 0] |
| | | } |
| | | }, |
| | | { |
| | | name: "随访率(%)", |
| | | type: "line", |
| | | yAxisIndex: 1, |
| | | data: followUpRateData, |
| | | symbolSize: 8, |
| | | lineStyle: { |
| | | width: 3 |
| | | }, |
| | | markLine: { |
| | | silent: true, |
| | | data: [{ |
| | | yAxis: 80, |
| | | lineStyle: { |
| | | color: '#EE6666', |
| | | type: 'dashed' |
| | | }, |
| | | // label: { |
| | | // position: 'end', |
| | | // formatter: '目标80%' |
| | | // } |
| | | }] |
| | | } |
| | | }, |
| | | { |
| | | name: "及时率(%)", |
| | | type: "line", |
| | | yAxisIndex: 1, |
| | | data: timelyRateData, |
| | | symbolSize: 8, |
| | | lineStyle: { |
| | | width: 3, |
| | | type: 'dotted' // 使用虚线区分 |
| | | }, |
| | | markLine: { |
| | | silent: true, |
| | | data: [{ |
| | | yAxis: 90, |
| | | lineStyle: { |
| | | color: '#9A60B4', |
| | | type: 'dashed' |
| | | }, |
| | | // label: { |
| | | // position: 'end', |
| | | // formatter: '目标90%' |
| | | // } |
| | | }] |
| | | } |
| | | } |
| | | ], |
| | | grid: { |
| | | top: '15%', |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '15%', |
| | | containLabel: true |
| | | } |
| | | }; |
| | | |
| | | this.barLineChart.setOption(option); |
| | | window.addEventListener("resize", this.resizeBarLineChart); |
| | | }, |
| | | |
| | | // 图表响应式调整方法 |
| | | resizePieChart() { |
| | | if (this.pieChart) { |
| | | this.pieChart.resize(); |
| | | } |
| | | }, |
| | | |
| | | resizeBarLineChart() { |
| | | if (this.barLineChart) { |
| | | this.barLineChart.resize(); |
| | | } |
| | | }, |
| | | |
| | | // 在组件销毁时清理 |
| | | beforeDestroy() { |
| | | // 移除事件监听 |
| | | window.removeEventListener("resize", this.resizePieChart); |
| | | window.removeEventListener("resize", this.resizeBarLineChart); |
| | | |
| | | // 销毁图表实例 |
| | | if (this.pieChart) { |
| | | this.pieChart.dispose(); |
| | | this.pieChart = null; |
| | | } |
| | | if (this.barLineChart) { |
| | | this.barLineChart.dispose(); |
| | | this.barLineChart = null; |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |