血透系统pad前端

DetailsPage.vue 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <div class="mainBox">
  3. <side-bar :active_index="0"></side-bar>
  4. <div class="mainContent">
  5. <div class="navigation">
  6. <div class="goBack">
  7. <span class="back" @click="backAction()"><span class="iconfont">&#xe720;</span>返回</span>
  8. <el-popover
  9. placement="bottom"
  10. trigger="click" :disabled="true">
  11. <li slot="reference" class="name">{{ patient_name }}</li>
  12. </el-popover>
  13. </div>
  14. <div class="nav">
  15. <ul>
  16. <li v-for="(item,i) in ['病历','透析','今日']" :key="i" :class="index == i? 'active':'' " @click="ClickTab(i)" >{{item}}</li>
  17. </ul>
  18. </div>
  19. <!-- <div @click="openPicker()" class="time">
  20. {{pickerVisible}}<span class="iconfont">&#xe74a;</span>
  21. </div> -->
  22. <!-- <div class="time" style="width:1.49rem;">
  23. <span class="iconfont">2018-01-01&#xe74a;</span>
  24. </div> -->
  25. <div class="print" style="float: right">
  26. <el-button size="mini" type="primary" @click="print" icon="el-icon-printer">打印</el-button>
  27. </div>
  28. </div>
  29. <div class="Tab">
  30. <CaseHistory v-show="index==0" title="病历"></CaseHistory>
  31. <!--<check-tab v-show="index==1" title="化验单"></check-tab>-->
  32. <dialysis-tab v-show="index==1" title="透析" v-on:records="jump(val)"></dialysis-tab>
  33. <today-tab ref="today" v-show="index==2" title="今日" ></today-tab>
  34. </div>
  35. </div>
  36. <!-- <mt-datetime-picker
  37. v-model="pickerVisible"
  38. type="date"
  39. ref="picker"
  40. year-format="{value} "
  41. month-format="{value} "
  42. date-format="{value} ">
  43. </mt-datetime-picker> -->
  44. </div>
  45. </template>
  46. <script>
  47. import SideBar from "@/pages/layout/SideBar";
  48. import TodayTab from "./today/TodayTab";
  49. import DialysisTab from "./dialysis/DialysisTab";
  50. import RecordsTab from "./records/RecordsTab";
  51. import { Popover } from "vux";
  52. import CheckTab from "./dialysis/CheckTab";
  53. import {parseTime} from "@/utils"
  54. import {GetPatientInfoWithDiseases} from "@/api/patient";
  55. import { Toast } from 'vant';
  56. import CaseHistory from "./records/CaseHistory";
  57. export default {
  58. name: "DetailsPage",
  59. components: {
  60. CaseHistory,
  61. CheckTab,
  62. SideBar,
  63. TodayTab,
  64. DialysisTab,
  65. RecordsTab,
  66. Popover,
  67. },
  68. data() {
  69. return {
  70. // pickerVisible: new Date(),
  71. patient_id: 0,
  72. patient_name: "",
  73. date: 0,
  74. index: 2,
  75. patient: null,
  76. };
  77. },
  78. created() {
  79. var patient_id = this.$route.query.patient_id;
  80. var date = this.$route.query.date;
  81. var patient_name = this.$route.query.patient_name;
  82. this.patient_id = patient_id;
  83. this.date = date;
  84. this.patient_name = patient_name;
  85. this.GetPatientInfoWithDiseases(this.patient_id);
  86. },
  87. methods: {
  88. ClickTab: function(tabIndex) {
  89. this.index = tabIndex;
  90. },
  91. backAction() {
  92. this.$router.back(-1);
  93. },
  94. openPicker() {
  95. this.$refs.picker.open();
  96. },print:function () {
  97. var xtdate = parseTime(this.date, "{y}-{m}-{d}")
  98. if(this.patient != null){
  99. this.$router.push('/Print?xtdate='+xtdate+'&xtno='+this.patient.dialysis_no);
  100. }
  101. },GetPatientInfoWithDiseases(id) {
  102. GetPatientInfoWithDiseases(id).then(response=>{
  103. if (response.data.state==1) {
  104. this.patient = response.data.data.patient;
  105. }else {
  106. Toast.fail("网络异常");
  107. return false;
  108. }
  109. }).catch(() => {
  110. // on cancel
  111. Toast.fail("网络异常");
  112. return false;
  113. });
  114. },jump:function (val) {
  115. this.index = 2
  116. }
  117. }
  118. };
  119. </script>
  120. <style style="stylesheet/scss" lang="scss" scoped>
  121. .mainContent {
  122. position: relative;
  123. .navigation {
  124. @include display-flex;
  125. @include align-items-center;
  126. @include text-align;
  127. @include box-sizing;
  128. @include justify-content-between;
  129. padding: 0.3rem 0.36rem;
  130. border-bottom: 1px #e5e5e5 solid;
  131. position: fixed;
  132. top: 0;
  133. left:1.58rem;
  134. right: 0;
  135. z-index: 100;
  136. background: #fff;
  137. .nav {
  138. ul {
  139. li {
  140. float: left;
  141. font-size: 0.36rem;
  142. margin: 0 0.2rem;
  143. height: 0.64rem;
  144. line-height: 0.64rem;
  145. padding: 0 0.3rem;
  146. cursor: pointer;
  147. &.active {
  148. background: $main-color;
  149. color: #fff;
  150. border-radius: 30px;
  151. }
  152. }
  153. }
  154. }
  155. .time {
  156. cursor: pointer;
  157. .iconfont {
  158. margin-left: 0.1rem;
  159. }
  160. }
  161. }
  162. .Tab {
  163. padding-top: 63px;
  164. }
  165. }
  166. </style>