var template = '' $.ajax('../../../component/statistics/BuildBed/index.html', { data: {}, dataType: 'html', cache: false, timeout: 60000, async: false, error: function (res) {}, success: function (res) { template = res } }) Vue.component('build-bed', { template: template, props: [], data: function () { return { years: [], yearType: '1', chooseYear: null, chooseTime: null, form: {}, tableData: [], tableHeader: [ { label: '病人姓名', prop: 'patientName', width: '90' }, { label: '性别', prop: 'sex',width: '80' }, { label: '年龄', prop: 'age',width:'80' }, { label: '手机号', prop: 'mobile',width: '130' }, { label: '身份证号', prop: 'idcard',width: '170' }, { label: '住院号', prop: 'visitNo',width: '110' }, { label: '护理等级', prop: 'sickTendLevelName',width: '110' }, { label: '病情', prop: 'sickStateName',width: '110' }, { label: '主诊断', prop: 'sickDiagnoseCodeName',width: '110' }, { label: '责任医师', prop: 'adminVisitOperatorName',width: '90' }, { label: '上级医师', prop: 'upperOperatorName',width: '90' }, { label: '主营护士', prop: 'adminTendOperatorName',width: '90' }, { label: '床位名称', prop: 'sickBedName' ,width: '110'}, { label: '建床时间', prop: 'buildingTime',width: '160' } ], page: 1, size: 10, total: 0, loading: false, exportLoading: false } }, methods: { initTime() { var vm = this var now = new Date() vm.nowyear = vm.chooseYear = now.getFullYear() vm.years = [] for (i = vm.nowyear; i >= 2013; i--) { vm.years.push(i) } }, getList() { var vm = this this.loading = true var params = { ...this.form, page: this.page, pageSize: this.size } if (this.yearType == '1') { params.startDate = this.chooseYear + '-01-01 00:00' params.endDate = this.chooseYear + '-12-31 23:59' } else { if (this.chooseTime) { params.startDate = this.chooseTime[0] + ' 00:00' params.endDate = this.chooseTime[1] + ' 23:59' } } httpRequest.get('statistics/bed/getFamilyBedRecord', { data: params }).then(function (res) { if (res.status == 200) { vm.tableData = res.detailModelList vm.total = res.totalCount } vm.loading = false }) }, queryDate() { this.page = 1 this.getList() }, exportTable() { var vm = this var params = { ...this.form, page: this.page, pageSize: this.size } if (this.yearType == '1') { params.startDate = this.chooseYear + '-01-01 00:00' params.endDate = this.chooseYear + '-12-31 23:59' } else { if (this.chooseTime) { params.startDate = this.chooseTime[0] + ' 00:00' params.endDate = this.chooseTime[1] + ' 23:59' } } this.exportLoading = true var fileName = `建床人数${new Date().getTime()}.xls` httpRequest.downLoadFileForAjax('statistics/bed/exportGetFamilyBedRecord', fileName, params).then(function () { vm.exportLoading = false }) }, eliminateClick() { this.yearType = '1' this.chooseYear = new Date().getFullYear() this.chooseTime = null this.form = {} }, closeDialog() { this.dialogShow = false }, previewRecord(row) { this.dialogShow = true }, handleCurrentChange(val) { this.page = val this.getList() }, handleSizeChange(val) { this.size = val this.getList() } }, mounted() { this.initTime() this.getList() } })