Просмотр исходного кода

医师排名多身份切换维度

zz 2 месяцев назад
Родитель
Сommit
accddadfcc
2 измененных файлов с 115 добавлено и 142 удалено
  1. 3 3
      src/views/encoder/components/index/DoctorRank.vue
  2. 112 139
      src/views/encoder/index.vue

+ 3 - 3
src/views/encoder/components/index/DoctorRank.vue

@@ -18,14 +18,14 @@
       yNames() {
         const arr = []
         this.data.map(item => {
-          arr.unshift(item.docker_name)
+          arr.unshift(item.name)
         })
         return arr
       },
       qxCounts() {
         const arr = []
         this.data.map(item => {
-          arr.unshift(item.qx_sum)
+          arr.unshift(item.qx_total_num)
         })
         return arr
       },
@@ -163,4 +163,4 @@
 
 <style lang="scss" scoped>
 
-</style>
+</style>

+ 112 - 139
src/views/encoder/index.vue

@@ -3,35 +3,17 @@
     <!-- 搜索栏 -->
     <div class="bg-card" style="margin-bottom: 18px">
       <el-form :inline="true" :model="formInline" class="demo-form-inline">
-
         <el-form-item label="所属院区" style="margin-bottom: 0">
-          <el-select class="width150"  v-model="formInline.YQ_CODES" placeholder="请选择所属院区" multiple>
-            <el-option v-for="(item,index) in searchInfoOptions.yqArray" :label="item.YQ_NAME" :value="item.id" :key="index">
-            </el-option>
+          <el-select class="width150" v-model="formInline.YQ_CODES" placeholder="请选择所属院区" multiple>
+            <el-option v-for="(item, index) in searchInfoOptions.yqArray" :label="item.YQ_NAME" :value="item.id" :key="index"></el-option>
           </el-select>
         </el-form-item>
 
         <el-form-item label="所属科室" style="margin-bottom: 0">
-          <el-cascader
-            multiple
-            v-model="formInline.KS_IDS"
-            :options="searchInfoOptions.depArray"
-            :props="cascaderProps"
-            :show-all-levels="false"
-            @change="handleChange"
-            clearable
-          ></el-cascader>
+          <el-cascader multiple v-model="formInline.KS_IDS" :options="searchInfoOptions.depArray" :props="cascaderProps" :show-all-levels="false" clearable></el-cascader>
         </el-form-item>
         <el-form-item label="所属病区" style="margin-bottom: 0">
-          <el-cascader
-            v-model="formInline.BQ_IDS"
-            :options="searchInfoOptions.bqArray"
-            :props="cascaderProps"
-            @change="handleChange"
-            multiple
-            clearable
-            collapse-tags
-          ></el-cascader>
+          <el-cascader v-model="formInline.BQ_IDS" :options="searchInfoOptions.bqArray" :props="cascaderProps" multiple clearable collapse-tags></el-cascader>
         </el-form-item>
 
         <el-form-item label="出院日期" style="margin-bottom: 0">
@@ -47,7 +29,7 @@
       </el-form>
     </div>
     <!-- 汇总统计 -->
-    <div class="bg-card" style="margin-bottom: 24px;">
+    <div class="bg-card" style="margin-bottom: 24px">
       <CardTitle title="汇总统计">
         <el-image
           class="title_arrow"
@@ -161,7 +143,7 @@
       </el-collapse-transition>
     </div>
     <!-- 缺陷详情 -->
-    <div class="bg-card" style="margin-bottom: 24px;">
+    <div class="bg-card" style="margin-bottom: 24px">
       <CardTitle title="缺陷详情">
         <el-image
           class="title_arrow"
@@ -200,6 +182,11 @@
                 <el-form-item label="缺陷描述">
                   <el-input v-model="qxxqData.desc" placeholder="请输入" clearable></el-input>
                 </el-form-item>
+                <el-form-item label="编码员">
+                  <el-select v-model="qxxqData.bmy_ids" clearable filterable multiple placeholder="全部">
+                    <el-option v-for="(item, index) in qxSearchOptions.bmyArray" :label="item.name" :value="item.id" :key="index"></el-option>
+                  </el-select>
+                </el-form-item>
                 <el-form-item style="margin-bottom: 0">
                   <el-button type="primary" class="bg185DA6" @click="onQuexianSearch">查询</el-button>
                 </el-form-item>
@@ -218,12 +205,17 @@
                   </template>
                 </el-table-column>
                 <el-table-column prop="field" label="缺陷字段" width="140" align="center" show-overflow-tooltip></el-table-column>
