yuwandanmian 2 vuotta sitten
vanhempi
commit
d1e061975c

+ 1 - 1
src/main.js

@@ -39,7 +39,7 @@ Vue.component('Pagination', Pagination)
 //   mockXHR()
 // }
 Vue.use(Element, {
-  size: Cookies.get('size') || 'medium', // set element-ui default size
+  size: Cookies.get('size') || 'small', // set element-ui default size
   i18n: (key, value) => i18n.t(key, value)
 })
 

+ 61 - 8
src/views/knowledge/illness/components/SearchBox.vue

@@ -1,8 +1,36 @@
 <template>
   <div class="app-container">
     <div class="btn-box">
-      <el-button type="primary" icon="el-icon-search" style="float: left;" @click="show = !show">筛选</el-button>
-      <el-button type="primary" icon="el-icon-download" style="float: right;" @click="onExcelDownload">导出</el-button>
+      <el-button type="primary" icon="el-icon-s-data" style="float: left;" @click="show = !show">筛选</el-button>
+      <div style="float: right;">
+        <el-button type="primary" icon="el-icon-plus" style="margin-right: 10px;">新增</el-button>
+        <el-popover
+          placement="bottom-end"
+          title=""
+          trigger="click"
+          popper-class="table_code_popper"
+        >
+          <el-checkbox-group v-model="showCodes" @change="handleChange">
+            <el-checkbox label="FLAG">序号</el-checkbox>
+            <el-checkbox label="KSMC">科室</el-checkbox>
+            <el-checkbox label="JBMC">疾病名称</el-checkbox>
+            <el-checkbox label="BM">疾病别名</el-checkbox>
+            <el-checkbox label="JBBM">疾病编码</el-checkbox>
+            <el-checkbox label="JBZD">鉴别诊断</el-checkbox>
+            <el-checkbox label="ZZ">症状</el-checkbox>
+            <el-checkbox label="TZ">体征</el-checkbox>
+            <el-checkbox label="YP">药品</el-checkbox>
+            <el-checkbox label="ZL">治疗</el-checkbox>
+            <el-checkbox label="JC">检查</el-checkbox>
+            <el-checkbox label="JJ">检验</el-checkbox>
+            <el-checkbox label="BFZ">并发症</el-checkbox>
+            <el-checkbox label="CKWX">参考文献</el-checkbox>
+            <el-checkbox label="created_at">创建时间</el-checkbox>
+            <el-checkbox label="updated_at">更新时间</el-checkbox>
+          </el-checkbox-group>
+          <el-button slot="reference" icon="el-icon-setting">设置</el-button>
+        </el-popover>
+      </div>
     </div>
     <el-collapse-transition>
       <div v-if="show" style="margin-bottom: 16px;">
@@ -84,7 +112,10 @@
             />
           </el-form-item>
           <el-form-item>
-            <el-button type="primary" @click="onSubmit">查询</el-button>
+            <el-button type="primary" icon="el-icon-search" @click="onSubmit">搜索</el-button>
+          </el-form-item>
+          <el-form-item>
+            <el-button icon="el-icon-refresh" @click="onReset">重置</el-button>
           </el-form-item>
         </el-form>
       </div>
@@ -117,11 +148,15 @@ export default {
           createStartTime: '',
           createEndTime: '',
           updateStartTime: '',
-          updateEndTime: '',
-          SSMC: '',
-          SSBM: ''
+          updateEndTime: ''
         }
       }
+    },
+    codes: {
+      type: Array,
+      default() {
+        return []
+      }
     }
   },
   data() {
@@ -163,15 +198,25 @@ export default {
         }
       },
       deportments: [],
