index.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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. watch: {
  43. data: {
  44. handler(newVal, oldVal) {
  45. if (this.data.value && this.data.value.length) {
  46. var first = this.data.value[0]
  47. this.form.screenId = first.screenId
  48. this.form.receiveBreastUltrasoundInspect = first.receiveBreastUltrasoundInspect
  49. var formData = JSON.parse(JSON.stringify(this.data.value))
  50. formData.forEach(function (v) {
  51. var left = { boxShow: false, name: '左乳' },
  52. right = { boxShow: false, name: '右乳' }
  53. for (var k in v) {
  54. if (k.indexOf('right') === 0) {
  55. right[k] = v[k]
  56. if (k == 'rightCduSolidMassMaxSize') {
  57. if (!isStrEmpty(v[k])) {
  58. var m = v[k].split('*')
  59. right['minSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  60. right['middleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  61. right['maxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  62. } else {
  63. right['minSize'] = ''
  64. right['middleSize'] = ''
  65. right['maxSize'] = ''
  66. }
  67. }
  68. if (k == 'rightCystSize') {
  69. if (!isStrEmpty(v[k])) {
  70. var m = v[k].split('*')
  71. right['rightCystMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  72. right['rightCystMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  73. right['rightCystMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  74. } else {
  75. right['rightCystMinSize'] = ''
  76. right['rightCystMiddleSize'] = ''
  77. right['rightCystMaxSize'] = ''
  78. }
  79. }
  80. if (k == 'rightCduIrregularHypoechoicSize') {
  81. if (!isStrEmpty(v[k])) {
  82. var m = v[k].split('*')
  83. right['rightCduIrregularMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  84. right['rightCduIrregularMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  85. right['rightCduIrregularMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  86. } else {
  87. right['rightCduIrregularMinSize'] = ''
  88. right['rightCduIrregularMiddleSize'] = ''
  89. right['rightCduIrregularMaxSize'] = ''
  90. }
  91. }
  92. if (k == 'rightCduIrregularHypoechoicPosition') {
  93. right[k] = right[k] ? right[k].split(',') : []
  94. }
  95. if (k == 'rightCduSolidMassBloodDistribution') {
  96. right[k] = right[k] ? right[k].split(',') : []
  97. }
  98. if (k == 'rightCduCystType') {
  99. right[k] = right[k] ? right[k].split(',') : []
  100. }
  101. if (k == 'rightCduCyst') {
  102. right[k] = right[k] ? right[k].split(',') : []
  103. }
  104. if (k == 'rightCduOtherAbnormal') {
  105. right[k] = right[k] ? right[k].split(',') : []
  106. }
  107. if (k == 'rightDuctDilationLocation') {
  108. right[k] = right[k] ? right[k].split(',') : []
  109. }
  110. } else if (k.indexOf('left') === 0) {
  111. left['right' + k.substring(4)] = v[k]
  112. if (k == 'leftCduSolidMassMaxSize') {
  113. if (!isStrEmpty(v[k])) {
  114. var m = v[k].split('*')
  115. left['minSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  116. left['middleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  117. left['maxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  118. } else {
  119. left['minSize'] = ''
  120. left['middleSize'] = ''
  121. left['maxSize'] = ''
  122. }
  123. }
  124. if (k == 'leftCystSize') {
  125. if (!isStrEmpty(v[k])) {
  126. var m = v[k].split('*')
  127. left['rightCystMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  128. left['rightCystMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  129. left['rightCystMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  130. } else {
  131. left['rightCystMinSize'] = ''
  132. left['rightCystMiddleSize'] = ''
  133. left['rightCystMaxSize'] = ''
  134. }
  135. }
  136. if (k == 'leftCduIrregularHypoechoicSize') {
  137. if (!isStrEmpty(v[k])) {
  138. var m = v[k].split('*')
  139. left['rightCduIrregularMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  140. left['rightCduIrregularMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  141. left['rightCduIrregularMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  142. } else {
  143. left['rightCduIrregularMinSize'] = ''
  144. left['rightCduIrregularMiddleSize'] = ''
  145. left['rightCduIrregularMaxSize'] = ''
  146. }
  147. }
  148. if (k == 'leftCduIrregularHypoechoicPosition') {
  149. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  150. }
  151. if (k == 'leftCduSolidMassBloodDistribution') {
  152. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  153. }
  154. if (k == 'leftCduOtherAbnormal') {
  155. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  156. }
  157. if (k == 'leftCduCystType') {
  158. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  159. }
  160. if (k == 'leftCduCyst') {
  161. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  162. }
  163. if (k == 'leftDuctDilationLocation') {
  164. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  165. }
  166. // if(k=="leftCduSolidMassMaxSize") {
  167. // left["right"+ k.substring(4)] = left["right"+ k.substring(4)].split(',')
  168. // }
  169. }
  170. }
  171. v.breastList = [right, left]
  172. })
  173. this.form.list = formData
  174. this.cytoTubeNum = first.cytoTubeNum ? first.cytoTubeNum : ''
  175. console.log(this.form, 'lkkkkkkkkkkkkkkkkkkkkkkkkkkkk')
  176. }
  177. },
  178. deep: true
  179. }
  180. },
  181. mounted() {
  182. if (this.data.value && this.data.value.length) {
  183. var first = this.data.value[0]
  184. this.form.screenId = first.screenId
  185. this.form.receiveBreastUltrasoundInspect = first.receiveBreastUltrasoundInspect
  186. var formData = JSON.parse(JSON.stringify(this.data.value))
  187. formData.forEach(function (v) {
  188. var left = { boxShow: false, name: '左乳' },
  189. right = { boxShow: false, name: '右乳' }
  190. for (var k in v) {
  191. if (k.indexOf('right') === 0) {
  192. right[k] = v[k]
  193. if (k == 'rightCduSolidMassMaxSize') {
  194. if (!isStrEmpty(v[k])) {
  195. var m = v[k].split('*')
  196. right['minSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  197. right['middleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  198. right['maxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  199. } else {
  200. right['minSize'] = ''
  201. right['middleSize'] = ''
  202. right['maxSize'] = ''
  203. }
  204. }
  205. if (k == 'rightCystSize') {
  206. if (!isStrEmpty(v[k])) {
  207. var m = v[k].split('*')
  208. right['rightCystMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  209. right['rightCystMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  210. right['rightCystMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  211. } else {
  212. right['rightCystMinSize'] = ''
  213. right['rightCystMiddleSize'] = ''
  214. right['rightCystMaxSize'] = ''
  215. }
  216. }
  217. if (k == 'rightCduIrregularHypoechoicSize') {
  218. if (!isStrEmpty(v[k])) {
  219. var m = v[k].split('*')
  220. right['rightCduIrregularMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  221. right['rightCduIrregularMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  222. right['rightCduIrregularMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  223. } else {
  224. right['rightCduIrregularMinSize'] = ''
  225. right['rightCduIrregularMiddleSize'] = ''
  226. right['rightCduIrregularMaxSize'] = ''
  227. }
  228. }
  229. if (k == 'rightCduIrregularHypoechoicPosition') {
  230. right[k] = right[k] ? right[k].split(',') : []
  231. }
  232. if (k == 'rightCduSolidMassBloodDistribution') {
  233. right[k] = right[k] ? right[k].split(',') : []
  234. }
  235. if (k == 'rightCduCystType') {
  236. right[k] = right[k] ? right[k].split(',') : []
  237. }
  238. if (k == 'rightCduCyst') {
  239. right[k] = right[k] ? right[k].split(',') : []
  240. }
  241. if (k == 'rightCduOtherAbnormal') {
  242. right[k] = right[k] ? right[k].split(',') : []
  243. }
  244. if (k == 'rightDuctDilationLocation') {
  245. right[k] = right[k] ? right[k].split(',') : []
  246. }
  247. } else if (k.indexOf('left') === 0) {
  248. left['right' + k.substring(4)] = v[k]
  249. if (k == 'leftCduSolidMassMaxSize') {
  250. if (!isStrEmpty(v[k])) {
  251. var m = v[k].split('*')
  252. left['minSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  253. left['middleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  254. left['maxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  255. } else {
  256. left['minSize'] = ''
  257. left['middleSize'] = ''
  258. left['maxSize'] = ''
  259. }
  260. }
  261. if (k == 'leftCystSize') {
  262. if (!isStrEmpty(v[k])) {
  263. var m = v[k].split('*')
  264. left['rightCystMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  265. left['rightCystMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  266. left['rightCystMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  267. } else {
  268. left['rightCystMinSize'] = ''
  269. left['rightCystMiddleSize'] = ''
  270. left['rightCystMaxSize'] = ''
  271. }
  272. }
  273. if (k == 'leftCduIrregularHypoechoicSize') {
  274. if (!isStrEmpty(v[k])) {
  275. var m = v[k].split('*')
  276. left['rightCduIrregularMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0])
  277. left['rightCduIrregularMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1])
  278. left['rightCduIrregularMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2])
  279. } else {
  280. left['rightCduIrregularMinSize'] = ''
  281. left['rightCduIrregularMiddleSize'] = ''
  282. left['rightCduIrregularMaxSize'] = ''
  283. }
  284. }
  285. if (k == 'leftCduIrregularHypoechoicPosition') {
  286. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  287. }
  288. if (k == 'leftCduSolidMassBloodDistribution') {
  289. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  290. }
  291. if (k == 'leftCduOtherAbnormal') {
  292. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  293. }
  294. if (k == 'leftCduCystType') {
  295. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  296. }
  297. if (k == 'leftCduCyst') {
  298. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  299. }
  300. if (k == 'leftDuctDilationLocation') {
  301. left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : []
  302. }
  303. // if(k=="leftCduSolidMassMaxSize") {
  304. // left["right"+ k.substring(4)] = left["right"+ k.substring(4)].split(',')
  305. // }
  306. }
  307. }
  308. v.breastList = [right, left]
  309. })
  310. this.form.list = formData
  311. this.cytoTubeNum = first.cytoTubeNum ? first.cytoTubeNum : ''
  312. console.log(this.form, 'lkkkkkkkkkkkkkkkkkkkkkkkkkkkk')
  313. }
  314. console.log('1111111111111111111',this)
  315. }
  316. })