basicInfo.vue 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <div class="page_basicInfo">
  3. <div class="basicOne">
  4. <p class="basicLable">患者姓名:</p>
  5. <el-input placeholder="请输入内容" v-model="form.name" :disabled="true"></el-input>
  6. <el-button type="primary" v-clipboard:copy="form.name" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  7. </div>
  8. <div class="basicOne">
  9. <p class="basicLable">透析编号:</p>
  10. <el-input placeholder="请输入内容" v-model="form.dialysis_no" :disabled="true"></el-input>
  11. <el-button type="primary" v-clipboard:copy="form.dialysis_no" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  12. </div>
  13. <div class="basicOne">
  14. <p class="basicLable">证件类型:</p>
  15. <el-input placeholder="请输入内容" v-model="form.type" :disabled="true"></el-input>
  16. </div>
  17. <div class="basicOne">
  18. <p class="basicLable">证件号码:</p>
  19. <el-input style="width:170px;" placeholder="请输入内容" v-model="form.id_card_no" :disabled="true"></el-input>
  20. <el-button type="primary" v-clipboard:copy="form.id_card_no" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  21. </div>
  22. <div class="basicOne">
  23. <p class="basicLable">首次透析时间:</p>
  24. <el-input placeholder="请输入内容" v-model="form.first_dialysis_date" :disabled="true"></el-input>
  25. <el-button type="primary" v-clipboard:copy="form.first_dialysis_date" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  26. </div>
  27. <div class="basicOne">
  28. <p class="basicLable">性别:</p>
  29. <el-input placeholder="请输入内容" v-model="form.gender" :disabled="true"></el-input>
  30. </div>
  31. <div class="basicOne">
  32. <p class="basicLable">生日:</p>
  33. <el-input placeholder="请输入内容" v-model="form.birthday" :disabled="true"></el-input>
  34. <el-button type="primary" v-clipboard:copy="form.birthday" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  35. </div>
  36. <div class="basicOne">
  37. <p class="basicLable">工作:</p>
  38. <el-input placeholder="请输入内容" v-model="form.work_unit" :disabled="true"></el-input>
  39. </div>
  40. <div class="basicOne">
  41. <p class="basicLable">婚姻:</p>
  42. <el-input placeholder="请输入内容" v-model="form.marital_status" :disabled="true"></el-input>
  43. </div>
  44. <div class="basicOne">
  45. <p class="basicLable">学历:</p>
  46. <el-input placeholder="请输入内容" v-model="form.education_level" :disabled="true"></el-input>
  47. </div>
  48. <div class="basicOne">
  49. <p class="basicLable">民族:</p>
  50. <el-input placeholder="请输入内容" v-model="form.nation" :disabled="true"></el-input>
  51. </div>
  52. <div class="basicOne">
  53. <p class="basicLable">工作电话:</p>
  54. <el-input placeholder="请输入内容" v-model="form.relative_phone" :disabled="true"></el-input>
  55. <el-button type="primary" v-clipboard:copy="form.relative_phone" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  56. </div>
  57. <div class="basicOne">
  58. <p class="basicLable">家庭地址:</p>
  59. <el-input placeholder="请输入内容" v-model="form.home_address" :disabled="true"></el-input>
  60. <el-button type="primary" v-clipboard:copy="form.home_address" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  61. </div>
  62. <div class="basicOne">
  63. <p class="basicLable">医保类型:</p>
  64. <el-input placeholder="请输入内容" v-model="form.reimbursement_way_id" :disabled="true"></el-input>
  65. </div>
  66. <div class="basicOne">
  67. <p class="basicLable">联系电话:</p>
  68. <el-input placeholder="请输入内容" v-model="form.phone" :disabled="true"></el-input>
  69. <el-button type="primary" v-clipboard:copy="form.phone" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  70. </div>
  71. <div class="basicOne">
  72. <p class="basicLable">姓名输入码:</p>
  73. <el-input placeholder="请输入内容" v-model="input" :disabled="true"></el-input>
  74. </div>
  75. <div class="basicOne">
  76. <p class="basicLable">随访号:</p>
  77. <el-input placeholder="请输入内容" v-model="input" :disabled="true"></el-input>
  78. </div>
  79. <div class="basicOne">
  80. <p class="basicLable">传染病检查结果:</p>
  81. <el-input placeholder="请输入内容" v-model="form.is_infectious" :disabled="true"></el-input>
  82. <el-button type="primary" v-clipboard:copy="form.is_infectious" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import { parseTime } from "@/utils";
  88. import { getDataConfig } from "@/utils/data";
  89. import { isNumber } from 'util';
  90. export default {
  91. props:{
  92. patient:Object
  93. },
  94. data(){
  95. return{
  96. input:'',
  97. form:{
  98. name:'',
  99. dialysis_no:'',
  100. type:'身份证',
  101. id_card_no:'',
  102. first_dialysis_date:'',
  103. gender:'',
  104. birthday:'',
  105. work_unit:'',
  106. marital_status:'',
  107. education_level:'',
  108. nation:'',
  109. relative_phone:'',
  110. home_address:'',
  111. reimbursement_way_id:'',
  112. phone:'',
  113. is_infectious:''
  114. },
  115. educationOptions:[],
  116. wayOptions:[]
  117. }
  118. },
  119. created(){
  120. console.log('patient',this.patient)
  121. this.form = this.patient
  122. this.getUpdate()
  123. },
  124. methods:{
  125. getEducation(id){
  126. this.educationOptions = getDataConfig("patient", "education_types")
  127. let name = ''
  128. this.educationOptions.map(item => {
  129. if(item.id == id){
  130. name = item.name
  131. }
  132. })
  133. return name
  134. },
  135. getReimbursement(id){
  136. this.wayOptions = getDataConfig("patient", "reimbursement_ways")
  137. let name = ''
  138. this.wayOptions.map(item => {
  139. if(item.id == id){
  140. name = item.name
  141. }
  142. })
  143. return name
  144. },
  145. getUpdate(){
  146. this.$set(this.form, 'type', '身份证')
  147. this.$forceUpdate()
  148. if(isNumber(this.form.first_dialysis_date)){
  149. this.form.first_dialysis_date = parseTime(this.form.first_dialysis_date, '{y}-{m}-{d}')
  150. }
  151. if(this.form.gender == 1){
  152. this.form.gender = '男'
  153. }else if(this.form.gender == 2){
  154. this.form.gender = '女'
  155. }else if(this.form.gender == 0){
  156. this.form.gender = ''
  157. }
  158. if(isNumber(this.form.birthday)){
  159. this.form.birthday = parseTime(this.form.birthday, '{y}-{m}-{d}')
  160. }
  161. if(this.form.marital_status == 1){
  162. this.form.marital_status = '未婚'
  163. }else if(this.form.marital_status == 2){
  164. this.form.marital_status = '已婚'
  165. }else if(this.form.marital_status == 3){
  166. this.form.marital_status = '离异'
  167. }else if(this.form.marital_status == 0){
  168. this.form.marital_status = ''
  169. }
  170. if(isNumber(this.form.education_level)){
  171. if(this.form.education_level == 0){
  172. this.form.education_level = ''
  173. }else{
  174. this.form.education_level = this.getEducation(this.form.education_level)
  175. }
  176. }
  177. if(isNumber(this.form.reimbursement_way_id)){
  178. if(this.form.reimbursement_way_id == 0){
  179. this.form.reimbursement_way_id = ''
  180. }else{
  181. this.form.reimbursement_way_id = this.getReimbursement(this.form.reimbursement_way_id)
  182. }
  183. }
  184. },
  185. onCopy() {
  186. this.$message.success("复制成功");
  187. },
  188. onError() {
  189. this.$message.success("复制失败,请重试");
  190. }
  191. },
  192. watch:{
  193. patient:{
  194. handler:function(val) {
  195. console.log(1111111111111,val)
  196. Object.keys(val).map((item,index) => {
  197. this.$set(this.form, item, val[item])
  198. this.$forceUpdate()
  199. })
  200. this.getUpdate()
  201. }
  202. },
  203. // immediate:true,
  204. deep:true,
  205. }
  206. }
  207. </script>
  208. <style lang="scss" scoped>
  209. .page_basicInfo{
  210. width: 100%;
  211. padding-right: 20px;
  212. margin-top: 10px;
  213. display: flex;
  214. flex-wrap: wrap;
  215. .basicOne{
  216. width: 380px;
  217. margin-right: 10px;
  218. margin-bottom: 10px;
  219. display: flex;
  220. align-items: center;
  221. font-size: 14px;
  222. color:rgb(48, 49, 51);
  223. .basicLable{
  224. width: 120px;
  225. text-align: right;
  226. margin-right: 10px;
  227. }
  228. }
  229. }
  230. </style>
  231. <style lang="scss">
  232. .page_basicInfo{
  233. .el-input{
  234. width: 150px;
  235. margin-right: 10px;
  236. }
  237. }
  238. .el-input.is-disabled .el-input__inner{
  239. color:#909399;
  240. }
  241. .el-textarea.is-disabled .el-textarea__inner{
  242. color:#909399;
  243. }
  244. </style>