-      show: false
+      show: false,
+      showCodes: []
     }
   },
   created() {
     this.getDeportmentList()
+    this.showCodes = JSON.parse(JSON.stringify(this.codes))
   },
   methods: {
+    // 展示字段发生变化
+    handleChange(val) {
+      this.$emit('codesChange', val)
+    },
+    // 重置
+    onReset() {
+      this.$emit('reset')
+    },
+    // 提交
     onSubmit() {
-      console.log(this.data, 'this.data')
       this.$emit('search')
     },
     getDeportmentList() {
@@ -201,3 +246,11 @@ export default {
   margin-bottom: 15px;
 }
 </style>
+<style lang="scss">
+.table_code_popper {
+  .el-checkbox {
+    display: block;
+    line-height: 26px;
+  }
+}
+</style>

+ 25 - 8
src/views/knowledge/illness/components/TableBox.vue

@@ -6,104 +6,115 @@
       style="width: 100%"
     >
       <el-table-column
-        prop="id"
+        v-if="codes.includes('FLAG')"
+        prop="FLAG"
         label="序号"
-        width="100"
+        width="200"
         show-overflow-tooltip
         align="center"
         fixed="left"
       />
       <el-table-column
+        v-if="codes.includes('KSMC')"
         prop="KSMC"
         label="科室"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('JBMC')"
         prop="JBMC"
         label="疾病名称"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('BM')"
         prop="BM"
         label="疾病别名"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('JBBM')"
         prop="JBBM"
         label="疾病编码"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('JBZD')"
         prop="JBZD"
         label="鉴别诊断"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('ZZ')"
         prop="ZZ"
         label="症状"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('TZ')"
         prop="TZ"
         label="体征"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('YP')"
         prop="YP"
         label="药品"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('ZL')"
         prop="ZL"
         label="治疗"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('JC')"
         prop="JC"
         label="检查"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('JJ')"
         prop="JJ"
         label="检验"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('BFZ')"
         prop="BFZ"
         label="并发症"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('CKWX')"
         prop="CKWX"
         label="参考文献"
         width="200"
         show-overflow-tooltip
       />
       <el-table-column
+        v-if="codes.includes('created_at')"
         prop="created_at"
         label="创建时间"
         width="200"
       />
       <el-table-column
-        prop="created_at"
-        label="更新时间"
-        width="200"
-      />
-      <el-table-column
+        v-if="codes.includes('updated_at')"
         prop="updated_at"
-        label="查询时间"
+        label="更新时间"
         width="200"
       />
       <el-table-column
@@ -137,6 +148,12 @@ export default {
       default() {
         return false
       }
+    },
+    codes: {
+      type: Array,
+      default() {
+        return []
+      }
     }
   },
   methods: {

+ 113 - 5
src/views/knowledge/illness/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
-    <SearchBoxVue :data="searchData" @search="handleSearch" />
-    <TableBoxVue :loading="loading" :data="tableData" style="margin-top: -40px;" @download="handleDownLoad" />
+    <SearchBoxVue :data="searchData" :codes="tableShowCode" @search="handleSearch" @reset="handleReset" @codesChange="handleCodesChange" />
+    <TableBoxVue :loading="loading" :data="tableData" :codes="tableShowCode" style="margin-top: -40px;" @download="handleDownLoad" />
     <pagination
       :auto-scroll="false"
       :total="paginationData.total"
@@ -45,11 +45,27 @@ export default {
         createStartTime: '',
         createEndTime: '',
         updateStartTime: '',
-        updateEndTime: '',
-        SSMC: '',
-        SSBM: ''
+        updateEndTime: ''
       },
       tableData: [],
+      tableShowCode: [
+        'FLAG',
+        'KSMC',
+        'JBMC',
+        'BM',
+        'JBBM',
+        'JBZD',
+        'ZZ',
+        'TZ',
+        'YP',
+        'ZL',
+        'JC',
+        'JJ',
+        'BFZ',
+        'CKWX',
+        'created_at',
+        'updated_at'
+      ],
       paginationData: {
         total: 0,
         page: 1,
@@ -58,9 +74,19 @@ export default {
     }
   },
   created() {
+    const codes = localStorage.getItem('illness_talbe_codes').split(',')
+    if (codes.length) {
+      this.$set(this, 'tableShowCode', codes)
+    }
     this.getList()
   },
   methods: {
+    // 展示字段变化
+    handleCodesChange(val) {
+      localStorage.setItem('illness_talbe_codes', val)
+      this.$set(this, 'tableShowCode', val)
+    },
+    // 获取列表数据
     getList() {
       const {
         FLAG,
@@ -116,6 +142,64 @@ export default {
         const { p } = res
         this.paginationData.total = p.count
         this.tableData = p.list
+        this.tableData = [{
+          'id': 20,
+          'FLAG': 'EK_ZLSJBMC',
+          'KSMC': '儿科',
+          'JBMC': '这里是疾病名称',
+          'BM': '这里是别名',
+          'JBBM': '这里是疾病编码',
+          'JBZD': '这里是鉴别诊断',
+          'ZZ': '这里是症状',
+          'TZ': '这里是体征',
+          'YP': '这里是药品',
+          'ZL': '这里是治疗',
+          'JC': '这里是检查',
+          'JJ': '这里是检验',
+          'BFZ': '这里是并发症',
+          'CKWX': '这里是参考文献',
+          'created_at': '2023-06-06 14:24:51',
+          'updated_at': '2023-06-06 14:24:51'
+        },
+        {
+          'id': 21,
+          'FLAG': 'ZLSJBMCYYY',
+          'KSMC': '',
+          'JBMC': '这里是疾病名称111',
+          'BM': '这里是别名111',
+          'JBBM': '这里是疾病编码111',
+          'JBZD': '这里是鉴别诊断111',
+          'ZZ': '这里是症状111',
+          'TZ': '这里是体征111',
+          'YP': '这里是药品111',
+          'ZL': '这里是治疗111',
+          'JC': '这里是检查111',
+          'JJ': '这里是检验111',
+          'BFZ': '这里是并发症111',
+          'CKWX': '这里是参考文献111',
+          'created_at': '2023-06-06 14:24:51',
+          'updated_at': '2023-06-06 14:24:51'
+        },
+        {
+          'id': 22,
+          'FLAG': 'ZLSJBMCEEE',
+          'KSMC': '',
+          'JBMC': '这里是疾病名称222',
+          'BM': '这里是别名222',
+          'JBBM': '这里是疾病编码222',
+          'JBZD': '',
+          'ZZ': '',
+          'TZ': '',
+          'YP': '',
+          'ZL': '',
+          'JC': '',
+          'JJ': '',
+          'BFZ': '',
+          'CKWX': '',
+          'created_at': '2023-06-06 14:24:51',
+          'updated_at': '2023-06-06 14:24:51'
+        }
+        ]
       }).catch(error => {
         console.log(error)
       }).finally(() => {
@@ -131,6 +215,30 @@ export default {
       this.paginationData.page = 1
       this.getList()
     },
+    handleReset() {
+      this.searchData = {
+        FLAG: '',
+        KSMC: '',
+        JBMC: '',
+        BM: '',
+        JBBM: '',
+        JBZD: '',
+        ZZ: '',
+        TZ: '',
+        YP: '',
+        ZL: '',
+        JC: '',
+        JJ: '',
+        BFZ: '',
+        CKWX: '',
+        createStartTime: '',
+        createEndTime: '',
+        updateStartTime: '',
+        updateEndTime: '',
+        SSMC: '',
+        SSBM: ''
+      }
+    },
     handleDownLoad() {
       const { name, dep_id, time, keyword } = this.searchData
       const params = {