-                <el-table-column prop="level" label="缺陷分级" width="140" align="center"></el-table-column>
-                <el-table-column prop="count" label="缺陷数量" width="140" align="center">
+                <el-table-column prop="level" label="缺陷分级" width="120" align="center"></el-table-column>
+                <el-table-column prop="count" label="缺陷数量" width="120" align="center">
                   <template slot-scope="scope">
                     <span class="link" @click="toPage(scope.row)">{{ scope.row.count }}</span>
                   </template>
                 </el-table-column>
+                <el-table-column  label="缺陷占比" width="120" align="center">
+                  <template slot-scope="scope">
+                    <span v-if="scope.row.count">{{(scope.row.count/tongjiData.qxSum).toFixed(2)*100}}%</span>
+                  </template>
+                </el-table-column>
               </el-table>
               <!-- 分页 -->
               <div v-if="qxxqData.radio === 2">
@@ -251,7 +243,7 @@
       </el-collapse-transition>
     </div>
     <!-- 医师排名 -->
-    <div class="bg-card" style="margin-bottom: 24px;">
+    <div class="bg-card" style="margin-bottom: 24px">
       <CardTitle title="医师排名">
         <el-image
           class="title_arrow"
@@ -264,35 +256,63 @@
           <el-button type="primary" class="export-btn" icon="el-icon-download" size="small" style="float: right" @click="onBmyDoctorExport">下载</el-button>
         </slot>
       </CardTitle>
+      <div style="margin-bottom: 10px">
+        <el-form class="demo-form-inline mb20" v-model="ysSearch">
+          <el-form-item label="所属身份">
+            <el-select v-model="ysSearch.sf_type" @change="ysTypeChange">
+              <el-option v-for="(item, index) in ysSearchOptions.sfArray" :key="index" :label="item.label" :value="item.value"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+      </div>
       <el-collapse-transition>
         <div v-show="doctor_show">
           <el-row :gutter="20">
             <el-col :span="14">
-              <el-table :data="doctor_tableData" class="mb20" style="width: 100%">
+              <el-table :data="doctor_tableData" class="mb20" style="width: 150%" :default-sort="ysSortParams" @sort-change="handleSortChange">
                 <el-table-column type="index" label="序号" width="50" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.$index + 1 + (paginationDataDoctor.page - 1) * paginationDataDoctor.size }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column prop="docker_name" label="医师姓名" align="center" show-overflow-tooltip></el-table-column>
-                <el-table-column prop="code" label="医师工号" align="center" show-overflow-tooltip></el-table-column>
-                <el-table-column prop="dep_name" label="医师科室" align="center" show-overflow-tooltip></el-table-column>
-                <el-table-column prop="bl_sum" label="病历总数" align="center">
+                <el-table-column prop="name" label="医师姓名" width="100" align="center" show-overflow-tooltip></el-table-column>
+                <el-table-column prop="code" label="医师工号" width="100" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span v-if="scope.row.code">
+                      {{ scope.row.code }}
+                      <i class="el-icon-document-copy" style="color: green" @click="yiCodeCopy(scope.row.code)" />
+                    </span>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="dep_name" label="医师科室" width="120" align="center" show-overflow-tooltip></el-table-column>
+                <el-table-column prop="bl_sum" label="病历总数" width="100" align="center" sortable="custom" :sort-orders="['ascending', 'descending']">
+                  <template slot-scope="scope">
+                    <span v-if="scope.row.bl_sum" class="link2" @click="toPageDoctor(scope.row)">{{ scope.row.bl_sum }}例</span>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="total_deduction" label="总扣分" width="100" align="center" sortable="custom" :sort-orders="['ascending', 'descending']">
                   <template slot-scope="scope">
-                    <span class="link2" @click="toPageDoctor(scope.row)">{{ scope.row.bl_sum }}</span>
-                    <span v-if="scope.row.bl_sum">例</span>
+                    <span v-if="typeof scope.row.total_deduction === 'number'" class="link2" @click="toPageDoctorKf(scope.row)">{{ scope.row.total_deduction}}分</span>
                   </template>
                 </el-table-column>
-                <el-table-column prop="kf_score" label="总扣分" align="center">
+                <el-table-column prop="avg_score" label="平均得分" width="120" align="center" sortable="custom" :sort-orders="['ascending', 'descending']">
                   <template slot-scope="scope">
-                    <span class="link2" @click="toPageDoctorKf(scope.row)">{{ scope.row.kf_score ? -scope.row.kf_score : '' }}</span>
-                    <span v-if="scope.row.kf_score">分</span>
+                    <span v-if="scope.row.avg_score">{{ scope.row.avg_score }}分</span>
                   </template>
                 </el-table-column>
