xiaochan 5 mesiacov pred
rodič
commit
1f173d2289

+ 7 - 0
.prettierrc

@@ -0,0 +1,7 @@
+{
+  "trailingComma": "es5",
+  "jsxBracketSameLine": false, 
+  "singleQuote": false,
+  "arrowParens": "avoid",
+  "semicolons": true
+}

+ 0 - 7
.prettierrc.js

@@ -1,7 +0,0 @@
-module.exports = {
-  trailingComma: 'es5', // 是否使用尾逗号,有三个可选值"<none|es5|all>"
-  jsxBracketSameLine: false, // 在jsx中把'>' 是否单独放一行
-  singleQuote: false,
-  arrowParens: 'avoid',
-  semicolons: true,
-}

+ 37 - 31
src/components/xmlr/components/HeaderInfo.vue

@@ -1,49 +1,63 @@
 <script setup lang="tsx">
-import {key, ProjectInput} from "@/components/xmlr/index";
-import {getListOfDischargedPatients} from "@/api/zhu-yuan-yi-sheng/emr-patient";
-import {useDialog} from "@/components/cy/CyDialog/index";
+import { key, ProjectInput } from "@/components/xmlr/index";
+import { getListOfDischargedPatients } from "@/api/zhu-yuan-yi-sheng/emr-patient";
+import { useDialog } from "@/components/cy/CyDialog/index";
 import DisPatientList from "@/components/xmlr/dialog/DisPatientList.vue";
 
-const {store, mutation, medicalTechnology} = inject(key) as ProjectInput
+const { store, mutation, medicalTechnology } = inject(key) as ProjectInput;
 
 const infoKeyValue = [
-  {key: "name", value: "姓名"},
-  {key: "bedNo", value: "床号"},
-  {key: "sexName", value: "性别"},
-  {key: "admissDate", value: "入院日期"},
-  {key: "responceTypeName", value: "医保身份"},
-  {key: "totalCharge", value: "总费用"}
-]
+  { key: "name", value: "姓名" },
+  { key: "bedNo", value: "床号" },
+  { key: "sexName", value: "性别" },
+  { key: "admissDate", value: "入院日期" },
+  { key: "responceTypeName", value: "医保身份" },
+  { key: "totalCharge", value: "总费用" },
+];
 
 async function getDisList() {
   if (!store.searchPatNo) {
-    return
+    return;
   }
-  const data = await getListOfDischargedPatients(store.searchPatNo)
+  const data = await getListOfDischargedPatients(store.searchPatNo);
   await useDialog(DisPatientList, {
     dialogProps: {
-      title: "出院患者信息"
+      title: "出院患者信息",
     },
     params: {
-      data
-    }
+      data,
+    },
   }).then(res => {
     store.searchPatNo = res.inpatientNo;
     mutation.getPatInfo(res.admissTimes);
-  })
+  });
 }
 </script>
 
 <template>
   <header>
     住院号:
-    <el-input v-model="store.searchPatNo" style="width: 120px;" clearable
-              @keydown.enter="() => mutation.getPatInfo(null)"/>
-    <el-divider direction="vertical"/>
-    <el-button icon="Search" type="primary" @click="() => mutation.getPatInfo(null)">查询</el-button>
+    <el-input
+      v-model="store.searchPatNo"
+      style="width: 120px"
+      clearable
+      @keydown.enter="() => mutation.getPatInfo(null)"
+    />
+    <el-divider direction="vertical" />
+    <el-button
+      icon="Search"
+      type="primary"
+      @click="() => mutation.getPatInfo(null)"
+      >查询</el-button
+    >
     <el-button type="info" @click="getDisList">出院</el-button>
-    <el-button v-if="!medicalTechnology" type="danger" @click="mutation.closeDialog">关闭</el-button>
-    <el-divider direction="vertical"/>
+    <el-button
+      v-if="!medicalTechnology"
+      type="danger"
+      @click="mutation.closeDialog"
+      >关闭</el-button
+    >
+    <el-divider direction="vertical" />
     <el-space>
       <el-tag v-for="item in infoKeyValue">
         {{ item.value }}:{{ store.patInfo?.[item.key] }}
