yuwandanmian 1 år sedan
förälder
incheckning
7baa11a233

+ 27 - 0
src/api/dict.js

@@ -53,3 +53,30 @@ export function ssczSave(data) {
     data: data
   })
 }
+
+// 病历目录-数据字典
+export function get_field_detail(data) {
+  return request({
+    url: '/api/quality_rule/get_field_detail',
+    method: 'post',
+    data: data
+  })
+}
+
+// 病历目录-列表
+export function get_dict_list(data) {
+  return request({
+    url: '/api/quality_rule/get_dict',
+    method: 'post',
+    data: data
+  })
+}
+
+// 病历目录-列表-修改状态
+export function edit_dict_status(data) {
+  return request({
+    url: '/api/quality_rule/edit_dict_status',
+    method: 'post',
+    data: data
+  })
+}

+ 35 - 0
src/views/dict/blml/components/DictDialog.vue

@@ -0,0 +1,35 @@
+<template>
+  <div>
+    <el-dialog
+      title="提示"
+      :visible.sync="data.bSwitch"
+      width="500px"
+    >
+      <span>这是一段信息</span>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    data: {
+      type: Object,
+      default() {
+        return {
+          bSwitch: false,
+          field: ''
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 42 - 11
src/views/dict/blml/components/SearchBox.vue

@@ -2,40 +2,71 @@
   <div class="app-container">
     <el-form :inline="true" :model="data" class="demo-form-inline">
       <el-form-item label="">
-        <el-select v-model="data.sslb" filterable clearable placeholder="操作类型">
-          <el-option label="介入治疗" value="介入治疗" />
-          <el-option label="手术" value="手术" />
-          <el-option label="治疗性操作" value="治疗性操作" />
-          <el-option label="诊断性操作" value="诊断性操作" />
+        <el-select v-model="data.table" filterable clearable placeholder="数据库表">
+          <el-option v-for="item of table" :key="item.id" :label="item.field_name" :value="item.id" />
         </el-select>
       </el-form-item>
+      <el-form-item label="">
+        <el-input v-model="data.field" clearable placeholder="数据库表字段" />
+      </el-form-item>
+      <el-form-item label="">
+        <el-input v-model="data.field_name" clearable placeholder="表字段名称" />
+      </el-form-item>
+      <el-form-item label="">
+        <el-input v-model="data.dict" clearable placeholder="数据字典" />
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="onSubmit">查询</el-button>
       </el-form-item>
+      <el-form-item>
+        <el-button @click="onReset">重置</el-button>
+      </el-form-item>
     </el-form>
   </div>
 </template>
 
 <script>
+import { get_field_detail } from '@/api/dict'
+
 export default {
   props: {
     data: {
       type: Object,
       default() {
         return {
-          ssbm: '',
-          ssmc: '',
-          ssysbm: '',
-          ssysmc: '',
-          sslb: '',
-          ssnm: ''
+          table: '',
+          field: '',
+          field_name: '',
+          dict: ''
         }
       }
     }
   },
+  data() {
+    return {
+      table: []
+    }
+  },
+  created() {
+    this.getData()
+  },
   methods: {
+    getData() {
+      get_field_detail({ field: 0 }).then(res => {
+        console.log(res)
+        const { p } = res
+        this.table = p.list
+      }).catch(error => {
+        console.log(error)
+      }).finally(() => {
+        // this.loading = false
+      })
+    },
     onSubmit() {
       this.$emit('search')
+    },
+    onReset() {
+      this.$emit('reset')
     }
   }
 }

+ 53 - 14
src/views/dict/blml/components/TableBox.vue

@@ -17,37 +17,48 @@
         align="center"
       />
       <el-table-column
-        prop=""
+        prop="parent_field"
         label="数据库表"
         align="center"
       />
       <el-table-column
-        prop="SSNM"
+        prop="parent_fildname"
         label="数据库表名称"
         align="center"
       />
       <el-table-column
-        prop="SSLB"
+        prop="field"
         label="数据字段"
         align="center"
       />
       <el-table-column
-        prop="SSLB"
+        prop="field_name"
         label="字段含义"
         align="center"
       />
       <el-table-column
-        prop="SSLB"
+        prop=""
         label="数据字典"
+        width="130"
         align="center"
-      />
-      <el-table-column
-        prop="SSLB"
-        label="状态"
-        align="center"
-      />
+      >
+        <template slot-scope="scope">
+          <el-button type="text" style="color: #E6A23C;" @click="onShowDict(scope.row)">查看</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column key="status" label="状态" width="130" align="center">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.status"
+            active-color="#13ce66"
+            :active-value="1"
+            :inactive-value="2"
+            @change="handleStatusChange(scope.row)"
+          />
+        </template>
+      </el-table-column>
       <el-table-column
-        prop="SSLB"
+        prop="remark"
         label="备注"
         align="center"
       />
@@ -59,6 +70,7 @@
       >
         <template slot-scope="scope">
           <el-button type="text" @click="onEdit(scope.row)">修改</el-button>
+          <el-button type="text" style="color: #F56C6C;">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -69,6 +81,7 @@
 
 <script>
 import CreateDialog from './CreateDialog.vue'
+import { edit_dict_status } from '@/api/dict'
 
 export default {
   components: {
@@ -90,9 +103,17 @@ export default {
   },
   data() {
     return {
+      statusArr: [
+        { 'id': 1, 'name': '启用' },
+        { 'id': 2, 'name': '停用' }
+      ],
       createData: {
         bSwitch: false,
         row: {}
+      },
+      dictData: {
+        bSwitch: false,
+        field: ''
       }
     }
   },
@@ -108,8 +129,26 @@ export default {
     handleRefresh() {
       this.$emit('refresh')
     },
-    onExport() {
-      this.$emit('export')
+    handleStatusChange(row) {
+      const statusIndex = this.statusArr.findIndex((value) => parseInt(value.id) === parseInt(row.status))
+      this.$confirm('确认要更改为 <strong>' + this.statusArr[statusIndex].name + '</strong> 状态吗?', '提示', {
+        dangerouslyUseHTMLString: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        edit_dict_status({ id: row.id, status: row.status }).then((res) => {
+          this.$message.success(res.m || '操作成功')
+        }).catch(function() {
+          row.status = row.status === 2 ? 1 : 2
+        })
+      }).catch(function() {
+        row.status = row.status === 2 ? 1 : 2
+      })
+    },
+    onShowDict(row) {
+      this.dictData.field = row.field
+      this.dictData.bSwitch = true
     }
   }
 }

+ 45 - 18
src/views/dict/blml/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <SearchBoxVue :data="searchData" @search="handleSearch" />
+    <SearchBoxVue :data="searchData" @search="handleSearch" @reset="handleReset" />
     <TableBoxVue :loading="loading" :data="tableData" style="margin-top: -40px;" @refresh="handleRefresh" />
     <pagination
       :auto-scroll="false"
@@ -15,7 +15,7 @@
 <script>
 import SearchBoxVue from './components/SearchBox.vue'
 import TableBoxVue from './components/TableBox.vue'
-import { getSsczysList } from '@/api/dict'
+import { get_dict_list } from '@/api/dict'
 
 export default {
   components: {
@@ -26,14 +26,33 @@ export default {
     return {
       loading: false,
       searchData: {
-        ssbm: '',
-        ssmc: '',
-        ssysbm: '',
-        ssysmc: '',
-        sslb: '',
-        ssnm: ''
+        table: '',
+        field: '',
+        field_name: '',
+        dict: ''
       },
-      tableData: [],
+      tableData: [
+        {
+          'id': 44,
+          'parent_field': 'attending_group',
+          'field': 'id',
+          'field_name': '',
+          'status': 1,
+          'type': 0,
+          'remark': '',
+          'parent_fildname': '病案首页主诊组'
+        },
+        {
+          'id': 62,
+          'parent_field': 'attending_group_data',
+          'field': 'standard_error_medical',
+          'field_name': '规范性有问题病案数',
+          'status': 1,
+          'type': 0,
+          'remark': '',
+          'parent_fildname': '病案首页统计表'
+        }
+      ],
       paginationData: {
         total: 0,
         page: 1,
@@ -42,27 +61,35 @@ export default {
     }
   },
   created() {
-    this.getList()
+    // this.getList()
   },
   methods: {
+    handleReset() {
+      this.searchData = {
+        table: '',
+        field: '',
+        field_name: '',
+        dict: ''
+      }
+      this.paginationData.page = 1
+      this.getList()
+    },
     handleRefresh() {
       this.getList()
     },
     async getList() {
-      const { ssbm, ssmc, ssysbm, ssysmc, sslb, ssnm } = this.searchData
+      const { table, field, field_name, dict } = this.searchData
       const { page, limit } = this.paginationData
       const params = {
-        ssbm,
-        ssmc,
-        ssysbm,
-        ssysmc,
-        sslb,
-        ssnm,
+        table,
+        field,
+        field_name,
+        dict,
         page,
         page_size: limit
       }
       this.loading = true
-      getSsczysList(params).then(res => {
+      get_dict_list(params).then(res => {
         const { p } = res
         this.paginationData.total = p.count
         this.tableData = p.list