-                <el-table-column prop="avg_score" label="平均得分" align="center">
+                <el-table-column prop="qx_total_num" label="缺陷总数" width="120" align="center">
                   <template slot-scope="scope">
-                    <span>{{ scope.row.avg_score }}</span>
-                    <span v-if="scope.row.avg_score">分</span>
+                    <span v-if="typeof scope.row.qx_total_num === 'number'">{{ scope.row.qx_total_num }}列</span>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="qx_zb" label="个人缺陷占比" width="120" align="center">
+                  <template slot-scope="scope">
+                    <span v-if="typeof scope.row.qx_zb === 'number'">{{ scope.row.qx_zb }}%</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="占缺陷列数总比" width="120" align="center">
+                  <template slot-scope="scope">
+                    <span v-if="typeof scope.row.qx_total_num === 'number'">{{ (scope.row.qx_total_num/tongjiData.qxSum ).toFixed(2)*100}}%</span>
                   </template>
                 </el-table-column>
               </el-table>
@@ -314,14 +334,12 @@
               </div>
             </el-col>
             <el-col :span="10">
-              <DoctorRankVue v-if="doctor_tableData.length" :data="doctor_tableData" ref="barRank" />
+              <DoctorRankVue v-if="doctor_tableData.length" :data="doctor_tableData" :key="refreshKey" ref="barRank" />
             </el-col>
           </el-row>
         </div>
       </el-collapse-transition>
     </div>
-    <el-dialog title="所属科室多选" :visible.sync="ksSearchDialog" width="1000px"  center custom-class="custom-dialog">
-    </el-dialog>
   </div>
 </template>
 
