var template = '' function isStrEmpty(str) { if (str instanceof Array) { return str.length === 0 } return typeof str === 'undefined' || str === null || str === '' } $.ajax('../../../component/statistics/LascBreastCduInspectEntityList/index.html', { data: {}, dataType: 'html', cache: false, timeout: 60000, async: false, error: function (res) {}, success: function (res) { template = res } }) Vue.component('lasc-breast-cduInspect-entity-list', { template: template, props: ['data'], data: function () { return { readonly: true, isShowPicker: false, columns: ['非对称性腺体增厚', '乳头凹陷', '腋窝淋巴结肿大', '副乳腺', '乳腺切除术后'], pickType: '', curItem: '', isShowDatePicker: false, activeDateField: '', date: '', form: { screenId: '', //两癌筛查id receiveBreastUltrasoundInspect: '2', //是否接收乳腺临床检查1拒绝2接收 list: [] }, active: '', cytoTubeNum: '' } }, methods: {}, watch: { data: { handler(newVal, oldVal) { if (this.data.value && this.data.value.length) { var first = this.data.value[0] this.form.screenId = first.screenId this.form.receiveBreastUltrasoundInspect = first.receiveBreastUltrasoundInspect var formData = JSON.parse(JSON.stringify(this.data.value)) formData.forEach(function (v) { var left = { boxShow: false, name: '左乳' }, right = { boxShow: false, name: '右乳' } for (var k in v) { if (k.indexOf('right') === 0) { right[k] = v[k] if (k == 'rightCduSolidMassMaxSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') right['minSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) right['middleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) right['maxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { right['minSize'] = '' right['middleSize'] = '' right['maxSize'] = '' } } if (k == 'rightCystSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') right['rightCystMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) right['rightCystMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) right['rightCystMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { right['rightCystMinSize'] = '' right['rightCystMiddleSize'] = '' right['rightCystMaxSize'] = '' } } if (k == 'rightCduIrregularHypoechoicSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') right['rightCduIrregularMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) right['rightCduIrregularMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) right['rightCduIrregularMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { right['rightCduIrregularMinSize'] = '' right['rightCduIrregularMiddleSize'] = '' right['rightCduIrregularMaxSize'] = '' } } if (k == 'rightCduIrregularHypoechoicPosition') { right[k] = right[k] ? right[k].split(',') : [] } if (k == 'rightCduSolidMassBloodDistribution') { right[k] = right[k] ? right[k].split(',') : [] } if (k == 'rightCduCystType') { right[k] = right[k] ? right[k].split(',') : [] } if (k == 'rightCduCyst') { right[k] = right[k] ? right[k].split(',') : [] } if (k == 'rightCduOtherAbnormal') { right[k] = right[k] ? right[k].split(',') : [] } if (k == 'rightDuctDilationLocation') { right[k] = right[k] ? right[k].split(',') : [] } } else if (k.indexOf('left') === 0) { left['right' + k.substring(4)] = v[k] if (k == 'leftCduSolidMassMaxSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') left['minSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) left['middleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) left['maxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { left['minSize'] = '' left['middleSize'] = '' left['maxSize'] = '' } } if (k == 'leftCystSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') left['rightCystMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) left['rightCystMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) left['rightCystMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { left['rightCystMinSize'] = '' left['rightCystMiddleSize'] = '' left['rightCystMaxSize'] = '' } } if (k == 'leftCduIrregularHypoechoicSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') left['rightCduIrregularMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) left['rightCduIrregularMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) left['rightCduIrregularMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { left['rightCduIrregularMinSize'] = '' left['rightCduIrregularMiddleSize'] = '' left['rightCduIrregularMaxSize'] = '' } } if (k == 'leftCduIrregularHypoechoicPosition') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } if (k == 'leftCduSolidMassBloodDistribution') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } if (k == 'leftCduOtherAbnormal') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } if (k == 'leftCduCystType') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } if (k == 'leftCduCyst') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } if (k == 'leftDuctDilationLocation') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } // if(k=="leftCduSolidMassMaxSize") { // left["right"+ k.substring(4)] = left["right"+ k.substring(4)].split(',') // } } } v.breastList = [right, left] }) this.form.list = formData this.cytoTubeNum = first.cytoTubeNum ? first.cytoTubeNum : '' console.log(this.form, 'lkkkkkkkkkkkkkkkkkkkkkkkkkkkk') } }, deep: true } }, mounted() { if (this.data.value && this.data.value.length) { var first = this.data.value[0] this.form.screenId = first.screenId this.form.receiveBreastUltrasoundInspect = first.receiveBreastUltrasoundInspect var formData = JSON.parse(JSON.stringify(this.data.value)) formData.forEach(function (v) { var left = { boxShow: false, name: '左乳' }, right = { boxShow: false, name: '右乳' } for (var k in v) { if (k.indexOf('right') === 0) { right[k] = v[k] if (k == 'rightCduSolidMassMaxSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') right['minSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) right['middleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) right['maxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { right['minSize'] = '' right['middleSize'] = '' right['maxSize'] = '' } } if (k == 'rightCystSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') right['rightCystMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) right['rightCystMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) right['rightCystMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { right['rightCystMinSize'] = '' right['rightCystMiddleSize'] = '' right['rightCystMaxSize'] = '' } } if (k == 'rightCduIrregularHypoechoicSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') right['rightCduIrregularMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) right['rightCduIrregularMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) right['rightCduIrregularMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { right['rightCduIrregularMinSize'] = '' right['rightCduIrregularMiddleSize'] = '' right['rightCduIrregularMaxSize'] = '' } } if (k == 'rightCduIrregularHypoechoicPosition') { right[k] = right[k] ? right[k].split(',') : [] } if (k == 'rightCduSolidMassBloodDistribution') { right[k] = right[k] ? right[k].split(',') : [] } if (k == 'rightCduCystType') { right[k] = right[k] ? right[k].split(',') : [] } if (k == 'rightCduCyst') { right[k] = right[k] ? right[k].split(',') : [] } if (k == 'rightCduOtherAbnormal') { right[k] = right[k] ? right[k].split(',') : [] } if (k == 'rightDuctDilationLocation') { right[k] = right[k] ? right[k].split(',') : [] } } else if (k.indexOf('left') === 0) { left['right' + k.substring(4)] = v[k] if (k == 'leftCduSolidMassMaxSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') left['minSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) left['middleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) left['maxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { left['minSize'] = '' left['middleSize'] = '' left['maxSize'] = '' } } if (k == 'leftCystSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') left['rightCystMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) left['rightCystMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) left['rightCystMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { left['rightCystMinSize'] = '' left['rightCystMiddleSize'] = '' left['rightCystMaxSize'] = '' } } if (k == 'leftCduIrregularHypoechoicSize') { if (!isStrEmpty(v[k])) { var m = v[k].split('*') left['rightCduIrregularMinSize'] = isStrEmpty(m[0]) ? '' : Number(m[0]) left['rightCduIrregularMiddleSize'] = isStrEmpty(m[1]) ? '' : Number(m[1]) left['rightCduIrregularMaxSize'] = isStrEmpty(m[2]) ? '' : Number(m[2]) } else { left['rightCduIrregularMinSize'] = '' left['rightCduIrregularMiddleSize'] = '' left['rightCduIrregularMaxSize'] = '' } } if (k == 'leftCduIrregularHypoechoicPosition') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } if (k == 'leftCduSolidMassBloodDistribution') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } if (k == 'leftCduOtherAbnormal') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } if (k == 'leftCduCystType') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } if (k == 'leftCduCyst') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } if (k == 'leftDuctDilationLocation') { left['right' + k.substring(4)] = left['right' + k.substring(4)] ? left['right' + k.substring(4)].split(',') : [] } // if(k=="leftCduSolidMassMaxSize") { // left["right"+ k.substring(4)] = left["right"+ k.substring(4)].split(',') // } } } v.breastList = [right, left] }) this.form.list = formData this.cytoTubeNum = first.cytoTubeNum ? first.cytoTubeNum : '' console.log(this.form, 'lkkkkkkkkkkkkkkkkkkkkkkkkkkkk') } console.log('1111111111111111111',this) } })