123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904 |
- <template>
- <div ref="editorMainRef">
- <div v-if="tiShiBiaoTi?.length > 0" class="editor__title">
- <span v-for="item in tiShiBiaoTi">
- {{ item }}
- </span>
- </div>
- <div class="ribbon">
- <button @click="qingKong">清空工作台</button>
- <button @click="toAddAnOrder">录入医嘱</button>
- <button @click="duplicateAndPaste">复制并粘贴</button>
- <button @click="openTheOrderPopUpWindow">打开医嘱弹窗</button>
- </div>
- <div class="editing_area" ref="editingAreaRef"
- :style="{color: isEdit ? '#0014fc' : ''}">
- <div class="yz_editor__disable" v-if="isEdit"></div>
- <div class="yz_input__box">
- <div>
- 医嘱名称:
- <xc-combo-grid
- style="width: 240px"
- ref="searchRef"
- v-model="yiZhuData.orderName"
- :table-header="tableHeader"
- :query-data-func="huoQuXiangMu"
- :current-key="yiZhuData.orderCode + yiZhuData.orderName"
- @rowClick="xuanZhongFeiYong">
- </xc-combo-grid>
- </div>
- <div class="input__style">
- {{ yiZhuData.drugSpecification }}
- </div>
- <div>
- 频率:
- <xc-select-v3 style="width: 120px"
- :disabled="queryParam.frequCode === 1"
- v-model="yiZhuData"
- :data="yaoPinPingLvData"
- code="frequCode"
- name="frequCodeName"
- :remote-method="pinLvRemoteMethod"
- id="yz_frequCode"
- ref="pingLv"/>
- </div>
- <div>
- 一次剂量:
- <el-input-number v-model="yiZhuData.dose"
- :min="0"
- ref="doseRef"
- id="yz_dose"
- :precision="yiZhuData.doseUnitName === yiZhuData.miniUnitName ? 0 : 2"
- style="width: 110px"
- @change="jiSuanLingLiang"/>
- <XcSelect v-model="yiZhuData"
- id="yz_doseUnit"
- ref="doseUnitRef"
- :data="yaoPinJiLiangData"
- :name="['doseUnit', 'doseUnitName']"
- :width="80"
- @change="xuanZheJiLiang">
- <XcOption label="value"></XcOption>
- <XcOption label="name"></XcOption>
- </XcSelect>
- </div>
- <div>
- 领量:
- {{ yiZhuData.drugQuan }}
- {{ yiZhuData.miniUnitName }}
- </div>
- </div>
- <div class="yz_input__box">
- <div>
- 给药方式:
- <xc-select-v3
- style="width: 120px"
- v-model="yiZhuData"
- :data="geiYaoFangShiData"
- id="yz_supplyCode"
- code="supplyCode"
- name="supplyCodeName"
- :remote-method="geiYaoFangShiRemoteMethod"
- clearable/>
- </div>
- <div>
- 开始时间:
- <!-- <input v-model="yiZhuData.startTime"-->
- <!-- type="datetime-local">-->
- <el-date-picker
- style="width: 160px"
- v-model="yiZhuData.startTime"
- :disabled-date="disabledDate"
- id="yz_startTime"
- format="YYYY-MM-DD HH:mm:ss"
- type="datetime"
- value-format="YYYY-MM-DD HH:mm:ss"
- ></el-date-picker>
- </div>
- <div>
- 停止时间:
- <el-date-picker
- style="width: 160px"
- v-model="yiZhuData.endTime"
- id="yz_endTime"
- :disabled="yiZhuData.frequCode === 'ONCE'"
- :disabled-date="disabledDate"
- format="YYYY-MM-DD HH:mm:ss"
- type="datetime"
- value-format="YYYY-MM-DD HH:mm:ss"
- ></el-date-picker>
- </div>
- <div class="input__style" style="width: 120px">
- 医生: {{ store.state.user.info.name }}
- </div>
- <div>
- 执行科室:
- <xc-select-v3
- style="width: 120px"
- v-model="yiZhuData"
- :data="zhiXingKeShiData"
- id="yz_execUnit"
- code="execUnit"
- name="execUnitName"
- :remote-method="metZhiXingKeShi"/>
- </div>
- </div>
- <div class="yz_input__box">
- <div class="div_center__box">
- 医嘱时间:
- <div class="input__style"> {{ yiZhuData.orderTime }}</div>
- </div>
- <div>
- 父医嘱:
- <select v-model="yiZhuData.parentNo"
- style="width: 120px"
- @focus="fuYiZhuClick"
- @change="modifyDosingMethod"
- :disabled="yiZhuData.serial === '00'">
- <option :value="null"/>
- <template v-for="item in fuYiZhuData">
- <option :value="item.actOrderNo"
- v-if="yiZhuData?.actOrderNo !== item?.actOrderNo">
- {{ item.orderName }}
- </option>
- </template>
- </select>
- </div>
- <div :title="yiZhuData.discription" class="div_center__box">
- 描述:
- <div class="input__style" style="overflow: auto;width: 240px">
- {{ yiZhuData.discription }}
- </div>
- </div>
- <div>
- <!-- 皮试药品 -->
- </div>
- </div>
- <div class="yz_input__box">
- <div class="div_center__box" :title="yiZhuData.instruction">
- <div style="width: 87px">
- 医生嘱托:
- </div>
- <el-input v-model="yiZhuData.instruction"
- clearable
- maxlength="50"
- show-word-limit></el-input>
- </div>
- <div class="div_center__box">
- <el-select
- ref="kfFlagRef"
- @focus="elSelectFocus(kfFlagRef)"
- @blur="elSelectBlur(kfFlagRef)"
- v-model="yiZhuData.kfFlag"
- id="yz_kfFlag"
- clearable
- style="width: 80px"
- @clear="yiZhuData.kfFlag = null">
- <el-option key="1" label="饭前" value="1"></el-option>
- <el-option key="2" label="饭后" value="2"></el-option>
- </el-select>
- </div>
- <div>
- 费用标志:
- <el-select v-model="yiZhuData.selfBuy"
- id="yz_selfBuy"
- ref="selfBuyRef"
- @focus="elSelectFocus(selfBuyRef)"
- @blur="elSelectBlur(selfBuyRef)"
- clearable style="width: 120px"
- @clear="yiZhuData.selfBuy = null">
- <el-option key="1" label="自备" value="1"></el-option>
- <el-option key="2" label="嘱托" value="2"></el-option>
- <el-option key="3" label="基数药" value="3"></el-option>
- </el-select>
- </div>
- <div class="div_center__box">
- <xc-checkbox
- label="医保自费"
- v-model="yiZhuData.ybSelfFlag"
- inactive-value="0"
- active-value="1"/>
-
- <xc-checkbox
- label="紧急"
- v-model="yiZhuData.emergencyFlag"
- active-value="1"
- inactive-value="0"/>
- </div>
- <div>
- 录入/确认/停止
- <div style="display: inline-block">
- <span style="background-color:#05ff00;padding: 2px;">
- {{ yiZhuData.enterOperName }}
- </span>
- /
- <span style="background-color:#0000fa;padding: 2px;color: white ">
- {{ yiZhuData.signerName }}
- </span>
- /
- <span style="background-color:red;padding: 2px;">
- {{ yiZhuData.modifierName }}
- </span>
- </div>
- </div>
- </div>
- </div>
- <!-- 报错信息 -->
- <bao-cun-xin-xi @clickError="clickError"
- :data="errorMessageData"
- :currentKey="yiZhuData.actOrderNo"
- ref="baoCunXinXiRef"/>
- <!-- 弹窗医嘱 -->
- <yz-dialog :yz-data="yiZhuData" ref="yzDialogRef"/>
- </div>
- </template>
- <script setup name='YzEditor'>
- import {
- confirmOrders,
- enterOrders,
- getOrderNo,
- getParentOrders,
- huoQuFeiYongXinXi,
- huoQuGeiYaoFangShi,
- huoQuXiangMu,
- huoQuZhiXinKeShi,
- huoQuZhuYuanPinLv,
- toDeleteAnOrder
- } from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
- import {listNotBlank, 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";
- import {clone} from "@/utils/clone";
- import {
- winsize,
- queryParam,
- yiZhuData,
- yzData
- } 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";
- import {xcHotKey} from "@/utils/xckeydown";
- const props = defineProps({
- patientInfo: {
- type: Object,
- default: null
- },
- successfullyEntered: Function,
- openGroupOrderTemplate: Function
- })
- let tableHeader = [
- {label: '编码', prop: 'orderCode'},
- {label: '名称', prop: 'orderName', width: 220},
- {label: '规格', prop: 'drugSpecification'},
- {label: '描述', prop: 'discription'},
- {label: '库存', prop: 'stockAmount'},
- {label: '大包装', prop: 'specPack'},
- {label: '医保类型', prop: 'ybFlagNew'},
- {label: '医保编码', prop: 'nationalCode'},
- {label: '医保名称', prop: 'nationalName'},
- {label: '医保备注', prop: 'ybComment'},
- {label: '大输液', prop: 'infusionFlagName'},
- {label: '厂家', prop: 'manuName'},
- {label: '类型', prop: 'orderType'},
- {label: '毒麻类型', prop: 'drugFlagName'}
- ]
- /*提示信息*/
- const tiShiBiaoTi = ref([])
- // 搜索医嘱
- const xuanZhongFeiYong = async (row, laiyuan = 1) => {
- if (row.serial === '0000' && row.groupNo === '0000') {
- props.openGroupOrderTemplate(row.orderCode)
- return
- }
- if (yiZhuData.value.actOrderNo === 'tempOrderNo') {
- yiZhuData.value.actOrderNo = await getOrderNo()
- }
- let tempOrderNo = null
- // 在使用 查询医嘱搜索的时候 row 是不会有 actOrderNo 的所以要保留一下 原来的医嘱
- if (laiyuan === 1) {
- tempOrderNo = yiZhuData.value.actOrderNo
- }
- await fuYiZhuClick()
- qingKong()
- await Sleep(300)
- yiZhuData.value = row
- if (tempOrderNo !== null) {
- yiZhuData.value.actOrderNo = tempOrderNo;
- yiZhuData.value.statusFlag = '1'
- }
- let newData = yiZhuData.value.statusFlag === '1'
- if (row.serial === '01' || row.serial === '99') {
- try {
- let res = await huoQuFeiYongXinXi(row.orderCode, row.serial, props.patientInfo.smallDept)
- // 加载药品计量
- yaoPinJiLiangData.value = res.yaoPingJiLiang
- if (newData) {
- yiZhuData.value.drugFlag = row.drugFlag ? row.drugFlag : row.orderType
- // 判断是否 是皮试的药 如果是就只能有这些 给药方式
- geiYaoFangShiData.value = res.piShi
- // 是否是 抗菌药物
- yiZhuData.value.kjywFlag = res.data.kjywFlag
- // 提示信息
- tiShiBiaoTi.value = res.prompt
- // 最小单位名称
- yiZhuData.value.miniUnit = res.data.miniUnit
- yiZhuData.value.miniUnitName = res.data.miniUnitName
- 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
- }
- 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 {
- yiZhuData.value.frequCode = 'ONCE'
- yiZhuData.value.frequCodeName = '一次'
- }
- }
- // 加载给药方式 如果已经有了就没事了
- if (stringIsBlank(yiZhuData.value.supplyCode)) {
- if (stringNotBlank(res.data.supplyCode)) {
- yiZhuData.value.supplyCode = res.data.supplyCode
- yiZhuData.value.supplyCodeName = res.data.supplyCodeName
- }
- }
- }
- } catch (e) {
- if (yiZhuData.value.statusFlag === '1') {
- await Sleep(200)
- qingKong()
- }
- }
- } else {
- yiZhuData.value.kjywFlag = 0
- try {
- let res = await huoQuFeiYongXinXi(row.orderCode, '00', props.patientInfo.smallDept)
- if (newData) {
- openTheOrderPopUpWindow('请输入处置医嘱名')
- yiZhuData.value.drugFlag = row.drugFlag ? row.drugFlag : row.orderType
- if (stringNotBlank(res.prompt)) {
- tiShiBiaoTi.value = res.prompt
- }
- if (!res.dose) {
- yiZhuData.value.dose = 1
- }
- }
- } catch (e) {
- if (yiZhuData.value.statusFlag === '1') {
- await Sleep(200)
- qingKong()
- }
- }
- }
- if (newData) {
- // 判断这个是不是 新添加的数据 如果是空的就是 新数据
- let serverDate = await getServerDateApi()
- if (!yiZhuData.value.orderTime) {
- yiZhuData.value.orderTime = serverDate
- }
- if (!yiZhuData.value.startTime) {
- yiZhuData.value.startTime = serverDate
- }
- // 用来加载默认的执行科室
- if (stringIsBlank(row.execUnit)) {
- if (stringNotBlank(props.patientInfo.smallDept)) {
- yiZhuData.value.execUnit = props.patientInfo.smallDept
- yiZhuData.value.execUnitName = props.patientInfo.smallDeptName
- }
- } else if (props.patientInfo.smallDept && row.execUnit.startsWith("8")) {
- yiZhuData.value.execUnit = props.patientInfo.smallDept
- yiZhuData.value.execUnitName = props.patientInfo.smallDeptName
- }
- if (!yiZhuData.value.frequCode) {
- yiZhuData.value.frequCode = 'ONCE'
- yiZhuData.value.frequCodeName = '一次'
- }
- try {
- pingLv.value.focus()
- } catch (e) {
- console.log(e)
- }
- if (queryParam.frequCode === 1) {
- yiZhuData.value.frequCode = 'ONCE'
- yiZhuData.value.frequCodeName = '一次'
- }
- }
- // 如果搜索了医嘱那么 这里就需要 重新赋值,不认表格就没办法变化了,把原来的换掉
- for (let i = 0, len = yzData.value.length; i < len; i++) {
- let item = yzData.value[i]
- if (yiZhuData.value.actOrderNo === item.actOrderNo) {
- yzData.value[i] = yiZhuData.value
- return
- }
- }
- }
- /* 频率 */
- const pingLv = ref()
- const yaoPinPingLvData = ref([])
- // 获取药品频率
- const pinLvRemoteMethod = (val) => {
- huoQuZhuYuanPinLv(val).then((res) => {
- yaoPinPingLvData.value = res
- })
- }
- /*计算领量*/
- const jiSuanLingLiang = (val) => {
- if (jiLiangValue.value <= 0) return
- yiZhuData.value.drugQuan = Math.ceil(val / jiLiangValue.value)
- }
- /* 选择剂量 */
- const yaoPinJiLiangData = ref([])
- const jiLiangValue = ref(0)
- const xuanZheJiLiang = (val) => {
- jiLiangValue.value = val.value
- yiZhuData.value.dose = val.value
- jiSuanLingLiang(yiZhuData.value.dose)
- }
- /* 给药方式 */
- const geiYaoFangShiData = ref([])
- const geiYaoFangShiRemoteMethod = (val) => {
- huoQuGeiYaoFangShi(val).then((res) => {
- geiYaoFangShiData.value = res
- })
- }
- // 医嘱限制时间不能在之前
- const disabledDate = (time) => {
- if (props.patientInfo?.admissDate) {
- return time.getTime() < new Date(props.patientInfo?.admissDate).getTime() - 8.64e7
- }
- return true
- }
- /* 获取执行科室 */
- const zhiXingKeShiData = ref([])
- const metZhiXingKeShi = (val) => {
- huoQuZhiXinKeShi(val).then((res) => {
- zhiXingKeShiData.value = res
- })
- }
- /* 父医嘱 */
- const fuYiZhuData = ref([])
- const fuYiZhuClick = async () => {
- fuYiZhuData.value = []
- fuYiZhuData.value = await getParentOrders(props.patientInfo.inpatientNo, props.patientInfo.admissTimes)
- }
- const modifyDosingMethod = () => {
- if (yiZhuData.value.parentNo) {
- yiZhuData.value.supplyCode = '044'
- yiZhuData.value.supplyCodeName = '副药'
- }
- }
- /**
- * 添加医嘱
- * @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,
- data: yiZhuData.value
- }
- try {
- let res = await enterOrders(param)
- // 如果有错误信息 就 提示
- if (res !== null && res.error) {
- baoCunXinXiRef.value.openOrClose()
- errorMessageData.value = res.data
- return
- }
- props.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)
- }
- } else {
- qingKong()
- yiZhuData.value.actOrderNo = 'tempOrderNo'
- openSearch()
- }
- }
- const qingKong = () => {
- yaoPinJiLiangData.value = []
- jiLiangValue.value = 0
- tiShiBiaoTi.value = []
- tempData = null
- yiZhuData.value = {
- id: '',
- actOrderNo: null,
- orderName: '',
- orderCode: '',
- // 频率
- frequCode: '',
- frequCodeName: '',
- drugSpecification: '',
- dose: 0,
- // 领量
- doseUnit: '',
- doseUnitName: '',
- supplyCode: '',
- supplyCodeName: '',
- startTime: '',
- endTime: '',
- orderTime: '',
- doctorName: '',
- drugFlag: '',
- execUnit: '',
- execUnitName: '',
- parentNo: '',
- parentNoName: '',
- physicianName: '',
- discription: '',
- instruction: null,
- kfFlag: null,
- selfBuy: null,
- ybSelfFlag: '0',
- emergencyFlag: '0',
- drugQuan: 0,
- miniUnitName: '',
- serial: '',
- miniUnit: '',
- psFlag: false,
- kjywFlag: 0,
- yyfs: null,
- ssqk: null,
- yysj: null,
- zkObj: '',
- zkWardCode: '',
- zkDeptCode: '',
- statusFlag: '1'
- }
- }
- // 判断是否可以编辑
- const isEdit = computed(() => {
- return !!(stringIsBlank(yiZhuData.value.actOrderNo)
- || yiZhuData.value.statusFlag !== '1'
- || stringIsBlank(props.patientInfo.inpatientNo));
- })
- let baoCunXinXiRef = ref(null)
- const toAddAnOrder = async () => {
- if (stringIsBlank(props.patientInfo.inpatientNo)) {
- BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择患者')
- }
- if (stringIsBlank(yiZhuData.value.actOrderNo) || yiZhuData.value.actOrderNo === 'tempOrderNo') {
- BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择一个医嘱')
- }
- // 有 医嘱 不是 录入就说明在看医嘱 直接清空就可以了
- if (stringNotBlank(yiZhuData.value.orderCode) && yiZhuData.value.statusFlag !== '1') {
- qingKong()
- return
- }
- 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
- }
- 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()
- props.successfullyEntered(yiZhuData.value)
- } catch (e) {
- console.log(e)
- }
- }
- /**
- * 点击了确认医嘱
- */
- const confirmOrdersClick = async () => {
- try {
- let res = await confirmOrders(props.patientInfo)
- if (res !== null && res.error) {
- baoCunXinXiRef.value.openOrClose()
- errorMessageData.value = res.data
- }
- } catch (e) {
- }
- }
- const yzDialogRef = ref(null)
- const openTheOrderPopUpWindow = () => {
- if (!isEdit.value) {
- yzDialogRef.value.openOrClose(true)
- }
- }
- // 错误信息
- const errorMessageData = ref({})
- /**
- * 点击了查看错误信息
- * @param val 数据
- */
- const clickError = (val) => {
- 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)
- }
- }
- /**
- * 填充 数据
- * @param data
- */
- let tempData = null
- const fillData = async (data) => {
- await fuYiZhuClick()
- await xuanZhongFeiYong(data, 2)
- tempData = JSON.stringify(yiZhuData.value)
- }
- /**
- * 复制粘贴医嘱
- * @returns {Promise<void>}
- */
- const duplicateAndPaste = async () => {
- if (stringIsBlank(yiZhuData.value.actOrderNo)) {
- BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择医嘱')
- }
- let temp = clone(yiZhuData.value)
- qingKong()
- temp.actOrderNo = await getOrderNo()
- temp.statusFlag = '1'
- let newDate = await getServerDateApi()
- temp.orderTime = newDate
- temp.startTime = newDate
- temp.endTime = newDate
- temp.enterOper = store.getters['user/info'].code
- temp.enterOperName = store.getters['user/info'].name
- temp.signerName = ''
- temp.signer = ''
- temp.modifierName = ''
- temp.modifier = ''
- await xuanZhongFeiYong(temp)
- }
- // 删除医嘱
- const toDeleteAnOrderClick = () => {
- if (stringIsBlank(yiZhuData.value.actOrderNo)) {
- BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择要删除的医嘱')
- }
- ElMessageBox.confirm(`确认是否要删除<span style="color: red"> ${yiZhuData.value.orderName} </span>`, '提示', {
- type: 'warning',
- dangerouslyUseHTMLString: true
- }).then(() => {
- toDeleteAnOrder(yiZhuData.value.actOrderNo).then(() => {
- qingKong()
- props.successfullyEntered(yiZhuData.value)
- })
- })
- }
- const editorMainRef = ref()
- const parentNoRef = ref(null)
- const kfFlagRef = ref(null)
- const selfBuyRef = ref(null)
- const searchRef = ref(null)
- const elSelectFocus = (val) => {
- val.toggleMenu()
- }
- const elSelectBlur = (val) => {
- val.blur()
- }
- const openSearch = () => {
- if (isEdit.value) return
- searchRef.value.focus()
- }
- let shortcutKeyRegistration = {
- ctrl: {s: toAddAnOrder, f: openSearch},
- alt: {a: addOrderNo}
- }
- onActivated(() => {
- xcHotKey(shortcutKeyRegistration)
- })
- const editingAreaRef = ref()
- onMounted(async () => {
- await nextTick();
- // 获取编辑器的宽度
- winsize.value.editor = editingAreaRef.value.clientWidth
- let inputs = editorMainRef.value.querySelectorAll('input')
- for (let i = 1, len = inputs.length - 2; i < len; i++) {
- let item = inputs[i]
- item.addEventListener('keydown', async function (event) {
- if (event.keyCode === 13) {
- let tempIndex = 1
- if (inputs[i + 1].disabled) {
- tempIndex++
- }
- await Sleep(300)
- if (i === len - 1) {
- await toAddAnOrder()
- }
- item.blur()
- inputs[i + tempIndex].focus()
- }
- })
- }
- })
- defineExpose({
- addOrderNo,
- fillData,
- toDeleteAnOrderClick,
- confirmOrdersClick
- })
- </script>
- <style scoped lang="scss">
- .editing_area {
- position: relative;
- width: max-content;
- }
- .editor__title {
- background-color: #ffdb04;
- padding: 5px;
- width: 100%;
- overflow-x: auto;
- }
- .yz_editor__disable {
- position: absolute;
- height: 100%;
- width: 100%;
- z-index: 89;
- &::before {
- position: absolute;
- content: '禁止编辑';
- right: 0;
- color: red;
- }
- }
- .yz_input__box {
- display: flex;
- margin-top: 6px;
- flex-wrap: wrap;
- div {
- margin-left: 3px;
- }
- .div_center__box {
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .input__style {
- width: 125px;
- line-height: 22px;
- height: 22px;
- border: 1px solid
- }
- }
- </style>
|