瀏覽代碼

同步老项目。

lighter 3 年之前
父節點
當前提交
e2432b31de

+ 7 - 0
src/App.vue

@@ -56,4 +56,11 @@ function getWindowSize() {
 .el-table--striped .el-table__body tr.el-table__row--striped.current-row td {
   background-color: #a7d3ff !important;
 }
+
+.eltable .el-checkbox__inner {
+  width: 16px;
+  height: 16px;
+  border: 2px solid #000;
+  border-radius: 4px;
+}
 </style>

+ 8 - 0
src/api/yibao/patient.js

@@ -111,3 +111,11 @@ export function getEmpiViewUrl(id) {
     params: { id },
   })
 }
+
+export function receiveAndRecalculateCost(data) {
+  return request({
+    url: '/patient/receiveAndRecalculateCost',
+    method: 'post',
+    data,
+  })
+}

+ 40 - 2
src/api/yibao/xiang-mu-lu-ru.js

@@ -40,11 +40,11 @@ export function getMuBanXinXi(patternName, opIdCode) {
   })
 }
 
-export function queryDanGeXiangMu(pyCode) {
+export function queryDanGeXiangMu(pyCode, xiangMuHuoYaoPinFlag) {
   return request({
     url: '/xmlr/queryXiangMu',
     method: 'get',
-    params: { pyCode },
+    params: { pyCode, xiangMuHuoYaoPinFlag },
   })
 }
 
@@ -71,3 +71,41 @@ export function yiZhuTuiFeiPiPei(inpatientNo, admissTimes) {
     params: { inpatientNo, admissTimes },
   })
 }
+
+export function shanChuMuBan(patterName, opIdCode) {
+  return request({
+    url: '/xmlr/shanChuMuBan',
+    method: 'get',
+    params: { patterName, opIdCode },
+  })
+}
+
+export function getDept() {
+  return request({
+    url: '/xmlr/getDept',
+    method: 'get',
+  })
+}
+
+export function getWard() {
+  return request({
+    url: '/xmlr/getWard',
+    method: 'get',
+  })
+}
+
+export function getPyCode(inputStr) {
+  return request({
+    url: '/xmlr/getPyCode',
+    method: 'get',
+    params: { inputStr },
+  })
+}
+
+export function getBingQuDuiYingKeShi(ward) {
+  return request({
+    url: '/xmlr/getBingQuDuiYingKeShi',
+    method: 'get',
+    params: { ward },
+  })
+}

+ 17 - 0
src/api/yibao/yi-zhu-tui-fei.js

@@ -0,0 +1,17 @@
+import request from '@/utils/request'
+
+export function getOrderList(data) {
+  return request({
+    url: '/zhuYuanYiZhu/getOrderList',
+    method: 'post',
+    data,
+  })
+}
+
+export function yiZhuTuiFei(data) {
+  return request({
+    url: '/zhuYuanYiZhu/yiZhuTuiFei',
+    method: 'post',
+    data,
+  })
+}

+ 27 - 0
src/api/zhu-yuan-yi-ji/que-ren-yi-zhu-shou-fei.js

@@ -0,0 +1,27 @@
+import request from '../../utils/request'
+
+const url = '/queRen'
+
+export function getXuQueFeiYiZhu(data) {
+  return request({
+    url: url + '/getXuQueFeiYiZhu',
+    method: 'post',
+    data,
+  })
+}
+
+export function getXuQueFeiXiangXiXinXi(inpatientNo, admissTimes, execUnit) {
+  return request({
+    url: url + '/getXuQueFeiXiangXiXinXi',
+    method: 'get',
+    params: { inpatientNo, admissTimes, execUnit },
+  })
+}
+
+export function baoCunYiZhuQueFeiShuJu(data) {
+  return request({
+    url: url + '/baoCunYiZhuQueFeiShuJu',
+    method: 'post',
+    data,
+  })
+}

+ 11 - 0
src/api/zhu-yuan-yi-ji/yi-ji-fei-yong-lu-ru.js

@@ -0,0 +1,11 @@
+import request from '../../utils/request'
+
+const url = '/yiJiFeiYongLuRu'
+
+export function getHuanZheXinXi(inpatientNo, zaiYuanChuYuan, admissTimes) {
+  return request({
+    url: url + '/getHuanZheXinXi',
+    method: 'get',
+    params: { inpatientNo, zaiYuanChuYuan, admissTimes },
+  })
+}

+ 208 - 138
src/views/hospitalization/XiangMuLuRu.vue → src/components/inpatient/XiangMuLuRu.vue

@@ -1,56 +1,73 @@
 <template>
   <el-container>
     <el-header height="50px">
-      <el-tag>患者姓名: {{ patient.name }}</el-tag>
-      <el-tag>住院号: {{ patient.inpatientNo }}</el-tag>
-      <el-tag>床号: {{ patient.bedNo }}</el-tag>
-      <el-tag>住院次数: {{ patient.admissTimes }}</el-tag>
-      <el-tag>性别: {{ cptSex(patient.sex) }}</el-tag>
+      <el-tag effect="dark">患者姓名: {{ patient.name }}</el-tag>
+      <el-tag effect="dark">住院号: {{ patient.inpatientNo }}</el-tag>
+      <el-tag effect="dark">床号: {{ patient.bedNo }}</el-tag>
+      <el-tag effect="dark">住院次数: {{ patient.admissTimes }}</el-tag>
+      <el-tag effect="dark">性别: {{ cptSex(patient.sex) }}</el-tag>
       住院号: <el-input v-model="inpatientNo" size="mini" style="width: 100px" clearable placeholder="住院号"></el-input>
       <el-button size="mini" type="primary" icon="el-icon-search" @click="chaXunHuanZheXinXi">查询患者信息</el-button>
       <el-button size="mini" type="warning" style="margin-left: 20px" icon="el-icon-close" @click="guanBiDialog">关闭</el-button>
     </el-header>
     <el-container>
       <el-main>
-        <el-tabs v-model="xmlrTabs" style="margin-bottom: 10px">
+        <el-tabs v-model="xmlrTabs" style="margin-top: 11px">
           <el-tab-pane label="已录入项目" name="ylrxm">
-            项目名称:<el-select v-model="patient.chargeCode" size="mini" remote filterable clearable :remote-method="remoteMethodChargeCode">
+            项目名称:<el-select
+              v-model="patient.chargeCode"
+              size="mini"
+              remote
+              filterable
+              clearable
+              @blur="patient.chargeCode = $event.target.value.trim()"
+              :remote-method="remoteMethodChargeCode"
+            >
               <el-option v-for="item in chargeCodeNameData" :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>
             </el-select>
-            录入日期:<el-date-picker type="date" placeholder="选择日期" size="mini" style="width: 120px" v-model="patient.startTime"></el-date-picker> 退费:<el-select
-              v-model="patient.tuiFeiFlag"
-              style="width: 120px"
+            录入日期:<el-date-picker
+              type="daterange"
+              v-model="dateRange"
+              placeholder="选择日期"
+              size="mini"
+              style="width: 280px"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              :shortcuts="shortcuts"
+            ></el-date-picker>
+            <el-button
               size="mini"
-              @change="tuiFeiZhuangTaiChaKan"
+              @click="riQiPaiXu === 'DESC' ? (riQiPaiXu = 'ASC') : (riQiPaiXu = 'DESC')"
+              type="success"
+              :icon="riQiPaiXu === 'DESC' ? 'el-icon-caret-bottom' : 'el-icon-caret-top'"
+              >{{ riQiPaiXu === 'DESC' ? '日期降序' : '日期升序' }}</el-button
             >
-              <el-option :key="0" :value="0" label="全部"></el-option>
-              <el-option :key="1" :value="1" label="未退费"></el-option>
-              <el-option :key="3" :value="3" label="已退费"></el-option>
+            <el-select style="width: 100px" size="mini" v-model="feiYongLeiXingCode">
+              <el-option v-for="item in feiYongLeiXing" :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>
             </el-select>
-            费用类型:<el-select v-model="patient.orderNo" style="width: 120px" size="mini" @change="queryFeiYong">
-              <el-option :key="0" :value="0" label="护士录入"></el-option>
-              <el-option :key="1" :value="1" label="医嘱"></el-option>
-              <el-option :key="3" :value="3" label="医技"></el-option>
-              <el-option :key="4" :value="4" label="全部"></el-option>
+            <el-select v-model="patient.orderNo" style="width: 120px" size="mini" @change="queryFeiYong">
+              <el-option v-for="item in yiZhuTuiFeiLeiXing" :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>
             </el-select>
-            <el-button size="mini" type="primary" @click="queryXiangMu" icon="el-icon-search">查询</el-button>
-            <el-button size="mini" type="primary" @click="shuaXinFeiYong" icon="el-icon-refresh-left">刷新费用</el-button>
+            <el-button size="mini" type="primary" @click="queryFeiYong" icon="el-icon-search">查询</el-button>
             <el-button size="mini" type="danger" @click="xiangMuTuiFeiClick" icon="el-icon-delete-solid">退费</el-button>
-            <el-table
-              :height="tableHeight"
-              @selection-change="handleSelectionChange"
-              :data="cptTableDataHuanZheFeiYong.slice((patient.currentPage - 1) * patient.pageSize, patient.currentPage * patient.pageSize)"
-              stripe
-              highlight-current-row
-            >
-              <el-table-column type="selection"></el-table-column>
+            <el-table :height="tableHeight" @selection-change="handleSelectionChange" :data="cptTableDataHuanZheFeiYong" stripe highlight-current-row class="eltable">
+              <el-table-column type="selection" style="width: 100px"> </el-table-column>
               <el-table-column label="流水号" prop="detailSn" width="70px"></el-table-column>
               <el-table-column prop="chargeDate" label="录入日期" width="80px"></el-table-column>
-              <el-table-column prop="chargeCode" label="项目编码"></el-table-column>
+              <el-table-column prop="chargeCodeMx" label="项目编码"></el-table-column>
               <el-table-column prop="chargeName" label="项目名称"></el-table-column>
               <el-table-column prop="drugname" label="药品名称"></el-table-column>
               <el-table-column prop="execDept" label="执行科室"></el-table-column>
@@ -68,9 +85,9 @@
                 <template #default="scope">
                   <span v-if="scope.row.tuiFeiFlag === 1" style="color: red"
                     >已退费 <br />
-                    <span v-if="scope.row.oriDetailSn !== null" style="color: red"
+                    <span v-if="scope.row.oriDetailSn !== null" style="color: teal"
                       >原流水号 <br />
-                      {{ scope.row.oriDetailSn }}</span
+                      {{ scope.row.oriDetailSn }}</span
                     >
                   </span>
                 </template>
@@ -91,41 +108,7 @@
           <el-tab-pane label="项目录入" name="xmlr" v-if="panDuanSFTongGuoBingShiJinRu">
             <el-row>
               <el-col :span="3">
-                <el-table :height="tableHeight + 20" :data="muBanData.slice((muBanCurrentPage - 1) * muBanPageSize, muBanCurrentPage * muBanPageSize)">
-                  <el-table-column label="模板名称" prop="name" width="120px">
-                    <!-- 店家激发弹出框 -->
-                    <template #default="scope">
-                      <el-popover placement="right" trigger="click" :width="600">
-                        <template #reference>
-                          <el-button type="text" @click="getMuBanXinXiClick(scope.row)">{{ scope.row.name }}</el-button>
-                        </template>
-                        <!-- 这里是弹出框中的数据 -->
-                        <el-table :height="tableHeight" :data="muBanXiangQing" @selection-change="xuanZeXiangMuTable">
-                          <el-table-column type="selection"></el-table-column>
-                          <el-table-column label="项目名称" prop="chargeName"></el-table-column>
-                          <el-table-column label="单价" prop="chargeAmount"></el-table-column>
-                          <el-table-column label="数量" prop="amount"></el-table-column>
-                          <el-table-column label="金额">
-                            <template #default="scope">
-                              {{ (scope.row.chargeAmount * scope.row.amount).toFixed(2) }}
-                            </template>
-                          </el-table-column>
-                          <el-table-column label="编码" prop="chargeCode"></el-table-column>
-                        </el-table>
-                      </el-popover>
-                    </template>
-                  </el-table-column>
-                </el-table>
-                <el-pagination
-                  @current-change="muBanHandleCurrentChange"
-                  :current-page="muBanCurrentPage"
-                  :page-size="muBanPageSize"
-                  layout=" prev, pager, next,total"
-                  :total="muBanData.length"
-                  style="margin-top: 5px"
-                  :pager-count="5"
-                  small
-                ></el-pagination>
+                <HuoQuMuBan @selectionFeiYong="xuanZeXiangMuTable"></HuoQuMuBan>
               </el-col>
               <el-col :span="20" :offset="1">
                 <el-row>
