index.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. var template = ''
  2. $.ajax('../../../component/statistics/LascCervicalHistopathologyFollowup/index.html', {
  3. data: {},
  4. dataType: 'html',
  5. cache: false,
  6. timeout: 60000,
  7. async: false,
  8. error: function (res) {},
  9. success: function (res) {
  10. template = res
  11. }
  12. })
  13. Vue.component('lasc-cervical-histopathology-followup', {
  14. props: ['data'],
  15. data: function () {
  16. return {
  17. readonlyTwo: 1,
  18. readonly: true,
  19. pickType: '',
  20. curItem: '',
  21. isShowDatePicker: false,
  22. date: '',
  23. minDate: '',
  24. form: {
  25. screenId: '', //两癌筛查id
  26. list: []
  27. }
  28. }
  29. },
  30. template: template,
  31. created: function () {
  32. var vm = this
  33. this.form.screenId = this.data.screenId
  34. if (this.data.value && this.data.value.length) {
  35. var form = JSON.parse(JSON.stringify(this.data.value))
  36. if (vm.isStrEmpty(form[0].examineStatus)) {
  37. this.form.list = _.map(form, function (v) {
  38. return _.assign(vm.getDefItem(), v)
  39. })
  40. } else {
  41. _.each(form, function (m) {
  42. m.examineResultAbnorma = m.examineResultAbnorma.split(',')
  43. })
  44. this.form.list = form
  45. }
  46. }
  47. },
  48. watch:{
  49. data:{
  50. handler(newVal,oldVal){
  51. var vm = this
  52. this.form.screenId = this.data.screenId
  53. if (this.data.value && this.data.value.length) {
  54. var form = JSON.parse(JSON.stringify(this.data.value))
  55. if (vm.isStrEmpty(form[0].examineStatus)) {
  56. this.form.list = _.map(form, function (v) {
  57. return _.assign(vm.getDefItem(), v)
  58. })
  59. } else {
  60. _.each(form, function (m) {
  61. m.examineResultAbnorma = m.examineResultAbnorma.split(',')
  62. })
  63. this.form.list = form
  64. }
  65. }
  66. },
  67. deep:true
  68. }
  69. },
  70. methods: {
  71. isStrEmpty: function (str) {
  72. return typeof str === 'undefined' || str === null || str === ''
  73. },
  74. getDefItem: function (noDefault) {
  75. var tmp = {
  76. screenId: this.form.screenId,
  77. examineStatus: '', //病理学检查情况
  78. examineResult: '', //组织病理学检查结果
  79. examineResultAbnorma: [], //组织病理学检查结果异常
  80. examineResultAbnormaExplain: '', //组织病理学检查结果异常-其他
  81. diagnoseTimeStatus: '', //诊断日期(病理)
  82. diagnoseTime: '', //请选择诊断日期(病理)
  83. diagnoseOrgStatus: '', //诊断机构(病理)
  84. diagnoseOrg: '', //请输入诊断机构(病理)--暂时不用
  85. diagnoseOrgName: '', //请输入诊断机构(病理)
  86. notExaminedCause: '', //未接受检查的原因
  87. notExaminedCauseExplain: '', //未接受检查的原因-其他
  88. orgName: '', //随访机构
  89. org: '', //随访机构
  90. doctorName: '', //随访人员
  91. doctor: '', //随访人员
  92. followupTime: '' //随访时间
  93. }
  94. if (!noDefault) {
  95. tmp.orgName = docInfo.hospitalName
  96. tmp.org = docInfo.hospital
  97. tmp.doctorName = docInfo.name
  98. tmp.doctor = docInfo.code
  99. tmp.followupTime = moment().format('YYYY-MM-DD')
  100. }
  101. return tmp
  102. }
  103. }
  104. })