血透系统pad前端

DetailsPage.vue 6.5KB

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