hwy před 2 měsíci
rodič
revize
19e63e8d50

+ 16 - 20
component/statistics/CopdServeNum/index.html

@ -10,34 +10,30 @@
      </label>
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
    <div class="searchDiv pb20 pr20">
      <label class="c-333 c-f14">数据范围:</label>
      <el-select class="pr20 formWidth" v-model="rangeCode" placeholder="请选择">
        <el-option v-for="(option, index) in rangeList" :label="option.name" :value="option.code"></el-option>
      <el-select class="formWidth" v-model="form.range" placeholder="请选择" @change="resetArea">
        <el-option v-for="(option, index) in rangeOptions" :label="option.label" :value="option.value" :key="option.value"></el-option>
      </el-select>
    </div>
    <div class="searchDiv pb20 pr20">
      <label class="c-333 c-f14">地区:</label>
      <el-select class="formWidth" v-model="form.area" placeholder="请选择" @change="getHospital">
        <el-option v-for="(option, index) in areaOptions" :label="option.label" :value="option.value" :key="option.value"></el-option>
      </el-select>
    </div>
    <div class="searchDiv pb20 pr20" v-if="form.range == 'hospital'||form.range == 'team'">
      <label class="c-333 c-f14">社区:</label>
      <el-select class="formWidth" v-model="form.hospital" placeholder="请选择" @change="getTeam">
        <el-option v-for="(option, index) in hospitalOptions" :label="option.name" :value="option.code" :key="option.code"></el-option>
      </el-select>
    </div>
    <!--=======================================================-->
    <template v-if="rangeCode!='city'">
      <div class="searchDiv pb20">
        <label class="c-333 c-f14">地区:</label>
        <el-select v-model="areaCode" style="width: 100px" class="pr10" @change="selChange(3)">
          <el-option v-for="(item , index) in areaList" :key="index" :label="item.name" :value="item.code"></el-option>
        </el-select>
      </div>
      <!--=======================================================-->
      <div class="searchDiv pb20" v-show="rangeCode!='town'&&rangeCode!='specHos'">
        <label class="c-333 c-f14">社区:</label>
        <el-select v-model="communityCode" style="width: 200px" class="pr10">
          <el-option v-for="(item , index) in communityList" :key="index" :label="item.name" :value="item.code"></el-option>
        </el-select>
      </div>
    </template>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <el-button type="primary" size="mini" @click="search">查询</el-button>
      <el-button type="success" size="mini" @click="toggle(true)" v-if="isShowBtn">导入</el-button>
      <el-button type="ff9526" size="mini" @click="exportTable">导出</el-button>
      <span class="eliminate" @click="resetDate">清除筛选条件</span>
      <span class="eliminate" @click="eliminateClick">清除筛选条件</span>
    </div>
    <!--=======================================================-->
  </div>

+ 118 - 50
component/statistics/CopdServeNum/index.js

