lighter 3 år sedan
förälder
incheckning
55de337335

+ 50 - 51
src/router/index.js

@@ -3,10 +3,10 @@
  * @params hideMenu: 是否隐藏当前路由结点不在导航中展示
  * @params alwaysShow: 只有一个子路由时是否总是展示菜单,默认false
  */
-import {createRouter, createWebHistory} from 'vue-router'
+import { createRouter, createWebHistory } from 'vue-router'
 import store from '@/store'
 import NProgress from '@/utils/system/nprogress'
-import {changeTitle} from '@/utils/system/title'
+import { changeTitle } from '@/utils/system/title'
 
 // 动态路由相关引入数据
 // 引入modules
@@ -19,70 +19,69 @@ const apiUrl = import.meta.env.VITE_BASE_URL
 const routes = modules
 
 const router = createRouter({
-    history: createWebHistory(),
-    routes,
+  history: createWebHistory(),
+  routes,
 })
 
 let routesAsynced = false
 
 export function addRoutes() {
-    let modules = [...Dashboard]
-    System.forEach((item) => {
-        modules.push(item)
-        router.addRoute(item)
-    })
-    routesAsynced = true
+  let modules = [...Dashboard]
+  System.forEach((item) => {
+    modules.push(item)
+    router.addRoute(item)
+  })
+  routesAsynced = true
 }
 
 const whiteList = ['/login', '/dashboard', '/404', '/401', '/']
 
 router.beforeEach((to, _from, next) => {
-
-    if (apiUrl !== 'http://172.16.32.160:8706') {
-        to.meta.title ? changeTitle(to.meta.title) : '' // 动态title
-        next()
-        return;
-    }
-    if (to.meta.property === _from.meta.property) {
-        to.meta.title ? changeTitle(to.meta.title) : '' // 动态title
-        next();
-        return;
-    }
-    if (to.meta.parent) {
-        to.meta.title ? changeTitle(to.meta.title) : '' // 动态title
-        next(to.meta.parent);
-        return;
-    }
-    if (whiteList.indexOf(to.path) === -1) {
-        const userPaths = [...store.state.user.paths]
-        const toPathArr = to.path.split('/')
-        const target = toPathArr[toPathArr.length - 1]
-        if (userPaths.indexOf(target) === -1 && userPaths.indexOf('/' + target) === -1) {
-            next('/401')
-        }
-    }
-    NProgress.start()
-    if (!routesAsynced) {
-        addRoutes()
-    }
-    if (store.state.user.token || whiteList.indexOf(to.path) !== -1) {
-        to.meta.title ? changeTitle(to.meta.title) : '' // 动态title
-        next()
-    } else {
-        next('/login') // 全部重定向到登录页
-        to.meta.title ? changeTitle(to.meta.title) : '' // 动态title
+  // if (apiUrl !== 'http://172.16.32.160:8706') {
+  //     to.meta.title ? changeTitle(to.meta.title) : '' // 动态title
+  //     next()
+  //     return;
+  // }
+  if (to.meta.property === _from.meta.property) {
+    to.meta.title ? changeTitle(to.meta.title) : '' // 动态title
+    next()
+    return
+  }
+  if (to.meta.parent) {
+    to.meta.title ? changeTitle(to.meta.title) : '' // 动态title
+    next(to.meta.parent)
+    return
+  }
+  if (whiteList.indexOf(to.path) === -1) {
+    const userPaths = [...store.state.user.paths]
+    const toPathArr = to.path.split('/')
+    const target = toPathArr[toPathArr.length - 1]
+    if (userPaths.indexOf(target) === -1 && userPaths.indexOf('/' + target) === -1) {
+      next('/401')
     }
+  }
+  NProgress.start()
+  if (!routesAsynced) {
+    addRoutes()
+  }
+  if (store.state.user.token || whiteList.indexOf(to.path) !== -1) {
+    to.meta.title ? changeTitle(to.meta.title) : '' // 动态title
+    next()
+  } else {
+    next('/login') // 全部重定向到登录页
+    to.meta.title ? changeTitle(to.meta.title) : '' // 动态title
+  }
 })
 
 router.afterEach((to, _from) => {
-    const keepAliveComponentsName = store.getters['keepAlive/keepAliveComponentsName'] || []
-    const name = to.matched[to.matched.length - 1].components.default.name
-    if (to.meta && to.meta.cache && name && !keepAliveComponentsName.includes(name)) {
-        store.commit('keepAlive/addKeepAliveComponentsName', name)
-    }
-    NProgress.done()
+  const keepAliveComponentsName = store.getters['keepAlive/keepAliveComponentsName'] || []
+  const name = to.matched[to.matched.length - 1].components.default.name
+  if (to.meta && to.meta.cache && name && !keepAliveComponentsName.includes(name)) {
+    store.commit('keepAlive/addKeepAliveComponentsName', name)
+  }
+  NProgress.done()
 })
 
-export {modules}
+export { modules }
 
 export default router

+ 255 - 268
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/TianJiaYiZhu.vue

@@ -7,12 +7,7 @@
   <el-button icon="el-icon-arrow-left" style="font-size: 14px" type="text" @click="router.go(-1)">返回</el-button>
   <el-button type="primary" @click="muBanRef.dialog = true">获取模板</el-button>
   <el-button :disabled="yiZhuList.length === 0" type="primary" @click="baoCunMuBanClick">保存模板</el-button>
-  <el-popover
-      :width="260"
-      placement="bottom-end"
-      title="错误信息"
-      trigger="click"
-  >
+  <el-popover :width="260" placement="bottom-end" title="错误信息" trigger="click">
     <template #reference>
       <el-button>错误信息</el-button>
     </template>
@@ -35,11 +30,16 @@
       </el-col>
       <el-col :span="span">
         <el-form-item label="频率:" prop="orderName">
-          <el-select v-model="yiZhuData.frequCode" :remote-method="pinLvRemoteMethod" clearable filterable remote
-                     size="mini"
-                     @change="yiZhuData.frequCode === 'ONCE' ? yiZhuData.endTime = null : '' ">
-            <el-option v-for="item in yaoPinPingLvData" :key="item.code" :label="item.name"
-                       :value="item.code">
+          <el-select
+            v-model="yiZhuData.frequCode"
+            :remote-method="pinLvRemoteMethod"
+            clearable
+            filterable
+            remote
+            size="mini"
+            @change="yiZhuData.frequCode === 'ONCE' ? (yiZhuData.endTime = null) : ''"
+          >
+            <el-option v-for="item in yaoPinPingLvData" :key="item.code" :label="item.name" :value="item.code">
               <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
               <el-divider direction="vertical"></el-divider>
               <span>{{ item.name }}</span>
@@ -49,8 +49,7 @@
       </el-col>
       <el-col :span="span">
         <el-form-item label="一次剂量:" prop="orderName">
-          <el-input-number v-model="yiZhuData.dose" :min="0" :precision="2" style="width: 110px"
-                           @change="jiSuanLingLiang"></el-input-number>
+          <el-input-number v-model="yiZhuData.dose" :min="0" :precision="2" style="width: 110px" @change="jiSuanLingLiang"></el-input-number>
           <el-select v-model="yiZhuData.doseUnit" size="mini" style="width: 80px" @change="xuanZheJiLiang">
             <el-option v-for="item in yaoPinJiLiangData" :key="item.code" :label="item.name" :value="item.code">
               <span style="color: #8492a6; font-size: 12px">{{ item.value }}</span>
@@ -68,8 +67,7 @@
       </el-col>
       <el-col :span="span">
         <el-form-item label="给药方式:" prop="orderName">
-          <el-select v-model="yiZhuData.supplyCode" :remote-method="geiYaoFangShiRemoteMethod" filterable remote
-                     size="mini">
+          <el-select v-model="yiZhuData.supplyCode" :remote-method="geiYaoFangShiRemoteMethod" filterable remote size="mini">
             <el-option v-for="item in geiYaoFangShiData" :key="item.code" :label="item.name" :value="item.code">
               <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
               <el-divider direction="vertical"></el-divider>
@@ -85,20 +83,25 @@
       </el-col>
       <el-col :span="span">
         <el-form-item label="开始时间:" prop="orderName">
-          <el-date-picker v-model="yiZhuData.startTime"
-                          :disabled-date="disabledDate"
-                          format="YYYY-MM-DD HH:mm:ss"
-                          type="datetime"
-                          value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
+          <el-date-picker
+            v-model="yiZhuData.startTime"
+            :disabled-date="disabledDate"
+            format="YYYY-MM-DD HH:mm:ss"
+            type="datetime"
+            value-format="YYYY-MM-DD HH:mm:ss"
+          ></el-date-picker>
         </el-form-item>
       </el-col>
       <el-col :span="span">
         <el-form-item label="停止时间:" prop="orderName">
-          <el-date-picker v-model="yiZhuData.endTime" :disabled="yiZhuData.frequCode === 'ONCE' "
-                          :disabled-date="disabledDate"
-                          format="YYYY-MM-DD HH:mm:ss"
-                          type="datetime"
-                          value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
+          <el-date-picker
+            v-model="yiZhuData.endTime"
+            :disabled="yiZhuData.frequCode === 'ONCE'"
+            :disabled-date="disabledDate"
+            format="YYYY-MM-DD HH:mm:ss"
+            type="datetime"
+            value-format="YYYY-MM-DD HH:mm:ss"
+          ></el-date-picker>
         </el-form-item>
       </el-col>
       <el-col :span="span">
@@ -108,8 +111,7 @@
       </el-col>
       <el-col :span="span">
         <el-form-item label="执行科室:" prop="orderName">
-          <el-select v-model="yiZhuData.execUnit" :remote-method="metZhiXingKeShi" filterable remote
-                     style="width: 120px">
+          <el-select v-model="yiZhuData.execUnit" :remote-method="metZhiXingKeShi" filterable remote style="width: 120px">
             <el-option v-for="item in zhiXingKeShiData" :key="item.code" :label="item.name" :value="item.code">
               <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
               <el-divider direction="vertical"></el-divider>
@@ -120,13 +122,12 @@
       </el-col>
       <el-col :span="span">
         <el-form-item label="父医嘱:" prop="orderName">
-          <el-select v-model="yiZhuData.parentNo" :disabled="yiZhuData.serial === '00' "
-                     clearable @clear="yiZhuData.parentNo = null"
-                     @click="fuYiZhuClick">
+          <el-select v-model="yiZhuData.parentNo" :disabled="yiZhuData.serial === '00'" clearable @clear="yiZhuData.parentNo = null" @click="fuYiZhuClick">
             <el-option v-for="item in fuYiZhuData" :key="item.code" :label="item.name" :value="item.code">
               <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
               <el-divider direction="vertical"></el-divider>
-              <span>{{ item.name }}</span></el-option>
+              <span>{{ item.name }}</span></el-option
+            >
           </el-select>
         </el-form-item>
       </el-col>
@@ -137,8 +138,7 @@
       </el-col>
       <el-col :span="span">
         <el-form-item label="医生嘱托:" prop="orderName">
-          <el-input v-model="yiZhuData.instruction" clearable maxlength="50" show-word-limit style="width: 130px"
-                    type="textarea"></el-input>
+          <el-input v-model="yiZhuData.instruction" clearable maxlength="50" show-word-limit style="width: 130px" type="textarea"></el-input>
           <el-select v-model="yiZhuData.kfFlag" clearable style="width: 80px" @clear="yiZhuData.kfFlag = null">
             <el-option key="1" label="饭前" value="1"></el-option>
             <el-option key="2" label="饭后" value="2"></el-option>
@@ -156,77 +156,68 @@
       </el-col>
       <el-col :span="span">
         <el-form-item label="医保自费:" prop="orderName">
-          <el-switch
-              v-model="yiZhuData.ybSelfFlag"
-              active-color="#13ce66"
-              active-text="自费"
-              active-value="1"
-              inactive-color="#ff4949"
-              inactive-text="记账"
-              inactive-value="0">
+          <el-switch v-model="yiZhuData.ybSelfFlag" active-color="#13ce66" active-text="自费" active-value="1" inactive-color="#ff4949" inactive-text="记账" inactive-value="0">
           </el-switch>
         </el-form-item>
       </el-col>
       <el-col :span="span">
         <el-form-item label="是否紧急:" prop="orderName">
-          <el-switch
-              v-model="yiZhuData.emergencyFlag"
-              active-color="#13ce66"
-              active-text="是"
-              active-value="1"
-              inactive-color="#ff4949"
-              inactive-text="否"
-              inactive-value="0">
+          <el-switch v-model="yiZhuData.emergencyFlag" active-color="#13ce66" active-text="是" active-value="1" inactive-color="#ff4949" inactive-text="否" inactive-value="0">
           </el-switch>
         </el-form-item>
       </el-col>
       <el-col v-if="yiZhuData.kjywFlag !== 0" :span="span">
         <el-form-item label="用药方式:">
-          <el-select v-model="yiZhuData.yyfs" style="width: 120px;"
-                     @change="kangJunYaoYongYaoFangShiGaiBian">
-            <el-option v-for="item in kangJunYaoWuYongYaoFangShi" :key="item.code" :label="item.name"
-                       :value="item.code">
+          <el-select v-model="yiZhuData.yyfs" style="width: 120px" @change="kangJunYaoYongYaoFangShiGaiBian">
+            <el-option v-for="item in kangJunYaoWuYongYaoFangShi" :key="item.code" :label="item.name" :value="item.code">
               <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
               <el-divider direction="vertical"></el-divider>
-              <span>{{ item.name }}</span></el-option>
+              <span>{{ item.name }}</span></el-option
+            >
           </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="span">
         <el-form-item v-if="yiZhuData.kjywFlag !== 0" label="切口等级:">
-          <el-select v-model="yiZhuData.ssqk"
-                     :disabled="yiZhuData.yyfs !== 1 && yiZhuData.yyfs !== 2 && yiZhuData.yyfs !== null"
-                     clearable style="width: 120px;" @clear="yiZhuData.ssqk = null">
+          <el-select
+            v-model="yiZhuData.ssqk"
+            :disabled="yiZhuData.yyfs !== 1 && yiZhuData.yyfs !== 2 && yiZhuData.yyfs !== null"
+            clearable
+            style="width: 120px"
+            @clear="yiZhuData.ssqk = null"
+          >
             <el-option v-for="item in kangJunYaoWuQieKou" :key="item.code" :label="item.name" :value="item.code">
               <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
               <el-divider direction="vertical"></el-divider>
-              <span>{{ item.name }}</span></el-option>
+              <span>{{ item.name }}</span></el-option
+            >
           </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="span">
         <el-form-item v-if="yiZhuData.kjywFlag !== 0" label="用药时间:">
-          <el-select v-model="yiZhuData.yysj"
-                     :disabled="yiZhuData.yyfs !== 1 && yiZhuData.yyfs !== 2 && yiZhuData.yyfs !== null"
-                     clearable
-                     style="width: 120px;" @clear="yiZhuData.yysj = null">
-            <el-option v-for="item in kangJunYaoWuYongYaoShiJian" :key="item.code" :label="item.name"
-                       :value="item.code">
+          <el-select
+            v-model="yiZhuData.yysj"
+            :disabled="yiZhuData.yyfs !== 1 && yiZhuData.yyfs !== 2 && yiZhuData.yyfs !== null"
+            clearable
+            style="width: 120px"
+            @clear="yiZhuData.yysj = null"
+          >
+            <el-option v-for="item in kangJunYaoWuYongYaoShiJian" :key="item.code" :label="item.name" :value="item.code">
               <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
               <el-divider direction="vertical"></el-divider>
-              <span>{{ item.name }}</span></el-option>
+              <span>{{ item.name }}</span></el-option
+            >
           </el-select>
         </el-form-item>
       </el-col>
     </el-row>
   </el-form>
   <el-button icon="el-icon-plus" type="primary" @click="tianJiaYiZhu">添加</el-button>
-  <el-button icon="el-icon-check" type="success" @click="baoCunYiZhuClick">保存
-  </el-button>
+  <el-button icon="el-icon-check" type="success" @click="baoCunYiZhuClick">保存 </el-button>
   <el-button icon="el-icon-close" type="danger" @click="dialog = false">关闭</el-button>
   <el-button @click="dianJiXiuGaiZhiXingKeShi">修改执行科室</el-button>
-  <el-table :data="yiZhuList" :height="windowSize.h / 3"
-            @selection-change="dianJiXuanZhongShuJu">
+  <el-table :data="yiZhuList" :height="windowSize.h / 3" @selection-change="dianJiXuanZhongShuJu">
     <el-table-column type="selection"></el-table-column>
     <el-table-column label="排序" type="index"></el-table-column>
     <el-table-column label="uuid" prop="id"></el-table-column>
@@ -238,14 +229,10 @@
     <el-table-column label="规格" prop="drugSpecification"></el-table-column>
     <el-table-column label="频率" prop="frequCodeName"></el-table-column>
     <el-table-column label="一次剂量" prop="dose">
-      <template #default="scope">
-        {{ scope.row.dose }} {{ scope.row.doseUnitName }}
-      </template>
+      <template #default="scope"> {{ scope.row.dose }} {{ scope.row.doseUnitName }} </template>
     </el-table-column>
     <el-table-column label="领量" prop="drugQuan">
-      <template #default="scope">
-        {{ scope.row.drugQuan }} {{ scope.row.miniUnitName }}
-      </template>
+      <template #default="scope"> {{ scope.row.drugQuan }} {{ scope.row.miniUnitName }} </template>
     </el-table-column>
     <el-table-column label="给药方式" prop="supplyCodeName"></el-table-column>
     <el-table-column label="执行科室" prop="execUnitName"></el-table-column>
@@ -275,12 +262,14 @@
     </el-table-column>
   </el-table>
   <el-dialog v-model="yiZhuMingDialog" :before-close="guanBiSouSuoXiangMu" title="搜索医嘱名" width="95%">
-    <el-input ref="searchInput" v-model="orderName" clearable style="width: 220px;"
-              @keyup.enter="queryYiZhuClick"></el-input>
+    <el-input ref="searchInput" v-model="orderName" clearable style="width: 220px" @keyup.enter="queryYiZhuClick"></el-input>
     <el-button icon="el-icon-search" type="primary" @click="queryYiZhuClick">搜索</el-button>
     <el-table
-        :data="orderData.data.slice((orderData.currentPage - 1) * orderData.pageSize , orderData.currentPage * orderData.pageSize)"
-        :height="windowSize.h / 1.6" highlight-current-row stripe>
+      :data="orderData.data.slice((orderData.currentPage - 1) * orderData.pageSize, orderData.currentPage * orderData.pageSize)"
+      :height="windowSize.h / 1.6"
+      highlight-current-row
+      stripe
+    >
       <el-table-column label="编码" prop="code">
         <template #default="scope">
           <el-button @click="xuanZhongFeiYong(scope.row)">{{ scope.row.orderCode }}</el-button>
@@ -299,45 +288,34 @@
       <el-table-column label="毒麻类型" prop="drugFlagName"></el-table-column>
     </el-table>
     <el-pagination
-        :current-page="orderData.currentPage"
-        :page-size="orderData.pageSize"
-        :total="orderData.data.length"
-        layout="total,prev,pager,next,jumper"
-        @current-change="orderDataCurrent">
+      :current-page="orderData.currentPage"
+      :page-size="orderData.pageSize"
+      :total="orderData.data.length"
+      layout="total,prev,pager,next,jumper"
+      @current-change="orderDataCurrent"
+    >
     </el-pagination>
   </el-dialog>
 </template>
 
 <script>
-import {computed, onActivated, ref, watch} from "vue";
-import {
-  huoQuFeiYongXinXi,
-  huoQuGeiYaoFangShi,
-  huoQuXiangMu,
-  huoQuZhiXinKeShi,
-  huoQuZhuYuanPinLv,
-  shangChuanYiZhu,
-} from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
-import {
-  getSelfBuy,
-  huanZheXinXi,
-  youWuXuanZheHuanZhe
-} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng"
-import store from "../../../../store";
-import {listIsBlank, listNotBlank, stringIsBlank, stringNotBlank} from "@/utils/blank-utils";
-import {kangJunYaoWuQieKou, kangJunYaoWuYongYaoFangShi, kangJunYaoWuYongYaoShiJian} from "@/data";
-import {ElMessage, ElMessageBox} from "element-plus";
-import {clone} from "@/utils/clone";
-import HuoQuMuBan from "../../../../components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/HuoQuMuBan.vue";
-import {uuid} from "@/utils/getUuid";
-import BaoCunMuBan from "../../../../components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/BaoCunMuBan.vue";
-import {getServerDateApi} from "@/api/public-api";
-import router from "@/router";
-
+import { computed, onActivated, onDeactivated, ref, watch } from 'vue'
+import { huoQuFeiYongXinXi, huoQuGeiYaoFangShi, huoQuXiangMu, huoQuZhiXinKeShi, huoQuZhuYuanPinLv, shangChuanYiZhu } from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
+import { getSelfBuy, huanZheXinXi, youWuXuanZheHuanZhe } from '@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng'
+import store from '../../../../store'
+import { listIsBlank, listNotBlank, stringIsBlank, stringNotBlank } from '@/utils/blank-utils'
+import { kangJunYaoWuQieKou, kangJunYaoWuYongYaoFangShi, kangJunYaoWuYongYaoShiJian } from '@/data'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { clone } from '@/utils/clone'
+import HuoQuMuBan from '../../../../components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/HuoQuMuBan.vue'
+import { uuid } from '@/utils/getUuid'
+import BaoCunMuBan from '../../../../components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/BaoCunMuBan.vue'
+import { getServerDateApi } from '@/api/public-api'
+import router from '@/router'
 
 export default {
-  name: "TianJiaHuoXiuGaiYiZhu",
-  components: {BaoCunMuBan, HuoQuMuBan},
+  name: 'TianJiaHuoXiuGaiYiZhu',
+  components: { BaoCunMuBan, HuoQuMuBan },
   setup() {
     const windowSize = computed(() => {
       return store.state.app.windowSize
@@ -407,10 +385,12 @@ export default {
     }
     spanSize(windowSize.value.w)
 
-    watch(() => windowSize.value, () => {
-      spanSize(windowSize.value.w)
-    })
-
+    watch(
+      () => windowSize.value,
+      () => {
+        spanSize(windowSize.value.w)
+      }
+    )
 
     // 搜索医嘱
     const yiZhuMingDialog = ref(false)
@@ -418,12 +398,12 @@ export default {
     const orderData = ref({
       currentPage: 1,
       pageSize: 10,
-      data: []
+      data: [],
     })
 
     const queryYiZhuClick = () => {
       if (orderName.value.length < 2) {
-        return ElMessage.error("至少输入2个字符以上")
+        return ElMessage.error('至少输入2个字符以上')
       }
       huoQuXiangMu(orderName.value).then((res) => {
         orderData.value.data = res
@@ -435,84 +415,87 @@ export default {
       orderData.value.currentPage = val
     }
 
-
     const xuanZhongFeiYong = (row) => {
       qingKong()
       yiZhuData.value = clone(row)
       if (row.serial !== '00') {
-        huoQuFeiYongXinXi(row.orderCode, row.serial).then((res) => {
-          yiZhuData.value.drugFlag = row.orderType
-          // 判断是否 是皮试的药 如果是就只能有这些 给药方式
-          if (res.data.psFlag === 1) {
-            geiYaoFangShiData.value = res.piShi
-            tiShiBiaoTi.value.push({title: "该药品为皮试药品给药方式只能是皮试类型", type: 'warning'})
-            yiZhuData.value.psFlag = true
-          } else {
-            geiYaoFangShiData.value = []
-            yiZhuData.value.psFlag = false
-          }
-          yiZhuData.value.kjywFlag = res.data.kjywFlag
-          if (yiZhuData.value.kjywFlag === 1) {
-            tiShiBiaoTi.value.push({title: "该药品为抗菌药物,请填写抗菌药物医嘱附注信息录入。", type: 'error'})
-          }
-          if (res.data.selfFlagYb === 1) {
-            tiShiBiaoTi.value.push({title: "该药品医保自费药品,如符合条件请填写记账,不是请填写自费。"})
-          }
-          yiZhuData.value.miniUnitName = res.data.miniUnitName
-          yaoPinJiLiangData.value = res.yaoPingJiLiang
-          // 加载 剂量单位
-          if (stringNotBlank(yiZhuData.value.doseUnit)) {
-            yaoPinJiLiangData.value.forEach(item => {
-              if (item.code === yiZhuData.value.doseUnit) {
-                jiLiangValue.value = item.value
-              }
-            })
-          } else if (listNotBlank(yaoPinJiLiangData.value)) {
-            // 没有剂量单位的时候默认加载第一个计量单位 并且计算
-            yiZhuData.value.doseUnit = yaoPinJiLiangData.value[0].code
-            yiZhuData.value.dose = yaoPinJiLiangData.value[0].value
-            jiLiangValue.value = yaoPinJiLiangData.value[0].value
-            jiSuanLingLiang(yaoPinJiLiangData.value[0].value)
-          }
-          // 加载默认频率 如果已经填写了 就用有的
-          if (stringNotBlank(row.frequCode)) {
-            pinLvRemoteMethod(yiZhuData.value.frequCode)
-          } else if (stringNotBlank(res.data.frequCode)) {
-            yiZhuData.value.frequCode = res.data.frequCode
-            pinLvRemoteMethod(yiZhuData.value.frequCode)
-          } else {
-            yiZhuData.value.frequCode = 'ONCE'
-            pinLvRemoteMethod('ONCE')
-          }
-          // 加载给药方式
-          if (stringNotBlank(yiZhuData.value.supplyCode)) {
-            geiYaoFangShiRemoteMethod(yiZhuData.value.supplyCode)
-          } else if (stringNotBlank(res.data.supplyCode)) {
-            yiZhuData.value.supplyCode = res.data.supplyCode
-            geiYaoFangShiRemoteMethod(yiZhuData.value.supplyCode)
-          }
-          guanBiSouSuoXiangMu()
-        }).catch((e) => {
-          setTimeout(() => {
-            console.error(e)
-            qingKong()
-          }, 100)
-        })
+        huoQuFeiYongXinXi(row.orderCode, row.serial)
+          .then((res) => {
+            yiZhuData.value.drugFlag = row.orderType
+            // 判断是否 是皮试的药 如果是就只能有这些 给药方式
+            if (res.data.psFlag === 1) {
+              geiYaoFangShiData.value = res.piShi
+              tiShiBiaoTi.value.push({ title: '该药品为皮试药品给药方式只能是皮试类型', type: 'warning' })
+              yiZhuData.value.psFlag = true
+            } else {
+              geiYaoFangShiData.value = []
+              yiZhuData.value.psFlag = false
+            }
+            yiZhuData.value.kjywFlag = res.data.kjywFlag
+            if (yiZhuData.value.kjywFlag === 1) {
+              tiShiBiaoTi.value.push({ title: '该药品为抗菌药物,请填写抗菌药物医嘱附注信息录入。', type: 'error' })
+            }
+            if (res.data.selfFlagYb === 1) {
+              tiShiBiaoTi.value.push({ title: '该药品医保自费药品,如符合条件请填写记账,不是请填写自费。' })
+            }
+            yiZhuData.value.miniUnitName = res.data.miniUnitName
+            yaoPinJiLiangData.value = res.yaoPingJiLiang
+            // 加载 剂量单位
+            if (stringNotBlank(yiZhuData.value.doseUnit)) {
+              yaoPinJiLiangData.value.forEach((item) => {
+                if (item.code === yiZhuData.value.doseUnit) {
+                  jiLiangValue.value = item.value
+                }
+              })
+            } else if (listNotBlank(yaoPinJiLiangData.value)) {
+              // 没有剂量单位的时候默认加载第一个计量单位 并且计算
+              yiZhuData.value.doseUnit = yaoPinJiLiangData.value[0].code
+              yiZhuData.value.dose = yaoPinJiLiangData.value[0].value
+              jiLiangValue.value = yaoPinJiLiangData.value[0].value
+              jiSuanLingLiang(yaoPinJiLiangData.value[0].value)
+            }
+            // 加载默认频率 如果已经填写了 就用有的
+            if (stringNotBlank(row.frequCode)) {
+              pinLvRemoteMethod(yiZhuData.value.frequCode)
+            } else if (stringNotBlank(res.data.frequCode)) {
+              yiZhuData.value.frequCode = res.data.frequCode
+              pinLvRemoteMethod(yiZhuData.value.frequCode)
+            } else {
+              yiZhuData.value.frequCode = 'ONCE'
+              pinLvRemoteMethod('ONCE')
+            }
+            // 加载给药方式
+            if (stringNotBlank(yiZhuData.value.supplyCode)) {
+              geiYaoFangShiRemoteMethod(yiZhuData.value.supplyCode)
+            } else if (stringNotBlank(res.data.supplyCode)) {
+              yiZhuData.value.supplyCode = res.data.supplyCode
+              geiYaoFangShiRemoteMethod(yiZhuData.value.supplyCode)
+            }
+            guanBiSouSuoXiangMu()
+          })
+          .catch((e) => {
+            setTimeout(() => {
+              console.error(e)
+              qingKong()
+            }, 100)
+          })
       } else {
         yiZhuData.value.kjywFlag = 0
-        huoQuFeiYongXinXi(row.orderCode, '00').then((res) => {
-          yiZhuData.value.drugFlag = row.orderType
-          guanBiSouSuoXiangMu()
-          yiZhuData.value.frequCode = 'ONCE'
-          pinLvRemoteMethod('ONCE')
-          if (stringNotBlank(res.paiChiYiZhu)) {
-            tiShiBiaoTi.value.push({title: res.paiChiYiZhu, type: 'error'})
-          }
-        }).catch((e) => {
-          setTimeout(() => {
-            qingKong()
-          }, 100)
-        })
+        huoQuFeiYongXinXi(row.orderCode, '00')
+          .then((res) => {
+            yiZhuData.value.drugFlag = row.orderType
+            guanBiSouSuoXiangMu()
+            yiZhuData.value.frequCode = 'ONCE'
+            pinLvRemoteMethod('ONCE')
+            if (stringNotBlank(res.paiChiYiZhu)) {
+              tiShiBiaoTi.value.push({ title: res.paiChiYiZhu, type: 'error' })
+            }
+          })
+          .catch((e) => {
+            setTimeout(() => {
+              qingKong()
+            }, 100)
+          })
       }
       // 判断这个是不是 新添加的数据 如果是空的就是 新数据
       if (stringIsBlank(row.newData)) {
@@ -528,7 +511,7 @@ export default {
           yiZhuData.value.execUnit = huanZheXinXi.value.smallDept
           zhiXingKeShiData.value.push({
             code: huanZheXinXi.value.smallDept,
-            name: huanZheXinXi.value.smallDeptName
+            name: huanZheXinXi.value.smallDeptName,
           })
         }
       } else {
@@ -539,12 +522,11 @@ export default {
       }
     }
 
-
     /* 频率 */
     const yaoPinPingLvData = ref([])
     const pinLvRemoteMethod = (val) => {
       if (val.length > 1) {
-        huoQuZhuYuanPinLv(val).then(res => {
+        huoQuZhuYuanPinLv(val).then((res) => {
           yaoPinPingLvData.value = res
         })
       }
@@ -553,7 +535,7 @@ export default {
     const yaoPinJiLiangData = ref([])
     const jiLiangValue = ref(0)
     const xuanZheJiLiang = (val) => {
-      yaoPinJiLiangData.value.forEach(item => {
+      yaoPinJiLiangData.value.forEach((item) => {
         if (item.code === val) {
           jiLiangValue.value = item.value
           yiZhuData.value.dose = item.value
@@ -583,14 +565,12 @@ export default {
     const fuYiZhuClick = () => {
       fuYiZhuData.value = []
       yiZhuList.value.forEach((item, index) => {
-        if (stringNotBlank(item.drugFlag) && item.drugFlag === 'i'
-            && item.id !== yiZhuData.value.id && stringIsBlank(item.parentNo)) {
-          fuYiZhuData.value.push({code: item.id, name: item.orderName})
+        if (stringNotBlank(item.drugFlag) && item.drugFlag === 'i' && item.id !== yiZhuData.value.id && stringIsBlank(item.parentNo)) {
+          fuYiZhuData.value.push({ code: item.id, name: item.orderName })
         }
       })
     }
 
-
     /* 获取执行科室 */
     const zhiXingKeShiData = ref([])
     const metZhiXingKeShi = (val) => {
@@ -612,42 +592,44 @@ export default {
       let data = {
         inpatientNo: huanZheXinXi.value.inpatientNo,
         admissTimes: huanZheXinXi.value.admissTimes,
-        list: list
+        list: list,
       }
-      shangChuanYiZhu(data).then((res) => {
-        let index = tianJiaYiZhuWeiYiBiaoShi.value.indexOf(yiZhuData.value.id)
-        if (index > -1) {
-          yiZhuList.value.splice(index, 1)
-          tianJiaYiZhuWeiYiBiaoShi.value.splice(index, 1)
-          ElMessage.error('重复添加,老记录已删除。')
-        }
-        tianJiaShiHuoQuXiaLaKuangDeZhi()
-        tianJiaYiZhuWeiYiBiaoShi.value.push(yiZhuData.value.id)
-        yiZhuList.value.push(clone(yiZhuData.value))
-        qingKong()
-      }).catch((e) => {
-        cuoWuXinXi.value = e
-      })
+      shangChuanYiZhu(data)
+        .then((res) => {
+          let index = tianJiaYiZhuWeiYiBiaoShi.value.indexOf(yiZhuData.value.id)
+          if (index > -1) {
+            yiZhuList.value.splice(index, 1)
+            tianJiaYiZhuWeiYiBiaoShi.value.splice(index, 1)
+            ElMessage.error('重复添加,老记录已删除。')
+          }
+          tianJiaShiHuoQuXiaLaKuangDeZhi()
+          tianJiaYiZhuWeiYiBiaoShi.value.push(yiZhuData.value.id)
+          yiZhuList.value.push(clone(yiZhuData.value))
+          qingKong()
+        })
+        .catch((e) => {
+          cuoWuXinXi.value = e
+        })
     }
 
     // 这里是获取下拉框中的值的
     const tianJiaShiHuoQuXiaLaKuangDeZhi = () => {
-      yaoPinPingLvData.value.forEach(item => {
+      yaoPinPingLvData.value.forEach((item) => {
         if (item.code === yiZhuData.value.frequCode) {
           yiZhuData.value.frequCodeName = item.name
         }
       })
-      yaoPinJiLiangData.value.forEach(item => {
+      yaoPinJiLiangData.value.forEach((item) => {
         if (item.code === yiZhuData.value.doseUnit) {
           yiZhuData.value.doseUnitName = item.name
         }
       })
-      geiYaoFangShiData.value.forEach(item => {
+      geiYaoFangShiData.value.forEach((item) => {
         if (item.code === yiZhuData.value.supplyCode) {
           yiZhuData.value.supplyCodeName = item.name
         }
       })
-      zhiXingKeShiData.value.forEach(item => {
+      zhiXingKeShiData.value.forEach((item) => {
         if (item.code === yiZhuData.value.execUnit) {
           yiZhuData.value.execUnitName = item.name
         }
@@ -658,21 +640,21 @@ export default {
     const xiuGaiYiZhu = (val) => {
       val.newData = true
       xuanZhongFeiYong(val)
-      ElMessage.success("你点击了修改")
+      ElMessage.success('你点击了修改')
     }
 
     /* 删除表格医嘱 */
     const shanChuBiaoGeYiZhu = (val) => {
       yiZhuList.value.splice(val, 1)
       tianJiaYiZhuWeiYiBiaoShi.value.splice(val, 1)
-      ElMessage.success("删除成功")
+      ElMessage.success('删除成功')
     }
 
     /* 复制医嘱 */
     const fuZhiYiZhu = (val) => {
       yiZhuData.value = clone(val)
       yiZhuData.value.id = uuid(8, 10)
-      ElMessage.success("复制成功")
+      ElMessage.success('复制成功')
     }
 
     /* 保存信息 */
@@ -685,14 +667,15 @@ export default {
         inpatientNo: huanZheXinXi.value.inpatientNo,
         admissTimes: huanZheXinXi.value.admissTimes,
         chaRuYiZhu: true,
-        list: yiZhuList.value
+        list: yiZhuList.value,
       }
-      shangChuanYiZhu(data).then((res) => {
-        router.go(-1)
-      }).catch((e) => {
-        cuoWuXinXi.value = e
-      })
-
+      shangChuanYiZhu(data)
+        .then((res) => {
+          router.go(-1)
+        })
+        .catch((e) => {
+          cuoWuXinXi.value = e
+        })
     }
 
     /*  这里是抗菌药物,选择了除了 1和 2 的其他都可以不用填写 */
@@ -703,13 +686,12 @@ export default {
       }
     }
 
-
     // 模板数据
     const muBanRef = ref(null)
     // 这里是返回的模板数据
     const muBanShuJu = (val) => {
-      let tongZhiCiShu = 0;
-      val.forEach(item => {
+      let tongZhiCiShu = 0
+      val.forEach((item) => {
         let index = tianJiaYiZhuWeiYiBiaoShi.value.indexOf(item.id)
         if (index > -1) {
           yiZhuList.value.splice(index, 1)
@@ -741,37 +723,44 @@ export default {
       let data = {
         inpatientNo: huanZheXinXi.value.inpatientNo,
         admissTimes: huanZheXinXi.value.admissTimes,
-        list: yiZhuList.value
+        list: yiZhuList.value,
       }
-      shangChuanYiZhu(data).then((res) => {
-        baoCunMuBanRef.value.daKaiBaoCunMuBan(yiZhuList.value)
-        cuoWuXinXi.value = ''
-      }).catch((e) => {
-        cuoWuXinXi.value = e
-      })
+      shangChuanYiZhu(data)
+        .then((res) => {
+          baoCunMuBanRef.value.daKaiBaoCunMuBan(yiZhuList.value)
+          cuoWuXinXi.value = ''
+        })
+        .catch((e) => {
+          cuoWuXinXi.value = e
+        })
     }
     // 医嘱限制时间不能在之前
     const disabledDate = (time) => {
-      return time.getTime() < Date.now() - 8.64e7;
+      return time.getTime() < Date.now() - 8.64e7
     }
 
+    watch(
+      () => huanZheXinXi.value,
+      () => {
+        zhiXingKeShiData.value = [
+          {
+            code: huanZheXinXi.value.smallDept,
+            name: huanZheXinXi.value.smallDeptName,
+          },
+        ]
+      }
+    )
 
-    watch(() => huanZheXinXi.value, () => {
-      zhiXingKeShiData.value = [
-        {
-          code: huanZheXinXi.value.smallDept,
-          name: huanZheXinXi.value.smallDeptName
+    watch(
+      () => yiZhuMingDialog.value,
+      () => {
+        if (yiZhuMingDialog.value) {
+          setTimeout(() => {
+            searchInput.value.focus()
+          }, 300)
         }
-      ]
-    })
-
-    watch(() => yiZhuMingDialog.value, () => {
-      if (yiZhuMingDialog.value) {
-        setTimeout(() => {
-          searchInput.value.focus()
-        }, 300)
       }
-    })
+    )
 
     const xuanZhongShuJu = ref([])
 
@@ -781,14 +770,14 @@ export default {
 
     const dianJiXiuGaiZhiXingKeShi = () => {
       if (listIsBlank(xuanZhongShuJu.value)) {
-        return ElMessage.error("请先选择数据。")
+        return ElMessage.error('请先选择数据。')
       } else {
-        zhiXingKeShiData.value.forEach(item => {
+        zhiXingKeShiData.value.forEach((item) => {
           if (item.code === yiZhuData.value.execUnit) {
             yiZhuData.value.execUnitName = item.name
           }
         })
-        xuanZhongShuJu.value.forEach(item => {
+        xuanZhongShuJu.value.forEach((item) => {
           item.execUnit = yiZhuData.value.execUnit
           item.execUnitName = yiZhuData.value.execUnitName
         })
@@ -803,7 +792,6 @@ export default {
       orderData.value.currentPage = 1
     }
 
-
     const qingKong = () => {
       cuoWuXinXi.value = ''
       zhiXingKeShiData.value = []
@@ -860,8 +848,7 @@ export default {
       if (stringIsBlank(huanZheXinXi.value.inpatientNo)) {
         ElMessage.warning('您现在进入的是医嘱模板编辑')
       } else {
-        ElMessage.warning('您现在进入的是医嘱编辑模块,' +
-            '您的编辑时间有 10 分钟,你准备好了吗?Are ya ready kids?')
+        ElMessage.warning('您现在进入的是医嘱编辑模块,' + '您的编辑时间有 10 分钟,你准备好了吗?Are ya ready kids?')
         kaiQiDaoJiShi()
       }
     })
@@ -871,22 +858,21 @@ export default {
       seconds.value = 600
       clearInterval(daoJiShi)
       daoJiShi = setInterval(() => {
-        seconds.value--;
+        seconds.value--
         countDown()
       }, 1000)
     }
 
     const countDown = () => {
-      let m = parseInt((seconds.value / 60 % 60).toString());
-      m = m < 10 ? "0" + m : m
-      let s = parseInt((seconds.value % 60).toString());
-      s = s < 10 ? "0" + s : s
+      let m = parseInt(((seconds.value / 60) % 60).toString())
+      m = m < 10 ? '0' + m : m
+      let s = parseInt((seconds.value % 60).toString())
+      s = s < 10 ? '0' + s : s
       count.value = '剩余操作时间 ' + m + '分' + s + '秒'
       if (seconds.value === 300) {
         ElMessageBox.alert('您的操作时间过半', '提示', {
-          type: "warning"
-        }).then((res) => {
-        })
+          type: 'warning',
+        }).then((res) => {})
       } else if (seconds.value === 60 || seconds.value === 30 || seconds.value === 20) {
         ElMessage({
           message: '剩余操作时间' + seconds.value + '秒',
@@ -901,6 +887,9 @@ export default {
       }
     }
 
+    onDeactivated(() => {
+      qingKong()
+    })
 
     return {
       router,
@@ -950,9 +939,7 @@ export default {
       count,
       guanBiSouSuoXiangMu,
     }
-
-
-  }
+  },
 }
 </script>
 

+ 2 - 0
src/views/medical-insurance/allpatient/SetlStatistics.vue

@@ -65,6 +65,7 @@
           <el-table-column prop="medTypeName" label="医疗类别"></el-table-column>
           <el-table-column prop="medfeeSumamt" label="总费用"></el-table-column>
           <el-table-column prop="fundPaySumamt" label="报销金额"></el-table-column>
+          <el-table-column prop="mafPay" label="医疗救助"></el-table-column>
           <el-table-column prop="acctPay" label="个人账户支出"></el-table-column>
           <el-table-column prop="psnCashPay" label="个人现金支出"></el-table-column>
           <el-table-column prop="hifmiPay" label="大病支出"></el-table-column>
@@ -327,6 +328,7 @@ export default {
           setlTime: '结算时间',
           medfeeSumamt: '医疗总费用',
           fundPaySumamt: '报销金额',
+          mafPay: '医疗救助',
           acctPay: '个人账户支出',
           psnCashPay: '个人现金支出',
           hifmiPay: '大病支出',