hd 3 ヶ月 前
コミット
ef5e0d00c4

+ 12 - 0
api/statistics-api.js

@ -545,6 +545,18 @@
    // 慢阻肺第二阶段三级医院随访进度及出组情况导出
    exportFollowAndOutData: function (data, filename) {
      return httpRequest.downLoadFileForAjax('/copd/statistics/exportFollowAndOutData', filename, data)
    },
    // 获取社区签约医生列表
    findDoctorList(data){
      return httpRequest.get('/doctor/jkCopd/findDoctorList', { data:data })
    },
    // 慢病骨干分配患者
    distributionPatient(data){
      return httpRequest.post('/doctor/jkCopd/distributionPatient', { data })
    },
    // 导出国家标准
    exportCountryStandard(data, filename){
      return httpRequest.downLoadFileForAjax('/doctor/jkCopd/exportNationalStandard', filename, data)
    }
  }

+ 1 - 1
app/statistics/html/comprehensive-query.html

@ -18,7 +18,7 @@
  <link href="../../../plugins/toastr/toastr.min.css" rel="stylesheet" />
  <link rel="stylesheet" type="text/css" href="../css/common.css" />
  <link rel="stylesheet" type="text/css" href="../css/comprehensive-query.css" />
  <link rel="stylesheet" type="text/css" href="../css/mzfWorksheet.css" />
  <!-- <link rel="stylesheet" type="text/css" href="../css/mzfWorksheet.css" /> -->
  <link rel="stylesheet" type="text/css" href="../../../component/statistics/CopdPatientRecordEdit/index.css" />
  <link rel="stylesheet" type="text/css" href="../../../component/statistics/CopdServiceRecord/index.css" />
  <link rel="stylesheet" type="text/css" href="../../../component/statistics/HealthRecord/index.css" />

+ 5 - 0
component/statistics/CopdPatientRecord/index.css

@ -24,4 +24,9 @@
    font-size: 14px;
    margin: 10px 15px;
    text-align: left;
}
.selected{
    border: none!important;
    padding: 0 20px!important;
}

+ 101 - 119
component/statistics/CopdPatientRecord/index.html

@ -1,9 +1,7 @@
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>慢阻肺患者档案</title>
    <link rel="stylesheet" type="text/css" href="index.css" />
@ -14,14 +12,14 @@
      <div class="copd-table-main">
        <template v-if="showTotalTable">
          <!--过滤器-->
       
          <div class="copd-filter-group ui-col-1 bgc-fff" style="min-width: 900px">
            <div class="searchDiv pb20">
              <label class="c-333 c-f14">
                  <label class="c-333 c-f14">确诊年份:</label>
                  <el-select v-model="chooseYear" class="pr20 formWidth wd160">
                    <el-option v-for="(item , index) in years" :key="index" :label="item" :value="item"></el-option>
                  </el-select>
                <label class="c-333 c-f14">确诊年份:</label>
                <el-select v-model="chooseYear" class="pr20 formWidth wd160">
                  <el-option v-for="(item , index) in years" :key="index" :label="item" :value="item"></el-option>
                </el-select>
              </label>
            </div>
            <!--=======================================================-->
@ -33,10 +31,7 @@
            <div class="searchDiv pb20">
              <label class="c-333 c-f14">下转状态:</label>
              <el-select class="pr20 formWidth" v-model="turnDownStatus" placeholder="请选择">
                <el-option
                  v-for="(option, index) in transferStatusOptions"
                  :label="option.value"
                  :value="option.code"></el-option>
                <el-option v-for="(option, index) in transferStatusOptions" :label="option.value" :value="option.code"></el-option>
                <!-- <el-option label="全部" value="item.value"></el-option> -->
              </el-select>
            </div>
@ -44,20 +39,14 @@
            <div class="searchDiv pb20">
              <label class="c-333 c-f14">接收状态:</label>
              <el-select class="pr20 formWidth" v-model="receiveStatus" placeholder="请选择">
                <el-option
                  v-for="(option, index) in receiveStatusOptions"
                  :label="option.label"
                  :value="option.value"></el-option>
                <el-option v-for="(option, index) in receiveStatusOptions" :label="option.label" :value="option.value"></el-option>
              </el-select>
            </div>
            <!--=======================================================-->
            <div class="searchDiv pb20">
              <label class="c-333 c-f14">接收社区医院:</label>
              <el-select class="pr20 formWidth" v-model="hospital" placeholder="请选择">
                <el-option
                  v-for="(option, index) in receivingHospitalList"
                  :label="option.name"
                  :value="option.code"></el-option>
                <el-option v-for="(option, index) in receivingHospitalList" :label="option.name" :value="option.code"></el-option>
              </el-select>
            </div>
            <!--=======================================================-->
@ -69,20 +58,14 @@
            <div class="searchDiv pb20">
              <label class="c-333 c-f14">随访状态:</label>
              <el-select class="pr20 formWidth" v-model="archivesStatus" placeholder="请选择">
                <el-option
                  v-for="(option, index) in followStatusArr"
                  :label="option.value"
                  :value="option.code"></el-option>
                <el-option v-for="(option, index) in followStatusArr" :label="option.value" :value="option.code"></el-option>
              </el-select>
            </div>
            <!--=======================================================-->
            <div class="searchDiv pb20">
              <label class="c-333 c-f14">生存状态:</label>
              <el-select class="pr20 formWidth" v-model="isLive" placeholder="请选择">
                <el-option
                  v-for="(option, index) in survivalStatusOption"
                  :label="option.value"
                  :value="option.code"></el-option>
                <el-option v-for="(option, index) in survivalStatusOption" :label="option.value" :value="option.code"></el-option>
              </el-select>
            </div>
            <!--=======================================================-->
@ -92,38 +75,28 @@
            </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>
              </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>
      </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 communityArr" :key="index" :label="item.name"
          :value="item.code"></el-option>
      </el-select>
      </div>
    </template>
    <!--=======================================================-->
              <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="queryDate">查询</el-button>
              <!-- <el-upload
@ -133,77 +106,64 @@
                 :file-list="fileList">
              <el-button type="success  " size="mini">导入</el-button>
            </el-upload> -->
            <!-- <div> 
              <!-- <div> 
                <input ref="imgFile" type="file" name="FileUpload" class="file-upload" @change="handlePreview">
              </div>
         -->  
              <el-button type="success  " size="mini" @click="toggle(true)">导入</el-button>
         -->
              <!-- <el-button type="success  " size="mini" @click="toggle(true)">导入</el-button> -->
              <el-button type="ff9526" size="mini" @click="exportTable">导出</el-button>
              <el-button type="ff9526" size="mini" @click="standardExport" :disabled="exportStandardLoading">国家标准导出</el-button>
              <el-button type="success" size="mini" @click="synPatient">档案同步</el-button>
              <el-button type="primary" size="mini" @click="distributionHospital">批量分配</el-button>
              <el-button type="primary" size="mini" v-if="isGuGan" @click="openAllocationDialog">分配</el-button>
              <el-button type="primary" size="mini" v-else @click="distributionHospital">批量分配</el-button>
              <span class="eliminate" @click="eliminateClick">清除筛选条件</span>
            </div>
            <!--=======================================================-->
          </div>
          <div class="ad-schedule-import">
            <el-dialog
                :destroy-on-close="true"
                title="导入"
                custom-class="schedule-import"
                :visible.sync="isShow"
                :append-to-body="true"
                width="400px">
                <div>
                    <el-form ref="form"  label-width="100px">
                        <el-form-item label="居民档案">
                            <el-upload
                                action=""
                                :before-upload="beforeUploadPic"
                                :multiple="false"
                                accept=".xls,.xlsx"
                                :show-file-list="false"
                                :file-list="fileList">
                                    <span class="fileName" style="color: #12b7f5;">{{file? file.name : '请选择文件'}}</span>
                                    <el-button style="vertical-align: middle;" size="small" type="primary">选择文件</el-button>
                            </el-upload>
                        </el-form-item>
                    </el-form>
                </div>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="toggle(false)">取 消</el-button>
                    <el-button v-loading="loading" type="primary" @click="check">确 定</el-button>
                </span>
            <el-dialog :destroy-on-close="true" title="导入" custom-class="schedule-import" :visible.sync="isShow" :append-to-body="true" width="400px">
              <div>
                <el-form ref="form" label-width="100px">
                  <el-form-item label="居民档案">
                    <el-upload action="" :before-upload="beforeUploadPic" :multiple="false" accept=".xls,.xlsx" :show-file-list="false" :file-list="fileList">
                      <span class="fileName" style="color: #12b7f5">{{file? file.name : '请选择文件'}}</span>
                      <el-button style="vertical-align: middle" size="small" type="primary">选择文件</el-button>
                    </el-upload>
                  </el-form-item>
                </el-form>
              </div>
              <span slot="footer" class="dialog-footer">
                <el-button @click="toggle(false)">取 消</el-button>
                <el-button v-loading="loading" type="primary" @click="check">确 定</el-button>
              </span>
            </el-dialog>
    
            <div >
            <el-dialog
                :destroy-on-close="true"
                title="导入进度"
                custom-class="schedule-import"
                :visible.sync="isProgressShow"
                :append-to-body="true"
                :close-on-click-modal="false"
                :close-on-press-escape="false"
                :show-close="false"
                width="400px">
                <div class="tc">
                    <div class="mb20">{{percentage!=100? '批量处理中,请耐心等待' : success? '处理成功!' : '处理失败,请重试'}}</div>
                    <el-progress v-if="percentage!=100||success"  :percentage="percentage"></el-progress>
                    <el-progress v-else="" status="exception" :percentage="percentage"></el-progress>
                    <div class="err-list" v-if="errList&&errList.length">
                        <div v-for="(item, i) in errList" :key="i" v-html="item.errorMes"></div>
                    </div>
                    <div class="mt20">
                        <el-button v-if="percentage!=100" type="info">处理中...</el-button>
                        <el-button @click="close()" v-else-if="success" type="primary">处理成功</el-button>
                        <el-button @click="close(1)" v-else type="danger">重试</el-button>
                    </div>
    
              :destroy-on-close="true"
              title="导入进度"
              custom-class="schedule-import"
              :visible.sync="isProgressShow"
              :append-to-body="true"
              :close-on-click-modal="false"
              :close-on-press-escape="false"
              :show-close="false"
              width="400px">
              <div class="tc">
                <div class="mb20">{{percentage!=100? '批量处理中,请耐心等待' : success? '处理成功!' : '处理失败,请重试'}}</div>
                <el-progress v-if="percentage!=100||success" :percentage="percentage"></el-progress>
                <el-progress v-else="" status="exception" :percentage="percentage"></el-progress>
                <div class="err-list" v-if="errList&&errList.length">
                  <div v-for="(item, i) in errList" :key="i" v-html="item.errorMes"></div>
                </div>
                <div class="mt20">
                  <el-button v-if="percentage!=100" type="info">处理中...</el-button>
                  <el-button @click="close()" v-else-if="success" type="primary">处理成功</el-button>
                  <el-button @click="close(1)" v-else type="danger">重试</el-button>
                </div>
              </div>
            </el-dialog>
            </div>
        </div>
          <el-table style="width: 100%" :data="dataList" v-loading="daLoading"  @selection-change="selectionLineChangeHandle">
          </div>
          <el-table style="width: 100%" :data="dataList" v-loading="daLoading" @selection-change="selectionLineChangeHandle">
            <el-table-column type="selection" width="55"></el-table-column>
            <el-table-column prop="name" label="患者姓名" width="180"></el-table-column>
            <el-table-column prop="nationality" label="国籍" width="180"></el-table-column>
