// 慢阻肺患者档案表格组件 var template = '' $.ajax('../../../component/statistics/CopdPatientRecord/index.html', { data: {}, dataType: 'html', cache: false, timeout: 60000, async: false, error: function (res) {}, success: function (res) { template = res } }) Vue.component('copd-patient-record', { template: template, props: [], data() { return { dataList: [ { name: '张三', nationality: '中国', ethnicity: '汉族', idType: '身份证', idNumber: '310************1234', gender: '男', birthdate: '1990-01-01', age: '32', contactNumber: '13812345678', permanentAddress: '上海市浦东新区', registeredAddress: '江苏省南京市', occupation: '工程师', maritalStatus: '已婚', medicalInsuranceType: '城镇职工基本医疗保险', transferStatus: '已下转', receiveStatus: '已接收', receivingHospital: '上海市第一人民医院', receivingDoctor: '李医生', recordStatus: '正常', survivalStatus: '存活', deathDate: '' } ], // 当前编辑的数据,点击编辑按钮后设置,取消或退出则清空 currentEditData: null, // 编辑页面是否显示 editViewVisable: false, //服务记录是否显示 serviceRecordVisable: false, // 健康档案是否显示 healthRecordVisable: false } }, computed: { showTotalTable() { return ( (this.currentEditData == null && this.editViewVisable == false) && this.serviceRecordVisable == false && this.healthRecordVisable == false ) }, showEditView() { return this.currentEditData && this.editViewVisable } }, mounted() { var vm = this EventBus.$on('copd-reset-select', function () { vm.currentEditData = null vm.editViewVisable = false vm.serviceRecordVisable = false vm.healthRecordVisable = false }) }, destroyed() { EventBus.$off('copd-reset-select') }, methods: { onClickEdit(record) { if (!record) { return } this.currentEditData = record this.editViewVisable = true }, onClickServiceRecord(record) { this.serviceRecordVisable = true }, onClickHealthRecord(record) { this.healthRecordVisable = true } } })