血透系统pad前端

RecordTable.vue 17KB

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