@@ -334,58 +352,41 @@ export default {
   },
   data() {
     return {
-      ksSearchDialog:false,
-      selectedValue: [], // 绑定选中的路径数组
+      refreshKey:0,
       cascaderProps: {
-        checkStrictly: true, // 允许独立选择任意层级
         multiple: true,      // 开启多选模式
         label: 'label',
         value: 'id',
         children: 'children',
+        checkStrictly: true, // 允许独立选择任意层级
         emitPath: false,     // 是否返回完整路径(true 返回路径数组,false 只返回末节点值)
-      },
-      options: [ // 树形结构数据
-        {
-          value: 'beijing',
-          label: '北京',
-          children: [
-            {
-              value: 'chaoyang',
-              label: '朝阳区',
-              children: [
-                { value: 'sanlitun', label: '三里屯' },
-                { value: 'wangjing', label: '望京' }
-              ]
-            },
-            {
-              value: 'haidian',
-              label: '海淀区',
-              children: [
-                { value: 'zhongguancun', label: '中关村' }
-              ]
-            }
-          ]
         },
-        {
-          value: 'shanghai',
-          label: '上海',
-          children: [
-            {
-              value: 'pudong',
-              label: '浦东新区',
-              children: [
-                { value: 'lujiazui', label: '陆家嘴' }
-              ]
-            }
-          ]
-        }
-      ],
       search:{},//搜索内容
-      searchInfoOptions:{//获取搜索的options
+      searchInfoOptions:{//顶部搜索options
         yqArray:[],//院区options
         depArray:[],//科室options
         bqArray:[],//病区options
       },
+      qxSearchOptions: {//缺陷详情options
+        bmyArray:[],//编码员options
+        },
+      //region 医师排名
+      // 默认排序配置
+      ysSortParams:{//排序
+        prop: 'avg_score',   // 排序字段(需与prop一致)
+        order: 'descending'  // 初始顺序:ascending(升序)/descending(降序)
+      },
+      ysSearch:{'sf_type':1},//医师排名search
+      ysSearchOptions: { //医师排名options
+        sfArray:[
+          {'label':'科主任','value':1},
+          {'label':'主任(副主任)医师','value':2},
+          {'label':'主治医师','value':3},
+          {'label':'住院医师','value':4},
+          {'label':'编码员','value':5}
+        ],//身份option
+      },
+      //endregion
       levels: [
         {
           label: '强制',
@@ -450,39 +451,23 @@ export default {
         total: 11,
       },
       doctor_tableData: [],
-      // doctor_tableData: [
-      //   {
-      //     "docker_name": "杜晓峰",
-      //     "bl_sum": 28,
-      //     "qx_sum": 22,
-      //     "sum_score": 2800,
-      //     "df_score": 2158,
-      //     "kf_score": 642,
-      //     "proportion": "77.07",
-      //     "avg_score": 88
-      //   },
-      // ],
     };
   },
   async mounted() {
-    /*
     const year = new Date().getFullYear();
     const month = new Date().getMonth() + 1 > 10 ?  new Date().getMonth() + 1 : `0${new Date().getMonth() + 1}`;
     const day = new Date().getDate() < 10 ? `0${new Date().getDate()}` : new Date().getDate();
     this.$set(this.formInline, 'start_time', `${year}0101`);
     this.$set(this.formInline, 'end_time', `${year}${month}${day}`);
-     */
-    //this.getDepartmentData();
+    this.getSearchOptions();//获取搜索options
     await this.getTongjiData()
     this.tongjiPie();
     this.qxxqPie();
     this.getQuexianData();
     this.getDoctorRank();
     this.getFieldList();
-    this.getSearchOptions();//获取搜索options
   },
   beforeRouteEnter(to, from, next) {
-
     next(vm => {
       // 回到原来的位置
       const position = JSON.parse(window.sessionStorage.getItem('position'))
@@ -496,18 +481,28 @@ export default {
     next()
     },
   methods: {
-    //
-    handleChange(){
-
+    //医师工号复制
+    yiCodeCopy(value) {
+      navigator.clipboard.writeText(value)
+      this.$message.success('复制成功');
+    },
+    //医师排名排序
+    handleSortChange({ prop, order }){
+      this.ysSortParams = { prop, order };
+      this.getDoctorRank();
+    },
+    //医师排名身份类型切换
+    ysTypeChange() {
+      this.getDoctorRank();
     },
-    //获取搜索内容
+    //获取搜索下拉options
     getSearchOptions(){
       this.$axios_new.post('/api/bmy/getSearchOptions').then(res => {
         this.searchInfoOptions.yqArray = res.data.yqArray;//院区
         this.searchInfoOptions.depArray = res.data.depArray;//科室
         this.searchInfoOptions.bqArray = res.data.bqArray;//病区
-        this.formInline.start_time = res.data.start_time;//开始时间
-        this.formInline.end_time = res.data.end_time;//结束时间
+        //缺陷详情options
+        this.qxSearchOptions.bmyArray = res.data.qxSearchOptions.bmyArray;
       });
     },
     // 获取缺陷字段选项
@@ -516,12 +511,6 @@ export default {
         this.fields = res.data;
       });
     },
-    // 汇总统计跳转
-    // toErrorPage(status) {
-    //   // status 1-总病历 2-缺陷病历
-    //   const { start_time, end_time } = this.formInline
-    //   this.$router.push({ name: 'EncoderErrors', query: { start_time, end_time, is_qx: status }})
-    // },
     // 缺陷详情列表
     toPage(row) {
       const { start_time, end_time } = this.formInline;
@@ -543,7 +532,7 @@ export default {
     },
     // 获取缺陷数据
     getQuexianData() {
-      const { dep_id, type, level, desc, field } = this.qxxqData;
+      const { dep_id, type, level, desc, field ,bmy_ids} = this.qxxqData;
       const { page, size } = this.paginationData;
       const params = {
         dep_id,
@@ -551,6 +540,7 @@ export default {
         level,
         desc,
         field,
+        bmy_ids,
         page,
         page_size: size,
         ...this.formInline,
@@ -829,33 +819,16 @@ export default {
     },
     // 医师排名
     getDoctorRank() {
-      const { page, size } = this.paginationDataDoctor;
-      const params = {
-        page,
-        page_size: size,
-        ...this.formInline,
-        is_export: 0,
-      };
+      //zz修改
+      let params = Object.assign({},this.formInline, this.ysSearch);//将顶部搜索条件与医师排名搜索条件合并成一个
+      params['prop'] = this.ysSortParams.prop;//排序字段
+      params['order'] = this.ysSortParams.order;//排序规则
+      params['page'] = this.paginationData.page;//页码
+      params['size'] = this.paginationData.size;//页数
       this.$axios_new.post('/api/bmy/doctorRanking', params).then(res => {
-        let arr = [];
-        if (res.data.list.length < 10) {
-          for (let i = 0; i < 10 - res.data.list.length; i++) {
-            arr.push({
-              docker_name: '',
-              bl_sum: '',
-              qx_sum: '',
-              sum_score: '',
-              df_score: '',
-              kf_score: '',
-              proportion: '',
-            });
-          }
-        }
-        this.$set(this, 'doctor_tableData', res.data.list.concat(arr))
-        this.paginationDataDoctor.total = res.data.count;
-        setTimeout(()=> {
-          this.$refs.barRank.updata();
-        }, 500)
+        this.doctor_tableData = res.data.data;
+        this.paginationDataDoctor.total = res.data.total;
+        this.refreshKey++;
       });
     },
     // 导出