@ -238,9 +198,11 @@
            <!-- TODO 修正 -->
            <el-pagination
              @current-change="handleCurrentChange"
              :current-page.sync="currentPage"
              :page-size="currentSize"
              layout="total, prev, pager, next, jumper"
              @size-change="handleSizeChange"
              :current-page.sync="page"
              :page-size="size"
              :page-sizes="[10, 20, 50]"
              layout="total, sizes, prev, pager, next, jumper"
              :total="totalCount"></el-pagination>
          </div>
        </template>
@ -248,11 +210,31 @@
          <copd-patient-record-edit :editData="currentEditData" ref="editName"></copd-patient-record-edit>
        </template>
        <template v-else-if="serviceRecordVisable">
          <copd-service-record :detailInfo="currentEditData" ></copd-service-record>
          <copd-service-record :detailInfo="currentEditData" @back="back"></copd-service-record>
        </template>
        <template v-else-if="healthRecordVisable">
          <health-record></health-record>
        </template>
        <el-dialog title="分配管理医生" :visible.sync="allocationDialog" width="500px">
          <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-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.unSignNum}}人</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-button @click="closeAllocationDialog">取 消</el-button>
            <el-button type="primary" @click="allocationFn">确 定</el-button>
          </span>
        </el-dialog>
      </div>
    </div>
  </body>

+ 447 - 377
component/statistics/CopdPatientRecord/index.js

