|
@@ -257,7 +257,6 @@
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import {
|
|
import {
|
|
|
- analyzeSiChargeLimit,
|
|
|
|
|
confirmOrders,
|
|
confirmOrders,
|
|
|
copyOrder,
|
|
copyOrder,
|
|
|
enterOrders,
|
|
enterOrders,
|
|
@@ -300,7 +299,7 @@ import {
|
|
|
yzInfoPrompt,
|
|
yzInfoPrompt,
|
|
|
jsQueryYzData,
|
|
jsQueryYzData,
|
|
|
} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
|
|
} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
|
|
|
-import { ElMessageBox } from "element-plus";
|
|
|
|
|
|
|
+import { dayjs, ElMessageBox } from "element-plus";
|
|
|
import YzDialog from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/dialog/YzDialog";
|
|
import YzDialog from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/dialog/YzDialog";
|
|
|
import Dig from "@/utils/math";
|
|
import Dig from "@/utils/math";
|
|
|
import SelectV4 from "@/components/xiao-chan/select-v4/SelectV4.vue";
|
|
import SelectV4 from "@/components/xiao-chan/select-v4/SelectV4.vue";
|
|
@@ -329,6 +328,7 @@ import doctorStore, {
|
|
|
YzSidebarEnum,
|
|
YzSidebarEnum,
|
|
|
} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/useDoctorStore";
|
|
} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/useDoctorStore";
|
|
|
import { useDialog } from "@/components/cy/CyDialog/index";
|
|
import { useDialog } from "@/components/cy/CyDialog/index";
|
|
|
|
|
+import { isDev } from "@/utils/public";
|
|
|
|
|
|
|
|
const props = withDefaults(
|
|
const props = withDefaults(
|
|
|
defineProps<{
|
|
defineProps<{
|
|
@@ -403,6 +403,11 @@ const searchClickFunc = async (row: SearchOrdersType): Promise<void> => {
|
|
|
.setDefaultValueByName("newOrderFlag", 1)
|
|
.setDefaultValueByName("newOrderFlag", 1)
|
|
|
.setDefaultValueByName("statusFlag", "1");
|
|
.setDefaultValueByName("statusFlag", "1");
|
|
|
|
|
|
|
|
|
|
+ let now = await getServerDate();
|
|
|
|
|
+
|
|
|
|
|
+ setYzData("orderTime", now);
|
|
|
|
|
+ setYzData("startTime", now);
|
|
|
|
|
+
|
|
|
// 查询一下父医嘱
|
|
// 查询一下父医嘱
|
|
|
fuYiZhuClick();
|
|
fuYiZhuClick();
|
|
|
// 药品
|
|
// 药品
|
|
@@ -461,6 +466,8 @@ const drugDefaultValue = async (
|
|
|
yiZhuData.value.superiorDoctor,
|
|
yiZhuData.value.superiorDoctor,
|
|
|
yiZhuData.value.statusFlag
|
|
yiZhuData.value.statusFlag
|
|
|
);
|
|
);
|
|
|
|
|
+
|
|
|
|
|
+ // @ts-ignore
|
|
|
const {
|
|
const {
|
|
|
permissionPrompt,
|
|
permissionPrompt,
|
|
|
prompt,
|
|
prompt,
|
|
@@ -477,25 +484,11 @@ const drugDefaultValue = async (
|
|
|
|
|
|
|
|
// 医生没有权限
|
|
// 医生没有权限
|
|
|
if (permissionPrompt) {
|
|
if (permissionPrompt) {
|
|
|
- await useDialog(DoctorAuthorization, {
|
|
|
|
|
- params: {
|
|
|
|
|
- drugCode: drugKey,
|
|
|
|
|
- },
|
|
|
|
|
- dialogProps: {
|
|
|
|
|
- title: "医生授权",
|
|
|
|
|
- closeOnPressEscape: false,
|
|
|
|
|
- closeOnClickModal: false,
|
|
|
|
|
- showClose: false,
|
|
|
|
|
- },
|
|
|
|
|
- })
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- setYzData("superiorDoctor", res.code);
|
|
|
|
|
- yzInfoPrompt.value.push("医生授权");
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {
|
|
|
|
|
- clearAndErrorMessage("取消授权。");
|
|
|
|
|
- yzInfoPrompt.value.push("取消授权");
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const prompt =
|
|
|
|
|
+ "药品分为限制等级,可通过上级医生授权的方式开出大于自身等级的药品,输入上级医生的工号和密码后,点击确认即可,请注意点击确认后该医嘱会变成这个医生开的,请不要在此医嘱上进行修改不然这条医嘱会变成另外一个医生的,如果开错了,删除重新开。";
|
|
|
|
|
+ await doctorAuth(drugKey, prompt).then(res => {
|
|
|
|
|
+ setYzData("superiorDoctor", res.code);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 加载药品的计量
|
|
// 加载药品的计量
|
|
@@ -574,6 +567,45 @@ const itemDefaultValue = (
|
|
|
yiZhuData.value.superiorDoctor,
|
|
yiZhuData.value.superiorDoctor,
|
|
|
yiZhuData.value.statusFlag
|
|
yiZhuData.value.statusFlag
|
|
|
);
|
|
);
|
|
|
|
|
+
|
|
|
|
|
+ if (yiZhuData.value.orderCode === "06026") {
|
|
|
|
|
+ if (isDev) {
|
|
|
|
|
+ huanZheXinXi.value.admissDate = dayjs(new Date())
|
|
|
|
|
+ .subtract(3, "day")
|
|
|
|
|
+ .format("YYYY-MM-DD HH:mm:ss");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const diffDays = dayjs(yiZhuData.value.orderTime).diff(
|
|
|
|
|
+ dayjs(huanZheXinXi.value.admissDate),
|
|
|
|
|
+ "day"
|
|
|
|
|
+ );
|
|
|
|
|
+ if (
|
|
|
|
|
+ diffDays <= 4 &&
|
|
|
|
|
+ yiZhuData.value.superiorDoctor !== huanZheXinXi.value.deptDirector
|
|
|
|
|
+ ) {
|
|
|
|
|
+ const prompt = `患者出院天数小于等于4需要【科主任】授权,此患者的科主任设置为:【${huanZheXinXi.value.deptDirectorName}】`;
|
|
|
|
|
+ const beforeConfirm = value => {
|
|
|
|
|
+ if (value.code !== huanZheXinXi.value.deptDirector) {
|
|
|
|
|
+ return "授权医生不是该患者的科主任。";
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ doctorAuth(
|
|
|
|
|
+ `${data.orderCode}_${data.serial}`,
|
|
|
|
|
+ prompt,
|
|
|
|
|
+ beforeConfirm
|
|
|
|
|
+ ).then(res => {
|
|
|
|
|
+ if (res.code === huanZheXinXi.value.deptDirector) {
|
|
|
|
|
+ setYzData("superiorDoctor", res.code);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ yzInfoPrompt.value.push("取消授权");
|
|
|
|
|
+ clearAndErrorMessage("授权医生不是该患者的科主任。");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const { prompt }: FeeInfo = huoQuFeiYongXinXi(queryKey).catch(() => {
|
|
const { prompt }: FeeInfo = huoQuFeiYongXinXi(queryKey).catch(() => {
|
|
|
clearAndErrorMessage("请联系管理员。");
|
|
clearAndErrorMessage("请联系管理员。");
|
|
|
});
|
|
});
|
|
@@ -608,12 +640,6 @@ const defaultAll = async (
|
|
|
) => {
|
|
) => {
|
|
|
if (isSearch) {
|
|
if (isSearch) {
|
|
|
doctorStore.setYzSidebar(YzSidebarEnum.YZ);
|
|
doctorStore.setYzSidebar(YzSidebarEnum.YZ);
|
|
|
-
|
|
|
|
|
- let now = await getServerDate();
|
|
|
|
|
-
|
|
|
|
|
- setYzData("orderTime", now);
|
|
|
|
|
- setYzData("startTime", now);
|
|
|
|
|
-
|
|
|
|
|
// 如果有默认科室的话就用项目中自带的科室,没有的话就用患者的科室
|
|
// 如果有默认科室的话就用项目中自带的科室,没有的话就用患者的科室
|
|
|
if (data.execDept) {
|
|
if (data.execDept) {
|
|
|
setYzData("execUnit", data.execDept);
|
|
setYzData("execUnit", data.execDept);
|
|
@@ -667,6 +693,35 @@ const defaultAll = async (
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const doctorAuth = async (
|
|
|
|
|
+ key,
|
|
|
|
|
+ prompt,
|
|
|
|
|
+ beforeConfirm: (value: any) => string | boolean = () => true
|
|
|
|
|
+) => {
|
|
|
|
|
+ return await useDialog(DoctorAuthorization, {
|
|
|
|
|
+ params: {
|
|
|
|
|
+ drugCode: key,
|
|
|
|
|
+ prompt,
|
|
|
|
|
+ beforeConfirm,
|
|
|
|
|
+ },
|
|
|
|
|
+ dialogProps: {
|
|
|
|
|
+ title: "医生授权",
|
|
|
|
|
+ closeOnPressEscape: false,
|
|
|
|
|
+ closeOnClickModal: false,
|
|
|
|
|
+ showClose: false,
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ yzInfoPrompt.value.push("医生授权");
|
|
|
|
|
+ return res;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ yzInfoPrompt.value.push("取消授权");
|
|
|
|
|
+ clearAndErrorMessage("取消授权。");
|
|
|
|
|
+ throw new Error("");
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const setYzData = (name: keyof YzType, value: any): void => {
|
|
const setYzData = (name: keyof YzType, value: any): void => {
|
|
|
yiZhuData.value[name] = value;
|
|
yiZhuData.value[name] = value;
|
|
|
};
|
|
};
|