hd 4 kuukautta sitten
vanhempi
commit
f371616565

+ 9 - 9
component/statistics/CopdServeNum/index.html

@ -12,28 +12,28 @@
    <!--=======================================================-->
    <div class="searchDiv pb20 pr20">
      <label class="c-333 c-f14">数据范围:</label>
      <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 class="formWidth" v-model="rangeCode" placeholder="请选择">
        <el-option v-for="(option, index) in rangeList" :label="option.name" :value="option.code" :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 class="formWidth" v-model="areaCode" placeholder="请选择" @change="getHospital">
        <el-option v-for="(option, index) in areaList" :label="option.name" :value="option.code" :key="option.value"></el-option>
      </el-select>
    </div>
    <div class="searchDiv pb20 pr20" v-if="form.range == 'hospital'||form.range == 'team'">
    <div class="searchDiv pb20 pr20" v-if="rangeCode=='hospital'">
      <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 class="formWidth" v-model="communityCode" placeholder="请选择">
        <el-option v-for="(option, index) in communityList" :label="option.name" :value="option.code" :key="option.code"></el-option>
      </el-select>
    </div>
    <!--=======================================================-->
    <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="eliminateClick">清除筛选条件</span>
      <el-button type="ff9526" size="mini" @click="exportTable" :disabled="exportLoading">导出</el-button>
      <!-- <span class="eliminate" @click="eliminateClick">清除筛选条件</span> -->
    </div>
    <!--=======================================================-->
  </div>

+ 51 - 93
component/statistics/CopdServeNum/index.js

