index.js 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. form: {
  29. screenId: '', //两癌筛查id
  30. receivePathologicalExamination: '2', //是否接收乳腺临床检查1拒绝2接收
  31. pathologicalExamTime: '',
  32. refusePathologicalExaminationReason: '医嘱取消',
  33. breastPathologyRefusalReason: [],
  34. breastPathologyRefusalReasonContent: '',
  35. list: [],
  36. id: ''
  37. }
  38. }
  39. },
  40. methods: {
  41. getPathologicalExaminationDiagnosisOrg: function (name) {
  42. if (name) {
  43. return _.contains(this.orgColumns, name) ? name : this.orgColumns[7]
  44. }
  45. return ''
  46. },
  47. difference: function (field, excludes) {
  48. return _.difference(field, excludes)
  49. }
  50. },
  51. created() {
  52. var vm = this
  53. if (this.data.value && this.data.value.length && this.data.value[0].id) {
  54. var first = this.data.value[0]
  55. this.form.screenId = first.screenId
  56. this.form.id = first.id ? first.id : ''
  57. this.form.receivePathologicalExamination = first.receivePathologicalExamination
  58. this.form.refusePathologicalExaminationReason = first.refusePathologicalExaminationReason
  59. this.form.breastPathologyRefusalReason = first.breastPathologyRefusalReason ? first.breastPathologyRefusalReason.split(',') : []
  60. this.form.breastPathologyRefusalReasonContent = first.breastPathologyRefusalReasonContent
  61. this.form.pathologicalExamTime = first.pathologicalExamTime
  62. var formData = JSON.parse(JSON.stringify(this.data.value))
  63. formData.forEach(function (v) {
  64. var left = { boxShow: false, name: '左乳' },
  65. right = { boxShow: false, name: '右乳' }
  66. for (var k in v) {
  67. if (k.indexOf('right') === 0) {
  68. right[k] = v[k]
  69. if (k == 'rightPathologicalBiopsyMethod') {
  70. right[k] = right[k] ? right[k].split(',') : []
  71. }
  72. if (k == 'rightPathologicalMalignanciesType') {
  73. right[k] = right[k] ? right[k].split(',') : []
  74. }
  75. } else if (k.indexOf('left') === 0) {
  76. left['right' + k.substring(4)] = v[k]
  77. if (k == 'leftPathologicalBiopsyMethod') {
  78. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : ''
  79. }
  80. if (k == 'leftPathologicalMalignanciesType') {
  81. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : ''
  82. }
  83. }
  84. }
  85. v.breastList = [right, left]
  86. v.pathologicalExaminationDiagnosisOrgPick = vm.getPathologicalExaminationDiagnosisOrg(v.pathologicalExaminationDiagnosisOrg)
  87. })
  88. this.form.list = formData
  89. }
  90. }
  91. })