var template = '' $.ajax('../../../component/statistics/LascProgress/index.html', { data: {}, dataType: 'html', cache: false, timeout: 60000, async: false, error: function (res) {}, success: function (res) { template = res } }) Vue.component('lasc-progress', { template: template, props: [], data: function () { return { years: [], yearType: '1', chooseYear: null, chooseTime: null, rangeOptions: [ { label: '区', value: '1' }, { label: '机构', value: '2' }, { label: '居住地', value: '3' } ], areaOptions: [ { label: '思明区', value: '350203' }, { label: '海沧区', value: '350205' }, { label: '湖里区', value: '350206' }, { label: '集美区', value: '350211' }, { label: '同安区', value: '350212' }, { label: '翔安区', value: '350213' } ], hospitalOptions: [], teamOptions: [], form: { range: '1' }, loading: false, exportLoading: false, tableData: [], tableHeader: [ { label: '机构', prop: 'gynOrg' }, { label: '筛查总人数', prop: 'total' }, // { label: '待评估人数', prop: 'status0' }, { label: '已评估人数', prop: 'status1' }, { label: '已评估且管理人数', prop: 'status2' }, { label: '宫颈待完善乳腺待完善人数', prop: 'status3' }, { label: '宫颈待完善乳腺完成筛查人数', prop: 'status4' }, { label: '宫颈完成筛查乳腺待完善人数', prop: 'status5' } ], level: 0, visible: false, query: { page: 1, size: 10, total: 0 }, dialogHeader: [ { label: '居民姓名', prop: 'name', width: '100' }, { label: '证件号码', prop: 'idcard', width: '100' }, { label: '手机号', prop: 'mobile', width: '110' }, { label: '年龄', prop: 'age', width: '90' }, { label: '出生日期', prop: 'birthday', width: '90' }, { label: '常驻地址', prop: 'address', width: '100' }, { label: '个人筛查状态', prop: 'statusName', width: '100' } ], currentEditData: '', serviceRecordVisable: false, page: 1, size: 10, total: 0, messageVisible: false, messInfo: null, remind: '', dialogLoading: false, dialogExportLoading: false, statusOptions: [], rehabilitationHospital: [], archiveList: [], inviteStatus: [ { value: '', label: '全部' }, { value: '1', label: '门诊患者' }, { value: '2', label: '出院患者' } ], communityHospitals: [], title: '', dialogVisible: false, signatoryList: [], dialogTableData: [] } }, methods: { back() { this.currentEditData = '' this.serviceRecordVisable = false }, init() { var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole')) if (selectedRole.code.indexOf('350200') > -1) { this.level = 1 // 市卫健委 this.areaOptions = [ { label: '厦门市', value: '' }, { label: '思明区', value: '350203' }, { label: '海沧区', value: '350205' }, { label: '湖里区', value: '350206' }, { label: '集美区', value: '350211' }, { label: '同安区', value: '350212' }, { label: '翔安区', value: '350213' } ] } else if (selectedRole.code.length == 6) { this.level = 2 // 区管理 this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }] this.form = { range: '1', area: selectedRole.code } this.getHospital(selectedRole.code) } else { this.level = 3 // 社区管理 this.rangeOptions = [ { label: '社区', value: '2' }, { label: '团队', value: 'team' } ] this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }] this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }] this.form = { range: '2', town: selectedRole.code.substring(0, 6), hospital: selectedRole.code } this.getTeam(selectedRole.code) } this.initTime() this.searchFn() this.hospitalsByType() }, gotoService(item) { this.currentEditData = item.patient this.serviceRecordVisable = true }, 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) } }, resetArea() { if (this.level == 1) { delete this.form.area delete this.form.hospital delete this.form.team } else if (this.level == 2) { delete this.form.hospital delete this.form.team } else { delete this.form.team } }, 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) }) }, searchFn() { var vm = this this.loading = true var params = { ...this.form, page: this.page, size: this.size } vm.tableData = [] if (this.chooseTime) { params.startTime = this.chooseTime[0] params.endTime = this.chooseTime[1] } httpRequest.get('doctor/twoCancers/count/twoCancerProgress', { data: params }).then(function (res) { if (res.status == 200) { vm.tableData = res.detailModelList vm.total = res.totalCount } vm.loading = false }) }, 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` httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportTwoCancerProgress', fileName, params).then(function () { vm.exportLoading = false }) }, eliminateClick() { var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole')) if (this.level == 1) { this.form = { range: '1' } } else if (this.level == 2) { this.form = { range: '1', area: selectedRole.code } this.getHospital(selectedRole.code) } else { this.form = { range: '2', town: selectedRole.code.substring(0, 6), hospital: selectedRole.code } this.getTeam(selectedRole.code) } this.yearType = '1' this.chooseYear = new Date().getFullYear() this.chooseTime = null const now = new Date() // 获取当前日期 const endDate = new Date() // 获取30天前的日期 const startDate = new Date() startDate.setDate(endDate.getDate() - 30) this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)] this.init() this.$forceUpdate() }, getHospital(code, flag = true) { var vm = this if (flag) { delete this.form.hospital delete this.form.team } var params = { type: 5, code: code } if (!code) { vm.hospitalOptions = [{ name: '全部', value: '' }] vm.teamOptions = [{ name: '全部', value: '' }] return false } httpRequest.post('common/district', { data: params }).then(function (res) { vm.hospitalOptions = res.list }) }, handleCurrentChange(val) { this.page = val this.searchFn() }, handleSizeChange(val) { this.size = val this.searchFn() }, // 获取社区医院 hospitalsByType() { 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 }] } 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') }) } }, closeDialog() { this.visible = false }, closeDialog1() { this.dialogVisible = false }, getData(data) { if (data) { this.yearType = data.yearType this.form.range = data.range this.form.area = data.area this.form.hospital = data.hospital this.form.team = data.team if (this.yearType == 1) { this.chooseYear = data.time } else { this.chooseTime = data.time } if (this.form.hospital) { // 如果有社区code传过来就调社区医院列表接口 this.getHospital(data.area, false) } if (this.form.team) { // 如果有团队code传过来就调团队列表接口 this.getTeam(data.hospital, false) } this.searchFn() } else { this.init() } }, openDialog(row, prop) { var vm = this if (prop != 'total') { this.query.status = prop.charAt(prop.length - 1) } vm.dialogLoading = true this.query.type = 't_' + prop this.query.orgCode = row.orgCode var params = { ...this.query, range: (this.form && this.form.range) || '', town: (this.form && this.form.town) || '' } vm.dialogTableData = [] if (this.chooseTime) { params.startTime = this.chooseTime[0] params.endTime = this.chooseTime[1] } delete params.total httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) { vm.dialogTableData = res.detailModelList vm.query.total = res.totalCount vm.visible = true vm.dialogLoading = false console.log('333333333333333',vm) }) }, caseDataList() { var vm = this vm.dialogLoading = true var params = { ...this.query, range: (this.form && this.form.range) || '', town: (this.form && this.form.town) || '', hospital: (this.form && this.form.hospital) || '' } vm.dialogTableData = [] if (this.chooseTime) { params.startTime = this.chooseTime[0] params.endTime = this.chooseTime[1] } delete params.total httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) { vm.dialogTableData = res.detailModelList vm.query.total = res.totalCount vm.dialogLoading = false }) }, dialogSearchFn() { this.caseDataList() }, handleCurrentChange1(val) { this.query.page = val this.caseDataList() }, handleSizeChange1(val) { this.query.size = val this.caseDataList() }, dialogExportFn() { var vm = this this.dialogExportLoading = true var params = { ...this.query, range: (this.form && this.form.range) || '', town: (this.form && this.form.town) || '', hospital: (this.form && this.form.hospital) || '' } if (this.chooseTime) { params.startTime = this.chooseTime[0] params.endTime = this.chooseTime[1] } var fileName = `个案数据列表${new Date().getTime()}.xls` httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportCaseDataList', fileName, params).then(function () { vm.dialogExportLoading = false }) }, dialogResetFn() { this.query = { page: 1, size: 10, total: 0, type:this.query.type, orgCode:this.query.orgCode, } this.caseDataList() }, formatDate(date) { const year = date.getFullYear() const month = String(date.getMonth() + 1).padStart(2, '0') const day = String(date.getDate()).padStart(2, '0') return `${year}-${month}-${day}` } }, mounted() { const now = new Date() // 获取当前日期 const endDate = new Date() // 获取30天前的日期 const startDate = new Date() startDate.setDate(endDate.getDate() - 30) this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)] this.init() } })