|
@@ -284,14 +284,10 @@ import Dig from "@/utils/math";
|
|
|
import SelectV4 from "@/components/xiao-chan/select-v4/SelectV4.vue";
|
|
|
import {shortcutTrigger, xcEvent} from "@/utils/xckeydown";
|
|
|
import {xcMessage} from "@/utils/xiaochan-element-plus";
|
|
|
-import OutpatientAppointments
|
|
|
- from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/OutpatientAppointments.vue";
|
|
|
-import OneClickStop from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/OneClickStop.vue";
|
|
|
import DoctorAuthorization
|
|
|
from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/DoctorAuthorization.vue";
|
|
|
import sleep from "@/utils/sleep";
|
|
|
-import {isDev} from "@/utils/public";
|
|
|
-
|
|
|
+import XEUtils from 'xe-utils'
|
|
|
|
|
|
const props = defineProps({
|
|
|
patientInfo: {
|
|
@@ -301,9 +297,6 @@ const props = defineProps({
|
|
|
openGroupOrderTemplate: Function,
|
|
|
})
|
|
|
|
|
|
-const emits = defineEmits(['successfullyEntered'])
|
|
|
-
|
|
|
-
|
|
|
let parentOrder = [
|
|
|
{prop: 'actOrderNo', label: "医嘱号"},
|
|
|
{prop: 'orderName', label: "医嘱名称", width: 250},
|
|
@@ -522,13 +515,10 @@ const jiSuanLingLiang = async (val) => {
|
|
|
if (jiLiangValue.value <= 0) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
let drugQuanA = Math.ceil(Dig.division(val, jiLiangValue.value))
|
|
|
-
|
|
|
if (yiZhuData.value.serial === '99') {
|
|
|
drugQuanA = Math.ceil(Dig.division(drugQuanA, yiZhuData.value.packSize))
|
|
|
}
|
|
|
-
|
|
|
yiZhuData.value.drugQuan = drugQuanA;
|
|
|
}
|
|
|
/* 选择剂量 */
|
|
@@ -540,8 +530,6 @@ const xuanZheJiLiang = (val) => {
|
|
|
jiSuanLingLiang(yiZhuData.value.dose)
|
|
|
}
|
|
|
|
|
|
-/* 给药方式 */
|
|
|
-// const geiYaoFangShiData = ref([])
|
|
|
const userInfo = store.state.user.info
|
|
|
// 医嘱限制时间不能在之前
|
|
|
const disabledDate = (time) => {
|
|
@@ -601,53 +589,23 @@ const clearDoctorSOrder = () => {
|
|
|
* @returns {Promise<void>}
|
|
|
*/
|
|
|
const addOrderNo = async () => {
|
|
|
- if (stringIsBlank(props.patientInfo.inpatientNo)) {
|
|
|
- BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择患者')
|
|
|
- }
|
|
|
- // 如果有录入数据的话就需要保存一下
|
|
|
- if (stringNotBlank(yiZhuData.value.actOrderNo) && yiZhuData.value.statusFlag === '1' && yiZhuData.value.actOrderNo !== 'tempOrderNo') {
|
|
|
- let param = {
|
|
|
- inpatientNo: props.patientInfo.inpatientNo,
|
|
|
- admissTimes: props.patientInfo.admissTimes,
|
|
|
- actOrderNo: yiZhuData.value.actOrderNo,
|
|
|
- groupNo: queryParam.value.groupNo,
|
|
|
- data: yiZhuData.value
|
|
|
- }
|
|
|
- try {
|
|
|
- let res = await enterOrders(param)
|
|
|
- // 如果有错误信息 就 提示
|
|
|
- if (res !== null && res.error) {
|
|
|
- baoCunXinXiRef.value.openOrClose()
|
|
|
- errorMessageData.value = res.data
|
|
|
- return
|
|
|
- }
|
|
|
- emits('successfullyEntered', yiZhuData.value)
|
|
|
- // 医嘱保存了 就删除错误提示
|
|
|
- if (errorMessageData.value) {
|
|
|
- for (let key in errorMessageData.value) {
|
|
|
- if (key === yiZhuData.value.actOrderNo.toString()) {
|
|
|
- delete errorMessageData.value[key]
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 如果没有了错误信息 就关闭
|
|
|
- if (!!errorMessageData.value) {
|
|
|
- baoCunXinXiRef.value.openOrClose(false)
|
|
|
- }
|
|
|
- qingKong()
|
|
|
- yiZhuData.value.actOrderNo = 'tempOrderNo'
|
|
|
- openSearch()
|
|
|
- } catch (e) {
|
|
|
- console.log(e)
|
|
|
- }
|
|
|
+ if (stringIsBlank(yiZhuData.value.actOrderNo) || yiZhuData.value.actOrderNo !== 'tempOrderNo') {
|
|
|
+ await toAddAnOrder()
|
|
|
} else {
|
|
|
- qingKong()
|
|
|
- yiZhuData.value.actOrderNo = 'tempOrderNo'
|
|
|
- openSearch()
|
|
|
+ setTheTemporaryVariableMedicalOrder()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 设置医嘱为临时变量,可以新增医嘱,关闭医嘱错误信息的弹窗。
|
|
|
+ */
|
|
|
+const setTheTemporaryVariableMedicalOrder = () => {
|
|
|
+ qingKong()
|
|
|
+ baoCunXinXiRef.value.openOrClose(false);
|
|
|
+ yiZhuData.value.actOrderNo = 'tempOrderNo'
|
|
|
+ openSearch()
|
|
|
+}
|
|
|
+
|
|
|
const qingKong = () => {
|
|
|
yaoPinJiLiangData.value = []
|
|
|
jiLiangValue.value = 0
|
|
@@ -708,8 +666,11 @@ const isEdit = computed(() => {
|
|
|
})
|
|
|
|
|
|
let baoCunXinXiRef = ref(null)
|
|
|
+/**
|
|
|
+ * 保存, 录入状态的医嘱
|
|
|
+ * @returns {Promise<boolean>}
|
|
|
+ */
|
|
|
const toAddAnOrder = async () => {
|
|
|
-
|
|
|
if (stringIsBlank(props.patientInfo.inpatientNo)) {
|
|
|
BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择患者')
|
|
|
}
|
|
@@ -718,13 +679,12 @@ const toAddAnOrder = async () => {
|
|
|
}
|
|
|
// 有 医嘱 不是 录入就说明在看医嘱 直接清空就可以了
|
|
|
if (stringNotBlank(yiZhuData.value.orderCode) && yiZhuData.value.statusFlag !== '1') {
|
|
|
- qingKong()
|
|
|
- return
|
|
|
+ setTheTemporaryVariableMedicalOrder()
|
|
|
+ return true
|
|
|
}
|
|
|
if (yiZhuData.value.frequCode === 'ONCE' && queryParam.value.frequCode === frequCodeEnum.longTerm) {
|
|
|
BizException(ExceptionEnum.LOGICAL_ERROR, '长期医嘱页面无法选择临时医嘱频率。')
|
|
|
}
|
|
|
-
|
|
|
let param = {
|
|
|
inpatientNo: props.patientInfo.inpatientNo,
|
|
|
admissTimes: props.patientInfo.admissTimes,
|
|
@@ -737,27 +697,31 @@ const toAddAnOrder = async () => {
|
|
|
if (res !== null && res.error) {
|
|
|
baoCunXinXiRef.value.openOrClose()
|
|
|
errorMessageData.value = res.data
|
|
|
- return
|
|
|
+ return false
|
|
|
}
|
|
|
- if (errorMessageData.value) {
|
|
|
- for (let key in errorMessageData.value) {
|
|
|
- if (key === yiZhuData.value.actOrderNo.toString()) {
|
|
|
- delete errorMessageData.value[key]
|
|
|
- break
|
|
|
- }
|
|
|
+ // 数据完全没问题
|
|
|
+ if (res != null && res.code && res.code === 200) {
|
|
|
+ errorMessageData.value = {}
|
|
|
+ let temp = res.data
|
|
|
+ // 从后面向前面循环
|
|
|
+ let index = XEUtils.findLastIndexOf(yzData.value, (item) => {
|
|
|
+ return item.actOrderNo === temp.actOrderNo
|
|
|
+ })
|
|
|
+ if (index > -1) {
|
|
|
+ yzData.value[index] = temp
|
|
|
+ } else {
|
|
|
+ yzData.value.push(temp)
|
|
|
}
|
|
|
+ yzMitt.emit('setOrderNoTwinkle', temp.actOrderNo)
|
|
|
}
|
|
|
- // 如果错误信息是空的就关闭
|
|
|
- if (Object.keys(errorMessageData.value).length === 0) {
|
|
|
- baoCunXinXiRef.value.openOrClose(false)
|
|
|
- }
|
|
|
- emits('successfullyEntered', yiZhuData.value)
|
|
|
- qingKong()
|
|
|
+ setTheTemporaryVariableMedicalOrder()
|
|
|
} catch (e) {
|
|
|
console.log(e)
|
|
|
}
|
|
|
+ return true
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 点击了确认医嘱
|
|
|
*/
|
|
@@ -813,28 +777,8 @@ const errorMessageData = ref({})
|
|
|
* @param val 数据
|
|
|
*/
|
|
|
const clickError = (val) => {
|
|
|
- if (yiZhuData.value.actOrderNo === 'tempOrderNo') {
|
|
|
- qingKong()
|
|
|
- }
|
|
|
- if (stringNotBlank(yiZhuData.value.actOrderNo)) {
|
|
|
- let param = {
|
|
|
- inpatientNo: props.patientInfo.inpatientNo,
|
|
|
- admissTimes: props.patientInfo.admissTimes,
|
|
|
- actOrderNo: yiZhuData.value.actOrderNo,
|
|
|
- data: yiZhuData.value
|
|
|
- }
|
|
|
- enterOrders(param).then((res) => {
|
|
|
- if (res !== null && res.error) {
|
|
|
- errorMessageData.value[yiZhuData.value.actOrderNo] = res.data[yiZhuData.value.actOrderNo]
|
|
|
- return
|
|
|
- }
|
|
|
- delete errorMessageData.value[yiZhuData.value.actOrderNo]
|
|
|
- xuanZhongFeiYong(val.data, 2)
|
|
|
- }).catch(e => {
|
|
|
- })
|
|
|
- } else {
|
|
|
- xuanZhongFeiYong(val.data, 2)
|
|
|
- }
|
|
|
+ qingKong()
|
|
|
+ xuanZhongFeiYong(val.data, 2)
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -886,12 +830,6 @@ let copyOrderNo = $ref({
|
|
|
inpatientNo: '',
|
|
|
admissTimes: 0
|
|
|
})
|
|
|
-const copyClick = () => {
|
|
|
- if (stringIsBlank(yiZhuData.value.actOrderNo) || yiZhuData.value.actOrderNo === 'tempOrderNo') {
|
|
|
- BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择医嘱')
|
|
|
- }
|
|
|
- copy(yiZhuData.value.actOrderNo, yiZhuData.value.frequCode)
|
|
|
-}
|
|
|
|
|
|
const copy = (actOrderNo, frequCode) => {
|
|
|
copyOrderNo.actOrderNo = actOrderNo
|
|
@@ -916,14 +854,13 @@ const pasteClick = () => {
|
|
|
}
|
|
|
|
|
|
const copyFuncApi = async () => {
|
|
|
- let list = await copyOrder(copyOrderNo)
|
|
|
+ let {list, data} = await copyOrder(copyOrderNo)
|
|
|
let temp = {}
|
|
|
- list.forEach(item => {
|
|
|
+ XEUtils.arrayEach(list, (item) => {
|
|
|
temp[item] = true
|
|
|
})
|
|
|
- queryParam.value.zhuangTai = 0
|
|
|
+ yzData.value.push(...data)
|
|
|
// 查询医嘱
|
|
|
- await yzMitt.emit('queryYz');
|
|
|
yzMitt.emit('scrollEndAndTwinkle', temp)
|
|
|
copyOrderNo.actOrderNo = null
|
|
|
}
|