血透系统pad前端

RecordTable.vue 18KB

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