Quellcode durchsuchen

医保出院规则维护

lighter vor 1 Jahr
Ursprung
Commit
8ba7343ac8

+ 31 - 0
src/api/medical-insurance/si-dismiss-rules.js

@@ -0,0 +1,31 @@
+import request from '../../utils/request'
+
+export function getAllRules() {
+    return request({
+        url: '/dismissRules/getAllRules',
+        method: 'get',
+    })
+}
+
+export function getBaseDict() {
+    return request({
+        url: '/dismissRules/getBaseDict',
+        method: 'get',
+    })
+}
+
+export function saveEditResult(data) {
+    return request({
+        url: '/dismissRules/saveEditResult',
+        method: 'post',
+        data
+    })
+}
+
+export function deleteRule(id) {
+    return request({
+        url: '/dismissRules/deleteRule',
+        method: 'get',
+        params: { id }
+    })
+}

+ 1 - 0
src/components/cy/combo-grid/src/CyComboGrid.vue

@@ -247,6 +247,7 @@ defineExpose({
                        show-overflow-tooltip
                        show-overflow
                        :row-class-name="rowClass"
+                       :showHeader="showTableHeader"
                        max-height="250px"
                        :columnConfig="{ resizable: true}"
                        :row-config="{ height: rowHeight, isCurrent: true,isHover:true, useKey: true,keyField: 'value' }"

+ 4 - 0
src/components/cy/combo-grid/src/CyComboGridProps.ts

@@ -116,6 +116,10 @@ const CyComboGridProps = {
             valueWidth: '80',
             labelWidth: '120'
         }
+    },
+    showTableHeader: {
+        type: Boolean,
+        default: true
     }
 }
 

+ 130 - 142
src/components/search/Index.vue

@@ -7,12 +7,18 @@
           <el-button plain icon="Close" circle title="关闭" @click="close"></el-button>
         </div>
       </div>
-      <div>
-        <span>检索依据:</span>
-        <el-select v-model="params.method" style="width: 70px">
-          <el-option v-for="item in allMethods" :key="item.code" :label="item.name" :value="item.code"></el-option> </el-select
-        >&nbsp;
-        <el-input ref="inputRef" v-model="params.content" style="width: 240px" clearable placeholder="请输入检索内容"></el-input>
+      <div style="display: flex;align-items: center;">
+        <div>检索依据:</div>
+        <div>
+          <el-select v-model="params.method" style="width: 70px">
+            <el-option v-for="item in allMethods" :key="item.code" :label="item.name" :value="item.code"></el-option> </el-select
+          >
+        </div>
+        <div>
+          <el-input ref="inputRef" v-model="params.content"
+                    style="width: 180px;margin-left: 4px"
+                    clearable placeholder="请输入检索内容"></el-input>
+        </div>
       </div>
       <div class="data-box">
         <el-table ref="resultRef" :data="data.list" stripe height="360px" highlight-current-row @row-click="clickItem">
@@ -53,160 +59,142 @@
   </div>
 </template>
 
-<script>
+<script setup>
 import { reactive, ref, watch } from 'vue'
 import { searchFromServer } from '@/api/inpatient/dictionary'
 import { diagTypes } from '@/data/index'
 import Sleep from '@/utils/sleep'
 
