index.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <div class="page-container">
  3. <!--统计-->
  4. <el-row class="top-panel">
  5. <el-col :span="6">
  6. <div class="group-box">
  7. <div class="group-title">
  8. 满意医院-{{ year }}年{{ month }}月
  9. <ScoreIcon :score="score" />
  10. </div>
  11. <div class="group-content">
  12. <div class="scoreIcon-container">
  13. <div class="scoreIcon scoreIcon-3">{{ parseFloat(score)!==0?parseFloat(score).toFixed(1):0 }}</div>
  14. <span class="tip">总评分</span>
  15. </div>
  16. </div>
  17. </div>
  18. </el-col>
  19. <el-col :span="12">
  20. <div class="group-box">
  21. <div class="group-title">
  22. <el-select v-model="year" placeholder="请选择" class="el-select-text" @change="getData">
  23. <el-option
  24. v-for="item in yearList"
  25. :key="item"
  26. :label="item+'年'"
  27. :value="item"
  28. />
  29. </el-select>
  30. 评分-<span>环比</span>
  31. </div>
  32. <div class="group-content">
  33. <FullYearChart :keys="yearScoreKeys" :values="yearScoreValues" @change="changeFullYearChart" />
  34. </div>
  35. </div>
  36. </el-col>
  37. <el-col :span="6">
  38. <div class="group-box">
  39. <div class="group-title">
  40. 历年{{ month }}月评分-<span>同比</span>
  41. </div>
  42. <div class="group-content">
  43. <YoYChart :keys="YoYScoreKeys" :values="YoYScoreValues" />
  44. </div>
  45. </div>
  46. </el-col>
  47. </el-row>
  48. <!--数据块-->
  49. <el-row>
  50. <el-col :span="6">
  51. <div>
  52. <TaskPanel more="/hos/satisfy/task/index" height="calc(100vh - 282px)" :task-cat-id="storyId" />
  53. </div>
  54. </el-col>
  55. <el-col :span="12">
  56. <div class="group-box">
  57. <div class="group-title">
  58. 满意医院-待改进项目
  59. <el-link @click="handleMoreAssess()">立即评价</el-link>
  60. </div>
  61. <el-row>
  62. <vuescroll :ops="ops" style="height: calc(100vh - 350px)">
  63. <ImprovingAdvice :story-id="storyId" />
  64. </vuescroll>
  65. </el-row>
  66. </div>
  67. </el-col>
  68. <el-col :span="6">
  69. <div>
  70. <ArtPanel more="/hos/satisfy/news/index" height="calc(100vh - 282px)" />
  71. </div>
  72. </el-col>
  73. </el-row>
  74. <IndexScoreDetail ref="IndexScoreDetail" />
  75. <AssessDetail ref="AssessDetail" />
  76. </div>
  77. </template>
  78. <script>
  79. import { FullYearChart, YoYChart } from '../components'
  80. import { getStoryOverview } from '@/api/hos/hosStatisApi'
  81. import ArtPanel from '@/views/hos/components/ArtPanel'
  82. import TaskPanel from '@/views/hos/components/TaskPanel'
  83. import { ImprovingAdvice } from '@/views/hos/components'
  84. import { IndexScoreDetail, ScoreIcon } from '@/components'
  85. import { AssessDetail } from '@/views/hos/components'
  86. import vuescroll from 'vuescroll'
  87. export default {
  88. name: 'SatisfyIndex',
  89. components: {
  90. ImprovingAdvice,
  91. FullYearChart,
  92. YoYChart,
  93. ArtPanel,
  94. TaskPanel,
  95. IndexScoreDetail,
  96. ScoreIcon,
  97. AssessDetail,
  98. vuescroll
  99. },
  100. data() {
  101. return {
  102. ops: {
  103. bar: {
  104. keepShow: false,
  105. background: 'rgba(144, 147, 153, 0.4)',
  106. onlyShowBarOnScroll: false
  107. }
  108. },
  109. path: require('@/assets/images/login/login_number.png'),
  110. scoreGreenBgImage: require('@/assets/images/common-hospital/common_dial_green.png'),
  111. scoreRadBgImage: require('@/assets/images/common-hospital/common_dial_red.png'),
  112. yearList: [],
  113. year: 2022,
  114. month: 10,
  115. storyId: 3,
  116. score: 0,
  117. yearScore: [],
  118. yearScoreKeys: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  119. yearScoreValues: [],
  120. monthScore: [],
  121. YoYScoreKeys: [],
  122. YoYScoreValues: []
  123. }
  124. },
  125. mounted() {
  126. const d = new Date()
  127. this.year = d.getFullYear()
  128. this.month = d.getMonth() + 1
  129. this.getData()
  130. this.initYearList()
  131. },
  132. methods: {
  133. initYearList() {
  134. const d = new Date()
  135. var yearList = []
  136. for (let i = -5; i < 1; i++) {
  137. yearList.push(d.getFullYear() + i)
  138. }
  139. this.yearList = yearList
  140. },
  141. handleAssessDetail(row) {
  142. this.$refs['AssessDetail'].handler(row)
  143. },
  144. viewIndexScoreDetail(data) {
  145. this.$refs['IndexScoreDetail'].handler(data)
  146. },
  147. getData() {
  148. getStoryOverview(this.year, this.month, this.storyId).then((resp) => {
  149. const { code, msg, data } = resp
  150. if (code === 200) {
  151. if (!data) {
  152. this.score = 0
  153. this.yearScore = 0
  154. this.showYearScore({ 'm1': 0, 'm10': 0, 'm11': 0, 'm12': 0, 'm2': 0, 'm3': 0, 'm4': 0, 'm5': 0, 'm6': 0, 'm7': 0, 'm8': 0, 'm9': 0, 'storyId': this.storyId, 'year': this.year })
  155. this.showMonthScore([])
  156. return
  157. }
  158. this.score = data.score
  159. this.yearScore = data.yearScore
  160. if (data.yearScore) {
  161. this.showYearScore(data.yearScore)
  162. }
  163. this.monthScore = data.monthScore
  164. if (data.monthScore) {
  165. this.showMonthScore(data.monthScore)
  166. }
  167. } else {
  168. this.$message.error(msg)
  169. }
  170. }).catch((error) => {
  171. console.log(error)
  172. })
  173. },
  174. // 显示月份同比
  175. showMonthScore(data) {
  176. const keys = []
  177. const values = []
  178. for (let i = 0; i < data.length; i++) {
  179. keys.push(`${data[i].year}-${data[i].month}`)
  180. values.push(data[i].hosScore)
  181. }
  182. this.YoYScoreKeys = keys
  183. this.YoYScoreValues = values
  184. },
  185. // 显示当年环比
  186. showYearScore(data) {
  187. this.yearScoreValues.length = 0
  188. this.yearScoreValues.push(data.m1)
  189. this.yearScoreValues.push(data.m2)
  190. this.yearScoreValues.push(data.m3)
  191. this.yearScoreValues.push(data.m4)
  192. this.yearScoreValues.push(data.m5)
  193. this.yearScoreValues.push(data.m6)
  194. this.yearScoreValues.push(data.m7)
  195. this.yearScoreValues.push(data.m8)
  196. this.yearScoreValues.push(data.m9)
  197. this.yearScoreValues.push(data.m10)
  198. this.yearScoreValues.push(data.m11)
  199. this.yearScoreValues.push(data.m12)
  200. },
  201. handleMoreAssess() {
  202. this.$router.push({
  203. path: '/hos/satisfy/assess/index'
  204. })
  205. },
  206. changeFullYearChart(params) {
  207. this.month = params.x
  208. getStoryOverview(this.year, params.x, this.storyId).then((resp) => {
  209. const { code, msg, data } = resp
  210. if (code === 200) {
  211. if (!data) {
  212. this.score = 0
  213. this.yearScore = 0
  214. this.showYearScore({ 'm1': 0, 'm10': 0, 'm11': 0, 'm12': 0, 'm2': 0, 'm3': 0, 'm4': 0, 'm5': 0, 'm6': 0, 'm7': 0, 'm8': 0, 'm9': 0, 'storyId': this.storyId, 'year': this.year })
  215. this.showMonthScore([])
  216. return
  217. }
  218. this.score = data.score
  219. this.yearScore = data.yearScore
  220. if (data.yearScore) {
  221. this.showYearScore(data.yearScore)
  222. }
  223. this.monthScore = data.monthScore
  224. if (data.monthScore) {
  225. this.showMonthScore(data.monthScore)
  226. }
  227. } else {
  228. this.$message.error(msg)
  229. }
  230. })
  231. }
  232. }
  233. }
  234. </script>
  235. <style lang="scss" scoped>
  236. .page-container {
  237. margin: 0px;
  238. padding: 5px 10px;
  239. color: #FFF;
  240. position: relative;
  241. .page-title {
  242. font-size: 18px;
  243. font-weight: bold;
  244. color: #FFFFFF;
  245. }
  246. .top-panel{
  247. margin-bottom:0;
  248. .group-box{
  249. border-radius: 0;
  250. padding: 5px 15px;
  251. background-color: inherit;
  252. border-top: 0;
  253. }
  254. }
  255. .group-box {
  256. width: calc(100% - 15px);
  257. background-color: #0C3242;
  258. border-top: 4px solid #1F3C51;
  259. border-radius: 5px 5px 0 0;
  260. padding: 15px;
  261. &-bg {
  262. background-repeat: no-repeat;
  263. background-position: right top;
  264. }
  265. .group-title {
  266. font-size: 16px;
  267. color: #FFF;
  268. margin-bottom: 15px;
  269. font-weight: bold;
  270. span{
  271. color: #aa9f9f;
  272. }
  273. .el-link {
  274. float: right;
  275. font-size: 14px;
  276. color: #C1C6C8;
  277. -webkit-text-fill-color: #C1C6C8;
  278. }
  279. span{
  280. font-size: 12px;
  281. font-family: Microsoft YaHei,serif;
  282. font-weight: 400;
  283. color: #7C878E;
  284. }
  285. }
  286. .group-content {
  287. height: 80%;
  288. overflow: hidden;
  289. }
  290. }
  291. .score-group{
  292. overflow: hidden;
  293. &-title{
  294. font-size: 14px;
  295. font-family: Microsoft YaHei,serif;
  296. font-weight: 400;
  297. color: #C1C6C8;
  298. text-align: center;
  299. overflow: hidden;
  300. p{
  301. position: relative;
  302. display: inline-block;
  303. &:before{
  304. position: absolute;
  305. left: -353px;
  306. top: 50%;
  307. content: "";
  308. width: 343px;
  309. height: 2px;
  310. background: linear-gradient(-90deg, #233E4F 0%, #193142 100%);
  311. }
  312. &:after{
  313. position: absolute;
  314. right: -353px;
  315. top: 50%;
  316. content: "";
  317. width: 343px;
  318. height: 2px;
  319. background: linear-gradient(90deg, #233E4F 0%, #193142 100%);
  320. }
  321. }
  322. }
  323. }
  324. .chart-score-group {
  325. margin-bottom: 15px;
  326. }
  327. }
  328. </style>