var template = '' $.ajax('../../../component/statistics/Referral/index.html', { data: {}, dataType: 'html', cache: false, timeout: 60000, async: false, error: function (res) {}, success: function (res) { template = res } }) Vue.component('referral', { template: template, props: [], data: function () { return { years: [], yearType: '1', chooseYear: null, chooseTime: null, turnOverOptions: [], form: { turnOver: "" }, tableData: [], tableHeader: [ { label: '住院号', prop: 'visitNo' }, { label: '病人姓名', prop: 'patientName' }, { label: '性别', prop: 'sex' }, { label: '年龄', prop: 'age' }, { label: '建床诊断', prop: 'diagnoseName' }, { label: '建床日期', prop: 'buildingDate', width: '140' }, { label: '建床天数', prop: 'buildingDays' }, { label: '撤床日期', prop: 'withdrawalTime', width: '140' }, { label: '撤床诊断', prop: 'sickOutDiagnoseName' }, { label: '转归情况', prop: 'turnOver' } ], dialogShow: false, info: {}, page: 1, size: 10, total: 0, loading: false, exportLoading: false, sexDict: { 1: '男', 2: '女' }, turnOverObj: {} } }, 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/getFamilyBedWithdrawalStatistics', { 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/exportGetFamilyBedWithdrawalStatistics', fileName, params).then(function () { vm.exportLoading = false }) }, eliminateClick() { this.form = { turnOver: "" } this.yearType = '1' this.chooseYear = new Date().getFullYear() this.chooseTime = null }, closeDialog() { this.dialogShow = false }, previewRecord(row) { var vm = this this.dialogShow = true httpRequest.get('doctor/familyBed/findBedWithdrawal', { data: { bedRecordCode: row.code } }).then(function (res) { vm.info = res.data }) }, getDictData() { var vm = this statisticAPI.getDictByDictName({ name: 'jkcopd_disease_conversion' }).then(function (res) { vm.turnOverOptions = [{ value: '全部', code:"" }] vm.turnOverOptions = vm.turnOverOptions.concat(res.list) for (var item of res.list) { vm.turnOverObj[item.code] = item.value } }) }, handleCurrentChange(val) { this.page = val this.getList() }, handleSizeChange(val) { this.size = val this.getList() }, getImgUrl(url) { return httpRequest.getImgUrl(url) } }, mounted() { this.initTime() this.getDictData() this.getList() } })