ecg-form/src/views/applyregistration/applyform/GuidePrint.vue

162 lines
4.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<!-- <el-form
ref="Print"
:model=applyFormVO
:rules="formRules"
label-width="100px"
v-loading="formLoading"
> -->
<div class="flex-center" id="printMe">
<div>
<h2 style="width: 500px;text-align: center;text-decoration: underline;">导引单</h2>
<table width="500px" border="1" style="border-collapse: collapse;">
<tr>
<td>姓名</td>
<td>{{applyFormVO?.pname}}</td>
<td>来源</td>
<td>{{applyFormVO?.regSource}}</td>
<td>性别</td>
<td>{{applyFormVO?.gender}}</td>
<td>登记单号</td>
<td>{{applyFormVO?.regId}}</td>
</tr>
<tr>
<td colspan="2">执行科室</td>
<td colspan="2">{{applyFormVO?.deviceDepartment}}</td>
<td colspan="2" style="text-align: center;">检查项目</td>
<td colspan="3" >{{applyFormVO?.examItemName}}</td>
</tr>
<tr>
<td colspan="2">检查设备</td>
<td colspan="6">{{applyFormVO?.deviceName}}</td>
</tr>
<tr>
<td colspan="2">分检时间</td>
<td colspan="6">{{applyFormVO?.sortDate}}</td>
</tr>
<tr>
<td colspan="2">检查状态</td>
<td colspan="6">{{applyFormVO?.examStatus}}</td>
</tr>
<tr>
<td colspan="2">开单医生</td>
<td colspan="3">{{applyFormVO?.billgDoctor}}</td>
<td colspan="2" style="text-align: center;">分检医生</td>
<td colspan="3">{{applyFormVO?.sortDoctor}}</td>
</tr>
<tr>
<td colspan="2" rowspan="3">备注</td>
<td colspan="6" rowspan="3" align="left"></td>
</tr>
</table>
</div>
</div>
<!-- </el-form> -->
<template #footer>
<el-button type="primary" :disabled="formLoading" v-print="'printMe'">打印</el-button>
<el-button @click="dialogVisible = false">关闭</el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { ApplyformApi, ApplyformVO,UPFJApplyformVO } from '@/api/applyregistration/applyform'
import print from "vue3-print-nb";
/** 申请登记记录 打印表单 */
defineOptions({ name: 'GuidePrint' })
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const upFJApplyformVO = ref<UPFJApplyformVO[]>([]);
const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中1修改时的数据加载2提交的按钮禁用
const formData = ref({
id: undefined,
regId: undefined,
regSource: undefined,
examId: undefined,
pname: undefined,
gender: undefined,
birthday: undefined,
examDate: undefined,
examItemName: undefined,
deviceId: undefined,
deviceName: undefined,
contactTel: undefined,
regDate: undefined,
sortDate: undefined,
billgDoctor: undefined,
examStatus: undefined,
billDoctorDepartment: undefined,
createDate: undefined,
examItemCode: undefined,
orgId: undefined,
sortDoctor: undefined,
deviceDepartment:undefined,
})
const applyFormVO = ref<ApplyformVO>({} as ApplyformVO);
const fordevicemValue = ref('')
const fordevicemData = ref<any[]>([])
const formRules = reactive({
})
const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const open = async (id:number) => {
dialogVisible.value = true
dialogTitle.value ="打印导引单"
// 提交请求
formLoading.value = true
try {
applyFormVO.value= await ApplyformApi.getApplyform(id)
} finally {
formLoading.value = false
}
}
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
//打印方法 暂时不需要 使用v-print
const PrintForm = () => {
// window.print()
// 发送操作成功的事件
emit('success')
}
/** 重置表单 */
const resetForm = () => {
fordevicemData.value =[]
fordevicemValue.value=''
upFJApplyformVO.value=[]
formRef.value?.resetFields()
}
</script>
<style scoped>
.flex-center {
display: flex;
justify-content: center;
align-items: center;
}
</style>