|
@@ -1,25 +1,32 @@
|
|
|
<script setup lang="ts">
|
|
|
-import {stringIsBlank} from "../../../../../../utils/blank-utils";
|
|
|
+import {stringIsBlank, stringNotBlank} from "@/utils/blank-utils";
|
|
|
import {
|
|
|
associateOrders,
|
|
|
- clearAssociate, openDrugManual,
|
|
|
+ clearAssociate, openDrugManual,
|
|
|
tempYzData, yiZhuData, yzMitt,
|
|
|
yzSize,
|
|
|
YzType
|
|
|
-} 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 {ref, h, reactive, onMounted, nextTick} from 'vue'
|
|
|
import {VxeTableInstance, VxeTablePropTypes} from 'vxe-table'
|
|
|
-import {nullToEmpty} from '../../../../../../utils/public'
|
|
|
-import {getFormatDatetime} from '../../../../../../utils/date'
|
|
|
-import {getServerDateApi} from '../../../../../../api/public-api'
|
|
|
+import {nullToEmpty} from '@/utils/public'
|
|
|
+import {getFormatDatetime} from '@/utils/date'
|
|
|
+import {getServerDateApi} from '@/api/public-api'
|
|
|
import XEUtils from "xe-utils";
|
|
|
-import {updateOrderInstruction} from '../../../../../../api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
|
|
|
+import {updateOrderInstruction} from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
|
|
|
import sleep from "../../../../../../utils/sleep";
|
|
|
+import {
|
|
|
+ ElButton,
|
|
|
+ ElButtonGroup
|
|
|
+} from "element-plus";
|
|
|
+import {xcMessage} from "@/utils/xiaochan-element-plus";
|
|
|
|
|
|
const {height} = defineProps({
|
|
|
height: [Number, null]
|
|
|
})
|
|
|
|
|
|
+const emits = defineEmits(['rowClick', 'voidOrders'])
|
|
|
+
|
|
|
const tableRef = ref<VxeTableInstance>(null)
|
|
|
|
|
|
const toggleAllCheckboxEvent = () => {
|
|
@@ -54,7 +61,11 @@ const menuConfig = reactive<VxeTablePropTypes.MenuConfig>({
|
|
|
{code: 'copy', name: '复制', prefixIcon: 'vxe-icon-copy'}
|
|
|
],
|
|
|
[
|
|
|
- {code: 'paste', name: '粘贴', prefixIcon: 'vxe-icon-paste'}
|
|
|
+ {
|
|
|
+ code: 'paste',
|
|
|
+ name: '粘贴',
|
|
|
+ prefixIcon: 'vxe-icon-paste'
|
|
|
+ }
|
|
|
],
|
|
|
[
|
|
|
{code: 'relevancy', name: '关联'}
|
|
@@ -63,17 +74,42 @@ const menuConfig = reactive<VxeTablePropTypes.MenuConfig>({
|
|
|
{code: 'exitTheAssociation', name: '退出关联'}
|
|
|
],
|
|
|
[
|
|
|
- {code: 'instructions', name: '说明书'}
|
|
|
+ {
|
|
|
+ code: 'instructions',
|
|
|
+ name: '说明书'
|
|
|
+ }
|
|
|
],
|
|
|
+ [
|
|
|
+ {
|
|
|
+ code: 'stopTime',
|
|
|
+ name: '停止医嘱'
|
|
|
+ }
|
|
|
+ ]
|
|
|
],
|
|
|
},
|
|
|
- visibleMethod({options, column}) {
|
|
|
+ visibleMethod({options, column, row}) {
|
|
|
options.forEach(list => {
|
|
|
list.forEach((item) => {
|
|
|
- item.disabled = !column;
|
|
|
+ item.disabled = true
|
|
|
+
|
|
|
if (item.code === 'paste') {
|
|
|
item.disabled = !yzMitt.emit('allowReplication')
|
|
|
}
|
|
|
+
|
|
|
+ if (row) {
|
|
|
+ if (['copy', 'relevancy', 'exitTheAssociation'].includes(item.code)) {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (['relevancy', 'instructions'].includes(item.code)) {
|
|
|
+ item.disabled = row.serial == '00'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.code === 'stopTime') {
|
|
|
+ item.disabled = !showEndTime(row)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
})
|
|
|
return true
|
|
@@ -90,19 +126,31 @@ const rightFunc = {
|
|
|
"paste": (data: YzType) => {
|
|
|
yzMitt.emit('paste')
|
|
|
},
|
|
|
- "relevancy": (data: YzType) => {
|
|
|
- yzMitt.emit('clickAssociate', data)
|
|
|
+ "relevancy": async (data: YzType) => {
|
|
|
+ if (canBeAssociated(data, true)) {
|
|
|
+ if (associateOrders.value.actOrderNo === null) {
|
|
|
+ await yzMitt.emit('queryYz')
|
|
|
+ associateOrders.value.actOrderNo = data.actOrderNo
|
|
|
+ } else {
|
|
|
+ xcMessage.error('请先确认当前关联医嘱。')
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
"exitTheAssociation": (data: YzType) => {
|
|
|
clearAssociate()
|
|
|
},
|
|
|
"instructions": (data: YzType) => {
|
|
|
- if (data.groupNo !== '00') {
|
|
|
- openDrugManual(data.orderCode, data.serial)
|
|
|
- }
|
|
|
+ openDrugManual(data.orderCode, data.serial)
|
|
|
},
|
|
|
+ "stopTime": (data) => {
|
|
|
+ if (tableRef.value.isCheckedByCheckboxRow(data)) {
|
|
|
+ cancelStopTime(data)
|
|
|
+ } else {
|
|
|
+ setDefaultStopTime({row: data})
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-// 触发鼠标右键的时间
|
|
|
+// 触发鼠标右键的事件
|
|
|
const tableRightClick = (val: MenuClick) => {
|
|
|
let {row, menu} = val
|
|
|
try {
|
|
@@ -111,6 +159,25 @@ const tableRightClick = (val: MenuClick) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function canBeAssociated(data: YzType, showMessage = false) {
|
|
|
+
|
|
|
+ function message(message) {
|
|
|
+ showMessage && xcMessage.error(message);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (stringNotBlank(data.parentNo)) {
|
|
|
+ message('该医嘱已经有父医嘱了。');
|
|
|
+ return false
|
|
|
+ } else if (data.statusFlag !== '1') {
|
|
|
+ message('不是录入状态的医嘱无法关联。');
|
|
|
+ return false
|
|
|
+ } else if (data.serial === '00') {
|
|
|
+ message('项目无法关联。');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+}
|
|
|
+
|
|
|
const twinkleList = ref({})
|
|
|
const rowClassName = ({row, rowIndex}) => {
|
|
|
let data = row as YzType
|
|
@@ -192,11 +259,14 @@ const timeFomat = (val) => {
|
|
|
}
|
|
|
|
|
|
const showEndTime = (data: YzType) => {
|
|
|
+ if (!data) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
return stringIsBlank(data.endTime) && stringIsBlank(data.parentNo) && data.frequCode !== 'ONCE';
|
|
|
}
|
|
|
|
|
|
const rowClick = ({row}) => {
|
|
|
- yzMitt.emit('rowClick', row)
|
|
|
+ emits('rowClick', row)
|
|
|
}
|
|
|
|
|
|
const endDateStyle = (item) => {
|
|
@@ -304,7 +374,7 @@ onMounted(() => {
|
|
|
{{ timeFomat(row.startTime) }}
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
- <vxe-column field="endTime" title="结束时间" width="140">
|
|
|
+ <vxe-column field="endTime" title="结束时间" width="150">
|
|
|
<template #default="scope">
|
|
|
<input v-if="showEndTime(scope.row)"
|
|
|
type='datetime-local'
|
|
@@ -353,35 +423,32 @@ onMounted(() => {
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
|
|
|
- <vxe-column field="right" title="操作" width="100" fixed="right">
|
|
|
- <template #default="scope">
|
|
|
- <div class="yz_button">
|
|
|
- <div class="toVoid">作废</div>
|
|
|
- <div class="delete">删除</div>
|
|
|
- </div>
|
|
|
+ <vxe-column field="right" title="操作" width="95" fixed="right">
|
|
|
+ <template #default="{row}">
|
|
|
+ <el-button-group
|
|
|
+ >
|
|
|
+ <el-button text
|
|
|
+ type="warning"
|
|
|
+ @click.stop.prevent="emits('voidOrders', row)"
|
|
|
+ >
|
|
|
+ 作废
|
|
|
+ </el-button>
|
|
|
+ <el-button text
|
|
|
+ type="danger"
|
|
|
+ @click.stop.prevent="yzMitt.emit('deleteAnOrderByOrderNo', row, false)"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </el-button-group>
|
|
|
+
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
-
|
|
|
-
|
|
|
</vxe-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
-.new_order {
|
|
|
- position: relative;
|
|
|
-
|
|
|
- &:before {
|
|
|
- position: absolute;
|
|
|
- right: -6px;
|
|
|
- font-size: 15px;
|
|
|
- top: -5px;
|
|
|
- content: "*";
|
|
|
- color: red;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
@keyframes hzfirst {
|
|
|
from {
|
|
|
background-color: #95d475
|
|
@@ -391,29 +458,6 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.yz_button {
|
|
|
- width: 100%;
|
|
|
- cursor: pointer;
|
|
|
- padding: 0 5px;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
-
|
|
|
- div {
|
|
|
- width: max-content;
|
|
|
- margin: 0 5px;
|
|
|
- }
|
|
|
-
|
|
|
- .toVoid {
|
|
|
- color: #E6A23C;
|
|
|
- background-color: inherit;
|
|
|
- }
|
|
|
-
|
|
|
- .delete {
|
|
|
- color: #F56C6C;
|
|
|
- background-color: inherit;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
.animation_hzfirst {
|
|
|
td {
|
|
|
animation: hzfirst 1s linear infinite
|