|
@@ -1,5 +1,36 @@
|
|
|
<template>
|
|
|
<div class="layout_container">
|
|
|
+ <el-dialog v-model="electronicPrescription.dialog" title="打印电子处方">
|
|
|
+ <div style="text-align: center">
|
|
|
+ <img
|
|
|
+ id="dzfpQrCode"
|
|
|
+ :src="`data:image/png;base64,${electronicPrescription.qrCode}`"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <el-button v-print="'#dzfpQrCode'" type="primary" size="default"
|
|
|
+ >打印
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog v-model="saveStore.dialog" title="保存">
|
|
|
+ <div style="color: red">收费日期: {{ huanZheXinXi.chargeDate }}</div>
|
|
|
+ <div v-html="saveStore.message" style="color: red" />
|
|
|
+ <PatientInfo />
|
|
|
+ <div
|
|
|
+ style="height: 400px; display: flex; flex-direction: column"
|
|
|
+ class="layout_el-table"
|
|
|
+ >
|
|
|
+ <ZyTale />
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <el-button v-el-btn="saveStore.func" type="primary" size="default"
|
|
|
+ >保存
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<header>
|
|
|
住院号:
|
|
|
<el-input
|
|
@@ -14,109 +45,104 @@
|
|
|
>
|
|
|
</el-input>
|
|
|
<el-button style="margin-left: 10px" type="primary" @click="queryClick"
|
|
|
- >查询患者信息
|
|
|
+ >患者
|
|
|
</el-button>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
机制号:
|
|
|
<el-input
|
|
|
- v-model="serialNo"
|
|
|
+ v-model.number="serialNo"
|
|
|
clearable
|
|
|
onkeyup="this.value=this.value.replace(/\D/g,'') "
|
|
|
placeholder="在此输入机制号"
|
|
|
prefix-icon="Search"
|
|
|
size="small"
|
|
|
style="width: 150px"
|
|
|
- @blur="serialNo = $event.target.value.trim()"
|
|
|
@keyup.enter="querySerialNo"
|
|
|
>
|
|
|
</el-input>
|
|
|
- <el-select v-model="liShiFlag" size="small" style="width: 70px">
|
|
|
- <el-option
|
|
|
- v-for="item in chaKanLiShi"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="item.code"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
<el-button style="margin-left: 10px" type="primary" @click="querySerialNo"
|
|
|
- >查询机制号信息
|
|
|
+ >机制
|
|
|
</el-button>
|
|
|
+ <el-button @click="handleQueryQrCode"> 电子发票</el-button>
|
|
|
<el-button
|
|
|
style="margin-left: 10px"
|
|
|
type="warning"
|
|
|
@click="huanZheFeiYongDrawer = true"
|
|
|
- >查看患者费用
|
|
|
+ >患者费用
|
|
|
</el-button>
|
|
|
<el-button style="margin-left: 10px" type="success" @click="baoCunClick"
|
|
|
- >保存
|
|
|
+ >保存并冲红
|
|
|
</el-button>
|
|
|
+ <el-button @click="handleOnlyChargeRed"> 仅充红</el-button>
|
|
|
</header>
|
|
|
<div>
|
|
|
- <el-descriptions border title="基本信息">
|
|
|
- <el-descriptions-item>
|
|
|
- <template #label>
|
|
|
- <i class="el-icon-user"></i>
|
|
|
- 患者姓名
|
|
|
- </template>
|
|
|
- {{ huanZheXinXi.name }}
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item>
|
|
|
- <template #label>
|
|
|
- <i class="el-icon-user"></i>
|
|
|
- 住院次数
|
|
|
- </template>
|
|
|
- {{ huanZheXinXi.admissTimes }}
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item>
|
|
|
- <template #label>
|
|
|
- <i class="el-icon-user-solid"></i>
|
|
|
- 性别
|
|
|
- </template>
|
|
|
- {{ cptSex(huanZheXinXi.sex) }}
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item>
|
|
|
- <template #label>
|
|
|
- <i class="el-icon-house"></i>
|
|
|
- 床号
|
|
|
- </template>
|
|
|
- {{ huanZheXinXi.bedNo }}
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item>
|
|
|
- <template #label>
|
|
|
- <i class="el-icon-s-home"></i>
|
|
|
- 病房
|
|
|
- </template>
|
|
|
- {{ huanZheXinXi.wardName }}
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item>
|
|
|
- <template #label>
|
|
|
- <i class="el-icon-date"></i>
|
|
|
- 入院日期
|
|
|
- </template>
|
|
|
- {{ huanZheXinXi.admissDate }}
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item>
|
|
|
- <template #label>
|
|
|
- <i class="el-icon-tickets"></i>
|
|
|
- 身份
|
|
|
- </template>
|
|
|
- {{ huanZheXinXi.responceTypeName }}
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item>
|
|
|
- <template #label>
|
|
|
- <i class="el-icon-coin"></i>
|
|
|
- 总费用
|
|
|
- </template>
|
|
|
- {{ huanZheXinXi.totalCharge }}
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item>
|
|
|
- <template #label>
|
|
|
- <i class="el-icon-coin"></i>
|
|
|
- 余额
|
|
|
- </template>
|
|
|
- <span style="color: red">{{ huanZheXinXi.balance }}</span>
|
|
|
- </el-descriptions-item>
|
|
|
- </el-descriptions>
|
|
|
+ <DefaultTemplate>
|
|
|
+ <el-descriptions border title="基本信息">
|
|
|
+ <el-descriptions-item>
|
|
|
+ <template #label>
|
|
|
+ <i class="el-icon-user"></i>
|
|
|
+ 患者姓名
|
|
|
+ </template>
|
|
|
+ {{ huanZheXinXi.name }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item>
|
|
|
+ <template #label>
|
|
|
+ <i class="el-icon-user"></i>
|
|
|
+ 住院次数
|
|
|
+ </template>
|
|
|
+ {{ huanZheXinXi.admissTimes }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item>
|
|
|
+ <template #label>
|
|
|
+ <i class="el-icon-user-solid"></i>
|
|
|
+ 性别
|
|
|
+ </template>
|
|
|
+ {{ cptSex(huanZheXinXi.sex) }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item>
|
|
|
+ <template #label>
|
|
|
+ <i class="el-icon-house"></i>
|
|
|
+ 床号
|
|
|
+ </template>
|
|
|
+ {{ huanZheXinXi.bedNo }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item>
|
|
|
+ <template #label>
|
|
|
+ <i class="el-icon-s-home"></i>
|
|
|
+ 病房
|
|
|
+ </template>
|
|
|
+ {{ huanZheXinXi.wardName }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item>
|
|
|
+ <template #label>
|
|
|
+ <i class="el-icon-date"></i>
|
|
|
+ 入院日期
|
|
|
+ </template>
|
|
|
+ {{ huanZheXinXi.admissDate }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item>
|
|
|
+ <template #label>
|
|
|
+ <i class="el-icon-tickets"></i>
|
|
|
+ 身份
|
|
|
+ </template>
|
|
|
+ {{ huanZheXinXi.responceTypeName }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item>
|
|
|
+ <template #label>
|
|
|
+ <i class="el-icon-coin"></i>
|
|
|
+ 总费用
|
|
|
+ </template>
|
|
|
+ {{ huanZheXinXi.totalCharge }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item>
|
|
|
+ <template #label>
|
|
|
+ <i class="el-icon-coin"></i>
|
|
|
+ 余额
|
|
|
+ </template>
|
|
|
+ <span style="color: red">{{ huanZheXinXi.balance }}</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </DefaultTemplate>
|
|
|
</div>
|
|
|
<div>
|
|
|
收费日期:
|
|
@@ -165,17 +191,22 @@
|
|
|
<el-button icon="Right" type="primary"></el-button>
|
|
|
</div>
|
|
|
<div class="layout_flex_1-x layout_el-table">
|
|
|
- <el-tag> 住院收费项目:合计【{{ zySum }}】</el-tag>
|
|
|
- <el-table :data="zyXinXiList" height="100%" stripe>
|
|
|
- <el-table-column label="项目名称" prop="itemName"></el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="收费编码"
|
|
|
- prop="chargeCodeMx"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column label="数量" prop="chargeQuantity"></el-table-column>
|
|
|
- <el-table-column label="单价" prop="unitPrice"></el-table-column>
|
|
|
- <el-table-column label="金额" prop="chargeFee"></el-table-column>
|
|
|
- </el-table>
|
|
|
+ <ZyFeeTemplate>
|
|
|
+ <el-tag> 住院收费项目:合计【{{ zySum }}】</el-tag>
|
|
|
+ <el-table :data="zyXinXiList" height="100%" stripe>
|
|
|
+ <el-table-column label="项目名称" prop="itemName"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="收费编码"
|
|
|
+ prop="chargeCodeMx"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="数量"
|
|
|
+ prop="chargeQuantity"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column label="单价" prop="unitPrice"></el-table-column>
|
|
|
+ <el-table-column label="金额" prop="chargeFee"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </ZyFeeTemplate>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -292,6 +323,8 @@
|
|
|
import { ref } from "vue";
|
|
|
import {
|
|
|
baoCunHuanZheZhuYuanFeiYong,
|
|
|
+ correctInvoice,
|
|
|
+ getDzfpQrcodeBySerialNo,
|
|
|
getSerialNo,
|
|
|
getZyJiMenZhenZhuangRuFeiYong,
|
|
|
queryEntryName,
|
|
@@ -300,25 +333,33 @@ import {
|
|
|
} from "@/api/inpatient/transfer-in-of-expenses";
|
|
|
import { cptSex } from "@/utils/computed";
|
|
|
import { computed } from "vue";
|
|
|
-import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
+import { ElMessage, ElTable } from "element-plus";
|
|
|
import { compareDate, formatDatetime } from "@/utils/date";
|
|
|
-import { getServerDateApi, queryDept } from "@/api/public-api";
|
|
|
-import { stringNotBlank } from "@/utils/blank-utils";
|
|
|
+import { stringIsBlank, stringNotBlank } from "@/utils/blank-utils";
|
|
|
import Dig from "@/utils/math";
|
|
|
import SystemDeptSelect from "@/components/system/dept-select/SystemDeptSelect.vue";
|
|
|
+import { isDev } from "@/utils/public";
|
|
|
+import dayjs from "dayjs";
|
|
|
+import { useDefaultTemplate } from "@/utils/cy-use/useDefaultTemplate";
|
|
|
+import { CyMessageBox } from "@/utils/cy-message-box/index";
|
|
|
+import { useCompShallowRef } from "@/utils/useCompRef";
|
|
|
+import { BizException, ExceptionEnum } from "@/utils/BizException";
|
|
|
|
|
|
//查询条件
|
|
|
//住院号
|
|
|
-const inpatientNo = ref(""); // 016868
|
|
|
+const inpatientNo = ref(isDev ? "022271" : "");
|
|
|
//机制号
|
|
|
-const serialNo = ref(""); // 11516328
|
|
|
-//是否查看历史记录
|
|
|
-const liShiFlag = ref(0);
|
|
|
+const serialNo = ref(isDev ? 4744398 : null);
|
|
|
//收费代码
|
|
|
const chargeCodeMX = ref("");
|
|
|
// 住院次数
|
|
|
const admissTimes = ref("");
|
|
|
|
|
|
+let serialNoTmp = null;
|
|
|
+
|
|
|
+const [DefaultTemplate, PatientInfo] = useDefaultTemplate();
|
|
|
+const [ZyFeeTemplate, ZyTale] = useDefaultTemplate();
|
|
|
+
|
|
|
const huanZheXinXi = ref({
|
|
|
execUnit: "",
|
|
|
});
|
|
@@ -337,17 +378,24 @@ const queryClick = async () => {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- chargeDate.value = await getServerDateApi();
|
|
|
deptList.value = [{ code: "1070000", name: "急诊科" }];
|
|
|
queryHuanZhe(inpatientNo.value).then(res => {
|
|
|
huanZheXinXi.value = res;
|
|
|
admissTimes.value = res.admissTimes;
|
|
|
huanZheXinXi.value.execUnit = "1070000";
|
|
|
|
|
|
- chargeDate.value = new Date(huanZheXinXi.value.admissDate ?? "");
|
|
|
+ chargeDate.value = new Date(
|
|
|
+ dayjs(huanZheXinXi.value.admissDate ?? "").add(1, "minutes")
|
|
|
+ );
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+function checkZyFee() {
|
|
|
+ if (zyXinXiList.value.length === 0) {
|
|
|
+ BizException(ExceptionEnum.MESSAGE_ERROR, "请选择要转入的费用");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//查询机制号
|
|
|
const querySerialNo = () => {
|
|
|
if (!serialNo.value) {
|
|
@@ -359,17 +407,19 @@ const querySerialNo = () => {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- getSerialNo(serialNo.value, liShiFlag.value)
|
|
|
+ serialNoTmp = serialNo.value;
|
|
|
+ getSerialNo(serialNo.value)
|
|
|
.then(res => {
|
|
|
mzXinXiList.value = res;
|
|
|
})
|
|
|
.catch(() => {
|
|
|
+ serialNoTmp = null;
|
|
|
mzXinXiList.value = [];
|
|
|
});
|
|
|
};
|
|
|
|
|
|
//定义用来删除 多选框的选中状态 以及点击选中多选框
|
|
|
-const multipleTable = ref(null);
|
|
|
+const multipleTable = useCompShallowRef(ElTable);
|
|
|
//点击多选框,把里面的内容添加进去
|
|
|
const mzSelectChecked = (selection, row) => {
|
|
|
zyXinXiList.value = selection;
|
|
@@ -448,6 +498,18 @@ const huanZheFeiYongCurrentChange = val => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const saveStore = reactive({
|
|
|
+ dialog: false,
|
|
|
+ message: "",
|
|
|
+ func: null,
|
|
|
+});
|
|
|
+
|
|
|
+function openSaveDialog(message) {
|
|
|
+ saveStore.dialog = true;
|
|
|
+ saveStore.message = message;
|
|
|
+ saveStore.func = handleSave;
|
|
|
+}
|
|
|
+
|
|
|
//删除住院收费项目 前端删除 后端也删除 只是不执行一个查找的动作了
|
|
|
const shanChuFeiYongClick = (index, val) => {
|
|
|
shanChuFeiYong(val).then(res => {
|
|
@@ -475,15 +537,7 @@ const baoCunClick = () => {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if (zyXinXiList.value.length === 0) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "请先选择要添加的费用",
|
|
|
- showClose: true,
|
|
|
- duration: 2500,
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
+ checkZyFee();
|
|
|
huanZheXinXi.value.list = zyXinXiList.value;
|
|
|
if (huanZheXinXi.value.chargeDate === "") {
|
|
|
return ElMessage.error({
|
|
@@ -495,41 +549,67 @@ const baoCunClick = () => {
|
|
|
huanZheXinXi.value.name !== mzXinXiList.value[i].patientName &&
|
|
|
typeof mzXinXiList.value[i].patientName !== "undefined"
|
|
|
) {
|
|
|
- return ElMessageBox.confirm("", "提示", {
|
|
|
- cancelButtonText: "取消",
|
|
|
- confirmButtonText: "确定",
|
|
|
- dangerouslyUseHTMLString: true,
|
|
|
- type: "warning",
|
|
|
- message: `门诊病人姓名【'${mzXinXiList.value[i].patientName} '】住院病人姓名【' ${huanZheXinXi.value.name} '】不一致,是否继续?<br>收费日期:${huanZheXinXi.value.chargeDate}`,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- baoCunHuanZheZhuYuanFeiYong(huanZheXinXi.value).then(res => {
|
|
|
- zyXinXiList.value = [];
|
|
|
- mzXinXiList.value = [];
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ return openSaveDialog(
|
|
|
+ `门诊病人姓名【'${mzXinXiList.value[i].patientName}'】住院病人姓名【' ${huanZheXinXi.value.name}'】不一致,是否继续?`
|
|
|
+ );
|
|
|
} else if (
|
|
|
huanZheXinXi.value.name === mzXinXiList.value[i].patientName &&
|
|
|
typeof mzXinXiList.value[i].patientName !== "undefined"
|
|
|
) {
|
|
|
- return ElMessageBox.confirm("", "提示", {
|
|
|
- cancelButtonText: "取消",
|
|
|
- confirmButtonText: "确定",
|
|
|
- dangerouslyUseHTMLString: true,
|
|
|
- type: "warning",
|
|
|
- message: `收费日期:${huanZheXinXi.value.chargeDate}`,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- baoCunHuanZheZhuYuanFeiYong(huanZheXinXi.value).then(res => {
|
|
|
- zyXinXiList.value = [];
|
|
|
- mzXinXiList.value = [];
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ return openSaveDialog();
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+const electronicPrescription = reactive({
|
|
|
+ dialog: false,
|
|
|
+ qrCode: "",
|
|
|
+});
|
|
|
+
|
|
|
+async function handleSave() {
|
|
|
+ await baoCunHuanZheZhuYuanFeiYong({
|
|
|
+ ...huanZheXinXi.value,
|
|
|
+ serialNo: serialNoTmp,
|
|
|
+ });
|
|
|
+ await handleCorrectInvoice();
|
|
|
+}
|
|
|
+
|
|
|
+async function handleCorrectInvoice(inputFee = true) {
|
|
|
+ checkZyFee();
|
|
|
+ const zyCodes = zyXinXiList.value.map(item => {
|
|
|
+ return item.chargeCodeMx;
|
|
|
+ });
|
|
|
+ const codes = [];
|
|
|
+
|
|
|
+ mzXinXiList.value.forEach(item => {
|
|
|
+ if (!zyCodes.includes(item.chargeCodeMx)) {
|
|
|
+ codes.push(item.chargeCodeMx);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ const success = await correctInvoice({
|
|
|
+ serialNo: serialNoTmp,
|
|
|
+ codes: codes,
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ handleOpenPrint(res);
|
|
|
+ return true;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ if (inputFee) {
|
|
|
+ CyMessageBox.alert({
|
|
|
+ message: "保存费用成功,但冲红发票失败,可以点击仅冲红发票按钮重试",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+ if (success) {
|
|
|
+ zyXinXiList.value = [];
|
|
|
+ multipleTable.value.clearSelection();
|
|
|
+ saveStore.dialog = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//项目名称 数组
|
|
|
const entryNameList = ref([]);
|
|
|
|
|
@@ -547,10 +627,24 @@ const chargeDate = ref(new Date());
|
|
|
// 科室
|
|
|
const deptList = ref([]);
|
|
|
|
|
|
-const chaKanLiShi = [
|
|
|
- { code: 0, name: "当前" },
|
|
|
- { code: 1, name: "历史" },
|
|
|
-];
|
|
|
+function handleOpenPrint(res) {
|
|
|
+ if (stringIsBlank(res)) return;
|
|
|
+ electronicPrescription.dialog = true;
|
|
|
+ electronicPrescription.qrCode = res;
|
|
|
+}
|
|
|
+
|
|
|
+function handleQueryQrCode() {
|
|
|
+ getDzfpQrcodeBySerialNo(serialNo.value).then(res => {
|
|
|
+ handleOpenPrint(res);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+async function handleOnlyChargeRed() {
|
|
|
+ checkZyFee();
|
|
|
+ saveStore.dialog = true;
|
|
|
+ saveStore.message = "仅充红,不会在录入住院费用了。";
|
|
|
+ saveStore.func = () => handleCorrectInvoice(false);
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style></style>
|