Browse Source

草药医嘱限制

DESKTOP-0GD05B0\Administrator 2 years ago
parent
commit
50c3b66d88

+ 63 - 0
src/components/zhu-yuan-yi-sheng/cao-yao-yi-zhu/CaoYaoCuoWuXinXin.vue

@@ -0,0 +1,63 @@
+<template>
+  <el-popover width="500">
+    <template #reference>
+      <el-badge :value="props.data.count">
+        <el-button>错误信息</el-button>
+      </el-badge>
+    </template>
+    <div class="content">
+      <div v-for="(value,key) in props.data.data">
+        <div class="main">
+          <div class="index">
+            {{ key }}
+          </div>
+          <div v-for="(item,index) in value" class="errorMsg">
+            {{ index + 1 }} 、 {{ item }}
+          </div>
+        </div>
+      </div>
+    </div>
+  </el-popover>
+</template>
+
+<script setup name='CaoYaoCuoWuXinXin'>
+const props = defineProps({
+  data: {
+    type: Object
+  }
+})
+
+</script>
+
+<style scoped lang="scss">
+
+.content {
+  width: max-content;
+  max-height: 400px;
+  overflow-y: auto;
+}
+
+.main {
+  border: 1px solid;
+  width: max-content;
+  margin-bottom: 5px;
+
+
+  .index {
+    border: 1px solid;
+    border-radius: 5px;
+    background-color: #0a84fd;
+    color: white;
+    text-align: center;
+  }
+
+  .errorMsg {
+    border: 1px solid;
+    border-radius: 5px;
+    background-color: rgba(245, 65, 65, 0.85);
+    color: white;
+    width: 240px;
+    padding: 2px;
+  }
+}
+</style>

+ 1 - 0
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/table/YzTable.vue

@@ -129,6 +129,7 @@ const header = [
     }
   },
   {
+    // 出院时间的大小不能改
     code: 'endTime', name: '结束时间', width: 90, func: (val) => {
       return timeFomat(val.endTime)
     }

+ 0 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/cao-yao-yi-zhu/ChaXunChaoYaoYiZhu.vue

@@ -110,8 +110,6 @@ const editorStyle = {
   overflow: 'scroll'
 }
 
-console.log(editorStyle)
-
 const xiangQing = ref({
   dialog: false,
   data: [],

+ 32 - 12
src/views/hospitalization/zhu-yuan-yi-sheng/cao-yao-yi-zhu/XinZhengCaoYao.vue

@@ -6,7 +6,7 @@
       <el-button :disabled="mingXi.list.length === 0" type="success" @click="cunMuBan.dialog = true">存模板</el-button>
       <el-divider direction="vertical"></el-divider>
       <el-button :disabled="mingXi.list.length === 0" type="success" @click="dianJiBaoCunCaoYao">保存数据</el-button>
-      <cuo-wu-xin-xi/>
+      <cao-yao-cuo-wu-xin-xin :data="errorMsg"/>
     </el-header>
     <el-main>
       <el-form label-width="120px">
@@ -186,6 +186,7 @@ import {yaoPinXiangMuPiPeiYiBao} from '@/api/public-api'
 import CuoWuXinXi from '@/components/zhu-yuan-yi-sheng/CuoWuXinXi.vue'
 import XcComboGrid from "@/components/xiao-chan/combo-grid/XcComboGrid";
 import sleep from "@/utils/sleep";
+import CaoYaoCuoWuXinXin from "@/components/zhu-yuan-yi-sheng/cao-yao-yi-zhu/CaoYaoCuoWuXinXin.vue";
 
 const props = defineProps({
   saveSuccess: Function
@@ -422,25 +423,44 @@ const dianJiBaoCunCaoYao = () => {
   })
 }
 
+const errorMsg = ref({
+  data: {},
+  count: 0
+})
+
 function baoCunShuJu() {
   ElMessageBox.confirm(chuFang.value.quantity > 20 ? '剂数大于20是否继续录入?' : '请确定好数据?', '提示', {
     type: 'warning',
+  }).then(() => {
+    let data = chuFang.value
+    data.inpatientNo = huanZheXinXi.value.inpatientNo
+    data.admissTimes = huanZheXinXi.value.admissTimes
+    data.list = mingXi.value.list
+    data.deptCode = store.state.user.info.deptCode
+    baoCunCaoYao(data).then((res) => {
+      if (res?.error) {
+        errorMsg.value.data = res.data
+        errorMsg.value.count = msgLength()
+      } else {
+        errorMsg.value.data = {}
+        errorMsg.value.count = 0
+        wipeData();
+        props.saveSuccess()
+      }
+    })
   })
-      .then(() => {
-        let data = chuFang.value
-        data.inpatientNo = huanZheXinXi.value.inpatientNo
-        data.admissTimes = huanZheXinXi.value.admissTimes
-        data.list = mingXi.value.list
-        data.deptCode = store.state.user.info.deptCode
-        baoCunCaoYao(data).then((res) => {
-          wipeData()
-          props.saveSuccess()
-        })
-      })
       .catch(() => {
       })
 }
 
+const msgLength = () => {
+  let a = 0;
+  for (let dataKey in errorMsg.value.data) {
+    a += 1
+  }
+  return a
+}
+
 const clearHerbalInformation = () => {
   mingXi.value.weiYi = []
   mingXi.value.list = []

+ 0 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/TemplateMaintenance.vue

@@ -666,7 +666,6 @@ const tianJiaYiZhu = () => {
       return ElMessage.error('请选择转科科室.')
     }
   }
-
   let data = {
     list: [yiZhuData.value],
   }