Browse Source

慢阻肺bug

hd 3 months ago
parent
commit
e8a42d7bc1

+ 3 - 0
api/statistics-api.js

@ -557,6 +557,9 @@
    // 导出国家标准
    exportCountryStandard(data, filename){
      return httpRequest.downLoadFileForAjax('/doctor/jkCopd/exportNationalStandard', filename, data)
    },
    jkCopdPatientDetail(data){
      return httpRequest.get('/doctor/jkCopd/jkCopdPatientDetail', { data })
    }
  }

+ 2 - 0
app/statistics/js/home.js

@ -167,6 +167,7 @@ new Vue({
					
			        if(userRole.length>0){
			            window.sessionStorage.setItem("userRole", JSON.stringify(userRole));
									window.localStorage.setItem("docInfo", JSON.stringify(docInfo))
			            window.sessionStorage.setItem("docInfo", JSON.stringify(docInfo));
			            vm.roles = userRole;
			            vm.selectedRole = vm.getHighestRole(userRole).code;
@ -174,6 +175,7 @@ new Vue({
			            window.sessionStorage.setItem("selectedRole", JSON.stringify(selected));
			            $("#main").removeClass("c-hide")
			        }else if(vm.isGugan){
								window.localStorage.setItem("docInfo", JSON.stringify(docInfo))
								window.sessionStorage.setItem("docInfo", JSON.stringify(docInfo));
								var selected = {
									code: docInfo.town,

+ 2 - 2
component/statistics/CopdPatientRecord/index.html

@ -217,12 +217,12 @@
          <el-form :model="allocationForm" ref="allocationForm">
            <el-form-item label="管理机构:">{{docInfo.hospitalName}}</el-form-item>
            <el-form-item label="管理医生:" :rules="{required: true, message:'请选择管理医生'}" prop="doctor">
              <el-select v-model="allocationForm.doctor" popper-class="dropDown-select" filterable>
              <el-select v-model="allocationForm.doctor" popper-class="dropDown-select" filterable :loading="selectLoading">
                <el-option v-for="item in doctorList" :value="item.code" :label="item.name">
                  {{item.name}}
                  <span style="padding-left: 6px">已接收:{{item.receiveNum}}人</span>
                  <span style="padding-left: 6px">签约患者:{{item.signNum}}人</span>
                  <span style="padding-left: 6px">未接收:{{item.unReceiveNum}}人</span>
                  <span style="padding-left: 6px">签约患者:{{item.signNum}}人</span>
                  <span style="padding-left: 6px">非签约患者:{{item.unSignNum}}人</span>
                </el-option>
              </el-select>

+ 26 - 14
component/statistics/CopdPatientRecord/index.js

@ -67,8 +67,8 @@ Vue.component('copd-patient-record', {
      chooseYear: '',
      nowyear: '',
      areaList: [],
      areaCode: '',
      communityCode: '',
      areaCode: null,
      communityCode: null,
      fileList: [],
      file: undefined,
      isProgressShow: false,
@ -89,7 +89,8 @@ Vue.component('copd-patient-record', {
      doctorList: [],
      allocationDialog: false,
      isGuGan: false, // 判断是否是骨干,若是显示分配,若不是显示批量分配
      exportStandardLoading: false
      exportStandardLoading: false,
      selectLoading: false
    }
  },
  computed: {
@ -105,13 +106,14 @@ Vue.component('copd-patient-record', {
    var userRole = window.sessionStorage.getItem('selectedRole')
    vm.userRoleCode = JSON.parse(userRole).code
    this.initTime(vm)
    this.initScope(3)
    if(this.docInfo.expandLevelName){
      this.isGuGan = this.docInfo.expandLevelName.indexOf('慢病骨干') > -1
    }
    this.initScope(3)
    if(this.isGuGan&&JSON.parse(window.sessionStorage.getItem('userRole')).length == 0){
      // 是慢病骨干并且没有给任何权限时
    if(this.isGuGan){
      // 如何是慢病骨干 则只能选社区,并且限定死社区
      this.rangeList = [
        { name: '按社区', code: 'hospital' }
      ]
@ -154,12 +156,13 @@ Vue.component('copd-patient-record', {
        vm.getDictByDictName(item)
      })
    })
    this.getJkCopdPatientPage()
    this.dicName.forEach(function (item) {
      vm.getDictByDictName(item)
    })
    
    // 如何是骨干并且userRole的数组长度为0 则只能选社区,并且限定死社区
    setTimeout(function(){
      vm.getJkCopdPatientPage()
    },200)
  
  },
  destroyed() {
    EventBus.$off('copd-reset-select')
@ -192,11 +195,10 @@ Vue.component('copd-patient-record', {
      }
      vm.userRole = JSON.parse(userRole)
      vm.areaTitle = vm.userRole.name
      if(vm.userRole&&JSON.parse(window.sessionStorage.getItem('userRole')).length == 0){
      if(vm.isGuGan){
        return
      }
      // const type = vm.rangeCode == 'town' ? 3 : 5
      if (type == 3) {
        this.areaCode = null
        this.communityCode = null
@ -311,7 +313,7 @@ Vue.component('copd-patient-record', {
      homeAPI.getDistrict(params).then(function (res) {
        if (res.status == 200) {
          vm[param + 'List'] = list.concat(res.list)
          // vm[param + 'Code'] = vm[param + 'List'][0].code
          vm[param + 'Code'] = vm[param + 'List'][0].code
          // console.log(vm.areaList)
        } else {
          vm.$message.error(res.msg)
@ -338,7 +340,7 @@ Vue.component('copd-patient-record', {
        doctorName: this.doctorName,
        isLive: this.isLive,
        firstOrg: this.firstOrg,
        queryArea: this.userRoleCode,
        queryArea: this.areaCode,
        queryHospital: this.communityCode,
      }
      statisticAPI.exportJkCopdAchives(params, '居民档案.xls').then(function (res) {
@ -387,6 +389,14 @@ Vue.component('copd-patient-record', {
      }
    },
    queryDate() {
      if(this.rangeCode == 'town' && this.areaCode == null){
        this.$message.warning("请选择地区")
        return
      }
      if(this.rangeCode == 'hospital' && this.communityCode == null){
        this.$message.warning("请选择社区")
        return
      }
      this.getJkCopdPatientPage()
    },
    distributionHospital() {
@ -622,8 +632,10 @@ Vue.component('copd-patient-record', {
      }
      var vm = this
      this.allocationDialog = true
      this.selectLoading = true
      statisticAPI.findDoctorList({ hospital: this.docInfo.hospital }).then(function (res) {
        vm.doctorList = res.detailModelList
        vm.selectLoading = false
      })
    },
    closeAllocationDialog() {
@ -663,7 +675,7 @@ Vue.component('copd-patient-record', {
        hospital: this.hospital,
        doctorName: this.doctorName,
        isLive: this.isLive,
        queryArea: this.userRoleCode,
        queryArea: this.areaCode,
        firstOrg: this.firstOrg,
        queryHospital: this.communityCode,
        startTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-01-01',

+ 8 - 8
component/statistics/CopdPatientRecordEdit/index.html

@ -155,8 +155,8 @@
                width="100%"
                placeholder="请选择地址"
                ref="cascader"
                :options="addressOptions"
                @active-item-change="handleItemChange"
                :options="addressOptions1"
                @active-item-change="handleItemChange(addressVal, 1)"
                :props="props"
                v-model="addressVal"
              ></el-cascader>
@ -171,8 +171,8 @@
              class="copd-form-input"
              placeholder="请选择地址"
              ref="cas"
              :options="addressOptions"
              @active-item-change="handleItemChange"
              :options="addressOptions2"
              @active-item-change="handleItemChange(resiginAddressVal, 2)"
              :props="props"
              v-model="resiginAddressVal"
            ></el-cascader>
@ -308,9 +308,9 @@
                clearable
                width="100%"
                placeholder="请选择诊断地址"
                ref="cascader"
                :options="addressOptions"
                @active-item-change="handleItemChange1"
                ref="diagnosis"
                :options="addressOptions3"
                @active-item-change="handleItemChange(diagnosisAddressVal, 3)"
                :props="props"
                v-model="diagnosisAddressVal"
              ></el-cascader>
@ -405,7 +405,7 @@
              </div>
            </div>
            <el-form-item label="是否做过血气分析:"  class="copd-form-item">
              <el-select placeholder="请选择" style="width: 100%;">
              <el-select placeholder="请选择" style="width: 100%;" v-model="formData.hasBloodGas">
                <el-option
                  v-for="item in copdArr"
                  :key="item.value"

+ 94 - 58
component/statistics/CopdPatientRecordEdit/index.js

@ -51,7 +51,9 @@ Vue.component('copd-patient-record-edit', {
        { value: '是', code: '1' },
        { value: '否', code: '0' }
      ],
      addressOptions: [],
      addressOptions1: [],
      addressOptions2: [],
      addressOptions3: [],
      props: {
        label: 'name',
        value: 'code',
@ -84,29 +86,33 @@ Vue.component('copd-patient-record-edit', {
      deep: true,
      immediate: true
    },
    addressVal(value) {
      console.log(value, '0000000000000000000000')
    }
    // addressOptions:{
    //   handler(nv){
    //     console.log("addressOptions",nv);
        
    //   },
    //   deep: true
    // }
  },
  mounted() {
    var vm = this
    this.formData = JSON.parse(window.localStorage.getItem('editDetail'))
    console.log(this.formData, '00000000000000000000000000000')
    this.getDetail()
    if (this.formData.liveStreet) {
      this.addressVal = [this.formData.liveProvince, this.formData.liveCity, this.formData.liveTown, this.formData.liveStreet]
      this.getDistrict(0)
      this.getDistrict(1)
    } else {
      this.addressVal = [this.formData.liveProvince, this.formData.liveCity, this.formData.liveTown]
      this.getDistrict(0)
      this.getDistrict(1)
    }
    this.getNation()
    if (this.formData.liveStreet) {
    if (this.formData.registStreet) {
      this.resiginAddressVal = [this.formData.registProvince, this.formData.registCity, this.formData.registTown, this.formData.registStreet]
      this.getDistrict(1)
      this.getDistrict(2)
    } else {
      this.resiginAddressVal = [this.formData.registProvince, this.formData.registCity, this.formData.registTown]
      this.getDistrict(1)
      this.getDistrict(2)
    }
    this.dicName.forEach(function (item) {
      vm.getDictByDictName(item)
@ -114,8 +120,18 @@ Vue.component('copd-patient-record-edit', {
  },
  methods: {
    handleItemChange(val) {
      this.areaType = 1
    getDetail(){
      var vm = this
      statisticAPI.jkCopdPatientDetail({ id: this.formData.id}).then(function(res){
        var jkcopdPatientExpend = res.obj.jkcopdPatientExpend
        vm.formData.jkcopdPatientExpend = jkcopdPatientExpend
        vm.diagnosisAddressVal = [jkcopdPatientExpend.firstVisitProvince,jkcopdPatientExpend.firstVisitCity,jkcopdPatientExpend.firstVisitTown]
          vm.getDistrict(3)
      })
    },
    handleItemChange(val, type) {
      this.areaType = type
      // 获取地址
      if (val.length == 1) {
        // 获取市
@ -125,27 +141,11 @@ Vue.component('copd-patient-record-edit', {
        // 获取区
        this.baseTownList(val)
      }
      if (val.length == 3) {
      if (val.length == 3&&type != 3) {
        // 获取区
        this.stressList(val)
      }
    },
    handleItemChange1(val) {
      this.areaType = 2
      // 获取地址
      if (val.length == 1) {
        // 获取市
        this.baseCityList(val[0])
      }
      if (val.length == 2) {
        // 获取区
        this.baseTownList(val)
      }
      // if (val.length == 3) {
      //   // 获取区
      //   this.stressList(val)
      // }
    },
    //字典
    getDictByDictName(value) {
      var vm = this
@ -192,13 +192,19 @@ Vue.component('copd-patient-record-edit', {
        detailModelList.forEach(function (item) {
          item.children = []
        })
        vm.addressOptions = detailModelList
        if (vm.formData.liveProvince && id == 0) {
        vm['addressOptions'+ id] = JSON.parse(JSON.stringify(detailModelList))
        console.log(vm['addressOptions'+ id],"vm['addressOptions'+ id]");
        
        if (vm.formData.liveProvince && id == 1) {
          vm.baseCityList(vm.formData.liveProvince, id)
        }
        if (vm.formData.registProvince && id == 1) {
        if (vm.formData.registProvince && id == 2) {
          vm.baseCityList(vm.formData.registProvince, id)
        }
        if(vm.diagnosisAddressVal[0] && id == 3){
          vm.baseCityList(vm.diagnosisAddressVal[0], id)
        }
      })
    },
    onClickNavLink(id) {
@ -210,7 +216,13 @@ Vue.component('copd-patient-record-edit', {
    baseCityList: function (code, id) {
      var vm = this
      var activeIndex = null
      vm.addressOptions.forEach(function (item, index) {
      var num = id
      if(!num){
        num = this.areaType
      }
      var arr = vm['addressOptions' + num]
      arr.forEach(function (item, index) {
        if (item.code == code) {
          activeIndex = index
        }
@ -222,13 +234,16 @@ Vue.component('copd-patient-record-edit', {
          detailModelList.forEach(item => {
            item.children = []
          })
          vm.addressOptions[activeIndex].children = detailModelList
          if (vm.addressVal.length && id == 0) {
          arr[activeIndex].children = detailModelList
          if (vm.addressVal.length && id == 1) {
            vm.baseTownList([vm.addressVal[0], vm.addressVal[1]], id)
          }
          if (vm.resiginAddressVal.length && id == 1) {
          if (vm.resiginAddressVal.length && id == 2) {
            vm.baseTownList([vm.resiginAddressVal[0], vm.resiginAddressVal[1]], id)
          }
          if(vm.diagnosisAddressVal.length && id == 3){
            vm.baseTownList([vm.diagnosisAddressVal[0], vm.diagnosisAddressVal[1]], id)
          }
        }
      })
    },
@ -237,7 +252,8 @@ Vue.component('copd-patient-record-edit', {
      var vm = this
      var provinceIndex = null
      var activeIndex = null
      vm.addressOptions.forEach(function (item, index) {
      var arr = vm['addressOptions' + id]
      arr.forEach(function (item, index) {
        if (item.code == val[0]) {
          var children = item.children
          provinceIndex = index
@ -251,39 +267,44 @@ Vue.component('copd-patient-record-edit', {
      homeAPI.getDistrict({ type: 3, code: val[1] }).then(function (res) {
        if (res.status == 200) {
          if (vm.areaType == 1) {
            var detailModelList = res.list
          } else {
          var detailModelList = res.list
          if (val[1] == '350200'&& id == 3) {
            var detailModelList = res.list.concat({ code: '350299', name: '不详区', city: '350200', province: '350000', id: 99999 })
          }
          if (val[1] == '350200') {
            detailModelList.forEach(function (item) {
              if (vm.areaType == 1) {
                item.children = []
              } else {
                item.children = null
              }
            })
          for(let item of detailModelList){
            if(id == 3){
              
              item.children = null
            }else{
              item.children = []
            }
          }
          if (vm.addressOptions[provinceIndex].children[activeIndex]) {
            vm.addressOptions[provinceIndex].children[activeIndex].children = detailModelList
            if (vm.addressVal.length && id == 0) {
              vm.stressList([vm.addressVal[0], vm.addressVal[1], vm.addressVal[2]])
          
          if (arr[provinceIndex].children[activeIndex]) {
            arr[provinceIndex].children[activeIndex].children = detailModelList
            
            if(id == 3)return
            if (vm.addressVal.length && id == 1) {
              vm.stressList([vm.addressVal[0], vm.addressVal[1], vm.addressVal[2]],id)
            }
            if (vm.resiginAddressVal.length && id == 1) {
              vm.stressList([vm.resiginAddressVal[0], vm.resiginAddressVal[1], vm.resiginAddressVal[2]])
            if (vm.resiginAddressVal.length && id == 2) {
              vm.stressList([vm.resiginAddressVal[0], vm.resiginAddressVal[1], vm.resiginAddressVal[2]],id)
            }
          }
        }
      })
    },
    //街道
    stressList(val) {
    stressList(val, id) {
      var vm = this
      var provinceIndex = null
      var activeIndex = null
      var xIndex = null
      vm.addressOptions.forEach(function (item, index) {
      var arr = vm['addressOptions' + id]
      arr.forEach(function (item, index) {
        if (item.code == val[0]) {
          var children = item.children
          provinceIndex = index
@ -304,8 +325,8 @@ Vue.component('copd-patient-record-edit', {
      homeAPI.getDistrict({ type: 4, code: val[2] }).then(function (res) {
        if (res.status == 200) {
          var detailModelList = res.list
          if (vm.addressOptions[provinceIndex].children[activeIndex].children[xIndex]) {
            vm.addressOptions[provinceIndex].children[activeIndex].children[xIndex].children = detailModelList
          if (arr[provinceIndex].children[activeIndex].children[xIndex]) {
            arr[provinceIndex].children[activeIndex].children[xIndex].children = detailModelList
          }
        }
      })
@ -378,6 +399,21 @@ Vue.component('copd-patient-record-edit', {
            vm.formData.registStreet = ''
            vm.formData.registStreetName = ''
          }
          if(vm.diagnosisAddressVal.length){
            vm.diagnosisAddressVal.forEach(function (item, index) {
              if (index == 0) {
                vm.formData.jkcopdPatientExpend.firstVisitProvince = item
                vm.formData.jkcopdPatientExpend.firstVisitProvinceName = vm.$refs.diagnosis.currentLabels[index]
              } else if (index == 1) {
                vm.formData.jkcopdPatientExpend.firstVisitCity = item
                vm.formData.jkcopdPatientExpend.firstVisitCityName = vm.$refs.diagnosis.currentLabels[index]
              } else if (index == 2) {
                vm.formData.jkcopdPatientExpend.firstVisitTown = item
                vm.formData.jkcopdPatientExpend.firstVisitTownName = vm.$refs.diagnosis.currentLabels[index]
              }
            })
          }
          
          statisticAPI.updJkCopdPatient({ jsonData: JSON.stringify(vm.formData), doctor: vm.docInfo.code }).then(function (res) {
            if (res.status == 200) {
              EventBus.$emit('copd-reset-save')

+ 45 - 86
component/statistics/CopdRecordSearch/index.html

@ -1,12 +1,12 @@
<div class="copd-record-search-box">
  <div class="copd-filter-group ui-col-1 bgc-fff" style="min-width: 900px;">
  <div class="copd-filter-group ui-col-1 bgc-fff" style="min-width: 900px">
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
          <el-radio v-model="radio" label="1">按确诊年份:</el-radio>
          <el-select v-model="chooseYear" class="pr20 formWidth">
            <el-option v-for="(item , index) in years" :key="index" :label="item" :value="item"></el-option>
          </el-select>
        <el-radio v-model="radio" label="1">按确诊年份:</el-radio>
        <el-select v-model="chooseYear" class="pr20 formWidth">
          <el-option v-for="(item , index) in years" :key="index" :label="item" :value="item"></el-option>
        </el-select>
      </label>
    </div>
    <!--=======================================================-->
@ -14,20 +14,11 @@
      <label class="c-333 c-f14">
        <el-radio v-model="radio" label="2">确诊时间:</el-radio>
      </label>
      <el-date-picker
          v-model="value1"
          type="daterange"
          value-format="yyyy-MM-dd"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
      </el-date-picker>
      <el-date-picker v-model="value1" type="daterange" value-format="yyyy-MM-dd" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
        患者性别:
      </label>
      <label class="c-333 c-f14">患者性别:</label>
      <el-select class="pr20 formWidth" v-model="sex" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option label="男" value="1"></el-option>
@ -36,19 +27,15 @@
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
        首次诊断地区:
      </label>
      <el-select class="pr20 formWidth" v-model="firstVisitArea"  placeholder="请选择">
      <label class="c-333 c-f14">首次诊断地区:</label>
      <el-select class="pr20 formWidth" v-model="firstVisitArea" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option v-for="item in  areaArr " :key="item.code" :label="item.value" :value="item.code"></el-option>
      </el-select>
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
        首次诊断机构级别:
      </label>
      <label class="c-333 c-f14">首次诊断机构级别:</label>
      <el-select class="pr20 formWidth" v-model="firstVisitOrgLevel" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option v-for="item in orGlevelArr " :key="item.code" :label="item.value" :value="item.code"></el-option>
@ -56,9 +43,7 @@
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
        肺功能检查情况:
      </label>
      <label class="c-333 c-f14">肺功能检查情况:</label>
      <el-select class="pr20 formWidth" v-model="hasLung" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option label="是" value="1"></el-option>
@ -67,9 +52,7 @@
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
        胸部CT检查情况:
      </label>
      <label class="c-333 c-f14">胸部CT检查情况:</label>
      <el-select class="pr20 formWidth" v-model="hasCt" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option label="是" value="1"></el-option>
@ -79,9 +62,7 @@
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
        X线检查情况:
      </label>
      <label class="c-333 c-f14">X线检查情况:</label>
      <el-select class="pr20 formWidth" v-model="hasx" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option label="是" value="1"></el-option>
@ -90,9 +71,7 @@
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
        血气分析检查情况:
      </label>
      <label class="c-333 c-f14">血气分析检查情况:</label>
      <el-select class="pr20 formWidth" v-model="hasBloodGas" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option label="是" value="1"></el-option>
@ -101,9 +80,7 @@
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
        是否抽烟:
      </label>
      <label class="c-333 c-f14">是否抽烟:</label>
      <el-select class="pr20 formWidth" v-model="hasSmoke" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option v-for="item in smokeArr " :key="item.code" :label="item.value" :value="item.code"></el-option>
@ -111,9 +88,7 @@
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
        是否饮酒:
      </label>
      <label class="c-333 c-f14">是否饮酒:</label>
      <el-select class="pr20 formWidth" v-model="hasDrink" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option v-for="item in  drinkArr " :key="item.code" :label="item.value" :value="item.code"></el-option>
@ -121,63 +96,47 @@
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <label class="c-333 c-f14">
        病人转归情况:
      </label>
      <label class="c-333 c-f14">病人转归情况:</label>
      <el-select class="pr20 formWidth" v-model="diseaseConversion" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option v-for="item in conversionArr " :key="item.code" :label="item.value" :value="item.code"></el-option>
       
      </el-select>
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20 age-range">
      <label class="c-333 c-f14">
        患者年龄段:
      </label>
      <label class="c-333 c-f14">患者年龄段:</label>
      <el-select class="pr20 formWidth" v-model="age" placeholder="请选择">
        <el-option label="全部" value=""></el-option>
        <el-option v-for="item in ageArr " :key="item.code" :label="item.value" :value="item.code"></el-option>
       
      </el-select>
    </div>
    <!--=======================================================-->
    <div class="searchDiv pb20">
      <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>
      <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>
    </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">
        <el-option v-for="(item , index) in areaList" :key="index" :label="item.name"
          :value="item.code"></el-option>
      </el-select>
        <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>
        <label class="c-333 c-f14">社区:</label>
        <el-select v-model="communityCode" style="width: 200px" class="pr10">
        <el-option v-for="(item , index) in communityArr" :key="index" :label="item.name"
          :value="item.code"></el-option>
      </el-select>
          <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="ff9526" size="mini" @click="exportTable" >导出</el-button>
      <el-button type="ff9526" size="mini" @click="exportTable">导出</el-button>
      <span class="eliminate" @click="resetDate">清除筛选条件</span>
    </div>
    <!--=======================================================-->
@ -227,20 +186,20 @@
      <el-table-column prop="other" label="其他" width="180" align="center"></el-table-column>
    </el-table-column>
  </el-table> -->
  <el-table border :data="tabledata" style="width: 100%" class="mt20" v-loading="daLoading"
  >
  <el-table-column fixed type="index" label="序号" width="50" min-width="50"
    align="center"></el-table-column>
  <el-table-column prop="townName" label="地区" align="center" v-if="rangeCode == 'town'"
    min-width="100"></el-table-column>
  <el-table-column prop="hospitalName" label="社区" align="center" v-if="rangeCode == 'hospital'"
    min-width="180"></el-table-column>
  <el-table-column :prop="item.prop" :label="item.label" align="right" header-align="center"
    v-for="(item,index) in tableHeader" :key="index"></el-table-column>
</el-table>
<div class="c-t-right mt20">
  <el-pagination @current-change="handleCurrentChange" :current-page.sync="currentPage"
    :page-size="currentSize" layout="total, prev, pager, next, jumper"
    :total="datatotal"></el-pagination>
</div>
  <el-table border :data="tabledata" style="width: 100%" class="mt20" v-loading="daLoading">
    <el-table-column fixed type="index" label="序号" width="50" min-width="50" align="center"></el-table-column>
    <el-table-column prop="townName" label="地区" align="center" v-if="rangeCode == 'town'" min-width="100"></el-table-column>
    <el-table-column prop="hospitalName" label="社区" align="center" v-if="rangeCode == 'hospital'" min-width="180"></el-table-column>
    <el-table-column :prop="item.prop" :label="item.label" align="right" header-align="center" v-for="(item,index) in tableHeader" :key="index"></el-table-column>
  </el-table>
  <div class="c-t-right mt20">
    <el-pagination
      @current-change="handleCurrentChange"
      @size-change="handleSizeChange"
      :current-page.sync="page"
      :page-size="size"
      :page-sizes="[10, 20, 50]"
      layout="total, sizes, prev, pager, next, jumper"
      :total="datatotal"></el-pagination>
  </div>
</div>

+ 379 - 322
component/statistics/CopdRecordSearch/index.js

@ -1,17 +1,16 @@
// 慢阻肺患者档案-服务档案
var template = '';
var template = ''
$.ajax('../../../component/statistics/CopdRecordSearch/index.html', {
  data: {},
  dataType: 'html',
  cache: false,
  timeout: 60000,
  async: false,
  error: function (res) {
  },
  error: function (res) {},
  success: function (res) {
    template = res;
    template = res
  }
});
})
Vue.component('copd-record-search', {
  template: template,
@ -19,60 +18,58 @@ Vue.component('copd-record-search', {
  data() {
    return {
      // 当前显示的字段
      communityArr:[],
      communityArr: [],
      tableFieldList: [],
      quotaStrArr:[],
      value1:[],
      rangeList:[  {name: '按区', code: 'town'},
    {name: '按社区', code: 'hospital'},
    {name: '按市', code: 'city'}
  ],
      startTime:'',
      endTime:'',
      rangeCode:'town',
      quotaStr:'',
      range:'',
      area:'',
      hospital:'',
      page:1,
      size:50,
      sex:'',
      firstVisitType:'',
      hasLung:'',
      hasCt:'',
      hasx:'',
      hasBloodGas:'',
      hasSmoke:'',
      hasDrink:'',
      diseaseConversion:'',
      age:'',
      dataList:[],
      daLoading:false,
      datatotal:0,
      currentPage: 1,
      currentSize:50,
      quotaStrArr: [],
      value1: [],
      rangeList: [
        { name: '按区', code: 'town' },
        { name: '按社区', code: 'hospital' }
      ],
      startTime: '',
      endTime: '',
      rangeCode: 'town',
      quotaStr: '',
      range: '',
      area: '',
      hospital: '',
      page: 1,
      size: 20,
      sex: '',
      firstVisitType: '',
      hasLung: '',
      hasCt: '',
      hasx: '',
      hasBloodGas: '',
      hasSmoke: '',
      hasDrink: '',
      diseaseConversion: '',
      age: '',
      dataList: [],
      daLoading: false,
      datatotal: 0,
      chooseYear: '',
      firstVisitArea:'',
      firstVisitOrgLevel:'',
      end:'',
      start:'',
      nowyear:'',
      nowmonth:'',
      years:[],
      firstVisitArea: '',
      firstVisitOrgLevel: '',
      end: '',
      start: '',
      nowyear: '',
      nowmonth: '',
      years: [],
      radio: '1',
      dicName:['jkcopd_disease_conversion','jkcopd_age','jkcopd_smoke','jkcopd_drink','jkcopd_firstVisitType','jkcopd_first_area','jkcopd_first_org_level'],
      conversionArr:[],
      ageArr:[],
      firstVisitType:[],
      areaArr:[],
      smokeArr:[],
      drinkArr:[],
      orGlevelArr:[],
      userRole:'',
      dicName: ['jkcopd_disease_conversion', 'jkcopd_age', 'jkcopd_smoke', 'jkcopd_drink', 'jkcopd_firstVisitType', 'jkcopd_first_area', 'jkcopd_first_org_level'],
      conversionArr: [],
      ageArr: [],
      firstVisitType: [],
      areaArr: [],
      smokeArr: [],
      drinkArr: [],
      orGlevelArr: [],
      userRole: '',
      levelList: [
        {level: '4', areaLevel: '2'},
        {level: '3', areaLevel: '3'},
        {level: '2', areaLevel: '4'}
        { level: '4', areaLevel: '2' },
        { level: '3', areaLevel: '3' },
        { level: '2', areaLevel: '4' }
      ], //两种搜索,地区等级对比
      areaLevel: '', // 2、市,3、区,4、社区,5、团队
      initareaLevel: '',
@ -80,198 +77,229 @@ Vue.component('copd-record-search', {
      initarea: '',
      level: '',
      areaTitle: '',
      areaCode:'',
      communityList: [{code: '', name: '全部'}],
      communityCode: '',
      teamList: [{code: '', name: '全部'}],
      areaCode: null,
      communityList: [{ code: '', name: '全部' }],
      communityCode: null,
      teamList: [{ code: '', name: '全部' }],
      teamCode: '',
      userRoleCode:''
    };
      userRoleCode: '',
      docInfo: JSON.parse(window.localStorage.getItem('docInfo')),
      isGuGan: false,
      areaList: [],
      tabledata: [],
      tableHeader: []
    }
  },
  watch:{
    value1(va){
      if(this.radio=='2'){
        this.startTime=va[0]
        this.endTime=va[1]
  watch: {
    value1(va) {
      if (this.radio == '2') {
        this.startTime = va[0]
        this.endTime = va[1]
      }
    },
    rangeCode: function (val) {
      var vm = this;
      if (vm.initlevel != 2) {
        vm.communityCode = '';
      }
      vm.teamCode = '';
    },
    areaCode: function (val) {
      var vm = this;
      vm.selChange(3);
    },
    communityCode: function (val) {
      var vm = this;
      vm.selChange(5);
      var vm = this
      // if (vm.initlevel != 2) {
      //   vm.communityCode = ''
      // }
      // vm.teamCode = ''
    },
    // areaCode: function (val) {
    //   var vm = this
    //   vm.selChange(3)
    // },
    // communityCode: function (val) {
    //   var vm = this
    //   vm.selChange(5)
    // }
  },
  methods: {
    getCommunityList(){
     var vm=this
     statisticAPI.hospitalList({queryArea:vm.userRoleCode}).then(function(res){
      if(res.status==200){
       vm.communityArr= res.detailModelList
      }
     })
    hospitalList() {
      var vm = this
      statisticAPI.hospitalList({ queryArea: vm.userRoleCode }).then(function (res) {
        if (res.status == 200) {
          vm.communityArr = res.detailModelList
        }
      })
    },
     //字典
     getDictByDictName(value){
      var vm=this
    statisticAPI.getDictByDictName({name:value}).then(function(res){
      if(value=='jkcopd_age'){
        vm.ageArr=res.list
      }else if(value=='jkcopd_smoke'){
        vm.smokeArr=res.list
      }else if(value=='jkcopd_drink'){
        vm.drinkArr=res.list
      }else if(value=='jkcopd_first_area'){
        vm.areaArr=res.list
      }else if(value=='jkcopd_disease_conversion'){
        vm.conversionArr=res.list
      }else if(value=='jkcopd_firstVisitType'){
        vm.firstVisitTypeArr=res.list
      }else if(value=='jkcopd_first_org_level'){
        vm.orGlevelArr=res.list
        
      }
     
    })
  
    //字典
    getDictByDictName(value) {
      var vm = this
      statisticAPI.getDictByDictName({ name: value }).then(function (res) {
        if (value == 'jkcopd_age') {
          vm.ageArr = res.list
        } else if (value == 'jkcopd_smoke') {
          vm.smokeArr = res.list
        } else if (value == 'jkcopd_drink') {
          vm.drinkArr = res.list
        } else if (value == 'jkcopd_first_area') {
          vm.areaArr = res.list
        } else if (value == 'jkcopd_disease_conversion') {
          vm.conversionArr = res.list
        } else if (value == 'jkcopd_firstVisitType') {
          vm.firstVisitTypeArr = res.list
        } else if (value == 'jkcopd_first_org_level') {
          vm.orGlevelArr = res.list
        }
      })
    },
       //获取省市区  type:区3
       getDistrict: function (type, code, name) {
        var vm = this,
          list = [],
          param = '';
        if (type == 3) {
          list = [{code: code, name: name}];
          param = 'area';
        } else if (type == 5) {
          list = [{code: '', name: '全部'}];
          param = 'community';
    //获取省市区  type:区3
    getDistrict: function (type, code, name) {
      var vm = this,
        list = [],
        param = ''
      if (type == 3) {
        list = [{ code: code, name: name }]
        param = 'area'
      } else if (type == 5) {
        list = [{ code: '', name: '全部' }]
        param = 'community'
      }
      var params = {
        type: type,
        code: code
      }
      homeAPI.getDistrict(params).then(function (res) {
        if (res.status == 200) {
          vm[param + 'List'] = list.concat(res.list)
          // vm[param + 'Code'] = vm[param + 'List'][0].code
        } else {
          vm.$message.error(res.msg)
        }
        var params = {
          type: type,
          code: code
        };
        homeAPI.getDistrict(params).then(function (res) {
          if (res.status == 200) {
            vm[param + 'List'] = list.concat(res.list);
            vm[param + 'Code'] = vm[param + 'List'][0].code;
          } else {
            vm.$message.error(res.msg);
          }
        });
      },
      })
    },
    // 初始化时间
 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');
    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='2022'
  vm.nowmonth = now.getMonth() + 1;
  vm.years = [];
  for (i = vm.nowyear; i >= 2013; i--) {
    vm.years.push(i);
  }
},    
      vm.nowyear = vm.chooseYear = now.getFullYear()
      vm.chooseYear = '2022'
      vm.nowmonth = now.getMonth() + 1
      vm.years = []
      for (i = vm.nowyear; i >= 2013; i--) {
        vm.years.push(i)
      }
    },
    // 数据范围初始化
initScope(vm) {
  //获得缓存中缓存的角色权限
  var userRole = window.sessionStorage.getItem('selectedRole');
  console.log(userRole,'aaaaaaaaaaalllllooooooooooooooo')
  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;
    initScope(type) {
      var vm = this
  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;
  }
  vm.range = vm.rangeCode;
},
      //获得缓存中缓存的角色权限
      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.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 {
        this.communityCode = null
        if (this.rangeCode == 'hospital') vm.getDistrict(type, vm.areaCode)
      }
      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
      }
      vm.range = vm.rangeCode
    },
    toggleField(fieldName) {
      return this.tableFieldList.indexOf(fieldName) !== -1
    },
    manageInfo(){
      var vm =this
      this.daLoading=true
      var params={
      startTime: this.radio==1? this.chooseYear+'-01-01' : this.startTime,
      endTime:this.radio==1? this.chooseYear+'-12-31': this.endTime,
      quotaStr:this.quotaStrArr.join(','),
      range:this.rangeCode,
      area:this.areaCode=='350200'?'':this.areaCode,
      hospital:this.communityCode,
      page:1,
      size:50,
      sex:this.sex,
      firstVisitType:this.firstVisitType,
      hasLung:this.hasLung,
      hasCt:this.hasCt,
      hasx:this.hasx,
      hasBloodGas:this.hasBloodGas,
      hasSmoke:this.hasSmoke,
      hasDrink:this.hasDrink,
      diseaseConversion:this.diseaseConversion,
      age:this.age,
    manageInfo() {
      var vm = this
      this.daLoading = true
      var params = {
        startTime: this.radio == 1 ? this.chooseYear + '-01-01' : this.startTime,
        endTime: this.radio == 1 ? this.chooseYear + '-12-31' : this.endTime,
        quotaStr: this.quotaStrArr.join(','),
        range: this.rangeCode,
        area: this.areaCode == '350200' ? '' : this.areaCode,
        hospital: this.communityCode,
        page: 1,
        size: 50,
        sex: this.sex,
        firstVisitType: this.firstVisitType,
        hasLung: this.hasLung,
        hasCt: this.hasCt,
        hasx: this.hasx,
        hasBloodGas: this.hasBloodGas,
        hasSmoke: this.hasSmoke,
        hasDrink: this.hasDrink,
        diseaseConversion: this.diseaseConversion,
        age: this.age
      }
      statisticAPI.manageInfo(params).then(function(res){
        if (res.status == 200) {
          vm.tabledata = res.data.data;
          vm.datatotal = res.data.total;
          if (vm.tabledata.length) {
            vm.tableHeader = [];
            _.each(vm.tabledata[0], function (item, index) {
              if (
                index != 'town' &&
                index != 'townName' &&
                index != 'hospital' &&
                index != 'hospitalName' &&
                index != 'area' &&
                index != 'areaName' &&
                index != 'code' &&
                index != 'name'
              )
                vm.tableHeader.push({prop: index, label: index});
            });
      statisticAPI
        .manageInfo(params)
        .then(function (res) {
          if (res.status == 200) {
            vm.tabledata = res.data.data
            vm.datatotal = res.data.total
            if (vm.tabledata.length) {
              vm.tableHeader = []
              _.each(vm.tabledata[0], function (item, index) {
                if (
                  index != 'town' &&
                  index != 'townName' &&
                  index != 'hospital' &&
                  index != 'hospitalName' &&
                  index != 'area' &&
                  index != 'areaName' &&
                  index != 'code' &&
                  index != 'name'
                )
                  vm.tableHeader.push({ prop: index, label: index })
              })
            }
          } else {
            vm.$message.error(res.msg)
          }
        } else {
          vm.$message.error(res.msg);
        }
        vm.daLoading=false
      }).catch(function(err){
        vm.daLoading=false
      })
          vm.daLoading = false
        })
        .catch(function (err) {
          vm.daLoading = false
        })
    },
    bubbleSort(array) {
      for (var i = 0; i < array.length - 1; i++) {
@ -279,138 +307,167 @@ initScope(vm) {
          // 1.对每一个值和它的下一个值进行比较
          if (array[j] > array[j + 1]) {
            // 如果第一个值更多,则将其赋予自定义计数值 count
             var count = array[j];
              // 反复交换
              array[j] = array[j + 1];
              array[j + 1] = count;
           };
        };
      };
      return array;
            var count = array[j]
            // 反复交换
            array[j] = array[j + 1]
            array[j + 1] = count
          }
        }
      }
      return array
    },
    
    search(){
      if(this.quotaStrArr.length){
    search() {
      if(this.rangeCode == 'town' && this.areaCode == null){
        this.$message.warning("请选择地区")
        return
      }
      if(this.rangeCode == 'hospital' && this.communityCode == null){
        this.$message.warning("请选择社区")
        return
      }
      if (this.quotaStrArr.length) {
        this.manageInfo()
      }else{
      } else {
        this.$message({
          message: '请选择查询指标!',
          type: 'warning'
        });
        })
        return false
      }
    },
    selChange: function (type) {
      var vm = this,
        name = '';
        name = ''
      if (type == 3) {
        vm.initSelOption('community');
        vm.initSelOption('team');
        vm.getCommunityHospital();
        vm.initSelOption('community')
        vm.initSelOption('team')
        vm.getCommunityHospital()
      } else if (type == 5) {
        vm.initSelOption('team');
        vm.initSelOption('team')
        // vm.teamListByArea();
      }
    },
    initSelOption: function (param) {
      var vm = this;
      vm[param + 'List'] = [{code: '', name: '全部'}];
      var vm = this
      vm[param + 'List'] = [{ code: '', name: '全部' }]
      if (param == 'team') {
        vm[param + 'List'] = [{id: '', name: '全部'}];
        vm[param + 'List'] = [{ id: '', name: '全部' }]
      }
      vm[param + 'Code'] = vm[param + 'List'][0].code || vm[param + 'List'][0].id;
      vm[param + 'Code'] = vm[param + 'List'][0].code || vm[param + 'List'][0].id
    },
    getCommunityHospital: function () {
      var vm = this,
        list = [{code: '', name: '全部'}],
        param = 'community';
      homeAPI.getCommunityHospital({area: vm.areaCode == '350200' ? '' : vm.areaCode}).then(function (res) {
        list = [{ code: '', name: '全部' }],
        param = 'community'
      homeAPI.getCommunityHospital({ area: vm.areaCode == '350200' ? '' : vm.areaCode }).then(function (res) {
        if (res.status == 200) {
          vm[param + 'List'] = list.concat(res.data);
          vm[param + 'Code'] = vm[param + 'List'][0].code;
          vm[param + 'List'] = list.concat(res.data)
          vm[param + 'Code'] = vm[param + 'List'][0].code
        } else {
          vm.$message.error(res.msg);
          vm.$message.error(res.msg)
        }
      });
      })
    },
    exportTable(){
      var vm=this
      vm.daLoading=true
    exportTable() {
      var vm = this
      vm.daLoading = true
      //  var quotaStrs= this.bubbleSort(this.quotaStrArr)
      this.quotaStrArr.sort(function(a, b) {
        
       return a - b});
      var params={
        startTime: this.radio==1? this.chooseYear+'-01-01' : this.startTime,
        endTime:this.radio==1? this.chooseYear+'-12-31': this.endTime,
        quotaStr:this.quotaStrArr.join(','),
        range:this.rangeCode,
        area:this.areaCode=='350200'?'':this.areaCode,
        hospital:this.communityCode,
        page:1,
        size:50,
        sex:this.sex,
        firstVisitType:this.firstVisitType,
        hasLung:this.hasLung,
        hasCt:this.hasCt,
        hasx:this.hasx,
        hasBloodGas:this.hasBloodGas,
        hasSmoke:this.hasSmoke,
        hasDrink:this.hasDrink,
        diseaseConversion:this.diseaseConversion,
        age:this.age,
        }
      statisticAPI.exportManageInfo(params,'管理情况.xls').then(
         function(res){
          vm.daLoading=false
          vm.$message({
            message: '导出成功!',
            type: 'success'
          });
         }
      )
      this.quotaStrArr.sort(function (a, b) {
        return a - b
      })
      var params = {
        startTime: this.radio == 1 ? this.chooseYear + '-01-01' : this.startTime,
        endTime: this.radio == 1 ? this.chooseYear + '-12-31' : this.endTime,
        quotaStr: this.quotaStrArr.join(','),
        range: this.rangeCode,
        area: this.areaCode == '350200' ? '' : this.areaCode,
        hospital: this.communityCode,
        page: 1,
        size: 50,
        sex: this.sex,
        firstVisitType: this.firstVisitType,
        hasLung: this.hasLung,
        hasCt: this.hasCt,
        hasx: this.hasx,
        hasBloodGas: this.hasBloodGas,
        hasSmoke: this.hasSmoke,
        hasDrink: this.hasDrink,
        diseaseConversion: this.diseaseConversion,
        age: this.age
      }
      statisticAPI.exportManageInfo(params, '管理情况.xls').then(function (res) {
        vm.daLoading = false
        vm.$message({
          message: '导出成功!',
          type: 'success'
        })
      })
    },
    resetDate(){
      this.startTime='',
      this.endTime='',
      this.rangeCode='town',
      this.quotaStr='',
      this.range='',
      this.area='',
      this.hospital='',
      this.sex='',
      this.firstVisitType='',
      this.firstVisitArea='',
      this.firstVisitOrgLevel='',
      this.areaCode='',
      this.hasLung='',
      this.hasCt='',
      this.hasx='',
      this.hasBloodGas='',
      this.hasSmoke='',
      this.hasDrink='',
      this.diseaseConversion='',
      this.age=''
    resetDate() {
      ;(this.startTime = ''),
        (this.endTime = ''),
        (this.rangeCode = 'town'),
        (this.quotaStr = ''),
        (this.range = ''),
        (this.area = ''),
        (this.hospital = ''),
        (this.sex = ''),
        (this.firstVisitType = ''),
        (this.firstVisitArea = ''),
        (this.firstVisitOrgLevel = ''),
        (this.areaCode = ''),
        (this.hasLung = ''),
        (this.hasCt = ''),
        (this.hasx = ''),
        (this.hasBloodGas = ''),
        (this.hasSmoke = ''),
        (this.hasDrink = ''),
        (this.diseaseConversion = ''),
        (this.age = '')
    },
    handleCurrentChange (val) {
      this.page = val
      this.search()
    },
    handleSizeChange(val) {
      this.size = val
      this.search()
    }
  },
  mounted() {
    var vm = this
    var userRole = window.sessionStorage.getItem('selectedRole');
    vm.userRoleCode = JSON.parse(userRole).code;
    var userRole = JSON.parse(window.sessionStorage.getItem('selectedRole'))
    vm.userRoleCode = userRole.code
    this.initTime(this)
    this.initScope(this)
    this.getCommunityList()
    if (this.docInfo.expandLevelName) {
      this.isGuGan = this.docInfo.expandLevelName.indexOf('慢病骨干') > -1
    }
    this.initScope(3)
    if (this.isGuGan) {
      // 如何是慢病骨干 则只能选社区,并且限定死社区
      this.rangeList = [{ name: '按社区', code: 'hospital' }]
      this.rangeCode = 'hospital'
      this.areaList = [{ name: this.docInfo.hospitalName.substring(0, 3), code: this.docInfo.town }]
      this.areaCode = this.docInfo.town
      this.communityList = [{ name: this.docInfo.hospitalName, code: this.docInfo.hospital }]
      this.communityCode = this.docInfo.hospital
      // vm.receivingHospitalList = [{code:this.docInfo.hospital,name:this.docInfo.hospitalName}]
      // this.hospital = this.docInfo.hospital
      
    }
    
    EventBus.$on('copd-record-filter-change', function (event) {
      vm.quotaStrArr = event
      console.log(vm.quotaStrArr,'999sd8s9a8d9s8ad9sa89')
      console.log(vm.quotaStrArr, '999sd8s9a8d9s8ad9sa89')
    })
    this.dicName.forEach(function(item) {
    this.dicName.forEach(function (item) {
      vm.getDictByDictName(item)
    });
    })
    // this.manageInfo()
  },
  destroyed() {
    EventBus.$off('copd-record-filter-change');
    EventBus.$off('copd-record-filter-change')
  }
});
})

+ 42 - 4
component/statistics/CopdServiceRecord/index.html

@ -90,7 +90,7 @@
                      <template v-else>{{event.circulation}}</template>
                    </span>
                  </div>
                  <div style="width: 50%">
                  <div style="width: 50%" >
                    <span style="color: #9fa2a8">是否回退:</span>
                    <span style="color: #656565">
                      <template>{{event.isBack==0?'否':'是'}}</template>
@ -107,7 +107,7 @@
                      </template>
                    </span>
                  </div>
                  <div style="width: 50%">
                  <div style="width: 50%"  v-if="event.type!=8">
                    <span style="color: #9fa2a8">是否失访:</span>
                    <span style="color: #656565">
                      <template>{{event.isLost==0?'否':'是'}}</template>
@ -125,7 +125,7 @@
                    </span>
                  </div>
                  <div style="width: 50%">
                    <span style="color: #9fa2a8">所属机构:</span>
                    <span style="color: #9fa2a8">操作机构:</span>
                    <span style="color: #656565">
                      <template>{{event.orgName}}</template>
                      <!-- <template v-if="i% 3 == 0">———</template>
@ -240,7 +240,44 @@
                    </span>
                  </div>
                </div>
                <div class="data-title" style="color: #12b7f5; font-size: 14px" v-if="event.type==5" @click="showDetail(event)">查看随访详情</div>
                <div class="data-cont" v-else-if="event.type == 8">
                  <div style="width: 50%">
                    <span style="color: #9fa2a8">下转状态:</span>
                    <span style="color: #656565">
                      <template>{{event.turnDownStatus==0?'未下转':'已下转'}}</template>
                    </span>
                  </div>
                  <div style="width: 50%">
                    <span style="color: #9fa2a8">接收状态:</span>
                    <span style="color: #656565">
                      <template>{{event.receiveStatus==0?'未接收':'已接收'}}</template>
                    </span>
                  </div>
                  <div style="width: 50%">
                    <span style="color: #9fa2a8">分配去向</span>
                    <span style="color: #656565">
                      <template>{{event.backReason}}</template>
                    </span>
                  </div>
                  <div style="width: 50%">
                    <span style="color: #9fa2a8">分配医生</span>
                    <span style="color: #656565">
                      <template>{{event.backReason}}</template>
                    </span>
                  </div>
                  <div style="width: 50%">
                    <span style="color: #9fa2a8">操作医生:</span>
                    <span style="color: #656565">
                      <template>{{event.operaterName}}</template>
                    </span>
                  </div>
                  <div style="width: 50%">
                    <span style="color: #9fa2a8">操作机构:</span>
                    <span style="color: #656565">
                      <template>{{event.orgName}}</template>
                    </span>
                  </div>
                </div>
                <div class="data-cont" v-else>
                  <div style="width: 50%" v-for="item in event.achievesRecordList" :key="item.id">
                    <span style="color: #9fa2a8">{{item.classFieldName}}:</span>
@ -261,6 +298,7 @@
                    </span>
                  </div>
                </div>
                <div class="data-title" style="color: #12b7f5; font-size: 14px" v-if="event.type==5" @click="showDetail(event)">查看随访详情</div>
              </div>
            </div>
          </div>