-export default {
-  props: {
-    title: {
-      type: String,
-      required: true,
-    },
-    target: {
-      type: String,
-      required: true,
-    },
-    medType: {
-      type: String,
-      default: '',
-    },
-    showEmpDept: {
-      type: Boolean,
-      default: false
-    },
-    showYbCode: {
-      type: Boolean,
-      default: false
-    }
+const props = defineProps({
+  title: {
+    type: String,
+    required: true,
   },
-  emits: ['close', 'clickItem'],
-  setup(props, ctx) {
-    const inputRef = ref(null)
-    const resultRef = ref(null)
-    const allMethods = [
-      { code: 'alpha', name: '拼音' },
-      { code: 'code', name: '编码' },
-      { code: 'name', name: '名称' },
-    ]
-    const params = reactive({
-      method: 'alpha',
-      target: props.target,
-      medType: props.medType,
-      page: 1,
-      pageSize: 10,
-      content: '',
-    })
-    const data = reactive({
-      list: [],
-      totalSize: 0,
-    })
+  target: {
+    type: String,
+    required: true,
+  },
+  medType: {
+    type: String,
+    default: '',
+  },
+  showEmpDept: {
+    type: Boolean,
+    default: false
+  },
+  showYbCode: {
+    type: Boolean,
+    default: false
+  }
+})
+
+const emits = defineEmits(['close', 'clickItem'])
+
+const inputRef = ref(null)
+const resultRef = ref(null)
+const allMethods = [
+  { code: 'alpha', name: '拼音' },
+  { code: 'code', name: '编码' },
+  { code: 'name', name: '名称' },
+]
+const params = reactive({
+  method: 'alpha',
+  target: props.target,
+  medType: props.medType,
+  page: 1,
+  pageSize: 10,
+  content: '',
+})
+const data = reactive({
+  list: [],
+  totalSize: 0,
+})
+
+const showDiagType = ref(false)
+const diagItem = reactive({
+  icdCode: null,
+  icdText: null,
+  diagType: null,
+})
 
-    const showDiagType = ref(false)
-    const diagItem = reactive({
-      icdCode: null,
-      icdText: null,
-      diagType: null,
+const executeSearch = () => {
+  if (params.content.trim().length > 1) {
+    searchFromServer(params).then((res) => {
+      data.list = res.list
+      data.totalSize = res.totalSize
+      currentIndex.value = currentIndex.value > data.list.length - 1 ? data.list.length - 1 : currentIndex.value
+      resultRef.value.setCurrentRow(data.list[currentIndex.value])
     })
+  } else {
+    data.list = []
+    data.totalSize = 0
+  }
+}
 
-    const executeSearch = () => {
-      if (params.content.trim().length > 1) {
-        searchFromServer(params).then((res) => {
-          data.list = res.list
-          data.totalSize = res.totalSize
-          currentIndex.value = currentIndex.value > data.list.length - 1 ? data.list.length - 1 : currentIndex.value
-          resultRef.value.setCurrentRow(data.list[currentIndex.value])
-        })
-      } else {
-        data.list = []
-        data.totalSize = 0
-      }
-    }
+const currentIndex = ref(0)
+
+const handleCurrentChange = (val) => {
+  params.page = val
+  executeSearch()
+}
 
-    const currentIndex = ref(0)
+const confirmDiaginfo = () => {
+  emits('clickItem', diagItem)
+}
 
-    const handleCurrentChange = (val) => {
-      params.page = val
-      executeSearch()
-    }
+const clickItem = (item) => {
+  if (props.target === 'diag' || props.target === 'injurydiag') {
+    diagItem.icdCode = item.code
+    diagItem.icdText = item.name
+    diagItem.diagType = '1'
+    showDiagType.value = true
+  } else {
+    emits('clickItem', item)
+  }
+}
 
-    const confirmDiaginfo = () => {
-      ctx.emit('clickItem', diagItem)
-    }
+const close = () => {
+  emits('close')
+}
 
-    const clickItem = (item) => {
-      if (props.target === 'diag' || props.target === 'injurydiag') {
-        diagItem.icdCode = item.code
-        diagItem.icdText = item.name
-        diagItem.diagType = '1'
-        showDiagType.value = true
-      } else {
-        ctx.emit('clickItem', item)
-      }
+watch(
+    () => params.content,
+    () => {
+      executeSearch()
     }
+)
 
-    const close = () => {
-      ctx.emit('close')
-    }
+onMounted(async () => {
+  await Sleep(100)
+  inputRef.value.focus()
 
-    watch(
-      () => params.content,
-      () => {
-        executeSearch()
-      }
-    )
-
-    onMounted(async () => {
-      await Sleep(100)
-      inputRef.value.focus()
-
-      document.onkeydown = (e) => {
-        switch (e.code) {
-          case 'ArrowUp':
-            resultRef.value.setCurrentRow(data.list[currentIndex.value === 0 ? 0 : --currentIndex.value])
-            return false
-          case 'ArrowDown':
-            resultRef.value.setCurrentRow(data.list[currentIndex.value === data.list.length - 1 ? data.list.length - 1 : ++currentIndex.value])
-            return false
-          case 'ArrowLeft':
-            if (params.page > 1) {
-              handleCurrentChange(params.page - 1)
-            }
-            return false
-          case 'ArrowRight':
-            if (params.page * params.pageSize < data.totalSize) {
-              handleCurrentChange(params.page + 1)
-            }
-            return false
-          case 'Enter':
-            clickItem(data.list[currentIndex.value])
-            break
-          case 'Escape':
-            close()
-            break
+  document.onkeydown = (e) => {
+    switch (e.code) {
+      case 'ArrowUp':
+        resultRef.value.setCurrentRow(data.list[currentIndex.value === 0 ? 0 : --currentIndex.value])
+        return false
+      case 'ArrowDown':
+        resultRef.value.setCurrentRow(data.list[currentIndex.value === data.list.length - 1 ? data.list.length - 1 : ++currentIndex.value])
+        return false
+      case 'ArrowLeft':
+        if (params.page > 1) {
+          handleCurrentChange(params.page - 1)
         }
-      }
-    })
-
-    return {
-      inputRef,
-      resultRef,
-      data,
-      params,
-      allMethods,
-      diagItem,
-      diagTypes,
-      showDiagType,
-      confirmDiaginfo,
-      executeSearch,
-      handleCurrentChange,
-      clickItem,
-      close,
+        return false
+      case 'ArrowRight':
+        if (params.page * params.pageSize < data.totalSize) {
+          handleCurrentChange(params.page + 1)
+        }
+        return false
+      case 'Enter':
+        clickItem(data.list[currentIndex.value])
+        break
+      case 'Escape':
+        close()
+        break
     }
-  },
-}
+  }
+})
 </script>
 
 <style scoped>

+ 2 - 2
src/utils/cy-use/useDateRange.tsx

@@ -55,12 +55,12 @@ export default function useDateRange(props?: ElDatePickerType) {
         dateRange.value = elDateRangeAddTime(value)
     }
 
-    if (props?.aFewDaysAgo) {
+    if (typeof props?.aFewDaysAgo !== undefined) {
         currentAndAFewDaysAgo(props?.aFewDaysAgo).then(res => {
             handelChangeDate(res)
         })
     }
-
+    
     function CyDateRange(dateProps) {
         return (<div style="display: inline-flex;vertical-align: middle;width:220px">
             <ElDatePicker

+ 1 - 1
src/views/clinic/WxPayRefund.vue

@@ -26,7 +26,7 @@
       <el-button type="primary" icon="Upload" @click="exportExcel">导出Excel</el-button>
     </template>
     <template #main>
-      <el-table :data="data.list" stripe highlight-current-row>
+      <el-table :data="data.list" :height="tableHeight" stripe highlight-current-row>
         <el-table-column prop="patientId" label="门诊ID" width="80"></el-table-column>
         <el-table-column prop="patientName" label="姓名" width="80"></el-table-column>
         <el-table-column prop="body" label="商品" width="180"></el-table-column>

+ 120 - 0
src/views/medical-insurance/management/ViolationRules.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="cy_h-w_max">
+    <CyVxeTable>
+      <VxeColumn title="已有规则">
+        <template #default="{row}">
+          <span v-html="row.description"></span>
+        </template>
+      </VxeColumn>
+      <VxeColumn width="120">
+        <template #header>
+          <el-button type="primary" icon="Plus" plain @click="addNewRule">添加规则</el-button>
+        </template>
+        <template #default="{row}">
+              <span
+                  style="color: blue; text-decoration: underline;cursor: pointer"
+                  @click="editRule(row)"
+              >
+                编辑
+              </span>
+          <span
+              style="color: red;margin-left: 4px;cursor: pointer;text-decoration: underline"
+              @click="beforeDeleteRule(row)"
+          >
+                  删除
+                </span>
+        </template>
+      </VxeColumn>
+    </CyVxeTable>
+  </div>
+  <el-dialog v-model="showEditRulePanel" :title="editRulePanelTitle">
+    <SystemItemDrug v-model="tempRule" value="chargeCode" label="chargeName"></SystemItemDrug>
+
+    <cy-combo-grid v-model="tempRule"
+                   value="attribute"
+                   :show-table-header="false"
+                   :table-header="[{code: 'label', name: '名称', width: '135px'}]"
+                   :data="baseDict.attributes"
+                   label="attributeName"/>
+
+    <span style="font-weight: bold; margin: 0 8px; color: red">不能</span>
+    <cy-combo-grid v-model="tempRule"
+                   value="operator"
+                   :show-table-header="false"
+                   :table-header="[{code: 'label', name: '名称', width: '135px'}]"
+                   :data="baseDict.operatorSymbols"
+                   label="operatorName"/>
+
+    <cy-combo-grid v-model="tempRule"
+                   value="comparison"
+                   :show-table-header="false"
+                   :table-header="[{code: 'label', name: '名称', width: '135px'}]"
+                   :data="baseDict.comparisons"
+                   label="comparisonName"/>
+
+    <template #footer>
+      <el-button type="success" plain size="small" style="width: 88px" @click="executeSaving">保存</el-button>
+    </template>
+  </el-dialog>
+</template>
+<script setup>
+import {deleteRule, getAllRules, getBaseDict, saveEditResult} from "@/api/medical-insurance/si-dismiss-rules";
+import cyMessageBox from "@/components/cy/message-box/src/cy-message-box";
+import useVxeTable from "@/utils/cy-use/useVxeTable";
+import SystemItemDrug from "@/components/system/item-drug/SystemItemDrug.vue"
+import CyComboGrid from "@/components/cy/combo-grid/src/CyComboGrid.vue";
+
+const baseDict = reactive({
+  operatorSymbols: [],
+  attributes: [],
+  comparisons: []
+})
+
+const {CyVxeTable,querySearch} = useVxeTable({
+  keyField: 'id',
+  mountedQuery: true,
+  remoteSearch: () => getAllRules(),
+})
+
+const tempRule = ref({})
+const showEditRulePanel = ref(false)
+const editRulePanelTitle = computed(() => {
+  return tempRule.value.id ? '编辑规则' : '添加规则'
+})
+function editRule(row) {
+  tempRule.value = row
+  showEditRulePanel.value = true
+}
+
+function addNewRule() {
+  tempRule.value = {}
+  showEditRulePanel.value = true
+}
+
+function executeSaving() {
+  saveEditResult(tempRule.value).then(() => {
+    showEditRulePanel.value = false
+    querySearch()
+  })
+}
+
+function beforeDeleteRule(row) {
+  cyMessageBox.confirm({
+    message: '是否确定删除此规则?' + row.description,
+    dangerouslyUseHTMLString: true
+  }).then(() => {
+    deleteRule(row.id).then(() => {
+      querySearch()
+    })
+  }).catch(() => {
+  })
+}
+
+onMounted(() => {
+  getBaseDict().then(res => {
+    baseDict.operatorSymbols = res.operatorSymbols
+    baseDict.attributes = res.attributes
+    baseDict.comparisons = res.comparisons
+  })
+})
+</script>