Browse Source

删除检验正常

xiaochan 1 year ago
parent
commit
3fe4be5629

+ 14 - 7
src/components/xiao-chan/cy-dialog/cy-dialog.vue

@@ -7,7 +7,6 @@ import {Close} from '@element-plus/icons-vue'
 import {computed, PropType} from "vue";
 import sleep from "@/utils/sleep";
 
-
 const props = defineProps({
   modelValue: {
     type: Boolean,
@@ -58,6 +57,10 @@ const props = defineProps({
   bodyCenter: {
     type: Boolean,
     default: false
+  },
+  showIcon: {
+    type: Boolean,
+    default: true
   }
 })
 
@@ -77,7 +80,7 @@ async function handleMakeClick() {
 }
 
 function beforeClose(done, val) {
-  if (!props.closeOnClickModal && (val === 'modal' || val === 'icon')) {
+  if (!props.closeOnClickModal && (val === 'modal')) {
     handleMakeClick()
     return
   }
@@ -101,7 +104,7 @@ const dialogStyle = computed(() => {
 })
 
 const modalClass = computed(() => {
-  return 'cy_dialog-moda'
+  return 'cy_dialog-modal' + props.bodyCenter ? 'cy_dialog_body-center' : ''
 })
 
 defineExpose({
@@ -122,7 +125,7 @@ defineExpose({
              :append-to-body="props.appendToBody"
              ref="dialogRef"
              :show-close="false"
-             :modal-class="'cy_dialog-modal'"
+             :modal-class="modalClass"
              :width="props.width"
              draggable>
     <template #header="{close, titleId, titleClass}">
@@ -134,7 +137,7 @@ defineExpose({
       <span :class="titleClass">
         {{ props.title }}
       </span>
-      <button class="cy-message-box_close" @click.stop="close">
+      <button class="cy-message-box_close" @click.stop="close" v-if="props.showIcon">
         <ElIcon>
           <Close/>
         </ElIcon>
@@ -193,8 +196,12 @@ defineExpose({
 .cy_dialog_body-center {
   .el-overlay-dialog {
     display: flex;
-    align-content: center;
-    margin: 0;
+    justify-content: center;
+    align-items: center;
+
+    .el-dialog {
+      margin: 0;
+    }
   }
 }
 

+ 50 - 5
src/components/xiao-chan/cy-message-box-v2/cy-message-box-v2.ts

@@ -1,6 +1,6 @@
 //@ts-ignore
 import CyDialog from "../cy-dialog/cy-dialog.vue";
-import {createVNode, render} from "vue";
+import {createVNode, h, render} from "vue";
 import {uuid} from "../../../utils/getUuid";
 import {
     Close,
@@ -11,13 +11,58 @@ import {
     DeleteFilled
 } from '@element-plus/icons-vue'
 
-function showMessage() {
+interface CyMessageBox {
+    message?: string;
+    type?: 'success' | 'error' | 'warning' | 'info' | 'delete',
+    titleAlign?: string;
+    titleIcon?: any;
+    titleIconColor?: any,
+    title?: string,
+    confirmButtonText?: string,
+    cancelButtonText?: string,
+}
+
+const headerIconData = {
+    success: {
+        icon: h(SuccessFilled),
+        title: '成功',
+        color: '#67c23a'
+    },
+    warning: {
+        icon: h(Warning),
+        title: '警告',
+        color: '#e6a23c'
+    },
+    info: {
+        icon: h(InfoFilled),
+        title: '提示',
+        color: '#909399'
+    },
+    error: {
+        icon: h(CircleCloseFilled),
+        title: '错误',
+        color: '#f56c6c'
+    },
+    delete: {
+        icon: h(DeleteFilled),
+        title: '删除',
+        color: '#f56c6c'
+    }
+}
+
+
+export function showMessage(options: CyMessageBox) {
     const div = document.createElement('div');
+    document.body.appendChild(div)
     return new Promise((resolve, reject) => {
-        const data = {
+        const icon = headerIconData[options.type];
+        const data: CyMessageBox = {
             titleAlign: 'left',
-            titleIcon: '',
+            titleIcon: options.titleIcon || icon.icon,
         }
-        const vNode = createVNode(CyDialog, data, () => '')
+        //@ts-ignore
+        const vNode = createVNode(CyDialog, data, () => null)
+        render(vNode, div)
     })
+
 }

+ 38 - 20
src/components/xiao-chan/cy-message-box-v2/index.vue

@@ -1,14 +1,6 @@
 <script setup lang="ts">
-import {ref} from "vue";
+import {onMounted, ref} from "vue";
 import CyDialog from "@/components/xiao-chan/cy-dialog/cy-dialog.vue";
-import {
-  Close,
-  Warning,
-  SuccessFilled,
-  InfoFilled,
-  CircleCloseFilled,
-  DeleteFilled,
-} from '@element-plus/icons-vue'
 import {ElButton} from "element-plus";
 
 const props = defineProps({
@@ -16,13 +8,32 @@ const props = defineProps({
     type: String,
     default: '提示'
   },
-  manualShutdown: {
+  closeOnClickModal: {
     type: Boolean,
-    default: false
+    default: true
+  },
+  closeOnPressEscape: {
+    type: Boolean,
+    default: true
   },
   message: {
     type: String,
     default: '内容'
+  },
+  titleIcon: {
+    type: Object,
+  },
+  titleIconColor: {
+    type: String,
+    default: ''
+  },
+  confirmButtonText: {
+    type: String,
+    default: '确认'
+  },
+  cancelButtonText: {
+    type: String,
+    default: "取消"
   }
 })
 
@@ -34,11 +45,7 @@ let close = null
 
 const beforeClose = (done, type) => {
   close = close || 'close'
-  if (props.manualShutdown) {
-    dialogRef.value.handleMakeClick()
-  } else {
-    done()
-  }
+  done()
 }
 
 function handelClose(val) {
@@ -49,6 +56,11 @@ function handelClose(val) {
 function onClose() {
   console.log(close)
 }
+
+onMounted(() => {
+  console.log(dialog.value);
+})
+console.log(dialog.value);
 </script>
 
 <template>
@@ -56,14 +68,20 @@ function onClose() {
              :title="props.title"
              @closed="onClose"
              ref="dialogRef"
+             :close-on-click-modal="props.closeOnClickModal"
+             :close-on-press-escape="props.closeOnPressEscape"
              append-to-body
              :before-close="beforeClose"
-             title-icon-color="#67c23a"
-             :title-icon="SuccessFilled">
+             :title-icon-color="props.titleIconColor"
+             :title-icon="props.titleIcon">
     {{ props.message }}
     <template #footer>
-      <el-button type="danger" text size="default" @click="handelClose('cancel')">取消</el-button>
-      <el-button type="primary" size="default" @click="handelClose('confirm')">确认</el-button>
+      <el-button type="danger" text size="default" @click="handelClose('cancel')">
+        {{ props.cancelButtonText }}
+      </el-button>
+      <el-button type="primary" size="default" @click="handelClose('confirm')">
+        {{ props.cancelButtonText }}
+      </el-button>
     </template>
   </cy-dialog>
 </template>

+ 1 - 1
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrOrderList.vue

@@ -40,7 +40,7 @@
           </vxe-column>
           <vxe-column title="自费" field="ybSelfFlag" min-width="35">
             <template #default="{row}">
-              <span style="color: red" v-if="row.ybSelfFlag === 1">√</span>
+              <span style="color: red" v-if="row.ybSelfFlag === '1'">√</span>
             </template>
           </vxe-column>
           <vxe-column title="医嘱名称" field="orderName" min-width="220"/>

+ 0 - 364
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTest.vue

@@ -1,364 +0,0 @@
-<template>
-  <div style="height: 10%;display: flex">
-    <div>
-      <el-date-picker v-model="dateRange"
-                      style="width: 220px"
-                      :clearable="false"
-                      type="daterange"/>
-      <br>
-      <hr>
-      <el-button @click="query" type="primary">查询</el-button>
-      <el-button @click="appendCopy" type="success">复制 / 追加</el-button>
-      <el-button @click="copyClick" type="success">确认复制</el-button>
-      <br>
-    </div>
-    <div class="describe">
-      <el-button v-if="isEmr" type="primary" @click="copyOutcome('病理结果')">
-        病理结果
-      </el-button>
-
-      <el-button v-if="isEmr" type="primary" @click="copyOutcome('细菌培养结果')">
-        细菌培养结果
-      </el-button>
-
-      <div class="pat-info">
-        <div>
-          <test-describe front="姓名"
-                         :text="inspectionHeader?.ptnt_NAME"/>
-        </div>
-        <div>
-          <test-describe front="性别"
-                         :text="filterSex(inspectionHeader?.ptnt_SEX)"/>
-        </div>
-        <div>
-          <test-describe front="年龄"
-                         :text="inspectionHeader.ptnt_AGE + filterAgeUnit(inspectionHeader.ptnt_AGE_UNIT) "/>
-        </div>
-        <div>
-          <test-describe front="住院号"
-                         :text="inspectionHeader.ptnt_NO"/>
-        </div>
-        <div>
-          <test-describe front="科室"
-                         :text="inspectionHeader.dept_NAME"/>
-        </div>
-        <div>
-          <test-describe front="床号"
-                         :text="inspectionHeader.ptnt_BED_NO"/>
-        </div>
-        <div>
-          <test-describe front="标本类型"
-                         :text="inspectionHeader.smpl_NAME "/>
-        </div>
-        <div>
-          <test-describe front="申请项目"
-                         :text="inspectionHeader?.aply_CNTN"/>
-        </div>
-      </div>
-      <div class="test-date">
-        <div>
-          <test-describe front="接收时间"
-                         :text="inspectionHeader.aply_DATE"/>
-        </div>
-        <div>
-          <test-describe front="检验时间"
-                         :text="inspectionHeader.ordr_CREATE_DATE"/>
-        </div>
-        <div>
-          <test-describe front="报告时间"
-                         :text="inspectionHeader.audt_TIME"/>
-        </div>
-        <div>
-          <test-describe front="送检医生"
-                         :text="inspectionHeader.test_USR_NAME"/>
-        </div>
-        <div>
-          <test-describe front="检验人"
-                         :text="inspectionHeader.ordr_USR_NAME"/>
-        </div>
-        <div>
-          <test-describe front="审核人"
-                         :text="inspectionHeader.audt_USR_NAME"/>
-        </div>
-      </div>
-    </div>
-  </div>
-  <div class="container">
-    <el-auto-resizer>
-      <template #default="{ height, width }">
-        <div style="display: flex">
-          <div class="sidebar">
-            <vxe-table :height="height"
-                       :max-height="height"
-                       :row-config="{isHover : true, isCurrent: true,height: 24}"
-                       show-header-overflow
-                       show-overflow
-                       :scroll-x="{enabled: false}"
-                       :scroll-y="{gt: 0 ,enabled: true}"
-                       class="vxe-padding_zero"
-                       @cell-click="sidebarRow"
-                       :data="sidebarList">
-              <vxe-column title="名称" field="aply_CTNT"/>
-              <vxe-column title="时间" field="ordr_CREATE_DATE" width="180"/>
-            </vxe-table>
-
-          </div>
-          <div class="main">
-            <el-table :data="mainList"
-                      :height="height"
-                      row-key="itm_ORDR"
-                      ref="tableRef"
-                      @row-click="testRowClick"
-                      :expand-row-keys="expands">
-              <el-table-column label="选择" type="selection"/>
-              <el-table-column type="expand" width="20">
-                <template #default="{row,$index}">
-                  <el-table :data="row.bacteriaResults[0].antibioticResults"
-                            :ref="(el) => setRefMap(el, $index)"
-                            @row-click="drugTable"
-                            v-if="row.bacteriaResults.length > 0">
-                    <el-table-column label="选择" type="selection"/>
-                    <el-table-column label="抗菌药物" prop="anti_NAME_CN"/>
-                    <el-table-column label="抗菌药物编码" prop="anti_ABB"/>
-                    <el-table-column label="MIC值" prop="anti_MIC"/>
-                    <el-table-column label="敏感性" prop="anti_VALUE"/>
-                  </el-table>
-                </template>
-              </el-table-column>
-              <el-table-column label="检验项目" prop="itm_NAME" width="450"/>
-              <el-table-column label="结果">
-                <template #default="{row}">
-                  {{ result(row) }}
-                </template>
-              </el-table-column>
-              <el-table-column label="单位" prop="itm_UNIT"/>
-              <el-table-column label="说明" prop="itm_ALERT">
-                <template #default="{row}">
-                  <span v-html="getItemAlert(row.itm_ALERT, row.itm_STR_VALUE, row.itm_VALUE)"></span>
-                </template>
-              </el-table-column>
-              <el-table-column label="参考值" prop="range"/>
-            </el-table>
-          </div>
-        </div>
-      </template>
-    </el-auto-resizer>
-  </div>
-</template>
-
-<script setup name='EmrTest'>
-import {
-  queryInspectionDetail,
-  queryInspectionsIndex
-} from '@/api/inspections'
-import {onMounted, ref} from "vue";
-import {xcMessage} from '@/utils/xiaochan-element-plus'
-import TestDescribe from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/TestDescribe.vue";
-import {currentAndAFewDaysAgo, getDateRangeFormatDate} from '@/utils/date'
-import {
-  elementReplication,
-  emrCopyFunc
-} from '@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init'
-import {copyStrFunc} from "@/utils/public";
-import {getCriticalValueByPatInfo} from "@/api/zhu-yuan-yi-sheng/critical-value";
-
-const {patNo, isEmr, times} = defineProps({
-  patNo: String,
-  times: Number,
-  isEmr: {
-    type: Boolean,
-    default: true
-  }
-})
-
-
-const emits = defineEmits(['close'])
-const sidebarList = ref()
-const mainList = ref()
-const tableRef = ref()
-const drugSensitivityRef = ref()
-const inspectionHeader = ref({
-  aply_CNTN: ''
-})
-const dateRange = ref([])
-
-const refMap = {}
-const setRefMap = (el, item) => {
-  refMap[`drug${item}`] = el
-}
-
-const query = async () => {
-  let {startTime, endTime} = getDateRangeFormatDate(dateRange.value)
-  const param = {
-    type: 1,
-    content: patNo,
-    start: startTime,
-    end: endTime,
-  }
-  queryInspectionsIndex(param).then((res) => {
-    sidebarList.value = res
-  })
-}
-const expands = ref([])
-let currentReportForm = {}
-
-const sidebarRow = ({row}) => {
-  currentReportForm = row
-  queryInspectionDetail(row.ordr_ID).then((res) => {
-    mainList.value = res['inspectionItems']
-    inspectionHeader.value = res['inspectionHeader']
-    mainList.value.forEach(item => {
-      if (item.bacteriaResults.length > 0) {
-        expands.value.push(item.itm_ORDR)
-      }
-    })
-  })
-}
-
-const testRowClick = (row) => {
-  let temp = tableRef.value.getSelectionRows()
-  tableRef.value.toggleRowSelection(row, !temp.includes(row))
-}
-
-const drugTable = (row) => {
-  let temp = drugSensitivityRef.value.getSelectionRows()
-  drugSensitivityRef.value.toggleRowSelection(row, !temp.includes(row))
-}
-
-let copyStr = ''
-const appendCopy = () => {
-  let temp = tableRef.value.getSelectionRows()
-  let data = currentReportForm.aply_CTNT + ":"
-
-  temp.forEach(item => {
-    data += `${item.itm_NAME}${result(item)}${item.itm_UNIT}${getItemStr(item.itm_ALERT, item.itm_STR_VALUE, item.itm_VALUE)},`
-  })
-
-  for (let key in refMap) {
-    let item = refMap[key]
-    let tempList = item.getSelectionRows()
-    tempList.forEach(item => {
-      data += `${item.anti_NAME_CN}${item.anti_ABB}${item.anti_MIC}${item.anti_VALUE},`
-    })
-  }
-
-  copyStr += '   ' + data
-  xcMessage.success('追加成功。')
-}
-
-const copyClick = () => {
-  if (isEmr) {
-    emrCopyFunc(copyStr)
-  } else {
-    copyStrFunc(copyStr)
-  }
-  emits('close')
-}
-
-const copyOutcome = (name) => {
-  elementReplication(copyStr, name)
-}
-
-const result = (row) => {
-  if (row.bacteriaResults.length > 0) {
-    return row.bacteriaResults[0].bac_NAME_CN
-  }
-  return `${row.itm_VALUE} ${row.itm_STR_VALUE}`
-}
-
-function filterSex(val) {
-  switch (val) {
-    case '0':
-      return '未填'
-    case '1':
-      return '男'
-    case '2':
-      return '女'
-    case '3':
-      return '未知'
-  }
-  return ''
-}
-
-function filterAgeUnit(val) {
-  switch (val) {
-    case '0':
-      return '岁'
-    case '1':
-      return '月'
-    case '2':
-      return '天'
-    case '3':
-      return '时'
-  }
-  return ''
-}
-
-function getItemAlert(val, strValue, value) {
-  if (strValue !== '' || value === '') return ''
-  switch (val) {
-    case 'L':
-      return '<span style="color:#F56C6C;font-weight:bold">↓</span>'
-    case 'H':
-      return '<span style="color:#F56C6C;font-weight:bold">↑</span>'
-  }
-  return '<span style="color:#67C23A;font-weight:bold">正常</span>'
-}
-
-function getItemStr(val, strValue, value) {
-  if (strValue !== '' || value === '') return ''
-  switch (val) {
-    case 'L':
-      return '↓'
-    case 'H':
-      return '↑'
-  }
-  return '正常'
-}
-
-onMounted(async () => {
-  dateRange.value = await currentAndAFewDaysAgo()
-  await query()
-
-})
-
-</script>
-
-<style scoped lang="scss">
-.container {
-  width: 100%;
-  height: 90%;
-}
-
-.sidebar {
-  width: 420px;
-}
-
-.main {
-  width: 100%;
-  height: 100%;
-}
-
-.describe {
-  width: 100%;
-  margin-left: 20px;
-  font-size: 12px;
-
-  .pat-info {
-    display: flex;
-
-    div {
-      padding: 5px;
-    }
-  }
-
-  .test-date {
-    display: flex;
-
-    div {
-      padding: 5px;
-    }
-  }
-
-}
-</style>

+ 2 - 2
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/ResultTable.vue

@@ -37,7 +37,7 @@ function getItemAlert(val, strValue, value) {
     case 'H':
       return '<span style="color:#F56C6C;font-weight:bold">↑</span>'
   }
-  return '<span style="color:#67C23A;font-weight:bold"></span>'
+  return ''
 }
 
 function getItemStr(val, strValue, value) {
@@ -48,7 +48,7 @@ function getItemStr(val, strValue, value) {
     case 'H':
       return '↑'
   }
-  return '正常'
+  return ''
 }
 
 function danger(item: Measurement): string {