var template = '' $.ajax('../../../component/statistics/TurndownDetail/index.html', { data: {}, dataType: 'html', cache: false, timeout: 60000, async: false, error: function (res) {}, success: function (res) { template = res } }) Vue.component('turndown-detail', { template: template, props: [], data: function () { return { chooseTime: null, statusOptions: [], form: { status: '', hospitalCode: '', orgCode: '', archiveStatus: '', patientType: '' }, loading: false, exportLoading: false, tableData: [], tableHeader: [ { label: '患者姓名', prop: 'name', width: '90' }, { label: '年龄', prop: 'age', width: '90' }, { label: '性别', prop: 'sex', width: '90' }, { label: '患者手机号', prop: 'mobile', width: '130' }, { label: '下转医院', prop: 'hospitalName', width: '170' }, { label: '下转医生', prop: 'hospitalDoctor', width: '90' }, { label: '下转时间', prop: 'createTime', width: '90' }, { label: '患者类型', prop: 'patientType', width: '90' }, { label: '下转状态', prop: 'statusName', width: '110' }, { label: '接收社区医院', prop: 'orgName', width: '110' }, { label: '接收签约医生', prop: 'doctorName', width: '170' }, { label: '接收时间', prop: 'receiveTime', width: '90' }, { label: '档案状态', prop: 'archiveStatusName', width: '130' } ], communityHospitals: [], archiveList: [], rehabilitationHospital: [], inviteStatus: [ { value: '', label: '全部' }, { value: '1', label: '门诊患者' }, { value: '2', label: '出院患者' } ], signatoryList: [], page: 1, size: 10, total: 0, dialogVisible: false } }, methods: { initTime() { var date = new Date() var maxTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}` var date1 = new Date(date.getTime() - 2592000000) var minTime = `${date1.getFullYear()}-${date1.getMonth() + 1}-${date1.getDate()}` this.chooseTime = [minTime, maxTime] }, getList() { var vm = this this.loading = true var params = { ...this.form, page: this.page, size: this.size } if (this.chooseTime) { params.startTime = this.chooseTime[0] params.endTime = this.chooseTime[1] } httpRequest.get('doctor/specialist/rehabilitation/rehabilitationPatientInfo', { 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, size: this.size } if (this.chooseTime) { params.startTime = this.chooseTime[0] params.endTime = this.chooseTime[1] } this.exportLoading = true var fileName = `康复下转明细${new Date().getTime()}.xls` statisticAPI .exportRehabilitationPatientInfo(params, fileName) .then(function (res) { vm.exportLoading = false }) .catch(function (err) { vm.exportLoading = false }) }, eliminateClick() { this.form = { status: '', hospitalCode: '', orgCode: '', archiveStatus: '', patientType: '' } var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole')) // 如果是社区管理员 if(selectedRole.code.length > 6){ this.form.orgCode = selectedRole.code } this.initTime() }, getDictData() { var vm = this statisticAPI.getDictByDictName({ name: 'rehabilitation_status' }).then(function (res) { vm.statusOptions = [{ value: '全部', code: '' }] vm.statusOptions = vm.statusOptions.concat(res.list) }) statisticAPI.getDictByDictName({ name: 'rehabilitation_hospital' }).then(function (res) { vm.rehabilitationHospital = [{ value: '全部', code: '' }] vm.rehabilitationHospital = vm.rehabilitationHospital.concat(res.list) }) statisticAPI.getDictByDictName({ name: 'archive_status' }).then(function (res) { vm.archiveList = [{ value: '全部', code: '' }] vm.archiveList = vm.archiveList.concat(res.list) }) }, // 获取社区医院 hospitalsByType: function () { var vm = this // var code var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole')) if (selectedRole.code.indexOf('350200') > -1) { code = '350200' // 市卫健委 } else if (selectedRole.code.length == 6) { code = selectedRole.code } else { this.level = 3 // 社区管理 } if (selectedRole.code.length > 6) { this.communityHospitals = [{ label: selectedRole.name, value: selectedRole.code }] this.form.orgCode = selectedRole.code } else { var type = 1 if (selectedRole.code.indexOf('350200') > -1) { type = 1 // 市卫健委 } else if (selectedRole.code.length == 6) { type = 2 } statisticAPI .hospitalsByType({ type: type, code: selectedRole.code }) .then(function (res) { if (res.status == 200) { vm.communityHospitals = [{ label: '全部', value: '' }] res.list.forEach(function (v) { vm.communityHospitals.push({ value: v.code, label: v.name }) }) } }) .catch(function (err) { console.log(err, 'Errr') }) } }, handleCurrentChange(val) { this.page = val this.getList() }, handleSizeChange(val) { this.size = val this.getList() }, // 康复下转操作 operation(num, item) { var vm = this if (num != 2) { statisticAPI .synchronizePationSingle({ id: item.id }) .then(function (res) { if (res.status == 200) { vm.$message.success('操作成功') } else { vm.$message.error(res.msg) } }) .catch(function (err) { console.log(err, 'Errr') }) } else { vm.signatoryList = [] statisticAPI .kangfuGetSignInfo({ idcard: item.idcard }) .then(function (res) { if (res.status == 200) { if (res.data != null) { vm.signatoryList.push(res.data) } } }) .catch(function (err) { console.log(err, 'Errr') }) this.dialogVisible = true } }, transformData(data, prop) { if (prop == 'sex') { if (data == 0) { return '男' } else { return '女' } } else { return data } } }, mounted() { this.initTime() this.getDictData() this.hospitalsByType() this.getList() } })