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

patientControlAnalysis.vue 26KB

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