@@ -51,11 +65,3 @@ async function getDisList() {
     </el-space>
   </header>
 </template>
-
-<style lang="scss">
-.xmlrv2-hide-descriptions {
-  .el-descriptions__body {
-    display: none;
-  }
-}
-</style>

+ 4 - 4
src/components/xmlr/components/TableFee.vue

@@ -75,7 +75,7 @@ function rcvrcalcost() {
           <el-input v-model="store.searchFeeParams.orderNo" clearable style="width: 95px"/>
         </el-form-item>
         <el-form-item label="录入时间">
-          <CyDateRange v-model="store.searchFeeParams" :shortcuts-index="isDev ? null : 0"/>
+          <CyDateRange v-model="store.searchFeeParams" :shortcuts-index="isDev ? 0 : 0"/>
         </el-form-item>
         <el-form-item label="日期">
           <el-switch v-model="store.searchFeeParams.orderBy" active-text="升序" inactive-text="降序"/>
@@ -115,9 +115,9 @@ function rcvrcalcost() {
     <div class="layout_main">
       <el-table
           height="100%"
-          @row-click="(row) =>{
-            feeTableRef.toggleRowSelection(row)
-          }"
+          @row-click="(row) => {feeTableRef.toggleRowSelection(row)}"
+          :summary-method="mutation.feeTableSummaryMethod"
+          show-summary
           border
           ref="feeTableRef"
           row-key="detailSn"

+ 153 - 108
src/components/xmlr/components/projectInput/FeeInput.vue

@@ -1,32 +1,44 @@
 <script setup lang="ts">
-import {key, ProjectInput} from "@/components/xmlr/index";
+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";
-import {ElMessageBox} from "element-plus";
+import { ElMessageBox } from "element-plus";
 import XEUtils from "xe-utils";
-import {getBingQuDuiYingKeShi, getWard, xiangMuFeiYongShangChuan} from "@/api/inpatient/xiang-mu-lu-ru";
-import {useUserStore} from "@/pinia/user-store";
-import {stringIsBlank, stringNotBlank} from "@/utils/blank-utils";
-import {BizException, ExceptionEnum} from "@/utils/BizException";
+import {
+  getBingQuDuiYingKeShi,
+  getWard,
+  xiangMuFeiYongShangChuan,
+} from "@/api/inpatient/xiang-mu-lu-ru";
+import { useUserStore } from "@/pinia/user-store";
+import { stringIsBlank, stringNotBlank } from "@/utils/blank-utils";
+import { BizException, ExceptionEnum } from "@/utils/BizException";
 import SaveTemplate from "@/components/xmlr/dialog/SaveTemplate.vue";
-import {useDialog} from "@/components/cy/CyDialog/index";
+import { useDialog } from "@/components/cy/CyDialog/index";
 import NewDialog from "@/components/xmlr/dialog/NewDialog.vue";
-import {xcMessage} from "@/utils/xiaochan-element-plus";
+import { xcMessage } from "@/utils/xiaochan-element-plus";
 import ScanCodeGun from "@/components/xmlr/dialog/ScanCodeGun.vue";
+import { isDev } from "@/utils/public";
 
-const {saveData, saveProxy, store, muBanRef, medicalTechnology} = inject(key) as ProjectInput
+const { saveData, saveProxy, store, muBanRef, medicalTechnology } = inject(
+  key
+) as ProjectInput;
 
-const wardData = ref([])
-const xiaoKeShiList = ref([])
+const wardData = ref([]);
+const xiaoKeShiList = ref([]);
 
-const ssCode = ref('')
+const ssCode = ref("");
 
 const userStore = useUserStore().userInfo;
 
 function handleSave() {
   if (!medicalTechnology) {
-    if (store.patInfo.ward !== userStore.deptCode) {
-      BizException(ExceptionEnum.LOGICAL_ERROR, "患者已不在您所处的科室,无法录入。");
+    if (!isDev) {
+      if (store.patInfo.ward !== userStore.deptCode && !isDev) {
+        BizException(
+          ExceptionEnum.LOGICAL_ERROR,
+          "患者已不在您所处的科室,无法录入。"
+        );
+      }
     }
   }
 
@@ -39,13 +51,13 @@ function handleSave() {
   }
 
   if (
-      operationRoom() &&
-      stringNotBlank(ssCode.value) &&
-      !XEUtils.isStringNumber(ssCode.value)
+    operationRoom() &&
+    stringNotBlank(ssCode.value) &&
+    !XEUtils.isStringNumber(ssCode.value)
   ) {
     BizException(
-        ExceptionEnum.LOGICAL_ERROR,
-        "手术编码必须纯数字且中间不得有空格。"
+      ExceptionEnum.LOGICAL_ERROR,
+      "手术编码必须纯数字且中间不得有空格。"
     );
   }
 
@@ -69,52 +81,55 @@ function handleSave() {
   };
 
   ElMessageBox.confirm(
-      "共上传【" + saveData.value.length + "】条",
-      "请认真核对",
-      {
-        cancelButtonText: "取消",
-        confirmButtonText: "确定",
-      }
+    "共上传【" + saveData.value.length + "】条",
+    "请认真核对",
+    {
+      cancelButtonText: "取消",
+      confirmButtonText: "确定",
+    }
   ).then(() => {
     xiangMuFeiYongShangChuan(shangChuanFeiYong).then(() => {
       saveProxy.clear();
-    })
-  })
+    });
+  });
 }
 
