index.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. var template = ''
  2. function isStrEmpty(str) {
  3. if (str instanceof Array) {
  4. return str.length === 0
  5. }
  6. return typeof str === 'undefined' || str === null || str === ''
  7. }
  8. $.ajax('../../../component/statistics/LascBreastCduInspectEntityList/index.html', {
  9. data: {},
  10. dataType: 'html',
  11. cache: false,
  12. timeout: 60000,
  13. async: false,
  14. error: function (res) {},
  15. success: function (res) {
  16. template = res
  17. }
  18. })
  19. Vue.component('lasc-breast-cduInspect-entity-list', {
  20. template: template,
  21. props: ['data'],
  22. data: function () {
  23. return {
  24. readonly: true,
  25. isShowPicker: false,
  26. columns: ['非对称性腺体增厚', '乳头凹陷', '腋窝淋巴结肿大', '副乳腺', '乳腺切除术后'],
  27. pickType: '',
  28. curItem: '',
  29. isShowDatePicker: false,
  30. activeDateField: '',
  31. date: '',
  32. form: {
  33. screenId: '', //两癌筛查id
  34. receiveBreastUltrasoundInspect: '2', //是否接收乳腺临床检查1拒绝2接收
  35. list: []
  36. },
  37. active: '',
  38. cytoTubeNum: ''
  39. }
  40. },
  41. methods: {},
  42. mounted() {
  43. if (this.data.value && this.data.value.length) {
  44. var first = this.data.value[0]
  45. this.form.screenId = first.screenId
  46. this.form.receiveBreastUltrasoundInspect = first.receiveBreastUltrasoundInspect
  47. var formData = JSON.parse(JSON.stringify(this.data.value))
  48. formData.forEach(function (v) {
  49. var left = { boxShow: false, name: '左乳' },
  50. right = { boxShow: false, name: '右乳' }
  51. for (var k in v) {
  52. if (k.indexOf('right') === 0) {
  53. right[k] = v[k]
  54. if (k == 'rightCduSolidMassMaxSize') {
  55. if (!isStrEmpty(v[k])) {
  56. var m = v[k].split('*')
  57. right['minSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  58. right['middleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  59. right['maxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  60. } else {
  61. right['minSize'] = ''
  62. right['middleSize'] = ''
  63. right['maxSize'] = ''
  64. }
  65. }
  66. if (k == 'rightCystSize') {
  67. if (!isStrEmpty(v[k])) {
  68. var m = v[k].split('*')
  69. right['rightCystMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  70. right['rightCystMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  71. right['rightCystMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  72. } else {
  73. right['rightCystMinSize'] = ''
  74. right['rightCystMiddleSize'] = ''
  75. right['rightCystMaxSize'] = ''
  76. }
  77. }
  78. if (k == 'rightCduIrregularHypoechoicSize') {
  79. if (!isStrEmpty(v[k])) {
  80. var m = v[k].split('*')
  81. right['rightCduIrregularMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  82. right['rightCduIrregularMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  83. right['rightCduIrregularMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  84. } else {
  85. right['rightCduIrregularMinSize'] = ''
  86. right['rightCduIrregularMiddleSize'] = ''
  87. right['rightCduIrregularMaxSize'] = ''
  88. }
  89. }
  90. if (k == 'rightCduIrregularHypoechoicPosition') {
  91. right[k] = right[k] ? right[k].split(',') : []
  92. }
  93. if (k == 'rightCduSolidMassBloodDistribution') {
  94. right[k] = right[k] ? right[k].split(',') : []
  95. }
  96. if (k == 'rightCduCystType') {
  97. right[k] = right[k] ? right[k].split(',') : []
  98. }
  99. if (k == 'rightCduCyst') {
  100. right[k] = right[k] ? right[k].split(',') : []
  101. }
  102. if (k == 'rightCduOtherAbnormal') {
  103. right[k] = right[k] ? right[k].split(',') : []
  104. }
  105. if (k == 'rightDuctDilationLocation') {
  106. right[k] = right[k] ? right[k].split(',') : []
  107. }
  108. } else if (k.indexOf('left') === 0) {
  109. left['right' + k.substring(4)] = v[k]
  110. if (k == 'leftCduSolidMassMaxSize') {
  111. if (!isStrEmpty(v[k])) {
  112. var m = v[k].split('*')
  113. left['minSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  114. left['middleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  115. left['maxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  116. } else {
  117. left['minSize'] = ''
  118. left['middleSize'] = ''
  119. left['maxSize'] = ''
  120. }
  121. }
  122. if (k == 'leftCystSize') {
  123. if (!isStrEmpty(v[k])) {
  124. var m = v[k].split('*')
  125. left['rightCystMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  126. left['rightCystMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  127. left['rightCystMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  128. } else {
  129. left['rightCystMinSize'] = ''
  130. left['rightCystMiddleSize'] = ''
  131. left['rightCystMaxSize'] = ''
  132. }
  133. }
  134. if (k == 'leftCduIrregularHypoechoicSize') {
  135. if (!isStrEmpty(v[k])) {
  136. var m = v[k].split('*')
  137. left['rightCduIrregularMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  138. left['rightCduIrregularMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  139. left['rightCduIrregularMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  140. } else {
  141. left['rightCduIrregularMinSize'] = ''
  142. left['rightCduIrregularMiddleSize'] = ''
  143. left['rightCduIrregularMaxSize'] = ''
  144. }
  145. }
  146. if (k == 'leftCduIrregularHypoechoicPosition') {
  147. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  148. }
  149. if (k == 'leftCduSolidMassBloodDistribution') {
  150. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  151. }
  152. if (k == 'leftCduOtherAbnormal') {
  153. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  154. }
  155. if (k == 'leftCduCystType') {
  156. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  157. }
  158. if (k == 'leftCduCyst') {
  159. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  160. }
  161. if (k == 'leftDuctDilationLocation') {
  162. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  163. }
  164. // if(k=="leftCduSolidMassMaxSize") {
  165. // left["right"+ k.substring(4)] = left["right"+ k.substring(4)].split(',')
  166. // }
  167. }
  168. }
  169. v.breastList = [right, left]
  170. })
  171. this.form.list = formData
  172. this.cytoTubeNum = first.cytoTubeNum ? first.cytoTubeNum : ''
  173. console.log(this.form, 'lkkkkkkkkkkkkkkkkkkkkkkkkkkkk')
  174. }
  175. }
  176. })