@ -1,4 +1,3 @@
// 慢阻肺患者档案表格组件
var template = ''
$.ajax('../../../component/statistics/CopdPatientRecord/index.html', {
@ -19,79 +18,80 @@ Vue.component('copd-patient-record', {
  data() {
    return {
      docInfo: JSON.parse(window.localStorage.getItem('docInfo')),
      daLoading:false,
      dataList: [
      ],
      daLoading: false,
      dataList: [],
      // 当前编辑的数据,点击编辑按钮后设置,取消或退出则清空
      currentEditData: null,
      // 编辑页面是否显示
      editViewVisable: false,
      userRoleCode:'',
      userRoleCode: '',
      //服务记录是否显示
      serviceRecordVisable: false,
      transferStatusOptions:[{code:'',value:'全部'}],
      recordStatusOptions:[{code:'',value:'全部'}],
      followStatusArr:[{code:'',value:'全部'}],
      receivingHospitalList:[{code:'',name:'全部'}],
      receiveStatusOptions:[{value:'',label:'全部'},{value:'1',label:' 已接收'},{value:'0',label:' 未接收'}],
      survivalStatusOption:[{code:'',value:'全部'}],
      transferStatusOptions: [{ code: '', value: '全部' }],
      recordStatusOptions: [{ code: '', value: '全部' }],
      followStatusArr: [{ code: '', value: '全部' }],
      receivingHospitalList: [{ code: '', name: '全部' }],
      receiveStatusOptions: [
        { value: '', label: '全部' },
        { value: '1', label: ' 已接收' },
        { value: '0', label: ' 未接收' }
      ],
      survivalStatusOption: [{ code: '', value: '全部' }],
      // 健康档案是否显示
      healthRecordVisable: false,
      page: 1,
      size: 50,
      currentSize:50,
      currentPage: 1,
      rangeList:[{name: '按区', code: 'town'}],
      rangeCode:'town',
      size: 20,
      rangeList: [{ name: '按区', code: 'town' }],
      rangeCode: 'town',
      totalPage: 0,
      totalCount: 0,
      name:'',
      years:'',
      turnDownStatus:'',
      receiveStatus:'',
      archivesStatus:'',
      hospital:'',
      doctorName:'',
      name: '',
      years: '',
      turnDownStatus: '',
      receiveStatus: '',
      archivesStatus: '',
      hospital: '',
      doctorName: '',
      isLive: '',
      patientCode:'',
      patientCode: '',
      firstOrg: '',
      currentSelect:[],
      followupStatus:[],
      dicName:['jkcopd_archivesStatus','jkcopd_turnDownStatus','jkcopd_isLive','jkcopd_followup_status'],
      currentSelect: [],
      followupStatus: [],
      dicName: ['jkcopd_archivesStatus', 'jkcopd_turnDownStatus', 'jkcopd_isLive', 'jkcopd_followup_status'],
      isShow: false,
      startTime:'',
      endTime:'',
      startTime: '',
      endTime: '',
      chooseYear: '',
      nowyear:'',
      areaList:[],
      areaCode:"",
      communityCode:'',
            fileList: [],
            file: undefined,
            isProgressShow: false,
            percentage: 0,
            success: false,
            loading: false,
            isOver: false,
            status: "",
            errList: [],
            pickerOptions: {
                disabledDate(time) {
                    let timeSpace = time.getTime() <= moment.toDate().getTime();
                    return timeSpace;
                }
            },
      nowyear: '',
      areaList: [],
      areaCode: '',
      communityCode: '',
      fileList: [],
      file: undefined,
      isProgressShow: false,
      percentage: 0,
      success: false,
      loading: false,
      isOver: false,
      status: '',
      errList: [],
      pickerOptions: {
        disabledDate(time) {
          let timeSpace = time.getTime() <= moment.toDate().getTime()
          return timeSpace
        }
      },
      communityList: [],
      allocationForm: {},
      doctorList: [],
      allocationDialog: false,
      isGuGan: false, // 判断是否是骨干,若是显示分配,若不是显示批量分配
      exportStandardLoading: false
    }
  },
  computed: {
    showTotalTable() {
      return (
        this.currentEditData == null &&
        this.editViewVisable == false &&
        this.serviceRecordVisable == false &&
        this.healthRecordVisable == false
      )
      return this.currentEditData == null && this.editViewVisable == false && this.serviceRecordVisable == false && this.healthRecordVisable == false
    },
    showEditView() {
      return this.currentEditData && this.editViewVisable
@ -99,11 +99,13 @@ Vue.component('copd-patient-record', {
  },
  mounted() {
    var vm = this
    var userRole = window.sessionStorage.getItem('selectedRole');
    vm.userRoleCode = JSON.parse(userRole).code;
    var userRole = window.sessionStorage.getItem('selectedRole')
    vm.userRoleCode = JSON.parse(userRole).code
    this.initTime(vm)
    this.initScope(this)
    this.hospitalList()
    this.isGuGan = this.docInfo.expandLevelName.indexOf('慢病骨干') > -1
    EventBus.$on('copd-reset-select', function () {
      vm.currentEditData = null
      vm.editViewVisable = false
@ -115,20 +117,24 @@ Vue.component('copd-patient-record', {
      vm.editViewVisable = false
      vm.serviceRecordVisable = false
      vm.healthRecordVisable = false
      vm.transferStatusOptions=[{code:'',value:'全部'}],
      vm.recordStatusOptions=[{code:'',value:'全部'}],
      vm.followStatusArr=[{code:'',value:'全部'}],
      vm.receiveStatusOptions=[{value:'',label:'全部'},{value:'1',label:' 已接收'},{value:'0',label:' 未接收'}],
      vm.survivalStatusOption=[{code:'',value:'全部'}],
      vm.getJkCopdPatientPage()
      vm.dicName.forEach(function(item) {
      ;(vm.transferStatusOptions = [{ code: '', value: '全部' }]),
        (vm.recordStatusOptions = [{ code: '', value: '全部' }]),
        (vm.followStatusArr = [{ code: '', value: '全部' }]),
        (vm.receiveStatusOptions = [
          { value: '', label: '全部' },
          { value: '1', label: ' 已接收' },
          { value: '0', label: ' 未接收' }
        ]),
        (vm.survivalStatusOption = [{ code: '', value: '全部' }]),
        vm.getJkCopdPatientPage()
      vm.dicName.forEach(function (item) {
        vm.getDictByDictName(item)
      });
      })
    })
    this.getJkCopdPatientPage()
    this.dicName.forEach(function(item) {
    this.dicName.forEach(function (item) {
      vm.getDictByDictName(item)
    });
    })
  },
  destroyed() {
    EventBus.$off('copd-reset-select')
@ -136,252 +142,251 @@ Vue.component('copd-patient-record', {
  },
  methods: {
    // 初始化时间
 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='全部'
  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 = '全部'
      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,'ssssssssssllllllllllllllll')
      var userRole = window.sessionStorage.getItem('selectedRole')
      if (!userRole) {
        return false;
        return false
      }
      vm.userRole = JSON.parse(userRole);
      console.log(vm.userRole.code.length,'aaaaaaaaapppppppppppppppppp')
      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.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;
    
      vm.initarea = vm.area = vm.userRole.code
      vm.areaTitle = vm.userRole.name
      // console.log(vm.initlevel,"vm.initlevel");
      
      if (vm.initlevel == 4) {
        //市获取区
        vm.getDistrict(3, vm.initarea.substring(3), vm.areaTitle.substr(0, 3));
        vm.rangeCode = vm.rangeList[0].code;
        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;
        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.communityList = [{ code: vm.initarea, name: vm.areaTitle }]
        vm.communityCode = vm.initarea
        vm.rangeList.shift()
        vm.rangeCode = vm.rangeList[0]?.code
      }
      vm.range = vm.rangeCode;
      vm.range = vm.rangeCode
    },
    handlePreview(value) {
      var vm = this
			var file = value.target.files[0]
      this.daLoading=true
      console.log(file,'vvvvvvvvvvvv',value,value.target.files[0])
			if(file && file.size) {
				var formFile = new FormData()
            formFile.append("file", file)
            httpRequest.post('doctor/jkCopd/importExcel',{
              data: formFile,
              cache: false,//上传文件无需缓存
                processData: false,//用于对data参数进行序列化处理 这里必须false
                contentType: false, //必须
            }).then(function(res) {
              if(res.status == 200) {
                vm.getJkCopdPatientPage()
                vm.dicName.forEach(function(item) {
                  vm.getDictByDictName(item)
                });
              vm.daLoading=false
              vm.$message({
			          message: '导入成功!',
			          type: 'success'
			        });
              } else {
                vm.$message.error('导入失败!')
                vm.daLoading=false
              }
            }).catch(function(e) {
              console.error(e)
              vm.daLoading=false
            })
            // statisticAPI.importExcel({file:formFile}).then(function(res){
            //   console.log('22222222222',res)
            // })
          }
    },
        //获取省市区  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) {
      var file = value.target.files[0]
      this.daLoading = true
      if (file && file.size) {
        var formFile = new FormData()
        formFile.append('file', file)
        httpRequest
          .post('doctor/jkCopd/importExcel', {
            data: formFile,
            cache: false, //上传文件无需缓存
            processData: false, //用于对data参数进行序列化处理 这里必须false
            contentType: false //必须
          })
          .then(function (res) {
            if (res.status == 200) {
              vm[param + 'List'] = list.concat(res.list);
              vm[param + 'Code'] = vm[param + 'List'][0].code;
              vm.getJkCopdPatientPage()
              vm.dicName.forEach(function (item) {
                vm.getDictByDictName(item)
              })
              vm.daLoading = false
              vm.$message({
                message: '导入成功!',
                type: 'success'
              })
            } else {
              vm.$message.error(res.msg);
              vm.$message.error('导入失败!')
              vm.daLoading = false
            }
          });
        },
    hospitalList(){
      var vm=this
    statisticAPI.hospitalList({queryArea:vm.userRoleCode}).then(function(res){
      vm.receivingHospitalList=vm.receivingHospitalList&& vm.receivingHospitalList.concat(res.detailModelList)
    })
          })
          .catch(function (e) {
            console.error(e)
            vm.daLoading = false
          })
        // statisticAPI.importExcel({file:formFile}).then(function(res){
        //   console.log('22222222222',res)
        // })
      }
    },
    //获取省市区  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)
        }
      })
    },
    hospitalList() {
      var vm = this
      statisticAPI.hospitalList({ queryArea: vm.userRoleCode }).then(function (res) {
        vm.receivingHospitalList = vm.receivingHospitalList && vm.receivingHospitalList.concat(res.detailModelList)
      })
    },
    exportTable(){
      var vm=this
      vm.daLoading=true
    exportTable() {
      var vm = this
      vm.daLoading = true
      var params = {
        startTime: this.chooseYear=='全部'?'': this.chooseYear+'-01-01',
        endTime:this.chooseYear=='全部'?'': this.chooseYear+'-12-31',
        name:this.name,
        turnDownStatus:this.turnDownStatus,
        receiveStatus:this.receiveStatus,
        archivesStatus:this.archivesStatus,
        hospital:this.hospital,
        doctorName:this.doctorName,
        startTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-01-01',
        endTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-12-31',
        name: this.name,
        turnDownStatus: this.turnDownStatus,
        receiveStatus: this.receiveStatus,
        archivesStatus: this.archivesStatus,
        hospital: this.hospital,
        doctorName: this.doctorName,
        isLive: this.isLive,
        firstOrg: this.firstOrg,
        queryArea:this.userRoleCode
        queryArea: this.userRoleCode
      }
      statisticAPI.exportJkCopdAchives(params,'居民档案.xls').then(
         function(res){
          vm.daLoading=false
          vm.$message({
            message: '导出成功!',
            type: 'success'
          });
         }
      )
    },
    selectionLineChangeHandle(val){
      var vm=this
      var arr=[]
      val.forEach(function(item){
      statisticAPI.exportJkCopdAchives(params, '居民档案.xls').then(function (res) {
        vm.daLoading = false
        vm.$message({
          message: '导出成功!',
          type: 'success'
        })
      })
    },
    selectionLineChangeHandle(val) {
      var vm = this
      var arr = []
      val.forEach(function (item) {
        arr.push(item.id)
      })
      vm.currentSelect=arr
      vm.currentSelect = arr
    },
    synPatient(){
      var vm=this
      if(vm.currentSelect.length){
        statisticAPI.synPatient({
          ids:vm.currentSelect.join(','),
          doctor: vm.docInfo.code
        }).then(function(res){
          if(res.status=='200'){
            vm.$message({
              message: res.message,
              type: 'success'
            });
            vm.getJkCopdPatientPage()
            vm.dicName.forEach(function(item) {
              vm.getDictByDictName(item)
            });
            
          }else{
            vm.$message({
              message: res.message,
              type: 'warning'
            });
          }
        })
      }else{
    synPatient() {
      var vm = this
      if (vm.currentSelect.length) {
        statisticAPI
          .synPatient({
            ids: vm.currentSelect.join(','),
            doctor: vm.docInfo.code
          })
          .then(function (res) {
            if (res.status == '200') {
              vm.$message({
                message: res.message,
                type: 'success'
              })
              vm.getJkCopdPatientPage()
              vm.dicName.forEach(function (item) {
                vm.getDictByDictName(item)
              })
            } else {
              vm.$message({
                message: res.message,
                type: 'warning'
              })
            }
          })
      } else {
        vm.$message('请勾选患者!')
      }
    },
    queryDate(){
    queryDate() {
      this.getJkCopdPatientPage()
    },
    distributionHospital(){
      var vm=this
      if(vm.currentSelect.length){
       vm.daLoading=true
        statisticAPI.distributionHospital({
          type:1,
          ids:vm.currentSelect.join(','),
          doctor: vm.docInfo.code
        }).then(function(res){
          if(res.status=='200'){
            vm.daLoading=false
            vm.$message({
              message: res.message,
              type: 'success'
            });
            vm.getJkCopdPatientPage()
            vm.dicName.forEach(function(item) {
              vm.getDictByDictName(item)
            });
            
          }else{
            vm.daLoading=false
            vm.$message({
              message: res.message,
              type: 'warning'
            });
          }
        })
      }else{
        vm.daLoading=false
    distributionHospital() {
      var vm = this
      if (vm.currentSelect.length) {
        vm.daLoading = true
        statisticAPI
          .distributionHospital({
            type: 1,
            ids: vm.currentSelect.join(','),
            doctor: vm.docInfo.code
          })
          .then(function (res) {
            if (res.status == '200') {
              vm.daLoading = false
              vm.$message({
                message: res.message,
                type: 'success'
              })
              vm.getJkCopdPatientPage()
              vm.dicName.forEach(function (item) {
                vm.getDictByDictName(item)
              })
            } else {
              vm.daLoading = false
              vm.$message({
                message: res.message,
                type: 'warning'
              })
            }
          })
      } else {
        vm.daLoading = false
        vm.$message('请勾选患者!')
      }
    },
    eliminateClick(){
      this.name='',
      this.turnDownStatus='',
      this.receiveStatus='',
      this.archivesStatus='',
      this.hospital='',
      this.doctorName='',
      this.isLive= '',
      this.firstOrg= ''
    eliminateClick() {
      ;(this.name = ''),
        (this.turnDownStatus = ''),
        (this.receiveStatus = ''),
        (this.archivesStatus = ''),
        (this.hospital = ''),
        (this.doctorName = ''),
        (this.isLive = ''),
        (this.firstOrg = '')
    },
    //下转状态
    getDictByDictName(value){
      var vm=this
    statisticAPI.getDictByDictName({name:value}).then(function(res){
      if(value=='jkcopd_turnDownStatus'){
        vm.transferStatusOptions= vm.transferStatusOptions.concat(res.list)
      }else if(value=='jkcopd_archivesStatus'){
        vm.recordStatusOptions=vm.recordStatusOptions.concat(res.list)
      }else if(value=='jkcopd_isLive'){
        vm.survivalStatusOption=  vm.survivalStatusOption.concat(res.list)
      }else if(value=='jkcopd_followup_status'){
        vm.followStatusArr=  vm.followStatusArr.concat(res.list)
      }
      
    })
  
    getDictByDictName(value) {
      var vm = this
      statisticAPI.getDictByDictName({ name: value }).then(function (res) {
        if (value == 'jkcopd_turnDownStatus') {
          vm.transferStatusOptions = vm.transferStatusOptions.concat(res.list)
        } else if (value == 'jkcopd_archivesStatus') {
          vm.recordStatusOptions = vm.recordStatusOptions.concat(res.list)
        } else if (value == 'jkcopd_isLive') {
          vm.survivalStatusOption = vm.survivalStatusOption.concat(res.list)
        } else if (value == 'jkcopd_followup_status') {
          vm.followStatusArr = vm.followStatusArr.concat(res.list)
        }
      })
    },
    onClickEdit(record) {
      window.localStorage.setItem('editDetail',JSON.stringify(record))
      window.localStorage.setItem('editDetail', JSON.stringify(record))
      if (!record) {
        return
      }
@ -393,157 +398,222 @@ Vue.component('copd-patient-record', {
      this.serviceRecordVisable = true
    },
    /*打开预览链接*/
openURL (url) {
  let aLabel = document.createElement('a');
  //设置链接
  aLabel.setAttribute('href', url);
  //新窗口打开链接
  aLabel.setAttribute('target', '_blank');
  //设置标签ID
  aLabel.setAttribute('id', 'reportpoint');
  // 防止反复添加
  if (document.getElementById('reportpoint')) {
      document.body.removeChild(document.getElementById('reportpoint'));
     }
  document.body.appendChild(aLabel);
  aLabel.click();
  console.log("打开链接:",url);
  //window.open(url);
},
    openURL(url) {
      let aLabel = document.createElement('a')
      //设置链接
      aLabel.setAttribute('href', url)
      //新窗口打开链接
      aLabel.setAttribute('target', '_blank')
      //设置标签ID
      aLabel.setAttribute('id', 'reportpoint')
      // 防止反复添加
      if (document.getElementById('reportpoint')) {
        document.body.removeChild(document.getElementById('reportpoint'))
      }
      document.body.appendChild(aLabel)
      aLabel.click()
      //window.open(url);
    },
    onClickHealthRecord(record) {
      this.getCode(record.idcard)
    },
    getCode(idcard){
      var vm=this
    getCode(idcard) {
      var vm = this
      this.patientCode = ''
      statisticAPI.getPatientAccetokenByIdcard({idcard:idcard}).then(function(res){
      if (res.status == 200) {
        vm.patientCode=res.data.patientCode
        var  healthRecordServer="http://www.xmtyw.cn/wlyy/profileweb/#/menzhen"  //健康档案服务
        //var healthRecordServer="https://www.xmtyw.cn/wlyytest/profileweb/#/menzhen"  //健康档案服务wlyytest
      window.open(healthRecordServer + '?patientCode=' + res.data.patientCode)
      }else{
        vm.patientCode=''
        this.$message.error('获取授权码失败')
      statisticAPI.getPatientAccetokenByIdcard({ idcard: idcard }).then(function (res) {
        if (res.status == 200) {
          vm.patientCode = res.data.patientCode
          var healthRecordServer = 'http://www.xmtyw.cn/wlyy/profileweb/#/menzhen' //健康档案服务
          //var healthRecordServer="https://www.xmtyw.cn/wlyytest/profileweb/#/menzhen"  //健康档案服务wlyytest
          window.open(healthRecordServer + '?patientCode=' + res.data.patientCode)
        } else {
          vm.patientCode = ''
          this.$message.error('获取授权码失败')
          return
      }
        }
      })
    },
  	handleCurrentChange:function(val) {
    handleCurrentChange: function (val) {
      this.page = val
      this.getJkCopdPatientPage()
    },
    handleSizeChange(val) {
      this.size = val
      this.getJkCopdPatientPage()
    },
    getJkCopdPatientPage: function (val) {
      this.daLoading=true
      var vm =this
      this.daLoading = true
      var vm = this
      var params = {
        page: this.page,
        size: this.size,
        name:this.name,
        turnDownStatus:this.turnDownStatus,
        receiveStatus:this.receiveStatus,
        archivesStatus:this.archivesStatus,
        hospital:this.hospital,
        doctorName:this.doctorName,
        name: this.name,
        turnDownStatus: this.turnDownStatus,
        receiveStatus: this.receiveStatus,
        archivesStatus: this.archivesStatus,
        hospital: this.hospital,
        doctorName: this.doctorName,
        isLive: this.isLive,
        queryArea:this.userRoleCode,
        queryArea: this.userRoleCode,
        firstOrg: this.firstOrg,
        startTime: this.chooseYear=='全部'?"": this.chooseYear+'-01-01',
        endTime:this.chooseYear=='全部'?"": this.chooseYear+'-12-31',
        startTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-01-01',
        endTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-12-31'
      }
      statisticAPI.jkCopdAchivesPage(params).then(function (res) {
        vm.totalCount = res.totalCount
        vm.totalPage = res.totalPage
        vm.currentPage=res.currPage
        vm.dataList = res.detailModelList
        console.log(vm.currentPage,res,'88888888888')
        vm.daLoading=false
        vm.daLoading = false
      })
    },
    //上传
    toggle(isShow){
    toggle(isShow) {
      this.isShow = isShow
      if(!isShow){
          this.reset()
      if (!isShow) {
        this.reset()
      }
  },
  reset(type){
    },
    reset(type) {
      this.percentage = 0
      this.success = false
      this.isOver = false
      this.errList = []
      if(type!=1){
          this.loading = false
          this.file = undefined
          this.month = ""
      if (type != 1) {
        this.loading = false
        this.file = undefined
        this.month = ''
      }
  },
  close(type){
    },
    close(type) {
      this.reset(type)
      this.isProgressShow = false
      if(type!=1){
          this.isShow = false
      if (type != 1) {
        this.isShow = false
      }
  },
  beforeUploadPic(file){
    console.log(file,'000000000000000000000')
    },
    beforeUploadPic(file) {
      this.file = file
  },
  check(){
    },
    check() {
      var vm = this
      vm.loading = true
      if(!vm.file){
          vm.loading = false
          vm.$message('请选择文件');
          return
      if (!vm.file) {
        vm.loading = false
        vm.$message('请选择文件')
        return
      }
      vm.save()
  },
  save(){
    },
    save() {
      var vm = this
      vm.daLoading=true
      vm.daLoading = true
      var formData = new FormData()
      formData.append("file", vm.file)
      formData.append('file', vm.file)
      // vm.initProgress()
      console.log(formData, 'formData');
      httpRequest.post('doctor/jkCopd/importExcel',{
        data: formData,
        cache: false,//上传文件无需缓存
          processData: false,//用于对data参数进行序列化处理 这里必须false
          contentType: false, //必须
      }).then(function(res) {
        if(res.status == 200) {
          vm.getJkCopdPatientPage()
          vm.dicName.forEach(function(item) {
            vm.getDictByDictName(item)
          });
        vm.daLoading=false
        vm.isShow = false
        vm.$message({
          message: '导入成功!',
          type: 'success'
        });
        } else {
          vm.$message.error('导入失败!')
          vm.daLoading=false
        }
      }).catch(function(e) {
        console.error(e)
        vm.daLoading=false
      })
  },
  initProgress(){
      httpRequest
        .post('doctor/jkCopd/importExcel', {
          data: formData,
          cache: false, //上传文件无需缓存
          processData: false, //用于对data参数进行序列化处理 这里必须false
          contentType: false //必须
        })
        .then(function (res) {
          if (res.status == 200) {
            vm.getJkCopdPatientPage()
            vm.dicName.forEach(function (item) {
              vm.getDictByDictName(item)
            })
            vm.daLoading = false
            vm.isShow = false
            vm.$message({
              message: '导入成功!',
              type: 'success'
            })
          } else {
            vm.$message.error('导入失败!')
            vm.daLoading = false
          }
        })
        .catch(function (e) {
          console.error(e)
          vm.daLoading = false
        })
    },
    initProgress() {
      var vm = this
      this.isProgressShow = true
      setTimeout(()=>{
          if(!vm.isOver && vm.percentage!=90){
              vm.percentage += 10
              vm.initProgress()
          }
      setTimeout(() => {
        if (!vm.isOver && vm.percentage != 90) {
          vm.percentage += 10
          vm.initProgress()
        }
      }, 1000)
    },
    openAllocationDialog() {
      if (this.currentSelect.length == 0) {
        this.$message.warning('请选择患者')
        return
      }
      var vm = this
      this.allocationDialog = true
      statisticAPI.findDoctorList({ hospital: this.docInfo.hospital }).then(function (res) {
        vm.doctorList = res.detailModelList
      })
    },
    closeAllocationDialog() {
      this.allocationDialog = false
    },
    back() {
      var vm = this
      vm.currentEditData = null
      vm.editViewVisable = false
      vm.serviceRecordVisable = false
      vm.healthRecordVisable = false
    },
    allocationFn() {
      var vm = this
      this.$refs.allocationForm.validate(function (valid) {
        if (valid) {
          statisticAPI.distributionPatient({ ids: vm.currentSelect.join(','), doctor: vm.allocationForm.doctor }).then(function (res) {
            if (res.status == 200) {
              vm.allocationDialog = false
              vm.$message.success('分配成功')
              vm.getJkCopdPatientPage()
            } else {
              vm.$message.error(res.msg)
            }
          })
        }
      })
    },
    standardExport() {
      var vm = this
      vm.exportStandardLoading = true
      var params = {
        page: this.page,
        size: this.size,
        name: this.name,
        turnDownStatus: this.turnDownStatus,
        receiveStatus: this.receiveStatus,
        archivesStatus: this.archivesStatus,
        hospital: this.hospital,
        doctorName: this.doctorName,
        isLive: this.isLive,
        queryArea: this.userRoleCode,
        firstOrg: this.firstOrg,
        startTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-01-01',
        endTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-12-31'
      }
      var time = new Date().getTime()
      statisticAPI.exportCountryStandard(params, `国家标准${time}.xls`).then(function (res) {
        vm.exportStandardLoading = false
        vm.$message({
          message: '导出成功!',
          type: 'success'
        })
      })
    }
  }
}
})

+ 13 - 0
component/statistics/CopdServiceRecord/index.css

@ -190,4 +190,17 @@
  display: flex;
  justify-content: center;
  align-items: center;
}
.el-radio-button{
  margin-right: 20px;
}
.el-radio-button__inner{
  border-left: 1px solid #dcdfe6;
  border-radius: 4px;
}
.el-radio-button:first-child .el-radio-button__inner{
  border-radius: 4px;
}
.el-radio-button:last-child .el-radio-button__inner{
  border-radius: 4px;
}

+ 83 - 166
component/statistics/CopdServiceRecord/index.html

@ -1,65 +1,52 @@
<div class="copd-service-record-box">
  <div class="service-base-info">
    <div class="base-title ki-title ta-title">
      基本信息
    </div>
    <div class="base-title ki-title ta-title">基本信息</div>
    <div class="base-content">
      <div class="base-info-item">
        姓名:{{detailInfo.name}}
      </div>
      <div class="base-info-item">
        性别:{{detailInfo.sexName}}
      </div>
      <div class="base-info-item">
        证件号码:{{detailInfo.idcard}}
      </div>
      <div class="base-info-item">
        联系电话:{{detailInfo.mobile}}
      </div>
      <div class="base-info-item">
        下转状态:{{detailInfo.turnDownStatus==1?'已下转':'未下转'}}
      </div>
      <div class="base-info-item">姓名:{{detailInfo.name}}</div>
      <div class="base-info-item">性别:{{detailInfo.sexName}}</div>
      <div class="base-info-item">证件号码:{{detailInfo.idcard}}</div>
      <div class="base-info-item">联系电话:{{detailInfo.mobile}}</div>
      <div class="base-info-item">下转状态:{{detailInfo.turnDownStatus==1?'已下转':'未下转'}}</div>
      <template v-if="detailInfo.turnDownStatus==1&&detailInfo.receiveStatus!=1">
        
        <div class="base-info-item">
          分配医院:{{detailInfo.hospitalName}}
        </div>
        <div class="base-info-item">
          分配医生:{{detailInfo.basicDoctorName}}
        </div>
        <div class="base-info-item">分配医院:{{detailInfo.hospitalName}}</div>
        <div class="base-info-item">分配医生:{{detailInfo.basicDoctorName}}</div>
      </template>
      <div class="base-info-item">
        接收状态:{{detailInfo.receiveStatus==1?'已接收':'未接收'}}
      </div>
      <div class="base-info-item">接收状态:{{detailInfo.receiveStatus==1?'已接收':'未接收'}}</div>
      <template v-if="detailInfo.receiveStatus==1">
        
        <div class="base-info-item">
          接收医院:{{detailInfo.hospitalName}}
        </div>
        <div class="base-info-item">
          接收医生:{{detailInfo.doctorName}}
        </div>
        <div class="base-info-item">接收医院:{{detailInfo.hospitalName}}</div>
        <div class="base-info-item">接收医生:{{detailInfo.doctorName}}</div>
      </template>
      
    </div>
  </div>
  <div class="service-record-timeline">
    <div class="title">服务记录</div>
    <div>
      <div class="mb10 mt10" style="display: flex;align-items: center;">
        <span>服务年份:</span>
        <el-radio-group v-model="serviceYear" @input="getDealRecord">
          <el-radio-button :label="item.value" v-for="item in yearList">{{item.label}}</el-radio-button>
        </el-radio-group>
        <el-date-picker v-model="customizeYear" style="width: 400px;" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" v-if="serviceYear=='customize'" value-format="yyyy-MM-dd" @change="getDealRecord"></el-date-picker>
      </div>
      <div  style="display: flex;align-items: center;">
        <span>服务节点:</span>
        <el-radio-group v-model="serviceNode" @input="getDealRecord">
          <el-radio-button :label="item.value" v-for="item in nodeList">{{item.label}}</el-radio-button>
        </el-radio-group>
      </div>
    </div>
    <div class="record-list time-line">
      <div class="timeline" v-loading="loading">
        <div v-for="(event, eI) in events" :key="eI">
          <div class="timeline-item" v-if="event.flag">
            <div class="timeline-time" :id="'left-' + eI">
              {{ event.createTime&&event.createTime.substring(0,4)}}
            </div>
            <div class="timeline-time" :id="'left-' + eI">{{ event.createTime&&event.createTime.substring(0,4)}}</div>
          </div>
          <div class="timeline-item" :class="{'timeline-item-blue-dot': event.createTime != null}">
            <div class="timeline-time" :id="'left-' + eI">{{event.createTime&& event.createTime.slice(5) }}</div>
            <div class="timeline-content" :id="'right-' + eI">
              <div class="data-item">
                <div class="data-title">
                  {{event.type==1?'下转患者':event.type==2?'医生接收':event.type==3?'居民流转':
                  event.type==4?'医生退回':event.type==5?'医生随访':event.type==6?'档案修改':'档案同步'}}
                  {{getTypeName(event.type)}}
                </div>
                <div class="data-cont" v-if="event.type!=5&&event.type!=6&&event.type!=7">
                  <div style="width: 50%">
@ -75,7 +62,6 @@
                    </span>
                  </div>
                  <template v-if="event.receiveStatus!=0">
                    
                    <div style="width: 50%">
                      <span style="color: #9fa2a8">接收医生:</span>
                      <span style="color: #656565">
@ -116,7 +102,9 @@
                    <span style="color: #9fa2a8">回退原因:</span>
                    <span style="color: #656565">
                      <template v-if="event.isBack==0">———</template>
                      <template v-else>{{event.backType==1?'找到本人或家属,但否认慢阻肺病史':event.backType==2?'找到本人或家属,非本辖区,也不清楚现在的住址':event.backReason}}</template>
                      <template v-else>
                        {{event.backType==1?'找到本人或家属,但否认慢阻肺病史':event.backType==2?'找到本人或家属,非本辖区,也不清楚现在的住址':event.backReason}}
                      </template>
                    </span>
                  </div>
                  <div style="width: 50%">
@ -159,7 +147,6 @@
                    </span>
                  </div>
                  <template v-if="event.receiveStatus==1">
                    <div style="width: 50%">
                      <span style="color: #9fa2a8">接收医院:</span>
                      <span style="color: #656565">
@ -200,10 +187,12 @@
                    <span style="color: #9fa2a8">回退原因:</span>
                    <span style="color: #656565">
                      <template v-if="event.isBack==0">———</template>
                      <template v-else>{{event.backType==1?'找到本人或家属,但否认慢阻肺病史':event.backType==2?'找到本人或家属,非本辖区,也不清楚现在的住址':event.backReason}}</template>
                      <template v-else>
                        {{event.backType==1?'找到本人或家属,但否认慢阻肺病史':event.backType==2?'找到本人或家属,非本辖区,也不清楚现在的住址':event.backReason}}
                      </template>
                    </span>
                  </div>
                  <div style="display: flex; justify-content: space-between; width: 100%; ">
                  <div style="display: flex; justify-content: space-between; width: 100%">
                    <div class="data-title">随访信息</div>
                  </div>
                  <div style="width: 50%">
@ -230,7 +219,6 @@
                      <template>{{event.jkcopdFollowup.isLive==1?'生存':'死亡'}}</template>
                    </span>
                  </div>
                  
                </div>
                <div class="data-cont" v-else-if="event.type==7">
                  <div style="width: 50%">
@ -251,10 +239,9 @@
                      <template>{{event.orgName}}</template>
                    </span>
                  </div>
                  </div>
                <div class="data-title" style="color: #12B7F5; font-size: 14px" v-if="event.type==5" @click="showDetail(event)"> 查看随访详情</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>
                
                  <div style="width: 50%" v-for="item in event.achievesRecordList" :key="item.id">
                    <span style="color: #9fa2a8">{{item.classFieldName}}:</span>
                    <span style="color: #656565">
@ -267,14 +254,13 @@
                      <template>{{event.operaterName}}</template>
                    </span>
                  </div>
                  <div style="width: 50%" >
                  <div style="width: 50%">
                    <span style="color: #9fa2a8">操作机构:</span>
                    <span style="color: #656565">
                      <template>{{event.orgName}}</template>
                    </span>
                  </div>
                </div>
                
              </div>
            </div>
          </div>
@ -288,121 +274,66 @@
  <el-dialog title="随访详情" :visible.sync="dialog" width="50%" :destroy-on-close="true">
    <div class="copd-follow-up-dialog-box">
      <div class="copd-bb-record-info">
        <div class="title ki-title ta-title">
          随访信息
        </div>
        <div class="title ki-title ta-title">随访信息</div>
        <div class="copd-bb-base-content">
          <div class="copd-bb-base-info-item" v-if="followInfo.createTime"> 
            随访时间:{{followInfo.createTime}}
          </div>
          <div class="copd-bb-base-info-item" v-if="followInfo.doctorName">
            随访医生:{{followInfo.doctorName}}
          </div>
          <div class="copd-bb-base-info-item" v-if="followInfo.hospitalName">
            随访机构: {{followInfo.hospitalName}}
          </div>
          <div class="copd-bb-base-info-item" v-if="followup"> 
            随访状态:{{followup}}
          </div>
          <div class="copd-bb-base-info-item" v-if="followInfo.status==4"> 
            失访原因:{{followInfo.lostReason}}
          </div>
          <div class="copd-bb-base-info-item" v-if="followInfo.createTime">随访时间:{{followInfo.createTime}}</div>
          <div class="copd-bb-base-info-item" v-if="followInfo.doctorName">随访医生:{{followInfo.doctorName}}</div>
          <div class="copd-bb-base-info-item" v-if="followInfo.hospitalName">随访机构: {{followInfo.hospitalName}}</div>
          <div class="copd-bb-base-info-item" v-if="followup">随访状态:{{followup}}</div>
          <div class="copd-bb-base-info-item" v-if="followInfo.status==4">失访原因:{{followInfo.lostReason}}</div>
        </div>
      </div>
      <template v-if="followInfo.status!='4'">
        <div class="copd-bb-record-info">
          <div class="title ki-title">
            基本信息
          </div>
          <div class="title ki-title">基本信息</div>
          <div class="copd-bb-base-content">
            <div class="copd-bb-base-info-item" v-if="followInfo.name">
              姓名:{{followInfo.name}}
            </div>
            <div class="copd-bb-base-info-item"  v-if="followInfo.sex">
              性别:{{followInfo.sex==1?'男':'女'}}
            </div>
            <div class="copd-bb-base-info-item"  v-if="nationName">
              民族:{{nationName}}
            </div>
            <div class="copd-bb-base-info-item" v-if="followInfo.name">姓名:{{followInfo.name}}</div>
            <div class="copd-bb-base-info-item" v-if="followInfo.sex">性别:{{followInfo.sex==1?'男':'女'}}</div>
            <div class="copd-bb-base-info-item" v-if="nationName">民族:{{nationName}}</div>
            <div class="copd-bb-base-info-item"  v-if="followInfo.birthday">
              出生日期:{{followInfo.birthday}}
            </div>
            <div class="copd-bb-base-info-item"  v-if="idcardTypeName">
              证件类型:{{idcardTypeName}}
            </div>
            <div class="copd-bb-base-info-item"  v-if="followInfo.idcard">
              证件号码:{{followInfo.idcard}}
            </div>
            <div class="copd-bb-base-info-item"  v-if="followInfo.mobile">
              联系电话:{{followInfo.mobile}}
            </div>
            <div class="copd-bb-base-info-item" v-if="educational">
              学历:{{educational}}
            </div>
            <div class="copd-bb-base-info-item"  v-if="marriageName">
              婚姻状况:{{marriageName}}
            </div>
            <div class="copd-bb-base-info-item"  v-if="occupation">
              职业类型:{{occupation}}
            </div>
            <div class="copd-bb-base-info-item"  v-if="followInfo.liveProvinceName">
            <div class="copd-bb-base-info-item" v-if="followInfo.birthday">出生日期:{{followInfo.birthday}}</div>
            <div class="copd-bb-base-info-item" v-if="idcardTypeName">证件类型:{{idcardTypeName}}</div>
            <div class="copd-bb-base-info-item" v-if="followInfo.idcard">证件号码:{{followInfo.idcard}}</div>
            <div class="copd-bb-base-info-item" v-if="followInfo.mobile">联系电话:{{followInfo.mobile}}</div>
            <div class="copd-bb-base-info-item" v-if="educational">学历:{{educational}}</div>
            <div class="copd-bb-base-info-item" v-if="marriageName">婚姻状况:{{marriageName}}</div>
            <div class="copd-bb-base-info-item" v-if="occupation">职业类型:{{occupation}}</div>
            <div class="copd-bb-base-info-item" v-if="followInfo.liveProvinceName">
              常住地区:{{followInfo.liveProvinceName}}{{followInfo.liveCityName}}{{followInfo.liveTownName}}{{followInfo.liveStreetName}}
            </div>
            <div class="copd-bb-base-info-item" v-if="followInfo.liveAddress">
              常住地址:{{followInfo.liveAddress}}
            </div>
              <div class="copd-bb-base-info-item" v-if="followInfo.registProvinceName" >
            <div class="copd-bb-base-info-item" v-if="followInfo.liveAddress">常住地址:{{followInfo.liveAddress}}</div>
            <div class="copd-bb-base-info-item" v-if="followInfo.registProvinceName">
              户籍地区:{{followInfo.registProvinceName}}{{followInfo.registCityName}}{{followInfo.registTownName}}{{followInfo.registStreetName}}
            </div>
            <div class="copd-bb-base-info-item" v-if="followInfo.registAddress">
              户籍地址:{{followInfo.registAddress}}
            <div class="copd-bb-base-info-item" v-if="followInfo.registAddress">户籍地址:{{followInfo.registAddress}}</div>
          </div>
        </div>
        <div class="copd-bb-record-info">
          <div class="title ki-title  ta-title">
            随访情况
          </div>
          <div class="title ki-title ta-title">随访情况</div>
          <div class="copd-bb-base-content">
            <div class="copd-bb-base-info-item" v-if="followInfo.isLive">
              生存状态:{{followInfo.isLive==1?'生存':'死亡'}}
            </div>
            <div class="copd-bb-base-info-item" v-if="followInfo.isLive">生存状态:{{followInfo.isLive==1?'生存':'死亡'}}</div>
            <template v-if="followInfo.isLive==1">
              <div class="copd-bb-base-info-item" v-if="followInfo.hasSmoke">
                是否抽烟:{{followInfo.hasSmoke==1?'是':followInfo.hasSmoke==0?'否':'已戒烟'}}
              </div>
              <div class="copd-bb-base-info-item" v-if="followInfo.hasDrink">
                是否饮酒:{{followInfo.hasDrink==1?'是':followInfo.hasDrink==0?'否':'已戒酒'}}
              </div>
              <div class="copd-bb-base-info-item" v-if="diseaseConversion">
                病情归转:{{diseaseConversion}}
              </div>
              <div class="copd-bb-base-info-item" v-if="followInfo.hasSmoke">是否抽烟:{{followInfo.hasSmoke==1?'是':followInfo.hasSmoke==0?'否':'已戒烟'}}</div>
              <div class="copd-bb-base-info-item" v-if="followInfo.hasDrink">是否饮酒:{{followInfo.hasDrink==1?'是':followInfo.hasDrink==0?'否':'已戒酒'}}</div>
              <div class="copd-bb-base-info-item" v-if="diseaseConversion">病情归转:{{diseaseConversion}}</div>
            </template>
            
            <!-- <div class="copd-bb-base-info-item">
              是否做过肺功能检查:{{followInfo.hasLung}}
            </div> -->
            <!-- <div class="copd-bb-base-info-item">e
              是否做过胸部CT或X线检查:{{followInfo.birthday}}
            </div> -->
         
          </div>
        </div>
        <template v-if="followInfo.isLive==1">
        <div class="copd-bb-record-info">
          <div class="title ki-title ta-title">
            首次确诊情况
          </div>
          <div class="copd-bb-base-content">
            <div class="copd-bb-base-info-item" v-if="followInfo.firstVisitTime">
              慢阻肺首次诊断时间:{{followInfo.firstVisitTime}}
            </div>
            <div class="copd-bb-base-info-item" v-if="firstAreaName">
              慢阻肺首次诊断地区:{{firstAreaName}}
            </div>
            <div class="copd-bb-base-info-item" v-if="orGlevelName">
              <!-- 慢阻肺首次诊断机构级别:{{
          <div class="copd-bb-record-info">
            <div class="title ki-title ta-title">首次确诊情况</div>
            <div class="copd-bb-base-content">
              <div class="copd-bb-base-info-item" v-if="followInfo.firstVisitTime">慢阻肺首次诊断时间:{{followInfo.firstVisitTime}}</div>
              <div class="copd-bb-base-info-item" v-if="firstAreaName">慢阻肺首次诊断地区:{{firstAreaName}}</div>
              <div class="copd-bb-base-info-item" v-if="orGlevelName">
                <!-- 慢阻肺首次诊断机构级别:{{
                followInfo.firstVisitOrgLevel == 1 ? '三级医院' :
                followInfo.firstVisitOrgLevel == 2 ? '二级医院' :
                followInfo.firstVisitOrgLevel == 3 ? '村卫生室' :
@ -410,35 +341,21 @@
                followInfo.firstVisitOrgLevel == 5 ? '其他医疗卫生机构' :
                ''
              }} -->
              慢阻肺首次诊断机构级别:{{orGlevelName}}
            </div>
            <div class="copd-bb-base-info-item" v-if="diagnosticBasisName">
              最高诊断依据:{{diagnosticBasisName}}
            </div>
            <div class="copd-bb-base-info-item" v-if="symptom">
              症状:{{symptom}}
            </div>
            <div class="copd-bb-base-info-item" v-if="followInfo.drugBefore">
              使用支气管扩张剂前FEV1/FVC(%):{{followInfo.drugBefore}}
            </div>
            <div class="copd-bb-base-info-item" v-if="followInfo.drugAfter">
              使用支气管扩张剂后FEV1/FVC(%):{{followInfo.drugAfter}}
                慢阻肺首次诊断机构级别:{{orGlevelName}}
              </div>
              <div class="copd-bb-base-info-item" v-if="diagnosticBasisName">最高诊断依据:{{diagnosticBasisName}}</div>
              <div class="copd-bb-base-info-item" v-if="symptom">症状:{{symptom}}</div>
              <div class="copd-bb-base-info-item" v-if="followInfo.drugBefore">使用支气管扩张剂前FEV1/FVC(%):{{followInfo.drugBefore}}</div>
              <div class="copd-bb-base-info-item" v-if="followInfo.drugAfter">使用支气管扩张剂后FEV1/FVC(%):{{followInfo.drugAfter}}</div>
            </div>
          </div>
        </div>
        </template>
        <div class="copd-bb-record-info" v-if="followInfo.isLive!=1">
          <div class="title ki-title ta-title">
            死亡情况
          </div>
          <div class="copd-bb-base-content" >
          <div class="title ki-title ta-title">死亡情况</div>
          <div class="copd-bb-base-content">
            <template v-if="followInfo.isLive!=1">
              <div class="copd-bb-base-info-item" v-if="followInfo.deathTime">
                死亡时间:{{followInfo.deathTime}}
              </div>
              <div class="copd-bb-base-info-item"  v-if="followInfo.deathReason">
                死亡原因:{{followInfo.deathReason}}
              </div>
              <div class="copd-bb-base-info-item" v-if="followInfo.deathTime">死亡时间:{{followInfo.deathTime}}</div>
              <div class="copd-bb-base-info-item" v-if="followInfo.deathReason">死亡原因:{{followInfo.deathReason}}</div>
            </template>
          </div>
        </div>
@ -448,4 +365,4 @@
      <el-button @click="dialog = false">关闭</el-button>
    </span>
  </el-dialog>
</div>
</div>

+ 196 - 164
component/statistics/CopdServiceRecord/index.js

@ -1,247 +1,271 @@
// 慢阻肺患者档案-服务档案
var template = ''
$.ajax('../../../component/statistics/CopdServiceRecord/index.html',{
$.ajax('../../../component/statistics/CopdServiceRecord/index.html', {
  data: {},
  dataType: 'html',
  cache: false,
  timeout: 60000,
  async: false,
  error: function(res) {
  },
  success: function(res) {
  error: function (res) {},
  success: function (res) {
    template = res
  }
})
  
Vue.component('copd-service-record', {
  template: template,
  props: ['detailInfo'],
  data() {
    return {
      dialog: false,
      loading:false,
      page:1,
      size:999,
      
      idcardTypeName:'',
      followInfo:{},
      loading: false,
      page: 1,
      size: 999,
      idcardTypeName: '',
      followInfo: {},
      events: [
        {date: '2023年'},
        {title: 'Event 1', date: '05-11 17:00:01', description: 'Description for event 1'},
        {date: '2024年', description: 'Description for event 2'},
        {date: '2025年', description: 'Description for event 3'},
        {date: '2026年', description: 'Description for event 4'},
        {title: 'Event 5', date: '2027年', description: 'Description for event 5'}
        { date: '2023年' },
        { title: 'Event 1', date: '05-11 17:00:01', description: 'Description for event 1' },
        { date: '2024年', description: 'Description for event 2' },
        { date: '2025年', description: 'Description for event 3' },
        { date: '2026年', description: 'Description for event 4' },
        { title: 'Event 5', date: '2027年', description: 'Description for event 5' }
      ],
      dicName:['jkcopd_back_type','jkcopd_followup_status','jkcopd_symptom','jkcopd_isLive','jkcopd_first_area','jkcopd_first_org_level', 'jkcopd_marriage','jkcopd_occupation','jkcopd_smoke','jkcopd_drink','jkcopd_archivesStatus','jkcopd_disease_conversion','jkcopd_firstVisitType','jkcopd_educational','idCardType','jkcopd_diagnosticBasis'],
      marriageArr:[],
      backTypeName:'',
      diagnosticBasisName:'',
      marriageName:'',
      symptom:'',
      symptomsArr:[],
      followupArr:[],
      followup:'',
      idCardTypeArr:[],
      firstAreaArr:[],
      firstAreaName:'',
      isLiveArr:[],
      orgLevelArr:[],
      orGlevelName:'',
      occupationArr:[],
      occupation:'',
      smokeArr:[],
      drinkArr:[],
      archivesArr:[],
      diseaseConversion:'',
      conversionArr:[],
      firstVisitTypeArr:[],
      educationalArr:[],
      educational:'',
      nationDict:[],
      nationName:''
      dicName: [
        'jkcopd_back_type',
        'jkcopd_followup_status',
        'jkcopd_symptom',
        'jkcopd_isLive',
        'jkcopd_first_area',
        'jkcopd_first_org_level',
        'jkcopd_marriage',
        'jkcopd_occupation',
        'jkcopd_smoke',
        'jkcopd_drink',
        'jkcopd_archivesStatus',
        'jkcopd_disease_conversion',
        'jkcopd_firstVisitType',
        'jkcopd_educational',
        'idCardType',
        'jkcopd_diagnosticBasis'
      ],
      marriageArr: [],
      backTypeName: '',
      diagnosticBasisName: '',
      marriageName: '',
      symptom: '',
      symptomsArr: [],
      followupArr: [],
      followup: '',
      idCardTypeArr: [],
      firstAreaArr: [],
      firstAreaName: '',
      isLiveArr: [],
      orgLevelArr: [],
      orGlevelName: '',
      occupationArr: [],
      occupation: '',
      smokeArr: [],
      drinkArr: [],
      archivesArr: [],
      diseaseConversion: '',
      conversionArr: [],
      firstVisitTypeArr: [],
      educationalArr: [],
      educational: '',
      nationDict: [],
      nationName: '',
      communityArr: [],
      yearList: [{ label: '全部年份',value: "" }],
      nodeList: [
        { label: '全部节点', value: "" },
        { label: '下转患者', value: 1 },
        { label: '医生接受', value: 2 },
        { label: '居民流转', value: 3 },
        { label: '医生退回', value: 4 },
        { label: '医生随访', value: 5 },
        { label: '档案修改', value: 6 },
        { label: '档案同步', value: 7 },
        { label: '分配患者', value: 8 },
        { label: '添加患者', value: 9 },
      ],
      serviceYear: "",
      customizeYear: [],
      serviceNode: ""
    }
  },
  methods: {
    getNation(){
      var vm=this
       statisticAPI.getNationDict().then(function(res){
           vm.nationDict= res.data
           vm.nationDict.forEach(function(item){
            if(item.NATION_CODE==vm.followInfo.nation){
              vm.nationName=item.NATION_NAME
            }
           })
       })
    getNation() {
      var vm = this
      statisticAPI.getNationDict().then(function (res) {
        vm.nationDict = res.data
        vm.nationDict.forEach(function (item) {
          if (item.NATION_CODE == vm.followInfo.nation) {
            vm.nationName = item.NATION_NAME
          }
        })
      })
    },
    setLeftHeights() {
      this.$nextTick(() => {
        this.events.forEach((event, index) => {
          const rightContent = document.getElementById('right-' + index);
          const leftContent = document.getElementById('left-' + index);
          const rightContent = document.getElementById('right-' + index)
          const leftContent = document.getElementById('left-' + index)
          if (rightContent && leftContent) {
            leftContent.style.height = rightContent.offsetHeight + 'px';
            leftContent.style.height = rightContent.offsetHeight + 'px'
          }
        });
      });
        })
      })
    },
       //字典
       getDictByDictName(value){
        var vm=this
      statisticAPI.getDictByDictName({name:value}).then(function(res){
        if(value=='jkcopd_marriage'){
         var arr = res.list
          arr.forEach(function(item){
            if(item.code==vm.followInfo.marriage){
              vm.marriageName=item.value
    //字典
    getDictByDictName(value) {
      var vm = this
      statisticAPI.getDictByDictName({ name: value }).then(function (res) {
        if (value == 'jkcopd_marriage') {
          var arr = res.list
          arr.forEach(function (item) {
            if (item.code == vm.followInfo.marriage) {
              vm.marriageName = item.value
            }
          })
        }else if(value=='jkcopd_smoke'){
        } else if (value == 'jkcopd_smoke') {
          // var vm=this
          // vm.smokeArr=res.list
        }else if(value=='jkcopd_drink'){
        } else if (value == 'jkcopd_drink') {
          // var vm=this
          // vm.drinkArr=res.list
        }else if(value=='jkcopd_first_area'){
        } else if (value == 'jkcopd_first_area') {
          var arr = res.list
          arr.forEach(function(item){
            if(item.code==vm.followInfo.firstVisitArea){
              vm.firstAreaName=item.value
          arr.forEach(function (item) {
            if (item.code == vm.followInfo.firstVisitArea) {
              vm.firstAreaName = item.value
            }
          })
        }else if(value=='jkcopd_disease_conversion'){
        } else if (value == 'jkcopd_disease_conversion') {
          var arr = res.list
          arr.forEach(function(item){
            if(item.code==vm.followInfo.diseaseConversion){
              vm.diseaseConversion=item.value
          arr.forEach(function (item) {
            if (item.code == vm.followInfo.diseaseConversion) {
              vm.diseaseConversion = item.value
            }
          })
        }else if(value=='jkcopd_firstVisitType'){
        } else if (value == 'jkcopd_firstVisitType') {
          // vm.firstVisitTypeArr=res.list
        }else if(value=='jkcopd_first_org_level'){
        } else if (value == 'jkcopd_first_org_level') {
          var arr = res.list
          arr.forEach(function(item){
            if(item.code==vm.followInfo.firstVisitOrgLevel){
              vm.orGlevelName=item.value
          arr.forEach(function (item) {
            if (item.code == vm.followInfo.firstVisitOrgLevel) {
              vm.orGlevelName = item.value
            }
          })
          
        }else if(value=='jkcopd_followup_status'){
          vm.followupArr= res.list
          vm.followupArr.forEach(function(item){
            if(item.code==vm.followInfo.status){
              vm.followup=item.value
        } else if (value == 'jkcopd_followup_status') {
          vm.followupArr = res.list
          vm.followupArr.forEach(function (item) {
            if (item.code == vm.followInfo.status) {
              vm.followup = item.value
            }
          })
        }else if(value=='idCardType'){
        } else if (value == 'idCardType') {
          var arr = res.list
          arr.forEach(function(item){
            if(item.code==vm.followInfo.idcardType){
              vm.idcardTypeName=item.value
          arr.forEach(function (item) {
            if (item.code == vm.followInfo.idcardType) {
              vm.idcardTypeName = item.value
            }
          })
        }else if(value=='jkcopd_occupation'){
        } else if (value == 'jkcopd_occupation') {
          var arr = res.list
          arr.forEach(function(item){
            if(item.code==vm.followInfo.occupation){
              vm.occupation=item.value
          arr.forEach(function (item) {
            if (item.code == vm.followInfo.occupation) {
              vm.occupation = item.value
            }
          })
        }else if(value=='jkcopd_educational'){
        } else if (value == 'jkcopd_educational') {
          var arr = res.list
          arr.forEach(function(item){
            if(item.code==vm.followInfo.educational){
              vm.educational=item.value
          arr.forEach(function (item) {
            if (item.code == vm.followInfo.educational) {
              vm.educational = item.value
            }
          })
        }else if(value=='jkcopd_symptom'){
        } else if (value == 'jkcopd_symptom') {
          var arr = res.list
          vm.symptomsArr=[]
          var symptoms=vm.followInfo.symptom.split(',')
          arr.forEach(function(item){
            symptoms.forEach(function(v){
              if(v==item.code){
          vm.symptomsArr = []
          var symptoms = vm.followInfo.symptom.split(',')
          arr.forEach(function (item) {
            symptoms.forEach(function (v) {
              if (v == item.code) {
                vm.symptomsArr.push(item.value)
              }
            })
          })
          vm.symptom=vm.symptomsArr.join()
        }
        else if(value=='jkcopd_diagnosticBasis'){
          vm.symptom = vm.symptomsArr.join()
        } else if (value == 'jkcopd_diagnosticBasis') {
          var arr = res.list
          arr.forEach(function(item){
            if(item.code==vm.followInfo.diagnosticBasis){
              vm.diagnosticBasisName=item.value
          arr.forEach(function (item) {
            if (item.code == vm.followInfo.diagnosticBasis) {
              vm.diagnosticBasisName = item.value
            }
          })
        }
        // }else if(value=='jkcopd_back_type'){
        //   var arr = res.list
        //   arr.forEach(function(item){
        //     if(item.code==vm.followInfo.backType){
        //       vm.backTypeName=item.value
        //       console.log('wwwwwwwwwwwwwwwwwwwww',vm.backTypeName)
        //     }
        //   })
        // }
        
       
      })
    
      },
    recordBack(){
    },
    recordBack() {
      this.$emit('back')
      EventBus.$emit('copd-reset-select')
    },
    getDealRecord: function () {
    getDealRecord () {
      var vm = this
      vm.loading = true
      var params = {
        page: vm.page,
        size: vm.size,
        patient: vm.detailInfo.patient
        patient: vm.detailInfo.patient,
        type: vm.serviceNode
      }
      if(vm.serviceYear == 'customize'){
        params.startTime = vm.customizeYear[0]
        params.endTime = vm.customizeYear[1]
      }else if(vm.serviceYear != ''){
        params.startTime = vm.serviceYear + "-01-01"
        params.endTime = vm.serviceYear + "-12-31"
      } else{
        params.startTime = ''
        params.endTime = ''
      }
      statisticAPI.dealRecordPage(params).then(function(res){
      
      statisticAPI.dealRecordPage(params).then(function (res) {
        res.detailModelList.forEach(function (item, index) {
          var time1 =
            res.detailModelList[index] &&
            res.detailModelList[index].createTime &&
            res.detailModelList[index].createTime.slice(0, 4)
          var time2 =
            res.detailModelList[index + 1] &&
            res.detailModelList[index + 1].createTime &&
            res.detailModelList[index + 1].createTime.slice(0, 4)
          var time1 = res.detailModelList[index] && res.detailModelList[index].createTime && res.detailModelList[index].createTime.slice(0, 4)
          var time2 = res.detailModelList[index + 1] && res.detailModelList[index + 1].createTime && res.detailModelList[index + 1].createTime.slice(0, 4)
          if (index == 0) {
            item.flag = 1
          } else if (index != res.detailModelList.length - 1 && time1 == time2) {
            res.detailModelList[index + 1].flag = 0
          } else if (res.detailModelList.length - 1 == index&& res.detailModelList[index + 1] &&
            res.detailModelList[index + 1].createTime &&res.detailModelList[index]&&res.detailModelList[index].createTime) {
            if (
              res.detailModelList[index - 1].createTime.slice(0, 4) ==res.detailModelList[index].createTime.slice(0, 4)
            ) {
          } else if (
            res.detailModelList.length - 1 == index &&
            res.detailModelList[index + 1] &&
            res.detailModelList[index + 1].createTime &&
            res.detailModelList[index] &&
            res.detailModelList[index].createTime
          ) {
            if (res.detailModelList[index - 1].createTime.slice(0, 4) == res.detailModelList[index].createTime.slice(0, 4)) {
              res.detailModelList[res.detailModelList.length - 1].flag = 0
            } else {
              res.detailModelList[res.detailModelList.length - 1].flag = 1
            }
          }
        })
        vm.loading=false
        vm.loading = false
        vm.events = res.detailModelList
        console.log(vm.events,'999999999999')
      })
    },
    showDetail(item){
      var vm =this
       statisticAPI.followupDetail({id:item.jkcopdFollowup.id}).then(function(res){
        console.log(res)
        vm.followInfo=res.obj
        vm.dicName.forEach(function(item) {
    showDetail(item) {
      var vm = this
      statisticAPI.followupDetail({ id: item.jkcopdFollowup.id }).then(function (res) {
        vm.followInfo = res.obj
        vm.dicName.forEach(function (item) {
          vm.getDictByDictName(item)
        });
    vm.getNation()
        })
        vm.getNation()
        // statisticAPI.getDictByDictName({name:'idCardType'}).then(function(res){
        //   res.list.forEach(function(item){
@ -250,18 +274,26 @@ Vue.component('copd-service-record', {
        //     }
        //   })
        // })
        console.log(vm.followInfo,'sssss')
        vm.dialog=true
       })
        vm.dialog = true
      })
    },
    getYearList() {
      for (var i = 0; i < 6; i++) {
        var year = new Date().getFullYear() - i
        this.yearList.push({ label: year, value: year })
      }
      this.yearList.push({ label: '自定义', value: 'customize' })
    },
    getTypeName(type){
      return this.nodeList.find(function(item){return item.value == type})?.label
    }
  },
  mounted() {
    // this.$nextTick(() => {
    //   this.setLeftHeights();
    // });
    console.log('pppppppppppppp--------',this.detailInfo)
    var vm =this
    var vm = this
    this.getDealRecord()
   
  },
});
    this.getYearList()
  }
})