血透系统pad前端

DetailsPage.vue 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <div class="mainBox">
  3. <div class="mainContent">
  4. <div class="navigation">
  5. <div class="goBack">
  6. <span class="back" @click="backAction()">
  7. <span class="iconfont">&#xe720;</span>返回
  8. </span>
  9. <el-popover placement="bottom" trigger="click" :disabled="true">
  10. <li slot="reference" class="name">{{ patient_name }}</li>
  11. </el-popover>
  12. </div>
  13. <div class="nav">
  14. <ul>
  15. <li
  16. v-for="(item, i) in ['病历', '透析', '今日']"
  17. :key="i"
  18. :class="index == i ? 'active' : ''"
  19. @click="ClickTab(i)"
  20. >
  21. {{ item }}
  22. </li>
  23. </ul>
  24. </div>
  25. <!-- <div @click="openPicker()" class="time">
  26. {{pickerVisible}}<span class="iconfont">&#xe74a;</span>
  27. </div>-->
  28. <!-- <div class="time" style="width:1.49rem;">
  29. <span class="iconfont">2018-01-01&#xe74a;</span>
  30. </div>-->
  31. <div class="print" style="float: right; display:none">
  32. <el-button
  33. size="mini"
  34. type="primary"
  35. @click="print"
  36. icon="el-icon-printer"
  37. >打印</el-button
  38. >
  39. </div>
  40. </div>
  41. <div class="Tab">
  42. <CaseHistory v-show="index == 0" title="病历"></CaseHistory>
  43. <!--<check-tab v-show="index==1" title="化验单"></check-tab>-->
  44. <dialysis-tab
  45. v-show="index == 1"
  46. title="透析"
  47. v-on:records="jump(val)"
  48. ></dialysis-tab>
  49. <today-tab ref="today" v-show="index == 2" title="今日"></today-tab>
  50. </div>
  51. </div>
  52. <div class="add" @click="print">
  53. <p>打印预览</p>
  54. </div>
  55. <side-bar :active_index="0"></side-bar>
  56. <!-- <mt-datetime-picker
  57. v-model="pickerVisible"
  58. type="date"
  59. ref="picker"
  60. year-format="{value} "
  61. month-format="{value} "
  62. date-format="{value} ">
  63. </mt-datetime-picker>-->
  64. </div>
  65. </template>
  66. <script>
  67. import SideBar from "@/pages/layout/SideBar";
  68. import TodayTab from "./today/TodayTab";
  69. import DialysisTab from "./dialysis/DialysisTab";
  70. import RecordsTab from "./records/RecordsTab";
  71. import { Popover } from "vux";
  72. import CheckTab from "./dialysis/CheckTab";
  73. import { parseTime } from "@/utils";
  74. import { GetPatientInfoWithDiseases } from "@/api/patient";
  75. import { Toast } from "vant";
  76. import CaseHistory from "./records/CaseHistory";
  77. export default {
  78. name: "DetailsPage",
  79. components: {
  80. CaseHistory,
  81. CheckTab,
  82. SideBar,
  83. TodayTab,
  84. DialysisTab,
  85. RecordsTab,
  86. Popover
  87. },
  88. data() {
  89. return {
  90. // pickerVisible: new Date(),
  91. patient_id: 0,
  92. patient_name: "",
  93. date: 0,
  94. index: 2,
  95. patient: null
  96. };
  97. },
  98. created() {
  99. var patient_id = this.$route.query.patient_id;
  100. var date = this.$route.query.date;
  101. var patient_name = this.$route.query.patient_name;
  102. this.patient_id = patient_id;
  103. this.date = date;
  104. this.patient_name = patient_name;
  105. this.GetPatientInfoWithDiseases(this.patient_id);
  106. },
  107. methods: {
  108. ClickTab: function(tabIndex) {
  109. this.index = tabIndex;
  110. },
  111. backAction() {
  112. this.$router.back(-1);
  113. },
  114. openPicker() {
  115. this.$refs.picker.open();
  116. },
  117. print: function() {
  118. var xtdate = parseTime(this.date, "{y}-{m}-{d}");
  119. if (this.patient != null) {
  120. this.$router.push(
  121. "/Print?xtdate=" + xtdate + "&xtno=" + this.patient.dialysis_no
  122. );
  123. }
  124. },
  125. GetPatientInfoWithDiseases(id) {
  126. GetPatientInfoWithDiseases(id)
  127. .then(response => {
  128. if (response.data.state == 1) {
  129. this.patient = response.data.data.patient;
  130. } else {
  131. Toast.fail("网络异常");
  132. return false;
  133. }
  134. })
  135. .catch(() => {
  136. // on cancel
  137. Toast.fail("网络异常");
  138. return false;
  139. });
  140. },
  141. jump: function(val) {
  142. this.index = 2;
  143. },
  144. toMyPatients() {
  145. var patient_id = this.$route.query.patient_id;
  146. this.$router.push("/mypatients/" + patient_id);
  147. }
  148. }
  149. };
  150. </script>
  151. <style style="stylesheet/scss" lang="scss" scoped>
  152. .mainBox {
  153. display: flex;
  154. flex-direction: column;
  155. height: 100%;
  156. overflow-x: hidden;
  157. > :first-child {
  158. flex: 1;
  159. overflow-x: hidden;
  160. }
  161. }
  162. .mainContent {
  163. position: relative;
  164. .navigation {
  165. @include display-flex;
  166. @include align-items-center;
  167. @include text-align;
  168. @include box-sizing;
  169. @include justify-content-between;
  170. padding: 0.3rem 0.36rem;
  171. // border-bottom: 1px #e5e5e5 solid;
  172. position: fixed;
  173. top: 0;
  174. left: 0;
  175. right: 0;
  176. z-index: 100;
  177. background: #258ffc;
  178. -webkit-transform:translateZ(1px);
  179. -moz-transform:translateZ(1px);
  180. -o-transform:translateZ(1px);
  181. transform:translateZ(1px);
  182. @media only screen and (max-width: 320px) {
  183. display: -webkit-box;
  184. }
  185. .name {
  186. color: #fff;
  187. }
  188. .nav {
  189. margin-right: 2.4rem;
  190. @media only screen and (min-width: 768px) {
  191. margin-right: 4rem;
  192. }
  193. ul {
  194. li {
  195. float: left;
  196. font-size: 0.45rem;
  197. margin: 0 0.2rem;
  198. height: 0.7rem;
  199. line-height: 0.7rem;
  200. padding: 0 0.3rem;
  201. cursor: pointer;
  202. color: #fff;
  203. &.active {
  204. // background: $main-color;
  205. background: #fff;
  206. color: #258ffc;
  207. // color: #fff;
  208. border-radius: 30px;
  209. }
  210. }
  211. }
  212. }
  213. .time {
  214. cursor: pointer;
  215. .iconfont {
  216. margin-left: 0.1rem;
  217. }
  218. }
  219. }
  220. .Tab {
  221. padding-top: 63px;
  222. // padding-bottom: 0.25rem;
  223. @media only screen and (max-width: 812px) {
  224. padding-top: 42px !important;
  225. }
  226. }
  227. }
  228. .add {
  229. width: 1.6rem;
  230. height: 1.6rem;
  231. background: #f18f68;
  232. // box-shadow: 0px 3px 9px 0px rgba(7, 30, 102, 0.15);
  233. border-radius: 50%;
  234. position: fixed;
  235. right: 0.6rem;
  236. bottom: 2.25rem;
  237. font-size: 0.34rem;
  238. text-align: center;
  239. @media only screen and (max-width: 767px) {
  240. display: none;
  241. }
  242. p {
  243. width: 30px;
  244. text-align: center;
  245. margin: 9px auto 0;
  246. color: #fff;
  247. // @media only screen and (min-width: 768px) {
  248. // width: 40px !important;
  249. // margin: 11px auto 0;
  250. // }
  251. @media only screen and (min-width: 768px) {
  252. width: 50px;
  253. margin: 17px auto 0;
  254. }
  255. }
  256. }
  257. </style>