血透系统pad前端

RecordTable.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. <template>
  2. <div>
  3. <van-list
  4. width="100%"
  5. v-model="loading"
  6. :finished="finished"
  7. @load="onLoad"
  8. >
  9. <div class="choice">
  10. <ul>
  11. <li>透析时间:
  12. <div @click="openStartPicker" class="">{{parseTime(startTime.getTime()/1000, "{y}-{m}-{d}")}}<span
  13. class="iconfont">&#xe74a;</span></div>
  14. <span class="line"></span>
  15. <div @click="openEndPicker" class="">{{parseTime(endTime.getTime()/1000, "{y}-{m}-{d}")}}<span
  16. class="iconfont">&#xe74a;</span></div>
  17. </li>
  18. <!-- <popover placement="bottom">
  19. <div slot="content" class="popover-demo-content">
  20. <ul >
  21. <li v-for="item in modeOptions" :key="item.id" @click="itemClick(item.id)" :class="mode_id == item.id ? 'tick' : ''">{{item.name}}</li>
  22. </ul>
  23. </div>
  24. <li>透析模式:{{modeNameOther(mode_id)}}<span class="iconfont">&#xe74a;</span></li>
  25. </popover> -->
  26. <el-popover
  27. placement="bottom"
  28. trigger="click">
  29. <li slot="reference">透析模式:{{modeNameOther(mode_id)}}<span class="iconfont">&#xe74a;</span></li>
  30. <div class="popover-demo-content">
  31. <ul>
  32. <li v-for="item in modeOptions" :key="item.id" @click="itemClick(item.id)" :class="mode_id == item.id ? 'tick' : ''">{{item.name}}</li>
  33. </ul>
  34. </div>
  35. </el-popover>
  36. </ul>
  37. </div>
  38. <div class="blueBorder"></div>
  39. <div style="width:100%;overflow:hildden;overflow-x:auto;" class="RecordTable">
  40. <table class="table" style="">
  41. <tr>
  42. <th width="124px">透析日期</th>
  43. <th width="72px">班次</th>
  44. <th width="80px">分区-机号</th>
  45. <th width="110px">透析模式</th>
  46. <th width="92px">透析时长(h)</th>
  47. <th width="76px">干体重(kg)</th>
  48. <th width="76px">透前体重(kg)</th>
  49. <th width="76px">透后体重(kg)</th>
  50. <th width="92px">透前血压(mmHg)</th>
  51. <th width="92px">透后血压(mmHg)</th>
  52. <th width="92px">超滤总量(L)</th>
  53. <th width="92px">抗凝剂种类 首剂/维持/总量</th>
  54. <th width="92px">治疗护士</th>
  55. <th width="92px">治疗医生</th>
  56. </tr>
  57. <tr v-for="(item,index) in tableDate" :key="index" :value="item.value" @click="jump(item)">
  58. <td>{{parseTime(item.dialysis_date, "{y}-{m}-{d}")}}</td>
  59. <td>{{scheduleType(item.schedule_type)}}</td>
  60. <td>{{item.partition_name}} - {{item.device_number}}</td>
  61. <td>{{modeName(item.prescription.mode_id)}}</td>
  62. <td>{{item.prescription.dialysis_duration?item.prescription.dialysis_duration:""}}</td>
  63. <td>{{item.prescription.dry_weight?item.prescription.dry_weight:""}}</td>
  64. <td>{{item.predialysis_evaluation.weight_before?item.predialysis_evaluation.weight_before:""}}</td>
  65. <td>{{item.assessment_after_dislysis.weight_after?item.assessment_after_dislysis.weight_after:""}}</td>
  66. <td>{{item.predialysis_evaluation.systolic_blood_pressure?item.predialysis_evaluation.systolic_blood_pressure:""}}</td>
  67. <td>{{item.assessment_after_dislysis.systolic_blood_pressure?item.assessment_after_dislysis.systolic_blood_pressure:""}}</td>
  68. <td>{{item.predialysis_evaluation.ultrafiltration_amount?item.predialysis_evaluation.ultrafiltration_amount:""}}</td>
  69. <td>{{setAnticoagulantsConfit(item.prescription)}}</td>
  70. <!--<td>{{getName(item.treatment_summary.zl_nurse)}}</td>-->
  71. <!--<td>{{getName(item.treatment_summary.zl_doctor)}}</td>-->
  72. <td>{{getName(item.treatment_summary.zl_nurse)}}</td>
  73. <td>{{getName(item.treatment_summary.zl_doctor)}}</td>
  74. </tr>
  75. </table>
  76. <!--<div class="NoData" v-show="tableDate.length == 0"><img src="@/assets/login/data.jpg" alt=""></div>-->
  77. <div class="NoData" v-show="tableDate.length == 0"><img style="margin-top: 50px; margin-bottom: 50px" src="@/assets/login/data.jpg" alt=""></div>
  78. </div>
  79. </van-list>
  80. <mt-datetime-picker
  81. ref="start_date_picker"
  82. type="date"
  83. @confirm="handleStartDateConfirm"
  84. :endDate="new Date()"
  85. v-model="startTime">
  86. </mt-datetime-picker>
  87. <mt-datetime-picker
  88. ref="end_date_picker"
  89. type="date"
  90. @confirm="handleEndDateConfirm"
  91. :endDate="new Date()"
  92. v-model="endTime">
  93. </mt-datetime-picker>
  94. </div>
  95. </template>
  96. <script>
  97. import { Popover } from "vux";
  98. import { parseTime } from "@/utils";
  99. import { getRecordList } from "@/api/patient";
  100. import { fetchAllDoctorAndNurse, fetchAllAdminUsers } from "@/api/doctor";
  101. export default {
  102. name: "LongTable",
  103. created() {
  104. var date = new Date();
  105. var year = date.getFullYear();
  106. var month = date.getMonth();
  107. var day = date.getDate();
  108. if (month < 10) {
  109. month = "0" + month;
  110. }
  111. if (day < 10) {
  112. day = "0" + day;
  113. }
  114. var nowDate = year + "-" + month + "-" + day;
  115. this.startTime = new Date(nowDate);
  116. this.modeOptions = this.$store.getters.treatment_mode;
  117. this.modeOptions["0"] = {
  118. id: 0,
  119. name: "全部"
  120. };
  121. // console.log(this.modeOptions);
  122. this.anticoagulantsConfit = this.$store.getters.anticoagulants_confit;
  123. this.queryParams.start_time = this.parseTime(
  124. this.startTime.getTime() / 1000,
  125. "{y}-{m}-{d}"
  126. );
  127. this.queryParams.end_time = this.parseTime(
  128. new Date().getTime() / 1000,
  129. "{y}-{m}-{d}"
  130. );
  131. this.queryParams.patient_id = this.$route.query.patient_id;
  132. this.queryParams.page = this.queryParams.page + 1;
  133. this.queryParams.limit = 15;
  134. this.tableDate = [];
  135. // console.log(this.queryParams);
  136. getRecordList(this.queryParams).then(response => {
  137. if (response.data.state == 0) {
  138. return false;
  139. } else {
  140. if (response.data.data.records.length == 0) {
  141. } else {
  142. for (let i = 0; i < response.data.data.records.length; i++) {
  143. this.tableDate.push(response.data.data.records[i]);
  144. }
  145. }
  146. }
  147. });
  148. this.fetchAllAdminUsers();
  149. this.fetchAllDoctorAndNurse();
  150. },
  151. data() {
  152. return {
  153. mode_id: "",
  154. loading: false,
  155. finished: false,
  156. startTime: new Date(),
  157. endTime: new Date(),
  158. modeOptions: {},
  159. anticoagulantsConfit: [],
  160. doctorList: [],
  161. nurseList: [],
  162. doctorOptions: [],
  163. adminUserOptions: null,
  164. queryParams: {
  165. mode_id: "",
  166. start_time: "",
  167. end_time: "",
  168. page: 0,
  169. patient_id: 0,
  170. limit: 15
  171. },
  172. tableDate: []
  173. };
  174. },
  175. methods: {
  176. modeName(mode_id) {
  177. return typeof this.modeOptions[mode_id] != "undefined" &&
  178. typeof this.modeOptions[mode_id].name != "undefined"
  179. ? this.modeOptions[mode_id].name
  180. : "";
  181. },
  182. modeNameOther(mode_id) {
  183. return typeof this.modeOptions[mode_id] != "undefined" &&
  184. typeof this.modeOptions[mode_id].name != "undefined"
  185. ? this.modeOptions[mode_id].name
  186. : "全部";
  187. },
  188. parseTime(time, layout) {
  189. return parseTime(time, layout);
  190. },
  191. openStartPicker: function() {
  192. this.$refs.start_date_picker.open();
  193. },
  194. openEndPicker: function() {
  195. this.$refs.end_date_picker.open();
  196. },
  197. handleStartDateConfirm: function(val) {
  198. this.queryParams.start_time = this.parseTime(
  199. this.startTime / 1000,
  200. "{y}-{m}-{d}"
  201. );
  202. this.queryParams.end_time = this.parseTime(
  203. this.endTime / 1000,
  204. "{y}-{m}-{d}"
  205. );
  206. this.queryParams.page = 1;
  207. this.queryParams.limit = 15;
  208. this.getRecordList(this.queryParams);
  209. },
  210. handleEndDateConfirm: function(val) {
  211. this.queryParams.start_time = this.parseTime(
  212. this.startTime / 1000,
  213. "{y}-{m}-{d}"
  214. );
  215. this.queryParams.end_time = this.parseTime(
  216. this.endTime / 1000,
  217. "{y}-{m}-{d}"
  218. );
  219. this.queryParams.page = 1;
  220. this.queryParams.limit = 15;
  221. this.getRecordList(this.queryParams);
  222. },
  223. getRecordList: function(val) {
  224. this.tableDate = [];
  225. getRecordList(val).then(response => {
  226. if (response.data.state == 0) {
  227. return false;
  228. } else {
  229. if (response.data.data.records.length == 0) {
  230. } else {
  231. for (let i = 0; i < response.data.data.records.length; i++) {
  232. this.tableDate.push(response.data.data.records[i]);
  233. }
  234. }
  235. }
  236. });
  237. },
  238. onLoad() {
  239. this.queryParams.start_time = this.parseTime(
  240. this.startTime.getTime() / 1000,
  241. "{y}-{m}-{d}"
  242. );
  243. this.queryParams.end_time = this.parseTime(
  244. this.endTime.getTime() / 1000,
  245. "{y}-{m}-{d}"
  246. );
  247. this.queryParams.patient_id = this.$route.query.patient_id;
  248. this.queryParams.page = this.queryParams.page + 1;
  249. this.queryParams.limit = 15;
  250. getRecordList(this.queryParams).then(response => {
  251. if (response.data.state == 0) {
  252. this.finished = true;
  253. this.loading = false;
  254. return false;
  255. } else {
  256. if (response.data.data.records.length == 0) {
  257. this.finished = true;
  258. this.loading = false;
  259. } else {
  260. for (let i = 0; i < response.data.data.records.length; i++) {
  261. this.tableDate.push(response.data.data.records[i]);
  262. }
  263. this.loading = false;
  264. }
  265. }
  266. });
  267. },
  268. scheduleType(scheduleType) {
  269. var typeName = "";
  270. switch (scheduleType) {
  271. case 1:
  272. typeName = "上午";
  273. break;
  274. case 2:
  275. typeName = "下午";
  276. break;
  277. case 3:
  278. typeName = "晚上";
  279. break;
  280. default:
  281. break;
  282. }
  283. return typeName;
  284. },
  285. setAnticoagulantsConfit: function(prescription) {
  286. if (
  287. typeof this.anticoagulantsConfit[prescription.anticoagulant] ==
  288. "undefined"
  289. ) {
  290. return "";
  291. } else {
  292. if (this.anticoagulantsConfit[prescription.anticoagulant].shouji != 1) {
  293. return this.anticoagulantsConfit[prescription.anticoagulant].name;
  294. } else {
  295. return (
  296. this.anticoagulantsConfit[prescription.anticoagulant].name +
  297. "/" +
  298. prescription.anticoagulant_shouji +
  299. "/" +
  300. prescription.anticoagulant_weichi +
  301. "/" +
  302. prescription.anticoagulant_zongliang
  303. );
  304. }
  305. }
  306. },
  307. getName: function(id) {
  308. if (id <= 0) {
  309. return "";
  310. }
  311. var name = "";
  312. if (
  313. this.adminUserOptions == null ||
  314. typeof this.adminUserOptions.length == "undefined"
  315. ) {
  316. return name;
  317. }
  318. var leng = this.adminUserOptions.length;
  319. if (leng == 0) {
  320. return name;
  321. }
  322. for (let index = 0; index < leng; index++) {
  323. if (this.adminUserOptions[index].id == id) {
  324. name = this.adminUserOptions[index].name;
  325. break;
  326. }
  327. }
  328. return name;
  329. },
  330. fetchAllAdminUsers() {
  331. fetchAllAdminUsers().then(response => {
  332. if (response.data.state == 1) {
  333. this.adminUserOptions = response.data.data.users;
  334. var alen = this.adminUserOptions.length;
  335. for (let index = 0; index < alen; index++) {
  336. if (this.adminUserOptions[index].user_type == 2) {
  337. this.doctorOptions.push(this.adminUserOptions[index]);
  338. }
  339. }
  340. }
  341. });
  342. },
  343. fetchAllDoctorAndNurse() {
  344. fetchAllDoctorAndNurse().then(response => {
  345. if (response.data.state == 1) {
  346. this.doctorOptions = response.data.data.doctors;
  347. }
  348. });
  349. },
  350. itemClick: function(val) {
  351. if (val == "0") {
  352. this.mode_id = "0";
  353. } else {
  354. this.mode_id = val;
  355. }
  356. this.queryParams.mode_id = val;
  357. this.queryParams.start_time = this.parseTime(
  358. this.startTime / 1000,
  359. "{y}-{m}-{d}"
  360. );
  361. this.queryParams.end_time = this.parseTime(
  362. this.endTime / 1000,
  363. "{y}-{m}-{d}"
  364. );
  365. this.queryParams.page = 1;
  366. this.queryParams.limit = 15;
  367. this.getRecordList(this.queryParams);
  368. },
  369. jump: function(val) {
  370. this.$emit("record", val);
  371. this.$router.push({
  372. path: "/details",
  373. query: {
  374. patient_id: val.patient_id,
  375. date: val.dialysis_date
  376. }
  377. });
  378. }
  379. },
  380. components: {
  381. Popover
  382. }
  383. };
  384. </script>
  385. <style style="stylesheet/scss" lang="scss" scoped>
  386. .choice {
  387. border-bottom: 1px #e5e5e5 solid;
  388. ul {
  389. @include display-flex;
  390. @include align-items-center;
  391. @include text-align;
  392. @include justify-content-between;
  393. width: 70%;
  394. margin: 0 auto;
  395. font-size: 0.32rem;
  396. color: $pgh-color;
  397. li {
  398. @include display-flex;
  399. @include align-items-center;
  400. @include text-align;
  401. padding: 0.3rem 0;
  402. .iconfont {
  403. margin: 0 0.1rem;
  404. }
  405. .line {
  406. background: #a8b3ba;
  407. width: 0.2rem;
  408. height: 1px;
  409. margin: 0 0.2rem;
  410. display: inline-block;
  411. }
  412. }
  413. }
  414. }
  415. .RecordTable{
  416. padding-top:0;
  417. background: #fff;
  418. min-height: calc(100vh - 180px);
  419. }
  420. .popover-demo-content{
  421. max-height: 400px;
  422. overflow-y: scroll;
  423. }
  424. </style>