treatment-patient.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. Vue.component('treatment-patient', {
  2. template: '<div><div class="c-f16 c-border-b pb5">就诊人信息</div>\
  3. <table class="table table-no-bordered">\
  4. <tbody>\
  5. <tr>\
  6. <td class="w150">就诊居民</td>\
  7. <td>{{appointinfo.name}}</td>\
  8. </tr>\
  9. <tr>\
  10. <td class="w150">身份证号</td>\
  11. <td>{{handleIdcard(appointinfo.idcard)}}</td>\
  12. </tr>\
  13. <tr>\
  14. <td class="w150">社保卡号</td>\
  15. <td >{{appointinfo.ssc}}</td>\
  16. </tr>\
  17. <tr>\
  18. <td class="w150">手机号码</td>\
  19. <td >{{appointinfo.phone}}</td>\
  20. </tr>\
  21. </tbody>\
  22. </table>\
  23. <div class="c-t-center">\
  24. <button @click="remove" type="button" class="btn btn-w-m btn-ff3b30 mr15" v-show="appointinfo.status != 0">取消挂号</button>\
  25. <button @click="goBack" type="button" class="btn btn-w-m btn-fff">返回</button>\
  26. </div>\
  27. </div>',
  28. props: ["appointinfo"],
  29. data: function() {
  30. return {
  31. editable: false
  32. }
  33. },
  34. mounted: function() {
  35. },
  36. methods: {
  37. remove: function() {
  38. var vm = this
  39. var layerid = top.layer.confirm('请与居民确认:<br>一个月内连续取消预约三次,系统会自动将居民年列入黑名单,三个月后才 可再次预约。', {
  40. title: '取消预约',
  41. closeBtn: true,
  42. btn: ['确定','取消'] //按钮
  43. }, function(){
  44. var loadingid = top.layer.load(1, {
  45. shade: [0.1,'#fff'] //0.1透明度的白色背景
  46. });
  47. APIService.cancelOrder(param).then(function(res) {
  48. top.layer.close(loadingid)
  49. if(res.status == 200) {
  50. top.layer.close(layerid)
  51. top.showSuccessMessage("取消预约成功!")
  52. closeLayer()
  53. EventBus.$emit('appointment-search',{
  54. data: kwObj
  55. })
  56. } else {
  57. top.showErrorMessage(res.msg || "取消预约失败!")
  58. }
  59. }).catch(function(e) {
  60. top.layer.close(loadingid)
  61. console && console.error(e)
  62. })
  63. }, function(){
  64. });
  65. },
  66. goBack: function() {
  67. var layerid = parent.layer.getFrameIndex(window.name)
  68. parent.layer.close(layerid)
  69. },
  70. handleIdcard: function(str) {
  71. var len = str.length
  72. if (len == 18) {
  73. return str.substr(0, 4) + '**********' + str.substr(14, 4)
  74. } else if (len == 15) {
  75. return str.substr(0, 4) + '*******' + str.substr(11, 4)
  76. }
  77. }
  78. }
  79. })