|
@@ -1,5 +1,4 @@
|
|
|
<template>
|
|
|
- <doctor-authorization/>
|
|
|
<div ref="editorMainRef" style="width: max-content">
|
|
|
<div class="editor__title" style="height: 10px; width: 100%">
|
|
|
<span v-for="item in tiShiBiaoTi">
|
|
@@ -234,9 +233,7 @@
|
|
|
</div>
|
|
|
<!-- 报错信息 -->
|
|
|
<bao-cun-xin-xi @clickError="clickError"
|
|
|
- :data="errorMessageData"
|
|
|
- :currentKey="yiZhuData.actOrderNo"
|
|
|
- ref="baoCunXinXiRef"/>
|
|
|
+ :currentKey="yiZhuData.actOrderNo"/>
|
|
|
<!-- 弹窗医嘱 -->
|
|
|
<yz-dialog :yz-data="yiZhuData" v-if="yzDialogRef" @closed="yzDialogRef = false"/>
|
|
|
</div>
|
|
@@ -277,7 +274,7 @@ import {
|
|
|
frequencyConfig,
|
|
|
addTempOrderNo,
|
|
|
yiZhuDataInit,
|
|
|
- setOrderDataAndTwinkle, feeKey, YzType, SearchOrdersType, RefFillingValue
|
|
|
+ setOrderDataAndTwinkle, feeKey, YzType, SearchOrdersType, RefFillingValue, errorMsg, YzErrTypeEnum
|
|
|
} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
|
|
|
import {ElMessageBox} from "element-plus";
|
|
|
import YzDialog from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/dialog/YzDialog";
|
|
@@ -301,6 +298,7 @@ import {
|
|
|
import {userInfoStore} from "@/utils/store-public";
|
|
|
import {getServerDate} from "@/utils/moment-utils";
|
|
|
import {CyMessageBox} from "@/components/cy/message-box";
|
|
|
+import setDialogToJs from "@/components/js-dialog-comp/useDialogToJs";
|
|
|
|
|
|
const props = withDefaults(defineProps<{
|
|
|
patientInfo: {
|
|
@@ -400,7 +398,6 @@ const rowClickFillData = async (data: YzType) => {
|
|
|
await itemDefaultValue(false, data)
|
|
|
}
|
|
|
await defaultAll(false, data)
|
|
|
-
|
|
|
}
|
|
|
|
|
|
const clearAndErrorMessage = (message: string) => {
|
|
@@ -423,13 +420,12 @@ const drugDefaultValue = async (isSearch: boolean, data: SearchOrdersType | YzTy
|
|
|
|
|
|
// 医生没有权限
|
|
|
if (permissionPrompt) {
|
|
|
- await yzMitt.emit('openDoctorAuthoriztion', drugKey)
|
|
|
- .then((res) => {
|
|
|
- setYzData('superiorDoctor', res.code)
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- clearAndErrorMessage('取消授权。')
|
|
|
- })
|
|
|
+ await setDialogToJs(DoctorAuthorization, {drugCode: drugKey}).then((res) => {
|
|
|
+ const [us] = res
|
|
|
+ setYzData('superiorDoctor', us.code)
|
|
|
+ }).catch(() => {
|
|
|
+ clearAndErrorMessage('取消授权。')
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 加载药品的计量
|
|
@@ -579,205 +575,6 @@ const setYzData = (name: keyof YzType, value: any): void => {
|
|
|
|
|
|
/*提示信息*/
|
|
|
const tiShiBiaoTi = ref([])
|
|
|
-// 填充数据
|
|
|
-const xuanZhongFeiYong = async (row, laiyuan = 1) => {
|
|
|
- // 这里是用的模板数据
|
|
|
- if (row.serial === '0000' && row.groupNo === '0000') {
|
|
|
- props.openGroupOrderTemplate(row.orderCode);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (row.serial === '00' && isCydy()) {
|
|
|
- qingKong()
|
|
|
- return BizException(ExceptionEnum.LOGICAL_ERROR, '出院带药不能开项目')
|
|
|
- }
|
|
|
-
|
|
|
- // 如果是搜索的医嘱的话就需要给一个新的医嘱号
|
|
|
- if (laiyuan === 1) {
|
|
|
- // 如果是在原来有的医嘱上搜索的话就不要给医嘱号了。
|
|
|
- if (stringIsBlank(yiZhuData.value.actOrderNo) || yiZhuData.value.actOrderNo === addTempOrderNo) {
|
|
|
- yiZhuData.value.actOrderNo = parseInt(await getOrderNo())
|
|
|
- yiZhuData.value.newOrderFlag = 1
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- let tempOrderNo = null
|
|
|
- // 查询医嘱是不会有医嘱号的,医生会在原来的医嘱上面修改成项目或者药品
|
|
|
- // 保留一下医嘱号 不然 yiZhuData.value = row 这个会把医嘱号给干掉
|
|
|
- if (laiyuan === 1) {
|
|
|
- tempOrderNo = yiZhuData.value.actOrderNo
|
|
|
- }
|
|
|
- fuYiZhuClick()
|
|
|
- qingKong()
|
|
|
- await Sleep(200)
|
|
|
- // 克隆一下数据防止有问题
|
|
|
- yiZhuData.value = clone(row) as YzType
|
|
|
- if (tempOrderNo !== null) {
|
|
|
- yiZhuData.value.actOrderNo = tempOrderNo;
|
|
|
- yiZhuData.value.statusFlag = '1'
|
|
|
- }
|
|
|
- let newData = yiZhuData.value.statusFlag === '1'
|
|
|
- // 00 是项目
|
|
|
- if (row.serial !== '00') {
|
|
|
- try {
|
|
|
- let queryKey2 = feeKey(row.orderCode, row.serial, props.patientInfo.zkWard, queryParam.value.groupNo, yiZhuData.value.superiorDoctor, yiZhuData.value.statusFlag)
|
|
|
- let res = await huoQuFeiYongXinXi(queryKey2)
|
|
|
- if (res.permissionPrompt) {
|
|
|
- let authorization = await yzMitt.emit('openDoctorAuthoriztion', row.orderCode + '_' + row.serial)
|
|
|
- yiZhuData.value.superiorDoctor = authorization.code
|
|
|
- }
|
|
|
- // 加载药品计量
|
|
|
- yaoPinJiLiangData.value = res.yaoPingJiLiang;
|
|
|
- if (newData) {
|
|
|
- // 是否是 抗菌药物
|
|
|
- yiZhuData.value.kjywFlag = res.data.kjywFlag
|
|
|
- // 提示信息
|
|
|
- tiShiBiaoTi.value = res.prompt
|
|
|
- // 最小单位名称
|
|
|
- if (laiyuan === 1) {
|
|
|
- yiZhuData.value.miniUnit = res.data.packUnit;
|
|
|
- yiZhuData.value.miniUnitName = res.data.packUnitName;
|
|
|
- }
|
|
|
- yiZhuData.value.packSize = res.data.packSize
|
|
|
- yiZhuData.value.packUnit = res.data.packUnit
|
|
|
- yiZhuData.value.drugVolume = res.data.volum
|
|
|
- yiZhuData.value.drugVolUnit = res.data.volUnit
|
|
|
- // 加载 剂量单位
|
|
|
- if (stringNotBlank(yiZhuData.value.doseUnit)) {
|
|
|
- yaoPinJiLiangData.value.forEach((item) => {
|
|
|
- if (item.code === yiZhuData.value.doseUnit) {
|
|
|
- jiLiangValue.value = item.value
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (listNotBlank(yaoPinJiLiangData.value)) {
|
|
|
- // 没有剂量单位的时候默认加载第一个计量单位 并且计算
|
|
|
- yiZhuData.value.doseUnit = yaoPinJiLiangData.value[0].code
|
|
|
- yiZhuData.value.dose = yaoPinJiLiangData.value[0].value
|
|
|
- jiLiangValue.value = yaoPinJiLiangData.value[0].value
|
|
|
- }
|
|
|
- await jiSuanLingLiang(yiZhuData.value.dose)
|
|
|
- // 加载默认频率 如果已经填写了 就用有的
|
|
|
- if (stringIsBlank(row.frequCode)) {
|
|
|
- // 如果药品中自带了 频率就用药品表的频率
|
|
|
- if (stringNotBlank(res.data.frequCode)) {
|
|
|
- yiZhuData.value.frequCode = res.data.frequCode
|
|
|
- yiZhuData.value.frequCodeName = res.data.frequCodeName
|
|
|
- } else {
|
|
|
- if (queryParam.value.frequCode === frequCodeEnum.longTerm) {
|
|
|
- yiZhuData.value.frequCode = frequencyConfig
|
|
|
- } else if (queryParam.value.frequCode === frequCodeEnum.temporary) {
|
|
|
- yiZhuData.value.frequCode = 'ONCE'
|
|
|
- } else {
|
|
|
- yiZhuData.value.frequCode = frequencyConfig
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 加载给药方式 如果已经有了就没事了
|
|
|
- if (stringIsBlank(yiZhuData.value.supplyCode)) {
|
|
|
- if (stringNotBlank(res.data.supplyCode)) {
|
|
|
- yiZhuData.value.supplyCode = res.data.supplyCode
|
|
|
- yiZhuData.value.supplyCodeName = res.data.supplyCodeName
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- openTheOrderPopUpWindow()
|
|
|
- } catch (e) {
|
|
|
- if (yiZhuData.value.statusFlag === '1') {
|
|
|
- await Sleep(200);
|
|
|
- setTheTemporaryVariableMedicalOrder()
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- yiZhuData.value.kjywFlag = 0
|
|
|
- try {
|
|
|
- let queryKey2 = feeKey(row.orderCode, '00', props.patientInfo.zkWard, queryParam.value.groupNo, yiZhuData.value.superiorDoctor, yiZhuData.value.statusFlag)
|
|
|
- let res = await huoQuFeiYongXinXi(queryKey2)
|
|
|
- tiShiBiaoTi.value = res.prompt
|
|
|
- if (newData) {
|
|
|
- openTheOrderPopUpWindow()
|
|
|
- if (stringNotBlank(res.prompt)) {
|
|
|
- tiShiBiaoTi.value = res.prompt
|
|
|
- }
|
|
|
- if (!row.dose) {
|
|
|
- yiZhuData.value.dose = 1
|
|
|
- }
|
|
|
- // 如果是项目就不需要给药方式
|
|
|
- yiZhuData.value.supplyCode = null
|
|
|
- yiZhuData.value.supplyCodeName = ''
|
|
|
- }
|
|
|
- } catch (e) {
|
|
|
- if (yiZhuData.value.statusFlag === '1') {
|
|
|
- await Sleep(200)
|
|
|
- setTheTemporaryVariableMedicalOrder()
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (newData) {
|
|
|
- // 判断这个是不是 新添加的数据 如果是空的就是 新数据
|
|
|
- const serverDate = await getServerDate();
|
|
|
- if (!yiZhuData.value.orderTime) {
|
|
|
- yiZhuData.value.orderTime = serverDate
|
|
|
- }
|
|
|
- if (!yiZhuData.value.startTime) {
|
|
|
- yiZhuData.value.startTime = serverDate
|
|
|
- }
|
|
|
- // 用来加载默认的执行科室 加载项目的执行科室
|
|
|
- if (laiyuan === 1) {
|
|
|
- if (stringNotBlank(row.execDept)) {
|
|
|
- yiZhuData.value.execUnit = row.execDept
|
|
|
- yiZhuData.value.execUnitName = row.execDeptName
|
|
|
- xcMessage.warning('请注意,已使用默认执行科室,如需修改请在执行科室下拉框中搜索科室。')
|
|
|
- } else {
|
|
|
- yiZhuData.value.execUnit = props.patientInfo.zkWard
|
|
|
- yiZhuData.value.execUnitName = props.patientInfo.zkWardName
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (stringIsBlank(row.execUnit)) {
|
|
|
- yiZhuData.value.execUnit = props.patientInfo.zkWard
|
|
|
- yiZhuData.value.execUnitName = props.patientInfo.zkWardName
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!yiZhuData.value.frequCode) {
|
|
|
- yiZhuData.value.frequCode = 'ONCE'
|
|
|
- yiZhuData.value.frequCodeName = '一次'
|
|
|
- }
|
|
|
- try {
|
|
|
- pingLvRef.value.focus()
|
|
|
- } catch (e) {
|
|
|
- console.log(e)
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- if (queryParam.value.frequCode === 'takeMedicine') {
|
|
|
- yiZhuData.value.selfBuy = '4'
|
|
|
- yiZhuData.value.frequCode = 'ONCE'
|
|
|
- yiZhuData.value.supplyCode = '007'
|
|
|
- }
|
|
|
- // 显示父医嘱的名称
|
|
|
- if (yiZhuData.value.statusFlag !== '1' && yiZhuData.value.parentNo) {
|
|
|
- fuYiZhuData.value = []
|
|
|
- fuYiZhuData.value.push({
|
|
|
- actOrderNo: yiZhuData.value.parentNo,
|
|
|
- orderName: yiZhuData.value.parentNoName,
|
|
|
- })
|
|
|
- }
|
|
|
- // 如果搜索了医嘱那么 这里就需要 重新赋值,不认表格就没办法变化了,把原来的换掉
|
|
|
- for (let i = yzData.value.length - 1; i >= 0; i--) {
|
|
|
- let item = yzData.value[i];
|
|
|
- if (yiZhuData.value.actOrderNo === item.actOrderNo) {
|
|
|
- yzData.value[i] = yiZhuData.value
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (laiyuan === 1) {
|
|
|
- if (queryParam.value.frequCode === frequCodeEnum.temporary && yiZhuData.value.frequCode !== 'ONCE') {
|
|
|
- yiZhuData.value.frequCode = 'ONCE'
|
|
|
- } else if (queryParam.value.frequCode === frequCodeEnum.longTerm && yiZhuData.value.frequCode === 'ONCE') {
|
|
|
- yiZhuData.value.frequCode = frequencyConfig
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
/* 频率 */
|
|
|
const pingLvRef = ref()
|
|
@@ -793,10 +590,8 @@ const jiSuanLingLiang = async (val) => {
|
|
|
return;
|
|
|
}
|
|
|
let drugQuanA = Math.ceil(Dig.division(val, jiLiangValue.value))
|
|
|
- console.log('领量', drugQuanA, Dig.division(val, jiLiangValue.value))
|
|
|
if (yiZhuData.value.serial === '99') {
|
|
|
drugQuanA = Math.ceil(Dig.division(drugQuanA, yiZhuData.value.packSize))
|
|
|
- console.log('大包装 %o ,除以%o,包装规格%o', drugQuanA, Dig.division(drugQuanA, yiZhuData.value.packSize), yiZhuData.value.packSize)
|
|
|
}
|
|
|
yiZhuData.value.drugQuan = drugQuanA;
|
|
|
}
|
|
@@ -812,7 +607,7 @@ const xuanZheJiLiang = (val) => {
|
|
|
// 医嘱限制时间不能在之前
|
|
|
const disabledDate = (time) => {
|
|
|
if (props.patientInfo?.admissDate) {
|
|
|
- return time.getTime() < new Date(props.patientInfo?.admissDate).getTime() - 8.64e7;
|
|
|
+ return time.getTime() < new Date(props.patientInfo.admissDate).getTime() - 8.64e7;
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -852,10 +647,8 @@ const modifyDosingMethod = (val) => {
|
|
|
yiZhuData.value.orderTime = val.orderTime
|
|
|
yiZhuData.value.startTime = val.startTime
|
|
|
yiZhuData.value.endTime = val.endTime
|
|
|
-
|
|
|
yiZhuData.value.supplyCode = '044'
|
|
|
yiZhuData.value.supplyCodeName = '副药'
|
|
|
-
|
|
|
yiZhuData.value.frequCode = val.frequCode
|
|
|
yiZhuData.value.frequCodeName = val.frequCodeName
|
|
|
yiZhuData.value.groupNo = val.groupNo
|
|
@@ -872,7 +665,7 @@ const clearDoctorSOrder = () => {
|
|
|
*/
|
|
|
const setTheTemporaryVariableMedicalOrder = () => {
|
|
|
qingKong()
|
|
|
- baoCunXinXiRef.value.openOrClose(false);
|
|
|
+ errorMsg.value.dialog = false
|
|
|
yiZhuData.value.actOrderNo = addTempOrderNo
|
|
|
openSearch()
|
|
|
}
|
|
@@ -889,7 +682,6 @@ const isEdit = computed(() => {
|
|
|
return (stringIsBlank(yiZhuData.value.actOrderNo) || yiZhuData.value.statusFlag !== '1' || stringIsBlank(props.patientInfo.inpatientNo));
|
|
|
})
|
|
|
|
|
|
-let baoCunXinXiRef = ref(null)
|
|
|
/**
|
|
|
* 保存, 录入状态的医嘱
|
|
|
* @returns {Promise<boolean>}
|
|
@@ -916,13 +708,14 @@ const toAddAnOrder = async () => {
|
|
|
try {
|
|
|
let res = await enterOrders(param)
|
|
|
if (res && res.error) {
|
|
|
- baoCunXinXiRef.value.openOrClose()
|
|
|
- errorMessageData.value = res.data
|
|
|
+ errorMsg.value.type = YzErrTypeEnum.确认错误
|
|
|
+ errorMsg.value.dialog = true
|
|
|
+ errorMsg.value.data = res.data
|
|
|
return false
|
|
|
}
|
|
|
// 数据完全没问题
|
|
|
if (res != null && res.code && res.code === 200) {
|
|
|
- errorMessageData.value = {}
|
|
|
+ errorMsg.value.data = {}
|
|
|
let orderNo = yiZhuData.value.actOrderNo
|
|
|
await setOrderDataAndTwinkle(orderNo, res.data)
|
|
|
}
|
|
@@ -957,7 +750,7 @@ const confirmOrdersClick = async () => {
|
|
|
}
|
|
|
let res = await confirmOrders(props.patientInfo)
|
|
|
if (res !== null && res.error) {
|
|
|
- baoCunXinXiRef.value.openOrClose()
|
|
|
+ errorMsg.value.dialog = false
|
|
|
errorMessageData.value = res.data
|
|
|
}
|
|
|
} catch (e) {
|
|
@@ -1125,12 +918,10 @@ onMounted(() => {
|
|
|
yzMitt.on('allowReplication', () => {
|
|
|
return copyOrderNo.value.actOrderNo !== null
|
|
|
})
|
|
|
-
|
|
|
yzMitt.on('deleteAnOrderByOrderNo', ({actOrderNo, orderName}, clearOrNot = true) => {
|
|
|
if (stringIsBlank(actOrderNo)) {
|
|
|
BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择要删除的医嘱')
|
|
|
}
|
|
|
-
|
|
|
CyMessageBox.confirm({
|
|
|
message: `确认是否要删除<span style="color: red"> ${orderName} </span>`,
|
|
|
dangerouslyUseHTMLString: true,
|
|
@@ -1170,14 +961,12 @@ onActivated(() => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
-
|
|
|
defineExpose({
|
|
|
fillData,
|
|
|
toDeleteAnOrderClick,
|
|
|
confirmOrdersClick,
|
|
|
isEdit
|
|
|
})
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|