visitor-info.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Vue.component('visitor-info', {
  2. template: '<div><div class="c-f16 c-border-b pb5">就诊人信息</div>\
  3. <ul class="pl40">\
  4. <li class="h34">\
  5. <span class="fc-999 mr40 w100">就诊居民</span>\
  6. <span class="ti1">{{param.patientName}}</span>\
  7. </li>\
  8. <li class="h34">\
  9. <span class="fc-999 mr40 w100">身份证号</span>\
  10. <span class="ti1">{{handleIdcard(param.cardNo)}}</span>\
  11. </li>\
  12. <li class="h34">\
  13. <span class="fc-999 mr40 w100">社保卡号</span>\
  14. <span class="ti1">{{param.clinicCard}}</span>\
  15. </li>\
  16. <li class="h34">\
  17. <span class="fc-999 mr40 w100">手机号码</span>\
  18. <input class="bd1 ti1" v-model="param.patientPhone" placeholder="输入手机号码" />\
  19. </li>\
  20. </ul>\
  21. </div>',
  22. props: ["param"],
  23. data: function() {
  24. return {
  25. imgCode: "",
  26. text: ""
  27. }
  28. },
  29. mounted: function() {
  30. this.initValidate()
  31. },
  32. methods: {
  33. // 验证
  34. sureValue: function() {
  35. if(!isMobilePhone(visitor.phone)) {
  36. top.showErrorMessage("手机号码编辑错误!")
  37. return true
  38. }
  39. },
  40. handleIdcard: function(str) {
  41. var len = str.length
  42. if (len == 18) {
  43. return str.substr(0, 4) + '**********' + str.substr(14, 4)
  44. } else if (len == 15) {
  45. return str.substr(0, 4) + '*******' + str.substr(11, 4)
  46. }
  47. },
  48. initValidate: function() {
  49. var docInfo = JSON.parse(window.localStorage.getItem('docInfo'))
  50. var vm = this
  51. APIService.captchaWithDoctor(docInfo.jobCode, {
  52. }).then(function(res) {
  53. if(res.status == 200) {
  54. vm.imgCode = "data:image/png;base64,"+ res.data.image
  55. vm.param.key = res.data.key
  56. } else {
  57. }
  58. }).catch(function(e) {
  59. })
  60. },
  61. }
  62. })