@ -54,12 +54,29 @@ Vue.component('copd-serve-num', {
      communityCode: null,
      teamList: [{ code: '', name: '全部' }],
      teamCode: '',
      form: {
        range: 'town'
      },
      userRoleCode: '',
      docInfo: JSON.parse(window.localStorage.getItem('docInfo')),
      isShowBtn: 0,
      isGuGan: false,
      areaList: [],
      rangeOptions: [
        { label: '区', value: 'town' },
        { label: '社区', value: 'hospital' }
      ],
      areaOptions: [
        { label: '厦门市', value: '' },
        { label: '思明区', value: '350203' },
        { label: '海沧区', value: '350205' },
        { label: '湖里区', value: '350206' },
        { label: '集美区', value: '350211' },
        { label: '同安区', value: '350212' },
        { label: '翔安区', value: '350213' }
      ],
      tabledata: [],
      hospitalOptions: [],
      tableHeader: [
        { label: '地区', prop: 'name', width: '90' },
        { label: '总患者人数', prop: 'patientNum', width: '90' },
@ -144,35 +161,60 @@ Vue.component('copd-serve-num', {
      //   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
      }
    },
    // 数据范围初始化
    initScope(type) {
      var vm = this
      //获得缓存中缓存的角色权限
      var userRole = window.sessionStorage.getItem('selectedRole')
      if (!userRole) {
        return false
      }
      vm.userRole = JSON.parse(userRole)
      vm.areaTitle = vm.userRole.name
      if (vm.isGuGan) {
        return
      }
      if (type == 3) {
        this.areaCode = null
        this.communityCode = null
        if (vm.userRole.code == '350200' || vm.userRole.code == 'jk_350200') {
          vm.isShowBtn = 1
          vm.getDistrict(type, 350200, '厦门市')
        } else if (vm.userRole.code.indexOf('jk_') > -1) {
          vm.getDistrict(type, vm.userRole.code.substring(3), vm.areaTitle.substring(0, 3))
        } else if (vm.userRole.code.length == 6) {
          vm.getDistrict(type, vm.userRole.code, vm.areaTitle.substring(0, 3))
      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' }
        ]
        this.rangeOptions = [
          { label: '区', value: 'town' },
          { label: '社区', value: 'hospital' }
        ]
        this.form = {
          range: 'town',
          area: ''
        }
      } 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.communityCode = null
        if (this.rangeCode == 'hospital') vm.getDistrict(type, vm.areaCode)
        this.level = 3 // 社区管理
        this.rangeOptions = [{ label: '社区', value: 'hospital' }]
        this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code.substring(0, 6) }]
        this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
        this.form = {
          range: 'hospital',
          area: selectedRole.code.substring(0, 6),
          hospital: selectedRole.code
        }
        this.getTeam(selectedRole.code)
      }
      return
      //获得缓存中缓存的角色权限
@ -248,11 +290,11 @@ Vue.component('copd-serve-num', {
      vm.daLoading = true
      var params = {
        year: this.chooseYear,
        range: this.rangeCode,
        area: this.areaCode == '350200' ? '' : this.areaCode === null ? '' : this.areaCode
        range: this.form.range,
        area: this.form.area == '350200' ? '' : this.form.area === null ? '' : this.form.area
      }
      if (this.rangeCode == 'hospital') {
        params.hospital = this.communityCode
      if (this.form.range == 'hospital') {
        params.hospital = this.form.hospital
      }
      statisticAPI.exportServiceProgress(params, '服务人数配置及进度查询.xls').then(function (res) {
        vm.daLoading = false
@ -262,6 +304,25 @@ Vue.component('copd-serve-num', {
        })
      })
    },
    getHospital(code) {
      var vm = this
      homeAPI.getCommunityHospital({ area: vm.form.area == '350200' ? '' : vm.form.area }).then(function (res) {
        vm.hospitalOptions = [{ code: '', name: '全部' }]
        vm.hospitalOptions = vm.hospitalOptions.concat(res.data)
      })
    },
    getTeam(code) {
      var vm = this
      delete this.form.team
      var params = {
        hospital: code,
        area: this.form.area
      }
      httpRequest.get('statisticsExport/teamList', { data: params }).then(function (res) {
        vm.teamOptions = [{ id: '', name: '全部' }]
        vm.teamOptions = vm.teamOptions.concat(res.data)
      })
    },
    resetDate() {
      if (this.isGuGan) {
        this.rangeCode = 'hospital'
@ -272,24 +333,31 @@ Vue.component('copd-serve-num', {
        this.areaCode = ''
        this.communityCode = ''
      }
      this.startTime = ''
      this.endTime = ''
      this.quotaStr = ''
      this.range = ''
      this.area = ''
      this.hospital = ''
      this.sex = ''
      this.firstVisitType = ''
      this.firstVisitArea = ''
      this.firstVisitOrgLevel = ''
      this.hasLung = ''
      this.hasCt = ''
      this.hasx = ''
      this.hasBloodGas = ''
      this.hasSmoke = ''
      this.hasDrink = ''
      this.diseaseConversion = ''
      this.age = ''
    },
    eliminateClick() {
      var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
      if (this.level == 1) {
        this.form = {
          range: 'town'
        }
      } else if (this.level == 2) {
        this.form = {
          range: 'town',
          area: selectedRole.code
        }
        this.getHospital(selectedRole.code)
      } else {
        this.form = {
          range: 'hospital',
          area: selectedRole.code.substring(0, 6),
          hospital: selectedRole.code
        }
        this.getTeam(selectedRole.code)
      }
      this.yearType = '1'
      this.chooseYear = new Date().getFullYear()
      this.chooseTime = null
      this.$forceUpdate()
    },
    handleCurrentChange(val) {
      this.page = val
@ -322,11 +390,11 @@ Vue.component('copd-serve-num', {
      vm.daLoading = true
      var params = {
        year: this.chooseYear,
        range: this.rangeCode,
        area: this.areaCode == '350200' ? '' : this.areaCode === null ? '' : this.areaCode
        range: this.form.range,
        area: this.form.area == '350200' ? '' : this.form.area === null ? '' : this.form.area
      }
      if (this.rangeCode == 'hospital') {
        params.hospital = this.communityCode
      if (this.form.range == 'hospital') {
        params.hospital = this.form.hospital
      }
      statisticAPI.getServiceProgress(params).then(function (res) {
        vm.daLoading = false