index.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // 慢阻肺患者档案表格组件
  2. var template = ''
  3. $.ajax('../../../component/statistics/CopdPatientRecord/index.html', {
  4. data: {},
  5. dataType: 'html',
  6. cache: false,
  7. timeout: 60000,
  8. async: false,
  9. error: function (res) {},
  10. success: function (res) {
  11. template = res
  12. }
  13. })
  14. Vue.component('copd-patient-record', {
  15. template: template,
  16. props: [],
  17. data() {
  18. return {
  19. dataList: [
  20. {
  21. name: '张三',
  22. nationality: '中国',
  23. ethnicity: '汉族',
  24. idType: '身份证',
  25. idNumber: '310************1234',
  26. gender: '男',
  27. birthdate: '1990-01-01',
  28. age: '32',
  29. contactNumber: '13812345678',
  30. permanentAddress: '上海市浦东新区',
  31. registeredAddress: '江苏省南京市',
  32. occupation: '工程师',
  33. maritalStatus: '已婚',
  34. medicalInsuranceType: '城镇职工基本医疗保险',
  35. transferStatus: '已下转',
  36. receiveStatus: '已接收',
  37. receivingHospital: '上海市第一人民医院',
  38. receivingDoctor: '李医生',
  39. recordStatus: '正常',
  40. survivalStatus: '存活',
  41. deathDate: ''
  42. }
  43. ],
  44. // 当前编辑的数据,点击编辑按钮后设置,取消或退出则清空
  45. currentEditData: null,
  46. // 编辑页面是否显示
  47. editViewVisable: false,
  48. //服务记录是否显示
  49. serviceRecordVisable: false,
  50. // 健康档案是否显示
  51. healthRecordVisable: false
  52. }
  53. },
  54. computed: {
  55. showTotalTable() {
  56. return (
  57. (this.currentEditData == null && this.editViewVisable == false) &&
  58. this.serviceRecordVisable == false &&
  59. this.healthRecordVisable == false
  60. )
  61. },
  62. showEditView() {
  63. return this.currentEditData && this.editViewVisable
  64. }
  65. },
  66. mounted() {
  67. var vm = this
  68. EventBus.$on('copd-reset-select', function () {
  69. vm.currentEditData = null
  70. vm.editViewVisable = false
  71. vm.serviceRecordVisable = false
  72. vm.healthRecordVisable = false
  73. })
  74. },
  75. destroyed() {
  76. EventBus.$off('copd-reset-select')
  77. },
  78. methods: {
  79. onClickEdit(record) {
  80. if (!record) {
  81. return
  82. }
  83. this.currentEditData = record
  84. this.editViewVisable = true
  85. },
  86. onClickServiceRecord(record) {
  87. this.serviceRecordVisable = true
  88. },
  89. onClickHealthRecord(record) {
  90. this.healthRecordVisable = true
  91. }
  92. }
  93. })