detail.vue 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="cnt_wrapper">
  3. <view class="wrap">
  4. <view class="p_title">
  5. <view style="margin-left: 30rpx;">
  6. <view class="p_name">{{name}}</view>
  7. <view class="p_number">透析号:{{dialysis_no}}</view>
  8. </view>
  9. </view>
  10. <view class="p_cnt">
  11. <view class="p_cnt_list">
  12. <view>性别</view>
  13. <view>{{form.sex==1 ?'男' : '女'}}</view>
  14. </view>
  15. <view class="p_cnt_list">
  16. <view>身份证号</view>
  17. <view>{{form.ID}}</view>
  18. </view>
  19. <view class="p_cnt_list">
  20. <view>出生日期</view>
  21. <view>{{form.birthday}}</view>
  22. </view>
  23. <view class="p_cnt_list">
  24. <view>手机号</view>
  25. <view>{{form.Mobile}}</view>
  26. </view>
  27. <view class="p_cnt_list">
  28. <view>地址</view>
  29. <view>{{form.address}}</view>
  30. </view>
  31. <!-- <view class="p_cnt_list">
  32. <view>绑定医院</view>
  33. <view>{{form.hospital}}</view>
  34. </view> -->
  35. </view>
  36. <!-- <view class="delete_btn" @click="deleteP">
  37. <button>删除就诊人</button>
  38. </view> -->
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import { getRecord,getOrg } from '@/api/api.js';
  44. export default {
  45. data() {
  46. return {
  47. form:{
  48. sex:'',
  49. birthday:'',
  50. ID:'',
  51. Mobile:'',
  52. address:'',
  53. hospital:''
  54. },
  55. dialysis_no:'',
  56. name:'',
  57. }
  58. },
  59. onLoad(){
  60. this.name = this.$store.state.data.userInfo.name
  61. this.dialysis_no = this.$store.state.data.userInfo.dialysis_no
  62. this.form={
  63. sex: this.$store.state.data.userInfo.gender,
  64. ID: this.$store.state.data.userInfo.id_card_no,
  65. Mobile: this.$store.state.data.userInfo.phone,
  66. address: this.$store.state.data.userInfo.home_address,
  67. }
  68. let hospital = this.$store.state.data.userInfo.id
  69. this.getOrg(hospital)
  70. this.getIdInfo(this.form.ID)
  71. },
  72. methods: {
  73. // 删除就诊人
  74. // deleteP() {
  75. // },
  76. async getOrg(patient_id){
  77. let params = {
  78. patient_id:patient_id
  79. }
  80. let res = await getOrg(params)
  81. console.log('zzzzz',res);
  82. this.form.hospital = res.data.data.orgInfo.org_name
  83. console.log(this.form);
  84. // return this.form.hospital
  85. },
  86. getIdInfo(cardNo) {
  87. var reg = /(^\d{15}$)|(^\d{17}([0-9]|X)$)/; //验证身份证号码的正则
  88. if(reg.test(cardNo)){ // 身份证号码是否合法
  89. var birthday = "";
  90. var gender = "";
  91. if (cardNo.length == 15) {
  92. var org_birthday = cardNo.substring(6, 12);
  93. var org_gender = cardNo.substring(14, 15);
  94. birthday = "19" + org_birthday.substring(0, 2) + "-"
  95. + org_birthday.substring(2, 4) + "-"
  96. + org_birthday.substring(4, 6);
  97. } else if (cardNo.length == 18) {
  98. var org_birthday = cardNo.substring(6, 14);
  99. var org_gender = cardNo.substring(16, 17);
  100. birthday = org_birthday.substring(0, 4) + "-"
  101. + org_birthday.substring(4, 6) + "-"
  102. + org_birthday.substring(6, 8);
  103. }
  104. this.form.birthday=birthday
  105. }else{
  106. return false;
  107. }
  108. },
  109. }
  110. }
  111. </script>
  112. <style>
  113. page {
  114. height: 100%;
  115. background-color: #f3f3f9;
  116. }
  117. .cnt_wrapper {
  118. margin: 0;
  119. padding: 0;
  120. }
  121. .p_title {
  122. width: 93vw;
  123. height: 140rpx;
  124. display: flex;
  125. align-items: center;
  126. margin: 20rpx auto;
  127. margin-top: 30rpx;
  128. border-radius: 10rpx;
  129. background: #fff;
  130. }
  131. .p_title .p_name {
  132. font-weight: bold;
  133. }
  134. .p_title .p_number {
  135. font-size: 24rpx;
  136. line-height: 50rpx;
  137. color: #999999;
  138. }
  139. .p_cnt {
  140. width: 93vw;
  141. margin: 20rpx auto;
  142. border-radius: 10rpx;
  143. background: #fff;
  144. }
  145. .p_cnt_list {
  146. height: 60rpx;
  147. padding: 10rpx 40rpx;
  148. display: flex;
  149. justify-content: space-between;
  150. align-items: center;
  151. font-size: 30rpx;
  152. font-weight: bold;
  153. }
  154. .delete_btn {
  155. width: 93vw;
  156. margin: 0 auto;
  157. }
  158. .delete_btn button {
  159. background: #fff;
  160. color: #ff3d71;
  161. box-shadow: 0px 2px 11px 0px rgba(211, 211, 234, 0.43);
  162. font-size: 30rpx;
  163. height: 88rpx;
  164. line-height: 88rpx;
  165. }
  166. </style>