@@ -133,17 +116,25 @@
                     <el-button type="warning" size="mini" icon="el-icon-star-off" @click="baoCunMuBanDialog = true">存模板</el-button>
                     <el-button type="primary" size="mini" @click="shangChuanXiangMu" icon="el-icon-upload">保存</el-button>
                     <el-button type="success" size="mini" icon="el-icon-plus" @click="xinZhengXiangMuDialog = true">新增</el-button>
+                    <el-select style="width: 180px; margin: 0px 10px 0px 10px" v-model="zhiXingKeShi" size="mini" filterable>
+                      <el-option v-for="item in deptData" :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
+                      >
+                    </el-select>
+                    <el-button type="warning" size="mini" icon="el-icon-edit" @click="xieGaiZhiXingKeShi">修改执行科室</el-button>
                   </el-col>
                   <el-col :span="24">
                     <!-- 这个下面查看录入的项目 -->
-                    <el-table :data="muBanNeiRongData" :height="tableHeight - 27" style="margin-top: 10px" stripe highlight-current-row>
+                    <el-table :data="muBanNeiRongData" :height="tableHeight - 27" class="eltable" style="margin-top: 10px" stripe highlight-current-row>
                       <el-table-column label="录入信息">
                         <el-table-column label="录入时间">
                           <template #default>
                             {{ getDatetime(new Date()) }}
                           </template>
                         </el-table-column>
-                        <el-table-column label="项目编码" prop="chargeCode"></el-table-column>
+                        <el-table-column label="项目编码" prop="chargeCodeMx"></el-table-column>
                         <el-table-column label="名称" prop="chargeName"></el-table-column>
                         <el-table-column label="执行科室" prop="deptCode">
                           <template #default="scope">
@@ -160,7 +151,7 @@
                         <el-table-column label="数量" prop="amount">
                           <template #default="scope">
                             <!--precision 限制输入的精度 0 就是不带任何一位小数点  -->
-                            <el-input-number v-model="scope.row.amount" size="mini" :min="1" :precision="1"></el-input-number>
+                            <el-input-number v-model="scope.row.amount" size="mini" :min="0" :precision="1"></el-input-number>
                           </template>
                         </el-table-column>
                       </el-table-column>
@@ -216,8 +207,8 @@
               <el-button size="mini" type="success" @click="danGeXiangMuBaoCun">保存</el-button>
             </el-col>
             <el-col :span="24">
-              <el-table :data="danGeLuRuXiangMu">
-                <el-table-column label="项目代码" prop="chargeCode"></el-table-column>
+              <el-table :data="danGeLuRuXiangMu" class="eltable">
+                <el-table-column label="项目代码" prop="chargeCodeMx"></el-table-column>
                 <el-table-column label="项目名称" prop="chargeName"></el-table-column>
                 <el-table-column label="规格" prop="spec"></el-table-column>
                 <el-table-column label="执行科室" prop="deptCode">
@@ -252,7 +243,6 @@
             <el-col :span="24"> 模板名称:<el-input size="mini" v-model="cunMuBanPojo.name" maxlength="15" @blur="zhuanPinYin" show-word-limit></el-input> </el-col>
             <el-col :span="12"> 拼音码:<el-input size="mini" v-model="cunMuBanPojo.pyCode" maxlength="8" show-word-limit></el-input> </el-col>
             <el-col :span="12"> 五笔码:<el-input size="mini" v-model="cunMuBanPojo.dcode" maxlength="8" show-word-limit></el-input> </el-col>
-            <!-- <el-col :span="12"> 排序码:<el-input size="mini" v-model="cunMuBanPojo.paiXu" maxlength="7" show-word-limit></el-input> </el-col> -->
             <el-col :span="12"> 创建科室:<el-input size="mini" v-model="cunMuBanPojo.dept" disabled></el-input> </el-col>
             <el-col :span="12">
               <el-button size="mini" style="margin-top: 10px" icon="el-icon-upload" type="primary" @click="baoCunMuBan">保存</el-button>
@@ -268,18 +258,32 @@
 import { computed, onMounted, ref, watch } from 'vue'
 import store from '@/store'
 import { cptSex } from '@/utils/computed'
-import { getChargeCode, getHuanZheFeiYong, getMuBan, getMuBanXinXi, xiangMuTuiFei, queryDanGeXiangMu, xiangMuFeiYongShangChuan, shangChuanMuBan } from '@/api/yibao/xiang-mu-lu-ru'
+import { shortcuts } from '@/data/shortcuts'
+import {
+  getChargeCode,
+  getHuanZheFeiYong,
+  getMuBan,
+  getMuBanXinXi,
+  xiangMuTuiFei,
+  queryDanGeXiangMu,
+  xiangMuFeiYongShangChuan,
+  shangChuanMuBan,
+  shanChuMuBan,
+  getDept,
+  getPyCode,
+} from '@/api/yibao/xiang-mu-lu-ru'
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { costState } from '@/utils/computed'
 import Cookie from 'js-cookie'
-import { formatDate, getDatetime } from '@/utils/date'
-import { getWard } from '@/api/yz-data-mod/yz-temperature-modify'
+import { getDatetime } from '@/utils/date'
 import { clone } from '@/utils/clone'
-import { getWb, getPy } from '@/utils/pingyin'
 import { getPatientInfo } from '@/api/yibao/patient'
+import { yiZhuTuiFeiLeiXing, feiYongLeiXing } from '@/data/index'
+import HuoQuMuBan from '@/components/med-tec-mod/HuoQuMuBan.vue'
+import { getDateRangeFormatDate } from '@/utils/date'
 import { baseinfo } from '@/data/inpatient'
