Browse Source

小优化

xiaochan 5 months ago
parent
commit
f9ae438228

+ 10 - 1
src/api/inpatient/xiang-mu-lu-ru.js

@@ -92,6 +92,10 @@ export function getDept() {
     });
 }
 
+/**
+ * 
+ * @returns {Promise<any[]>}
+ */
 export function getWard() {
     return request({
         url: "/xmlr/getWard",
@@ -112,6 +116,11 @@ export function getPyCode(inputStr) {
     });
 }
 
+/**
+ * 
+ * @param {string} ward 
+ * @returns {Promise<any[]>}
+ */
 export function getBingQuDuiYingKeShi(ward) {
     return request({
         url: "/xmlr/getBingQuDuiYingKeShi",
@@ -234,7 +243,7 @@ export function getPatientInfo(patNo, times) {
 /**
  *
  * @param data
- * @return {Promise<{data: any[] , total: number}>}
+ * @return {Promise<{data: any[] , feeTotal: number}>}
  */
 export function getFee(data) {
     return request({

+ 14 - 12
src/components/xmlr/components/projectInput/FeeInput.vue

@@ -1,4 +1,4 @@
-<script setup lang="ts">
+<script setup lang="tsx">
 import { key, ProjectInput } from "@/components/xmlr/index";
 import SystemStaffSelect from "@/components/system/staff-select/SystemStaffSelect.vue";
 import SystemDeptSelect from "@/components/system/dept-select/SystemDeptSelect.vue";
@@ -81,11 +81,13 @@ function handleSave() {
   };
 
   ElMessageBox.confirm(
-    "共上传【" + saveData.value.length + "】条",
+    `住院号:${store.patInfo.inpatientNo}<br />姓名:${store.patInfo.name}<br />共:${saveData.value.length}条费用`,
     "请认真核对",
     {
+      type: "info",
       cancelButtonText: "取消",
       confirmButtonText: "确定",
+      dangerouslyUseHTMLString: true,
     }
   ).then(() => {
     xiangMuFeiYongShangChuan(shangChuanFeiYong).then(() => {
@@ -116,7 +118,7 @@ function handleDoctor({ row }) {
 
 function getBingQuDuiYingKeShiChange() {
   getBingQuDuiYingKeShi(store.queryWard).then(res => {
-    xiaoKeShiList.value = res as any[];
+    xiaoKeShiList.value = res;
   });
   store.queryDept = "";
 }
@@ -127,7 +129,7 @@ function getSummaries(param) {
   data.forEach(value => {
     sum += value.chargeAmount * value.amount;
   });
-  return ["", "", sum];
+  return ["", "", "", sum + "元"];
 }
 
 function operationRoom() {
@@ -194,17 +196,17 @@ onMounted(() => {
   <div class="layout_container" style="padding-left: 5px">
     <header>
       <el-button icon="Document" type="warning" @click="handleSaveTemplate"
-        >存模板</el-button
-      >
+        >存模板
+      </el-button>
       <el-button icon="Upload" type="primary" @click="handleSave"
-        >保存</el-button
-      >
+        >保存
+      </el-button>
       <el-button icon="Plus" type="success" @click="openNewDialog"
-        >新增</el-button
-      >
+        >新增
+      </el-button>
       <el-button icon="Tickets" type="info" @click="openScanCodeGun"
-        >扫码枪</el-button
-      >
+        >扫码枪
+      </el-button>
       <template v-if="medicalTechnology">
         病区:
         <el-select

+ 4 - 4
src/components/xmlr/index.ts

@@ -29,6 +29,7 @@ type ChargeCodeType = {
     deptCode: string;
     chargeAmount: number;
     amount: number;
+    doctorCode: string
 };
 
 export type XmlrProps = {
@@ -53,7 +54,7 @@ export const useXmlr = (props: XmlrProps, emits: UseDialogType.Emits) => {
             chargeType: 0,
             feeSources: 2,
             refundSymbol: 3,
-            execDept: props.medicalTechnology ? userInfo.deptCode : "",
+            execDept: props.medicalTechnology ? isDev ? "" : userInfo.deptCode : "",
         },
         tabsVal: "费用",
 
@@ -103,7 +104,7 @@ export const useXmlr = (props: XmlrProps, emits: UseDialogType.Emits) => {
                 ...store.searchFeeParams
             }).then(res => {
                 store.feeData = res.data
-                store.feeTotal = res.total;
+                store.feeTotal = res.feeTotal;
             })
         },
         clearData() {
@@ -134,8 +135,7 @@ export const useXmlr = (props: XmlrProps, emits: UseDialogType.Emits) => {
         },
         feeTableSummaryMethod() {
             const tmp = [];
-            tmp[9] = store.feeTotal;
-            console.log(store.feeTotal)
+            tmp[9] = `${store.feeTotal} 元`;
             return tmp
         },
     }

+ 100 - 96
vite.config.js

@@ -1,118 +1,122 @@
-import {defineConfig, loadEnv} from "vite";
+import { defineConfig, loadEnv } from "vite";
 import vue from "@vitejs/plugin-vue";
-import {resolve} from "path";
+import { resolve } from "path";
 // vue setup 的糖语法
 import VueSetupExtend from "vite-plugin-vue-setup-extend";
 // 不用导入 vue 的 import 了
 import AutoImport from "unplugin-auto-import/vite";
 import Icons from "unplugin-icons/vite";
 import vueJsx from "@vitejs/plugin-vue-jsx";
-import {createHtmlPlugin} from "vite-plugin-html";
+import { createHtmlPlugin } from "vite-plugin-html";
 import pkg from "./package.json";
 
 const pathResolve = dir => {
-    return resolve(__dirname, ".", dir);
+  return resolve(__dirname, ".", dir);
 };
 
 const alias = {
-    "@": pathResolve("src"),
+  "@": pathResolve("src"),
 };
 
-export default defineConfig(({mode}) => {
-    const ENV = loadEnv(mode, process.cwd());
-    const GLOB_CONFIG_FILE_NAME = "_app.config.js";
+export default defineConfig(({ mode }) => {
+  const ENV = loadEnv(mode, process.cwd());
+  const GLOB_CONFIG_FILE_NAME = "_app.config.js";
 
-    const isBuild = mode === "production";
-    const getAppConfigSrc = () => {
-        return `/${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}`;
-    };
+  const isBuild = mode === "production";
+  const getAppConfigSrc = () => {
+    return `/${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}`;
+  };
 
-    return {
-        define: {
-            __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "true",
-        },
-        esbuild: {
-            jsxFactory: "h",
-            jsxFragment: "Fragment",
-        },
-        externals: {
-            BMap: "BMap",
-            BMapLib: "BMapLib",
+  return {
+    define: {
+      __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "true",
+    },
+    esbuild: {
+      jsxFactory: "h",
+      jsxFragment: "Fragment",
+    },
+    externals: {
+      BMap: "BMap",
+      BMapLib: "BMapLib",
+    },
+    resolve: {
+      alias,
+      extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"],
+    },
+    plugins: [
+      Icons({
+        autoInstall: true,
+        compiler: "vue3",
+      }),
+      VueSetupExtend({ name: false }),
+      vue(),
+      vueJsx(),
+      AutoImport({
+        dts: "src/auto-imports.d.ts",
+        imports: ["vue"],
+      }),
+      createHtmlPlugin({
+        minify: isBuild,
+        inject: {
+          data: {
+            title: "",
+          },
+          // Embed the generated app.config.js file
+          tags: isBuild
+            ? [
+                {
+                  tag: "script",
+                  attrs: {
+                    src: getAppConfigSrc(),
+                  },
+                },
+              ]
+            : [],
         },
-        resolve: {
-            alias,
-            extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"],
+      }),
+    ],
+    server: {
+      host: "0.0.0.0",
+      port: 3000,
+      proxy: {
+        "/emr": {
+          //这里配置运行时服务地址
+          target: "http://172.16.32.125:8001/emr",
+          secure: false, //如果运行时服务是https,此处配置为true
+          changeOrigin: true, //支持跨域调用,这里配置为true
+          rewrite: path => path.replace(/^\/emr/, ""),
         },
-        plugins: [
-            Icons({
-                autoInstall: true,
-                compiler: "vue3",
-            }),
-            VueSetupExtend({name: false}),
-            vue(),
-            vueJsx(),
-            AutoImport({
-                dts: "src/auto-imports.d.ts",
-                imports: ["vue"],
-            }),
-            createHtmlPlugin({
-                minify: isBuild,
-                inject: {
-                    data: {
-                        title: "",
-                    },
-                    // Embed the generated app.config.js file
-                    tags: isBuild
-                        ? [
-                            {
-                                tag: "script",
-                                attrs: {
-                                    src: getAppConfigSrc(),
-                                },
-                            },
-                        ]
-                        : [],
-                },
-            }),
-        ],
-        server: {
-            host: "0.0.0.0",
-            port: 3000,
-            proxy: {
-                "/emr": {
-                    //这里配置运行时服务地址
-                    target: "http://172.16.32.125:8001/emr",
-                    secure: false, //如果运行时服务是https,此处配置为true
-                    changeOrigin: true, //支持跨域调用,这里配置为true
-                    rewrite: path => path.replace(/^\/emr/, ""),
-                },
-                "/doctorSignatureImage": {
-                    target: "http://172.16.32.167:8077",
-                    secure: false, //如果运行时服务是https,此处配置为true
-                    changeOrigin: true, //支持跨域调用,这里配置为true
-                },
-                "/thyyarchive": {
-                    target: "http://172.16.32.197:9202/",
-                    secure: false,
-                    changeOrigin: true,
-                    rewrite: path => path.replace(/^\/thyyarchive/, ""),
-                },
-            },
+        "/doctorSignatureImage": {
+          target: "http://172.16.32.167:8077",
+          secure: false, //如果运行时服务是https,此处配置为true
+          changeOrigin: true, //支持跨域调用,这里配置为true
         },
-        build: {
-            chunkSizeWarningLimit: 1000,
-            outDir: "release/dist",
-            rollupOptions: {
-                output: {
-                    // monaco-editor-DPcKYIc8.js
-                    manualChunks(id) {
-                        if (id.includes('node_modules')) {
-                            return id.toString().split('node_modules/')[1].split('/')[0].toString();
-                        }
-                        return null;
-                    },
-                }
-            }
+        "/thyyarchive": {
+          target: "http://172.16.32.197:9202/",
+          secure: false,
+          changeOrigin: true,
+          rewrite: path => path.replace(/^\/thyyarchive/, ""),
         },
-    };
+      },
+    },
+    build: {
+      chunkSizeWarningLimit: 1000,
+      outDir: "release/dist",
+      // 优化打包把第三方的东西每次打包时都不重复
+      // rollupOptions: {
+      //   output: {
+      //     manualChunks(id) {
+      //       if (id.includes("node_modules")) {
+      //         return id
+      //           .toString()
+      //           .split("node_modules/")[1]
+      //           .split("/")[0]
+      //           .toString();
+      //       }
+      //       return null;
+      //     },
+      //   },
+      // },
+    },
+  };
 });