Pārlūkot izejas kodu

Merge branch 'master' of http://192.168.1.220:10080/raolu/PC-application

hd 1 nedēļu atpakaļ
vecāks
revīzija
c08b40d775
1 mainītis faili ar 169 papildinājumiem un 166 dzēšanām
  1. 169 166
      app/jbsc/js/statistics.js

+ 169 - 166
app/jbsc/js/statistics.js

@ -1,4 +1,3 @@
function showSuccessMessage(msg) {
  layer.msg(msg, {
    icon: 1
@ -23,7 +22,7 @@ function showInfoMessage(msg) {
  })
}
var httpData=GetRequest();
var httpData = GetRequest()
new Vue({
  el: '#app',
  data: {
@ -39,25 +38,21 @@ new Vue({
    tablelist: [],
    types: [],
    Statics: {},
    scListItem:'',
    scListItem: '',
    wujilu: false,
    value1:'',
    value1: '',
    datamodelshow: true,
    centerDialogVisible: false,
	surveyResultCode:"",
	isloading:false,
	docInfo:JSON.parse(window.localStorage.getItem('docInfo')),
	jiayiShow:false,
	doctorMobile:'',
  newDropdownItems: [
  ],
  selectedNewDropdown: ''
  },
  created:function() {
	
  },
  watch:{
    surveyResultCode: '',
    isloading: false,
    docInfo: JSON.parse(window.localStorage.getItem('docInfo')),
    jiayiShow: false,
    doctorMobile: '',
    newDropdownItems: [],
    selectedNewDropdown: ''
  },
  created: function () {},
  watch: {},
  mounted: function () {
    var vm = this
    // vm.scListItem={
@ -112,90 +107,94 @@ new Vue({
    //   birthday: null
    // }
    // vm.name=vm.scListItem.patientName
    if(httpData.scListItem){
      vm.scListItem=JSON.parse(decodeURIComponent(httpData.scListItem))
      vm.name=vm.scListItem.patientName
      console.log('3333333333333333',JSON.parse(decodeURIComponent(httpData.scListItem)))
    if (httpData.scListItem) {
      vm.scListItem = JSON.parse(decodeURIComponent(httpData.scListItem))
      vm.name = vm.scListItem.patientName
      console.log('3333333333333333', JSON.parse(decodeURIComponent(httpData.scListItem)))
    }
    vm.getModal()
     // 初始化Bootstrap下拉菜单
	// 专科
	if(vm.docInfo.level == '1') {
		vm.getList()
	}else{
		vm.getDatas()
	}
    // 初始化Bootstrap下拉菜单
    // 专科
    if (vm.docInfo.level == '1') {
      vm.getList()
    } else {
      vm.getDatas()
    }
    vm.gettypes()
    vm.getDraopDown()
	parent.eventBuss.$on('guan_results',function(index){
		top.layer.close(index)
		if(vm.docInfo.level == '1') {
			vm.getList()
		}else{
			vm.getDatas()
		}
		vm.getModal()
	})
    parent.eventBuss.$on('guan_results', function (index) {
      top.layer.close(index)
      if (vm.docInfo.level == '1') {
        vm.getList()
      } else {
        vm.getDatas()
      }
      vm.getModal()
    })
  },
  methods: {
    selectTemplate: function (template) {
      this.templateCode = template.code
      $('#TemplateCode').val(template.name)
    },
	lianxijiayi:function(data) {
		this.doctorMobile = data.doctorMobile
		this.jiayiShow = true
	},
	centerDialogClick:function() {
		var vm = this
		var docInfo=JSON.parse(window.localStorage.getItem('docInfo'));
		this.centerDialogVisible = false
		vm.isloading = true
		jbscAPI.changeSurveyState({
			surveyResultCode:this.surveyResultCode,   //问卷code
			surveyStatus:1,       //surveyStatus =1 社区随访--已管理    
			doctorCode:docInfo.code        //医生code
		}).then(function(res){
			if(res.status == 200) {
				showSuccessMessage('操作成功')
				vm.isloading = false
				if(vm.docInfo.level == '1') {
					vm.getList()
				}else{
					vm.getDatas()
				}
				vm.getModal()
			}
		})
	},
    lianxijiayi: function (data) {
      this.doctorMobile = data.doctorMobile
      this.jiayiShow = true
    },
    centerDialogClick: function () {
      var vm = this
      var docInfo = JSON.parse(window.localStorage.getItem('docInfo'))
      this.centerDialogVisible = false
      vm.isloading = true
      jbscAPI
        .changeSurveyState({
          surveyResultCode: this.surveyResultCode, //问卷code
          surveyStatus: 1, //surveyStatus =1 社区随访--已管理
          doctorCode: docInfo.code //医生code
        })
        .then(function (res) {
          if (res.status == 200) {
            showSuccessMessage('操作成功')
            vm.isloading = false
            if (vm.docInfo.level == '1') {
              vm.getList()
            } else {
              vm.getDatas()
            }
            vm.getModal()
          }
        })
    },
    //获取筛查数据模型
    getModal: function () {
      var vm = this
      jbscAPI.screenStatics({
		  type:vm.docInfo.level==1?"2":'1' //  类型 1全科 2专科(默认1)
	  }).then(function (res) {
        if (res.status == 200) {
          vm.Statics = res.data
        } else {
          showErrorMessage(res.msg)
        }
      })
      jbscAPI
        .screenStatics({
          type: vm.docInfo.level == 1 ? '2' : '1' //  类型 1全科 2专科(默认1)
        })
        .then(function (res) {
          if (res.status == 200) {
            vm.Statics = res.data
          } else {
            showErrorMessage(res.msg)
          }
        })
    },
    //获取数据
    getDatas: function () {
      var vm = this
      var params = {
        diseaseType:vm.scListItem?'3': vm.type, //疾病类型
        diseaseType: vm.scListItem ? '3' : vm.type, //疾病类型
        dealType: vm.status, //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
        patientName: vm.name, //搜索居民的姓名
        isDanger: vm.isDanger, //是否高危预警(0否 1是)
        pageNo: vm.currentPage,
        pageSize: vm.pagesize,
        templateCode:  vm.scListItem?'6bcd306aaafb4e4381071346d86fadbb1': vm.selectedNewDropdown,
        startDate:vm.value1[0],
        endDate:vm.value1[1],
        patient:vm.scListItem?vm.scListItem.patientCode:"",
        onlyPatient:vm.scListItem? '1':''
        templateCode: vm.scListItem ? '6bcd306aaafb4e4381071346d86fadbb1' : vm.selectedNewDropdown,
        startDate: vm.value1[0],
        endDate: vm.value1[1],
        patient: vm.scListItem ? vm.scListItem.patientCode : '',
        onlyPatient: vm.scListItem ? '1' : ''
      }
      jbscAPI.getResultList(params).then(function (res) {
        if (res.status == 200) {
@ -211,73 +210,75 @@ new Vue({
        }
      })
    },
	getList:function() {
		var vm = this
		var params = {
			doctor: vm.docInfo.code, //专科医生code
            diseaseType: vm.type, //疾病类型
            type: vm.status, //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
            patientName: vm.name, //搜索居民的姓名
            isDanger: vm.isDanger, //是否高危预警(''否 1是 0日常健康管理)
            pageNo: vm.currentPage,
            pageSize: vm.pagesize
		}
		jbscAPI.getList(params).then(function (res) {
		  if (res.status == 200) {
		    vm.wujilu = false
		    vm.total = res.total?res.total:'0'
		    vm.pagetotal = Math.ceil(res.total / vm.pagesize)
		    vm.tablelist = res.data
		    if (vm.tablelist.length == 0) {
		      vm.wujilu = true
		    }
		  } else {
		    showErrorMessage(res.msg)
		  }
		})
	},
  getDraopDown:function(diseaseType){
    var vm=this
    console.log(diseaseType,'asdddddddddddd')
       jbscAPI.getScreenList({pageNo:1,pageSize:1000,labelType:'5',title:'',diseaseType:diseaseType}).then(function (res) {
    getList: function () {
      var vm = this
      var params = {
        doctor: vm.docInfo.code, //专科医生code
        diseaseType: vm.type, //疾病类型
        type: vm.status, //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
        patientName: vm.name, //搜索居民的姓名
        isDanger: vm.isDanger, //是否高危预警(''否 1是 0日常健康管理)
        pageNo: vm.currentPage,
        pageSize: vm.pagesize,
        templateCode: vm.scListItem ? '6bcd306aaafb4e4381071346d86fadbb1' : vm.selectedNewDropdown
      }
      jbscAPI.getList(params).then(function (res) {
        if (res.status == 200) {
          vm.wujilu = false
          vm.total = res.total ? res.total : '0'
          vm.pagetotal = Math.ceil(res.total / vm.pagesize)
          vm.tablelist = res.data
          if (vm.tablelist.length == 0) {
            vm.wujilu = true
          }
        } else {
          showErrorMessage(res.msg)
        }
      })
    },
    getDraopDown: function (diseaseType) {
      var vm = this
      console.log(diseaseType, 'asdddddddddddd')
      jbscAPI.getScreenList({ pageNo: 1, pageSize: 1000, labelType: '5', title: '', diseaseType: diseaseType }).then(function (res) {
        if (res.status == 200) {
          vm.newDropdownItems = _.map(res.data, function (v) {
            return {
              code: v.code,
              name: v.title
            }
    
          })
          if (vm.newDropdownItems.length > 1) {
            vm.newDropdownItems = [
              {
                code: 'all',
                name: '全部'
              }
            ].concat(vm.newDropdownItems)
          }
        )
        if(vm.newDropdownItems.length>1){
          vm.newDropdownItems=[
            {
              code: 'all',
              name: '全部'
            }
          ].concat(vm.newDropdownItems)
        }
      }})
  },
  exportScreenResultList:function(){
      var vm=this
      if(vm.selectedNewDropdown==''||vm.selectedNewDropdown=='all'){
      })
    },
    exportScreenResultList: function () {
      var vm = this
      if (vm.selectedNewDropdown == '' || vm.selectedNewDropdown == 'all') {
        showErrorMessage('请选中筛查表单!')
        return false
      }
      jbscAPI.exportScreenResultList({
        diseaseType: vm.type, //疾病类型
        dealType: vm.status? vm.status:'', //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
        patientName: vm.name, //搜索居民的姓名
        isDanger: vm.isDanger, //是否高危预警(0否 1是)
        pageNo: vm.currentPage,
        pageSize: vm.pagesize,
        templateCode:vm.selectedNewDropdown,
        startDate:vm.value1[0]?vm.value1[0]:'',
        endDate:vm.value1[1]?vm.value1[1]:''
      },'筛查表单.xls')
  },
      jbscAPI.exportScreenResultList(
        {
          diseaseType: vm.type, //疾病类型
          dealType: vm.status ? vm.status : '', //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
          patientName: vm.name, //搜索居民的姓名
          isDanger: vm.isDanger, //是否高危预警(0否 1是)
          pageNo: vm.currentPage,
          pageSize: vm.pagesize,
          templateCode: vm.selectedNewDropdown,
          startDate: vm.value1[0] ? vm.value1[0] : '',
          endDate: vm.value1[1] ? vm.value1[1] : ''
        },
        '筛查表单.xls'
      )
    },
    gettypes: function () {
      var vm = this
      var search = true
@ -340,17 +341,19 @@ new Vue({
              }
            ].concat(data.value)
          }
          $('#Type').bsSuggest({
            data: data,
            getDataMethod: 'data',
            effectiveFields: ['name'],
            idField: 'code',
            keyField: 'name',
          }).on('onSetSelectValue', function (e, selectedData, selectedRawData) {
            vm.getDraopDown(selectedData.id)
            vm.selectedNewDropdown=''
            console.log('onSetSelectValue: ', e.target.value, selectedData, selectedRawData);
        })
          $('#Type')
            .bsSuggest({
              data: data,
              getDataMethod: 'data',
              effectiveFields: ['name'],
              idField: 'code',
              keyField: 'name'
            })
            .on('onSetSelectValue', function (e, selectedData, selectedRawData) {
              vm.getDraopDown(selectedData.id)
              vm.selectedNewDropdown = ''
              console.log('onSetSelectValue: ', e.target.value, selectedData, selectedRawData)
            })
          vm.types = res.data
        } else {
          showErrorMessage(res.msg)
@ -399,27 +402,27 @@ new Vue({
        vm.status = status
      }
      vm.currentPage = page
	  if(vm.docInfo.level == '1') {
	  	vm.getList()
	  }else{
	  	vm.getDatas()
	  }
      if (vm.docInfo.level == '1') {
        vm.getList()
      } else {
        vm.getDatas()
      }
    },
    //转诊
    zhuanzhen: function (data) {
	console.log(data,"ssss")
      console.log(data, 'ssss')
      // showInfoMessage('PC上暂不支持,请打开手机端疑似高危记录进行转诊预约!')
      // top.layer.msg('PC上暂不支持,请打开手机端疑似高危记录进行转诊预约', { icon: 5 })
			// 如果是康复复诊过去预约挂号,在就诊信息页面少一个字段显示,1隐藏字段,0正常显示
			sessionStorage.setItem("isFuzhen",0)
      
      // 如果是康复复诊过去预约挂号,在就诊信息页面少一个字段显示,1隐藏字段,0正常显示
      sessionStorage.setItem('isFuzhen', 0)
      top.layer.open({
        type: 2,
        closeBtn: 1, // 显示关闭按钮
        area: ['800px', '90%'],
        title: '预约挂号',
        content: '../../jbsc/html/appointment/appoint-select.html?patient=' + data.patientCode + '&surveyCode='+data.code
        content: '../../jbsc/html/appointment/appoint-select.html?patient=' + data.patientCode + '&surveyCode=' + data.code
      })
    },
    //健康教育
@ -461,7 +464,7 @@ new Vue({
      //		location.href="../../../../health-education/login.html?origin=jbsc"
    },
    view: function (data) {
		var vm = this
      var vm = this
      layer.open({
        type: 2,
        //				  offset: ['100px'], //右下角弹出
@ -474,15 +477,15 @@ new Vue({
        shift: 5,
        shadeClose: false, //点击遮罩关闭层
        content: '../../jbsc/html/view_screening_results.html?isView=true&resultCode=' + data.code,
		end:function() {
			vm.tablelist = []
			if(vm.docInfo.level == '1') {
				vm.getList()
			}else{
				vm.getDatas()
			}
			vm.getModal()
		},
        end: function () {
          vm.tablelist = []
          if (vm.docInfo.level == '1') {
            vm.getList()
          } else {
            vm.getDatas()
          }
          vm.getModal()
        }
      })
    },
    //筛查
@ -562,7 +565,7 @@ new Vue({
    },
    sqsf: function (item) {
      var vm = this
	  vm.surveyResultCode = item.code
      vm.surveyResultCode = item.code
      vm.centerDialogVisible = true
    }
  }