|
@@ -0,0 +1,153 @@
|
|
|
+<template>
|
|
|
+ <div class="layout_container">
|
|
|
+ <header class="round-header">
|
|
|
+ <el-date-picker
|
|
|
+ type="daterange"
|
|
|
+ v-model="daterange"
|
|
|
+ :shortcuts="shortcuts"
|
|
|
+ style="width: 200px"
|
|
|
+ :clearable="false"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="inquiry.patNo"
|
|
|
+ clearable
|
|
|
+ placeholder="住院号/门诊ID"
|
|
|
+ style="width: 100px;margin-left: 12px"
|
|
|
+ />
|
|
|
+ <el-divider direction="vertical" />
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="getYjReq"
|
|
|
+ >
|
|
|
+ 查询医技申请
|
|
|
+ </el-button>
|
|
|
+ </header>
|
|
|
+ <div class="layout_container layout-horizontal">
|
|
|
+ <aside class="layout_el-table">
|
|
|
+ <el-table
|
|
|
+ :data="yjReqList"
|
|
|
+ stripe
|
|
|
+ highlight-current-row
|
|
|
+ @row-click="handleClickRow"
|
|
|
+ >
|
|
|
+ <el-table-column prop="patNo" :label="patNoType" width="70"/>
|
|
|
+ <el-table-column prop="patName" label="患者姓名" width="70" />
|
|
|
+ <el-table-column prop="reqNo" label="申请号" width="90" />
|
|
|
+ <el-table-column prop="groupName" label="申请内容" width="140" />
|
|
|
+ <el-table-column prop="reqDate" label="申请时间" width="130" />
|
|
|
+ </el-table>
|
|
|
+ </aside>
|
|
|
+ <div class="layout_main">
|
|
|
+ <div>
|
|
|
+ 报告文件:请上传报告pdf文件
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ ref="upload"
|
|
|
+ :action="apiUrl + '/yjReq/uploadYjPdf'"
|
|
|
+ :headers="header"
|
|
|
+ :file-list="fileList"
|
|
|
+ :limit="1"
|
|
|
+ :data="currentReq"
|
|
|
+ :on-exceed="fileSizeOutLimit"
|
|
|
+ :on-success="uploadSuccess"
|
|
|
+ :on-error="uploadError"
|
|
|
+ :auto-upload="false"
|
|
|
+ accept=".pdf"
|
|
|
+ >
|
|
|
+ <template #trigger>
|
|
|
+ <el-button type="primary" icon="Picture">选取文件</el-button>
|
|
|
+ </template>
|
|
|
+ <el-button
|
|
|
+ style="margin-left: 10px"
|
|
|
+ type="success"
|
|
|
+ icon="Upload"
|
|
|
+ @click="submitUpload"
|
|
|
+ >上传到服务器
|
|
|
+ </el-button>
|
|
|
+ <template #tip>
|
|
|
+ <div class="el-upload__tip">
|
|
|
+ 只能上传 pdf 文件
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import {queryYjReqIndex,uploadYjPdf} from "@/api/inspections/yj-req.js";
|
|
|
+import {shortcuts} from "@/data/shortcuts.js";
|
|
|
+import {getDateRangeFormatDate, getOneMonthOffset} from "@/utils/date.js";
|
|
|
+import { isDev } from "@/utils/public";
|
|
|
+import env from "@/utils/setting";
|
|
|
+import {ref} from "vue";
|
|
|
+import {ElMessage} from "element-plus";
|
|
|
+import {xcMessage} from "@/utils/xiaochan-element-plus";
|
|
|
+
|
|
|
+const daterange = ref([])
|
|
|
+const inquiry = reactive({
|
|
|
+ patNo: '',
|
|
|
+ start: '',
|
|
|
+ end: ''
|
|
|
+})
|
|
|
+
|
|
|
+const patNoType = computed(() => {
|
|
|
+ if (yjReqList.value.length === 0) {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ let req = yjReqList.value[0]
|
|
|
+ return req.patientType === 'INPATIENT' ? '住院号' : '门诊ID'
|
|
|
+})
|
|
|
+const yjReqList = ref([])
|
|
|
+function getYjReq() {
|
|
|
+ const m = getDateRangeFormatDate(daterange.value)
|
|
|
+ inquiry.start = m.startTime
|
|
|
+ inquiry.end = m.endTime
|
|
|
+ queryYjReqIndex(inquiry).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ yjReqList.value = res
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const upload = ref(null);
|
|
|
+const currentReq = ref({})
|
|
|
+const apiUrl = env.VITE_BASE_URL;
|
|
|
+const header = {
|
|
|
+ token: localStorage.token,
|
|
|
+};
|
|
|
+
|
|
|
+function handleClickRow(row) {
|
|
|
+ currentReq.value = row
|
|
|
+}
|
|
|
+
|
|
|
+const fileList = ref([]);
|
|
|
+const submitUpload = () => {
|
|
|
+ if (!currentReq.value.reqNo) {
|
|
|
+ xcMessage.warning('请先选择一条医技申请!')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ upload.value.submit();
|
|
|
+};
|
|
|
+const fileSizeOutLimit = () => {
|
|
|
+ ElMessage.error("已经选取报告文件,如须更换请先移除已选取的文件!");
|
|
|
+};
|
|
|
+const uploadSuccess = () => {
|
|
|
+ ElMessage.success("上传成功!");
|
|
|
+ fileList.value = [];
|
|
|
+};
|
|
|
+const uploadError = () => {
|
|
|
+ ElMessage.error("上传失败!");
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ const m = getOneMonthOffset()
|
|
|
+ daterange.value[0] = m.start
|
|
|
+ daterange.value[1] = m.end
|
|
|
+ if (isDev) {
|
|
|
+ daterange.value[0] = '2025-06-01'
|
|
|
+ inquiry.patNo = '317452-0'
|
|
|
+ }
|
|
|
+})
|
|
|
+</script>
|