| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 | var template = ''$.ajax('../../../component/statistics/JzSituation/index.html', {  data: {},  dataType: 'html',  cache: false,  timeout: 60000,  async: false,  error: function (res) {},  success: function (res) {    template = res  }})Vue.component('jz-situation', {  template: template,  props: [],  data: function () {    return {      years: [],      yearType: '1',      chooseYear: null,      chooseTime: null,      rangeOptions: [        { label: '区', value: 'town' },        { label: '医院', value: 'hospital' },        { label: '团队', value: 'team' }      ],      areaOptions: [        { label: '思明区', value: '350203' },        { label: '海沧区', value: '350205' },        { label: '湖里区', value: '350206' },        { label: '集美区', value: '350211' },        { label: '同安区', value: '350212' },        { label: '翔安区', value: '350213' }      ],      hospitalOptions: [],      teamOptions: [],      idcard: '',      cardNo: '',      form: {        range: 'town'      },      loading: false,      exportLoading: false,      tableData: [],      tableHeader: [        { label: '患者姓名', prop: 'name', width: '110' },        { label: '身份证号', prop: 'idcard', width: '110' },        { label: '医保卡号', prop: 'cardNo', width: '110' },        { label: '就诊医院', prop: 'orgName', width: '170' },        { label: '就诊科室', prop: 'outpatientDeptName', width: '110' },        { label: '诊断名称', prop: 'icd10Name', width: '110' },        { label: '就诊类型', prop: 'outpatientTypeName', width: '110' },        { label: '就诊时间', prop: 'outpatientTime', width: '110' },        { label: '就诊流水号', prop: 'MedicalNumber', width: '110' }      ],      page: 1,      size: 10,      total: 0,      level: 0    }  },  methods: {    init() {      var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))      if (selectedRole.code.indexOf('350200') > -1) {        this.level = 1 //  市卫健委        this.areaOptions = [          { 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: 'town',          area: selectedRole.code        }        this.getHospital(selectedRole.code)      } else {        this.level = 3 // 社区管理        this.rangeOptions = [          { label: '医院', value: 'hospital' },          { label: '团队', value: 'team' }        ]        this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]        this.hospital = [{ label: selectedRole.name, value: selectedRole.code }]        this.form = {          range: 'hospital',          area: selectedRole.code.substring(0, 6),          hospital: selectedRole.code        }        this.getTeam(selectedRole.code)      }      this.initTime()      // this.getList()    },    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      }    },    getList() {      var vm = this      this.loading = true      if (this.idcard || this.cardNo) {        var params = {          cardNo: this.cardNo,          idcard: this.idcard,          page: this.page,          pageSize: this.size        }        if (this.yearType == '1') {          params.startDate = this.chooseYear + '-01-01'          params.endDate = this.chooseYear + '-12-31'        } else {          if (this.chooseTime) {            params.startDate = this.chooseTime[0]            params.endDate = this.chooseTime[1]          }        }        httpRequest.get('statistics/collaborate/outPatientList', { data: params }).then(function (res) {          if (res.status == 200) {            vm.tableData = res.detailModelList            if (res.detailModelList.length == 0) {              vm.$message.warning('暂无数据!')            }            vm.total = res.totalCount          }          vm.loading = false        })      } else {        this.$message.warning('请输入患者身份证或医保卡号进行查询!')        this.loading = false        return false      }    },    queryDate() {      this.page = 1      this.getList()    },    exportTable() {      var vm = this      if (this.idcard || this.cardNo) {        var params = {          cardNo: this.cardNo,          idcard: this.idcard        }        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 = `冠心病就诊记录表.xls`        httpRequest.downLoadFileForAjax('statistics/collaborate/exportOutPatientList', fileName, params).then(function () {          vm.exportLoading = false        })      } else {        this.$message.warning('请输入患者身份证或医保卡号进行导出!')        this.loading = false        return false      }    },    eliminateClick() {      this.resetArea()      this.yearType = '1'      this.chooseYear = new Date().getFullYear()      this.chooseTime = null      this.idcard = ''      this.cardNo = ''      this.$forceUpdate()    },    getHospital(code) {      var vm = this      delete this.form.hospital      delete this.form.team      var params = {        type: 5,        code: code      }      httpRequest.post('common/district', { data: params }).then(function (res) {        vm.hospitalOptions = res.list      })    },    getTeam(code) {      var vm = this      delete this.form.team      var params = {        hospital: code      }      httpRequest.get('statisticsExport/teamList', { data: params }).then(function (res) {        vm.teamOptions = res.data      })    },    handleCurrentChange(val) {      this.page = val      this.getList()    },    handleSizeChange(val) {      this.size = val      this.getList()    }  },  mounted() {    this.init()  }})
 |