123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446 |
- // 慢阻肺患者档案表格组件
- 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 {
- docInfo: JSON.parse(window.localStorage.getItem('docInfo')),
- daLoading:false,
- dataList: [
- ],
- // 当前编辑的数据,点击编辑按钮后设置,取消或退出则清空
- currentEditData: null,
- // 编辑页面是否显示
- editViewVisable: false,
- //服务记录是否显示
- serviceRecordVisable: false,
- transferStatusOptions:[{code:'',value:'全部'}],
- recordStatusOptions:[{code:'',value:'全部'}],
- followStatusArr:[{code:'',value:'全部'}],
- receivingHospitalList:[{code:'',name:'全部'}],
- receiveStatusOptions:[{value:'',label:'全部'},{value:'1',label:' 已接收'},{value:'0',label:' 未接收'}],
- survivalStatusOption:[{code:'',value:'全部'}],
- // 健康档案是否显示
- healthRecordVisable: false,
- page: 1,
- size: 50,
- currentSize:50,
- currentPage: 1,
- totalPage: 0,
- totalCount: 0,
- name:'',
- years:'',
- turnDownStatus:'',
- receiveStatus:'',
- archivesStatus:'',
- hospital:'',
- doctorName:'',
- isLive: '',
- firstOrg: '',
- currentSelect:[],
- followupStatus:[],
- dicName:['jkcopd_archivesStatus','jkcopd_turnDownStatus','jkcopd_isLive','jkcopd_followup_status'],
- isShow: false,
- startTime:'',
- endTime:'',
- chooseYear: '',
- nowyear:'',
- fileList: [],
- file: undefined,
- isProgressShow: false,
- percentage: 0,
- success: false,
- loading: false,
- isOver: false,
- status: "",
- errList: [],
- pickerOptions: {
- disabledDate(time) {
- let timeSpace = time.getTime() <= moment.toDate().getTime();
- return timeSpace;
- }
- },
- }
- },
- 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
- this.initTime(vm)
- this.hospitalList()
- EventBus.$on('copd-reset-select', function () {
- vm.currentEditData = null
- vm.editViewVisable = false
- vm.serviceRecordVisable = false
- vm.healthRecordVisable = false
- })
- EventBus.$on('copd-reset-save', function () {
- vm.currentEditData = null
- vm.editViewVisable = false
- vm.serviceRecordVisable = false
- vm.healthRecordVisable = false
- vm.transferStatusOptions=[{code:'',value:'全部'}],
- vm.recordStatusOptions=[{code:'',value:'全部'}],
- vm.followStatusArr=[{code:'',value:'全部'}],
- vm.receivingHospitalList=[{code:'',name:'全部'}],
- vm.receiveStatusOptions=[{value:'',label:'全部'},{value:'1',label:' 已接收'},{value:'0',label:' 未接收'}],
- vm.survivalStatusOption=[{code:'',value:'全部'}],
- vm.getJkCopdPatientPage()
- vm.dicName.forEach(function(item) {
- vm.getDictByDictName(item)
- });
- })
- this.getJkCopdPatientPage()
- this.dicName.forEach(function(item) {
- vm.getDictByDictName(item)
- });
- },
- destroyed() {
- EventBus.$off('copd-reset-select')
- EventBus.$off('copd-reset-save')
- },
- methods: {
- // 初始化时间
- initTime(vm) {
- var now = new Date();
- vm.endTime = now.format('yyyy-MM-dd');
- var start = now.getFullYear()+'-'+'01-01';
- vm.startTime = new Date(start).format('yyyy-MM-dd');
- vm.nowyear = vm.chooseYear = now.getFullYear();
- vm.chooseYear='全部'
- vm.nowmonth = now.getMonth() + 1;
- vm.years = ['全部'];
- for (i = vm.nowyear; i >= 2013; i--) {
- vm.years.push(i);
- }
- },
- handlePreview(value) {
- var vm = this
- var file = value.target.files[0]
- this.daLoading=true
- console.log(file,'vvvvvvvvvvvv',value,value.target.files[0])
- if(file && file.size) {
- var formFile = new FormData()
- formFile.append("file", file)
- httpRequest.post('doctor/jkCopd/importExcel',{
- data: formFile,
- cache: false,//上传文件无需缓存
- processData: false,//用于对data参数进行序列化处理 这里必须false
- contentType: false, //必须
- }).then(function(res) {
- if(res.status == 200) {
- vm.getJkCopdPatientPage()
- vm.dicName.forEach(function(item) {
- vm.getDictByDictName(item)
- });
- vm.daLoading=false
- vm.$message({
- message: '导入成功!',
- type: 'success'
- });
- } else {
- vm.$message.error('导入失败!')
- vm.daLoading=false
- }
- }).catch(function(e) {
- console.error(e)
- vm.daLoading=false
- })
- // statisticAPI.importExcel({file:formFile}).then(function(res){
- // console.log('22222222222',res)
- // })
- }
- },
- hospitalList(){
- var vm=this
- statisticAPI.hospitalList().then(function(res){
- vm.receivingHospitalList=vm.receivingHospitalList&& vm.receivingHospitalList.concat(res.detailModelList)
- })
- },
- exportTable(){
- var vm=this
- vm.daLoading=true
- var params = {
- startTime: this.chooseYear=='全部'?'': this.chooseYear+'-01-01',
- endTime:this.chooseYear=='全部'?'': this.chooseYear+'-12-31',
- name:this.name,
- turnDownStatus:this.turnDownStatus,
- receiveStatus:this.receiveStatus,
- archivesStatus:this.archivesStatus,
- hospital:this.hospital,
- doctorName:this.doctorName,
- isLive: this.isLive,
- firstOrg: this.firstOrg
- }
- statisticAPI.exportJkCopdAchives(params,'居民档案.xls').then(
- function(res){
- vm.daLoading=false
- vm.$message({
- message: '导出成功!',
- type: 'success'
- });
- }
- )
- },
- selectionLineChangeHandle(val){
- var vm=this
- var arr=[]
- val.forEach(function(item){
- arr.push(item.id)
- })
- vm.currentSelect=arr
- },
- synPatient(){
- var vm=this
- if(vm.currentSelect.length){
- statisticAPI.synPatient({
- ids:vm.currentSelect.join(','),
- doctor: vm.docInfo.code
- }).then(function(res){
- if(res.status=='200'){
- vm.$message({
- message: res.message,
- type: 'success'
- });
- vm.getJkCopdPatientPage()
- vm.dicName.forEach(function(item) {
- vm.getDictByDictName(item)
- });
-
- }else{
- vm.$message({
- message: res.message,
- type: 'warning'
- });
- }
- })
- }else{
- vm.$message('请勾选患者!')
- }
- },
- queryDate(){
- this.getJkCopdPatientPage()
- },
- distributionHospital(){
- var vm=this
- if(vm.currentSelect.length){
- vm.daLoading=true
- statisticAPI.distributionHospital({
- type:1,
- ids:vm.currentSelect.join(','),
- doctor: vm.docInfo.code
- }).then(function(res){
- if(res.status=='200'){
- vm.daLoading=false
- vm.$message({
- message: res.message,
- type: 'success'
- });
- vm.getJkCopdPatientPage()
- vm.dicName.forEach(function(item) {
- vm.getDictByDictName(item)
- });
-
- }else{
- vm.daLoading=false
- vm.$message({
- message: res.message,
- type: 'warning'
- });
- }
- })
- }else{
- vm.daLoading=false
- vm.$message('请勾选患者!')
- }
- },
- eliminateClick(){
- this.name='',
- this.turnDownStatus='',
- this.receiveStatus='',
- this.archivesStatus='',
- this.hospital='',
- this.doctorName='',
- this.isLive= '',
- this.firstOrg= ''
- },
- //下转状态
- getDictByDictName(value){
- var vm=this
- statisticAPI.getDictByDictName({name:value}).then(function(res){
- if(value=='jkcopd_turnDownStatus'){
- vm.transferStatusOptions= vm.transferStatusOptions.concat(res.list)
- }else if(value=='jkcopd_archivesStatus'){
- vm.recordStatusOptions=vm.recordStatusOptions.concat(res.list)
- }else if(value=='jkcopd_isLive'){
- vm.survivalStatusOption= vm.survivalStatusOption.concat(res.list)
- }else if(value=='jkcopd_followup_status'){
- vm.followStatusArr= vm.followStatusArr.concat(res.list)
- }
-
- })
-
- },
- onClickEdit(record) {
- window.localStorage.setItem('editDetail',JSON.stringify(record))
- if (!record) {
- return
- }
- this.currentEditData = record
- this.editViewVisable = true
- },
- onClickServiceRecord(record) {
- this.currentEditData = record
- this.serviceRecordVisable = true
- },
- onClickHealthRecord(record) {
- console.log('ssssssssssssssss',record)
- var healthRecordServer="http://www.xmtyw.cn/wlyy/profileweb/#/" //健康档案服务
- var healthRecordServer="https://www.xmtyw.cn/wlyytest/profileweb/#/" //健康档案服务wlyytest
- window.open(healthRecordServer + '?patientCode=' + record.patient)
- // this.healthRecordVisable = true
- },
- handleCurrentChange:function(val) {
- this.page = val
- this.getJkCopdPatientPage()
- },
- getJkCopdPatientPage: function (val) {
- this.daLoading=true
- var vm =this
- var params = {
- page: this.page,
- size: this.size,
- name:this.name,
- turnDownStatus:this.turnDownStatus,
- receiveStatus:this.receiveStatus,
- archivesStatus:this.archivesStatus,
- hospital:this.hospital,
- doctorName:this.doctorName,
- isLive: this.isLive,
- firstOrg: this.firstOrg,
- startTime: this.chooseYear=='全部'?"": this.chooseYear+'-01-01',
- endTime:this.chooseYear=='全部'?"": this.chooseYear+'-12-31',
- }
- statisticAPI.jkCopdAchivesPage(params).then(function (res) {
- vm.totalCount = res.totalCount
- vm.totalPage = res.totalPage
- vm.currentPage=res.currPage
- vm.dataList = res.detailModelList
- console.log(vm.currentPage,res,'88888888888')
- vm.daLoading=false
- })
- },
- //上传
- toggle(isShow){
- this.isShow = isShow
- if(!isShow){
- this.reset()
- }
- },
- reset(type){
- this.percentage = 0
- this.success = false
- this.isOver = false
- this.errList = []
- if(type!=1){
- this.loading = false
- this.file = undefined
- this.month = ""
- }
- },
- close(type){
- this.reset(type)
- this.isProgressShow = false
- if(type!=1){
- this.isShow = false
- }
- },
- beforeUploadPic(file){
- console.log(file,'000000000000000000000')
- this.file = file
- },
- check(){
- var vm = this
- vm.loading = true
- if(!vm.file){
- vm.loading = false
- vm.$message('请选择文件');
- return
- }
- vm.save()
- },
- save(){
- var vm = this
- vm.daLoading=true
- var formData = new FormData()
- formData.append("file", vm.file)
- // vm.initProgress()
- console.log(formData, 'formData');
- httpRequest.post('doctor/jkCopd/importExcel',{
- data: formData,
- cache: false,//上传文件无需缓存
- processData: false,//用于对data参数进行序列化处理 这里必须false
- contentType: false, //必须
- }).then(function(res) {
- if(res.status == 200) {
- vm.getJkCopdPatientPage()
- vm.dicName.forEach(function(item) {
- vm.getDictByDictName(item)
- });
- vm.daLoading=false
- vm.isShow = false
- vm.$message({
- message: '导入成功!',
- type: 'success'
- });
- } else {
- vm.$message.error('导入失败!')
- vm.daLoading=false
- }
- }).catch(function(e) {
- console.error(e)
- vm.daLoading=false
- })
- },
- initProgress(){
- var vm = this
- this.isProgressShow = true
- setTimeout(()=>{
- if(!vm.isOver && vm.percentage!=90){
- vm.percentage += 10
- vm.initProgress()
- }
- }, 1000)
- }
- }
- })
|