Browse Source

优化代码

xiaochan 3 years ago
parent
commit
e590f07f16

+ 9 - 0
src/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing.js

@@ -117,6 +117,15 @@ export function biaoBenApi(name) {
     })
 }
 
+export function shanChuJianChaJianYan(reqNo, patNo, times) {
+    return request({
+        url: url + 'shanChuJianChaJianYan',
+        method: 'get',
+        params: {reqNo, patNo, times}
+    })
+}
+
+
 
 
 

+ 1 - 1
src/utils/ExportExcel.js

@@ -2,7 +2,7 @@ import fs from 'file-saver'
 import XLSX from 'xlsx'
 import {clone} from "./clone";
 import {ElMessage, ElMessageBox} from "element-plus";
-import {listIsBlank, stringIsBlank, stringNotBlank} from "./blank-utils";
+import {listIsBlank} from "./blank-utils";
 
 export function Export(json, fields, filename) {
     const temp = clone(json)

+ 1 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/HuiZhenShenQing.vue

@@ -1,8 +1,8 @@
 <template>
   <el-container>
     <el-header>
-      <el-button icon="el-icon-plus" type="success" @click="dianJiHuiZhenShenQing">会诊申请</el-button>
       <el-button icon="el-icon-search" type="primary" @click="chaKanHuiZhenShenQingClick">会诊查询</el-button>
+      <el-button icon="el-icon-plus" type="success" @click="dianJiHuiZhenShenQing">会诊申请</el-button>
     </el-header>
     <el-main>
       <el-table :data="chaKanHuiZhenList" :height="(windowSize.h / 1.5) ">

+ 18 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/cao-yao-yi-zhu/ChaXunChaoYaoYiZhu.vue

@@ -13,10 +13,20 @@
           type="daterange"
           @change="caoYaoShuJu.currentPage = 1"
       ></el-date-picker>
+      <el-switch
+          v-model="shiFouFaYao"
+          :active-value="true"
+          :inactive-value="false"
+          active-color="#13ce66"
+          active-text="已发药"
+          inactive-color="#ff4949"
+          inactive-text="未发药">
+      </el-switch>
       <el-divider direction="vertical"></el-divider>
       <el-button @click="dianJiChaXunYiZhu(0)">查询</el-button>
       <el-divider direction="vertical"></el-divider>
       <el-button @click="DianJiXinZengChaoYao">新增草药医嘱</el-button>
+
     </el-header>
     <el-main>
       <el-table :data="caoYaoShuJu.data" :height="windowSize.h / 1.4">
@@ -94,6 +104,7 @@ export default {
       pageSize: 20,
       total: 0,
     })
+    const shiFouFaYao = ref(false)
     const windowSize = computed(() => {
       return store.state.app.windowSize
     })
@@ -109,6 +120,7 @@ export default {
       let data = {
         startTime: dateS.startTime,
         endTime: dateS.endTime,
+        shiFouFaYao: shiFouFaYao.value,
         patNo: huanZheXinXi.value.inpatientNo,
         times: huanZheXinXi.value.admissTimes,
         currentPage: caoYaoShuJu.value.currentPage,
@@ -168,7 +180,8 @@ export default {
       handleCurrentChange,
       caoYaoYiZhuXiangQing,
       xiangQing,
-      DianJiXinZengChaoYao
+      DianJiXinZengChaoYao,
+      shiFouFaYao
     }
   }
 }
@@ -182,6 +195,10 @@ function getStatusFlag(val) {
       return "收费"
     case '3':
       return "提交"
+    case '4' :
+      return "发药"
+    case 'd' :
+      return "删除"
     default:
       return ""
   }

+ 37 - 8
src/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/JianChaShenQing.vue

@@ -29,12 +29,28 @@
               <span v-html="huanHangXianShi(scope.row.startTime)"></span>
             </template>
           </el-table-column>
-          <el-table-column label="操作" width="80">
+          <el-table-column label="操作" width="120">
             <template #default="scope">
