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

nurse.vue 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. <template>
  2. <div>
  3. <div class="cell clearfix">
  4. <el-select v-model="query.admin_user_id" placeholder="请选择" style="width:120px;margin-right:10px" @change="changeNurse"
  5. >
  6. <el-option
  7. v-for="item in nurse_options"
  8. :key="item.id"
  9. :label="item.user_name"
  10. :value="item.admin_user_id"
  11. ></el-option>
  12. </el-select>
  13. <el-select
  14. v-model="query.statistics_type"
  15. placeholder="请选择"
  16. @change="changeProject"
  17. style="width:120px;margin-right:10px"
  18. >
  19. <el-option
  20. v-for="item in project_options"
  21. :key="item.value"
  22. :label="item.name"
  23. :value="item.value"
  24. ></el-option>
  25. </el-select>
  26. <label class="title">
  27. <span class="name">月份查询</span> :
  28. </label>
  29. <el-date-picker
  30. @change='changeMonth'
  31. v-model="monthValue"
  32. type="month"
  33. placeholder="选择月">
  34. </el-date-picker>
  35. <label class="title">
  36. <span class="name">日期查询</span> :
  37. </label>
  38. <el-date-picker
  39. v-model="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="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. <!--&lt;!&ndash;{{// scope.row.patient.lapseto == 1 ? '留治':'转出'}}&ndash;&gt;-->
  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. <!--&lt;!&ndash;{{scope.row.last_after_weight?scope.row.last_after_weight:''}}&ndash;&gt;-->
  93. <!--&lt;!&ndash;<div v-if="scope.row.before.systolic_blood_pressure">{{scope.row.before.systolic_blood_pressure}} / {{scope.row.before.diastolic_blood_pressure}}</div>&ndash;&gt;-->
  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. <!--&lt;!&ndash;<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>&ndash;&gt;-->
  100. <!--</template>-->
  101. <!--</el-table-column>-->
  102. <!--</el-table>-->
  103. <el-table :data="tableData" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
  104. <el-table-column fixed label="姓名" align="center">
  105. <template slot-scope="scope">
  106. {{scope.row.user_name}}
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="穿刺" align="center">
  110. <template slot-scope="scope">
  111. {{scope.row.puncture_count?scope.row.puncture_count:''}}
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="治疗" align="center">
  115. <template slot-scope="scope">
  116. {{scope.row.cure_count?scope.row.cure_count:''}}
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="换药" align="center">
  120. <template slot-scope="scope">
  121. {{scope.row.change_nuser_count?scope.row.change_nuser_count:''}}
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="疑难穿刺" align="center">
  125. <template slot-scope="scope">
  126. {{scope.row.difficult_nuser_count?scope.row.difficult_nuser_count:''}}
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="上机" align="center" width="300">
  130. <template slot-scope="scope">
  131. {{scope.row.start_nuser_count?scope.row.start_nuser_count:''}}
  132. <span v-if="getTotalCount(scope.row.admin_user_id)!=''">({{getTotalCount(scope.row.admin_user_id)}})</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="下机" align="center">
  136. <template slot-scope="scope">
  137. {{scope.row.finish_nuser_count?scope.row.finish_nuser_count:''}}
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="冲管" align="center">
  141. <template slot-scope="scope">
  142. {{scope.row.washpipe_nuser_count?scope.row.washpipe_nuser_count:''}}
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="宣教/小结" align="center">
  146. <template slot-scope="scope">
  147. {{scope.row.mission_count?scope.row.mission_count:''}}
  148. </template>
  149. </el-table-column>
  150. <!-- change_nurse_count:total_change_nurse,
  151. diffcult_nurse_count:total_diffcult_nurse,
  152. new_fistula_nurse_count:total_new_fistula_nurse,
  153. start_nurse_count:total_start_nurse, -->
  154. <el-table-column label="合计" align="center">
  155. <template slot-scope="scope">
  156. {{scope.row.finish_nuser_count + scope.row.washpipe_nuser_count + scope.row.puncture_count + scope.row.cure_count + scope.row.mission_count + scope.row.change_nuser_count+scope.row.difficult_nuser_count+scope.row.new_nuser_count +scope.row.start_nuser_count ?scope.row.puncture_count + scope.row.cure_count + scope.row.mission_count+scope.row.change_nuser_count+scope.row.difficult_nuser_count+scope.row.new_nuser_count+scope.row.start_nuser_count:''}}
  157. </template>
  158. </el-table-column>
  159. </el-table>
  160. </div>
  161. </div>
  162. </template>
  163. <script>
  164. const moment = require('moment')
  165. import echarts from "echarts";
  166. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  167. import LineChart from "../../qcd/components/LineChart";
  168. import {GetNurseWorkloadChartData,GetNurseWorkloadTableData,GetAllAdminUser} from "@/api/common/statistics";
  169. export default {
  170. components: {
  171. BreadCrumb,
  172. LineChart
  173. },
  174. data() {
  175. return {
  176. percent:[],
  177. pickerOptions: {
  178. disabledDate(time) {
  179. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
  180. return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  181. }
  182. },
  183. tableData: [
  184. ],
  185. loading: false,
  186. total: '',
  187. query: {
  188. admin_user_id: 0,
  189. statistics_type: 1,
  190. start_time: "",
  191. end_time: "",
  192. limit:20,
  193. page:1,
  194. },
  195. start_time:'',
  196. end_time:'',
  197. monthValue:'',
  198. nurse_options:[
  199. {id:0,user_name:"全部",admin_user_id:0}
  200. ],
  201. project_options:[
  202. {value:1, name:"治疗"},
  203. {value:2, name:"穿刺"},
  204. {value:3, name:"宣教/小结"},
  205. {value:4, name:"换药"},
  206. {value:5, name:"疑难穿刺"},
  207. {value:6, name:"开瘘"},
  208. {value:7, name:"上机"},
  209. {value:8, name:"下机"},
  210. {value:9, name:"冲管"},
  211. ],
  212. crumbs: [
  213. { path: false, name: "质控管理" },
  214. { path: false, name: "工作量分析统计" },
  215. { path: false, name: "护士" }
  216. ],
  217. activeName: "second",
  218. listQuery: {
  219. start_time: "",
  220. end_time: "",
  221. page: 1,
  222. limit: 10
  223. },
  224. value: "请选项",
  225. bar: {
  226. title: {
  227. text: "ECharts 入门示例"
  228. },
  229. tooltip: {},
  230. legend: {
  231. data: [],
  232. left: 0
  233. },
  234. xAxis: {
  235. data: []
  236. },
  237. yAxis: {
  238. axisLabel: {
  239. formatter: "{value} %"
  240. },
  241. show: false
  242. },
  243. series: [
  244. {
  245. name: "",
  246. type: "bar",
  247. data: [],
  248. barWidth: 30,
  249. label: {
  250. normal: {
  251. show: true,
  252. position: "top",
  253. formatter: (params) => {
  254. if(this.percent.length > 0){
  255. let str = ''
  256. str = params.data + '('+ this.percent[params.dataIndex] +'%)'
  257. return str
  258. }else{
  259. let str = ''
  260. str = params.data
  261. return str
  262. }
  263. }
  264. }
  265. },
  266. //配置样式
  267. itemStyle: {
  268. //通常情况下:
  269. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  270. normal: {
  271. color: function(params) {
  272. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  273. var colorList = [
  274. ["#A9E0F3", "#9FBDFC"],
  275. ["#FFD7C0", "#FF9994"]
  276. ];
  277. var index = params.dataIndex;
  278. if (params.dataIndex >= colorList.length) {
  279. index = params.dataIndex % colorList.length;
  280. }
  281. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  282. { offset: 0, color: colorList[index][0] },
  283. // { offset: 0.5, color: colorList[index][1] },
  284. { offset: 1, color: colorList[index][1] }
  285. ]);
  286. },
  287. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  288. },
  289. //鼠标悬停时:
  290. emphasis: {
  291. shadowBlur: 10,
  292. shadowOffsetX: 0,
  293. shadowColor: "rgba(0, 0, 0, 0.2)"
  294. }
  295. }
  296. }
  297. ],
  298. dataZoom: [
  299. {
  300. // Y轴固定,让内容滚动
  301. type: 'slider',
  302. show: false,
  303. xAxisIndex: [0],
  304. start: 1,
  305. end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
  306. zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
  307. },
  308. {
  309. type: 'inside',
  310. xAxisIndex: [0],
  311. start: 1,
  312. end: 20,
  313. zoomLock: true // 锁定区域禁止缩放
  314. }
  315. ]
  316. },
  317. modeList:[],
  318. };
  319. },
  320. methods: {
  321. changeNurse(val){
  322. this.query.admin_user_id = val
  323. this.query.page = 1
  324. this.GetNurseWorkloadChartData(this.query)
  325. this.GetNurseWorkloadTableData(this.query)
  326. },
  327. GetAllNurse(){
  328. GetAllAdminUser().then(response => {
  329. if (response.data.state == 1) {
  330. var adminUser = response.data.data.admin
  331. this.admin_user = adminUser
  332. for (let i = 0; i < adminUser.length; i++){
  333. if(adminUser[i].user_type == 3){
  334. this.nurse_options.push(adminUser[i])
  335. }
  336. }
  337. } else {
  338. this.$message.error('请求数据失败')
  339. return false
  340. }
  341. })
  342. },
  343. changeProject(val){
  344. this.query.statistics_type = val
  345. this.query.page = 1
  346. this.GetNurseWorkloadChartData(this.query)
  347. // this.GetDialysisProcessIndexTableData(this.query)
  348. },
  349. handleSizeChange(limit) {
  350. this.query.limit = limit;
  351. this.GetNurseWorkloadTableData(this.query)
  352. },
  353. handleCurrentChange(page) {
  354. this.query.page = page;
  355. this.GetNurseWorkloadTableData(this.query)
  356. },
  357. GetNurseWorkloadTableData(params) {
  358. this.loading = true
  359. this.tableData = []
  360. this.modeList = []
  361. // console.log("params",params)
  362. GetNurseWorkloadTableData(params)
  363. .then(rs => {
  364. var resp = rs.data
  365. console.log("列表2323323232323233232332323223233223233223",resp)
  366. if (resp.state == 1) {
  367. let total_cure = 0
  368. let total_puncture = 0
  369. let total_mission = 0
  370. let total_change_nurse = 0
  371. let total_diffcult_nurse = 0
  372. let total_new_fistula_nurse = 0
  373. let total_start_nurse = 0
  374. let total_finish_nurse = 0
  375. let total_washpipe_nurse = 0
  376. this.loading = false
  377. for (let i = 0; i < resp.data.data.length; i++) {
  378. total_cure = total_cure + resp.data.data[i].cure_count
  379. total_puncture = total_puncture + resp.data.data[i].puncture_count
  380. total_mission = total_mission + resp.data.data[i].mission_count
  381. total_change_nurse = total_change_nurse + resp.data.data[i].change_nuser_count
  382. total_diffcult_nurse = total_diffcult_nurse + resp.data.data[i].difficult_nuser_count
  383. total_new_fistula_nurse = total_new_fistula_nurse + resp.data.data[i].new_nuser_count
  384. total_start_nurse = total_start_nurse + resp.data.data[i].start_nuser_count
  385. total_finish_nurse = total_finish_nurse + resp.data.data[i].finish_nuser_count
  386. total_washpipe_nurse = total_washpipe_nurse + resp.data.data[i].washpipe_nuser_count
  387. this.tableData.push(resp.data.data[i])
  388. }
  389. this.tableData.push( {
  390. user_name:"合计",
  391. cure_count:total_cure,
  392. puncture_count:total_puncture,
  393. mission_count:total_mission,
  394. change_nuser_count:total_change_nurse,
  395. difficult_nuser_count:total_diffcult_nurse,
  396. new_nuser_count:total_new_fistula_nurse,
  397. start_nuser_count:total_start_nurse,
  398. finish_nuser_count:total_finish_nurse,
  399. washpipe_nuser_count:total_washpipe_nurse,
  400. })
  401. console.log("hhhhhhh23232233223",this.tableData)
  402. var dialysisCount = resp.data.dialysisCount
  403. console.log("dialysisCount",dialysisCount)
  404. for(let i=0;i<dialysisCount.length;i++){
  405. if(dialysisCount[i].mode_id == 1){
  406. dialysisCount[i].mode_id = "HD"
  407. }
  408. if(dialysisCount[i].mode_id == 2){
  409. dialysisCount[i].mode_id = "HDF"
  410. }
  411. if(dialysisCount[i].mode_id == 3){
  412. dialysisCount[i].mode_id = "HD+HP"
  413. }
  414. if(dialysisCount[i].mode_id == 4){
  415. dialysisCount[i].mode_id = "HP"
  416. }
  417. if(dialysisCount[i].mode_id == 5){
  418. dialysisCount[i].mode_id = "HF"
  419. }
  420. if(dialysisCount[i].mode_id == 6){
  421. dialysisCount[i].mode_id = "SCUF"
  422. }
  423. if(dialysisCount[i].mode_id == 7){
  424. dialysisCount[i].mode_id = "IUF"
  425. }
  426. if(dialysisCount[i].mode_id == 8){
  427. dialysisCount[i].mode_id = "HFHD"
  428. }
  429. if(dialysisCount[i].mode_id == 9){
  430. dialysisCount[i].mode_id = "HFHD+HP"
  431. }
  432. if(dialysisCount[i].mode_id == 10){
  433. dialysisCount[i].mode_id = "PHF"
  434. }
  435. if(dialysisCount[i].mode_id == 11){
  436. dialysisCount[i].mode_id = "HFR"
  437. }
  438. if(dialysisCount[i].mode_id == 12){
  439. dialysisCount[i].mode_id = "HDF+HP"
  440. }
  441. if(dialysisCount[i].mode_id == 13){
  442. dialysisCount[i].mode_id = "CRRT"
  443. }
  444. if(dialysisCount[i].mode_id == 14){
  445. dialysisCount[i].mode_id = "腹水回输"
  446. }
  447. }
  448. let dataInfo = {}
  449. dialysisCount.forEach((item, index) => {
  450. let { start_nurse } = item
  451. if (!dataInfo[start_nurse]) {
  452. dataInfo[start_nurse] = {
  453. child: [],
  454. start_nurse: item.start_nurse,
  455. }
  456. }
  457. })
  458. let list = Object.values(dataInfo)
  459. console.log("list222222",list)
  460. list.map(item=>{
  461. for(let i=0;i<dialysisCount.length;i++){
  462. if(item.start_nurse == dialysisCount[i].start_nurse){
  463. item.child.push(dialysisCount[i])
  464. }
  465. }
  466. })
  467. console.log("listq23333",list)
  468. this.modeList.push(...list)
  469. } else {
  470. this.loading = false
  471. }
  472. })
  473. .catch(error => {
  474. })
  475. },
  476. getTimestamp(time) {
  477. // 把时间日期转成时间戳
  478. return new Date(time).getTime() / 1000;
  479. },
  480. changeTime(val) {
  481. this.query.end_time = ''
  482. var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
  483. if (time > 0) {
  484. this.$message.error("结束时间不能小于开始时间");
  485. this.query.start_time = "";
  486. } else {
  487. // this.getDialysisList()
  488. console.log(val)
  489. this.query.page = 1;
  490. this.query.start_time = val
  491. this.query.end_time = this.end_time
  492. this.monthValue = ''
  493. sessionStorage.setItem("nurse_start_time", val)
  494. sessionStorage.removeItem("nurseMonth");
  495. this.GetNurseWorkloadChartData(this.query)
  496. this.GetNurseWorkloadTableData(this.query)
  497. }
  498. },
  499. GetNurseWorkloadChartData(params) {
  500. this.bar.xAxis.data = []
  501. this.bar.series[0].data = []
  502. this.percent = []
  503. console.log("parasm",params)
  504. GetNurseWorkloadChartData(params)
  505. .then(rs => {
  506. var resp = rs.data
  507. console.log("图标数据",resp)
  508. if (resp.state == 1) {
  509. for (let i = 0; i < resp.data.data.length;i++){
  510. this.bar.xAxis.data.push(resp.data.data[i].user_name)
  511. if(this.query.statistics_type == 2){
  512. this.bar.series[0].data.push(resp.data.data[i].puncture_count)
  513. this.percent.push(resp.data.data[i].puncture_ratio)
  514. }else if(this.query.statistics_type == 1){
  515. this.bar.series[0].data.push(resp.data.data[i].cure_count)
  516. this.percent.push(resp.data.data[i].cure_ratio)
  517. }else if(this.query.statistics_type == 3){
  518. this.bar.series[0].data.push(resp.data.data[i].mission_count)
  519. this.percent.push(resp.data.data[i].mission_ratio)
  520. }else if(this.query.statistics_type == 4){
  521. this.bar.series[0].data.push(resp.data.data[i].change_nuser_count)
  522. this.percent.push(resp.data.data[i].change_nurse_ratio)
  523. }else if(this.query.statistics_type == 5){
  524. this.bar.series[0].data.push(resp.data.data[i].difficult_nuser_count)
  525. this.percent.push(resp.data.data[i].difficult_nurse_ratio)
  526. }else if(this.query.statistics_type == 6){
  527. this.bar.series[0].data.push(resp.data.data[i].new_nuser_count)
  528. this.percent.push(resp.data.data[i].new_nurse_ratio)
  529. }else if(this.query.statistics_type == 7){
  530. this.bar.series[0].data.push(resp.data.data[i].start_nuser_count)
  531. this.percent.push(resp.data.data[i].start_nurse_ratio)
  532. }else if(this.query.statistics_type == 8){
  533. this.bar.series[0].data.push(resp.data.data[i].finish_nuser_count)
  534. this.percent.push(resp.data.data[i].finish_nurse_ratio)
  535. }else if(this.query.statistics_type == 9){
  536. this.bar.series[0].data.push(resp.data.data[i].washpipe_nuser_count)
  537. this.percent.push(resp.data.data[i].washpipe_nurse_ratio)
  538. }
  539. }
  540. this.getArrLength(this.bar.xAxis.data)
  541. } else {
  542. }
  543. })
  544. .catch(error => {
  545. })
  546. },
  547. changeEndTime(val) {
  548. var time =
  549. this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
  550. if (time < 0) {
  551. this.$message.error("结束时间不能小于开始时间");
  552. this.query.end_time = "";
  553. } else {
  554. this.query.start_time = this.start_time
  555. this.query.end_time = val
  556. this.monthValue = ''
  557. this.query.page = 1;
  558. sessionStorage.setItem("nurse_end_time", val)
  559. sessionStorage.removeItem("nurseMonth");
  560. this.GetNurseWorkloadChartData(this.query)
  561. this.GetNurseWorkloadTableData(this.query)
  562. }
  563. },
  564. handleClick() {
  565. if (this.activeName == "first") {
  566. this.$router.push({ path: "/qcd/workAnalysis/doctor" });
  567. }
  568. },
  569. getArrLength(result){
  570. if(result.length > 10){
  571. var dataZoom_end = (10/result.length)*100;
  572. this.bar.dataZoom[0].end = dataZoom_end
  573. }else{
  574. var dataZoom_end = 100;
  575. this.bar.dataZoom[0].end = dataZoom_end
  576. }
  577. },
  578. changeMonth(value){
  579. // console.log('monthStartTime',value.getTime() / 1000)
  580. sessionStorage.removeItem("nurse_start_time");
  581. sessionStorage.removeItem("nurse_end_time");
  582. let monthStartTime = value.getTime() / 1000
  583. var nowDate = new Date(value);
  584. var cloneNowDate = new Date(value);
  585. var fullYear = nowDate.getFullYear();
  586. var month = nowDate.getMonth() + 1; // getMonth 方法返回 0-11,代表1-12月
  587. var endOfMonth = new Date(fullYear, month, 0).getDate(); // 获取本月最后一天
  588. let monthEndTime = this.getFullDate(cloneNowDate.setDate(endOfMonth))
  589. this.query.start_time = moment(new Date(monthStartTime * 1000)).format('YYYY-MM-DD')
  590. this.query.end_time = moment(new Date(monthEndTime)).format('YYYY-MM-DD')
  591. this.end_time = ''
  592. this.start_time = ''
  593. sessionStorage.setItem("nurseMonth", monthStartTime);
  594. this.GetNurseWorkloadChartData(this.query)
  595. this.GetNurseWorkloadTableData(this.query)
  596. },
  597. getFullDate(targetDate) {
  598. var D, y, m, d;
  599. if (targetDate) {
  600. D = new Date(targetDate);
  601. y = D.getFullYear();
  602. m = D.getMonth() + 1;
  603. d = D.getDate();
  604. } else {
  605. y = fullYear;
  606. m = month;
  607. d = date;
  608. }
  609. m = m > 9 ? m : '0' + m;
  610. d = d > 9 ? d : '0' + d;
  611. return y + '-' + m + '-' + d;
  612. },
  613. getTotalCount(adminuserid){
  614. console.log("adminuserid",adminuserid)
  615. console.log("333333",this.modeList)
  616. var name = ""
  617. for(let i=0;i<this.modeList.length;i++){
  618. for(let j=0;j<this.modeList[i].child.length;j++){
  619. if(adminuserid == this.modeList[i].child[j].start_nurse){
  620. name += (this.modeList[i].child[j].mode_id+"-"+this.modeList[i].child[j].Count) + "次"+"、"
  621. }
  622. }
  623. }
  624. console.log("name22222",name)
  625. return name.substr(0,name.length-1)
  626. }
  627. },
  628. created(){
  629. var date = new Date()
  630. var year = date.getFullYear() //获取完整的年份(4位)
  631. var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  632. var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
  633. var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
  634. this.query.patient_id = 0
  635. this.query.end_time = year + '-' + month + '-' + day
  636. this.query.start_time = year + '-' + last_month + '-' + day
  637. this.query.statistics_type = 1
  638. this.start_time = year + '-' + last_month + '-' + day
  639. this.end_time = year + '-' + month + '-' + day
  640. if(sessionStorage.getItem("nurse_start_time") == null){
  641. sessionStorage.setItem("nurse_start_time", this.start_time);
  642. }else{
  643. this.start_time = sessionStorage.getItem("nurse_start_time")
  644. this.query.start_time = sessionStorage.getItem("nurse_start_time")
  645. }
  646. if(sessionStorage.getItem("nurse_end_time") == null){
  647. sessionStorage.setItem("nurse_end_time", this.end_time);
  648. }else{
  649. this.end_time = sessionStorage.getItem("nurse_end_time")
  650. this.query.end_time = sessionStorage.getItem("nurse_end_time")
  651. }
  652. if(sessionStorage.getItem("nurseMonth") != null){
  653. console.log("tjos")
  654. let value = parseInt(sessionStorage.getItem("nurseMonth")) * 1000
  655. let monthStartTime = new Date(value)
  656. this.monthValue = monthStartTime
  657. var nowDate = new Date(value);
  658. var cloneNowDate = new Date(value);
  659. var fullYear = nowDate.getFullYear();
  660. var month = nowDate.getMonth() + 1; // getMonth 方法返回 0-11,代表1-12月
  661. var endOfMonth = new Date(fullYear, month, 0).getDate(); // 获取本月最后一天
  662. let monthEndTime = this.getFullDate(cloneNowDate.setDate(endOfMonth))
  663. this.query.start_time = moment(new Date(monthStartTime)).format('YYYY-MM-DD')
  664. this.query.end_time = moment(new Date(monthEndTime)).format('YYYY-MM-DD')
  665. this.start_time = ''
  666. this.end_time = ''
  667. }
  668. // console.log('this.query2',this.query)
  669. this.GetAllNurse()
  670. this.GetNurseWorkloadChartData(this.query)
  671. this.GetNurseWorkloadTableData(this.query)
  672. }
  673. };
  674. </script>
  675. <style lang="scss" scoped>
  676. .tableTitle {
  677. font-size: 16px;
  678. color: #000;
  679. font-weight: bold;
  680. margin-bottom: 10px;
  681. }
  682. </style>