Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

doctor.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div class="page_workAnalysis">
  8. <el-tabs v-model="activeName" @tab-click="handleClick">
  9. <el-tab-pane label="医生" name="first"></el-tab-pane>
  10. <el-tab-pane label="护士" name="second"></el-tab-pane>
  11. </el-tabs>
  12. <div class="cell clearfix">
  13. <el-select v-model="query.admin_user_id" placeholder="请选择" style="width:120px;margin-right:20px" @change="changeDoctor"
  14. >
  15. <el-option
  16. v-for="item in doctor_options"
  17. :key="item.id"
  18. :label="item.user_name"
  19. :value="item.admin_user_id"
  20. ></el-option>
  21. </el-select>
  22. <el-select
  23. v-model="query.statistics_type"
  24. placeholder="请选择"
  25. @change="changeProject"
  26. style="width:120px;margin-right:20px"
  27. >
  28. <el-option
  29. v-for="item in project_options"
  30. :key="item.value"
  31. :label="item.name"
  32. :value="item.value"
  33. ></el-option>
  34. </el-select>
  35. <label class="title">
  36. <span class="name">日期查询</span> :
  37. </label>
  38. <el-date-picker
  39. v-model="query.start_time"
  40. prefix-icon="el-icon-date"
  41. @change="changeTime"
  42. :editable="false"
  43. style="width: 150px;"
  44. type="date"
  45. :picker-options="pickerOptions"
  46. placeholder="选择日期时间"
  47. align="right"
  48. format="yyyy-MM-dd"
  49. value-format="yyyy-MM-dd"
  50. ></el-date-picker>
  51. <span class>-</span>
  52. <el-date-picker
  53. v-model="query.end_time"
  54. prefix-icon="el-icon-date"
  55. @change="changeEndTime"
  56. :editable="false"
  57. :picker-options="pickerOptions"
  58. style="width: 150px;"
  59. type="date"
  60. placeholder="选择日期时间"
  61. align="right"
  62. format="yyyy-MM-dd"
  63. value-format="yyyy-MM-dd"
  64. ></el-date-picker>
  65. </div>
  66. <div class="tableTitle">统计图</div>
  67. <div>
  68. <line-chart :options="bar"></line-chart>
  69. </div>
  70. <div class="tableTitle">统计表</div>
  71. <div>
  72. <el-table :data="tableData" style="width: 100%" :height="tableHeight">
  73. <el-table-column fixed label="姓名" align="center">
  74. <template slot-scope="scope">
  75. {{scope.row.user_name}}
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="治疗人次" align="center">
  79. <template slot-scope="scope">
  80. {{scope.row.p_count?scope.row.p_count:''}}
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="病程记录" align="center">
  84. <template slot-scope="scope">
  85. {{scope.row.course_count?scope.row.course_count:''}}
  86. <!--{{// scope.row.patient.lapseto == 1 ? '留治':'转出'}}-->
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="抢救记录" align="center">
  90. <template slot-scope="scope">
  91. {{scope.row.rescue_count?scope.row.rescue_count:''}}
  92. <!--{{scope.row.last_after_weight?scope.row.last_after_weight:''}}-->
  93. <!--<div v-if="scope.row.before.systolic_blood_pressure">{{scope.row.before.systolic_blood_pressure}} / {{scope.row.before.diastolic_blood_pressure}}</div>-->
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="合计" align="center">
  97. <template slot-scope="scope">
  98. {{scope.row.p_count + scope.row.course_count + scope.row.rescue_count?scope.row.p_count + scope.row.course_count + scope.row.rescue_count:''}}
  99. <!--<div v-if="scope.row.min_monitor.systolic_blood_pressure">{{ scope.row.min_monitor.systolic_blood_pressure}} /{{ scope.row.min_monitor.diastolic_blood_pressure}}</div>-->
  100. </template>
  101. </el-table-column>
  102. </el-table>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </template>
  108. <script>
  109. import echarts from "echarts";
  110. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  111. import LineChart from "../../qcd/components/LineChart";
  112. import {GetDoctorWorkloadChartData,GetDoctorWorkloadTableData,GetAllAdminUser} from "@/api/common/statistics";
  113. export default {
  114. components: {
  115. BreadCrumb,
  116. LineChart
  117. },
  118. data() {
  119. return {
  120. pickerOptions: {
  121. disabledDate(time) {
  122. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
  123. return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  124. }
  125. },
  126. tableData: [
  127. ],
  128. loading: false,
  129. total: '',
  130. query: {
  131. admin_user_id: "",
  132. statistics_type: 1,
  133. start_time: "",
  134. end_time: "",
  135. limit:20,
  136. page:1,
  137. },
  138. doctor_options:[],
  139. project_options:[
  140. {value:1, name:"治疗"},
  141. {value:2, name:"病程记录"},
  142. {value:3, name:"抢救记录"}
  143. ],
  144. crumbs: [
  145. { path: false, name: "质控管理" },
  146. { path: false, name: "工作量分析统计" },
  147. { path: false, name: "医生" }
  148. ],
  149. activeName: "first",
  150. listQuery: {
  151. start_time: "",
  152. end_time: "",
  153. page: 1,
  154. limit: 10
  155. },
  156. value: "请选项",
  157. bar: {
  158. title: {
  159. text: "ECharts 入门示例"
  160. },
  161. tooltip: {},
  162. legend: {
  163. data: [],
  164. left: 0
  165. },
  166. xAxis: {
  167. data: []
  168. },
  169. yAxis: {
  170. axisLabel: {
  171. formatter: "{value} %"
  172. },
  173. show: false
  174. },
  175. series: [
  176. {
  177. name: "",
  178. type: "bar",
  179. data: [],
  180. barWidth: 30,
  181. label: {
  182. normal: {
  183. show: true,
  184. position: "top",
  185. formatter: "{c}"
  186. }
  187. },
  188. //配置样式
  189. itemStyle: {
  190. //通常情况下:
  191. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  192. normal: {
  193. color: function(params) {
  194. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  195. var colorList = [
  196. ["#A9E0F3", "#9FBDFC"],
  197. ["#FFD7C0", "#FF9994"]
  198. ];
  199. var index = params.dataIndex;
  200. if (params.dataIndex >= colorList.length) {
  201. index = params.dataIndex % colorList.length;
  202. }
  203. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  204. { offset: 0, color: colorList[index][0] },
  205. // { offset: 0.5, color: colorList[index][1] },
  206. { offset: 1, color: colorList[index][1] }
  207. ]);
  208. },
  209. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  210. },
  211. //鼠标悬停时:
  212. emphasis: {
  213. shadowBlur: 10,
  214. shadowOffsetX: 0,
  215. shadowColor: "rgba(0, 0, 0, 0.5)"
  216. }
  217. }
  218. }
  219. ]
  220. }
  221. };
  222. },
  223. methods: {
  224. changeDoctor(val){
  225. this.query.admin_user_id = val
  226. this.query.page = 1
  227. this.GetDoctorWorkloadTableData(this.query)
  228. },
  229. GetAllDoctor(){
  230. GetAllAdminUser().then(response => {
  231. if (response.data.state == 1) {
  232. var adminUser = response.data.data.admin
  233. this.admin_user = adminUser
  234. for (let i = 0; i < adminUser.length; i++){
  235. if(adminUser[i].user_type == 2){
  236. this.doctor_options.push(adminUser[i])
  237. }
  238. }
  239. } else {
  240. this.$message.error('请求数据失败')
  241. return false
  242. }
  243. })
  244. },
  245. changeProject(val){
  246. this.query.statistics_type = val
  247. this.query.page = 1
  248. this.GetDoctorWorkloadChartData(this.query)
  249. // this.GetDialysisProcessIndexTableData(this.query)
  250. },
  251. handleSizeChange(limit) {
  252. this.query.limit = limit;
  253. this.GetDoctorWorkloadTableData(this.query)
  254. },
  255. handleCurrentChange(page) {
  256. this.query.page = page;
  257. this.GetDoctorWorkloadTableData(this.query)
  258. },GetDoctorWorkloadTableData(params) {
  259. this.loading = true
  260. this.tableData = []
  261. GetDoctorWorkloadTableData(params)
  262. .then(rs => {
  263. var resp = rs.data
  264. if (resp.state == 1) {
  265. this.loading = false
  266. for (let i = 0; i < resp.data.data.length; i++) {
  267. this.tableData.push(resp.data.data[i])
  268. }
  269. } else {
  270. this.loading = false
  271. }
  272. })
  273. .catch(error => {
  274. })
  275. },
  276. changeTime(val) {
  277. var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
  278. if (time > 0) {
  279. this.$message.error("结束时间不能小于开始时间");
  280. this.query.start_time = "";
  281. } else {
  282. // this.getDialysisList()
  283. this.query.page = 1;
  284. this.GetDoctorWorkloadChartData(this.query)
  285. this.GetDoctorWorkloadTableData(this.query)
  286. }
  287. }, GetDoctorWorkloadChartData(params) {
  288. this.bar.xAxis.data = []
  289. this.bar.series[0].data = []
  290. GetDoctorWorkloadChartData(params)
  291. .then(rs => {
  292. var resp = rs.data
  293. if (resp.state == 1) {
  294. for (let i = 0; i < resp.data.data.length;i++){
  295. this.bar.xAxis.data.push(resp.data.data[i].user_name)
  296. if(this.query.statistics_type == 1){
  297. this.bar.series[0].data.push(resp.data.data[i].p_count)
  298. }else if(this.query.statistics_type == 2){
  299. this.bar.series[0].data.push(resp.data.data[i].course_count)
  300. }else if(this.query.statistics_type == 3){
  301. this.bar.series[0].data.push(resp.data.data[i].rescue_count)
  302. }
  303. }
  304. } else {
  305. }
  306. })
  307. .catch(error => {
  308. })
  309. },
  310. changeEndTime(val) {
  311. var time =
  312. this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
  313. if (time < 0) {
  314. this.$message.error("结束时间不能小于开始时间");
  315. this.query.end_time = "";
  316. } else {
  317. this.query.page = 1;
  318. this.GetDoctorWorkloadChartData(this.query)
  319. this.GetDoctorWorkloadTableData(this.query)
  320. }
  321. },
  322. handleClick() {
  323. if (this.activeName == "second") {
  324. this.$router.push({ path: "/qcd/workAnalysis/nurse" });
  325. }
  326. }
  327. },created(){
  328. var date = new Date()
  329. var year = date.getFullYear() //获取完整的年份(4位)
  330. var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  331. var day = date.getDate() < 0 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
  332. var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
  333. this.query.patient_id = 0
  334. this.query.end_time = year + '-' + month + '-' + day
  335. this.query.start_time = year + '-' + last_month + '-' + day
  336. this.query.statistics_type = 1
  337. this.GetAllDoctor()
  338. this.GetDoctorWorkloadChartData(this.query)
  339. this.GetDoctorWorkloadTableData(this.query)
  340. }
  341. };
  342. </script>
  343. <style lang="scss" scoped>
  344. .tableTitle {
  345. font-size: 16px;
  346. color: #000;
  347. font-weight: bold;
  348. margin-bottom: 10px;
  349. }
  350. </style>
  351. <style lang="scss">
  352. .page_workAnalysis {
  353. .cell {
  354. text-align: center;
  355. }
  356. }
  357. </style>