@ -62,19 +62,11 @@ Vue.component('copd-serve-num', {
      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' }
      rangeList: [
        { name: '按区', code: 'town' },
        { name: '按社区', code: 'hospital' }
      ],
      areaList: [],
      tabledata: [],
      hospitalOptions: [],
      tableHeader: [
@ -96,7 +88,8 @@ Vue.component('copd-serve-num', {
      errList: [],
      daLoading: false,
      isShow: false,
      datatotal: 0
      datatotal: 0,
      exportLoading: false
    }
  },
@ -156,15 +149,15 @@ Vue.component('copd-serve-num', {
      vm.nowyear = vm.chooseYear = now.getFullYear()
      // vm.chooseYear = '2022'
      vm.nowmonth = now.getMonth() + 1
      vm.years = ['2025']
      vm.years = [2025]
      // 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.areaCode
        delete this.hospital
        delete this.form.team
      } else if (this.level == 2) {
        delete this.form.hospital
@ -176,77 +169,43 @@ Vue.component('copd-serve-num', {
    // 数据范围初始化
    initScope(type) {
      var vm = this
      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.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
      //获得缓存中缓存的角色权限
      var userRole = window.sessionStorage.getItem('selectedRole')
      if (!userRole) {
        return false
      }
      vm.userRole = JSON.parse(userRole)
      //level:2、市,3、区,4、社区,5、团队
      vm.initareaLevel = vm.areaLevel = vm.userRole.code == 'jk_350200' ? 2 : vm.userRole.code.length == 9 ? 3 : 4
      vm.initlevel = vm.level = vm.userRole.code == 'jk_350200' ? 4 : vm.userRole.code.length == 9 ? 3 : 2
      //	vm.lowLevel = vm.initlowLevel = vm.userRole.code == '350200' ? 3 : vm.userRole.code.length == 6 ? 2 : 1;
      vm.initarea = vm.area = vm.userRole.code
      vm.areaTitle = vm.userRole.name
      if (vm.initlevel == 4) {
        //市获取区
        vm.getDistrict(3, vm.initarea.substring(3), vm.areaTitle.substr(0, 3))
        vm.rangeCode = vm.rangeList[0].code
      } else if (vm.initlevel == 3) {
        //区获取社区
        vm.areaList = [{ code: vm.initarea, name: vm.areaTitle }]
        vm.areaCode = vm.initarea
        vm.rangeCode = vm.rangeList[0].code
      } else if (vm.initlevel == 2) {
        //社区获取团队
        vm.communityList = [{ code: vm.initarea, name: vm.areaTitle }]
        vm.communityCode = vm.initarea
        vm.rangeList.shift()
        vm.rangeCode = vm.rangeList[0].code
      if (vm.isGuGan) {
        return
      }
      if (type == 3) {
        this.areaCode = null
        this.communityCode = null
        if (vm.userRole.code == '350200' || vm.userRole.code == 'jk_350200') {
          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))
        } else if (vm.userRole.code.length == 10) {
          
          this.rangeList = [{ name: '按社区', code: 'hospital' }]
          this.rangeCode = 'hospital'
          this.areaList = [{ name: this.userRole.name.substring(0, 3), code: this.userRole.code.substring(0, 6) }]
          this.areaCode = this.userRole.code.substring(0, 6)
          this.communityList = [{ name: this.userRole.name, code: this.userRole.code }]
          this.communityCode = this.userRole.code
        }
      } else {
        this.communityCode = null
        if (this.rangeCode == 'hospital') vm.getDistrict(type, vm.areaCode)
      }
      vm.range = vm.rangeCode
      return
    },
    toggleField(fieldName) {
      return this.tableFieldList.indexOf(fieldName) !== -1
@ -287,17 +246,17 @@ Vue.component('copd-serve-num', {
    },
    exportTable() {
      var vm = this
      vm.daLoading = true
      vm.exportLoading = true
      var params = {
        year: this.chooseYear,
        range: this.form.range,
        area: this.form.area == '350200' ? '' : this.form.area === null ? '' : this.form.area
        range: this.rangeCode,
        area: this.areaCode == '350200' ? '' : this.areaCode === null ? '' : this.areaCode
      }
      if (this.form.range == 'hospital') {
        params.hospital = this.form.hospital
      if (this.rangeCode == 'hospital') {
        params.hospital = this.communityCode
      }
      statisticAPI.exportServiceProgress(params, '服务人数配置及进度查询.xls').then(function (res) {
        vm.daLoading = false
        vm.exportLoading = false
        vm.$message({
          message: '导出成功!',
          type: 'success'
@ -306,9 +265,9 @@ 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)
      homeAPI.getCommunityHospital({ area: vm.areaCode == '350200' ? '' : vm.areaCode }).then(function (res) {
        vm.communityList = [{ code: '', name: '全部' }]
        vm.communityList = vm.communityList.concat(res.data)
      })
    },
    getTeam(code) {
@ -340,6 +299,7 @@ Vue.component('copd-serve-num', {
        this.form = {
          range: 'town'
        }
        this.rangeCode = 'town'
      } else if (this.level == 2) {
        this.form = {
          range: 'town',
@ -390,11 +350,11 @@ Vue.component('copd-serve-num', {
      vm.daLoading = true
      var params = {
        year: this.chooseYear,
        range: this.form.range,
        area: this.form.area == '350200' ? '' : this.form.area === null ? '' : this.form.area
        range: this.rangeCode,
        area: this.areaCode == '350200' ? '' : this.areaCode === null ? '' : this.areaCode
      }
      if (this.form.range == 'hospital') {
        params.hospital = this.form.hospital
      if (this.rangeCode == 'hospital') {
        params.hospital = this.communityCode
      }
      statisticAPI.getServiceProgress(params).then(function (res) {
        vm.daLoading = false
@ -405,7 +365,6 @@ Vue.component('copd-serve-num', {
        } else {
          vm.$message.error(res.msg)
        }
        console.log(res, 'llllllllllllllllllllllllllllllll')
      })
    },
    close(type) {
@ -496,7 +455,6 @@ Vue.component('copd-serve-num', {
    EventBus.$on('copd-record-filter-change', function (event) {
      vm.quotaStrArr = event
      console.log(vm.quotaStrArr, '999sd8s9a8d9s8ad9sa89')
    })
  },
  destroyed() {