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

patientControlAnalysis.vue 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  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_patientControlAnalysis">
  8. <div class="cell clearfix">
  9. <el-form :inline="true" :model="listQuery">
  10. <el-form-item label>
  11. <el-autocomplete
  12. class="checkSearch"
  13. popper-class="my-autocomplete"
  14. v-model.trim="listQuery.search"
  15. :fetch-suggestions="querySearchAsync"
  16. :trigger-on-focus="false"
  17. placeholder="病人透析号/姓名"
  18. @select="handleSelect"
  19. >
  20. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  21. <template slot-scope="{ item }">
  22. <div class="name">{{ item.name }}</div>
  23. </template>
  24. </el-autocomplete>
  25. </el-form-item>
  26. </el-form>
  27. <!-- <el-select v-model="lapstor" placeholder="请选择" style="margin-right:20px;width:100px">
  28. <el-option
  29. v-for="item in options"
  30. :key="item.value"
  31. :label="item.label"
  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="listQuery.start_time"
  40. prefix-icon="el-icon-date"
  41. @change="changeTime"
  42. :editable="false"
  43. style="width: 196px;"
  44. type="date"
  45. placeholder="选择日期时间"
  46. align="right"
  47. format="yyyy-MM-dd"
  48. value-format="yyyy-MM-dd"
  49. :picker-options="pickerOptions"
  50. ></el-date-picker>
  51. <span class>-</span>
  52. <el-date-picker
  53. v-model="listQuery.end_time"
  54. prefix-icon="el-icon-date"
  55. @change="changeEndTime"
  56. :editable="false"
  57. style="width: 196px;"
  58. type="date"
  59. placeholder="选择日期时间"
  60. align="right"
  61. format="yyyy-MM-dd"
  62. value-format="yyyy-MM-dd"
  63. :picker-options="pickerOptions"
  64. ></el-date-picker>
  65. </div>
  66. <div class="cell clearfix">
  67. <p class="chartTitle">统计图</p>
  68. </div>
  69. <div class="cell clearfix">
  70. <p class="point"></p>
  71. <p class="pointTitle">指标正常范围值</p>
  72. </div>
  73. <div>
  74. <line-chart :options="chart"></line-chart>
  75. </div>
  76. <div class="cell clearfix">
  77. <p class="chartTitle">统计表</p>
  78. </div>
  79. <div>
  80. <el-table :data="tableData" border style="width: 100%" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
  81. <el-table-column fixed prop="name" label="姓名" width="100"></el-table-column>
  82. <el-table-column label="透析号" width="80">
  83. <template slot-scope="scope">
  84. {{scope.row.dialysis_no}}
  85. </template>
  86. </el-table-column>
  87. <el-table-column
  88. :label="modeItem.item_name"
  89. property="number"
  90. align="center"
  91. min-width="120"
  92. v-for="(modeItem, index) in normData"
  93. :key="index"
  94. >
  95. <template slot-scope="scope">
  96. <span v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value == ''">0</span>
  97. <span v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) < parseInt(scope.row.data[modeItem.item_name].range_min))">
  98. <span >{{scope.row.data[modeItem.item_name].inspect_value}}</span><span style="color:#5B98FF;margin-left:5px;">↓</span>
  99. </span>
  100. <span v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) > parseInt(scope.row.data[modeItem.item_name].range_max))">
  101. <span>{{scope.row.data[modeItem.item_name].inspect_value}}</span><span style="color:#F56C6C;margin-left:5px;">↑</span>
  102. </span>
  103. <span v-if="scope.row.data[modeItem.item_name].range_type == 1 && scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) >= parseInt(scope.row.data[modeItem.item_name].range_min))&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) <= parseInt(scope.row.data[modeItem.item_name].range_max)) ">{{scope.row.data[modeItem.item_name].inspect_value}}</span>
  104. <span v-if="scope.row.data[modeItem.item_name].range_type == 2 && scope.row.data[modeItem.item_name].inspect_value !=''">
  105. <span v-if="scope.row.data[modeItem.item_name].range_value == scope.row.data[modeItem.item_name].inspect_value">
  106. <span style="color:#5B98FF;margin-left:5px;" >{{scope.row.data[modeItem.item_name].inspect_value}}</span>
  107. </span>
  108. <span v-if="scope.row.data[modeItem.item_name].range_value != scope.row.data[modeItem.item_name].inspect_value">
  109. <span style="color:#F56C6C;margin-left:5px;" >{{scope.row.data[modeItem.item_name].inspect_value}}</span>
  110. </span>
  111. </span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column fixed="right" label="操作" width="100">
  115. <template slot-scope="scope">
  116. <el-button @click="handleClick(scope.row.patient_id,scope.row.inspect_date)" style="font-size:14px;" type="text" size="small">查看</el-button>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <el-pagination
  121. align="right"
  122. @size-change="handleSizeChange"
  123. @current-change="handleCurrentChange"
  124. :current-page="listQuery.page"
  125. :page-sizes="[10, 20, 50, 100]"
  126. :page-size="10"
  127. background
  128. style="margin-top:20px;"
  129. layout="total, sizes, prev, pager, next, jumper"
  130. :total="total"
  131. ></el-pagination>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </template>
  137. <script>
  138. import { PostSearch} from '@/api/patient'
  139. import echarts from "echarts";
  140. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  141. import LineChart from "../qcd/components/LineChart";
  142. import { getNormData,getPatientsControl,getCartogramlist,getPatientContorlAnalysis,getCurrentOrgPatients } from "@/api/common/common"
  143. export default {
  144. components: {
  145. LineChart,
  146. BreadCrumb
  147. },
  148. data() {
  149. return {
  150. pickerOptions: {
  151. disabledDate(time) {
  152. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
  153. return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  154. }
  155. },
  156. crumbs: [
  157. { path: false, name: "质控管理" },
  158. { path: false, name: "患者质控达标统计" }
  159. ],
  160. listQuery: {
  161. start_time: "",
  162. end_time: "",
  163. page: 1,
  164. limit: 10
  165. },
  166. total:0,
  167. lapstor:0,
  168. options: [
  169. {
  170. value: 0,
  171. label: "全部"
  172. },
  173. {
  174. value: 1,
  175. label: "留治"
  176. },
  177. {
  178. value: "2",
  179. label: "转出"
  180. },
  181. ],
  182. value: "",
  183. modesData: {
  184. xAxis: [],
  185. series: []
  186. },
  187. chart: {
  188. // title: {
  189. // text: "ECharts 入门示例"
  190. // },
  191. tooltip: {},
  192. // legend: {
  193. // data: ["次数"],
  194. // left: 0
  195. // },
  196. xAxis: {
  197. data: []
  198. },
  199. yAxis: {
  200. axisLabel: {
  201. formatter: "{value} %"
  202. },
  203. show: false
  204. },
  205. series: [
  206. {
  207. name: "",
  208. type: "bar",
  209. data: [],
  210. barWidth: 30,
  211. label: {
  212. normal: {
  213. show: true,
  214. position: "top",
  215. formatter: (params) => {
  216. if(this.obj.length > 0){
  217. let str = ''
  218. str = '('+ this.obj[params.dataIndex] +'人'+',' + params.data +'%' +')'
  219. return str
  220. }else{
  221. let str = ''
  222. str = params.data+'%'
  223. return str
  224. }
  225. }
  226. }
  227. },
  228. //配置样式
  229. itemStyle: {
  230. //通常情况下:
  231. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  232. normal: {
  233. color: function(params) {
  234. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  235. var colorList = [
  236. ["#A9E0F3", "#9FBDFC"],
  237. ["#FFD7C0", "#FF9994"]
  238. ];
  239. var index = params.dataIndex;
  240. if (params.dataIndex >= colorList.length) {
  241. index = params.dataIndex % colorList.length;
  242. }
  243. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  244. { offset: 0, color: colorList[index][0] },
  245. // { offset: 0.5, color: colorList[index][1] },
  246. { offset: 1, color: colorList[index][1] }
  247. ]);
  248. },
  249. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  250. },
  251. //鼠标悬停时:
  252. // emphasis: {
  253. // shadowBlur: 10,
  254. // shadowOffsetX: 0,
  255. // shadowColor: "rgba(0, 0, 0, 0.2)"
  256. // }
  257. }
  258. }
  259. ]
  260. },
  261. patientsArr:[],
  262. tableData: [],
  263. normData:[],
  264. paitents:[],
  265. tableName:[],
  266. total:0,
  267. obj:[],
  268. ObjectData:{},
  269. tablePatients:[],
  270. tableSort:[],
  271. dataName:[
  272. {id:0,name:"达标"},
  273. {id:1,name:"未达标"},
  274. ],
  275. dataCount:[
  276. {id:0,count:0},
  277. {id:1,count:0}
  278. ],
  279. patient_id:0,
  280. };
  281. },
  282. methods: {
  283. handleSizeChange(limit){
  284. this.listQuery.limit = limit
  285. this.getlist()
  286. },
  287. handleCurrentChange(page){
  288. this.listQuery.page = page
  289. this.getlist()
  290. },
  291. changeTime() {
  292. var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
  293. if (time > 0) {
  294. this.$message.error("结束时间不能小于开始时间");
  295. this.listQuery.start_time = "";
  296. } else {
  297. }
  298. },
  299. changeEndTime(val) {
  300. var time =
  301. this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
  302. if (time < 0) {
  303. this.$message.error("结束时间不能小于开始时间");
  304. this.listQuery.end_time = "";
  305. } else {
  306. }
  307. },
  308. getTimestamp(time) {
  309. // 把时间日期转成时间戳
  310. return new Date(time).getTime() / 1000;
  311. },
  312. handleClick(patientid,inspectdate) {
  313. // var id = 0
  314. // var dialysis_no = 0
  315. // for(let i=0;i<this.tablePatients.length;i++){
  316. // if(name == this.tablePatients[i].name){
  317. // id = this.tablePatients[i].patient_id
  318. // dialysis_no = this.tablePatients[i].dialysis_no
  319. // }
  320. // }
  321. this.$router.push({ path: "/qcd/patientComplianceDetails?patientid="+patientid+"&date="+inspectdate});
  322. },
  323. getDialysisNo(name){
  324. for(let i=0;i<this.tablePatients.length;i++){
  325. if(name == this.tablePatients[i].name){
  326. return this.tablePatients[i].dialysis_no
  327. }
  328. }
  329. },
  330. getNormData(){
  331. getNormData().then(response=>{
  332. if(response.data.state == 1){
  333. var normdata = response.data.data.normdata
  334. // console.log("normdata",normdata)
  335. this.normData = normdata
  336. var a=[];
  337. for(let i=0;i<normdata.length;i++){
  338. a.push(normdata[i])
  339. }
  340. // console.log("a",a)
  341. this.newArr = a
  342. var arr = this.arrayToObj(a)
  343. this.ObjectData = arr
  344. }
  345. })
  346. },
  347. onSearch(){
  348. const params = {
  349. lapstor:this.lapstor,
  350. patientid:this.patient_id,
  351. startime:this.listQuery.start_time,
  352. endtime:this.listQuery.end_time,
  353. }
  354. getPatientContorlAnalysis(params).then(response=>{
  355. if(response.data.state == 1){
  356. var control = response.data.data.patientcontorDetail
  357. // console.log("control",control)
  358. let dataInfo = {}
  359. control.forEach((item, index) => {
  360. let { inspect_date } = item
  361. if (!dataInfo[inspect_date]) {
  362. dataInfo[inspect_date] = {
  363. inspect_date,
  364. name: item.name,
  365. child: [],
  366. patient_id: item.patient_id,
  367. range_type:item.range_type,
  368. dialysis_no:item.dialysis_no
  369. }
  370. }
  371. })
  372. let list = Object.values(dataInfo)
  373. // console.log("list",list)
  374. list.map(item => {
  375. for (let i = 0; i < control.length; i++) {
  376. if (item.inspect_date == control[i].inspect_date && item.patient_id == control[i].patient_id) {
  377. item.child.push(control[i])
  378. }
  379. }
  380. })
  381. var newarrtwo = []
  382. list.map(item => {
  383. item.child.map(it => {
  384. newarrtwo.push(it)
  385. })
  386. })
  387. // 配置的才显示
  388. var arrthree = []
  389. for (let i = 0; i < newarrtwo.length; i++) {
  390. for (let j = 0; j < this.normData.length; j++) {
  391. if (newarrtwo[i].item_id == this.normData[j].inspection_minor) {
  392. arrthree.push(newarrtwo[i])
  393. }
  394. }
  395. }
  396. // console.log("arrthree",arrthree)
  397. var arrfour = this.arrayDate(arrthree, newarrtwo)
  398. arrfour.map(item => {
  399. item.item_name = ''
  400. arrthree.push(item)
  401. })
  402. var dd = {}
  403. for (const index in arrthree) {
  404. if (!(arrthree[index].inspect_date in dd)) {
  405. dd[arrthree[index].inspect_date] = {}
  406. }
  407. if (!(arrthree[index].item_name in dd[arrthree[index].inspect_date]) && arrthree[index].item_name != 0) {
  408. dd[arrthree[index].inspect_date][arrthree[index].item_name] = arrthree[index]
  409. }
  410. }
  411. this.tableData = []
  412. for (const key in dd) {
  413. for (const mkey in this.ObjectData) {
  414. if (!(this.ObjectData[mkey].item_name in dd[key])) {
  415. dd[key][this.ObjectData[mkey].item_name] = {
  416. item_name: this.ObjectData[mkey].item_name,
  417. name: mkey,
  418. inspect_value: 0,
  419. range_type:this.ObjectData[mkey].range_type  
  420. }
  421. }
  422. }
  423. this.tableData.push({ name: key, data: dd[key]})
  424. }
  425. let dataInfotwo = {}
  426. control.forEach((item, index) => {
  427. let { inspect_date } = item
  428. if (!dataInfotwo[inspect_date]) {
  429. dataInfotwo[inspect_date] = {
  430. inspect_date,
  431. name: item.name,
  432. dialysis_no:item.dialysis_no
  433. }
  434. }
  435. })
  436. let listtwo = Object.values(dataInfotwo)
  437. // console.log("listtwo",listtwo)
  438. listtwo.map(item=>{
  439. this.tableData.map(it=>{
  440. if(item.inspect_date == parseInt(it.name)){
  441. it.name = item.name
  442. it.dialysis_no = item.dialysis_no
  443. }
  444. })
  445. })
  446. // let projectArr = []
  447. // this.newArr.map(item => {
  448. // projectArr.push(item.item_name)
  449. // })
  450. // this.tableData.map(item => {
  451. // let newarr = Object.values(item.data)
  452. // newarr.sort((a, b) => {
  453. // return projectArr.indexOf(a.item_name) - projectArr.indexOf(b.item_name)
  454. // })
  455. // item.data = newarr
  456. // })
  457. // for (let i = 0; i < this.patientsArr.length; i++) {
  458. // for (let j = 0; j < this.tableData.length; j++) {
  459. // if (this.patientsArr[i].name == this.tableData[j].name) {
  460. // this.tableData[j].dialysis_no = this.patientsArr[i].dialysis_no
  461. // this.tableData[j].patient_id = this.patientsArr[i].id
  462. // }
  463. // }
  464. // }
  465. }
  466. })
  467. },
  468. getlist(){
  469. getPatientsControl(this.lapstor,this.listQuery.start_time,this.listQuery.end_time,this.listQuery.page,this.listQuery.limit).then(response=>{
  470. if(response.data.state == 1){
  471. var patients = response.data.data.patients
  472. this.tablePatients = patients
  473. var total = response.data.data.total
  474. this.total = total
  475. var control = response.data.data.control
  476. var infectiousControl = response.data.data.infectiousControl
  477. infectiousControl.map(item=>{
  478. control.push(item)
  479. })
  480. var newArr = []
  481. // 分页
  482. for (let i = 0; i < control.length; i++) {
  483. for (let j = 0; j < patients.length; j++) {
  484. if (control[i].inspect_date == patients[j].inspect_date) {
  485. newArr.push(control[i])
  486. }
  487. }
  488. }
  489. let dataInfo = {}
  490. newArr.forEach((item, index) => {
  491. let { inspect_date } = item
  492. if (!dataInfo[inspect_date]) {
  493. dataInfo[inspect_date] = {
  494. inspect_date,
  495. name: item.name,
  496. child: [],
  497. patient_id: item.patient_id,
  498. range_type:item.range_type
  499. }
  500. }
  501. })
  502. let list = Object.values(dataInfo)
  503. list.map(item => {
  504. for (let i = 0; i < newArr.length; i++) {
  505. if (item.inspect_date == newArr[i].inspect_date) {
  506. item.child.push(newArr[i])
  507. }
  508. }
  509. })
  510. var newarrtwo = []
  511. list.map(item => {
  512. item.child.map(it => {
  513. newarrtwo.push(it)
  514. })
  515. })
  516. // 配置的才显示
  517. var arrthree = []
  518. for (let i = 0; i < newarrtwo.length; i++) {
  519. for (let j = 0; j < this.normData.length; j++) {
  520. if (newarrtwo[i].item_id == this.normData[j].inspection_minor) {
  521. arrthree.push(newarrtwo[i])
  522. }
  523. }
  524. }
  525. var arrfour = this.arrayDate(arrthree, newarrtwo)
  526. arrfour.map(item => {
  527. item.item_name = ''
  528. arrthree.push(item)
  529. })
  530. var dd = {}
  531. for (const index in arrthree) {
  532. if (!(arrthree[index].inspect_date in dd)) {
  533. dd[arrthree[index].inspect_date] = {}
  534. }
  535. if (!(arrthree[index].item_name in dd[arrthree[index].inspect_date]) && arrthree[index].item_name != 0) {
  536. dd[arrthree[index].inspect_date][arrthree[index].item_name] = arrthree[index]
  537. }
  538. }
  539. let dataInfotwo = {}
  540. newArr.forEach((item, index) => {
  541. let { inspect_date } = item
  542. if (!dataInfotwo[inspect_date]) {
  543. dataInfotwo[inspect_date] = {
  544. inspect_date,
  545. name: item.name,
  546. inspect_value:item.inspect_value,
  547. id:item.id,
  548. inspect_date:item.inspect_date,
  549. }
  550. }
  551. })
  552. let listtwo = Object.values(dataInfotwo)
  553. for (const key in dd) {
  554. for (const mkey in this.ObjectData) {
  555. if (!(this.ObjectData[mkey].item_name in dd[key])) {
  556. dd[key][this.ObjectData[mkey].item_name] = {
  557. item_name: this.ObjectData[mkey].item_name,
  558. name: mkey,
  559. inspect_value: 0,
  560. range_type:this.ObjectData[mkey].range_type
  561. }
  562. }
  563. }
  564. this.tableData.push({ name: key, data: dd[key]})
  565. }
  566. listtwo.map(item=>{
  567. this.tableData.map(it=>{
  568. if(item.inspect_date == parseInt(it.name)){
  569. it.name = item.name
  570. it.id = item.id
  571. it.inspect_date = item.inspect_date
  572. }
  573. })
  574. })
  575. for(let i=0;i<this.patientsArr.length;i++){
  576. for(let j=0;j<this.tableData.length;j++){
  577. if(this.patientsArr[i].name == this.tableData[j].name){
  578. this.tableData[j].dialysis_no = this.patientsArr[i].dialysis_no
  579. this.tableData[j].patient_id = this.patientsArr[i].id
  580. }
  581. }
  582. }
  583. }
  584. })
  585. },
  586. arrayToObj(arr){
  587. return Object.assign({},arr);
  588. },
  589. arrayDate(array1,array2){
  590. var array1 = array1;
  591. var array2 = array2;
  592. var result = [];
  593. for(var i = 0; i < array2.length; i++){
  594. var obj = array2[i];
  595. var num = obj.item_id; //staff_id 就是要对比的key
  596. var isExist = false;
  597. for(var j = 0; j < array1.length; j++){
  598. var aj = array1[j];
  599. var n = aj.item_id;
  600. if(n == num){
  601. isExist = true;
  602. break;
  603. }
  604. }
  605. if(!isExist){
  606. result.push(obj);
  607. }
  608. }
  609. return result;
  610. },
  611. getCartogramlist(){
  612. getCartogramlist(this.lapstor,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
  613. if(response.data.state == 1){
  614. var cartogramlist = response.data.data.cartogramlist
  615. console.log("cartogramlist",cartogramlist)
  616. var totaltwo = response.data.data.total
  617. // console.log("totaltwo",totaltwo)
  618. var infectiouscontrol = response.data.data.infectiouscontrol
  619. // console.log("infectiouscontrol",infectiouscontrol)
  620. infectiouscontrol.map(item=>{
  621. cartogramlist.push(item)
  622. })
  623. var cart = []
  624. // console.log("已配置的选项",this.normData)
  625. //过滤已经配置的选项
  626. for(let i=0;i<cartogramlist.length;i++){
  627. for(let j=0;j<this.normData.length;j++){
  628. if(cartogramlist[i].item_id == this.normData[j].inspection_minor){
  629. cart.push(cartogramlist[i])
  630. }
  631. }
  632. }
  633. let dataInfo = {}
  634. cart.forEach((item, index) => {
  635. let { patient_id } = item
  636. if (!dataInfo[patient_id]) {
  637. dataInfo[patient_id] = {
  638. patient_id,
  639. name:item.name,
  640. child: [],
  641. inspect_date:item.inspect_date,
  642. total:0,
  643. count:0,
  644. infectotal:0,
  645. }
  646. }
  647. })
  648. let list = Object.values(dataInfo)
  649. var arr = []
  650. list.map(item=>{
  651. for(let i=0;i<cart.length;i++){
  652. if(item.inspect_date == cart[i].inspect_date && item.patient_id == cart[i].patient_id){
  653. item.child.push(cart[i])
  654. }
  655. }
  656. })
  657. // console.log("list",list)
  658. list.map(item=>{
  659. item.child.map(it=>{
  660. // console.log("长度",item.child.length)
  661. // console.log("it",it)
  662. if(it.range_type == 1 && parseInt(it.range_min)<=parseInt(it.inspect_value) && parseInt(it.inspect_value)<=parseInt(it.range_max)){
  663. item.total ++
  664. }
  665. if(it.range_type == 2 && it.inspect_value == it.range_value){
  666. item.infectotal ++
  667. }
  668. })
  669. })
  670. // console.log("list",list)
  671. var standardTotal = 0
  672. list.map(item=>{
  673. if((item.total +item.infectotal) == item.child.length){
  674. item.count ++
  675. }
  676. })
  677. list.map(item=>{
  678. standardTotal += item.count
  679. })
  680. var totalCount = list.length
  681. // console.log("arr",list)
  682. // console.log("合格",standardTotal)
  683. // console.log("总人数",totalCount)
  684. for(let i=0;i<this.dataCount.length;i++){
  685. this.dataCount[0].count = standardTotal
  686. this.dataCount[1].count = totalCount - standardTotal
  687. this.obj.push(this.dataCount[i].count)
  688. }
  689. // console.log("dataCount",this.dataCount)
  690. for (let i = 0; i < this.dataName.length; i++) {
  691. this.modesData.xAxis.push(this.dataName[i].name)
  692. }
  693. for (let i = 0; i < this.dataCount.length; i++) {
  694. this.modesData.series.push(((this.dataCount[i].count / totalCount) * 100).toFixed(1))
  695. }
  696. this.chart.series[0].data = this.modesData.series
  697. this.chart.xAxis.data = this.modesData.xAxis
  698. // console.log("this",this.modesData)
  699. }
  700. })
  701. },
  702. getCurrentOrgPatients(){
  703. getCurrentOrgPatients().then(response=>{
  704. if(response.data.state == 1){
  705. this.patientsArr = response.data.data.patients
  706. // console.log("病人",this.patientsArr)
  707. //获取列表数据
  708. this.getlist()
  709. }
  710. })
  711. },
  712. querySearchAsync(keyword, cb) {
  713. let key = ''
  714. if (keyword != undefined) {
  715. key = keyword
  716. }
  717. let searchArray = []
  718. PostSearch(key).then(response => {
  719. if (response.data.state == 1) {
  720. searchArray = response.data.data.patient
  721. cb(searchArray)
  722. } else {
  723. cb([])
  724. }
  725. })
  726. },
  727. handleSelect(val) {
  728. this.listQuery.search = val.name
  729. this.patient_id = val.id
  730. this.onSearch()
  731. },
  732. },
  733. created(){
  734. var nowDate = new Date();
  735. var nowYear = nowDate.getFullYear();
  736. var nowMonth = nowDate.getMonth() + 1;
  737. var nowDay = nowDate.getDate();
  738. this.listQuery.end_time =
  739. nowYear +
  740. "-" +
  741. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  742. "-" +
  743. (nowDay < 10 ? "0" + nowDay : nowDay);
  744. nowDate.setMonth(nowDate.getMonth() - 3);
  745. nowYear = nowDate.getFullYear();
  746. nowMonth = nowDate.getMonth() + 1;
  747. nowDay = nowDate.getDate();
  748. this.listQuery.start_time =
  749. nowYear +
  750. "-" +
  751. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  752. "-" +
  753. (nowDay < 10 ? "0" + nowDay : nowDay);
  754. this.getCurrentOrgPatients()
  755. //获取系统指标
  756. this.getNormData()
  757. //获取统计图数据
  758. this.getCartogramlist()
  759. }
  760. };
  761. </script>
  762. <style lang="scss" scoped>
  763. .page_patientControlAnalysis {
  764. .pointTitle {
  765. font-size: 13px;
  766. }
  767. .chartTitle {
  768. font-size: 16px;
  769. font-weight: bold;
  770. color: #000000;
  771. }
  772. .point {
  773. width: 13px;
  774. height: 13px;
  775. background: linear-gradient(
  776. 0deg,
  777. rgba(169, 224, 243, 1),
  778. rgba(159, 189, 252, 1)
  779. );
  780. border-radius: 7px;
  781. margin-right: 8px;
  782. }
  783. .pointTitle {
  784. font-size: 13px;
  785. }
  786. }
  787. </style>
  788. <style lang="scss">
  789. .page_patientControlAnalysis {
  790. .el-form-item {
  791. margin-bottom: 0;
  792. }
  793. .cell {
  794. text-align: center;
  795. }
  796. ::-webkit-scrollbar{
  797. height: 15px !important;
  798. }
  799. }
  800. </style>