|
@@ -110,7 +110,6 @@
|
|
|
type="datetime"
|
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
- @change="cydyDrugQuan(false)"
|
|
|
></el-date-picker>
|
|
|
</div>
|
|
|
<div>
|
|
@@ -118,7 +117,6 @@
|
|
|
<el-date-picker
|
|
|
style="width: 160px"
|
|
|
v-model="yiZhuData.endTime"
|
|
|
- @change="cydyDrugQuan(false)"
|
|
|
id="yz_endTime"
|
|
|
:disabled="yiZhuData.frequCode === 'ONCE'"
|
|
|
:disabled-date="disabledDate"
|
|
@@ -128,7 +126,7 @@
|
|
|
></el-date-picker>
|
|
|
</div>
|
|
|
<div class="input__style" style="width: 120px">
|
|
|
- 医生: {{ yiZhuData.enterOperName ? yiZhuData.enterOperName : store.state.user.info.name }}
|
|
|
+ 医生: {{ yiZhuData.enterOperName ? yiZhuData.enterOperName : userInfoStore.name }}
|
|
|
</div>
|
|
|
<div>
|
|
|
执行科室:
|
|
@@ -158,8 +156,7 @@
|
|
|
@focus="fuYiZhuClick"
|
|
|
@rowClick="modifyDosingMethod"
|
|
|
:table-header="parentOrder"
|
|
|
- :data="fuYiZhuData">
|
|
|
- </xc-combo-grid>
|
|
|
+ :data="fuYiZhuData"/>
|
|
|
</div>
|
|
|
<div :title="yiZhuData.discription" class="div_center__box">
|
|
|
描述:
|
|
@@ -245,7 +242,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script setup name='YzEditor'>
|
|
|
+<script setup lang="ts">
|
|
|
import {
|
|
|
confirmOrders, copyOrder,
|
|
|
enterOrders,
|
|
@@ -253,16 +250,14 @@ import {
|
|
|
huoQuFeiYongXinXi,
|
|
|
huoQuXiangMu,
|
|
|
huoQuZhiXinKeShi,
|
|
|
- toDeleteAnOrder
|
|
|
+ toDeleteAnOrder, YaoPingJiLiang
|
|
|
} from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
|
|
|
import {listNotBlank, listToStr, stringIsBlank, stringNotBlank} from '@/utils/blank-utils'
|
|
|
-import {getServerDateApi} from '@/api/public-api'
|
|
|
import Sleep from '@/utils/sleep'
|
|
|
import XcComboGrid from "@/components/xiao-chan/combo-grid/XcComboGrid";
|
|
|
import XcSelectV3 from "@/components/xiao-chan/select-v3/XcSelectV3";
|
|
|
import XcOption from "@/components/xiao-chan/select/XcOption";
|
|
|
import XcSelect from "@/components/xiao-chan/select/XcSelect";
|
|
|
-import store from "@/store"
|
|
|
import XcCheckbox from "@/components/xiao-chan/checkbox/XcCheckbox";
|
|
|
import {BizException, ExceptionEnum} from "@/utils/BizException";
|
|
|
import BaoCunXinXi from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/BaoCunXinXi";
|
|
@@ -282,7 +277,7 @@ import {
|
|
|
frequencyConfig,
|
|
|
addTempOrderNo,
|
|
|
yiZhuDataInit,
|
|
|
- setOrderDataAndTwinkle, feeKey
|
|
|
+ setOrderDataAndTwinkle, feeKey, YzType, SearchOrdersType, RefFillingValue
|
|
|
} 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";
|
|
@@ -294,13 +289,29 @@ import DoctorAuthorization
|
|
|
from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/DoctorAuthorization.vue";
|
|
|
import sleep from "@/utils/sleep";
|
|
|
import XEUtils from 'xe-utils'
|
|
|
-
|
|
|
-const props = defineProps({
|
|
|
+import {
|
|
|
+ ref,
|
|
|
+ computed,
|
|
|
+ nextTick,
|
|
|
+ onDeactivated,
|
|
|
+ onActivated,
|
|
|
+ watch,
|
|
|
+ onMounted
|
|
|
+} from 'vue'
|
|
|
+import {userInfoStore} from "@/utils/store-public";
|
|
|
+import {getServerDate} from "@/utils/moment-utils";
|
|
|
+
|
|
|
+const props = withDefaults(defineProps<{
|
|
|
patientInfo: {
|
|
|
- type: Object,
|
|
|
- default: null
|
|
|
+ inpatientNo: string,
|
|
|
+ admissTimes: number,
|
|
|
+ zkWard: string,
|
|
|
+ zkWardName: string
|
|
|
+ admissDate: Date
|
|
|
},
|
|
|
- openGroupOrderTemplate: Function,
|
|
|
+ openGroupOrderTemplate: (val: string) => void
|
|
|
+}>(), {
|
|
|
+ patientInfo: null,
|
|
|
})
|
|
|
|
|
|
let parentOrder = [
|
|
@@ -313,6 +324,78 @@ const searchOrders = (val) => {
|
|
|
return huoQuXiangMu(val, queryParam.value.groupNo)
|
|
|
}
|
|
|
|
|
|
+const searchClickFunc = async (row: SearchOrdersType): Promise<void> => {
|
|
|
+ // 这个是选择了医嘱弹窗的
|
|
|
+ if (row.serial === '0000' && row.groupNo === '0000') {
|
|
|
+ props.openGroupOrderTemplate(row.orderCode)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 在出院带药的页面中选择数据
|
|
|
+ if (row.serial === '00' && isCydy()) {
|
|
|
+ qingKong()
|
|
|
+ BizException(ExceptionEnum.LOGICAL_ERROR, '出院带药不能开项目')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 医嘱号是空的,或者是临时医嘱号的就需要一个新的医嘱号
|
|
|
+ if (stringIsBlank(yiZhuData.value.actOrderNo) || yiZhuData.value.actOrderNo === addTempOrderNo) {
|
|
|
+ setYzData('actOrderNo', parseInt(await getOrderNo()));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 清空数据但是保留原来的医嘱号
|
|
|
+ qingKong(false)
|
|
|
+
|
|
|
+ // 设置医嘱的一些默认值
|
|
|
+ const setYz = new RefFillingValue(yiZhuData, row);
|
|
|
+ setYz.setValue('orderCode')
|
|
|
+ .setValue('orderName')
|
|
|
+ .setValue('serial')
|
|
|
+ .setValue('discription')
|
|
|
+ .setValue('groupNo')
|
|
|
+ .setValue('groupName')
|
|
|
+ .setValue('infusionFlag')
|
|
|
+ .setValue('drugFlag')
|
|
|
+ .setValue('packSize')
|
|
|
+ .setValue('packSizeName')
|
|
|
+ .setValue('orderClass')
|
|
|
+ .setValue('dosage')
|
|
|
+ .setValue('ybType')
|
|
|
+ .setValue('execDept')
|
|
|
+ .setValue('execDeptName')
|
|
|
+ .setDefaultValueByName('newOrderFlag', 1)
|
|
|
+ .setDefaultValueByName('statusFlag', '1');
|
|
|
+
|
|
|
+ // 查询一下父医嘱
|
|
|
+ fuYiZhuClick()
|
|
|
+
|
|
|
+ // 药品
|
|
|
+ if (row.serial !== '00') {
|
|
|
+ const queryKey = feeKey(row.orderCode, row.serial, props.patientInfo.zkWard, queryParam.value.groupNo, yiZhuData.value.superiorDoctor, yiZhuData.value.statusFlag)
|
|
|
+ const {permissionPrompt, prompt, data, yaoPingJiLiang} = await huoQuFeiYongXinXi(queryKey)
|
|
|
+
|
|
|
+ // 医生没有权限
|
|
|
+ if (permissionPrompt) {
|
|
|
+ let authorization = await yzMitt.emit('openDoctorAuthoriztion', row.orderCode + '_' + row.serial)
|
|
|
+ setYz.setDefaultValueByName('superiorDoctor', authorization.code)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 加载药品的计量
|
|
|
+ yaoPinJiLiangData.value = yaoPingJiLiang
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const setYzData = (name: keyof YzType, value: any): void => {
|
|
|
+ yiZhuData.value[name] = value
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/*提示信息*/
|
|
|
const tiShiBiaoTi = ref([])
|
|
|
// 填充数据
|
|
@@ -327,8 +410,13 @@ const xuanZhongFeiYong = async (row, laiyuan = 1) => {
|
|
|
return BizException(ExceptionEnum.LOGICAL_ERROR, '出院带药不能开项目')
|
|
|
}
|
|
|
|
|
|
- if (typeof row.actOrderNo === 'undefined' && laiyuan === 1) {
|
|
|
- yiZhuData.value.actOrderNo = await getOrderNo()
|
|
|
+ // 如果是搜索的医嘱的话就需要给一个新的医嘱号
|
|
|
+ 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
|
|
@@ -337,11 +425,11 @@ const xuanZhongFeiYong = async (row, laiyuan = 1) => {
|
|
|
if (laiyuan === 1) {
|
|
|
tempOrderNo = yiZhuData.value.actOrderNo
|
|
|
}
|
|
|
- await fuYiZhuClick()
|
|
|
+ fuYiZhuClick()
|
|
|
qingKong()
|
|
|
await Sleep(200)
|
|
|
// 克隆一下数据防止有问题
|
|
|
- yiZhuData.value = clone(row)
|
|
|
+ yiZhuData.value = clone(row) as YzType
|
|
|
if (tempOrderNo !== null) {
|
|
|
yiZhuData.value.actOrderNo = tempOrderNo;
|
|
|
yiZhuData.value.statusFlag = '1'
|
|
@@ -355,13 +443,10 @@ const xuanZhongFeiYong = async (row, laiyuan = 1) => {
|
|
|
if (res.permissionPrompt) {
|
|
|
let authorization = await yzMitt.emit('openDoctorAuthoriztion', row.orderCode + '_' + row.serial)
|
|
|
yiZhuData.value.superiorDoctor = authorization.code
|
|
|
- yiZhuData.value.instruction = `由【${authorization.name}】医生授权。`
|
|
|
}
|
|
|
// 加载药品计量
|
|
|
yaoPinJiLiangData.value = res.yaoPingJiLiang;
|
|
|
if (newData) {
|
|
|
- // 判断是否 是皮试的药 如果是就只能有这些 给药方式
|
|
|
- // geiYaoFangShiData.value = res.piShi
|
|
|
// 是否是 抗菌药物
|
|
|
yiZhuData.value.kjywFlag = res.data.kjywFlag
|
|
|
// 提示信息
|
|
@@ -427,7 +512,7 @@ const xuanZhongFeiYong = async (row, laiyuan = 1) => {
|
|
|
let res = await huoQuFeiYongXinXi(queryKey2)
|
|
|
tiShiBiaoTi.value = res.prompt
|
|
|
if (newData) {
|
|
|
- openTheOrderPopUpWindow('请输入处置医嘱名')
|
|
|
+ openTheOrderPopUpWindow()
|
|
|
if (stringNotBlank(res.prompt)) {
|
|
|
tiShiBiaoTi.value = res.prompt
|
|
|
}
|
|
@@ -447,7 +532,7 @@ const xuanZhongFeiYong = async (row, laiyuan = 1) => {
|
|
|
}
|
|
|
if (newData) {
|
|
|
// 判断这个是不是 新添加的数据 如果是空的就是 新数据
|
|
|
- let serverDate = await getServerDateApi();
|
|
|
+ let serverDate = await getServerDate();
|
|
|
if (!yiZhuData.value.orderTime) {
|
|
|
yiZhuData.value.orderTime = serverDate
|
|
|
}
|
|
@@ -535,7 +620,7 @@ const jiSuanLingLiang = async (val) => {
|
|
|
yiZhuData.value.drugQuan = drugQuanA;
|
|
|
}
|
|
|
/* 选择剂量 */
|
|
|
-const yaoPinJiLiangData = ref([])
|
|
|
+const yaoPinJiLiangData = ref<YaoPingJiLiang[]>([])
|
|
|
const jiLiangValue = ref(0)
|
|
|
const xuanZheJiLiang = (val) => {
|
|
|
jiLiangValue.value = val.value
|
|
@@ -543,7 +628,6 @@ const xuanZheJiLiang = (val) => {
|
|
|
jiSuanLingLiang(yiZhuData.value.dose)
|
|
|
}
|
|
|
|
|
|
-const userInfo = store.state.user.info
|
|
|
// 医嘱限制时间不能在之前
|
|
|
const disabledDate = (time) => {
|
|
|
if (props.patientInfo?.admissDate) {
|
|
@@ -562,7 +646,7 @@ const metZhiXingKeShi = (val) => {
|
|
|
|
|
|
/* 父医嘱 */
|
|
|
const fuYiZhuData = ref([])
|
|
|
-const fuYiZhuClick = async () => {
|
|
|
+const fuYiZhuClick = () => {
|
|
|
fuYiZhuData.value = []
|
|
|
|
|
|
XEUtils.lastArrayEach(yzData.value, (item) => {
|
|
@@ -612,12 +696,12 @@ const setTheTemporaryVariableMedicalOrder = () => {
|
|
|
openSearch()
|
|
|
}
|
|
|
|
|
|
-const qingKong = () => {
|
|
|
+const qingKong = (clearOrderNo: boolean = true) => {
|
|
|
yaoPinJiLiangData.value = [];
|
|
|
jiLiangValue.value = 0;
|
|
|
tiShiBiaoTi.value = [];
|
|
|
tempData = null;
|
|
|
- yiZhuDataInit();
|
|
|
+ yiZhuDataInit(clearOrderNo);
|
|
|
}
|
|
|
|
|
|
// 判断是否可以编辑
|
|
@@ -743,7 +827,7 @@ const clickError = (orderNo) => {
|
|
|
*/
|
|
|
let tempData = null
|
|
|
const fillData = async (data) => {
|
|
|
- await fuYiZhuClick()
|
|
|
+ fuYiZhuClick()
|
|
|
await xuanZhongFeiYong(data, 2)
|
|
|
tempData = JSON.stringify(yiZhuData.value)
|
|
|
}
|
|
@@ -778,7 +862,13 @@ const dosePrecision = computed(() => {
|
|
|
return yiZhuData.value.serial === '00' ? 2 : 3
|
|
|
})
|
|
|
|
|
|
-let copyOrderNo = $ref({
|
|
|
+let copyOrderNo = ref<{
|
|
|
+ actOrderNo: number | null,
|
|
|
+ frequCode: string
|
|
|
+ deptCode: string
|
|
|
+ inpatientNo: string
|
|
|
+ admissTimes: number
|
|
|
+}>({
|
|
|
actOrderNo: null,
|
|
|
frequCode: '',
|
|
|
|
|
@@ -788,23 +878,23 @@ let copyOrderNo = $ref({
|
|
|
})
|
|
|
|
|
|
const copy = (actOrderNo, frequCode) => {
|
|
|
- copyOrderNo.actOrderNo = actOrderNo
|
|
|
- copyOrderNo.frequCode = frequCode
|
|
|
+ copyOrderNo.value.actOrderNo = actOrderNo
|
|
|
+ copyOrderNo.value.frequCode = frequCode
|
|
|
xcMessage.success('复制成功。')
|
|
|
}
|
|
|
|
|
|
const pasteClick = () => {
|
|
|
- if (queryParam.value.frequCode === frequCodeEnum.temporary && copyOrderNo.frequCode !== 'ONCE') {
|
|
|
- copyOrderNo.frequCode = 'ONCE'
|
|
|
- } else if (queryParam.value.frequCode === frequCodeEnum.longTerm && copyOrderNo.frequCode === 'ONCE') {
|
|
|
- copyOrderNo.frequCode = frequencyConfig
|
|
|
+ if (queryParam.value.frequCode === frequCodeEnum.temporary && copyOrderNo.value.frequCode !== 'ONCE') {
|
|
|
+ copyOrderNo.value.frequCode = 'ONCE'
|
|
|
+ } else if (queryParam.value.frequCode === frequCodeEnum.longTerm && copyOrderNo.value.frequCode === 'ONCE') {
|
|
|
+ copyOrderNo.value.frequCode = frequencyConfig
|
|
|
} else if (queryParam.value.frequCode === frequCodeEnum.takeMedicine) {
|
|
|
- copyOrderNo.frequCode = 'ONCE'
|
|
|
+ copyOrderNo.value.frequCode = 'ONCE'
|
|
|
}
|
|
|
|
|
|
- copyOrderNo.deptCode = props.patientInfo.zkWard
|
|
|
- copyOrderNo.inpatientNo = props.patientInfo.inpatientNo
|
|
|
- copyOrderNo.admissTimes = props.patientInfo.admissTimes
|
|
|
+ copyOrderNo.value.deptCode = props.patientInfo.zkWard
|
|
|
+ copyOrderNo.value.inpatientNo = props.patientInfo.inpatientNo
|
|
|
+ copyOrderNo.value.admissTimes = props.patientInfo.admissTimes
|
|
|
|
|
|
copyFuncApi()
|
|
|
}
|
|
@@ -817,7 +907,7 @@ const copyFuncApi = async () => {
|
|
|
})
|
|
|
yzData.value.push(...data)
|
|
|
yzMitt.emit('scrollEndAndTwinkle', temp)
|
|
|
- copyOrderNo.actOrderNo = null
|
|
|
+ copyOrderNo.value.actOrderNo = null
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -828,9 +918,10 @@ const duplicateAndPaste = () => {
|
|
|
if (stringIsBlank(yiZhuData.value.actOrderNo) || yiZhuData.value.actOrderNo === addTempOrderNo) {
|
|
|
BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择医嘱')
|
|
|
}
|
|
|
- copyOrderNo = {
|
|
|
+ copyOrderNo.value = {
|
|
|
actOrderNo: yiZhuData.value.actOrderNo,
|
|
|
frequCode: yiZhuData.value.frequCode,
|
|
|
+
|
|
|
deptCode: props.patientInfo.zkWard,
|
|
|
inpatientNo: props.patientInfo.inpatientNo,
|
|
|
admissTimes: props.patientInfo.admissTimes
|
|
@@ -862,7 +953,7 @@ onMounted(() => {
|
|
|
yzMitt.on('copy', copy)
|
|
|
yzMitt.on('paste', pasteClick)
|
|
|
yzMitt.on('allowReplication', () => {
|
|
|
- return copyOrderNo.actOrderNo !== null
|
|
|
+ return copyOrderNo.value.actOrderNo !== null
|
|
|
})
|
|
|
|
|
|
yzMitt.on('deleteAnOrderByOrderNo', ({actOrderNo, orderName}, clearOrNot = true) => {
|