Browse Source

草药问题

xiaochan 1 year ago
parent
commit
68baee3a31

+ 58 - 46
src/components/zhu-yuan-yi-sheng/cao-yao-yi-zhu/CaoYaoMuBan.vue

@@ -1,61 +1,69 @@
 <template>
-    <el-dialog v-model="dialog" title="取模板" width="60%" @close="emits('close')">
-        <el-container>
-            <el-aside style="width: 210px">
-                <el-input v-model="queryName" placeholder="模板名称" style="width: 120px"></el-input>
-                <el-button @click="dianJiaChaXunMuBan(0)">查询</el-button>
-                <el-table :data="muBanShuJu.muBan" :height="innerHeight / 2.1" @row-click="dianJiChaKanMuBanXiangQing">
-                    <el-table-column label="名称" prop="patternName"></el-table-column>
-                    <el-table-column label="操作">
-                        <template #default="scope">
-                            <el-button circle icon="Delete" type="danger"
-                                       @click="dianJiShanChuMuBan(scope.row, scope.$index)"></el-button>
-                        </template>
-                    </el-table-column>
-                </el-table>
-                <el-pagination
-                        :pager-count="5"
-                        small
-                        :total="muBanShuJu.total"
-                        layout="prev, pager, next"
-                        :current-page="muBanShuJu.currentPage"
-                        :page-size="muBanShuJu.pageSize"
-                        @current-change="handleCurrentChange"/>
-            </el-aside>
-            <el-main>
-                <el-button :disabled="muBanShuJu.xuanZhongShuJu.length === 0"
-                           @click="emits('xuanZhongShuJu', muBanShuJu.xuanZhongShuJu)">确定
-                </el-button>
-                <el-table :data="muBanShuJu.muBanXiangQing" :height="innerHeight / 2.1"
-                          @selection-change="huoQuMuBanXuanZhongShuJu">
-                    <el-table-column type="selection"></el-table-column>
-                    <el-table-column label="编码" prop="chargeCode"></el-table-column>
-                    <el-table-column label="名称" prop="chargeCodeName"></el-table-column>
-                    <el-table-column label="规格" prop="specification"></el-table-column>
-                    <el-table-column label="数量" prop="quantity"></el-table-column>
-                    <el-table-column label="单价" prop="retprice"></el-table-column>
-                    <el-table-column label="药房" prop="groupNo"></el-table-column>
-                    <el-table-column label="包装大小" prop="serial">
-                        <template #default="scope">
-                            <span v-if="scope.row.serial === '01'">小包装</span>
-                            <span v-else-if="scope.row.serial === '99'">大包装</span>
-                        </template>
-                    </el-table-column>
-                </el-table>
-            </el-main>
-        </el-container>
-    </el-dialog>
+  <CyDialog
+      title="模板"
+      body-height="500px"
+      body-width="50%"
+      :confirm-click="handelConfirmClick"
+  >
+    <div class="layout_container layout-horizontal">
+      <aside style="width: 190px" class="layout_container layout_el-table">
+        <div>
+          <el-input v-model="queryName" placeholder="模板名称" style="width: 120px"></el-input>
+          <el-button @click="dianJiaChaXunMuBan(0)">查询</el-button>
+        </div>
+        <el-table :data="muBanShuJu.muBan" @row-click="dianJiChaKanMuBanXiangQing">
+          <el-table-column label="名称" prop="patternName"></el-table-column>
+          <el-table-column label="操作">
+            <template #default="scope">
+              <el-button circle icon="Delete" type="danger"
+                         @click="dianJiShanChuMuBan(scope.row, scope.$index)"></el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <el-pagination
+            :pager-count="5"
+            small
+            :total="muBanShuJu.total"
+            layout="prev, pager, next"
+            :current-page="muBanShuJu.currentPage"
+            :page-size="muBanShuJu.pageSize"
+            @current-change="handleCurrentChange"/>
+      </aside>
+      <div class="layout_main layout_el-table">
+        <el-table :data="muBanShuJu.muBanXiangQing"
+                  @selection-change="huoQuMuBanXuanZhongShuJu">
+          <el-table-column type="selection"></el-table-column>
+          <el-table-column label="编码" prop="chargeCode"></el-table-column>
+          <el-table-column label="名称" prop="chargeCodeName"></el-table-column>
+          <el-table-column label="规格" prop="specification"></el-table-column>
+          <el-table-column label="数量" prop="quantity"></el-table-column>
+          <el-table-column label="单价" prop="retprice"></el-table-column>
+          <el-table-column label="药房" prop="groupNo"></el-table-column>
+          <el-table-column label="包装大小" prop="serial">
+            <template #default="scope">
+              <span v-if="scope.row.serial === '01'">小包装</span>
+              <span v-else-if="scope.row.serial === '99'">大包装</span>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+  </CyDialog>
 </template>
 
 <script setup>
 import {onMounted, ref} from 'vue'
 import {huoQuMuBan, muBanXiangQing, shanChuMuBan} from '@/api/zhu-yuan-yi-sheng/cao-yao-yi-zhu'
 import {ElMessageBox} from 'element-plus'