-
 export default {
+  components: { HuoQuMuBan },
   props: {
     init: {
       type: Number,
@@ -291,8 +295,13 @@ export default {
     const tableHeight = windowSize.h - 170
     // 默认选中已录入项目
     const xmlrTabs = ref('ylrxm')
-
     const inpatientNo = ref('')
+    const zhiXingKeShi = ref('')
+    const dateRange = ref(shortcuts[2].value)
+    // DESC 降 ASC 升
+    const riQiPaiXu = ref('DESC')
+
+    const feiYongLeiXingCode = ref(0)
 
     /**
      * 录入费用 表格
@@ -314,7 +323,7 @@ export default {
         getMuBan(Cookie.get('dept')).then((res) => {
           muBanData.value = res
         })
-        getWard().then((res) => {
+        getDept().then((res) => {
           deptData.value = res
         })
       }
@@ -358,7 +367,7 @@ export default {
           patient.value.currentPage = 1
           patient.value.pageSize = 40
           patient.value.total = 0
-          patient.value.tuiFeiFlag = 0
+          patient.value.orderNo = 0
           patient.value.deptCode = Cookie.get('dept')
           queryFeiYong()
           if (patient.value.ward === Cookie.get('dept')) {
@@ -377,27 +386,48 @@ export default {
      * 查询
      */
     const queryFeiYong = () => {
-      if (typeof patient.value.startTime !== 'undefined') {
-        if (patient.value.startTime !== null) {
-          patient.value.startTime = formatDate(patient.value.startTime)
-        }
-      }
-      getHuanZheFeiYong(patient.value).then((res) => {
-        tableDataHuanZheFeiYong.value = res
-        cptTableDataHuanZheFeiYong.value = res
-        patient.value.total = cptTableDataHuanZheFeiYong.value.length
-        tuiFeiZhuangTaiChaKan(patient.value.tuiFeiFlag)
-        if (patient.value.admissWard === Cookie.get('dept')) {
-          panDuanSFTongGuoBingShiJinRu.value = true
-        }
-      })
+      let dateR = getDateRangeFormatDate(dateRange.value)
+      patient.value.startTime = dateR.stratTime
+      patient.value.endTime = dateR.endTime
+      patient.value.riQiPaiXu = riQiPaiXu.value
+      patient.value.feiYongLeiXingCode = feiYongLeiXingCode.value
+      patient.value.currentPage = 1
+      getHuanZheFeiYong(patient.value)
+        .then((res) => {
+          tableDataHuanZheFeiYong.value = res
+          cptTableDataHuanZheFeiYong.value = res.records
+          patient.value.total = res.total
+          if (patient.value.admissWard === Cookie.get('dept')) {
+            panDuanSFTongGuoBingShiJinRu.value = true
+          }
+        })
+        .catch(() => {
+          tableDataHuanZheFeiYong.value = []
+          cptTableDataHuanZheFeiYong.value = []
+          patient.value.total = 0
+        })
     }
 
-    /**
-     * 点击查询 费用
-     */
-    const queryXiangMu = () => {
-      queryFeiYong()
+    const handleQueryFeiYong = () => {
+      let dateR = getDateRangeFormatDate(dateRange.value)
+      patient.value.startTime = dateR.stratTime
+      patient.value.endTime = dateR.endTime
+      patient.value.riQiPaiXu = riQiPaiXu.value
+      patient.value.feiYongLeiXingCode = feiYongLeiXingCode.value
+      getHuanZheFeiYong(patient.value)
+        .then((res) => {
+          tableDataHuanZheFeiYong.value = res
+          cptTableDataHuanZheFeiYong.value = res.records
+          patient.value.total = res.total
+          if (patient.value.admissWard === Cookie.get('dept')) {
+            panDuanSFTongGuoBingShiJinRu.value = true
+          }
+        })
+        .catch(() => {
+          tableDataHuanZheFeiYong.value = []
+          cptTableDataHuanZheFeiYong.value = []
+          patient.value.total = 0
+        })
     }
 
     /**
@@ -407,12 +437,12 @@ export default {
       let query = {
         inpatientNo: patient.value.inpatientNo,
         admissTimes: patient.value.admissTimes,
+        orderNo: patient.value.orderNo,
       }
       getHuanZheFeiYong(query).then((res) => {
         tableDataHuanZheFeiYong.value = res
         cptTableDataHuanZheFeiYong.value = res
         patient.value.total = cptTableDataHuanZheFeiYong.value.length
-        tuiFeiZhuangTaiChaKan(patient.value.tuiFeiFlag)
       })
     }
     /**
@@ -420,10 +450,12 @@ export default {
      */
     const handleSizeChange = (val) => {
       patient.value.pageSize = val
+      handleQueryFeiYong()
     }
 
     const handleCurrentChange = (val) => {
       patient.value.currentPage = val
+      handleQueryFeiYong()
     }
     /**
      * 获取项目名称
@@ -450,37 +482,28 @@ export default {
     /** */
     const cptTableDataHuanZheFeiYong = ref([])
 
-    /** 查看退费的状态 */
-    const tuiFeiZhuangTaiChaKan = (val) => {
-      cptTableDataHuanZheFeiYong.value = []
-      if (val == 0) {
-        cptTableDataHuanZheFeiYong.value = tableDataHuanZheFeiYong.value
-      } else if (val === 1) {
-        tableDataHuanZheFeiYong.value.filter((item) => {
-          if (item.tuiFeiFlag !== 1) {
-            cptTableDataHuanZheFeiYong.value.push(item)
-          }
-        })
-      } else if (val === 3) {
-        tableDataHuanZheFeiYong.value.filter((item) => {
-          if (item.tuiFeiFlag === 1) {
-            cptTableDataHuanZheFeiYong.value.push(item)
-          }
-        })
-      }
-      patient.value.total = cptTableDataHuanZheFeiYong.value.length
-    }
     /**
      *  项目退费
      */
     const xiangMuTuiFeiClick = () => {
       if (typeof patient.value.list !== 'undefined') {
+        let chargeFee = 0
+        let chargeAmount = 0
+        for (let i = 0; i < patient.value.list.length; i++) {
+          chargeAmount += patient.value.list[i].chargeAmount
+          chargeFee += patient.value.list[i].chargeFee
+        }
         if (patient.value.list.length > 0) {
-          ElMessageBox.confirm('共【' + patient.value.list.length + '】条退费数据', '请认真核对', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          })
+          ElMessageBox.confirm(
+            `退费数量为:<span style='color:red'>【${chargeAmount}】</span> ,总价格为:<span style='color:#E6A23C'>【${chargeFee.toFixed(2)}】</span>`,
+            '请认真核对',
+            {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning',
+              dangerouslyUseHTMLString: true,
+            }
+          )
             .then(() => {
               xiangMuTuiFei(patient.value).then((res) => {
                 queryFeiYong()
@@ -517,9 +540,10 @@ export default {
     const muBanNeiRongData = ref([])
     // 保存 code 不要重复添加
     let muBanCode = []
-    const xuanZeXiangMuTable = (val) => {
+    const xuanZeXiangMuTable = (param) => {
+      let val = param.val
       for (let i = 0; i < val.length; i++) {
-        let code = val[i].chargeCode
+        let code = val[i].chargeCodeMx
         if (muBanCode.indexOf(code) === -1) {
           muBanCode.push(code)
           val[i].deptCode = patient.value.zkWard
@@ -570,7 +594,7 @@ export default {
      */
     const rmChargePyCode = (val) => {
       if (val.length >= 2) {
-        queryDanGeXiangMu(val).then((res) => {
+        queryDanGeXiangMu(val, 0).then((res) => {
           xiangMuData.value = res
         })
       }
@@ -603,7 +627,7 @@ export default {
      */
     const danGeXiangMuBaoCun = () => {
       for (let i = 0; i < muBanNeiRongData.value.length; i++) {
-        if (muBanNeiRongData.value[i].chargeCode === danGeLuRuXiangMu.value[0].chargeCode) {
+        if (muBanNeiRongData.value[i].chargeCodeMx === danGeLuRuXiangMu.value[0].chargeCodeMx) {
           ElMessage.error({
             message: '已存在相同项目请勿重复添加',
             showClose: true,
@@ -611,7 +635,7 @@ export default {
           return
         }
       }
-      muBanCode.push(clone(danGeLuRuXiangMu.value[0].chargeCode))
+      muBanCode.push(clone(danGeLuRuXiangMu.value[0].chargeCodeMx))
       muBanNeiRongData.value.push(clone(danGeLuRuXiangMu.value[0]))
       danGeLuRuXiangMu.value = []
       chargePyCode.value = ''
@@ -643,7 +667,9 @@ export default {
         dept: patient.value.admissDept,
         zySerialNo: patient.value.zySerialNo,
         ward: patient.value.zkWard,
+        referPhysician: patient.value.referPhysician,
         list: muBanNeiRongData.value,
+        orderNo: 0,
       }
       // 在此处上传
       ElMessageBox.confirm('共上传【' + muBanNeiRongData.value.length + '】条', '请认真核对', {
@@ -689,7 +715,6 @@ export default {
         return
       }
       cunMuBanPojo.value.list = clone(muBanNeiRongData.value)
-
       // 开始上传
       shangChuanMuBan(cunMuBanPojo.value).then(() => {
         cunMuBanPojo.value = {}
@@ -698,8 +723,10 @@ export default {
 
     // 获取到保存模板的拼音码和五笔码
     const zhuanPinYin = () => {
-      cunMuBanPojo.value.pyCode = getPy(cunMuBanPojo.value.name)
-      cunMuBanPojo.value.dcode = getWb(cunMuBanPojo.value.name)
+      getPyCode(cunMuBanPojo.value.name).then((res) => {
+        cunMuBanPojo.value.pyCode = res.pyCode
+        cunMuBanPojo.value.dcode = res.wbCode
+      })
     }
 
     // 上面就是保存的模板信息
@@ -719,9 +746,9 @@ export default {
           patient.value.currentPage = 1
           patient.value.pageSize = 40
           patient.value.total = 0
-          patient.value.tuiFeiFlag = 0
           patient.value.orderNo = 0
           patient.value.deptCode = Cookie.get('dept')
+          zhiXingKeShi.value = patient.value.zkWard
           panDuanSFTongGuoBingShiJinRu.value = true
           queryFeiYong()
         }
@@ -729,27 +756,62 @@ export default {
     )
 
     onMounted(() => {
+      if (Cookie.get('code') === '02453') {
+        ElMessage.success({
+          message: '阳哥,hello  (*^▽^*)',
+          showClose: true,
+        })
+      }
       if (!baseinfo().inpatientNo) {
+        patient.value.currentPage = 1
+        patient.value.pageSize = 40
+        patient.value.total = 0
+        patient.value.orderNo = 0
+        patient.value.deptCode = Cookie.get('dept')
+        zhiXingKeShi.value = patient.value.zkWard
         jinRuPanDuanSFXieDaiHuanZheXinXi()
       } else {
         patient.value = clone(baseinfo())
         patient.value.currentPage = 1
         patient.value.pageSize = 40
         patient.value.total = 0
-        patient.value.tuiFeiFlag = 0
         patient.value.orderNo = 0
         patient.value.deptCode = Cookie.get('dept')
         panDuanSFTongGuoBingShiJinRu.value = true
+        zhiXingKeShi.value = patient.value.zkWard
         queryFeiYong()
       }
     })
 
+    const shanChuMuBanClick = (index, data) => {
+      if (data.opIdCode !== Cookie.get('code')) {
+        ElMessageBox.confirm('该模板非本人创建是否强制删除', '提示', {
+          type: 'warning',
+        })
+          .then(() => {
+            shanChuMuBan(data.name, data.opIdCode).then((res) => {
+              muBanData.value.splice(index, 1)
+            })
+          })
+          .catch(() => {})
+      } else {
+        shanChuMuBan(data.name, data.opIdCode).then((res) => {
+          muBanData.value.splice(index, 1)
+        })
+      }
+    }
+
+    const xieGaiZhiXingKeShi = () => {
+      for (let i = 0; i < muBanNeiRongData.value.length; i++) {
+        muBanNeiRongData.value[i].deptCode = zhiXingKeShi.value
+      }
+    }
+
     return {
       patient,
       cptSex,
       xmlrTabs,
       tableHeight,
-      queryXiangMu,
       tableDataHuanZheFeiYong,
       handleSizeChange,
       handleCurrentChange,
@@ -782,7 +844,6 @@ export default {
       muBanCurrentPage,
       muBanPageSize,
       muBanHandleCurrentChange,
-      tuiFeiZhuangTaiChaKan,
       cptTableDataHuanZheFeiYong,
       guanBiDialog,
       danGeXiangMuCurrentPage,
@@ -792,6 +853,15 @@ export default {
       shuaXinFeiYong,
       panDuanSFTongGuoBingShiJinRu,
       queryFeiYong,
+      shanChuMuBanClick,
+      yiZhuTuiFeiLeiXing,
+      zhiXingKeShi,
+      xieGaiZhiXingKeShi,
+      dateRange,
+      shortcuts,
+      riQiPaiXu,
+      feiYongLeiXingCode,
+      feiYongLeiXing,
     }
   },
 }

+ 266 - 0
src/components/inpatient/YiZhuTuiFei.vue

@@ -0,0 +1,266 @@
+<template>
+  <el-container>
+    <el-header height="30px">
+      <el-tag>患者姓名: {{ patient.name }}</el-tag>
+      <el-tag>住院号: {{ patient.inpatientNo }}</el-tag>
+      <el-tag>床号: {{ patient.bedNo }}</el-tag>
+      <el-tag>住院次数: {{ patient.admissTimes }}</el-tag>
+      <el-tag>性别: {{ cptSex(patient.sex) }}</el-tag> <br /><br />
+      医嘱号:<el-input size="mini" style="width: 120px" v-model="actOrderNo"></el-input> 医嘱名称:<el-select
+        v-model="orderCode"
+        size="mini"
+        remote
+        filterable
+        clearable
+        :remote-method="remoteMethodOrderCode"
+      >
+        <el-option v-for="item in orderCodeNameData" :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>
+      </el-select>
+      是否退费:<el-select size="mini" remote filterable v-model="tuiFeiCode">
+        <el-option v-for="item in tuiFeiLeiXin" :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>
+      </el-select>
+      医嘱时间:
+      <el-date-picker
+        v-model="dateRange"
+        type="daterange"
+        size="mini"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
+        :shortcuts="shortcuts"
+        style="width: 260px"
+      ></el-date-picker>
+      <el-button size="mini" style="margin-left: 10px" type="primary" icon="el-icon-search" @click="queryActOrder">搜索</el-button>
+      <el-button size="mini" style="margin-left: 10px" type="danger" icon="el-icon-delete-solid" @click="yiZhuTuiFeiClick">医嘱退费</el-button>
+      <el-button size="mini" style="margin-left: 10px" type="warning" icon="el-icon-close" @click="closeDialog">关闭</el-button>
+    </el-header>
+    <el-main style="margin-top: 50px">
+      <el-table :data="yzActOrderData" :height="tableHeight - 20" stripe highlight-current-row @selection-change="selectionTuiFeiYiZhu">
+        <el-table-column type="selection"></el-table-column>
+        <el-table-column prop="actOrderNo" label="医嘱号"></el-table-column>
+        <el-table-column prop="orderCode" label="医嘱编码"></el-table-column>
+        <el-table-column prop="orderName" label="医嘱名称"></el-table-column>
+        <el-table-column prop="drugQuan" label="执行用量"></el-table-column>
+        <el-table-column prop="supplyCodeName" label="给药方式"></el-table-column>
+        <el-table-column prop="frequCode" label="频次"></el-table-column>
+        <el-table-column prop="physicianName" label="医生"></el-table-column>
+        <el-table-column prop="startTime" label="开始时间" width="80px"></el-table-column>
+        <el-table-column prop="endTime" label="结束时间" width="80px"></el-table-column>
+        <el-table-column prop="dose" label="计量"></el-table-column>
+        <el-table-column prop="doseUnit" label="计量单位"></el-table-column>
+        <el-table-column prop="groupNo" label="药房号"></el-table-column>
+        <el-table-column prop="drugFlagName" label="医嘱类型"></el-table-column>
+        <el-table-column prop="discription" label="描述"></el-table-column>
+        <el-table-column prop="tfFlag" label="是否退费">
+          <template #default="scope">
+            <span v-html="tfFlag(scope.row.tfFlag)"></span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-sizes="[20, 30, 40, 50, 100]"
+        :page-size="pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total"
+        style="margin-top: 5px"
+      ></el-pagination>
+    </el-main>
+  </el-container>
+</template>
+
+<script>
+import { onMounted, ref, watch } from '@vue/runtime-core'
+import store from '@/store'
+import { getChargeCode } from '@/api/yibao/xiang-mu-lu-ru'
+import { cptSex } from '@/utils/computed'
+import { shortcuts } from '@/data/shortcuts'
+import { getDateRangeFormatDate } from '@/utils/date'
+import { getOrderList, yiZhuTuiFei } from '@/api/yibao/yi-zhu-tui-fei'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { tuiFeiLeiXin } from '@/data/index'
+import { baseinfo } from '@/data/inpatient'
+export default {
+  props: {
+    initYiZhu: {
+      type: Number,
+    },
+  },
+  setup(props, cxt) {
+    const windowSize = store.state.app.windowSize
+    const tableHeight = windowSize.h - 120
+
+    const actOrderNo = ref('')
+    const orderCode = ref('')
+    // 根据医嘱名称来查询
+    const orderCodeNameData = ref([])
+    const dateRange = ref(null)
+    // 退费编码
+    const tuiFeiCode = ref(3)
+
+    const currentPage = ref(1)
+    const pageSize = ref(20)
+    const total = ref(0)
+
+    const patient = baseinfo()
+
+    const yzActOrderData = ref([])
+
+    const handleSizeChange = (val) => {
+      pageSize.value = val
+      queryActOrder()
+    }
+
+    const handleCurrentChange = (val) => {
+      currentPage.value = val
+      queryActOrder()
+    }
+
+    /**
+     * 远程搜索
+     */
+    const remoteMethodOrderCode = (val) => {
+      if (val.length >= 2) {
+        getChargeCode(val).then((res) => {
+          orderCodeNameData.value = res
+        })
+      }
+    }
+
+    const closeDialog = () => {
+      cxt.emit('closeYiZhuTuiFei')
+    }
+
+    watch(
+      () => props.initYiZhu,
+      () => {
+        orderCode.value = ''
+        actOrderNo.value = ''
+        dateRange.value = null
+        currentPage.value = 1
+        pageSize.value = 20
+        queryActOrder()
+      }
+    )
+
+    onMounted(() => {
+      queryActOrder()
+    })
+
+    const queryActOrder = () => {
+      let date = getDateRangeFormatDate(dateRange.value)
+      let queryTerm = {
+        queryStartTime: date.stratTime,
+        queryEndTime: date.endTime,
+        orderCode: orderCode.value,
+        actOrderNo: actOrderNo.value,
+        inpatientNo: patient.inpatientNo,
+        admissTimes: patient.admissTimes,
+        currentPage: currentPage.value,
+        pageSize: pageSize.value,
+        tfFlag: tuiFeiCode.value,
+      }
+      getOrderList(queryTerm)
+        .then((res) => {
+          total.value = res.total
+          yzActOrderData.value = res.records
+        })
+        .catch(() => {
+          total.value = 0
+          yzActOrderData.value = []
+        })
+    }
+
+    // 获取退费医嘱
+    const tuiFaiYiZhu = ref([])
+
+    const selectionTuiFeiYiZhu = (val) => {
+      tuiFaiYiZhu.value = val
+    }
+
+    // 开始退费
+    const yiZhuTuiFeiClick = () => {
+      if (tuiFaiYiZhu.value.length <= 0) {
+        return ElMessage.error({
+          message: '请先选择需要退费的数据',
+          showClose: true,
+        })
+      }
+
+      ElMessageBox.confirm(`共${tuiFaiYiZhu.value.length}条数据退费,请认真审核。`, '提示', {
+        type: 'warning',
+      })
+        .then(() => {
+          let tuiFei = {
+            inpatientNo: patient.inpatientNo,
+            admissTimes: patient.admissTimes,
+            tuiFeiList: tuiFaiYiZhu.value,
+          }
+          yiZhuTuiFei(tuiFei).then((res) => {
+            queryActOrder()
+          })
+        })
+        .catch(() => {})
+    }
+
+    // 监听如果选择的退费类型 那么就要从第一页开始 不然会有bug
+    watch(
+      () => tuiFeiCode.value,
+      () => {
+        currentPage.value = 1
+        queryActOrder()
+      }
+    )
+
+    return {
+      actOrderNo,
+      orderCode,
+      orderCodeNameData,
+      remoteMethodOrderCode,
+      closeDialog,
+      patient,
+      cptSex,
+      dateRange,
+      shortcuts,
+      queryActOrder,
+      total,
+      yzActOrderData,
+      tableHeight,
+      currentPage,
+      pageSize,
+      handleCurrentChange,
+      handleSizeChange,
+      selectionTuiFeiYiZhu,
+      yiZhuTuiFeiClick,
+      tfFlag,
+      tuiFeiLeiXin,
+      tuiFeiCode,
+    }
+  },
+}
+
+function tfFlag(val) {
+  switch (val) {
+    case 0:
+      return `<span style="color: #67C23A">未退费</span>`
+    case 1:
+      return `<span style="color: #F56C6C">已退费</span>`
+    case 2:
+      return `<span style="color: #F56C6C">退费数据</span>`
+    default:
+      return `<span style="color: #909399">未知</span>`
+  }
+}
+</script>
+
+<style></style>

+ 163 - 0
src/components/med-tec-mod/HuanZheFeiYong.vue

@@ -0,0 +1,163 @@
+<template>
+  <el-container>
+    <el-main>
+      <el-button size="mini" type="danger" @click="xiangMuTuiFeiClick" icon="el-icon-delete-solid">退费</el-button>
+      <el-table :data="cptTableDataHuanZheFeiYong" :height="windowHeigth - 170" @selection-change="handleSelectionChange" highlight-current-row stripe>
+        <el-table-column type="selection"></el-table-column>
+        <el-table-column label="流水号" prop="detailSn" width="70px"></el-table-column>
+        <el-table-column prop="chargeDate" label="录入日期" width="80px"></el-table-column>
+        <el-table-column prop="chargeCodeMx" label="项目编码"></el-table-column>
+        <el-table-column prop="chargeName" label="项目名称"></el-table-column>
+        <el-table-column prop="drugname" label="药品名称"></el-table-column>
+        <el-table-column prop="execDept" label="执行科室"></el-table-column>
+        <el-table-column prop="deptCode" label="申请科室"></el-table-column>
+        <el-table-column prop="chargeFee" label="金额"></el-table-column>
+        <el-table-column label="数量" prop="chargeAmount"></el-table-column>
+        <el-table-column label="状态" prop="chargeStatus">
+          <template #default="scope">
+            {{ costState(scope.row.chargeStatus) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="录入人" prop="opName"></el-table-column>
+        <el-table-column label="账单码" prop="billItemName"></el-table-column>
+        <el-table-column label="是否退费" prop="tuiFeiFlag">
+          <template #default="scope">
+            <span v-if="scope.row.tuiFeiFlag === 1" style="color: red"
+              >已退费 <br />
+              <span v-if="scope.row.oriDetailSn !== null" style="color: teal"
+                >原流水号 <br />
+                {{ scope.row.oriDetailSn }}</span
+              >
+            </span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="fenYe.currentPage"
+        :page-sizes="[20, 30, 40, 50, 100]"
+        :page-size="fenYe.pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="fenYe.total"
+        style="margin-top: 5px"
+      ></el-pagination>
+    </el-main>
+  </el-container>
+</template>
+
+<script>
+import { ref, watch } from 'vue'
+import { costState } from '@/utils/computed'
+import store from '@/store'
+import { getChargeCode, xiangMuTuiFei } from '@/api/yibao/xiang-mu-lu-ru'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import jsCookie from 'js-cookie'
+export default {
+  name: 'huanZheFeiYong',
+  props: {
+    init: {
+      type: Object,
+    },
+    patient: {
+      type: Object,
+    },
+  },
+  setup(props, ctx) {
+    const windowSize = store.state.app.windowSize
+    const windowHeigth = windowSize.h
+    const cptTableDataHuanZheFeiYong = ref([])
+    const fenYe = ref({
+      pageSize: 40,
+      currentPage: 1,
+      total: 0,
+    })
+
+    watch(
+      () => props.init,
+      () => {
+        cptTableDataHuanZheFeiYong.value = props.init.records
+        fenYe.value.total = props.init.total
+        fenYe.value.currentPage = props.init.currentPage
+      }
+    )
+
+    // 分页
+    const handleSizeChange = (val) => {
+      ctx.emit('size', { val })
+    }
+
+    const handleCurrentChange = (val) => {
+      ctx.emit('current', { val })
+    }
+
+    /**
+     * 获取的项目名称保存的位置
+     */
+    const chargeCodeNameData = ref([])
+
+    /**
+     * 远程搜索
+     */
+    const remoteMethodChargeCode = (val) => {
+      if (val.length >= 2) {
+        getChargeCode(val).then((res) => {
+          chargeCodeNameData.value = res
+        })
+      }
+    }
+
+    // 获取选择到的项目
+    const handleSelectionChange = (val) => {
+      props.patient.list = val
+    }
+
+    const xiangMuTuiFeiClick = () => {
+      props.patient.deptCode = jsCookie.get('dept')
+      try {
+        let chargeFee = 0
+        let chargeAmount = 0
+        for (let i = 0; i < props.patient.list.length; i++) {
+          chargeFee += props.patient.list[i].chargeFee
+          chargeAmount += props.patient.list[i].chargeAmount
+        }
+        ElMessageBox.confirm(
+          `退费数量为:<span style='color:red'>【${chargeAmount}】</span> ,总价格为:<span style='color:#E6A23C'>【${chargeFee.toFixed(2)}】</span>`,
+          '请认真核对',
+          {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+            dangerouslyUseHTMLString: true,
+          }
+        )
+          .then(() => {
+            xiangMuTuiFei(props.patient).then((res) => {
+              ctx.emit('query-fei-yong')
+            })
+          })
+          .catch(() => {})
+      } catch (e) {
+        ElMessage.error({
+          message: '请选择退费数据',
+          showClose: true,
+        })
+      }
+    }
+    return {
+      cptTableDataHuanZheFeiYong,
+      costState,
+      fenYe,
+      windowHeigth,
+      handleSizeChange,
+      handleCurrentChange,
+      remoteMethodChargeCode,
+      chargeCodeNameData,
+      xiangMuTuiFeiClick,
+      handleSelectionChange,
+    }
+  },
+}
+</script>
+
+<style></style>

+ 133 - 0
src/components/med-tec-mod/HuoQuMuBan.vue

@@ -0,0 +1,133 @@
+<template>
+  <el-container>
+    <el-aside width="190px">
+      <el-table :height="tableHeight + 20" :data="muBanData.slice((muBanCurrentPage - 1) * muBanPageSize, muBanCurrentPage * muBanPageSize)">
+        <el-table-column label="模板名称" prop="name" width="120px">
+          <!-- 店家激发弹出框 -->
+          <template #default="scope">
+            <el-popover placement="right" trigger="click" :width="600">
+              <template #reference>
+                <el-button type="text" @click="getMuBanXinXiClick(scope.row)">{{ scope.row.name }}</el-button>
+              </template>
+              <!-- 这里是弹出框中的数据 -->
+              <el-table :height="tableHeight" :data="muBanXiangQing" @selection-change="xuanZeXiangMuTable" class="eltable">
+                <el-table-column type="selection"></el-table-column>
+                <el-table-column label="项目名称" prop="chargeName"></el-table-column>
+                <el-table-column label="单价" prop="chargeAmount"></el-table-column>
+                <el-table-column label="数量" prop="amount"></el-table-column>
+                <el-table-column label="金额">
+                  <template #default="scope">
+                    {{ (scope.row.chargeAmount * scope.row.amount).toFixed(2) }}
+                  </template>
+                </el-table-column>
+                <el-table-column label="编码" prop="chargeCodeMx"></el-table-column>
+              </el-table>
+            </el-popover>
+          </template>
+        </el-table-column>
+        <el-table-column>
+          <template #default="scope">
+            <el-popconfirm
+              confirm-button-text="确认"
+              cancel-button-text="取消"
+              icon="el-icon-info"
+              iconColor="red"
+              title="是否删除该数据"
+              @confirm="shanChuMuBanClick(scope.$index, scope.row)"
+            >
+              <template #reference>
+                <el-button size="mini" type="danger">删除</el-button>
+              </template>
+            </el-popconfirm>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        @current-change="muBanHandleCurrentChange"
+        :current-page="muBanCurrentPage"
+        :page-size="muBanPageSize"
+        layout=" prev, pager, next"
+        :total="muBanData.length"
+        style="margin-top: 5px"
+        :pager-count="5"
+        small
+      ></el-pagination>
+    </el-aside>
+  </el-container>
+</template>
+
+<script>
+import { onMounted, ref } from 'vue'
+import { getMuBanXinXi, shanChuMuBan, getMuBan } from '@/api/yibao/xiang-mu-lu-ru'
+import store from '@/store'
+import Cookie from 'js-cookie'
+import { ElMessageBox } from 'element-plus'
+export default {
+  setup(props, ctx) {
+    const windowSize = store.state.app.windowSize
+    const tableHeight = windowSize.h - 170
+
+    // 项目录入模板数据
+    const muBanData = ref([])
+    const muBanCurrentPage = ref(1)
+    const muBanPageSize = ref(10)
+
+    const muBanHandleCurrentChange = (val) => {
+      muBanCurrentPage.value = val
+    }
+
+    // 获取模板信息
+    const getMuBanXinXiClick = (row) => {
+      getMuBanXinXi(row.name, row.opIdCode).then((res) => {
+        muBanXiangQing.value = res
+      })
+    }
+
+    // 获取模板的详情
+    const muBanXiangQing = ref([])
+
+    // 获取选择的数据
+    const xuanZeXiangMuTable = (val) => {
+      ctx.emit('selectionFeiYong', { val })
+    }
+
+    const shanChuMuBanClick = (index, data) => {
+      if (data.opIdCode !== Cookie.get('code')) {
+        ElMessageBox.confirm('该模板非本人创建是否强制删除', '提示', {
+          type: 'error',
+        })
+          .then(() => {
+            shanChuMuBan(data.name, data.opIdCode).then((res) => {
+              muBanData.value.splice(index, 1)
+            })
+          })
+          .catch(() => {})
+      } else {
+        shanChuMuBan(data.name, data.opIdCode).then((res) => {
+          muBanData.value.splice(index, 1)
+        })
+      }
+    }
+
+    onMounted(() => {
+      getMuBan(Cookie.get('dept')).then((res) => {
+        muBanData.value = res
+      })
+    })
+
+    return {
+      tableHeight,
+      muBanData,
+      muBanCurrentPage,
+      muBanPageSize,
+      muBanHandleCurrentChange,
+      getMuBanXinXiClick,
+      xuanZeXiangMuTable,
+      muBanXiangQing,
+      shanChuMuBanClick,
+    }
+  },
+}
+</script>
+
+<style></style>

+ 466 - 0
src/components/med-tec-mod/YiJiXiangMuLuRu.vue

@@ -0,0 +1,466 @@
+<template>
+  <el-container>
+    <el-aside width="195px">
+      <HuoQuMuBan @selectionFeiYong="xuanZeXiangMuTable"></HuoQuMuBan>
+    </el-aside>
+    <el-main>
+      <el-button type="warning" size="mini" icon="el-icon-star-off" @click="baoCunMuBanDialog = true">存模板</el-button>
+      <el-button type="primary" size="mini" @click="shangChuanXiangMu" icon="el-icon-upload">保存</el-button>
+      <el-button type="success" size="mini" icon="el-icon-plus" @click="xinZhengXiangMuDialog = true">新增</el-button>
+      <el-select style="width: 120px; margin: 0px 10px 0px 10px" v-model="zhiXingKeShi" size="mini" filterable>
+        <el-option v-for="item in deptData" :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
+        >
+      </el-select>
+      <el-button type="warning" size="mini" icon="el-icon-edit" @click="xieGaiZhiXingKeShi">修改执行科室</el-button>
+      <span v-if="panDuanSFWeiShouShuShi()">
+        病区:
+        <el-select style="width: 120px" size="mini" filterable v-model="queryWard" @change="getBingQuDuiYingKeShiChange">
+          <el-option v-for="item in wardData" :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
+          > </el-select
+        >小科室:
+        <el-select style="width: 120px" size="mini" filterable v-model="queryDept">
+          <el-option v-for="item in xiaoKeShiList" :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
+          >
+        </el-select>
+        手术编码:
+        <el-input style="width: 120px" size="mini" v-model="ssCode" clearable placeholder="请输入手术编码"></el-input>
+      </span>
+      <el-tag type="danger"> 项目总价:{{ xiangMuZongJia }}</el-tag>
+      <el-table :data="feiYongShuJu" :height="tableHeight - 27" style="margin-top: 10px" stripe highlight-current-row>
+        <el-table-column label="录入信息">
+          <el-table-column label="是否自费">
+            <template #default="scope">
+              <el-switch
+                active-color="#ff4949"
+                inactive-color="#13ce66"
+                active-text="自费"
+                inactive-text="医保"
+                :active-value="1"
+                :inactive-value="0"
+                v-model="scope.row.ybSelfFlag"
+              ></el-switch>
+            </template>
+          </el-table-column>
+          <el-table-column label="录入时间" width="80px">
+            <template #default>
+              {{ getDatetime(new Date()) }}
+            </template>
+          </el-table-column>
+          <el-table-column label="项目编码" prop="chargeCodeMx"></el-table-column>
+          <el-table-column label="名称" prop="chargeName"></el-table-column>
+          <el-table-column label="执行科室" prop="deptCode">
+            <template #default="scope">
+              <el-select style="width: 90%" size="mini" v-model="scope.row.deptCode" filterable>
+                <el-option v-for="item in deptData" :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
+                >
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="单价" prop="chargeAmount"></el-table-column>
+          <el-table-column label="数量" prop="amount">
+            <template #default="scope">
+              <!--precision 限制输入的精度 0 就是不带任何一位小数点  -->
+              <el-input-number v-model="scope.row.amount" size="mini" :min="0" :precision="1"></el-input-number>
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column label="金额">
+          <template #default="scope">
+            {{ (scope.row.chargeAmount * scope.row.amount).toFixed(2) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="账单码" prop="billItemName"></el-table-column>
+        <el-table-column label="操作">
+          <template #default="scope">
+            <el-button size="mini" type="danger" @click="shanChuXiangMuClick(scope.$index)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-main>
+    <el-dialog v-model="xinZhengXiangMuDialog" title="新增" :width="1500">
+      搜索:
+      <el-select v-model="chargeCodePy" size="mini" remote filterable clearable @change="getDanGeXiangMu" default-first-option :remote-method="rmChargePyCode">
+        <el-option v-for="item in xiangMuHuoYaoPinShuJu" :key="item.chargeCodeMx" :label="item.chargeName" :value="item.chargeCodeMx">
+          <span v-if="xiangMuHuoYaoPinFlag == 0">
+            <span style="color: #8492a6; font-size: 12px">{{ item.chargeCodeMx }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span> {{ item.chargeName }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span style="color: red"> {{ item.ybComment }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span style="color: #e6a23c"> {{ item.chargeAmount }} 元</span>
+          </span>
+          <span v-else>
+            <span style="color: #8492a6; font-size: 12px">{{ item.chargeCodeMx }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span> {{ item.chargeName }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span style="color: #e6a23c"> {{ item.spec }} </span>
+            <el-divider direction="vertical"></el-divider>
+            <span style="color: #8492a6"> {{ item.yblx }} </span>
+            <el-divider direction="vertical"></el-divider>
+            <span style="color: #e6a23c"> {{ item.chargeAmount }} 元</span>
+          </span>
+        </el-option>
+      </el-select>
+      <el-switch
+        active-color="#409EFF"
+        inactive-color="#13ce66"
+        active-text="药品"
+        inactive-text="项目"
+        :active-value="1"
+        :inactive-value="0"
+        v-model="xiangMuHuoYaoPinFlag"
+      ></el-switch>
+      <el-button size="mini" type="success" @click="danGeXiangMuBaoCun">保存</el-button>
+      <el-table :data="danGeFeiYong">
+        <el-table-column label="项目编码" prop="chargeCodeMx"></el-table-column>
+        <el-table-column label="项目名称" prop="chargeName"></el-table-column>
+        <el-table-column label="规格" prop="spec"></el-table-column>
+        <el-table-column label="执行科室" prop="deptCode">
+          <template #default="scope">
+            <el-select style="width: 90%" size="mini" v-model="scope.row.deptCode" filterable>
+              <el-option v-for="item in deptData" :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
+              >
+            </el-select>
+          </template></el-table-column
+        >
+        <el-table-column label="单价" prop="chargeAmount"></el-table-column>
+        <el-table-column label="数量" prop="amount">
+          <template #default="scope">
+            <el-input-number v-model="scope.row.amount" size="mini" :min="1" :precision="1"></el-input-number>
+          </template>
+        </el-table-column>
+        <el-table-column label="金额">
+          <template #default="scope">
+            {{ (scope.row.chargeAmount * scope.row.amount).toFixed(2) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="账单码" prop="billItemName"></el-table-column>
+      </el-table>
+    </el-dialog>
+    <el-dialog title="保存模板" v-model="baoCunMuBanDialog">
+      <el-row>
+        <el-col :span="24"> 模板名称:<el-input size="mini" v-model="cunMuBanPojo.name" maxlength="15" @blur="zhuanPinYin" show-word-limit></el-input> </el-col>
+        <el-col :span="12"> 拼音码:<el-input size="mini" v-model="cunMuBanPojo.pyCode" maxlength="8" show-word-limit></el-input> </el-col>
+        <el-col :span="12"> 五笔码:<el-input size="mini" v-model="cunMuBanPojo.dcode" maxlength="8" show-word-limit></el-input> </el-col>
+        <!-- <el-col :span="12"> 排序码:<el-input size="mini" v-model="cunMuBanPojo.paiXu" maxlength="7" show-word-limit></el-input> </el-col> -->
+        <el-col :span="12">
+          <el-button size="mini" style="margin-top: 10px" icon="el-icon-upload" type="primary" @click="baoCunMuBan">保存</el-button>
+        </el-col>
+      </el-row>
+    </el-dialog>
+  </el-container>
+</template>
+
+<script>
+import { computed, onMounted, ref, watch } from 'vue'
+import { getMuBan, getMuBanXinXi, xiangMuFeiYongShangChuan, getDept, queryDanGeXiangMu, shanChuMuBan, getPyCode, shangChuanMuBan } from '@/api/yibao/xiang-mu-lu-ru'
+import Cookie from 'js-cookie'
+import store from '@/store'
+import { getDatetime } from '@/utils/date'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { getBingQuDuiYingKeShi, getWard } from '@/api/yibao/xiang-mu-lu-ru'
+import { clone } from '@/utils/clone'
+import HuoQuMuBan from './HuoQuMuBan.vue'
+
+export default {
+  components: {
+    HuoQuMuBan,
+  },
+  props: {
+    patient: {
+      type: Object,
+    },
+  },
+  setup(props, cxt) {
+    const windowSize = store.state.app.windowSize
+    const tableHeight = windowSize.h - 170
+    const deptData = ref([])
+    const wardData = ref([])
+
+    // 手术编码
+    const ssCode = ref('')
+
+    // 项目录入模板数据
+    const muBanData = ref([])
+    const muBanCurrentPage = ref(1)
+    const muBanPageSize = ref(10)
+
+    const queryDept = ref('')
+    const queryWard = ref('')
+
+    const xiaoKeShiList = ref([])
+
+    const muBanHandleCurrentChange = (val) => {
+      muBanCurrentPage.value = val
+    }
+    // 获取模板信息
+    const getMuBanXinXiClick = (row) => {
+      getMuBanXinXi(row.name, row.opIdCode).then((res) => {
+        muBanXiangQing.value = res
+      })
+    }
+
+    // 获取模板的详情
+    const muBanXiangQing = ref([])
+
+    // 获取选择的数据
+    const xuanZeXiangMuTable = (param) => {
+      let val = param.val
+      for (let i = 0; i < val.length; i++) {
+        if (chargeCode.value.indexOf(val[i].chargeCodeMx) === -1) {
+          chargeCode.value.push(val[i].chargeCodeMx)
+          val[i].deptCode = Cookie.get('dept')
+          feiYongShuJu.value.push(val[i])
+        }
+      }
+    }
+
+    const chargeCode = ref([])
+
+    onMounted(() => {
+      // 获取模板信息
+      getMuBan(Cookie.get('dept')).then((res) => {
+        muBanData.value = res
+      })
+      // 获取科室
+      getDept().then((res) => {
+        deptData.value = res
+      })
+      getWard().then((res) => {
+        wardData.value = res
+      })
+    })
+
+    const feiYongShuJu = ref([])
+
+    const shangChuanXiangMu = () => {
+      let shangChuanFeiYong = {
+        // 这里又要反回来 就尼玛坑爹 我也不知道为什么
+        dept: queryWard.value,
+        ward: queryDept.value,
+        inpatientNo: props.patient.inpatientNo,
+        admissTimes: props.patient.admissTimes,
+        zySerialNo: props.patient.zySerialNo,
+        ssCode: ssCode.value,
+        referPhysician: props.patient.referPhysician,
+        list: feiYongShuJu.value,
+        orderNo: 3,
+      }
+      //在此处上传
+      ElMessageBox.confirm('共上传【' + feiYongShuJu.value.length + '】条', '请认真核对', {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+      })
+        .then(() => {
+          xiangMuFeiYongShangChuan(shangChuanFeiYong).then(() => {
+            feiYongShuJu.value = []
+            chargeCode.value = []
+          })
+        })
+        .catch(() => {})
+    }
+
+    const shanChuXiangMuClick = (val) => {
+      feiYongShuJu.value.splice(val, 1)
+      chargeCode.value.splice(val, 1)
+    }
+    // 新增项目或者药品
+    const xinZhengXiangMuDialog = ref(false)
+    // 判断查询药品还是项目
+    const xiangMuHuoYaoPinFlag = ref(0)
+    // 这个是远程查询数据后 保存
+    const xiangMuHuoYaoPinShuJu = ref([])
+    // 远程查询的
+    const chargeCodePy = ref('')
+
+    /**
+     * 远程搜索
+     */
+    const rmChargePyCode = (val) => {
+      if (val.length >= 2) {
+        queryDanGeXiangMu(val, xiangMuHuoYaoPinFlag.value).then((res) => {
+          xiangMuHuoYaoPinShuJu.value = res
+        })
+      }
+    }
+    // 单个费用
+    const danGeFeiYong = ref([])
+
+    // 获取单个费用录入 并且放入表格中选择
+    const getDanGeXiangMu = () => {
+      xiangMuHuoYaoPinShuJu.value.filter((item) => {
+        if (item.chargeCodeMx === chargeCodePy.value) {
+          item.deptCode = Cookie.get('dept')
+          danGeFeiYong.value = []
+          danGeFeiYong.value.push(item)
+        }
+      })
+    }
+
+    const danGeXiangMuBaoCun = () => {
+      if (chargeCodePy.value === '') {
+        return ElMessage.error({
+          showClose: true,
+          message: '请先选择一条费用',
+        })
+      }
+      for (let i = 0; i < chargeCode.value.length; i++) {
+        if (chargeCode.value[i] === danGeFeiYong.value[0].chargeCodeMx) {
+          return ElMessage.error({
+            showClose: true,
+            message: '请勿重复录入',
+          })
+        }
+      }
+      feiYongShuJu.value.push(danGeFeiYong.value[0])
+      chargeCode.value.push(danGeFeiYong.value[0].chargeCodeMx)
+      danGeFeiYong.value = []
+      chargeCodePy.value = ''
+    }
+
+    const xiangMuZongJia = computed(() => {
+      let sum = 0
+      for (let i = 0; i < feiYongShuJu.value.length; i++) {
+        sum += feiYongShuJu.value[i].chargeAmount * feiYongShuJu.value[i].amount
+      }
+      return sum.toFixed(2)
+    })
+
+    watch(
+      () => props.patient,
+      () => {
+        // 这里刚好是反着的
+        queryWard.value = props.patient.admissDept
+        getBingQuDuiYingKeShiChange()
+        setTimeout(() => {
+          queryDept.value = props.patient.zkWard
+        }, 100)
+      }
+    )
+    // 以下是保存模板
+    const baoCunMuBanDialog = ref(false)
+
+    const cunMuBanPojo = ref({
+      pyCode: '',
+      dcode: '',
+      name: '',
+      paiXu: '',
+      dept: '',
+      deptCode: Cookie.get('dept'),
+      list: [],
+    })
+
+    // 获取到保存模板的拼音码和五笔码
+    const zhuanPinYin = () => {
+      if (cunMuBanPojo.value.name !== '') {
+        getPyCode(cunMuBanPojo.value.name).then((res) => {
+          cunMuBanPojo.value.pyCode = res.pyCode
+          cunMuBanPojo.value.dcode = res.wbCode
+        })
+      }
+    }
+
+    const baoCunMuBan = () => {
+      if (feiYongShuJu.value.length === 0) {
+        ElMessage.error({
+          message: '请先选择项目',
+          showClose: true,
+        })
+        return
+      }
+      if (cunMuBanPojo.value.name === '' || cunMuBanPojo.value.pyCode === '' || cunMuBanPojo.value.dcode === '') {
+        ElMessage.error({
+          message: '模板名称,拼音码,五笔码不能为空',
+          showClose: true,
+        })
+        return
+      }
+      cunMuBanPojo.value.list = clone(feiYongShuJu.value)
+      // 开始上传
+      shangChuanMuBan(cunMuBanPojo.value).then(() => {
+        cunMuBanPojo.value = {}
+      })
+    }
+
+    // 根据病人的科室来获取
+    const getBingQuDuiYingKeShiChange = () => {
+      getBingQuDuiYingKeShi(queryWard.value).then((res) => {
+        xiaoKeShiList.value = res
+        queryDept.value = ''
+      })
+    }
+    const zhiXingKeShi = ref(Cookie.get('dept'))
+
+    const xieGaiZhiXingKeShi = () => {
+      for (let i = 0; i < feiYongShuJu.value.length; i++) {
+        feiYongShuJu.value[i].deptCode = zhiXingKeShi.value
+      }
+    }
+
+    return {
+      muBanData,
+      tableHeight,
+      muBanCurrentPage,
+      muBanHandleCurrentChange,
+      muBanPageSize,
+      getMuBanXinXiClick,
+      muBanXiangQing,
+      xuanZeXiangMuTable,
+      deptData,
+      feiYongShuJu,
+      getDatetime,
+      shangChuanXiangMu,
+      shanChuXiangMuClick,
+      xinZhengXiangMuDialog,
+      xiangMuHuoYaoPinFlag,
+      xiangMuHuoYaoPinShuJu,
+      chargeCodePy,
+      rmChargePyCode,
+      getDanGeXiangMu,
+      danGeFeiYong,
+      danGeXiangMuBaoCun,
+      wardData,
+      queryWard,
+      queryDept,
+      ssCode,
+      xiangMuZongJia,
+      baoCunMuBanDialog,
+      cunMuBanPojo,
+      zhuanPinYin,
+      baoCunMuBan,
+      getBingQuDuiYingKeShiChange,
+      panDuanSFWeiShouShuShi,
+      zhiXingKeShi,
+      xieGaiZhiXingKeShi,
+      xiaoKeShiList,
+    }
+  },
+}
+
+function panDuanSFWeiShouShuShi() {
+  let dept = Cookie.get('dept')
+  if (dept === '1300000' || dept === '3100000' || dept === '1300010') {
+    return true
+  }
+  return false
+}
+</script>
+
+<style></style>

+ 20 - 1
src/data/index.js

@@ -209,4 +209,23 @@ export const siDictTypes = [
   { code: 'delv_stas_codg', name: '配送状态' },
   { code: 'delver_geo_type', name: '配送位置经纬度类型' },
   { code: 'hilist_lmtpric_type', name: '医保目录限价类型' },
-]
+]
+
+export const tuiFeiLeiXin = [
+  { code: 0, name: '未退费' },
+  { code: 1, name: '已退费' },
+  { code: 2, name: '退费数据' },
+  { code: 3, name: '全部' },
+]
+
+export const yiZhuTuiFeiLeiXing = [
+  { code: 0, name: '住院费用' },
+  { code: 2, name: '全部' },
+  { code: 1, name: '医嘱' },
+  { code: 3, name: '医技' },
+]
+
+export const feiYongLeiXing = [
+  { code: 0, name: '项目' },
+  { code: 1, name: '药品' },
+]

+ 6 - 1
src/utils/permission.js

@@ -1,4 +1,3 @@
-import Cookies from 'js-cookie'
 import store from '../store'
 
 export function getGreatestRole() {
@@ -10,6 +9,12 @@ export function getGreatestRole() {
     if (roles.indexOf(2) > -1 || roles.indexOf('2') > -1) {
       return 2
     }
+    if (roles.indexOf(3) > -1 || roles.indexOf('3') > -1) {
+      return 3
+    }
+    if (roles.indexOf(5) > -1 || roles.indexOf('5') > -1) {
+      return 5
+    }
     if (roles.indexOf(8) > -1 || roles.indexOf('8') > -1) {
       return 8
     }

文件差異過大導致無法顯示
+ 0 - 6
src/utils/pingyin.js


+ 4 - 2
src/utils/request.js

@@ -1,5 +1,5 @@
 import axios from 'axios'
-import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
+import { ElMessage, ElMessageBox } from 'element-plus'
 import Cookies from 'js-cookie'
 import router from '@/router'
 import store from '@/store'
@@ -35,12 +35,14 @@ service.interceptors.response.use(
       return response.data
     }
     if (response.data.code === 201) {
-      ElNotification({
+      ElMessage({
         type: 'success',
         title: '成功',
         duration: 2800,
         dangerouslyUseHTMLString: true,
         message: response.data.message,
+        showClose: true,
+        offset: 130,
       })
       return response.data.data
     }

+ 1 - 1
src/utils/websocket.js

@@ -40,7 +40,7 @@ export function initWebSocket(sid) {
   webSocket.onmessage = function (e) {
     let data = JSON.parse(e.data)
     if (data.name === 'refreshToken') {
-      Cookies.set('token', data.token)
+      store.commit('user/tokenChange', data.token)
     } else if (data.name === 'systemNotification') {
       ElNotification({
         title: typeof data.title === 'undefined' ? '新消息' : data.title,

+ 14 - 51
src/views/hospitalization/TransferInOfExpenses.vue

@@ -109,6 +109,7 @@
           <el-table :height="windowHeight" highlight-current-row :data="mzXinXiList" @selection-change="mzSelectChecked" ref="multipleTable">
             <el-table-column label="门诊发票信息">
               <el-table-column label="项目名称" prop="itemName"></el-table-column>
+              <el-table-column label="收费编码" prop="chargeCode"></el-table-column>
               <el-table-column label="数量" prop="chargeAmount"></el-table-column>
               <el-table-column label="单价" prop="price"> </el-table-column>
               <el-table-column label="金额" prop="chargeFee"></el-table-column>
@@ -118,17 +119,13 @@
           <el-tag>合计:{{ mzSum }}</el-tag>
         </div>
         <div style="width: 9%; float: left; margin-left: 4px; text-align: center" :style="{ lineHeight: windowHeight + 'px' }">
-          <el-button size="mini" icon="el-icon-right" type="primary" @click="rightClick"></el-button>
+          <el-button size="mini" icon="el-icon-right" type="primary"></el-button>
         </div>
         <div style="float: right; width: 45%">
           <el-table :height="windowHeight" stripe :data="zyXinXiList">
             <el-table-column label="住院收费项目">
-              <el-table-column label="操作">
-                <template #default="scope">
-                  <el-button type="danger" size="mini" @click="shanChuZyFeiYong(scope.$index)">删除</el-button>
-                </template>
-              </el-table-column>
               <el-table-column label="项目名称" prop="itemName"></el-table-column>
+              <el-table-column label="收费编码" prop="chargeCode"></el-table-column>
               <el-table-column label="数量" prop="chargeAmount"></el-table-column>
               <el-table-column label="单价" prop="price"> </el-table-column>
               <el-table-column label="金额" prop="chargeFee"></el-table-column>
@@ -202,7 +199,7 @@
 </template>
 
 <script>
-import { ref, unref } from '@vue/reactivity'
+import { ref } from '@vue/reactivity'
 import { baoCunHuanZheZhuYuanFeiYong, getSerialNo, getZyJiMenZhenZhuangRuFeiYong, queryEntryName, queryHuanZhe, shanChuFeiYong } from '@/api/yibao/transfer-in-of-expenses'
 import { cptSex } from '@/utils/computed'
 import store from '@/store'
@@ -219,7 +216,7 @@ export default {
     //住院号
     const inpatientNo = ref('')
     //机制号
-    const serialNo = ref(null)
+    const serialNo = ref('')
     //是否查看历史记录
     const liShiFlag = ref(0)
     //收费代码
@@ -246,11 +243,9 @@ export default {
       queryHuanZhe(inpatientNo.value).then((res) => {
         huanZheXinXi.value = res
         admissTimes.value = res.admissTimes
-        console.log(res)
       })
     }
 
-    const lingShiShuJu = ref([])
     //查询机制号
     const querySerialNo = () => {
       if (!serialNo.value) {
@@ -262,49 +257,20 @@ export default {
         })
         return
       }
-      getSerialNo(serialNo.value, liShiFlag.value).then((res) => {
-        mzXinXiList.value = res
-        console.log(res)
-      })
+      getSerialNo(serialNo.value, liShiFlag.value)
+        .then((res) => {
+          mzXinXiList.value = res
+        })
+        .catch(() => {
+          mzXinXiList.value = []
+        })
     }
 
-    //用来保存uuid的数据 来判断用户是否 重复插入了
-    const uuidList = ref([])
     //定义用来删除 多选框的选中状态 以及点击选中多选框
     const multipleTable = ref(null)
     //点击多选框,把里面的内容添加进去
     const mzSelectChecked = (selection, row) => {
-      lingShiShuJu.value = selection
-    }
-    /**
-     * 点击向右 首先要判断 是否有重复的
-     * 1、把能确定唯一数据的值拼接起来 变成uuid
-     * 2、在用 indexOf 来判断 uuidList 里面是否存在 这个uuid
-     * 3、如果存在就不 push 不存在就 push
-     */
-    const rightClick = () => {
-      let flag = true
-      lingShiShuJu.value.forEach((item) => {
-        const uuid = item.chargeCode
-        if (uuidList.value.indexOf(uuid) === -1) {
-          unref(multipleTable).clearSelection()
-          uuidList.value.push(uuid)
-          zyXinXiList.value.push(item)
-        } else if (flag) {
-          flag = false
-          ElMessage({
-            type: 'error',
-            message: '无法添加相同项目',
-            showClose: true,
-            duration: 2500,
-          })
-        }
-      })
-    }
-    //删除 一条患者的费用
-    const shanChuZyFeiYong = (val) => {
-      zyXinXiList.value.splice(val, 1)
-      uuidList.value.splice(val, 1)
+      zyXinXiList.value = selection
     }
 
     //门诊发票信息 金额总和
@@ -406,10 +372,9 @@ export default {
           })
             .then(() => {
               huanZheXinXi.value.reqExecUnit = jsCookie.get('dept')
-              console.log(huanZheXinXi.value)
               baoCunHuanZheZhuYuanFeiYong(huanZheXinXi.value).then((res) => {
                 zyXinXiList.value = []
-                uuidList.value = []
+                mzXinXiList.value = []
               })
             })
             .catch(() => {})
@@ -452,9 +417,7 @@ export default {
       getZyJiMenZhenZhuangRuFeiYongClick,
       zyDetailChargeList,
       shanChuFeiYongClick,
-      rightClick,
       chargeCodeMX,
-      shanChuZyFeiYong,
       baoCunClick,
       multipleTable,
       remoteMethodEntryName,

+ 244 - 0
src/views/hospitalization/med-tec-mod/QueRenYiZhuShouFei.vue

@@ -0,0 +1,244 @@
+<template>
+  <el-container>
+    <el-header height="36px" style="margin-top: 8px">
+      住院号:<el-input size="mini" style="width: 160px" placeholder="请输入住院号" clearable v-model.trim="queryTerm.inpatientNo" @keyup.enter="getHuanZheXinXiClick"></el-input>
+      病房:<el-select size="mini" v-model="queryTerm.wardCode">
+        <el-option v-for="item in wardData" :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>
+      </el-select>
+      <el-divider direction="vertical"></el-divider>
+      <el-button size="mini" type="primary" icon="el-icon-search" @click="getHuanZheXinXiClick">查询</el-button>
+      <el-button size="mini" type="primary" icon="el-icon-refresh-left" @click="getXuQueFeiYiZhuClick">检索</el-button>
+      <el-select size="mini" v-model="chargeStatus" style="width: 120px; margin: auto 10px auto 10px">
+        <el-option v-for="item in chargeStatusData" :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>
+      </el-select>
+      <el-button size="mini" type="warning" @click="yiJianXiuGaiClick">一键修改</el-button>
+      <el-button size="mini" type="success" @click="baoCunYiZhuQueFeiClick" icon="el-icon-upload">保存</el-button>
+    </el-header>
+    <el-container>
+      <el-aside>
+        <el-table :data="huanZheYiZhuFeiYongData" :height="winHeight - 70" @row-click="getXuQueFeiXiangXiXinXiClick" highlight-current-row stripe>
+          <el-table-column prop="wardName" label="病区"></el-table-column>
+          <el-table-column prop="inpatientNo" label="住院号" width="90"></el-table-column>
+          <el-table-column prop="bedNo" label="床号" width="50"></el-table-column>
+          <el-table-column prop="name" label="姓名"></el-table-column>
+        </el-table>
+        <el-pagination
+          @current-change="changeYiZhuQueFei"
+          :current-page="queryTerm.currentPage"
+          :page-size="queryTerm.pageSize"
+          layout=" prev, pager, next,total"
+          :total="queryTerm.total"
+          style="margin-top: 5px"
+          :pager-count="5"
+          small
+        ></el-pagination>
+      </el-aside>
+      <el-main>
+        <span v-if="patient.inpatientNo != null">
+          <el-tag>住院号: {{ patient.inpatientNo }}</el-tag>
+          <el-tag type="warning">患者姓名: {{ patient.name }}</el-tag>
+          <el-tag>床号: {{ patient.bedNo }}</el-tag>
+          <el-tag type="warning">住院次数: {{ patient.admissTimes }}</el-tag>
+          <el-tag>性别: {{ cptSex(patient.sex) }}</el-tag>
+          <el-tag type="warning">病房: {{ patient.wardName }}</el-tag>
+          <el-tag>入院日期: {{ patient.admissDate }}</el-tag>
+          <el-tag type="warning">医保身份: {{ patient.responceTypeName }}</el-tag>
+          <el-tag>总费用: {{ patient.totalCharge }}</el-tag>
+        </span>
+        <el-table :data="queFeiXiangQingData" :height="winHeight - 120" highlight-current-row stripe>
+          <el-table-column label="费用详情">
+            <el-table-column label="确认">
+              <template #default="scope">
+                <el-select size="mini" v-model="scope.row.chargeStatus">
+                  <el-option v-for="item in chargeStatusData" :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>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column prop="inpatientNo" label="住院号"></el-table-column>
+            <el-table-column prop="bedNo" label="床号"></el-table-column>
+            <el-table-column prop="name" label="姓名"></el-table-column>
+            <el-table-column prop="occTime" label="医嘱日期" width="80"> </el-table-column>
+            <el-table-column prop="actOrderNo" label="医嘱号"></el-table-column>
+            <el-table-column prop="docotrName" label="医生"></el-table-column>
+            <el-table-column prop="orderName" label="医嘱名称"></el-table-column>
+            <el-table-column prop="chargeCode" label="项目编码"></el-table-column>
+            <el-table-column label="单价">
+              <template #default="scope">
+                {{ (scope.row.chargeFee / scope.row.orderCount).toFixed(2) }}
+              </template>
+            </el-table-column>
+            <el-table-column prop="orderCount" label="数量"></el-table-column>
+            <el-table-column prop="chargeFee" label="金额"></el-table-column>
+          </el-table-column>
+        </el-table>
+      </el-main>
+    </el-container>
+  </el-container>
+</template>
+
+<script>
+import { onMounted, ref } from 'vue'
+import { getHuanZheXinXi } from '@/api/zhu-yuan-yi-ji/yi-ji-fei-yong-lu-ru'
+import { getXuQueFeiYiZhu, getXuQueFeiXiangXiXinXi, baoCunYiZhuQueFeiShuJu } from '@/api/zhu-yuan-yi-ji/que-ren-yi-zhu-shou-fei'
+import { getWard } from '@/api/yibao/xiang-mu-lu-ru'
+import Cookie from 'js-cookie'
+import { cptSex } from '@/utils/computed'
+import store from '@/store'
+import { getDate } from '../../utils/date'
+import { ElMessage } from 'element-plus'
+export default {
+  setup() {
+    const windowSize = store.state.app.windowSize
+    const winHeight = windowSize.h
+
+    const dept = Cookie.get('dept')
+    const queryTerm = ref({
+      inpatientNo: '',
+      admissTimes: 0,
+      wardCode: '',
+      execUnit: dept,
+      currentPage: 1,
+      pageSize: 20,
+      total: 0,
+    })
+
+    // 患者信息
+    const patient = ref({})
+    // 病房信息
+    const wardData = ref([])
+    // 需要确费的信息
+    const huanZheYiZhuFeiYongData = ref([])
+    // 需要确费的详细信息
+    const queFeiXiangQingData = ref([])
+    // 操作
+    const chargeStatusData = ref([
+      { code: '0', name: '确认' },
+      { code: '1', name: '取消' },
+      { code: '3', name: '不操作' },
+    ])
+
+    const chargeStatus = ref('0')
+
+    /**
+     * 这个是查询当前病人的
+     */
+    const getHuanZheXinXiClick = () => {
+      // 这个三个参数是 住院号,是否在院 0 在 1 否 , 住院次数
+      getHuanZheXinXi(queryTerm.value.inpatientNo, 0, 0).then((res) => {
+        queryTerm.value.currentPage = 1
+        patient.value = res
+        queryTerm.value.admissTimes = res.admissTimes
+        queryTerm.value.wardCode = res.ward
+        getXuQueFeiYiZhu(queryTerm.value).then((res) => {
+          queryTerm.value.total = res.total
+          huanZheYiZhuFeiYongData.value = res.records
+        })
+      })
+    }
+
+    /**
+     * 这个的搜索是查看全部的
+     */
+    const getXuQueFeiYiZhuClick = () => {
+      queryTerm.value.inpatientNo = ''
+      queryTerm.value.admissTimes = 0
+      queryTerm.value.wardCode = ''
+      queryTerm.value.execUnit = dept
+      queryTerm.value.currentPage = 1
+      queryTerm.value.pageSize = 20
+      getXuQueFeiYiZhu(queryTerm.value).then((res) => {
+        huanZheYiZhuFeiYongData.value = res.records
+        queryTerm.value.total = res.total
+      })
+    }
+
+    const changeYiZhuQueFei = (val) => {
+      queryTerm.value.currentPage = val
+      getXuQueFeiYiZhu(queryTerm.value).then((res) => {
+        queryTerm.value.total = res.total
+        huanZheYiZhuFeiYongData.value = res.records
+      })
+    }
+
+    const getXuQueFeiXiangXiXinXiClick = (row) => {
+      patient.value = row
+      getXuQueFeiXiangXiXinXi(row.inpatientNo, row.admissTimes, dept)
+        .then((res) => {
+          queFeiXiangQingData.value = res
+        })
+        .catch(() => {
+          queFeiXiangQingData.value = []
+        })
+    }
+
+    const yiJianXiuGaiClick = () => {
+      queFeiXiangQingData.value.forEach((item) => {
+        item.chargeStatus = chargeStatus.value
+      })
+    }
+
+    const baoCunYiZhuQueFeiClick = () => {
+      if (queFeiXiangQingData.value.length <= 0) {
+        return ElMessage.error({
+          message: '请先选择需要确认收费的数据。',
+          showClose: true,
+        })
+      }
+      let shaungChuanData = {
+        inpatientNo: patient.value.inpatientNo,
+        admissTimes: patient.value.admissTimes,
+        list: queFeiXiangQingData.value,
+      }
+      baoCunYiZhuQueFeiShuJu(shaungChuanData).then((res) => {
+        getXuQueFeiXiangXiXinXi(patient.value.inpatientNo, patient.value.admissTimes, dept)
+          .then((res) => {
+            queFeiXiangQingData.value = res
+          })
+          .catch(() => {
+            queFeiXiangQingData.value = []
+          })
+      })
+    }
+
+    onMounted(() => {
+      getWard().then((res) => {
+        wardData.value = res
+      })
+      getXuQueFeiYiZhuClick()
+    })
+
+    return {
+      patient,
+      getHuanZheXinXiClick,
+      wardData,
+      cptSex,
+      queryTerm,
+      getXuQueFeiYiZhuClick,
+      huanZheYiZhuFeiYongData,
+      winHeight,
+      changeYiZhuQueFei,
+      getXuQueFeiXiangXiXinXiClick,
+      queFeiXiangQingData,
+      chargeStatusData,
+      chargeStatus,
+      getDate,
+      yiJianXiuGaiClick,
+      baoCunYiZhuQueFeiClick,
+    }
+  },
+}
+</script>
+
+<style></style>

+ 226 - 0
src/views/hospitalization/med-tec-mod/YiJiFeiYongLuRu.vue

@@ -0,0 +1,226 @@
+<template>
+  <el-container>
+    <el-header style="margin-top: 8px">
+      <el-tag effect="dark">住院号: {{ patient.inpatientNo }}</el-tag>
+      <el-tag effect="dark" type="warning">患者姓名: {{ patient.name }}</el-tag>
+      <el-tag effect="dark">床号: {{ patient.bedNo }}</el-tag>
+      <el-tag effect="dark" type="warning">住院次数: {{ patient.admissTimes }}</el-tag>
+      <el-tag effect="dark">性别: {{ cptSex(patient.sex) }}</el-tag>
+      <el-tag effect="dark" type="warning">病房: {{ patient.wardName }}</el-tag>
+      <el-tag effect="dark">入院日期: {{ patient.admissDate }}</el-tag>
+      <el-tag effect="dark" type="warning">医保身份: {{ patient.responceTypeName }}</el-tag>
+      <el-tag effect="dark">总费用: {{ patient.totalCharge }}</el-tag
+      ><br />
+      住院号:<el-input size="mini" style="width: 160px" placeholder="请输入住院号" v-model="queryTerm.inpatientNo" @keyup.enter="getHuanZheXinXiClick"></el-input>
+      <span v-show="queryTerm.zaiHuanChuYuan === 1">
+        住院次数:<el-input-number
+          size="mini"
+          :min="0"
+          :precision="0"
+          style="width: 60px"
+          placeholder="请输入住院次数"
+          v-model="queryTerm.admissTimes"
+          :controls="false"
+        ></el-input-number>
+      </span>
+      <el-divider direction="vertical"></el-divider>
+      <el-switch active-color="#ff4949" inactive-color="#13ce66" active-text="出院" inactive-text="在院" :active-value="1" :inactive-value="0" v-model="queryTerm.zaiHuanChuYuan">
+      </el-switch>
+      <el-divider direction="vertical"></el-divider>
+      项目名称:<el-select v-model="queryTerm.chargeCode" size="mini" remote filterable clearable :remote-method="remoteMethodChargeCode">
+        <el-option v-for="item in chargeCodeNameData" :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>
+      </el-select>
+      录入日期:<el-date-picker
+        type="daterange"
+        v-model="queryTerm.dateRange"
+        placeholder="选择日期"
+        size="mini"
+        style="width: 200px"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
+        :shortcuts="shortcuts"
+      ></el-date-picker>
+      <el-button
+        size="mini"
+        @click="queryTerm.riQiPaiXu === 'DESC' ? (queryTerm.riQiPaiXu = 'ASC') : (queryTerm.riQiPaiXu = 'DESC')"
+        type="success"
+        :icon="queryTerm.riQiPaiXu === 'DESC' ? 'el-icon-caret-bottom' : 'el-icon-caret-top'"
+        >{{ queryTerm.riQiPaiXu === 'DESC' ? '降序' : '升序' }}</el-button
+      >
+      <el-select style="width: 100px" size="mini" v-model="queryTerm.feiYongLeiXingCode">
+        <el-option v-for="item in feiYongLeiXing" :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>
+      </el-select>
+      <el-select v-model="queryTerm.orderNo" style="width: 100px" size="mini" @change="queryHuanZheFeiYong">
+        <el-option v-for="item in yiZhuTuiFeiLeiXing" :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>
+      </el-select>
+      <el-button size="mini" type="primary" @click="getHuanZheXinXiClick">查询</el-button>
+    </el-header>
+    <el-container>
+      <el-main style="margin-top: 10px">
+        <el-tabs v-model="elTabPane">
+          <el-tab-pane label="已录入费用" name="ylrfy">
+            <huan-zhe-fei-yong
+              :init="tableDataHuanZheFeiYong"
+              :patient="patient"
+              @queryFeiYong="getHuanZheXinXiClick"
+              @size="handleSizeChange"
+              @current="handleCurrentChange"
+            ></huan-zhe-fei-yong>
+          </el-tab-pane>
+          <el-tab-pane label="费用录入" name="fylr">
+            <xiang-mu-lu-ru :patient="patient"></xiang-mu-lu-ru>
+          </el-tab-pane>
+        </el-tabs>
+      </el-main>
+    </el-container>
+  </el-container>
+</template>
+
+<script>
+import { ref } from 'vue'
+import store from '@/store'
+import { getHuanZheXinXi } from '@/api/zhu-yuan-yi-ji/yi-ji-fei-yong-lu-ru'
+import { cptSex } from '@/utils/computed'
+import Cookie from 'js-cookie'
+import { getChargeCode } from '@/api/yibao/xiang-mu-lu-ru'
+import { getHuanZheFeiYong } from '../../api/yibao/xiang-mu-lu-ru'
+import HuanZheFeiYong from './components/HuanZheFeiYong.vue'
+import XiangMuLuRu from './components/YiJiXiangMuLuRu.vue'
+import { yiZhuTuiFeiLeiXing, feiYongLeiXing } from '@/data/index'
+import { shortcuts } from '@/data/shortcuts'
+import { getDateRangeFormatDate } from '../../utils/date'
+export default {
+  components: { HuanZheFeiYong, XiangMuLuRu },
+  name: 'yiJiFeiYongLuRu',
+  setup() {
+    const windowSize = store.state.app.windowSize
+    const windowHeigth = windowSize.h
+
+    const queryTerm = ref({
+      inpatientNo: '',
+      admissTimes: 0,
+      zaiHuanChuYuan: '',
+      dateRange: shortcuts[2].value,
+      riQiPaiXu: 'DESC',
+      chargeCode: '',
+      orderNo: 0,
+      feiYongLeiXingCode: 0,
+      dept: Cookie.get('dept') === '3100000' ? '' : Cookie.get('dept'),
+      currentPage: 1,
+      pageSize: 30,
+    })
+
+    const elTabPane = ref('ylrfy')
+    const patient = ref({})
+
+    const tableDataHuanZheFeiYong = ref([])
+
+    const getHuanZheXinXiClick = () => {
+      if (queryTerm.value.zaiHuanChuYuan === 0) {
+        queryTerm.value.admissTimes = 0
+      }
+      if (patient.inpatientNo === queryTerm.value.inpatientNo) {
+        queryHuanZheFeiYong()
+      } else {
+        getHuanZheXinXi(queryTerm.value.inpatientNo, queryTerm.value.zaiHuanChuYuan, queryTerm.value.admissTimes)
+          .then((res) => {
+            patient.value = res
+            queryTerm.value.admissTimes = res.admissTimes
+            queryHuanZheFeiYong()
+          })
+          .catch(() => {
+            patient.value = {}
+            tableDataHuanZheFeiYong.value = []
+          })
+      }
+    }
+
+    const queryHuanZheFeiYong = () => {
+      if (elTabPane.value !== 'ylrfy') return
+      let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
+      queryTerm.value.startTime = dateRangeS.stratTime
+      queryTerm.value.endTime = dateRangeS.endTime
+      queryTerm.value.currentPage = 1
+      getHuanZheFeiYong(queryTerm.value)
+        .then((res) => {
+          tableDataHuanZheFeiYong.value = res
+        })
+        .catch(() => {
+          tableDataHuanZheFeiYong.value = []
+        })
+    }
+
+    const handleHuanZheFeiYong = () => {
+      if (elTabPane.value !== 'ylrfy') return
+      let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
+      queryTerm.value.startTime = dateRangeS.stratTime
+      queryTerm.value.endTime = dateRangeS.endTime
+      getHuanZheFeiYong(queryTerm.value)
+        .then((res) => {
+          tableDataHuanZheFeiYong.value = res
+        })
+        .catch(() => {
+          tableDataHuanZheFeiYong.value = []
+        })
+    }
+
+    // 根据项目名称来查询
+    const chargeCodeNameData = ref([])
+
+    /**
+     * 远程搜索
+     */
+    const remoteMethodChargeCode = (val) => {
+      if (val.length >= 2) {
+        getChargeCode(val).then((res) => {
+          chargeCodeNameData.value = res
+        })
+      }
+    }
+
+    // 分页
+    const handleSizeChange = (val) => {
+      queryTerm.value.pageSize = val.val
+      handleHuanZheFeiYong()
+    }
+
+    const handleCurrentChange = (val) => {
+      queryTerm.value.currentPage = val.val
+      handleHuanZheFeiYong()
+    }
+
+    return {
+      windowHeigth,
+      queryTerm,
+      getHuanZheXinXiClick,
+      tableDataHuanZheFeiYong,
+      patient,
+      cptSex,
+      queryHuanZheFeiYong,
+      chargeCodeNameData,
+      remoteMethodChargeCode,
+      elTabPane,
+      yiZhuTuiFeiLeiXing,
+      shortcuts,
+      feiYongLeiXing,
+      handleSizeChange,
+      handleCurrentChange,
+    }
+  },
+}
+</script>
+
+<style></style>

+ 31 - 13
src/views/medical-insurance/inpatient/AdmRegistration.vue

@@ -2,7 +2,7 @@
   <el-container>
     <el-header height="35px">
       <el-button size="mini" type="primary" icon="el-icon-check" :disabled="submitDisabled" @click="submitPatientInfo"> 提交 </el-button>
-      <el-button v-if="isAdmin" size="mini" type="primary" icon="el-icon-document-delete" @click="revoke">撤销 </el-button>
+      <el-button v-if="greatestRole < 3 || greatestRole === 8" size="mini" type="primary" icon="el-icon-document-delete" @click="revoke">撤销 </el-button>
       <el-dropdown style="margin-left: 10px" trigger="click" @command="beforeReadCard">
         <el-button size="mini" type="primary">读卡<i class="el-icon-arrow-down el-icon--right"></i> </el-button>
         <template #dropdown>
@@ -17,6 +17,7 @@
       <el-button size="mini" type="success" icon="el-icon-bottom" @click="beforeCancelRegister">取消入院登记</el-button>
       <el-button type="warning" size="mini" icon="el-icon-edit" @click="beforeYbRegister(2)">入院信息变更</el-button>
       <el-button size="mini" type="success" icon="el-icon-s-claim" @click="xiangMuLuRuRouter">项目录入</el-button>
+      <el-button size="mini" type="danger" icon="el-icon-warning" @click="yiZhuTuiFeiClick" v-if="greatestRole < 8">医嘱退费</el-button>
     </el-header>
     <el-main>
       <div>
@@ -201,6 +202,9 @@
     <el-dialog v-model="openXmlr" title="项目录入" :fullscreen="true" @close="closeXiangMuLuRuDialog">
       <Xmlr :init="initProp" @closeXmlr="openXmlr = false" />
     </el-dialog>
+    <el-dialog v-model="openYiZhuTuiFei" title="医嘱退费" :fullscreen="true">
+      <YiZhuTuiFei :initYiZhu="initYiZhu" @closeYiZhuTuiFei="openYiZhuTuiFei = false" />
+    </el-dialog>
   </el-container>
 </template>
 
@@ -222,13 +226,15 @@ import { getGreatestRole } from '@/utils/permission'
 import { clone } from '@/utils/clone'
 import { getDiagTypes, getMedTypesByFlag } from '@/api/medical-insurance/si-dict'
 import { baseinfo } from '@/data/inpatient'
-import Xmlr from '@/views/hospitalization/XiangMuLuRu.vue'
+import Xmlr from '@/components/inpatient/XiangMuLuRu.vue'
+import YiZhuTuiFei from '@/components/inpatient/YiZhuTuiFei.vue'
 export default {
   components: {
     Xmlr,
+    YiZhuTuiFei,
   },
   setup() {
-    const isAdmin = getGreatestRole() < 10
+    const greatestRole = getGreatestRole()
     const patient = computed(() => {
       return baseinfo()
     })
@@ -544,15 +550,6 @@ export default {
         .catch(() => {})
     }
 
-    onMounted(() => {
-      getMedTypesByFlag('hospitalization').then((res) => {
-        medTypes.value = res
-      })
-      getDiagTypes().then((res) => {
-        diagTypes.value = res
-      })
-    })
-
     // 项目录入
     const openXmlr = ref(false)
     const initProp = ref(0)
@@ -564,8 +561,26 @@ export default {
       openXmlr.value = false
     }
 
+    // 医嘱退费
+    const initYiZhu = ref(0)
+    const openYiZhuTuiFei = ref(false)
+    const yiZhuTuiFeiClick = () => {
+      if (nullPatient()) return
+      initYiZhu.value += 1
+      openYiZhuTuiFei.value = true
+    }
+
+    onMounted(() => {
+      getMedTypesByFlag('hospitalization').then((res) => {
+        medTypes.value = res
+      })
+      getDiagTypes().then((res) => {
+        diagTypes.value = res
+      })
+    })
+
     return {
-      isAdmin,
+      greatestRole,
       patient,
       submitDisabled,
       sexes,
@@ -598,6 +613,9 @@ export default {
       formatYbRegisterDate,
       xiangMuLuRuRouter,
       closeXiangMuLuRuDialog,
+      yiZhuTuiFeiClick,
+      openYiZhuTuiFei,
+      initYiZhu,
     }
   },
 }

+ 14 - 1
src/views/medical-insurance/inpatient/DiscSettlement.vue

@@ -1,6 +1,7 @@
 <template>
   <el-container>
     <el-header height="35px">
+      <el-button size="mini" type="success" icon="el-icon-refresh-right" @click="rcvrcalcost"> 费用接收重算 </el-button>
       <el-button size="mini" type="primary" icon="el-icon-refresh-left" @click="showConventions"> 撤销检验项目 </el-button>
       <el-button size="mini" type="success" icon="el-icon-time" @click="fetchActOrders(1)">出院结算</el-button>
       <el-button size="mini" type="info" icon="el-icon-video-pause" @click="selectZjdzTime">中间断账</el-button>
@@ -221,7 +222,7 @@ import Cookies from 'js-cookie'
 import { computed, onMounted, reactive, ref, watchEffect } from 'vue'
 import store from '@/store'
 import { cptSex, cptOperation, cptDisDiagStatus } from '@/utils/computed'
-import { genDismissActOrder, getDisDiag } from '@/api/yibao/patient'
+import { genDismissActOrder, getDisDiag, receiveAndRecalculateCost } from '@/api/yibao/patient'
 import { dismissCalculate, getActOrders, selfPayDismiss } from '@/api/yibao/dismiss'
 import { getDatetime, formatDatetime } from '@/utils/date'
 import { nullPatient } from '@/utils/validate'
@@ -504,6 +505,17 @@ export default {
     const isKqk = computed(() => {
       return store.state.currentWard === '8000201'
     })
+    const rcvrcalcost = () => {
+      if (nullPatient()) return
+      receiveAndRecalculateCost(patient.value).then((res) => {
+        ElMessage({
+          type: 'success',
+          message: res,
+          duration: 2000,
+          showClose: true,
+        })
+      })
+    }
     onMounted(() => {
       if (patient.value.inpatientNo) {
         fecthDisDiags()
@@ -554,6 +566,7 @@ export default {
       confirmSelectDismissOrderDate,
       makeDismissOrder,
       isKqk,
+      rcvrcalcost,
     }
   },
 }

+ 2 - 2
src/views/medical-insurance/inpatient/InHospFeeUpload.vue

@@ -31,7 +31,7 @@
       <el-table :data="fees.xm" size="mini" stripe :height="feeTableHeight">
         <el-table-column prop="detailSn" label="流水号" width="80"></el-table-column>
         <el-table-column prop="chargeCodeMx" label="院内码" width="100"></el-table-column>
-        <el-table-column prop="chargeAmount" label="数量" width="80"></el-table-column>
+        <el-table-column prop="chargeAmount" label="数量" sortable width="80"></el-table-column>
         <el-table-column prop="chargeFee" label="金额" width="80"></el-table-column>
         <el-table-column prop="chargeDate" label="收费日期"></el-table-column>
         <el-table-column prop="ybCode" label="医保码"></el-table-column>
@@ -53,7 +53,7 @@
       <el-table :data="fees.yp" size="mini" stripe :height="feeTableHeight">
         <el-table-column prop="detailSn" label="流水号" width="80"></el-table-column>
         <el-table-column prop="chargeCodeMx" label="院内码" width="100"></el-table-column>
-        <el-table-column prop="chargeAmount" label="数量" width="80"></el-table-column>
+        <el-table-column prop="chargeAmount" label="数量" sortable width="80"></el-table-column>
         <el-table-column prop="chargeFee" label="金额" width="80"></el-table-column>
         <el-table-column prop="chargeDate" label="收费日期"></el-table-column>
         <el-table-column prop="ybCode" label="医保码"></el-table-column>

部分文件因文件數量過多而無法顯示