-              <el-button circle icon="el-icon-view" title="查看"
-                         @click="dianJiaJianChaXiangQing(scope.row,scope.$index)"></el-button>
-              <el-button circle icon="iconfont icon-dayin" title="打印"
-                         @click="dianJiDaYingJianCha(scope.row,scope.$index)"></el-button>
+              <el-dropdown size="small" split-button type="primary"
+                           @click="dianJiaJianChaXiangQing(scope.row,scope.$index)">
+                查看
+                <template #dropdown>
+                  <el-dropdown-menu>
+                    <el-dropdown-item>
+                      <el-button icon="el-icon-printer" type="success"
+                                 @click="dianJiDaYingJianCha(scope.row,scope.$index)">
+                        打印
+                      </el-button>
+                    </el-dropdown-item>
+                    <br>
+                    <el-dropdown-item>
+                      <el-button icon="el-icon-delete" type="danger" @click="dianJiShanChu(scope.row,scope.$index)">
+                        删除
+                      </el-button>
+                    </el-dropdown-item>
+                  </el-dropdown-menu>
+                </template>
+              </el-dropdown>
             </template>
           </el-table-column>
         </el-table>
@@ -61,7 +77,8 @@ import {computed, ref, watch} from "vue";
 import {
   huoQuJianChaShenQing,
   huoQuJianYanJianChaMing,
-  huoQuShengQingXiangQing
+  huoQuShengQingXiangQing,
+  shanChuJianChaJianYan
 } from "@/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing";
 import store from "@/store";
 import DaYingJianCha from "@/components/zhu-yuan-yi-sheng/jian-cha-shen-qing/da-ying/DaYingJianCha.vue";
@@ -69,6 +86,7 @@ import {getDateRangeFormatDate, huanHangXianShi} from "@/utils/date";
 import {shortcuts} from '@/data/shortcuts'
 import TianJiaJianChaJianYan from "@/components/zhu-yuan-yi-sheng/TianJiaJianChaJianYan.vue";
 import router from "@/router";
+import {ElMessageBox} from "element-plus";
 
 export default {
   name: "JianChaShenQing",
@@ -132,6 +150,17 @@ export default {
       })
     }
 
+    const dianJiShanChu = (row, index) => {
+      console.log(row)
+      ElMessageBox.confirm(`您确定要删除【${row.orderName}】吗?`, '提示').then(() => {
+        shanChuJianChaJianYan(row.reqNo, row.inpatientNo, row.admissTimes).then((res) => {
+          console.log(row, index)
+        })
+      }).catch(() => {
+      })
+
+    }
+
     const querySearchAsync = (val, cb) => {
       if (youWuXuanZheHuanZhe()) return
       huoQuJianYanJianChaMing(val, huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, huanZheXinXi.value.bedNo, '3').then(res => {
@@ -150,7 +179,6 @@ export default {
           path: '/inpatient/zhuYuanYiSheng/jianChaShenQing'
         }
       })
-
     }
 
     const tableRowClassName = ({rowIndex}) => {
@@ -178,7 +206,8 @@ export default {
       querySearchAsync,
       shortcuts,
       daKaiTianJiaJianCha,
-      tableRowClassName
+      tableRowClassName,
+      dianJiShanChu
     }
   }
 

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

@@ -632,13 +632,13 @@ export default {
 
     /* 保存信息 */
     const baoCunYiZhuClick = () => {
+      if (listIsBlank(yiZhuList.value)) {
+        return ElMessage.error('请先选择数据')
+      }
+      if (youWuXuanZheHuanZhe()) return
       ElMessageBox.confirm('您确定要保存这些数据吗?请仔细检查数据。', '提示', {
         type: 'warning'
       }).then(() => {
-        if (listIsBlank(yiZhuList.value)) {
-          return ElMessage.error('请先选择数据')
-        }
-        if (youWuXuanZheHuanZhe()) return
         let data = {
           inpatientNo: huanZheXinXi.value.inpatientNo,
           admissTimes: huanZheXinXi.value.admissTimes,
@@ -647,6 +647,7 @@ export default {
         }
         shangChuanYiZhu(data)
             .then((res) => {
+              fuZhiYiZhu.value = []
               router.go(-1)
             })
             .catch((e) => {
@@ -815,7 +816,6 @@ export default {
 
     onUnmounted(() => {
       clearInterval(daoJiShi)
-      fuZhiYiZhu.value = []
     })
 
     // 倒计时功能

+ 2 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/YiZhuLuRu.vue

@@ -10,8 +10,8 @@
           size="mini"
           start-placeholder="开始日期"
           style="width: 220px"
-          type="daterange"
-      ></el-date-picker>
+          type="daterange">
+      </el-date-picker>
       医嘱名称:
       <el-select v-model="orderName" :remote-method="remoteMethodChargeCode" clearable filterable remote
                  style="width: 120px">