血透系统pad前端

InspectionItemTable.vue 9.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <template>
  2. <div>
  3. <div class="blueBorder"></div>
  4. <van-list
  5. v-model="loading"
  6. :finished="finished"
  7. finished-text=" "
  8. @load="onLoad"
  9. >
  10. <table class="table">
  11. <tr>
  12. <th width="20%">检查项目</th>
  13. <th width="10%">结果</th>
  14. <th width="10%">参考值</th>
  15. <th width="10%">单位</th>
  16. </tr>
  17. </table>
  18. <table
  19. class="table"
  20. v-for="(items, indexs) in inspections_item"
  21. :key="indexs"
  22. >
  23. <tr>
  24. <td width="20%">{{ items.date }}</td>
  25. <td width="10%"></td>
  26. <td width="10%"></td>
  27. <td width="10%"></td>
  28. </tr>
  29. <tr
  30. class="table"
  31. v-for="(item, index) in items.inspection_show_item"
  32. :key="index"
  33. >
  34. <td width="20%">{{ item.item_name }}</td>
  35. <td width="10%">{{ item.value }}</td>
  36. <td width="10%" v-if="item.range_type == 1">
  37. {{ item.range_min }} ~ {{ item.range_max }}
  38. </td>
  39. <td width="10%" v-else>{{ item.range_value }}</td>
  40. <td width="10%">{{ item.unit }}</td>
  41. </tr>
  42. <tr
  43. v-if="items.isExpand"
  44. class="table"
  45. v-for="(item, index) in items.inspection_hide_item"
  46. :key="index"
  47. >
  48. <td width="20%">{{ item.item_name }}</td>
  49. <td width="10%">{{ item.value }}</td>
  50. <td width="10%">{{ item.range_min }} ~ {{ item.range_max }}</td>
  51. <td width="10%">{{ item.unit }}</td>
  52. </tr>
  53. <tr>
  54. <td width="20%"></td>
  55. <td
  56. width="10%"
  57. style="color:#409EFF;"
  58. @click="expandTable(indexs)"
  59. v-model="isExpand"
  60. >
  61. {{ items.expandName }}
  62. </td>
  63. <td width="10%"></td>
  64. <td width="10%"></td>
  65. </tr>
  66. </table>
  67. <div class="NoData" v-show="inspections_item.length == 0">
  68. <img
  69. style="margin-top: 50px; margin-bottom: 50px"
  70. src="@/assets/login/data.jpg"
  71. alt
  72. />
  73. </div>
  74. </van-list>
  75. </div>
  76. </template>
  77. <script>
  78. import { parseTime } from "@/utils";
  79. import { GetInspectionItemValue } from "@/api/check";
  80. export default {
  81. name: "InspectionItemTable",
  82. created() {},
  83. data() {
  84. return {
  85. items: [],
  86. inspections: [],
  87. inspectionsMap: {},
  88. inspections_item: [],
  89. showItem: [],
  90. hideItem: [],
  91. expandNum: 5,
  92. loading: true,
  93. finished: false,
  94. isShow: 1,
  95. key: 0,
  96. project: null,
  97. isExpand: false,
  98. queryParams: {
  99. project_id: 0,
  100. page: 0,
  101. patient_id: 0
  102. }
  103. };
  104. },
  105. methods: {
  106. onLoad() {
  107. this.queryParams.page = this.queryParams.page + 1;
  108. GetInspectionItemValue(this.queryParams).then(response => {
  109. if (response.data.state == 0) {
  110. this.finished = true;
  111. this.loading = false;
  112. return false;
  113. } else {
  114. this.items = [];
  115. var inspections = response.data.data.inspections;
  116. this.inspections = response.data.data.inspections;
  117. if (inspections == null) {
  118. this.inspections = [];
  119. this.finished = true;
  120. this.loading = false;
  121. return false;
  122. }
  123. var inspections_item_map = {};
  124. inspections_item_map["date"] = response.data.data.date;
  125. var inspectionsMap = {};
  126. this.inspectionsMap = {};
  127. for (var index in inspections) {
  128. inspectionsMap[inspections[index].item_id] = inspections[index];
  129. this.inspectionsMap[inspections[index].item_id] =
  130. inspections[index];
  131. }
  132. var items = this.project.inspection_reference;
  133. for (var index in items) {
  134. if (items[index].id in inspectionsMap) {
  135. var item = {};
  136. for (var key in items[index]) {
  137. item[key] = items[index][key];
  138. }
  139. item.value = inspectionsMap[items[index].id].inspect_value;
  140. item.value_direction = "";
  141. if (item.range_type == 1) {
  142. var value = parseFloat(item.value);
  143. var range_min = parseFloat(item.range_min);
  144. var range_max = parseFloat(item.range_max);
  145. if (value < range_min) {
  146. item.value_direction = "↓";
  147. } else if (value > range_max) {
  148. item.value_direction = "↑";
  149. }
  150. }
  151. this.items.push(item);
  152. }
  153. }
  154. this.showItem = [];
  155. this.hideItem = [];
  156. for (let i = 0; i < this.items.length; i++) {
  157. if (i < this.expandNum) {
  158. this.showItem.push(this.items[i]);
  159. } else {
  160. this.hideItem.push(this.items[i]);
  161. }
  162. }
  163. inspections_item_map["isExpand"] = false;
  164. inspections_item_map["inspection_show_item"] = this.showItem;
  165. inspections_item_map["expandName"] = "展开";
  166. inspections_item_map["inspection_hide_item"] = this.hideItem;
  167. this.inspections_item.push(inspections_item_map);
  168. this.loading = false;
  169. }
  170. });
  171. },
  172. GetList(project_id, project) {
  173. this.finished = false;
  174. this.loading = true;
  175. this.project = project;
  176. this.queryParams.patient_id = this.$route.query.patient_id;
  177. this.queryParams.project_id = project_id;
  178. this.inspections_item = [];
  179. this.queryParams.page = 0;
  180. this.onLoad();
  181. },
  182. expandTable: function(index) {
  183. if (!this.isExpand) {
  184. this.isExpand = true;
  185. for (let i = 0; i < this.inspections_item.length; i++) {
  186. if (i == index) {
  187. this.inspections_item[i].isExpand = true;
  188. this.inspections_item[i].expandName = "收起";
  189. }
  190. }
  191. } else {
  192. this.isExpand = false;
  193. for (let i = 0; i < this.inspections_item.length; i++) {
  194. if (i == index) {
  195. this.inspections_item[i].isExpand = false;
  196. this.inspections_item[i].expandName = "展开";
  197. }
  198. }
  199. }
  200. }
  201. }
  202. };
  203. </script>
  204. <style style="stylesheet/scss" lang="scss" scoped>
  205. .top {
  206. padding: 0.28rem 0.3rem;
  207. @include text-align;
  208. font-size: 0.3rem;
  209. border-bottom: 1px #e5e5e5 solid;
  210. position: relative;
  211. .title {
  212. font-size: 0.3rem;
  213. font-weight: bold;
  214. color: $pgh-color;
  215. }
  216. .iconfont {
  217. font-size: 0.24rem;
  218. color: #a8b3ba;
  219. }
  220. }
  221. .search {
  222. background: #ebf1f7;
  223. border-radius: 30px;
  224. padding: 0.01rem 0.2rem;
  225. color: #a8b3ba;
  226. position: absolute;
  227. top: 0.15rem;
  228. right: 0.4rem;
  229. .iconfont {
  230. color: #a8b3ba;
  231. font-size: 0.32rem;
  232. }
  233. .searchInput {
  234. font-size: 0.28rem;
  235. border: none;
  236. outline: none;
  237. background: #ebf1f7;
  238. height: 0.6rem;
  239. line-height: 0.6rem;
  240. width: 80%;
  241. }
  242. }
  243. .choice {
  244. border-bottom: 1px #e5e5e5 solid;
  245. ul {
  246. @include display-flex;
  247. @include align-items-center;
  248. @include text-align;
  249. @include justify-content-between;
  250. width: 30%;
  251. margin: 0 auto;
  252. font-size: 0.28rem;
  253. color: #7b8a97;
  254. li {
  255. @include display-flex;
  256. @include align-items-center;
  257. @include text-align;
  258. @include justify-content-between;
  259. padding: 0.16rem 0;
  260. .iconfont {
  261. margin: 0 0.1rem;
  262. }
  263. .line {
  264. background: #a8b3ba;
  265. width: 0.2rem;
  266. height: 1px;
  267. margin: 0 0.2rem;
  268. display: inline-block;
  269. }
  270. }
  271. }
  272. }
  273. .table {
  274. width: 100%;
  275. overflow: hidden;
  276. font-size: 0.45rem;
  277. text-align: center;
  278. border: $border-color;
  279. tr {
  280. padding: 0;
  281. margin: 0;
  282. padding: 0.1rem 0;
  283. th {
  284. background: $main-color;
  285. border: none;
  286. color: #fff;
  287. padding: 0;
  288. margin: 0;
  289. height: 1.2rem;
  290. line-height: 1.2rem;
  291. font-weight: normal;
  292. }
  293. td {
  294. border: none;
  295. span {
  296. background: #ff7979;
  297. color: #fff;
  298. font-size: 0.28rem;
  299. height: 0.5rem;
  300. line-height: 0.5rem;
  301. display: inline-block;
  302. border-radius: 6px;
  303. width: 1.75rem;
  304. margin: 0 0.1rem;
  305. }
  306. }
  307. }
  308. }
  309. .van-list {
  310. background: #fff;
  311. min-height: calc(100vh - 178px);
  312. margin-top: 68px;
  313. // @media only screen and (min-width: 376px) and (max-width: 668px) {
  314. // margin-top: 84px;
  315. // }
  316. // @media only screen and (min-width: 415px) and (max-width: 736px) {
  317. // margin-top: 84px !important;
  318. // }
  319. // @media only screen and (max-width: 812px) {
  320. // margin-top: 80px !important;
  321. // }
  322. @media only screen and (min-width: 500px) {
  323. margin-top: 140px !important;
  324. }
  325. // @media only screen and (min-width: 813px) and (max-width: 1023px) {
  326. // margin-top: 114px !important;
  327. // }
  328. // @media only screen and (min-width: 1024px) {
  329. // margin-top: 96px !important;
  330. // }
  331. }
  332. </style>
  333. <style lang="scss">
  334. .nav {
  335. .van-ellipsis {
  336. font-size: 0.4rem;
  337. }
  338. }
  339. .van-tabs__line {
  340. background: #409eff !important;
  341. }
  342. </style>