Ver Fonte

指标排序

yuwandanmian há 2 anos atrás
pai
commit
923c3e292d
1 ficheiros alterados com 31 adições e 13 exclusões
  1. 31 13
      src/views/allcase/caseIndexList.vue

+ 31 - 13
src/views/allcase/caseIndexList.vue

@@ -37,36 +37,32 @@
         </div>
       </div>
       <!-- 列表 -->
-      <el-table :data="tableData" style="width: 100%">
+      <el-table :data="tableData" @sort-change="handleSortChange" style="width: 100%">
         <el-table-column type="index" label="序号" align="center" width="80">
           <template slot-scope="scope">
             <span>{{ scope.$index + 1 +  (paginationData.currentPage - 1) * paginationData.pageSize }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="" label="住院号" width="120">
+        <el-table-column prop="" label="住院号" width="90">
           <template slot-scope="scope">
             <span class="link" @click="toPage(scope.row)">{{ scope.row.AAA28 }}</span>
           </template>
         </el-table-column>
         <el-table-column prop="AAA01" label="患者姓名" width="120"></el-table-column>
-        <!-- <el-table-column prop="AAA02C" label="患者性别" width="120"></el-table-column> -->
-        <!-- <el-table-column prop="AAA29" label="住院次数" width="120"></el-table-column> -->
-        <!-- <el-table-column prop="" label="书写医生" width="120"></el-table-column> -->
-        <el-table-column prop="AAC11N" label="出院科室" width="240" show-overflow-tooltip></el-table-column>
-        <el-table-column prop="AAC01" label="出院时间" width="240" show-overflow-tooltip></el-table-column>
-        <el-table-column prop="AAB01" label="入院时间" width="180"></el-table-column>
-        <el-table-column prop="" label="状态" width="100">
+        <el-table-column prop="AAC11N" label="出院科室"></el-table-column>
+        <el-table-column prop="AAC01" label="出院时间" sortable width="160"></el-table-column>
+        <el-table-column prop="AAB01" label="入院时间" sortable width="160"></el-table-column>
+        <el-table-column prop="" label="状态" width="70">
           <template slot-scope="scope">
             <el-tag v-if="scope.row.numerator" type="success">正确</el-tag>
             <el-tag v-else type="danger">错误</el-tag>
           </template>
         </el-table-column>
-        <el-table-column prop="" label="描述">
+        <el-table-column prop="" label="描述" width="800">
           <template slot-scope="scope">
             <span>{{ scope.row.description }}</span>
           </template>
         </el-table-column>
-        <!-- <el-table-column prop="ADA01" label="总费用" width="120"></el-table-column> -->
       </el-table>
       <!-- 分页 -->
       <el-pagination
@@ -96,7 +92,9 @@ export default {
       searchData: {
         is_error: '',
         AAA28: '',
-        AAC11N: ''
+        AAC11N: '',
+        order: '',
+        order_sort: ''
       },
       tableData: [],
       paginationData: {
@@ -122,6 +120,22 @@ export default {
     this.getDepartmentList()
   },
   methods: {
+    handleSortChange(column) {
+      const { prop, order } = column
+      let str = ''
+      if (order === 'descending') {
+        str = 'desc'
+      } else if (order === 'ascending') {
+        str = 'asc'
+      } else {
+        str = null
+      }
+      
+      this.searchData.order = prop
+      this.searchData.order_sort = str
+      this.tableData = []
+      this.getList()
+    },
     toChildrenCase() {
       this.$router.push({ path: '/caseIndex', query: { type: 'children' }})
     },
@@ -135,7 +149,7 @@ export default {
     getList() {
       const { time, type, ruleId } = this.$route.query
       const { currentPage, pageSize } = this.paginationData
-      const { is_error, AAA28, AAC11N } = this.searchData
+      const { is_error, AAA28, AAC11N, order, order_sort } = this.searchData
       const params = {
         time,
         id: ruleId,
@@ -145,6 +159,10 @@ export default {
         AAA28,
         AAC11N
       }
+      if (order) {
+        params.order = order
+        params.order_sort = order_sort
+      }
       if ([0, 1].includes(is_error)) {
         params.is_error = is_error
       }