| | |
| | | { value: careData.inProgress, name: "护理进行中" }, |
| | | { value: careData.notStarted, name: "护理未开始" }, |
| | | ]; |
| | | } else if (this.activeTab === "combined") { |
| | | legendData = ["待随访", "随访成功", "随访失败"]; |
| | | const followUpData = { |
| | | pending: 0, |
| | | success: 0, |
| | | fail: 0, |
| | | }; |
| | | |
| | | this.data.forEach((item) => { |
| | | followUpData.pending += |
| | | (item.pendingFollowUp || 0) + (item.pendingFollowUpAgain || 0); |
| | | followUpData.success += |
| | | (item.followUpSuccess || 0) + (item.followUpSuccessAgain || 0); |
| | | followUpData.fail += |
| | | (item.followUpFail || 0) + (item.followUpFailAgain || 0); |
| | | }); |
| | | |
| | | seriesData = [ |
| | | { value: followUpData.pending, name: "待随访" }, |
| | | { value: followUpData.success, name: "随访成功" }, |
| | | { value: followUpData.fail, name: "随访失败" }, |
| | | ]; |
| | | } |
| | | |
| | | return { legendData, seriesData }; |
| | |
| | | }, |
| | | }, |
| | | ]; |
| | | } else if (this.activeTab === "combined") { |
| | | title = "综合随访"; |
| | | yAxisName1 = "人次"; |
| | | legendData = ["出院人次", "首次完成", "再次完成", "随访率(%)", "推送率(%)"]; |
| | | colors = ["#5470C6", "#91CC75", "#FAC858", "#EE6666", "#9A60B4"]; |
| | | |
| | | const dischargeData = this.data.map((item) => item.dischargeCount || 0); |
| | | const firstSuccessData = this.data.map( |
| | | (item) => item.followUpSuccess || 0 |
| | | ); |
| | | const againSuccessData = this.data.map( |
| | | (item) => item.followUpSuccessAgain || 0 |
| | | ); |
| | | const followUpRateData = this.data.map((item) => { |
| | | const success = Number(item.followUpSuccess) || 0; |
| | | const nonFollowUp = Number(item.nonFollowUp) || 0; |
| | | const followUpNeeded = Number(item.followUpNeeded) || 0; |
| | | const denominator = followUpNeeded + nonFollowUp; |
| | | return denominator > 0 |
| | | ? Number((((success + nonFollowUp) / denominator) * 100).toFixed(2)) |
| | | : 0; |
| | | }); |
| | | const pushRateData = this.data.map((item) => { |
| | | const successAgain = Number(item.followUpSuccessAgain) || 0; |
| | | const nonFollowUp = Number(item.nonFollowUp) || 0; |
| | | const followUpNeeded = Number(item.followUpNeeded) || 0; |
| | | const denominator = followUpNeeded + nonFollowUp; |
| | | return denominator > 0 |
| | | ? Number(((successAgain / denominator) * 100).toFixed(2)) |
| | | : 0; |
| | | }); |
| | | |
| | | series = [ |
| | | { |
| | | name: "出院人次", |
| | | type: "bar", |
| | | barWidth: "25%", |
| | | data: dischargeData, |
| | | itemStyle: { borderRadius: [4, 4, 0, 0] }, |
| | | }, |
| | | { |
| | | name: "首次完成", |
| | | type: "bar", |
| | | barWidth: "25%", |
| | | data: firstSuccessData, |
| | | itemStyle: { borderRadius: [4, 4, 0, 0] }, |
| | | }, |
| | | { |
| | | name: "再次完成", |
| | | type: "bar", |
| | | barWidth: "25%", |
| | | data: againSuccessData, |
| | | itemStyle: { borderRadius: [4, 4, 0, 0] }, |
| | | }, |
| | | { |
| | | name: "随访率(%)", |
| | | type: "line", |
| | | yAxisIndex: 1, |
| | | data: followUpRateData, |
| | | symbolSize: 8, |
| | | lineStyle: { width: 3 }, |
| | | }, |
| | | { |
| | | name: "推送率(%)", |
| | | type: "line", |
| | | yAxisIndex: 1, |
| | | data: pushRateData, |
| | | symbolSize: 8, |
| | | lineStyle: { width: 3, type: "dotted" }, |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | | return { |