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

CheckPersonal.vue 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <div class="page_checkPersonal">
  3. <div class="cell clearfix">
  4. <el-form :inline="true" :model="listQuery">
  5. <el-form-item label>
  6. <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
  7. <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
  8. </el-form-item>
  9. </el-form>
  10. <label class="title">
  11. <span class="name">日期查询</span> :
  12. </label>
  13. <el-date-picker
  14. v-model="listQuery.start_time"
  15. prefix-icon="el-icon-date"
  16. @change="changeTime"
  17. :editable="false"
  18. style="width: 196px;"
  19. type="date"
  20. placeholder="选择日期时间"
  21. align="right"
  22. format="yyyy-MM-dd"
  23. value-format="yyyy-MM-dd"
  24. :picker-options="pickerOptions"
  25. ></el-date-picker>
  26. <span class>-</span>
  27. <el-date-picker
  28. v-model="listQuery.end_time"
  29. prefix-icon="el-icon-date"
  30. @change="changeEndTime"
  31. :editable="false"
  32. style="width: 196px;"
  33. type="date"
  34. placeholder="选择日期时间"
  35. align="right"
  36. format="yyyy-MM-dd"
  37. value-format="yyyy-MM-dd"
  38. :picker-options="pickerOptions"
  39. ></el-date-picker>
  40. </div>
  41. <el-container>
  42. <div style="width:150px">
  43. <div class="tableTitle">患者列表</div>
  44. <el-table :data="patientsData" border style="width: 100%;"
  45. height="500" :row-style="{ color: '#303133' }"
  46. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  47. highlight-current-row
  48. @current-change="handleChange"
  49. >
  50. <el-table-column prop="dialysis_no" label="透析号" width="80">
  51. <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
  52. </el-table-column>
  53. <el-table-column prop="name" label="姓名" width="80">
  54. <template slot-scope="scope">{{ scope.row.name }}</template>
  55. </el-table-column>
  56. </el-table>
  57. </div>
  58. <div style="padding-left:10px;flex:1">
  59. <div class="tableTitle">统计图</div>
  60. <div>
  61. <line-chart :options="chart"></line-chart>
  62. </div>
  63. </div>
  64. </el-container>
  65. </div>
  66. </template>
  67. <script>
  68. import echarts from "echarts";
  69. import LineChart from "../../components/LineChart";
  70. import { getCurrentOrgPatients,getInspectionTotalCount,getInspectionDetailById,getSearchPatientInfo } from "@/api/common/common";
  71. export default {
  72. components: {
  73. LineChart
  74. },
  75. data() {
  76. return {
  77. listQuery: {
  78. start_time: "",
  79. end_time: "",
  80. page: 1,
  81. limit: 10
  82. },
  83. value: "请选项",
  84. patientsData:[],
  85. tableData:[],
  86. chart: {
  87. tooltip: {},
  88. // legend: {
  89. // data: ["次数"],
  90. // left: 0
  91. // },
  92. xAxis: {
  93. data: []
  94. },
  95. yAxis: {
  96. axisLabel: {
  97. formatter: "{value} %"
  98. },
  99. show: false
  100. },
  101. series: [
  102. {
  103. name: "次数",
  104. type: "bar",
  105. data: [],
  106. barWidth: 30,
  107. label: {
  108. normal: {
  109. show: true,
  110. position: "top",
  111. formatter: "{c}次"
  112. }
  113. },
  114. //配置样式
  115. itemStyle: {
  116. //通常情况下:
  117. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  118. normal: {
  119. color: function(params) {
  120. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  121. var colorList = [
  122. ["#A9E0F3", "#9FBDFC"],
  123. ["#A9E0F3", "#9FBDFC"],
  124. ["#A9E0F3", "#9FBDFC"],
  125. ["#FFD7C0", "#FF9994"],
  126. ["#FFD7C0", "#FF9994"],
  127. ["#FFD7C0", "#FF9994"],
  128. ["#D7C3FD", "#B3A8F7"],
  129. ["#D7C3FD", "#B3A8F7"],
  130. ["#D7C3FD", "#B3A8F7"]
  131. ];
  132. var index = params.dataIndex;
  133. if (params.dataIndex >= colorList.length) {
  134. index = params.dataIndex % colorList.length;
  135. }
  136. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  137. { offset: 0, color: colorList[index][0] },
  138. // { offset: 0.5, color: colorList[index][1] },
  139. { offset: 1, color: colorList[index][1] }
  140. ]);
  141. },
  142. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  143. },
  144. //鼠标悬停时:
  145. emphasis: {
  146. shadowBlur: 10,
  147. shadowOffsetX: 0,
  148. shadowColor: "rgba(0, 0, 0, 0.5)"
  149. }
  150. }
  151. }
  152. ]
  153. },
  154. pickerOptions: {
  155. disabledDate(time) {
  156. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
  157. return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  158. }
  159. },
  160. modesData: {
  161. xAxis: [],
  162. series: []
  163. },
  164. };
  165. },
  166. methods: {
  167. changeTime() {},
  168. changeEndTime(val) {
  169. var time =
  170. this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
  171. if (time < 0) {
  172. this.$message.error("结束时间不能小于开始时间");
  173. this.listQuery.end_time = "";
  174. } else {
  175. }
  176. },
  177. getCurrentOrgPatients(){
  178. getCurrentOrgPatients().then(response=>{
  179. var patients = response.data.data.patients
  180. this.patientsData = patients
  181. })
  182. },
  183. getInspectionTotalCount(){
  184. getInspectionTotalCount(this.listQuery.start_time,this.listQuery.end_time).then(response=>{
  185. if(response.data.state === 1){
  186. var Inspection = response.data.data.Inspection
  187. this.tableData = Inspection
  188. console.log("Inspection",Inspection)
  189. var counts = response.data.data.counts
  190. console.log("counts",counts)
  191. var arr = []
  192. for(let i=0;i<Inspection.length;i++){
  193. for(let j=0;j<counts.length;j++){
  194. if(Inspection[i].inspection_major == counts[j].ProjectId){
  195. arr.push(counts[j])
  196. }
  197. }
  198. }
  199. console.log("arr",arr)
  200. var hash = {};
  201. var i = 0;
  202. var res = [];
  203. arr.forEach(function(item) {
  204. var ProjectName = item.ProjectName;
  205. hash[ProjectName] ? res[hash[ProjectName] - 1].Count.push(item.Count) : hash[ProjectName] = ++i && res.push({
  206. Count: [item.Count],
  207. ProjectName: ProjectName,
  208. ProjectId: item.ProjectId,
  209. })
  210. });
  211. res.map(item => {
  212. item.Count = eval(item.Count.join('+'))
  213. })
  214. console.log(11111,res)
  215. for (const key in this.tableData) {
  216. this.modesData.xAxis.push(this.tableData[key].project_name);
  217. if (key in res) {
  218. this.modesData.series.push(parseInt(res[key].Count));
  219. // batotal += parseInt(res[key].Count);
  220. } else {
  221. this.modesData.series.push(0);
  222. }
  223. }
  224. this.chart.series[0].data = this.modesData.series
  225. this.chart.xAxis.data = this.modesData.xAxis
  226. console.log(2222,this.modesData)
  227. }
  228. })
  229. },
  230. //获取单个病人数据
  231. handleChange(val){
  232. getInspectionDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
  233. if(response.data.state === 1){
  234. var patientdetail = response.data.data.patientdetail
  235. console.log("patientdetail",patientdetail)
  236. var arr=[]
  237. for(let i=0;i<this.tableData.length;i++){
  238. for(let j=0;j<patientdetail.length;j++){
  239. if(this.tableData[i].inspection_major == patientdetail[j].ProjectId){
  240. arr.push(patientdetail[j])
  241. }
  242. }
  243. }
  244. console.log("arr",arr)
  245. }
  246. })
  247. },
  248. //搜索功能
  249. onSearch(){
  250. getSearchPatientInfo(this.listQuery.search,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
  251. if(response.data.state === 1){
  252. var PatientsInfo = response.data.data.PatientsInfo
  253. console.log("PatientsInfo",PatientsInfo)
  254. var arr = []
  255. for(let i=0;i<this.tableData.length;i++){
  256. for(let j=0;j<PatientsInfo.length;j++){
  257. if(this.tableData[i].inspection_major == PatientsInfo[j].ProjectId){
  258. arr.push(PatientsInfo[j])
  259. }
  260. }
  261. }
  262. console.log("arr",arr)
  263. }
  264. })
  265. }
  266. },
  267. created(){
  268. var nowDate = new Date();
  269. var nowYear = nowDate.getFullYear();
  270. var nowMonth = nowDate.getMonth() + 1;
  271. var nowDay = nowDate.getDate();
  272. this.listQuery.end_time =
  273. nowYear +
  274. "-" +
  275. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  276. "-" +
  277. (nowDay < 10 ? "0" + nowDay : nowDay);
  278. nowDate.setMonth(nowDate.getMonth() - 3);
  279. nowYear = nowDate.getFullYear();
  280. nowMonth = nowDate.getMonth() + 1;
  281. nowDay = nowDate.getDate();
  282. this.listQuery.start_time =
  283. nowYear +
  284. "-" +
  285. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  286. "-" +
  287. (nowDay < 10 ? "0" + nowDay : nowDay);
  288. //获取该机构下的所有患者
  289. this.getCurrentOrgPatients()
  290. //获取检验检查项目
  291. this.getInspectionTotalCount()
  292. }
  293. };
  294. </script>
  295. <style lang="scss" scoped>
  296. .tableTitle {
  297. font-size: 16px;
  298. color: #000;
  299. font-weight: bold;
  300. margin-bottom: 10px;
  301. }
  302. </style>
  303. <style lang="scss">
  304. .page_checkPersonal {
  305. .cell {
  306. text-align: center;
  307. }
  308. }
  309. </style>