+import {useUserStore} from "@/pinia/user-store";
+import CyDialog from "@/components/cy/dialog/src/CyDialog.vue";
 
 const emits = defineEmits(['close', 'xuanZhongShuJu'])
 
 const innerHeight = window.innerHeight
 
+const userStore = useUserStore().userInfo
+
 const queryName = ref('')
 const muBanShuJu = ref({
   muBan: [],
@@ -103,6 +111,10 @@ const huoQuMuBanXuanZhongShuJu = (val) => {
   muBanShuJu.value.xuanZhongShuJu = val
 }
 
+function handelConfirmClick(next) {
+  emits('xuanZhongShuJu', muBanShuJu.value.xuanZhongShuJu, next)
+}
+
 onMounted(() => {
   dianJiaChaXunMuBan(0)
 })

+ 1 - 7
src/layout/LayoutRouterView.vue

@@ -1,15 +1,9 @@
-<script setup lang="ts">
-import {getKeepAliveNames} from "@/pinia/use-tabs";
-</script>
-
 <template>
   <router-view v-slot="{ Component }">
     <transition name="fade-transform" mode="out-in">
-      <keep-alive :include="getKeepAliveNames">
+      <keep-alive>
         <component :is="Component"/>
       </keep-alive>
     </transition>
   </router-view>
 </template>
-
- 

+ 13 - 4
src/views/hospitalization/zhu-yuan-yi-sheng/cao-yao-yi-zhu/XinZhengCaoYao.vue

@@ -2,7 +2,7 @@
   <CyFlex content-size>
     <template #header>
       <div>
-        <el-button type="primary" @click="muBanZuJian = true">取模板</el-button>
+        <el-button type="primary" @click="openCaoYaoTemplate">取模板</el-button>
         <el-button :disabled="mingXi.list.length === 0" type="success" @click="cunMuBan.dialog = true">存模板
         </el-button>
         <el-divider direction="vertical"></el-divider>
@@ -171,7 +171,8 @@
   </CyFlex>
 
   <!-- 获取草药模板 -->
-  <cao-yao-mu-ban v-if="muBanZuJian" @close="muBanZuJian = false"
+  <cao-yao-mu-ban v-if="muBanZuJian"
+                  @close="muBanZuJian = false"
                   @xuanZhongShuJu="dianJiXuanZhongMuBanShuJu"></cao-yao-mu-ban>
   <!-- 下面是新增模板 -->
   <el-dialog v-model="cunMuBan.dialog" center title="存模板">
@@ -208,6 +209,7 @@ import Dig from "@/utils/math";
 import CyFlex from "@/components/cy/flex/src/CyFlex.vue";
 import CyComboGrid from "@/components/cy/combo-grid/src/CyComboGrid.vue";
 import {useUserStore} from "@/pinia/user-store";
+import useDialogToJs from "@/components/js-dialog-comp/useDialogToJs";
 
 const props = defineProps({
   saveSuccess: Function
@@ -353,7 +355,7 @@ watch(
  */
 const muBanZuJian = ref(false)
 
-const dianJiXuanZhongMuBanShuJu = (data) => {
+const dianJiXuanZhongMuBanShuJu = (data, next) => {
   let flag = false
   for (let item of data) {
     if (item.groupNo !== chuFang.value.groupNo) {
@@ -372,6 +374,7 @@ const dianJiXuanZhongMuBanShuJu = (data) => {
       mingXi.value.weiYi.push(key)
     }
   })
+  next()
   if (flag) {
     ElMessage({
       showClose: true,
@@ -497,6 +500,12 @@ const clearHerbalInformation = () => {
   chuFang.value.orderName = chuFang.value.groupNo === '81' ? '草药' : '中药颗粒'
 }
 
+function openCaoYaoTemplate() {
+  useDialogToJs(CaoYaoMuBan, {
+    onXuanZhongShuJu: dianJiXuanZhongMuBanShuJu
+  })
+}
+
 onChangePatient(() => {
   chuFang.value.execDept = huanZheXinXi.value.smallDept || ""
 })
@@ -507,7 +516,7 @@ onMounted(() => {
   })
 })
 
-let jiaShuiLeiXing = [
+const jiaShuiLeiXing = [
   {code: '加凉水', name: '加凉水'},
   {code: '加温水', name: '加温水'},
   {code: '加开水', name: '加开水'},