-function handleDeptCode({row}) {
-  ElMessageBox.confirm(`是否把项目的执行科室全部选为【${row.name}】`, '提示').then(() => {
-    saveData.value.forEach(value => {
-      value.deptCode = row.code
+function handleDeptCode({ row }) {
+  ElMessageBox.confirm(`是否把项目的执行科室全部选为【${row.name}】`, "提示")
+    .then(() => {
+      saveData.value.forEach(value => {
+        value.deptCode = row.code;
+      });
     })
-  }).catch(XEUtils.noop)
+    .catch(XEUtils.noop);
 }
 
-function handleDoctor({row}) {
-  ElMessageBox.confirm(`是否把项目的医生全部选为【${row.name}】`, '提示').then(() => {
-    saveData.value.forEach(value => {
-      value.doctorCode = row.code
+function handleDoctor({ row }) {
+  ElMessageBox.confirm(`是否把项目的医生全部选为【${row.name}】`, "提示")
+    .then(() => {
+      saveData.value.forEach(value => {
+        value.doctorCode = row.code;
+      });
     })
-  }).catch(XEUtils.noop)
+    .catch(XEUtils.noop);
 }
 
 function getBingQuDuiYingKeShiChange() {
   getBingQuDuiYingKeShi(store.queryWard).then(res => {
     xiaoKeShiList.value = res as any[];
   });
-  store.queryDept = ''
+  store.queryDept = "";
 }
 
 function getSummaries(param) {
-  const {data} = param
+  const { data } = param;
   let sum = 0;
   data.forEach(value => {
-    sum += (value.chargeAmount * value.amount)
-  })
-  return ['', '', sum];
+    sum += value.chargeAmount * value.amount;
+  });
+  return ["", "", sum];
 }
 
-
 function operationRoom() {
   let dept = userStore.deptCode;
   return dept === "1300000";
@@ -122,7 +137,7 @@ function operationRoom() {
 
 function handleSaveTemplate() {
   if (saveData.value.length === 0) {
-    return
+    return;
   }
   useDialog(SaveTemplate, {
     dialogProps: {
@@ -130,29 +145,31 @@ function handleSaveTemplate() {
     },
     params: {
       data: saveData.value,
-    }
+    },
   }).then(() => {
     muBanRef.value?.reloadData();
-  })
+  });
 }
 
 function openNewDialog() {
   useDialog(NewDialog, {
     dialogProps: {
       title: "新增",
-      width: "90vw"
+      width: "90vw",
     },
     params: {
       medicalTechnology,
       add(val) {
         if (stringIsBlank(val.deptCode)) {
-          val.deptCode = userStore.deptCode;
+          val.deptCode = medicalTechnology
+            ? userStore.deptCode
+            : store.patInfo.zkWard;
         }
         saveProxy.push(val);
-        xcMessage.success('添加成功')
+        xcMessage.success("添加成功");
       },
-    }
-  })
+    },
+  });
 }
 
 function openScanCodeGun() {
@@ -162,38 +179,46 @@ function openScanCodeGun() {
       closeOnClickModal: false,
       closeOnPressEscape: false,
       showClose: false,
-    }
-  })
+    },
+  });
 }
 
 onMounted(() => {
   getWard().then(res => {
     wardData.value = res as any[];
   });
-})
+});
 </script>
 
 <template>
   <div class="layout_container" style="padding-left: 5px">
     <header>
