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

优化系统组件,新增环节质控查询条件

xiaochan 1 год назад
Родитель
Сommit
54d2266d24

+ 3 - 3
src/api/emr-control/emr-control.ts

@@ -1,11 +1,11 @@
 import request from "./request";
 import requestV2 from "../../utils/request-v2";
 
-export function linkQualityControl(startDate: string, endDate: string, sid: string, timeType: string) {
+export function linkQualityControl(data: any) {
     return request({
         url: '/emrQualityControl/linkControl',
-        method: 'get',
-        params: {startDate, endDate, sid, timeType}
+        method: 'post',
+        data
     })
 }
 

+ 3 - 3
src/components/cy/combo-grid/src/CyComboGridProps.ts

@@ -88,7 +88,7 @@ const CyComboGridProps = {
         default: false,
     },
     tableWidth: {
-        type: [String, Array],
+        type: [String],
         default: '100%'
     },
     rowHeight: {
@@ -100,11 +100,11 @@ const CyComboGridProps = {
         default: ['bottom-start', 'top-start', 'left', 'right']
     },
     rightTableValueWidth: {
-        type: [String, Array],
+        type: [String],
         default: '80'
     },
     rightTableLabelWidth: {
-        type: [String, Array],
+        type: [String],
         default: '120'
     },
     arrayAdditionallyFields: {

+ 8 - 0
src/components/cy/date-range/CyDateRange.vue

@@ -45,11 +45,13 @@ const props = withDefaults(defineProps<{
   end?: string,
   clearable?: boolean,
   unlinkPanels?: boolean
+  shortcutsIndex?: number | null
 }>(), {
   start: 'startTime',
   end: 'endTime',
   clearable: true,
   unlinkPanels: true,
+  shortcutsIndex: null
 })
 
 const model = defineModel<string[] | object>();
@@ -80,6 +82,12 @@ const dateRange = computed({
     }
   },
 })
+
+onMounted(() => {
+  if (props.shortcutsIndex != null) {
+    dateRange.value = shortcuts[props.shortcutsIndex].value
+  }
+})
 </script>
 
 <template>

+ 1 - 1
src/components/system/dept-select/SystemDeptSelect.vue

@@ -5,7 +5,7 @@ import CyComboGridProps from "@/components/cy/combo-grid/src/CyComboGridProps";
 import {getDept} from "@/api/public-api";
 import {defineComponent, ref} from 'vue'
 
-const deptData = ref([])
+const deptData = ref<any[]>([])
 
 getDept().then((res) => {
   deptData.value = res

+ 52 - 44
src/components/system/staff-select/SystemStaffSelect.vue

@@ -1,59 +1,67 @@
-<script setup lang="ts">
+<script lang="ts">
 import CyComboGridProps from "@/components/cy/combo-grid/src/CyComboGridProps";
 import {useVModel} from "@vueuse/core/index";
 import CyComboGrid from "@/components/cy/combo-grid/src/CyComboGrid.vue";
 import XEUtils from "xe-utils";
+import {defineComponent} from "vue";
+import {getPersonnelAll} from "@/api/public-api";
 
-const props = defineProps({
-  ...CyComboGridProps,
-  tableHeader: {
-    type: Array,
-    default: () => [
-      {code: 'codeRs', name: '工号', width: '50px'},
-      {code: 'label', name: '名称', width: '80px'},
-      {code: 'deptCodeName', name: '科室', width: '90px'},
-      {code: 'title', name: '职称', width: '90px'},
-    ]
-  },
-  filterSpecifiedEncoding: {
-    type: Array,
-    default: () => []
-  }
-})
-
-const emits = defineEmits([
-  'update:modelValue'
-])
-
-const mValue = useVModel(props, 'modelValue', emits)
+const staffSelect = ref<any[]>([])
 
-const tempData = computed(() => {
-  if (props.filterSpecifiedEncoding?.length > 0) {
-    return staffSelect.value.filter(item => props.filterSpecifiedEncoding?.includes(item.value))
-  }
-  return staffSelect.value
+getPersonnelAll().then(res => {
+  // @ts-ignore
+  staffSelect.value = res
 })
 
-const tempBind = computed(() => {
-  const temp: any = {}
-  for (const key in props) {
-    if (XEUtils.has(CyComboGridProps, key)) {
-      // @ts-ignore
-      temp[key] = props[key]
+export default defineComponent({
+  name: 'SystemStaffSelect',
+  components: {CyComboGrid},
+  props: {
+    ...CyComboGridProps,
+    tableHeader: {
+      type: Array,
+      default: () => [
+        {code: 'codeRs', name: '工号', width: '50px'},
+        {code: 'label', name: '名称', width: '80px'},
+        {code: 'deptCodeName', name: '科室', width: '90px'},
+        {code: 'title', name: '职称', width: '90px'},
+      ]
+    },
+    filterSpecifiedEncoding: {
+      type: Array,
+      default: () => []
     }
-  }
-  return temp
-})
-</script>
+  },
+  emits: [
+    'update:modelValue'
+  ],
+  setup(props, {emit}) {
+    const mValue = useVModel(props, 'modelValue', emit)
 
+    const tempData = computed(() => {
+      if (props.filterSpecifiedEncoding?.length > 0) {
+        return staffSelect.value.filter(item => props.filterSpecifiedEncoding?.includes(item.value))
+      }
+      return staffSelect.value
+    })
 
-<script lang="ts">
-import {getPersonnelAll} from "@/api/public-api";
+    const tempBind = computed(() => {
+      const temp: any = {}
+      for (const key in props) {
+        if (XEUtils.has(CyComboGridProps, key)) {
+          // @ts-ignore
+          temp[key] = props[key]
+        }
+      }
+      return temp
+    })
 
-const staffSelect = ref<any[]>([])
-
-getPersonnelAll().then(res => {
-  staffSelect.value = res as any[]
+    return {
+      tempBind,
+      tempData,
+      mValue
+    }
+  },
 })
 
 </script>

+ 25 - 16
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr_control_rule/EmrControlRule.vue

@@ -4,18 +4,21 @@
       <el-switch
           active-value="intervalPatients"
           inactive-value="admissTimes"
-          v-model="timeType"
+          v-model="queryParams.timeType"
           active-text="质控时间"
           inactive-text="入院时间"
       />
-      <el-date-picker
-          :shortcuts="shortcuts"
-          style="width: 220px"
-          type="daterange"
-          v-model="intervalPatients"/>
+      <CyDateRange v-model="queryParams"
+                   start="startDate"
+                   end="endDate"
+                   :shortcuts-index="2"/>
+
+      <SystemDeptSelect v-model="queryParams.deptCode" clearable placeholder="入院科室"/>
+      <SystemStaffSelect v-model="queryParams.approver" clearable placeholder="审核人"/>
 
       <el-button type="primary"
-                 @click="querySearch">查询质控数据
+                 @click="querySearch">
+        查询质控数据
       </el-button>
 
       <el-button @click="queryScale">
@@ -56,8 +59,6 @@
 
 <script setup>
 import {onMounted, ref} from "vue";
-import {getDateRangeFormatDate} from "@/utils/date";
-import {shortcuts} from "@/data/shortcuts";
 import RuleSift
   from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr_control_rule/RuleSift.vue";
 import {setCallback} from "@/utils/websocket";
@@ -66,9 +67,20 @@ import {makePercentage} from "@/components/progress/progUtils";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
 import {openSocket, sid} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-func/emr-socket";
 import useVxeTable from "@/utils/cy-use/useVxeTable";
+import SystemDeptSelect from "@/components/system/dept-select/SystemDeptSelect.vue";
+import SystemStaffSelect from "@/components/system/staff-select/SystemStaffSelect.vue";
+import CyDateRange from "@/components/cy/date-range/CyDateRange.vue";
+
+
+const queryParams = reactive({
+  timeType: '',
+  deptCode: '',
+  approver: "",
+  startDate: '',
+  endDate: '',
+  sid: sid
+})
 
-const intervalPatients = ref([])
-const timeType = ref('intervalPatients')
 const percentage = ref(0)
 const numberToArray = ref([])
 const tabsModel = ref('质控数量')
@@ -80,10 +92,9 @@ const ruleReturnData = ref({
 const siftData = ref({})
 
 const queryQualityControlData = async () => {
-  let {startTime, endTime} = getDateRangeFormatDate(intervalPatients.value)
   percentage.value = 0
   siftData.value = {}
-  let res = await linkQualityControl(startTime, endTime, sid, timeType.value)
+  let res = await linkQualityControl(queryParams)
   ruleReturnData.value = res
   proportion.value = res.proportion
   numberToArrayFunc()
@@ -130,12 +141,10 @@ const detailClick = ({name, total}) => {
 
 const proportion = ref('0%')
 const queryScale = async () => {
-  let {startTime, endTime} = getDateRangeFormatDate(intervalPatients.value)
-  proportion.value = await obtainTheProportionOfMedicalRecords(startTime, endTime, 0)
+  proportion.value = await obtainTheProportionOfMedicalRecords(queryParams.startTime, queryParams.endTime, 0)
 }
 
 onMounted(() => {
-  intervalPatients.value = shortcuts[2].value
   openSocket()
   setCallback('LINK_CONTROL', (data) => {
     percentage.value = makePercentage(data.current, data.total)