index.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. var template = ''
  2. $.ajax('../../../component/statistics/LascBreastPathologyInspectEntityList/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-breast-pathology-inspect-entity-list', {
  14. template: template,
  15. props: ['data'],
  16. data: function () {
  17. return {
  18. isShowPicker: false,
  19. columns: ['非对称性腺体增厚', '乳头凹陷', '腋窝淋巴结肿大', '副乳腺', '乳腺切除术后'],
  20. pickType: '',
  21. curItem: '',
  22. readonly: true,
  23. orgColumns: ['', '厦门市妇幼保健院', '厦门市第一医院', '厦门市中山医院', '厦门市中医院', '复旦中山厦门医院', '厦门医学院附属第二医院', '其他(请说明)'],
  24. isShowDatePicker: false,
  25. isShowOrgsPicker: false,
  26. activeDateField: '',
  27. date: '',
  28. sort:0,
  29. form: {
  30. screenId: '', //两癌筛查id
  31. receivePathologicalExamination: '2', //是否接收乳腺临床检查1拒绝2接收
  32. pathologicalExamTime: '',
  33. refusePathologicalExaminationReason: '医嘱取消',
  34. breastPathologyRefusalReason: [],
  35. breastPathologyRefusalReasonContent: '',
  36. list: [],
  37. id: ''
  38. }
  39. }
  40. },
  41. methods: {
  42. getPathologicalExaminationDiagnosisOrg: function (name) {
  43. if (name) {
  44. return _.contains(this.orgColumns, name) ? name : this.orgColumns[7]
  45. }
  46. return ''
  47. },
  48. difference: function (field, excludes) {
  49. return _.difference(field, excludes)
  50. }
  51. },
  52. watch:{
  53. data: {
  54. handler(newVal, oldVal) {
  55. var vm = this
  56. if (this.data.value && this.data.value.length && this.data.value[0].id) {
  57. var first = this.data.value[0]
  58. this.form.screenId = first.screenId
  59. this.form.id = first.id ? first.id : ''
  60. this.form.receivePathologicalExamination = first.receivePathologicalExamination
  61. this.form.refusePathologicalExaminationReason = first.refusePathologicalExaminationReason
  62. this.form.breastPathologyRefusalReason = first.breastPathologyRefusalReason ? first.breastPathologyRefusalReason.split(',') : []
  63. this.form.breastPathologyRefusalReasonContent = first.breastPathologyRefusalReasonContent
  64. this.form.pathologicalExamTime = first.pathologicalExamTime
  65. var formData = JSON.parse(JSON.stringify(this.data.value))
  66. formData.forEach(function (v) {
  67. var left = { boxShow: false, name: '左乳' },
  68. right = { boxShow: false, name: '右乳' }
  69. for (var k in v) {
  70. if (k.indexOf('right') === 0) {
  71. right[k] = v[k]
  72. if (k == 'rightPathologicalBiopsyMethod') {
  73. right[k] = right[k] ? right[k].split(',') : []
  74. }
  75. if (k == 'rightPathologicalMalignanciesType') {
  76. right[k] = right[k] ? right[k].split(',') : []
  77. }
  78. } else if (k.indexOf('left') === 0) {
  79. left['right' + k.substring(4)] = v[k]
  80. if (k == 'leftPathologicalBiopsyMethod') {
  81. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : ''
  82. }
  83. if (k == 'leftPathologicalMalignanciesType') {
  84. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : ''
  85. }
  86. }
  87. }
  88. v.breastList = [right, left]
  89. v.pathologicalExaminationDiagnosisOrgPick = vm.getPathologicalExaminationDiagnosisOrg(v.pathologicalExaminationDiagnosisOrg)
  90. })
  91. this.form.list = formData
  92. }
  93. },
  94. deep: true
  95. }
  96. },
  97. created() {
  98. }
  99. })