-      <el-button icon="Document" type="warning" @click="handleSaveTemplate">存模板</el-button>
-      <el-button icon="Upload" type="primary" @click="handleSave">保存</el-button>
-      <el-button icon="Plus" type="success" @click="openNewDialog">新增</el-button>
-      <el-button icon="Tickets" type="info" @click="openScanCodeGun">扫码枪</el-button>
+      <el-button icon="Document" type="warning" @click="handleSaveTemplate"
+        >存模板</el-button
+      >
+      <el-button icon="Upload" type="primary" @click="handleSave"
+        >保存</el-button
+      >
+      <el-button icon="Plus" type="success" @click="openNewDialog"
+        >新增</el-button
+      >
+      <el-button icon="Tickets" type="info" @click="openScanCodeGun"
+        >扫码枪</el-button
+      >
       <template v-if="medicalTechnology">
         病区:
         <el-select
-            v-model="store.queryWard"
-            filterable
-            clearable
-            style="width: 120px"
-            @change="getBingQuDuiYingKeShiChange"
+          v-model="store.queryWard"
+          filterable
+          clearable
+          style="width: 120px"
+          @change="getBingQuDuiYingKeShiChange"
         >
           <el-option
-              v-for="item in wardData"
-              :key="item.code"
-              :label="item.name"
-              :value="item.code"
+            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>
@@ -201,12 +226,17 @@ onMounted(() => {
           >
         </el-select>
         小科室:
-        <el-select v-model="store.queryDept" filterable style="width: 120px" clearable>
+        <el-select
+          v-model="store.queryDept"
+          filterable
+          style="width: 120px"
+          clearable
+        >
           <el-option
-              v-for="item in xiaoKeShiList"
-              :key="item.code"
-              :label="item.name"
-              :value="item.code"
+            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>
@@ -214,56 +244,68 @@ onMounted(() => {
           >
         </el-select>
       </template>
-      <template
-          v-if="operationRoom()"
-      >
+      <template v-if="operationRoom()">
         手术编码:
         <el-input
-            v-model="ssCode"
-            @blur="ssCode = ssCode.trim()"
-            clearable
-            placeholder="请输入手术编码"
-            style="width: 120px"
+          v-model="ssCode"
+          @blur="ssCode = ssCode.trim()"
+          clearable
+          placeholder="请输入手术编码"
+          style="width: 120px"
         />
       </template>
     </header>
     <div class="layout_main">
-      <el-table :data="saveData" border show-summary
-                :summary-method="getSummaries"
-                max-height="100%"
+      <el-table
+        :data="saveData"
+        border
+        show-summary
+        :summary-method="getSummaries"
+        max-height="100%"
       >
         <el-table-column label="是否自费" width="130">
-          <template #default="{row}">
+          <template #default="{ row }">
             <el-switch
-                v-model="row.ybSelfFlag"
-                :active-value="1"
-                :inactive-value="0"
-                active-color="#ff4949"
-                active-text="自费"
-                inactive-color="#13ce66"
-                inactive-text="医保"/>
+              v-model="row.ybSelfFlag"
+              :active-value="1"
+              :inactive-value="0"
+              active-color="#ff4949"
+              active-text="自费"
+              inactive-color="#13ce66"
+              inactive-text="医保"
+            />
           </template>
         </el-table-column>
         <el-table-column label="医生" width="89px">
-          <template #default="{row}">
-            <SystemStaffSelect style="width: 80px" clearable v-model="row.doctorCode" @rowClick="handleDoctor"/>
+          <template #default="{ row }">
+            <SystemStaffSelect
+              style="width: 80px"
+              clearable
+              v-model="row.doctorCode"
+              @rowClick="handleDoctor"
+            />
           </template>
         </el-table-column>
-        <el-table-column label="项目编码" width="75" prop="chargeCodeMx"/>
-        <el-table-column label="名称" prop="chargeName" min-width="50"/>
+        <el-table-column label="项目编码" width="75" prop="chargeCodeMx" />
+        <el-table-column label="名称" prop="chargeName" min-width="50" />
         <el-table-column label="执行科室" prop="deptCode" width="150">
-          <template #default="{row}">
-            <SystemDeptSelect style="width: 90%" clearable v-model="row.deptCode" @rowClick="handleDeptCode"/>
+          <template #default="{ row }">
+            <SystemDeptSelect
+              style="width: 90%"
+              clearable
+              v-model="row.deptCode"
+              @rowClick="handleDeptCode"
+            />
           </template>
         </el-table-column>
-        <el-table-column label="单价" prop="chargeAmount" width="50"/>
+        <el-table-column label="单价" prop="chargeAmount" width="50" />
         <el-table-column label="数量" prop="amount" width="130">
-          <template #default="{row}">
+          <template #default="{ row }">
             <el-input-number
-                v-model="row.amount"
-                :min="0"
-                :precision="row.serial === '00' ? 2 : 3"
-                style="width: 120px"
+              v-model="row.amount"
+              :min="0"
+              :precision="row.serial === '00' ? 2 : 3"
+              style="width: 120px"
             />
           </template>
         </el-table-column>
@@ -272,12 +314,15 @@ onMounted(() => {
             {{ (scope.row.chargeAmount * scope.row.amount).toFixed(2) }}
           </template>
         </el-table-column>
-        <el-table-column label="账单码" prop="billItemName" width="50"></el-table-column>
+        <el-table-column
+          label="账单码"
+          prop="billItemName"
+          width="50"
+        ></el-table-column>
         <el-table-column label="操作" fixed="right" width="60">
-          <template #default="{$index}">
-            <el-button
-                type="danger"
-                @click=" () => saveData.splice($index , 1)">删除
+          <template #default="{ $index }">
+            <el-button type="danger" @click="() => saveData.splice($index, 1)"
+              >删除
             </el-button>
           </template>
         </el-table-column>

+ 2 - 2
src/components/xmlr/components/projectInput/ProjectInput.vue

@@ -5,13 +5,13 @@ import MagicResizer from "@/components/cy/magic-resizer.vue";
 import {key, ProjectInput} from "@/components/xmlr/index";
 import {useUserStore} from "@/pinia/user-store";
 
-const {saveProxy, muBanRef} = inject(key) as ProjectInput
+const {saveProxy, muBanRef, medicalTechnology, store} = inject(key) as ProjectInput
 const userStore = useUserStore().userInfo;
 
 function xuanZeXiangMuTable(data: any[]) {
   data.forEach(value => {
     value.doctorCode = "";
-    value.deptCode = userStore.deptCode;
+    value.deptCode = medicalTechnology ? userStore.deptCode : store.patInfo.zkWard;
   })
   saveProxy.push(...data)
 }

+ 7 - 1
src/components/xmlr/index.ts

@@ -103,7 +103,7 @@ export const useXmlr = (props: XmlrProps, emits: UseDialogType.Emits) => {
                 ...store.searchFeeParams
             }).then(res => {
                 store.feeData = res.data
-                store.feeTotal = res.total
+                store.feeTotal = res.total;
             })
         },
         clearData() {
@@ -132,6 +132,12 @@ export const useXmlr = (props: XmlrProps, emits: UseDialogType.Emits) => {
         closeDialog() {
             emits('cyDialogConfirm')
         },
+        feeTableSummaryMethod() {
+            const tmp = [];
+            tmp[9] = store.feeTotal;
+            console.log(store.feeTotal)
+            return tmp
+        },
     }
 
     onActivated(() => {

+ 10 - 1
src/utils/cyRefList.ts

@@ -5,7 +5,16 @@ import {stringIsBlank} from "@/utils/blank-utils";
 
 declare type CodeType<T> = keyof T & string | ((item: T) => string);
 
-function cyRefList<T = any>(code: CodeType<T>, errMsg: (item: T) => string = () => '请勿重复添加') {
+function cyRefList<T = any>(code: CodeType<T>, errMsg: (item: T) => string = () => '请勿重复添加'): [Ref<T[]>, {
+    push: (...items: T[]) => number;
+    watchPush: (cb: (value: T) => void) => () => void;
+    delIndex: (index: number) => void;
+    clear: () => void;
+    isEmpty: () => boolean;
+    emptyError: (errorMsg?: string) => void;
+    forEach: (cb: (item: T, index: number) => void) => void;
+    eachAndReturnList: (iteration: (item: T, index: number) => any) => any[];
+}] {
     const list = ref([]) as Ref<T[]>
     const watchFunc: Function[] = []