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

TimePersonal.vue 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. <template>
  2. <div class="page_timePersonal">
  3. <div class="cell clearfix">
  4. <el-form :inline="true" :model="listQuery">
  5. <el-form-item label>
  6. <el-autocomplete
  7. class="checkSearch"
  8. popper-class="my-autocomplete"
  9. v-model.trim="listQuery.search"
  10. :fetch-suggestions="querySearchAsync"
  11. :trigger-on-focus="false"
  12. placeholder="病人透析号/姓名"
  13. @select="handleSelect"
  14. style="width:160px;"
  15. >
  16. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  17. <template slot-scope="{ item }">
  18. <div class="name">{{ item.name }}</div>
  19. </template>
  20. </el-autocomplete>
  21. </el-form-item>
  22. </el-form>
  23. <label class="title" style="text-align:left;">
  24. <span class="name">日期查询</span> :
  25. </label>
  26. <el-date-picker
  27. v-model="listQuery.start_time"
  28. prefix-icon="el-icon-date"
  29. @change="changeTime"
  30. :editable="false"
  31. style="width: 196px;"
  32. type="date"
  33. placeholder="选择日期时间"
  34. align="right"
  35. format="yyyy-MM-dd"
  36. value-format="yyyy-MM-dd"
  37. ></el-date-picker>
  38. <span class>-</span>
  39. <el-date-picker
  40. v-model="listQuery.end_time"
  41. prefix-icon="el-icon-date"
  42. @change="changeEndTime"
  43. :editable="false"
  44. style="width: 196px;"
  45. type="date"
  46. placeholder="选择日期时间"
  47. align="right"
  48. format="yyyy-MM-dd"
  49. value-format="yyyy-MM-dd"
  50. ></el-date-picker>
  51. </div>
  52. <el-container>
  53. <div style="width:160px">
  54. <div class="tableTitle">患者列表</div>
  55. <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
  56. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  57. highlight-current-row
  58. @current-change="handleChange">
  59. <el-table-column prop="dialysis_no" label="透析号" width="70">
  60. <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
  61. </el-table-column>
  62. <el-table-column prop="name" label="姓名" width="90">
  63. <template slot-scope="scope">{{ scope.row.name }}</template>
  64. </el-table-column>
  65. </el-table>
  66. </div>
  67. <div style="padding-left:10px;flex:1">
  68. <div class="tableTitle">统计表</div>
  69. <div><el-button type="primary" @click="exportList">导出</el-button></div>
  70. <el-table :data="DialysisData" style="width: 100%" border :row-style="{ color: '#303133' }"
  71. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  72. >
  73. <el-table-column prop="name" label="姓名" width="140">
  74. <!-- <template slot-scope="scope">{{ scope.row.name }}</template> -->
  75. </el-table-column>
  76. <el-table-column label="年龄" width="140">
  77. <template slot-scope="scope">{{ getAge(scope.row.id_card_no) }}</template>
  78. </el-table-column>
  79. <el-table-column prop="dialysis_no" label="透析号" width="140">
  80. <!-- <template slot-scope="scope">{{ scope.row.dialysis_no }}</template> -->
  81. </el-table-column>
  82. <el-table-column prop="mode_id" label="透析模式">
  83. <template slot-scope="scope">
  84. <!-- <span>{{ scope.row.mode_id.join("、") }}</span> -->
  85. <span>{{getModeIdCount(scope.row.patient_id)}}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column prop="address" label="透析总次数" width="140">
  89. <template slot-scope="scope">
  90. <span>{{ getDialysisCount(scope.row.patient_id)}}</span>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. <el-pagination
  95. align="right"
  96. @size-change="handleSizeChange"
  97. @current-change="handleCurrentChange"
  98. :current-page="listQuery.page"
  99. :page-sizes="[20, 40, 60, 80, 100,200,300,500,1000]"
  100. :page-size="10"
  101. background
  102. style="margin-top:20px;"
  103. layout="total, sizes, prev, pager, next, jumper"
  104. :total="total"
  105. ></el-pagination>
  106. </div>
  107. </el-container>
  108. </div>
  109. </template>
  110. <script>
  111. import { PostSearch} from '@/api/patient'
  112. import { getCurrentOrgPatients,getDialysisList,getDialysisDetailById,getPrescriptionByName } from "@/api/common/common";
  113. import { uParseTime } from "@/utils/tools";
  114. export default {
  115. data() {
  116. return {
  117. listQuery: {
  118. start_time: "",
  119. end_time: "",
  120. page: 1,
  121. limit: 20
  122. },
  123. DialysisCount:[],
  124. total:0,
  125. options: [],
  126. value: "请选项",
  127. tableData: [],
  128. DialysisData: [],
  129. patientsData:[],
  130. prescriptionList:[],
  131. limit:1000,
  132. page:1,
  133. pickerOptions: {
  134. disabledDate(time) {
  135. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
  136. return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  137. }
  138. },
  139. patient_id:0,
  140. modeIdCount:[],
  141. };
  142. },
  143. methods: {
  144. changeTime(val) {
  145. var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
  146. if (time > 0) {
  147. this.$message.error("结束时间不能小于开始时间");
  148. this.listQuery.start_time = "";
  149. } else {
  150. this.getDialysisList()
  151. }
  152. },
  153. changeEndTime(val) {
  154. var time =
  155. this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
  156. if (time < 0) {
  157. this.$message.error("结束时间不能小于开始时间");
  158. this.listQuery.end_time = "";
  159. } else {
  160. this.getDialysisList()
  161. }
  162. },
  163. getTimestamp(time) {
  164. // 把时间日期转成时间戳
  165. return new Date(time).getTime() / 1000;
  166. },
  167. getCurrentOrgPatients(){
  168. getCurrentOrgPatients().then(response=>{
  169. if(response.data.state == 1){
  170. var patients = response.data.data.patients
  171. this.patientsData = patients
  172. }
  173. })
  174. },
  175. getTime(time) {
  176. return uParseTime(time, "{y}-{m}-{d}");
  177. },
  178. handleSizeChange(limit) {
  179. this.listQuery.limit = limit;
  180. this.getDialysisList();
  181. },
  182. handleCurrentChange(page) {
  183. this.listQuery.page = page;
  184. this.getDialysisList();
  185. },
  186. getDialysisList(){
  187. getDialysisList(this.listQuery.start_time,this.listQuery.end_time,this.listQuery.page,this.listQuery.limit).then(response=>{
  188. if(response.data.state === 1){
  189. var list = response.data.data.list
  190. var totallist = response.data.data.totallist
  191. this.total = totallist
  192. var prescriptionList = response.data.data.prescriptionList
  193. this.getModeId(prescriptionList)
  194. var count = response.data.data.count
  195. this.DialysisCount = count
  196. var modeIdCount = response.data.data.modeIdCount
  197. console.log("modeidcount=====",modeIdCount)
  198. for(let i=0;i<modeIdCount.length;i++){
  199. if(modeIdCount[i].mode_id == 1){
  200. modeIdCount[i].mode_id = "HD"
  201. }
  202. if(modeIdCount[i].mode_id == 2){
  203. modeIdCount[i].mode_id = "HDF"
  204. }
  205. if(modeIdCount[i].mode_id == 3){
  206. modeIdCount[i].mode_id = "HD+HP"
  207. }
  208. if(modeIdCount[i].mode_id == 4){
  209. modeIdCount[i].mode_id = "HP"
  210. }
  211. if(modeIdCount[i].mode_id == 5){
  212. modeIdCount[i].mode_id = "HF"
  213. }
  214. if(modeIdCount[i].mode_id == 6){
  215. modeIdCount[i].mode_id = "SCUF"
  216. }
  217. if(modeIdCount[i].mode_id == 7){
  218. modeIdCount[i].mode_id = "IUF"
  219. }
  220. if(modeIdCount[i].mode_id == 8){
  221. modeIdCount[i].mode_id = "HFHD"
  222. }
  223. if(modeIdCount[i].mode_id == 9){
  224. modeIdCount[i].mode_id = "HFHD+HP"
  225. }
  226. if(modeIdCount[i].mode_id == 10){
  227. modeIdCount[i].mode_id = "PHF"
  228. }
  229. if(modeIdCount[i].mode_id == 11){
  230. modeIdCount[i].mode_id = "HFR"
  231. }
  232. if(modeIdCount[i].mode_id == 12){
  233. modeIdCount[i].mode_id = "HDF+HP"
  234. }
  235. if(modeIdCount[i].mode_id == 13){
  236. modeIdCount[i].mode_id = "CRRT"
  237. }
  238. if(modeIdCount[i].mode_id == 14){
  239. modeIdCount[i].mode_id = "腹水回输"
  240. }
  241. if(modeIdCount[i].mode_id == 15){
  242. modeIdCount[i].mode_id = "HD前置换"
  243. }
  244. if(modeIdCount[i].mode_id == 16){
  245. modeIdCount[i].mode_id = "HD后置换"
  246. }
  247. if(modeIdCount[i].mode_id == 17){
  248. modeIdCount[i].mode_id = "HDF前置换"
  249. }
  250. if(modeIdCount[i].mode_id == 18){
  251. modeIdCount[i].mode_id = "HDF后置换"
  252. }
  253. if(modeIdCount[i].mode_id == 19){
  254. modeIdCount[i].mode_id = "IUF+HD"
  255. }
  256. if(modeIdCount[i].mode_id == 20){
  257. modeIdCount[i].mode_id = "UF"
  258. }
  259. if(modeIdCount[i].mode_id == 21){
  260. modeIdCount[i].mode_id = "HD+"
  261. }
  262. if(modeIdCount[i].mode_id == 22){
  263. modeIdCount[i].mode_id = "血浆胆红素吸附+HDF"
  264. }
  265. if(modeIdCount[i].mode_id == 23){
  266. modeIdCount[i].mode_id = "血浆胆红素吸附"
  267. }
  268. if(modeIdCount[i].mode_id == 24){
  269. modeIdCount[i].mode_id = "I-HDF"
  270. }
  271. if(modeIdCount[i].mode_id == 25){
  272. modeIdCount[i].mode_id = "HD高通"
  273. }
  274. if(modeIdCount[i].mode_id == 26){
  275. modeIdCount[i].mode_id = "CVVH"
  276. }
  277. if(modeIdCount[i].mode_id == 27){
  278. modeIdCount[i].mode_id = "CVVHD"
  279. }
  280. if(modeIdCount[i].mode_id == 28){
  281. modeIdCount[i].mode_id = "CVVHDF"
  282. }
  283. if(modeIdCount[i].mode_id == 29){
  284. modeIdCount[i].mode_id = "PE"
  285. }
  286. if(modeIdCount[i].mode_id == 30){
  287. modeIdCount[i].mode_id = "血浆胆红素吸附+HP"
  288. }
  289. if(modeIdCount[i].mode_id == 31){
  290. modeIdCount[i].mode_id = "HPD"
  291. }
  292. if(modeIdCount[i].mode_id == 32){
  293. modeIdCount[i].mode_id = "HDP"
  294. }
  295. }
  296. this.modeIdCount = modeIdCount
  297. let dataInfo = {}
  298. list.forEach((item, index) => {
  299. let { patient_id } = item
  300. if (!dataInfo[patient_id]) {
  301. dataInfo[patient_id] = {
  302. patient_id,
  303. name:item.name,
  304. id_card_no:item.id_card_no,
  305. dialysis_no:item.dialysis_no,
  306. total_dialysis:item.total_dialysis,
  307. user_sys_before_count:item.user_sys_before_count,
  308. mode_id: []
  309. }
  310. }
  311. })
  312. let list = Object.values(dataInfo)
  313. list.map(item => {
  314. for (let i = 0; i < prescriptionList.length; i++) {
  315. if (item.patient_id === prescriptionList[i].patient_id) {
  316. item.mode_id.push(prescriptionList[i].mode_id)
  317. }
  318. }
  319. })
  320. // console.log("list---",list)
  321. this.DialysisData = list
  322. }
  323. })
  324. },
  325. getAge(UUserCard) {
  326. if (UUserCard != null && UUserCard != '') {
  327. //获取年龄
  328. var myDate = new Date();
  329. var month = myDate.getMonth() + 1;
  330. var day = myDate.getDate();
  331. var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1;
  332. if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
  333. age++;
  334. }
  335. return age;
  336. }
  337. },
  338. getDialysisCount(id){
  339. var count = 0
  340. for(let i=0;i<this.DialysisCount.length;i++){
  341. if(id == this.DialysisCount[i].patient_id){
  342. count = this.DialysisCount[i].Count
  343. }
  344. }
  345. return count
  346. },
  347. onSearch(){
  348. if(this.listQuery.search == "" || this.listQuery.search == null){
  349. this.getDialysisList()
  350. return false
  351. }else{
  352. getPrescriptionByName(this.patient_id,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
  353. if(response.data.state === 1){
  354. var patients = response.data.data.patient
  355. this.getModeId(patients)
  356. //console.log("patient",patients)
  357. var hash = {};
  358. var i = 0;
  359. var res = [];
  360. patients.forEach(function(item) {
  361. var patient_id = item.patient_id;
  362. hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
  363. mode_id: [item.mode_id],
  364. patient_id: patient_id,
  365. dialysis_no: item.dialysis_no,
  366. name:item.name,
  367. id_card_no:item.id_card_no,
  368. total_dialysis:item.total_dialysis,
  369. user_sys_before_count:item.user_sys_before_count,
  370. })
  371. });
  372. this.DialysisData = res
  373. var total = response.data.data.total
  374. this.total = res.length
  375. // console.log("total",total)
  376. }
  377. })
  378. }
  379. },
  380. unique(arr) {
  381. const res = new Map();
  382. return arr.filter((arr) => !res.has(arr.mode_id) && res.set(arr.mode_id, 1));
  383. },
  384. handleChange(val){
  385. getDialysisDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
  386. if(response.data.state === 1){
  387. var patients = response.data.data.patients
  388. this.getModeId(patients)
  389. // console.log("patients",patients)
  390. var hash = {};
  391. var i = 0;
  392. var res = [];
  393. patients.forEach(function(item) {
  394. var patient_id = item.patient_id;
  395. hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
  396. mode_id: [item.mode_id],
  397. patient_id: patient_id,
  398. dialysis_no: item.dialysis_no,
  399. name:item.name,
  400. id_card_no:item.id_card_no,
  401. total_dialysis:item.total_dialysis,
  402. user_sys_before_count:item.user_sys_before_count,
  403. })
  404. });
  405. this.DialysisData = res
  406. // console.log(res)
  407. var total = response.data.data.total
  408. this.total = res.length
  409. // console.log("total",total)
  410. }
  411. })
  412. },
  413. getModeId(patients){
  414. for(let i=0;i<patients.length;i++){
  415. if(patients[i].mode_id == 1){
  416. patients[i].mode_id = "HD"
  417. }else if(patients[i].mode_id == 2){
  418. patients[i].mode_id = "HDF"
  419. }else if(patients[i].mode_id == 3){
  420. patients[i].mode_id = "HD+HP"
  421. }else if(patients[i].mode_id == 4){
  422. patients[i].mode_id = "HP"
  423. }else if(patients[i].mode_id == 5){
  424. patients[i].mode_id = "HF"
  425. }else if(patients[i].mode_id == 6){
  426. patients[i].mode_id = "SCUF"
  427. }else if(patients[i].mode_id == 7){
  428. patients[i].mode_id = "IUF"
  429. }else if(patients[i].mode_id == 8){
  430. patients[i].mode_id = "HFHD"
  431. }else if(patients[i].mode_id == 9){
  432. patients[i].mode_id = "HFHD+HP"
  433. }else if(patients[i].mode_id == 10){
  434. patients[i].mode_id = "PHF"
  435. }else if(patients[i].mode_id == 11){
  436. patients[i].mode_id = "HFR"
  437. }else if(patients[i].mode_id == 12){
  438. patients[i].mode_id = "HDF+HP"
  439. }else if(patients[i].mode_id == 13){
  440. patients[i].mode_id = "CRRT"
  441. }else if(patients[i].mode_id == 14){
  442. patients[i].mode_id = "腹水回输"
  443. }else if(patients[i].mode_id == 15){
  444. patients[i].mode_id = "HD前置换"
  445. }else if(patients[i].mode_id == 16){
  446. patients[i].mode_id = "HD后置换"
  447. }else if(patients[i].mode_id == 17){
  448. patients[i].mode_id = "HDF前置换"
  449. }else if(patients[i].mode_id == 18){
  450. patients[i].mode_id = "HDF后置换"
  451. }else if(patients[i].mode_id == 19){
  452. patients[i].mode_id = "IUF+HD"
  453. }else if(patients[i].mode_id == 20){
  454. patients[i].mode_id = "UF"
  455. }else if(patients[i].mode_id == 21){
  456. patients[i].mode_id = "HD+"
  457. }else if(patients[i].mode_id == 22){
  458. patients[i].mode_id = "血浆胆红素吸附+HDF"
  459. }else if(patients[i].mode_id == 23){
  460. patients[i].mode_id = "血浆胆红素吸附"
  461. }else if(patients[i].mode_id == 24){
  462. patients[i].mode_id = "I-HDF"
  463. }else if(patients[i].mode_id == 25){
  464. patients[i].mode_id = "HD高通"
  465. }else if(patients[i].mode_id == 26){
  466. patients[i].mode_id = "CVVH"
  467. }else if(patients[i].mode_id == 27){
  468. patients[i].mode_id = "CVVHD"
  469. }else if(patients[i].mode_id == 28){
  470. patients[i].mode_id = "CVVHDF"
  471. }else if(patients[i].mode_id == 29){
  472. patients[i].mode_id = "PE"
  473. }else if(patients[i].mode_id == 30){
  474. patients[i].mode_id = "血浆胆红素吸附+HP"
  475. }else if(patients[i].mode_id == 31){
  476. patients[i].mode_id = "HPD"
  477. }else if(patients[i].mode_id == 32){
  478. patients[i].mode_id = "HDP"
  479. }
  480. }
  481. },
  482. querySearchAsync(keyword, cb) {
  483. let key = ''
  484. if (keyword != undefined) {
  485. key = keyword
  486. }
  487. let searchArray = []
  488. PostSearch(key).then(response => {
  489. if (response.data.state == 1) {
  490. searchArray = response.data.data.patient
  491. // console.log("searchArray",searchArray)
  492. cb(searchArray)
  493. } else {
  494. cb([])
  495. }
  496. })
  497. },
  498. handleSelect(val) {
  499. // console.log("val",val)
  500. this.listQuery.search = val.name
  501. this.patient_id = val.id
  502. this.onSearch()
  503. },
  504. getModeIdCount(id){
  505. var arr = []
  506. for(let i = 0;i<this.modeIdCount.length;i++){
  507. if(id == this.modeIdCount[i].patient_id){
  508. arr.push(this.modeIdCount[i])
  509. }
  510. }
  511. let str = ''
  512. arr.map(item => {
  513. str += item.mode_id + '(' + item.Count + '次) 、'
  514. })
  515. var strs = str.substring(0, str.length - 1)
  516. return strs
  517. },
  518. exportList(){
  519. console.log("DialysisData",this.DialysisData)
  520. for(let i=0;i<this.DialysisData.length;i++){
  521. this.DialysisData[i].index = i+1
  522. this.DialysisData[i].HD = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HD")
  523. this.DialysisData[i].HDF = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HDF")
  524. this.DialysisData[i].HDHP = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HD+HP")
  525. this.DialysisData[i].HP = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HP")
  526. this.DialysisData[i].HF = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HF")
  527. this.DialysisData[i].SCUF = this.getHdModeIdCount(this.DialysisData[i].patient_id,"SCUF")
  528. this.DialysisData[i].IUF = this.getHdModeIdCount(this.DialysisData[i].patient_id,"IUF")
  529. this.DialysisData[i].HFHDHP = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HFHD+HP")
  530. this.DialysisData[i].HDFHP = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HDF+HP")
  531. this.DialysisData[i].CRRT = this.getHdModeIdCount(this.DialysisData[i].patient_id,"CRRT")
  532. this.DialysisData[i].OTR = this.getHdModeIdCount(this.DialysisData[i].patient_id,"腹水回输")
  533. this.DialysisData[i].IUFHD = this.getHdModeIdCount(this.DialysisData[i].patient_id,"IUF+HD")
  534. this.DialysisData[i].UF = this.getHdModeIdCount(this.DialysisData[i].patient_id,"UF")
  535. this.DialysisData[i].HDPlus = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HD+")
  536. this.DialysisData[i].IHDF = this.getHdModeIdCount(this.DialysisData[i].patient_id,"I-HDF")
  537. this.DialysisData[i].HDGT = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HD高通")
  538. this.DialysisData[i].CVVH = this.getHdModeIdCount(this.DialysisData[i].patient_id,"CVVH")
  539. this.DialysisData[i].CVVHD = this.getHdModeIdCount(this.DialysisData[i].patient_id,"CVVHD")
  540. this.DialysisData[i].CVVHDF = this.getHdModeIdCount(this.DialysisData[i].patient_id,"CVVHDF")
  541. this.DialysisData[i].PE = this.getHdModeIdCount(this.DialysisData[i].patient_id,"PE")
  542. this.DialysisData[i].XUEHP = this.getHdModeIdCount(this.DialysisData[i].patient_id,"血浆胆红素吸附+HP")
  543. this.DialysisData[i].HPD = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HPD")
  544. this.DialysisData[i].HDP = this.getHdModeIdCount(this.DialysisData[i].patient_id,"HDP")
  545. this.DialysisData[i].age = this.getAge(this.DialysisData[i].id_card_no)
  546. this.DialysisData[i].total_count = this.getDialysisCount(this.DialysisData[i].patient_id)
  547. }
  548. console.log("hhh2323323232",this.DialysisData)
  549. import('@/vendor/Export2Excel').then(excel => {
  550. const tHeader = ['序号','姓名', '年龄', '透析号','HD','HDF','HD+HP','HP','HF','SCUF','IUF','HFHD','HFHD+HP','HFR','HDF+HP','CRRT','腹水回输','IUF+HD','UF','HD+','I-HDF','HD高通','CVVH','CVVHD','CVVHDF','PE','血浆胆红素吸附+HP','HPD','HDP','总数']
  551. const filterVal = ['index','name', 'age', 'dialysis_no','HD','HDF','HDHP','HP','HF','SCUF','IUF','HFHD','HFHDHP','HFR','HDFHP','CRRT','OTR','IUF+HD','UF','HD+','I-HDF','HDGT','CVVH','CVVHD','CVVHDF','PE','XUEHP','HPD','HDP','total_count']
  552. const data = this.formatJson(filterVal, this.DialysisData)
  553. excel.export_json_to_excel({
  554. header: tHeader,
  555. data,
  556. filename: '透析详情'
  557. })
  558. this.downloadLoading = false
  559. })
  560. },
  561. formatJson(filterVal, jsonData) {
  562. return jsonData.map(v =>
  563. filterVal.map(j => {
  564. if (j === "timestamp") {
  565. return parseTime(v[j]);
  566. } else {
  567. return v[j];
  568. }
  569. })
  570. );
  571. },
  572. getHdModeIdCount(id,mode_name){
  573. var count = 0
  574. var arr = []
  575. for(let i = 0;i<this.modeIdCount.length;i++){
  576. if(id == this.modeIdCount[i].patient_id && this.modeIdCount[i].mode_id == mode_name){
  577. arr.push(this.modeIdCount[i])
  578. }
  579. }
  580. if(arr.length > 0){
  581. for(let i=0;i<arr.length;i++){
  582. count += arr[i].Count
  583. }
  584. }
  585. return count
  586. }
  587. },
  588. created(){
  589. var nowDate = new Date();
  590. var nowYear = nowDate.getFullYear();
  591. var nowMonth = nowDate.getMonth() + 1;
  592. var nowDay = nowDate.getDate();
  593. this.listQuery.end_time =
  594. nowYear +
  595. "-" +
  596. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  597. "-" +
  598. (nowDay < 10 ? "0" + nowDay : nowDay);
  599. nowDate.setMonth(nowDate.getMonth() - 3);
  600. nowYear = nowDate.getFullYear();
  601. nowMonth = nowDate.getMonth() + 1;
  602. nowDay = nowDate.getDate();
  603. this.listQuery.start_time =
  604. nowYear +
  605. "-" +
  606. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  607. "-" +
  608. (nowDay < 10 ? "0" + nowDay : nowDay);
  609. //获取该机构下的所有患者
  610. this.getCurrentOrgPatients()
  611. //统计列表
  612. this.getDialysisList()
  613. }
  614. };
  615. </script>
  616. <style lang="scss" scoped>
  617. .tableTitle {
  618. font-size: 16px;
  619. color: #000;
  620. font-weight: bold;
  621. margin-bottom: 10px;
  622. }
  623. </style>
  624. <style lang="scss">
  625. .page_timePersonal {
  626. .cell {
  627. text-align: center;
  628. }
  629. }
  630. </style>