var template = '' $.ajax('../../../component/statistics/LascCervicalHistopathologyFollowup/index.html', { data: {}, dataType: 'html', cache: false, timeout: 60000, async: false, error: function (res) {}, success: function (res) { template = res } }) Vue.component('lasc-cervical-histopathology-followup', { props: ['data'], data: function () { return { readonlyTwo: 1, readonly: true, pickType: '', curItem: '', isShowDatePicker: false, date: '', minDate: '', form: { screenId: '', //两癌筛查id list: [] } } }, template: template, created: function () { var vm = this this.form.screenId = this.data.screenId if (this.data.value && this.data.value.length) { var form = JSON.parse(JSON.stringify(this.data.value)) if (vm.isStrEmpty(form[0].examineStatus)) { this.form.list = _.map(form, function (v) { return _.assign(vm.getDefItem(), v) }) } else { _.each(form, function (m) { m.examineResultAbnorma = m.examineResultAbnorma.split(',') }) this.form.list = form } } }, methods: { isStrEmpty: function (str) { return typeof str === 'undefined' || str === null || str === '' }, getDefItem: function (noDefault) { var tmp = { screenId: this.form.screenId, examineStatus: '', //病理学检查情况 examineResult: '', //组织病理学检查结果 examineResultAbnorma: [], //组织病理学检查结果异常 examineResultAbnormaExplain: '', //组织病理学检查结果异常-其他 diagnoseTimeStatus: '', //诊断日期(病理) diagnoseTime: '', //请选择诊断日期(病理) diagnoseOrgStatus: '', //诊断机构(病理) diagnoseOrg: '', //请输入诊断机构(病理)--暂时不用 diagnoseOrgName: '', //请输入诊断机构(病理) notExaminedCause: '', //未接受检查的原因 notExaminedCauseExplain: '', //未接受检查的原因-其他 orgName: '', //随访机构 org: '', //随访机构 doctorName: '', //随访人员 doctor: '', //随访人员 followupTime: '' //随访时间 } if (!noDefault) { tmp.orgName = docInfo.hospitalName tmp.org = docInfo.hospital tmp.doctorName = docInfo.name tmp.doctor = docInfo.code tmp.followupTime = moment().format('YYYY-MM-DD') } return tmp } } })