Merge branch 'main' of http://47.97.125.165:8902/jiangs/lis8.0-vue3
This commit is contained in:
commit
5a3fb07f49
@ -19,3 +19,67 @@ export function fetchCodeList(query?: Object) {
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 查询项目
|
||||
export function fetchCodeDetail(query?: Object) {
|
||||
return request({
|
||||
url: 'zyreq/detail',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 执行条码
|
||||
export function fetchCodeExec(query?: Object) {
|
||||
return request({
|
||||
url: '/zyreq/exec',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 获取申请单主表信息
|
||||
export function fetchCodeReqmain(query?: Object) {
|
||||
return request({
|
||||
url: 'zyreq/reqmain',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 查询报告单列表
|
||||
export function reportList(query?: Object) {
|
||||
return request({
|
||||
url: '/report/ReportList',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 查询报告Pdf
|
||||
export function reportPrintPdf(query?: Object) {
|
||||
return request({
|
||||
url: '/report/pdf',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 查询项目报告
|
||||
export function reportResult(query?: Object) {
|
||||
return request({
|
||||
url: '/report/result',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 查询微生物报告
|
||||
export function reportMedList(query?: Object) {
|
||||
return request({
|
||||
url: '/report/MedList',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 查询微生物报告
|
||||
export function reportFsresult(query?: Object) {
|
||||
return request({
|
||||
url: '/report/fsresult',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
@ -2,37 +2,45 @@ import request from '@/utils/request'
|
||||
|
||||
// 查询字典数据列表
|
||||
export function queryComDictListService(query) {
|
||||
return request({
|
||||
url: '/comdict/query',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/comdict/query',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
//增加字典数据
|
||||
export function addComDictService(data) {
|
||||
return request({
|
||||
url: '/comdict/add',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: '/comdict/add',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//修改字典数据
|
||||
export function updateComDictService(data) {
|
||||
return request({
|
||||
url: '/comdict/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: '/comdict/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
||||
}
|
||||
//删除字典数据
|
||||
export function delComDictService(data) {
|
||||
return request({
|
||||
url: '/comdict/del',
|
||||
method: 'delete',
|
||||
data
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 根据字典类型查询字典数据信息
|
||||
export function getComDicts(zdlb) {
|
||||
return request({
|
||||
url: '/comdict/getComDicts',
|
||||
method: 'get',
|
||||
params: zdlb
|
||||
})
|
||||
return request({
|
||||
url: '/comdict/getComDicts',
|
||||
method: 'get',
|
||||
params: zdlb
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="custom-table-wrapper">
|
||||
<!-- 表格主体 -->
|
||||
<el-table ref="tableRef" :data="tableData" :loading="loading" :stripe="config.stripe || false"
|
||||
<el-table ref="tableRef" :data="tableData" v-loading="loading" :stripe="config.stripe || false"
|
||||
:border="config.border" :fit="config.fit !== true" :show-header="config.showHeader !== false"
|
||||
:highlight-current-row="config.highlightCurrentRow || false" :row-class-name="config.rowClassName"
|
||||
:header-cell-style="config.headerCellStyle" :cell-style="config.cellStyle" :max-height="config.maxHeight"
|
||||
@ -18,12 +18,12 @@
|
||||
|
||||
<!-- 动态列 -->
|
||||
<template v-for="item in columns" :key="item.prop || item.key">
|
||||
<!-- 自定义插槽列 -->
|
||||
<!-- 自定义插槽列 行数据插槽(有row属性) -->
|
||||
<el-table-column v-if="item.slot && item.visible" :prop="item.prop" :label="item.label" :width="item.width"
|
||||
:min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'left'" :sortable="item.sortable"
|
||||
:show-overflow-tooltip="item.showOverflowTooltip !== false">
|
||||
<template #default="scope">
|
||||
<slot :name="item.slot" :row="scope.row" :column="scope.column" :$index="scope.$index" />
|
||||
<slot :name="item.slot" :row="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
<el-table-column v-if="!item.slot && item.visible" :prop="item.prop" :label="item.label" :width="item.width"
|
||||
:min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'left'" :sortable="item.sortable"
|
||||
:show-overflow-tooltip="item.showOverflowTooltip !== false" :formatter="item.formatter">
|
||||
<!-- 表头插槽 -->
|
||||
<!-- 表头插槽 (无row属性)-->
|
||||
<template v-if="item.headerSlot" #header="scope">
|
||||
<slot :name="item.headerSlot" :column="scope.column" :$index="scope.$index" />
|
||||
</template>
|
||||
@ -83,6 +83,12 @@ interface TableColumn {
|
||||
visible?: boolean; // 是否显示列
|
||||
}
|
||||
|
||||
// 在子组件中定义插槽类型
|
||||
defineSlots<{
|
||||
// 具名插槽和动态插槽(不含 default)
|
||||
[slotName: string]: (props: { row?: any; column?: any; $index?: number }) => any;
|
||||
}>();
|
||||
|
||||
// Props 定义
|
||||
const props = defineProps({
|
||||
// 表格数据
|
||||
|
||||
@ -1,11 +1,21 @@
|
||||
import axios from 'axios'
|
||||
import { ElLoading, ElMessage } from 'element-plus'
|
||||
import { saveAs } from 'file-saver'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import {
|
||||
ElLoading,
|
||||
ElMessage
|
||||
} from 'element-plus'
|
||||
import {
|
||||
saveAs
|
||||
} from 'file-saver'
|
||||
import {
|
||||
getToken
|
||||
} from '@/utils/auth'
|
||||
import errorCode from '@/utils/errorCode'
|
||||
import { blobValidate } from '@/utils/ruoyi'
|
||||
import {
|
||||
blobValidate
|
||||
} from '@/utils/ruoyi'
|
||||
|
||||
const baseURL = import.meta.env.VITE_APP_BASE_API
|
||||
const baseURL =
|
||||
import.meta.env.VITE_APP_BASE_API
|
||||
let downloadLoadingInstance;
|
||||
|
||||
export default {
|
||||
@ -15,7 +25,14 @@ export default {
|
||||
method: 'get',
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
},
|
||||
onDownloadProgress: (progressEvent) => {
|
||||
console.log(progressEvent)
|
||||
//progressEvent.loaded 下载文件的当前大小
|
||||
//progressEvent.total 下载文件的总大小 如果后端没有返回 请让他加上
|
||||
}
|
||||
}).then((res) => {
|
||||
const isBlob = blobValidate(res.data);
|
||||
if (isBlob) {
|
||||
@ -32,7 +49,9 @@ export default {
|
||||
method: 'get',
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
}
|
||||
}).then((res) => {
|
||||
const isBlob = blobValidate(res.data);
|
||||
if (isBlob) {
|
||||
@ -45,16 +64,23 @@ export default {
|
||||
},
|
||||
zip(url, name) {
|
||||
var url = baseURL + url
|
||||
downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)", })
|
||||
downloadLoadingInstance = ElLoading.service({
|
||||
text: "正在下载数据,请稍候",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
})
|
||||
axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
}
|
||||
}).then((res) => {
|
||||
const isBlob = blobValidate(res.data);
|
||||
if (isBlob) {
|
||||
const blob = new Blob([res.data], { type: 'application/zip' })
|
||||
const blob = new Blob([res.data], {
|
||||
type: 'application/zip'
|
||||
})
|
||||
this.saveAs(blob, name)
|
||||
} else {
|
||||
this.printErrMsg(res.data);
|
||||
@ -76,4 +102,3 @@ export default {
|
||||
ElMessage.error(errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
83
src/utils/classCom.ts
Normal file
83
src/utils/classCom.ts
Normal file
@ -0,0 +1,83 @@
|
||||
|
||||
/**
|
||||
* 颜色处理工具类
|
||||
* 提供十进制颜色值转十六进制颜色码(支持BGR转RGB)及文字对比度计算功能
|
||||
*/
|
||||
|
||||
function decimalToHexColor(decimal: number | string): string {
|
||||
// 处理空值和非数字情况
|
||||
if (decimal === undefined || decimal === null || decimal === '') {
|
||||
return '#FFFFFF';
|
||||
}
|
||||
|
||||
// 统一转换为数字类型
|
||||
const num = typeof decimal === 'string' ? parseFloat(decimal) : decimal;
|
||||
if (isNaN(num)) {
|
||||
return '#FFFFFF';
|
||||
}
|
||||
|
||||
// 十进制转十六进制并转为大写
|
||||
let hex = Math.floor(num).toString(16).toUpperCase();
|
||||
|
||||
// 确保十六进制字符串为6位,不足则补0
|
||||
if (hex.length < 6) {
|
||||
hex = hex.padStart(6, '0');
|
||||
}
|
||||
|
||||
// BGR转RGB(交换前后两位)
|
||||
const r = hex.substring(4, 6);
|
||||
const g = hex.substring(2, 4);
|
||||
const b = hex.substring(0, 2);
|
||||
const rgbHex = r + g + b;
|
||||
|
||||
return `#${rgbHex}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据背景色计算对比度文字颜色(黑/白)
|
||||
* @param bgColor 十六进制背景色(如#FFFF80)
|
||||
* @returns 对比度文字颜色(#333333或#FFFFFF)
|
||||
*/
|
||||
function getContrastTextColor(bgColor: string): string {
|
||||
// 验证颜色格式
|
||||
if (!/^#([0-9A-F]{6})$/i.test(bgColor)) {
|
||||
throw new Error('Invalid hex color format. Expected #RRGGBB');
|
||||
}
|
||||
|
||||
// 提取RGB分量
|
||||
const r = parseInt(bgColor.slice(1, 3), 16);
|
||||
const g = parseInt(bgColor.slice(3, 5), 16);
|
||||
const b = parseInt(bgColor.slice(5, 7), 16);
|
||||
|
||||
// 计算亮度(标准 luminance 公式)
|
||||
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
||||
|
||||
// 根据亮度返回对比色
|
||||
return luminance > 0.5 ? '#333333' : '#FFFFFF';
|
||||
}
|
||||
// 打印base64 pdf
|
||||
function printPDF(base64: string) {
|
||||
const blob = base64ToBlob(base64);
|
||||
const pdfUrl = URL.createObjectURL(blob);
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.style.display = 'none';
|
||||
iframe.src = pdfUrl;
|
||||
document.body.appendChild(iframe);
|
||||
iframe.onload = () => {
|
||||
iframe.contentWindow?.print();
|
||||
setTimeout(() => URL.revokeObjectURL(pdfUrl), 1000); // 释放内存
|
||||
};
|
||||
}
|
||||
|
||||
function base64ToBlob(base64: string) {
|
||||
const binaryString = atob(base64.replace(/[\n\r]/g, ''));
|
||||
const bytes = new Uint8Array(binaryString.length);
|
||||
for (let i = 0; i < binaryString.length; i++) {
|
||||
bytes[i] = binaryString.charCodeAt(i);
|
||||
}
|
||||
return new Blob([bytes], { type: 'application/pdf' });
|
||||
}
|
||||
|
||||
|
||||
export const classCom = { decimalToHexColor, getContrastTextColor, printPDF }
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
// src/utils/print-utils.ts
|
||||
// src/utils/hiprintPrinter.ts
|
||||
import { io, Socket } from "socket.io-client";
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { usePrintStore } from '@/store/modules/printStore'
|
||||
|
||||
import { onUnmounted } from "vue"
|
||||
// @ts-ignore
|
||||
import Download from '@/plugins/download';
|
||||
// ... 类型定义 ...
|
||||
type PrinterInfo = {
|
||||
name: string;
|
||||
@ -61,7 +63,7 @@ function initSocket(onPrinterUpdate?: OnPrinterUpdate) {
|
||||
socket.on("connect_error", (err: Error) => {
|
||||
console.log('连接错误', err);
|
||||
ElMessageBox.alert(
|
||||
`连接失败!<br>请确保目标服务器已<a style="color: #1f79db" href="https://gitee.com/CcSimple/electron-hiprint/releases" target="_blank"> 下载 </a> 并运行 打印服务!`,
|
||||
`连接失败!<br>请确保目标服务器已<a style="color: #1f79db" onclick="downExe()"> 下载 </a> 并运行 打印服务!`,
|
||||
"客户端未连接",
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
@ -70,8 +72,19 @@ function initSocket(onPrinterUpdate?: OnPrinterUpdate) {
|
||||
printStore.setConnected(false);
|
||||
socket?.close();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
const downExe = () => {
|
||||
// 下载逻辑实现
|
||||
console.log('开始下载打印服务');
|
||||
Download.name('hiprint_win_x64-1.0.13.exe')
|
||||
};
|
||||
|
||||
// 挂载到window,使其能被全局访问
|
||||
(window as any).downExe = downExe
|
||||
function silentPrintPdf(url: string, printOptions?: object) {
|
||||
const printStore = usePrintStore();
|
||||
if (!url) {
|
||||
@ -144,3 +157,9 @@ export const HiprintPrinter = {
|
||||
return printStore.defaultPrinter;
|
||||
},
|
||||
};
|
||||
|
||||
onUnmounted(() => {
|
||||
if ('downExe' in window) {
|
||||
delete (window as any).downExe;
|
||||
}
|
||||
});
|
||||
@ -4,22 +4,23 @@
|
||||
<el-row :gutter="10" class="compact-form" v-show="showSearch">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" :rules="queryRules">
|
||||
<el-form-item label="日期:" prop="failed1">
|
||||
<el-date-picker v-model="queryParams.failed1" type="daterange" range-separator="-" start-placeholder="开始时间"
|
||||
end-placeholder="结束时间" />
|
||||
<el-date-picker v-model="queryParams.times" type="datetimerange" range-separator="-"
|
||||
start-placeholder="开始时间" end-placeholder="结束时间" format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" @change="handletime" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="医疗机构:" prop="failed2">
|
||||
<el-select v-model="queryParams.failed2" placeholder="请选择">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-form-item label="医疗机构:" prop="yljg">
|
||||
<el-select v-model="queryParams.yljg" placeholder="请选择">
|
||||
<el-option v-for="item in dictData.HOS" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="条码状态:" prop="failed3">
|
||||
<el-select v-model="queryParams.failed3" placeholder="请选择" style="width: 120px;">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-form-item label="条码状态:" prop="zt">
|
||||
<el-select v-model="queryParams.zt" placeholder="请选择" style="width: 100px;">
|
||||
<el-option v-for="item in dictData.ST" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="failed4">
|
||||
<el-select v-model="queryParams.failed4" placeholder="请选择">
|
||||
<el-select v-model="queryParams.failed4" placeholder="请选择" style="width:140px">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -53,10 +54,10 @@
|
||||
<el-button type="success" plain @click="printHandle1">打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="openBlock">采样登记</el-button>
|
||||
<el-button type="info" plain icon="Upload" @click="openBlock('采样登记')">采样登记</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain @click="openSj">送检登记</el-button>
|
||||
<el-button type="warning" plain @click="openBlock('送检登记')">送检登记</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain @click="goReport">报告查询</el-button>
|
||||
@ -74,32 +75,51 @@
|
||||
:columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<CustomTable :data="tableData" :columns="columns" :config="tableConfig" :loading="loading">
|
||||
<template #tfailed5="{ row }">
|
||||
{{ row.tfailed5 }}
|
||||
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
|
||||
@row-click="rowHandle" @selection-change="selectionChange">
|
||||
<template #jzbz="{ row }">
|
||||
{{ row.jzbz == '1' ? '急诊' : '非急诊' }}
|
||||
</template>
|
||||
<template #jjzt="{ row }">
|
||||
{{ row.jjzt == '1' ? '计价' : '无' }}
|
||||
</template>
|
||||
<template #brly="{ row }">
|
||||
{{ formatDict(row.brly, 'PT') }}
|
||||
</template>
|
||||
<template #zt="{ row }">
|
||||
{{ formatDict(row.zt.trim(), 'ST') }}
|
||||
</template>
|
||||
<template #yljg="{ row }">
|
||||
{{ formatDict(row.yljg, 'HOS') }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8" class="right-table">
|
||||
<div class="title"> 项目 </div>
|
||||
<el-button type="danger" class="mb10">拆分选中项目</el-button>
|
||||
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig" :loading="loading">
|
||||
<!-- <el-button type="danger" class="mb10">拆分选中项目</el-button> -->
|
||||
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig">
|
||||
<template #jjzt="{ row }">
|
||||
{{ row.jjzt == '1' ? '计价' : '无' }}
|
||||
</template>
|
||||
<template #zt="{ row }">
|
||||
{{ formatDict(row.zt, 'ST') }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<!-- 采样登记 -->
|
||||
<el-dialog v-model="dialogVisible" title="采样登记" draggable :close-on-click-modal="false">
|
||||
<el-dialog v-model="dialogVisible" :title="title" draggable :close-on-click-modal="false" width="70vw"
|
||||
@close="closeDialog">
|
||||
<div class="flex-between">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-input v-model="queryParams.failed5" clearable placeholder="条形码" @keyup.enter="handleQuery"
|
||||
@clear="handleQuery" />
|
||||
<el-input v-model="sqhText" clearable placeholder="条形码" @keyup.enter="sqdQuery" @clear="sqdQuery" />
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain>读取</el-button>
|
||||
<el-button type="primary" @click="sqdQuery" plain>读取</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="delete">删除选中行</el-button>
|
||||
@ -108,66 +128,52 @@
|
||||
<el-button type="info" plain>打印</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-button type="primary" plain>保存</el-button>
|
||||
<!-- <el-button type="primary" plain>保存</el-button> -->
|
||||
</div>
|
||||
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig" :loading="loading">
|
||||
<CustomTable :data="cyTableData" :columns="cyColumns" :config="cyTableConfig">
|
||||
<template #zt="{ row }">
|
||||
{{ formatDict(row.zt, 'ST') }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
|
||||
</el-dialog>
|
||||
<!-- 送检登记 -->
|
||||
<el-dialog v-model="dialogSjVisible" title="送检登记" draggable :close-on-click-modal="false">
|
||||
<div class="flex-between">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-input v-model="queryParams.failed5" clearable placeholder="条形码" @keyup.enter="handleQuery"
|
||||
@clear="handleQuery" />
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain>读取</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="delete">删除选中行</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain>打印</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-button type="primary" plain>保存</el-button>
|
||||
</div>
|
||||
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig" :loading="loading">
|
||||
</CustomTable>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted, onUnmounted } from 'vue';
|
||||
import { HiprintPrinter } from '@/utils/print-utils';
|
||||
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted, } from 'vue';
|
||||
import { HiprintPrinter } from '@/utils/hiprintPrinter';
|
||||
import { classCom } from '@/utils/classCom';
|
||||
import CustomTable from '@/components/tableCom/index.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { usePrintStore } from '@/store/modules/printStore' // 引入 Pinia store
|
||||
import { fetchCodeList, addObj } from '@/api/checkCode/index'
|
||||
import { usePrintStore } from '@/store/modules/printStore'
|
||||
import { fetchCodeList, addObj, fetchCodeDetail, fetchCodeExec, fetchCodeReqmain } from '@/api/checkCode/index'
|
||||
import { TableColumnCtx } from 'element-plus';
|
||||
import dayjs from 'dayjs';
|
||||
//@ts-ignore
|
||||
import { comDict } from '@/utils/dict'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
const router = useRouter()
|
||||
const printStore = usePrintStore();
|
||||
const compactForm = ref<HTMLElement | null>(null);
|
||||
const heightForm = ref(90);
|
||||
const dialogVisible = ref(false)
|
||||
const openBlock = () => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const dialogSjVisible = ref(false)
|
||||
const openSj = () => {
|
||||
dialogSjVisible.value = true
|
||||
const title = ref('采样登记')
|
||||
const sqhText = ref('')
|
||||
const tableRef = ref()
|
||||
interface QueryParams {
|
||||
times: string[]; // 明确类型为字符串元组
|
||||
yljg: string;
|
||||
zt: string;
|
||||
failed4: string;
|
||||
failed5: string;
|
||||
}
|
||||
// 提交表单数据
|
||||
const queryParams = reactive({
|
||||
failed1: [],
|
||||
failed2: '',
|
||||
failed3: '',
|
||||
const queryParams = reactive<QueryParams>({
|
||||
times: ['2025-07-18 00:00:00', '2025-07-18 23:59:59'],
|
||||
// times: [],
|
||||
yljg: '1',
|
||||
zt: '',
|
||||
failed4: '',
|
||||
failed5: '',
|
||||
});
|
||||
@ -186,71 +192,69 @@ const queryRules = ref({
|
||||
})
|
||||
const options = [
|
||||
{
|
||||
value: 'Option1',
|
||||
label: 'Option1',
|
||||
value: '1',
|
||||
label: '通过姓名搜索',
|
||||
},
|
||||
{
|
||||
value: 'Option2',
|
||||
label: 'Option2',
|
||||
value: '2',
|
||||
label: '通过病人号搜索',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '通过床号搜索',
|
||||
},
|
||||
|
||||
]
|
||||
interface DictData {
|
||||
SX?: Array<any>;
|
||||
HOS?: Array<any>;
|
||||
[key: string]: any[] | undefined; // 添加索引签名以支持动态访问
|
||||
}
|
||||
// 字典数据存储
|
||||
const dictData = ref<DictData>({});
|
||||
const handleQuery = async () => {
|
||||
const valid = await queryRef.value.validate().catch(() => { });
|
||||
if (!valid) return false;
|
||||
getList()
|
||||
}
|
||||
// 重置
|
||||
const resetQuery = () => {
|
||||
queryRef.value?.resetFields();
|
||||
// download([20221201167817]).then(() => {
|
||||
// console.log('重置成功');
|
||||
// }).catch(() => {
|
||||
// console.log('重置失败');
|
||||
// });
|
||||
|
||||
getList()
|
||||
}
|
||||
|
||||
const loading = false;
|
||||
const loading = ref(true);
|
||||
|
||||
|
||||
|
||||
// 数据源
|
||||
const tableData = [
|
||||
{
|
||||
id: 1, tfailed2: '张三', tfailed1: 24, tfailed3: '男', tfailed4: '血常规', tfailed5: '常规检查',
|
||||
tfailed6: '无', tfailed7: '否', tfailed8: '血液样本', tfailed9: '1234567890', tfailed10: '内科', tfailed11: 'A1234567890',
|
||||
tfailed12: '待处理', tfailed13: '门诊', tfailed14: '王医生', tfailed15: '2023-10-01 10:00', tfailed16: '计价标志', tfailed17: '执行医生', tfailed18: '送检人', tfailed19: '医疗机构'
|
||||
},
|
||||
{
|
||||
id: 2, tfailed2: '李四', tfailed1: 25, tfailed3: '男', tfailed4: '血常规', tfailed5: '常规检查',
|
||||
tfailed6: '无', tfailed7: '否', tfailed8: '血液样本', tfailed9: '1234567890', tfailed10: '内科', tfailed11: 'A1234567890',
|
||||
tfailed12: '待处理', tfailed13: '门诊', tfailed14: '王医生', tfailed15: '2023-10-01 10:00', tfailed16: '计价标志', tfailed17: '执行医生', tfailed18: '送检人', tfailed19: '医疗机构'
|
||||
}
|
||||
]
|
||||
const tableData = ref([])
|
||||
// 配置项
|
||||
const columns = ref([
|
||||
{ prop: 'tfailed1', label: '床号', visible: true, key: 0, sortable: true, width: '110px' },
|
||||
{ prop: 'tfailed2', label: '姓名', visible: true, key: 1, width: '110px' },
|
||||
{ prop: 'tfailed3', label: '性别', align: 'center', visible: true, key: 2, },
|
||||
{ prop: 'tfailed4', label: '项目名称', align: 'center', visible: true, key: 3, width: '110px' },
|
||||
{ prop: 'tfailed5', label: '类别', align: 'center', visible: true, key: 4, slot: 'tfailed5', width: '110px' },
|
||||
{ prop: 'tfailed6', label: '采样提示', align: 'center', visible: true, key: 5, width: '110px' },
|
||||
{ prop: 'tfailed7', label: '急诊', align: 'center', visible: true, key: 6, width: '110px' },
|
||||
{ prop: 'tfailed8', label: '样本类型', align: 'center', visible: true, key: 7, width: '110px' },
|
||||
{ prop: 'tfailed9', label: '病人号', align: 'center', visible: true, key: 8, width: '110px' },
|
||||
{ prop: 'tfailed10', label: '科室名称', align: 'center', visible: true, key: 9, width: '110px' },
|
||||
{ prop: 'tfailed11', label: '申请号/条码', align: 'center', visible: true, key: 10, width: '110px' },
|
||||
{ prop: 'tfailed12', label: '状态', align: 'center', visible: true, key: 11, width: '110px' },
|
||||
{ prop: 'tfailed13', label: '病人来源', align: 'center', visible: true, key: 12, width: '110px' },
|
||||
{ prop: 'tfailed14', label: '申请医生', align: 'center', visible: true, key: 13, width: '110px' },
|
||||
{ prop: 'tfailed15', label: '申请时间', align: 'center', visible: true, key: 14, width: '150px' },
|
||||
{ prop: 'tfailed16', label: '计价标志', align: 'center', visible: true, key: 15, width: '110px' },
|
||||
{ prop: 'tfailed17', label: '执行医生', align: 'center', visible: true, key: 16, width: '110px' },
|
||||
{ prop: 'tfailed18', label: '送检人', align: 'center', visible: true, key: 17, width: '110px' },
|
||||
{ prop: 'tfailed19', label: '医疗机构', align: 'center', visible: true, key: 18, width: '110px' },
|
||||
{ prop: 'ch', label: '床号', visible: true, key: 0, sortable: true, },
|
||||
{ prop: 'brxm', label: '姓名', visible: true, key: 1, },
|
||||
{ prop: 'brxbname', label: '性别', align: 'center', visible: true, key: 2, },
|
||||
{ prop: 'jymd', label: '项目名称', align: 'center', visible: true, key: 3, width: '140px' },
|
||||
{ prop: 'bgddhname', label: '类别', align: 'center', visible: true, key: 4, width: '120px' },
|
||||
{ prop: 'sampletips', label: '采样提示', align: 'center', visible: true, key: 5, width: '110px' },
|
||||
{ prop: 'jzbz', label: '急诊', align: 'center', visible: true, slot: 'jzbz', key: 6, width: '110px' },
|
||||
{ prop: 'yblx', label: '样本类型', align: 'center', visible: true, key: 7, width: '110px' },
|
||||
{ prop: 'brdh', label: '病人号', align: 'center', visible: true, key: 8, width: '110px' },
|
||||
{ prop: 'ksname', label: '科室名称', align: 'center', visible: true, key: 9, width: '110px' },
|
||||
{ prop: 'sqh', label: '申请号/条码', align: 'center', visible: true, key: 10, width: '110px' },
|
||||
{ prop: 'zt', label: '状态', align: 'center', visible: true, key: 11, slot: 'zt', width: '110px' },
|
||||
{ prop: 'brly', label: '病人来源', align: 'center', visible: true, key: 12, slot: 'brly', width: '110px' },
|
||||
{ prop: 'sqysname', label: '申请医生', align: 'center', visible: true, key: 13, width: '110px' },
|
||||
{ prop: 'sqsj', label: '申请时间', align: 'center', visible: true, key: 14, width: '170px' },
|
||||
{ prop: 'jjzt', label: '计价标志', align: 'center', visible: true, key: 15, slot: 'jjzt', },
|
||||
{ prop: 'zxysname', label: '执行医生', align: 'center', visible: true, key: 16, },
|
||||
{ prop: 'bbsjrname', label: '送检人', align: 'center', visible: true, key: 17, },
|
||||
{ prop: 'yljg', label: '医疗机构', align: 'center', visible: true, slot: 'yljg', key: 18, width: '170px' },
|
||||
])
|
||||
|
||||
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const sqhs = ref([]);
|
||||
// 单元格样式
|
||||
const cellStyleHd = ({ row, column, rowIndex, columnIndex }: {
|
||||
row: any;
|
||||
@ -259,19 +263,39 @@ const cellStyleHd = ({ row, column, rowIndex, columnIndex }: {
|
||||
columnIndex: number;
|
||||
}) => {
|
||||
// console.log(row, column, rowIndex, columnIndex);
|
||||
if (row.tfailed5 == "常规检查" && columnIndex == 5) {
|
||||
// console.log(row, column, rowIndex, columnIndex);
|
||||
if (column.label == "急诊" && row.jzbz == "1") {
|
||||
return { background: '#f00 !important', color: '#fff' };
|
||||
}
|
||||
|
||||
if (column.label == "类别") {
|
||||
const bgColor = classCom.decimalToHexColor(row.bkcolor);
|
||||
const textColor = classCom.getContrastTextColor(bgColor);
|
||||
return {
|
||||
backgroundColor: `${bgColor} !important`,
|
||||
color: textColor,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const rowClassNameHd = ({ row, rowIndex }: {
|
||||
row: any;
|
||||
rowIndex: number;
|
||||
}) => {
|
||||
return 'custom-row-class'; // 返回自定义类名
|
||||
};
|
||||
// 表格配置
|
||||
// 点击行
|
||||
const rowHandle = (row: any, column: TableColumnCtx<any>, event: Event) => {
|
||||
getRightTable(row)
|
||||
};
|
||||
|
||||
const selectionChange = (selection: any) => {
|
||||
sqhs.value = selection;
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
// 左侧表格配置
|
||||
const tableConfig = ref({
|
||||
// stripe: true, // 斑马纹
|
||||
border: false, // 边框
|
||||
@ -283,7 +307,104 @@ const tableConfig = ref({
|
||||
rowClassName: rowClassNameHd,
|
||||
fit: true
|
||||
})
|
||||
// 右侧数据源
|
||||
const rightTableData = ref([])
|
||||
// 配置项
|
||||
const rightColumns = ref([
|
||||
{ prop: 'sqxmdh', label: '项目代号', visible: true, key: 0, sortable: true, width: '110px' },
|
||||
{ prop: 'sqxmmc', label: '项目名称', visible: true, key: 1, width: '120px' },
|
||||
{ prop: 'dj', label: '单价', align: 'center', visible: true, key: 2 },
|
||||
{ prop: 'sl', label: '数量', align: 'center', visible: true, key: 3 },
|
||||
{ prop: 'zt', label: '状态', align: 'center', visible: true, slot: 'zt', key: 4 },
|
||||
{ prop: 'jjzt', label: '计价标志', align: 'center', visible: true, slot: 'jjzt', key: 5 },
|
||||
|
||||
])
|
||||
// 表格配置
|
||||
const rightTableConfig = ref({
|
||||
// stripe: true, // 斑马纹
|
||||
border: false, // 边框
|
||||
// selection: true, // 多选框
|
||||
index: false, // 序号
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
})
|
||||
|
||||
// 采样数据源
|
||||
const cyTableData = ref([])
|
||||
// 配置项
|
||||
const cyColumns = ref([
|
||||
{ prop: 'sqh', label: '申请号/条形码', visible: true, key: 0, sortable: true, width: '140px' },
|
||||
{ prop: 'ksdh', label: '科室病区', visible: true, key: 1, width: '120px' },
|
||||
{ prop: 'ch', label: '床号', visible: true, key: 2, sortable: true, },
|
||||
{ prop: 'brxm', label: '姓名', visible: true, key: 3, },
|
||||
{ prop: 'brdh', label: '病人号', visible: true, key: 4, },
|
||||
{ prop: 'brxb', label: '性别', align: 'center', visible: true, key: 5, },
|
||||
{ prop: 'yblx', label: '样本类型', align: 'center', visible: true, key: 6 },
|
||||
{ prop: 'zt', label: '状态', align: 'center', visible: true, slot: 'zt', key: 7 },
|
||||
{ prop: 'jzbz', label: '急诊', align: 'center', visible: true, key: 8 },
|
||||
{ prop: 'jjzt', label: '采样人', align: 'center', visible: true, key: 8 },
|
||||
{ prop: 'cysj', label: '采样时间', align: 'center', visible: true, key: 8 },
|
||||
{ prop: 'zxysname', label: '执行医生', align: 'center', visible: true, key: 8 },
|
||||
{ prop: 'zxsj', label: '执行时间', align: 'center', visible: true, key: 8 },
|
||||
])
|
||||
// 表格配置
|
||||
const cyTableConfig = ref({
|
||||
// stripe: true, // 斑马纹
|
||||
border: false, // 边框
|
||||
selection: true, // 多选框
|
||||
index: false, // 序号
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
})
|
||||
|
||||
// 采样登记
|
||||
const openBlock = async (value: string) => {
|
||||
if (sqhs.value.length > 0) {
|
||||
try {
|
||||
// 生成请求Promise数组
|
||||
const requests = sqhs.value.map((item: any) => fetchCodeExec({
|
||||
sqh: item.sqh,
|
||||
userid: 'lis',
|
||||
status: 12,
|
||||
yljg: 1
|
||||
}));
|
||||
const results = await Promise.all(requests);
|
||||
console.log('所有请求成功:', results);
|
||||
return results;
|
||||
} catch (error: any) {
|
||||
console.error('至少一个请求失败:', error.message);
|
||||
throw error;
|
||||
}
|
||||
|
||||
} else {
|
||||
title.value = value
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// 采样读取
|
||||
const sqdQuery = () => {
|
||||
const index = cyTableData.value.findIndex((item: any) => item.sqh == sqhText.value)
|
||||
if (index !== -1) return ElMessage.warning('该申请单数据已存在!')
|
||||
|
||||
fetchCodeReqmain({ sqh: sqhText.value }).then((res: any) => {
|
||||
if (res.code == 0 && res.data.sqh) {
|
||||
fetchCodeExec({
|
||||
sqh: res.data.sqh,
|
||||
userid: 'lis',
|
||||
status: 12,
|
||||
yljg: 1
|
||||
})
|
||||
cyTableData.value = cyTableData.value.concat(res.data)
|
||||
}
|
||||
})
|
||||
}
|
||||
// 关闭弹窗清空
|
||||
const closeDialog = () => {
|
||||
cyTableData.value = []
|
||||
sqhText.value = ''
|
||||
}
|
||||
|
||||
|
||||
interface ColumnItem {
|
||||
@ -300,49 +421,48 @@ const updateColumns = (arr: Array<ColumnItem>) => {
|
||||
columns.value = arr
|
||||
};
|
||||
|
||||
const getRightTable = (row: any) => {
|
||||
fetchCodeDetail({ sqh: row.sqh }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
rightTableData.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 右侧数据源
|
||||
const rightTableData = [
|
||||
{
|
||||
id: 1, tfailed1: 'P001', tfailed2: '项目A', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
|
||||
},
|
||||
{
|
||||
id: 1, tfailed1: 'P002', tfailed2: '项目B', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
|
||||
},
|
||||
]
|
||||
// 配置项
|
||||
const rightColumns = ref([
|
||||
{ prop: 'tfailed1', label: '项目代号', visible: true, key: 0, sortable: true, width: '110px' },
|
||||
{ prop: 'tfailed2', label: '项目名称', visible: true, key: 1 },
|
||||
{ prop: 'tfailed3', label: '单价', align: 'center', visible: true, key: 2 },
|
||||
{ prop: 'tfailed4', label: '数量', align: 'center', visible: true, key: 3 },
|
||||
{ prop: 'tfailed5', label: '状态', align: 'center', visible: true, key: 4 },
|
||||
{ prop: 'tfailed6', label: '计价标志', align: 'center', visible: true, key: 5 },
|
||||
|
||||
])
|
||||
// 表格配置
|
||||
const rightTableConfig = ref({
|
||||
// stripe: true, // 斑马纹
|
||||
border: false, // 边框
|
||||
selection: true, // 多选框
|
||||
index: false, // 序号
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
})
|
||||
|
||||
|
||||
const goReport = () => {
|
||||
// 跳转到报告查询页面
|
||||
router.push('/report')
|
||||
};
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
adjustTableHeight();
|
||||
onMounted(async () => {
|
||||
// 初始化3天区间(今天-前两天)
|
||||
// const end = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||
// const start = dayjs().subtract(2, 'day').format('YYYY-MM-DD HH:mm:ss'); //add 时间往后
|
||||
// queryParams.times = [start, end];
|
||||
// console.log(queryParams.times);
|
||||
getList()
|
||||
adjustTableHeight();
|
||||
// 加载病人来源字典
|
||||
const dictRefs = await comDict('PT', 'HOS', 'ST');
|
||||
|
||||
// 从 ref 中获取实际数据
|
||||
dictData.value = {
|
||||
PT: toRaw(dictRefs.PT.value) || [],
|
||||
HOS: toRaw(dictRefs.HOS.value) || [],
|
||||
ST: toRaw(dictRefs.ST.value) || [],
|
||||
};
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
// 字典格式化方法
|
||||
const formatDict = (v: string, dictType: string) => {
|
||||
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label;
|
||||
};
|
||||
|
||||
// 计算table高度
|
||||
watch(showSearch, () => {
|
||||
nextTick(() => {
|
||||
@ -354,21 +474,27 @@ function adjustTableHeight() {
|
||||
if (compactForm.value) {
|
||||
// 获取高度
|
||||
heightForm.value = compactForm.value.offsetHeight;
|
||||
tableConfig.value.height = `calc(75vh - ${heightForm.value}px)`; // 设置表格容器的高度
|
||||
rightTableConfig.value.height = `calc(75vh - ${heightForm.value}px)`; // 设置表格容器的高度
|
||||
tableConfig.value.height = `calc(72vh - ${heightForm.value}px)`; // 设置表格容器的高度
|
||||
rightTableConfig.value.height = `calc(76vh - ${heightForm.value}px)`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const handletime = (val: Array<string>) => {
|
||||
console.log('时间', val);
|
||||
}
|
||||
|
||||
// 生成条码
|
||||
const printHandle = () => {
|
||||
const data = {
|
||||
dept: 123,
|
||||
dept: '0235',
|
||||
userid: 'lis',
|
||||
st: '2025-01-01 00:00:00',
|
||||
et: '2025-05-21 23:59:59',
|
||||
yljg: 1
|
||||
st: '',
|
||||
et: '',
|
||||
yljg: queryParams.yljg
|
||||
}
|
||||
if (queryParams.times && queryParams.times.length) {
|
||||
data.st = queryParams.times[0]
|
||||
data.et = queryParams.times[1]
|
||||
}
|
||||
addObj(data).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
@ -380,14 +506,26 @@ const printHandle = () => {
|
||||
|
||||
// 查询申请单
|
||||
const getList = () => {
|
||||
fetchCodeList({ sqh: '20221201167864' }).then((response: any) => {
|
||||
loading.value = true;
|
||||
const data = {
|
||||
dept: '0235',
|
||||
userid: 'lis',
|
||||
st: queryParams.times[0],
|
||||
et: queryParams.times[1],
|
||||
yljg: queryParams.yljg
|
||||
}
|
||||
fetchCodeList(data).then((response: any) => {
|
||||
if (response.code == 0) {
|
||||
|
||||
loading.value = false;
|
||||
tableData.value = response.data
|
||||
getRightTable(response.data[0])
|
||||
tableRef.value.setCurrentRow(response.data[0])
|
||||
}
|
||||
})
|
||||
}
|
||||
const printHandle1 = () => {
|
||||
const url = 'http://47.97.125.165:8904/lis.pdf'
|
||||
// const url = sqhs.value[0]?.pdfUrl
|
||||
HiprintPrinter.silentPrintPdf(
|
||||
url,
|
||||
{
|
||||
@ -395,6 +533,7 @@ const printHandle1 = () => {
|
||||
orientation: "portrait", // 纵向(landscape=横向)
|
||||
copies: 1,
|
||||
monochrome: false, // 是否黑白打印
|
||||
// paperName: 'A4', // 纸张大小 A2, A3, A4, A5, A6, letter, legal, tabloid, statement
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@ -3,47 +3,46 @@
|
||||
<div ref="compactForm">
|
||||
<el-row :gutter="10" class="compact-form" v-show="showSearch">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" :rules="queryRules">
|
||||
<el-form-item label="日期:" prop="failed1">
|
||||
<el-date-picker v-model="queryParams.failed1" type="daterange" range-separator="-" start-placeholder="开始时间"
|
||||
end-placeholder="结束时间" />
|
||||
<el-form-item label="日期:" prop="times">
|
||||
<el-date-picker v-model="queryParams.times" type="daterange" range-separator="-" start-placeholder="开始时间"
|
||||
end-placeholder="结束时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="病人状态:" prop="failed2">
|
||||
<el-select v-model="queryParams.failed2" placeholder="请选择">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-form-item label="病人状态:" prop="dybz">
|
||||
<el-select v-model="queryParams.dybz" placeholder="请选择">
|
||||
<el-option label="已打印" value="1" />
|
||||
<el-option label="未打印" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="科室:" prop="failed3">
|
||||
<el-select v-model="queryParams.failed3" placeholder="请选择" style="width: 120px;">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-form-item label="科室:" prop="ksdh">
|
||||
<el-select v-model="queryParams.ksdh" placeholder="请选择" filterable clearable>
|
||||
<el-option v-for="item in dictData.DP" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="病人类型:" prop="failed4">
|
||||
<el-select v-model="queryParams.failed4" placeholder="请选择">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-form-item label="病人类型:" prop="brly">
|
||||
<el-select v-model="queryParams.brly" placeholder="请选择" style="width: 120px;">
|
||||
<el-option v-for="item in dictData.PT" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="failed5">
|
||||
<el-radio-group v-model="queryParams.failed5">
|
||||
<el-radio label="1">仅危急值</el-radio>
|
||||
<el-radio label="2">仅急诊</el-radio>
|
||||
</el-radio-group>
|
||||
<el-form-item label="" prop="">
|
||||
<el-checkbox v-model="queryParams.alarmflag" label="仅危急值" @change="alarmHandle" size="large" />
|
||||
<el-checkbox v-model="queryParams.jzbz" label="仅急诊" @change="jzbzHandle" size="large" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="failed6">
|
||||
<el-form-item label="姓名" prop="brxm">
|
||||
<el-col :span="1.5">
|
||||
<el-input v-model="queryParams.failed6" clearable placeholder="姓名" @keyup.enter="handleQuery"
|
||||
<el-input v-model="queryParams.brxm" clearable placeholder="姓名" @keyup.enter="handleQuery"
|
||||
@clear="handleQuery" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="病人号" prop="failed7">
|
||||
<el-form-item label="病人号" prop="brdh">
|
||||
<el-col :span="1.5">
|
||||
<el-input v-model="queryParams.failed7" clearable placeholder="病人号" @keyup.enter="handleQuery"
|
||||
<el-input v-model="queryParams.brdh" clearable placeholder="病人号" @keyup.enter="handleQuery"
|
||||
@clear="handleQuery" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="条形码" prop="failed8">
|
||||
<el-form-item label="条形码" prop="sqh">
|
||||
<el-col :span="1.5">
|
||||
<el-input v-model="queryParams.failed8" clearable placeholder="条形码" @keyup.enter="handleQuery"
|
||||
<el-input v-model="queryParams.sqh" clearable placeholder="条形码" @keyup.enter="handleQuery"
|
||||
@clear="handleQuery" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
@ -63,10 +62,10 @@
|
||||
<el-button type="primary" plain icon="Plus">打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Edit">勾选中所有未打印</el-button>
|
||||
<el-button type="danger" plain icon="Edit" @click="selectStatusRows">勾选中所有未打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain>打印单张PDF报告</el-button>
|
||||
<el-button type="success" plain :disabled="single" @click="printPdf">打印单张PDF报告</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload">GUID打印报告</el-button>
|
||||
@ -76,8 +75,17 @@
|
||||
:columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<CustomTable :data="tableData" :columns="columns" :config="tableConfig" :loading="loading">
|
||||
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
|
||||
@selection-change="selectionChange" @row-click="rowHandle">
|
||||
<template #dybz="{ row }">
|
||||
{{ row.dybz == 1 ? '✅' : '❌' }}
|
||||
</template>
|
||||
<template #alarmflag="{ row }">
|
||||
{{ row.alarmflag == 1 ? '是' : '否' }}
|
||||
</template>
|
||||
<template #jzbz="{ row }">
|
||||
{{ row.jzbz == 1 ? '急诊' : '危急诊' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
|
||||
</el-col>
|
||||
@ -91,11 +99,12 @@
|
||||
<el-button type="primary">知识库</el-button>
|
||||
</div>
|
||||
|
||||
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig" :loading="loading">
|
||||
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig" :loading="loading"
|
||||
@row-click="xmrowHandle">
|
||||
</CustomTable>
|
||||
|
||||
<div class="title mt10">检验结果</div>
|
||||
<CustomTable :data="rightTableData" :columns="rightColumns" :config="bottomTableConfig" :loading="loading">
|
||||
<div class="title mt10">抗生素项目</div>
|
||||
<CustomTable :data="bottomTableData" :columns="bottomColumns" :config="bottomTableConfig" :loading="loading">
|
||||
</CustomTable>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -106,16 +115,17 @@
|
||||
<div class="flex-between">
|
||||
|
||||
</div>
|
||||
<el-table :data="compareTableData" border style="width: 100%" @row-click="handleRowClick" highlight-current-row>
|
||||
<el-table-column prop="itemName" label="项目名称" fixed />
|
||||
<el-table-column prop="itemCode" label="项目编号" fixed />
|
||||
<template v-for="(period, idx) in periods" :key="period.key">
|
||||
<el-table-column :label="period.label" prop="period1_value" :width="150" />
|
||||
<el-table :data="compareTableData" style="width: 100%" @row-click="handleRowClick" highlight-current-row
|
||||
max-height="350px">
|
||||
<el-table-column prop="xmdh" label="项目编号" fixed align="center" width="100px" />
|
||||
<el-table-column prop="xmmc" label="项目名称" fixed align="center" />
|
||||
<template v-for="(period) in periods" :key="period">
|
||||
<el-table-column :label="period" :prop="period" :width="150" align="center" />
|
||||
</template>
|
||||
<el-table-column label="合计" prop="total" width="100" fixed="right" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<div ref="myEcharts" style="width:100%;height: 350px" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -123,65 +133,54 @@
|
||||
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted } from 'vue';
|
||||
import CustomTable from '@/components/tableCom/index.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { reportList, reportPrintPdf, reportResult, reportMedList, reportFsresult } from '@/api/checkCode/index'
|
||||
import dayjs from 'dayjs';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { classCom } from '@/utils/classCom'
|
||||
import * as echarts from 'echarts';
|
||||
//@ts-ignore
|
||||
import { comDict } from '@/utils/dict'
|
||||
const router = useRouter()
|
||||
|
||||
const compactForm = ref<HTMLElement | null>(null);
|
||||
const heightForm = ref(90);
|
||||
const dialogVisible = ref(false)
|
||||
const openDB = () => {
|
||||
dialogVisible.value = true
|
||||
const tableRefs = ref()
|
||||
|
||||
const myEcharts = ref()
|
||||
|
||||
interface QueryParams {
|
||||
times: string[]; // 明确类型为字符串元组
|
||||
alarmflag: boolean,
|
||||
jzbz: boolean,
|
||||
ksdh: string,
|
||||
brly: string,
|
||||
brxm: string,
|
||||
brdh: string,
|
||||
sqh: string,
|
||||
dybz: string,
|
||||
}
|
||||
|
||||
|
||||
const handleRowClick = (row: any) => {
|
||||
}
|
||||
const periods = [
|
||||
{
|
||||
key: 'period1',
|
||||
label: '2024-01-01~2024-01-07',
|
||||
|
||||
},
|
||||
{
|
||||
key: 'period2',
|
||||
label: '2024-01-08~2024-01-14',
|
||||
|
||||
}
|
||||
]
|
||||
|
||||
const compareTableData = [
|
||||
{
|
||||
itemName: '血糖',
|
||||
itemCode: 'GLU',
|
||||
period1_value: 5.6,
|
||||
period1_status: '正常',
|
||||
period2_value: 6.2,
|
||||
period2_status: '偏高'
|
||||
},
|
||||
{
|
||||
itemName: '血脂',
|
||||
itemCode: 'CHOL',
|
||||
period1_value: 4.8,
|
||||
period1_status: '正常',
|
||||
period2_value: 5.1,
|
||||
period2_status: '正常'
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
|
||||
// 提交表单数据
|
||||
const queryParams = reactive({
|
||||
failed1: [],
|
||||
failed2: '',
|
||||
failed3: '',
|
||||
failed4: '',
|
||||
failed5: '',
|
||||
failed6: '',
|
||||
failed7: '',
|
||||
failed8: '',
|
||||
const queryParams = reactive<QueryParams>({
|
||||
times: ['2025-08-19', '2025-08-19'],
|
||||
ksdh: '',
|
||||
brly: '',
|
||||
alarmflag: false,
|
||||
jzbz: false,
|
||||
brxm: '',
|
||||
brdh: '',
|
||||
sqh: '',
|
||||
dybz: '',
|
||||
});
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const alarmflag = ref('0')
|
||||
const jzbz = ref('0')
|
||||
const showSearch = ref(true);
|
||||
const queryRef = ref()
|
||||
// 项目点击数据
|
||||
const Info = ref<any>({})
|
||||
// 定义校验规则
|
||||
const queryRules = ref({
|
||||
// clientId: [
|
||||
@ -193,59 +192,96 @@ const queryRules = ref({
|
||||
// { required: true, message: '条码状态不能为空', trigger: 'change' },
|
||||
// ],
|
||||
})
|
||||
const options = [
|
||||
{
|
||||
value: 'Option1',
|
||||
label: 'Option1',
|
||||
},
|
||||
{
|
||||
value: 'Option2',
|
||||
label: 'Option2',
|
||||
},
|
||||
|
||||
]
|
||||
const handleQuery = async () => {
|
||||
const valid = await queryRef.value.validate().catch(() => { });
|
||||
if (!valid) return false;
|
||||
getList()
|
||||
}
|
||||
// 重置
|
||||
const resetQuery = () => {
|
||||
queryRef.value?.resetFields();
|
||||
getList()
|
||||
}
|
||||
|
||||
const loading = false;
|
||||
|
||||
// 勾选框数据
|
||||
const rows = ref<any[]>([])
|
||||
// 数据源
|
||||
const tableData = [
|
||||
{
|
||||
id: 1, tfailed1: '打印', tfailed2: '急诊', tfailed3: '危急诊', tfailed4: '检验日期', tfailed5: '病人代号', tfailed6: '床号', tfailed7: '仪器', tfailed8: '样本号',
|
||||
tfailed9: '样本类型', tfailed10: '检查项目', tfailed11: '检查结果', tfailed12: '检查结果', tfailed13: '检查结果', tfailed14: '检查结果'
|
||||
},
|
||||
{
|
||||
id: 2, tfailed1: '打印', tfailed2: '急诊', tfailed3: '危急诊', tfailed4: '检验日期', tfailed5: '病人代号', tfailed6: '床号', tfailed7: '仪器', tfailed8: '样本号',
|
||||
tfailed9: '样本类型', tfailed10: '检查项目', tfailed11: '检查结果', tfailed12: '检查结果', tfailed13: '检查结果', tfailed14: '检查结果'
|
||||
},
|
||||
|
||||
]
|
||||
const tableData = ref([])
|
||||
// 配置项
|
||||
const columns = ref([
|
||||
{ prop: 'tfailed1', label: '打印', visible: true, key: 0, sortable: true, width: '110px' },
|
||||
{ prop: 'tfailed2', label: '急诊', visible: true, key: 1, width: '110px' },
|
||||
{ prop: 'tfailed3', label: '危急诊', align: 'center', visible: true, key: 2, },
|
||||
{ prop: 'tfailed4', label: '检验日期', align: 'center', visible: true, key: 3, width: '110px' },
|
||||
{ prop: 'tfailed5', label: '病人代号', align: 'center', visible: true, key: 4, width: '110px' },
|
||||
{ prop: 'tfailed6', label: '床号', align: 'center', visible: true, key: 5, width: '110px' },
|
||||
{ prop: 'tfailed7', label: '仪器', align: 'center', visible: true, key: 6, width: '110px' },
|
||||
{ prop: 'tfailed8', label: '样本号', align: 'center', visible: true, key: 7, width: '110px' },
|
||||
{ prop: 'tfailed9', label: '样本类型', align: 'center', visible: true, key: 8, width: '110px' },
|
||||
{ prop: 'tfailed10', label: '检验目的', align: 'center', visible: true, key: 9, width: '110px' },
|
||||
{ prop: 'tfailed11', label: '病人类型', align: 'center', visible: true, key: 10, width: '110px' },
|
||||
{ prop: 'tfailed12', label: '性别', align: 'center', visible: true, key: 11, width: '110px' },
|
||||
{ prop: 'tfailed13', label: '仪器名称', align: 'center', visible: true, key: 12, width: '110px' },
|
||||
{ prop: 'tfailed14', label: '医疗机构', align: 'center', visible: true, key: 13, width: '110px' },
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{ prop: 'dybz', label: '打印', visible: true, key: 0, slot: 'dybz', },
|
||||
{ prop: 'jzbz', label: '急诊', visible: true, key: 1, slot: 'jzbz', },
|
||||
{ prop: 'alarmflag', label: '危急值', align: 'center', visible: true, key: 2, slot: 'alarmflag' },
|
||||
{ prop: 'jyrq', label: '检验日期', align: 'center', visible: true, key: 3, width: '150px' },
|
||||
{ prop: 'brdh', label: '病人代号', align: 'center', visible: true, key: 4, width: '110px' },
|
||||
{ prop: 'ch', label: '床号', align: 'center', visible: true, key: 5, sortable: true, },
|
||||
{ prop: 'yqdl', label: '仪器', align: 'center', visible: true, key: 6, width: '110px' },
|
||||
{ prop: 'ybh', label: '样本号', align: 'center', visible: true, key: 7, },
|
||||
{ prop: 'yblxname', label: '样本类型', align: 'center', visible: true, key: 8, },
|
||||
{ prop: 'jymd', label: '检验目的', align: 'center', visible: true, key: 9, width: '110px' },
|
||||
{ prop: 'brlyname', label: '病人类型', align: 'center', visible: true, key: 10, },
|
||||
{ prop: 'brxbname', label: '性别', align: 'center', visible: true, key: 11, },
|
||||
{ prop: 'yqmc', label: '仪器名称', align: 'center', visible: true, key: 12, width: '150px' },
|
||||
{ prop: 'yljg', label: '医疗机构', align: 'center', visible: true, key: 13, width: '150px' },
|
||||
])
|
||||
|
||||
const selectionChange = (selection: any) => {
|
||||
rows.value = selection
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
const rowHandle = (row: any) => {
|
||||
Info.value = row
|
||||
const data = {
|
||||
jyrq: row.jyrq,
|
||||
yq: row.yq,
|
||||
ybh: row.ybh,
|
||||
}
|
||||
reportResult(data).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
rightTableData.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 打印单张Pdf
|
||||
const printPdf = () => {
|
||||
const data = {
|
||||
jyrq: rows.value[0].jyrq,
|
||||
yq: rows.value[0].yq,
|
||||
ybh: rows.value[0].ybh
|
||||
}
|
||||
reportPrintPdf(data).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
if (!res.data.base64PDF) return
|
||||
classCom.printPDF(res.data.base64PDF)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 单元格样式
|
||||
const cellStyleHd = ({ row, column, rowIndex, columnIndex }: {
|
||||
row: any;
|
||||
column: any;
|
||||
rowIndex: number;
|
||||
columnIndex: number;
|
||||
}) => {
|
||||
// console.log(row, column, rowIndex, columnIndex);
|
||||
if (column.label == "急诊" && row.jzbz == "1") {
|
||||
return { background: '#f00 !important', color: '#fff' };
|
||||
}
|
||||
if (column.label == "危急值" && row.alarmflag == "1") {
|
||||
return { background: '#f00 !important', color: '#fff' };
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
// 表格配置
|
||||
const tableConfig = ref(
|
||||
@ -256,10 +292,37 @@ const tableConfig = ref(
|
||||
index: false, // 序号
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
fit: true
|
||||
fit: true,
|
||||
cellStyle: cellStyleHd
|
||||
}
|
||||
)
|
||||
|
||||
// 勾选未打印
|
||||
const selectStatusRows = () => {
|
||||
tableRefs.value.clearSelection()
|
||||
tableData.value.forEach((item: any) => {
|
||||
if (item.dybz != 1) {
|
||||
tableRefs.value.toggleRowSelection(item, true)
|
||||
}
|
||||
})
|
||||
}
|
||||
const alarmHandle = (val: boolean) => {
|
||||
if (val) {
|
||||
queryParams.jzbz = false
|
||||
alarmflag.value = '1'
|
||||
} else {
|
||||
alarmflag.value = '0'
|
||||
}
|
||||
|
||||
}
|
||||
const jzbzHandle = (val: boolean) => {
|
||||
if (val) {
|
||||
queryParams.alarmflag = false
|
||||
jzbz.value = '1'
|
||||
} else {
|
||||
jzbz.value = '0'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface ColumnItem {
|
||||
@ -267,9 +330,10 @@ interface ColumnItem {
|
||||
label: string;
|
||||
visible: boolean;
|
||||
key: number;
|
||||
align: string;
|
||||
slot: string;
|
||||
width: string;
|
||||
align?: string;
|
||||
slot?: string;
|
||||
width?: string;
|
||||
sortable?: boolean;
|
||||
}
|
||||
// 更新列
|
||||
const updateColumns = (arr: Array<ColumnItem>) => {
|
||||
@ -277,39 +341,16 @@ const updateColumns = (arr: Array<ColumnItem>) => {
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 右侧数据源
|
||||
const rightTableData = [
|
||||
{
|
||||
id: 1, tfailed1: 'P001', tfailed2: '项目A', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
|
||||
},
|
||||
{
|
||||
id: 2, tfailed1: 'P002', tfailed2: '项目B', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
|
||||
},
|
||||
{
|
||||
id: 2, tfailed1: 'P002', tfailed2: '项目B', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
|
||||
},
|
||||
{
|
||||
id: 2, tfailed1: 'P002', tfailed2: '项目B', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
|
||||
},
|
||||
{
|
||||
id: 2, tfailed1: 'P002', tfailed2: '项目B', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
|
||||
},
|
||||
{
|
||||
id: 2, tfailed1: 'P002', tfailed2: '项目B', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
|
||||
},
|
||||
{
|
||||
id: 2, tfailed1: 'P002', tfailed2: '项目B', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
|
||||
},
|
||||
]
|
||||
const rightTableData = ref([])
|
||||
// 配置项
|
||||
const rightColumns = ref([
|
||||
{ prop: 'tfailed1', label: '项目代号', visible: true, key: 0, sortable: true, width: '110px' },
|
||||
{ prop: 'tfailed2', label: '项目名称', visible: true, key: 1 },
|
||||
{ prop: 'tfailed3', label: '单价', align: 'center', visible: true, key: 2 },
|
||||
{ prop: 'tfailed4', label: '数量', align: 'center', visible: true, key: 3 },
|
||||
{ prop: 'tfailed5', label: '状态', align: 'center', visible: true, key: 4 },
|
||||
{ prop: 'tfailed6', label: '计价标志', align: 'center', visible: true, key: 5 },
|
||||
{ prop: 'xmdh', label: '项目代号', align: 'center', visible: true, key: 0, },
|
||||
{ prop: 'xmmc', label: '项目名称', align: 'center', visible: true, key: 1 },
|
||||
{ prop: 'csjg', label: '结果', align: 'center', visible: true, key: 2 },
|
||||
{ prop: 'refs', label: '参考值', align: 'center', visible: true, key: 3 },
|
||||
{ prop: 'dw', label: '单位', align: 'center', visible: true, key: 4 },
|
||||
{ prop: 'jgbz', label: '结果标志', align: 'center', visible: true, key: 5 },
|
||||
|
||||
])
|
||||
// 表格配置
|
||||
@ -321,10 +362,200 @@ const rightTableConfig = ref(
|
||||
index: false, // 序号
|
||||
height: '28vh', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
fit: true
|
||||
}
|
||||
)
|
||||
const xmRow = ref<any>({})
|
||||
// 查询抗生素
|
||||
const xmrowHandle = (row: any) => {
|
||||
xmRow.value = row
|
||||
const data = {
|
||||
jyrq: Info.value.jyrq,
|
||||
yq: Info.value.yq,
|
||||
ybh: Info.value.ybh,
|
||||
xmdh: row.xmdh
|
||||
}
|
||||
reportMedList(data).then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
bottomTableData.value = res.rows
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
const periods = ref<string[]>([])
|
||||
|
||||
const compareTableData = ref([])
|
||||
|
||||
|
||||
// 历史数据对比
|
||||
const openDB = () => {
|
||||
// 00507620
|
||||
compareTableData.value = []
|
||||
if (!xmRow.value.xmdh) return ElMessage.error('至少选择一条数据进行对比')
|
||||
const data = {
|
||||
brdh: Info.value.brdh,
|
||||
xmdh: xmRow.value.xmdh
|
||||
}
|
||||
reportFsresult(data).then((res: any) => {
|
||||
periods.value = []
|
||||
if (res.code == 0) {
|
||||
const arr: string[] = res.data.map((item: any) => item.confirmdt);
|
||||
periods.value = [...new Set(arr)];
|
||||
res.data.forEach((v: any) => {
|
||||
arr.forEach((item: any) => {
|
||||
if (item == v.confirmdt) {
|
||||
v[item] = v.csjg
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// @ts-ignore 忽略重组数据动态时间key
|
||||
compareTableData.value = formatGroupedData(res.data)
|
||||
dialogVisible.value = true
|
||||
nextTick(() => {
|
||||
handleRowClick(compareTableData.value[0])
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 数据重组
|
||||
const formatGroupedData = (data: any[]) => {
|
||||
if (!data || data.length === 0) return [];
|
||||
|
||||
const groupMap: any = {};
|
||||
data.forEach(item => {
|
||||
const key = item.xmdh;
|
||||
if (!groupMap[key]) {
|
||||
groupMap[key] = {
|
||||
xmdh: item.xmdh,
|
||||
xmmc: item.xmmc,
|
||||
// confirmdt: item.confirmdt
|
||||
};
|
||||
}
|
||||
const dateKeys = Object.keys(item).filter(key =>
|
||||
/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(key) // 匹配 YYYY-MM-DD HH:mm:ss 时间格式
|
||||
);
|
||||
// 将日期键值对添加到分组对象
|
||||
dateKeys.forEach(dateKey => {
|
||||
groupMap[key][dateKey] = item[dateKey];
|
||||
});
|
||||
});
|
||||
// 将 Map 转为数组
|
||||
return Object.values(groupMap);
|
||||
};
|
||||
|
||||
const handleRowClick = (row: any) => {
|
||||
getEcharts(row)
|
||||
}
|
||||
|
||||
const getEcharts = (data: any) => {
|
||||
const dateKeys = Object.keys(data).filter(key =>
|
||||
/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(key)
|
||||
);
|
||||
const Intance = echarts.init(myEcharts.value);
|
||||
const xData = dateKeys;
|
||||
let seriesData = []
|
||||
seriesData = dateKeys.map(item => data[item]);
|
||||
|
||||
const option = {
|
||||
title: {
|
||||
text: data.xmmc,
|
||||
top: '5',
|
||||
right: '5%',
|
||||
left: '20',
|
||||
// bottom: '20%'
|
||||
// subtext: 'Feature Sample: Gradient Color, Shadow, Click Zoom'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
grid: {
|
||||
top: '20%',
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
// bottom: '3%',
|
||||
height: '80%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xData,
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
// color: 'rgba(193, 207, 220, 1)',
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
rotate: 30,
|
||||
textStyle: {
|
||||
|
||||
color: "#8D949B "
|
||||
}
|
||||
},
|
||||
},
|
||||
yAxis: [{
|
||||
// name: '单位(mm)',
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: "#8D949B"
|
||||
},
|
||||
// formatter: '{value}%'
|
||||
|
||||
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
lineStyle: {
|
||||
color: '#24abf2'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
},
|
||||
},
|
||||
}
|
||||
],
|
||||
series: [{
|
||||
name: data.xmmc,
|
||||
type: 'line',
|
||||
data: seriesData,
|
||||
symbol: 'circle',
|
||||
symbolSize: 5, //标记的大小
|
||||
lineStyle: {
|
||||
normal: {
|
||||
width: 2,
|
||||
color: '#24abf2',
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#24abf2',
|
||||
}
|
||||
},
|
||||
smooth: true
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Intance.setOption(option);
|
||||
}
|
||||
|
||||
// 右侧数据源
|
||||
const bottomTableData = ref([])
|
||||
// 配置项
|
||||
const bottomColumns = ref([
|
||||
{ prop: 'ywdh', label: '抗生素编号', align: 'center', visible: true, key: 0 },
|
||||
{ prop: 'ywmc', label: '抗生素名称', align: 'center', visible: true, key: 1 },
|
||||
{ prop: 'csjg', label: '测试结果', align: 'center', visible: true, key: 2 },
|
||||
{ prop: 'jgbz', label: '结果标志', align: 'center', visible: true, key: 3 },
|
||||
])
|
||||
// 表格配置
|
||||
const bottomTableConfig = ref(
|
||||
{
|
||||
@ -334,15 +565,65 @@ const bottomTableConfig = ref(
|
||||
index: false, // 序号
|
||||
height: '28vh', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
fit: true,
|
||||
}
|
||||
)
|
||||
interface DictData {
|
||||
DP?: Array<any>;
|
||||
PT?: Array<any>;
|
||||
[key: string]: any[] | undefined; // 添加索引签名以支持动态访问
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
// 字典数据存储
|
||||
const dictData = ref<DictData>({});
|
||||
|
||||
onMounted(async () => {
|
||||
// 初始化3天区间(今天-前两天)
|
||||
// const end = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||
// const start = dayjs().subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'); //add 时间往后
|
||||
// queryParams.times = [start, end];
|
||||
// console.log(queryParams.times);
|
||||
getList()
|
||||
adjustTableHeight();
|
||||
|
||||
// 加载病人来源字典
|
||||
const dictRefs = await comDict('PT', 'DP');
|
||||
|
||||
// 从 ref 中获取实际数据
|
||||
dictData.value = {
|
||||
PT: toRaw(dictRefs.PT.value) || [],
|
||||
DP: toRaw(dictRefs.DP.value) || [],
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
const getList = () => {
|
||||
const data = {
|
||||
alarmflag: alarmflag.value,
|
||||
jzbz: jzbz.value,
|
||||
dybz: queryParams.dybz,
|
||||
ksdh: queryParams.ksdh,
|
||||
brly: queryParams.brly,
|
||||
brxm: queryParams.brxm,
|
||||
brdh: queryParams.brdh,
|
||||
sqh: queryParams.sqh,
|
||||
st: '',
|
||||
et: '',
|
||||
yljg: 1
|
||||
}
|
||||
if (queryParams.times && queryParams.times.length) {
|
||||
data.st = queryParams.times[0]
|
||||
data.et = queryParams.times[1]
|
||||
}
|
||||
reportList(data).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
tableData.value = res.data
|
||||
tableRefs.value.setCurrentRow(res.data[0])
|
||||
rowHandle(res.data[0])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 计算table高度
|
||||
watch(showSearch, () => {
|
||||
nextTick(() => {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import { computed, reactive, ref, onMounted, nextTick } from "vue";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { queryComDictListService, addComDictService, updateComDictService } from "../../../api/liswork/dict/ComDict.js";
|
||||
import { queryComDictListService, addComDictService, updateComDictService, delComDictService } from "../../../api/liswork/dict/ComDict.js";
|
||||
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
@ -59,7 +59,7 @@ const defaultProps = {
|
||||
id: 'zddh'
|
||||
}
|
||||
|
||||
|
||||
const info = ref({})
|
||||
watch(zdlbmc, (val) => {
|
||||
console.log(ref(treeRef.value));
|
||||
|
||||
@ -107,8 +107,6 @@ function getTypeList() {
|
||||
|
||||
/** 查询字典明细列表 */
|
||||
function getList() {
|
||||
|
||||
|
||||
loading.value = true;
|
||||
queryComDictListService(queryParams.value).then(response => {
|
||||
typeDetail.value = response.rows;
|
||||
@ -155,13 +153,19 @@ function handleAdd() {
|
||||
|
||||
//修改
|
||||
function handleUpdate(row) {
|
||||
form.value = row
|
||||
reset()
|
||||
form.value = row.zdlb ? row : info.value
|
||||
open.value = true;
|
||||
}
|
||||
|
||||
//删除
|
||||
function handleDelete() {
|
||||
|
||||
function handleDelete(row) {
|
||||
proxy.$modal.confirm('是否确认删除字典名称为"' + row.zdmc + '"的数据项?').then(function () {
|
||||
return delComDictService(row);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导入按钮操作 */
|
||||
function handleImport() {
|
||||
@ -198,7 +202,8 @@ const handleFileSuccess = (response, file, fileList) => {
|
||||
|
||||
|
||||
//多选框选中数据
|
||||
function handleSelectionChange() {
|
||||
function handleSelectionChange(selection) {
|
||||
info.value = selection[0]
|
||||
single.value = selection.length != 1;
|
||||
}
|
||||
|
||||
@ -215,21 +220,22 @@ function submitForm() {
|
||||
if (valid) {
|
||||
if (form.value.zdlb != undefined && form.value.zdlb != '') {
|
||||
updateComDictService(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}).catch(error => {
|
||||
reset();
|
||||
});
|
||||
if (response.code == 0) {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
form.value.zdlb = queryParams.value.zdlb;
|
||||
form.value.yljg = 1;
|
||||
addComDictService(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}).catch(error => {
|
||||
form.value.zdlb = '';
|
||||
});
|
||||
if (response.code == 0) {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -290,10 +296,10 @@ onMounted(() => {
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:dict:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:dict:remove']">删除</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="handleImport"
|
||||
v-hasPermi="['system:dict:import']">导入</el-button>
|
||||
@ -309,7 +315,7 @@ onMounted(() => {
|
||||
<el-table-column label='字典类型' align="center" prop="zdlb" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="明细代号" align="center" prop="zddh" />
|
||||
<el-table-column label="名称" align="center" prop="zdmc" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="备注" align="center" prop="bz" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(row)"
|
||||
|
||||
@ -1,149 +1,119 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="5" class="compact-form" :span="24" >
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-position="left" >
|
||||
<el-col :span="24" :xs="24">
|
||||
<el-form-item label="" label-width="0px" prop="brdh" >
|
||||
<el-row :gutter="5" class="compact-form" :span="24">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-position="left">
|
||||
<el-col :span="24" :xs="24">
|
||||
<el-form-item label="" label-width="0px" prop="brdh">
|
||||
|
||||
<el-col :span="6">
|
||||
<div> 就诊卡号/病历号/磁卡号: </div>
|
||||
<el-input
|
||||
v-model="queryParams.brdh"
|
||||
placeholder="就诊卡号/病历号/磁卡号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-radio-group v-model="queryParams.zt" size="default">
|
||||
<el-radio v-for="(item, index) in showconfirmOptions" :key="index" :label="item.value"
|
||||
:disabled="item.disabled">{{item.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="1"> <div> 申请获取期限: </div></el-col>
|
||||
<el-col :span="6">
|
||||
|
||||
<el-radio-group v-model="queryParams.subday" size="default">
|
||||
<el-radio v-for="(item, index) in subdayOptions" :key="index" :label="item.value"
|
||||
:disabled="item.disabled">{{item.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-select v-model="queryParams.cardtype" placeholder="卡类型" clearable :style="{width: '100%'}">
|
||||
<el-option v-for="(item, index) in cardtypeOptions" :key="index" :label="item.label"
|
||||
:value="item.value" :disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="Search" @click="readCard">读卡</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<PatSearchDialog @select="handlePatientSelect"/>
|
||||
<el-col :span="6">
|
||||
<div> 就诊卡号/病历号/磁卡号: </div>
|
||||
<el-input v-model="queryParams.brdh" placeholder="就诊卡号/病历号/磁卡号" clearable @keyup.enter="handleQuery" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-radio-group v-model="queryParams.zt" size="default">
|
||||
<el-radio v-for="(item, index) in showconfirmOptions" :key="index" :label="item.value"
|
||||
:disabled="item.disabled">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<div> 申请获取期限: </div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
|
||||
</el-form>
|
||||
<el-radio-group v-model="queryParams.subday" size="default">
|
||||
<el-radio v-for="(item, index) in subdayOptions" :key="index" :label="item.value"
|
||||
:disabled="item.disabled">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-select v-model="queryParams.cardtype" placeholder="卡类型" clearable :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in cardtypeOptions" :key="index" :label="item.label" :value="item.value"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="Search" @click="readCard">读卡</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<PatSearchDialog @select="handlePatientSelect" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row :gutter="5" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Search"
|
||||
@click="handleQuery"
|
||||
v-hasPermi="['system:reqmain:Search']"
|
||||
>查询</el-button>
|
||||
<el-button type="primary" plain icon="Search" @click="handleQuery"
|
||||
v-hasPermi="['system:reqmain:Search']">查询</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Printer"
|
||||
:disabled="single"
|
||||
@click="printAll"
|
||||
v-hasPermi="['system:reqmain:add']"
|
||||
>打印</el-button>
|
||||
<el-button type="success" plain icon="Printer" :disabled="single" @click="printAll"
|
||||
v-hasPermi="['system:reqmain:add']">打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Printer"
|
||||
:disabled="single"
|
||||
@click="printSigne"
|
||||
v-hasPermi="['system:reqmain:edit']"
|
||||
>单打条码</el-button>
|
||||
<el-button type="success" plain icon="Printer" :disabled="single" @click="printSigne"
|
||||
v-hasPermi="['system:reqmain:edit']">单打条码</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Printer"
|
||||
:disabled="freesingle"
|
||||
@click="printBack"
|
||||
v-hasPermi="['system:reqmain:edit']"
|
||||
>单打回单</el-button>
|
||||
<el-button type="danger" plain icon="Printer" :disabled="freesingle" @click="printBack"
|
||||
v-hasPermi="['system:reqmain:edit']">单打回单</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Delete"
|
||||
@click="cancel"
|
||||
v-hasPermi="['system:reqmain:export']"
|
||||
>取消采样</el-button>
|
||||
<el-button type="warning" plain icon="Delete" @click="cancel"
|
||||
v-hasPermi="['system:reqmain:export']">取消采样</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="5" class="table-container">
|
||||
<el-table ref="tableRef" class="compact-form my-table" :data="reqmainList" @selection-change="handleSelectionChange" @select="handleSelect" height="100%" :cell-style="tableCellStyle">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="sqxmmc" width="200" show-overflow-tooltip/>
|
||||
<el-table-column label="项目代码" align="center" prop="sqxmdh" width="100" show-overflow-tooltip/>
|
||||
<el-table-column label="项目类别" align="center" prop="cp_xmlb" />
|
||||
<el-table-column label="样本类型" align="center" prop="yblx" />
|
||||
<el-table-column label="条码号" align="center" prop="sqh" width="150" show-overflow-tooltip/>
|
||||
<el-table-column label="申请时间" align="center" prop="sqsj" width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.sqsj, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="病人姓名" align="center" prop="brxm" show-overflow-tooltip/>
|
||||
<el-table-column label="申请医生" align="center" prop="sqys" :formatter="formatDict('SRD')" show-overflow-tooltip/>
|
||||
<el-table-column label="序号" align="center" prop="xh" show-overflow-tooltip/>
|
||||
<el-table-column label="数量" align="center" prop="sl" show-overflow-tooltip/>
|
||||
<el-table-column label="单价" align="center" prop="dj" show-overflow-tooltip/>
|
||||
<el-table-column label="状态" align="center" prop="zt" show-overflow-tooltip/>
|
||||
<el-table-column label="计价" align="center" prop="jjzt" >
|
||||
<template #default="scope">
|
||||
<el-checkbox :model-value="scope.row.jjzt === '1'" disabled>
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="病人代号" align="center" prop="brdh" show-overflow-tooltip/>
|
||||
<el-table-column label="备注1" align="center" prop="detailBZ1" show-overflow-tooltip/>
|
||||
<el-table-column label="备注2" align="center" prop="detailBZ2" show-overflow-tooltip/>
|
||||
<el-table-column label="颜色" align="center" prop="cp_color" v-if="false" show-overflow-tooltip/>
|
||||
<el-table-column label="确认标识" align="center" prop="cp_cflag" v-if="false" show-overflow-tooltip/>
|
||||
<el-table-column label="科室" align="center" prop="ksdh" :formatter="formatDict('DP')" show-overflow-tooltip/>
|
||||
<el-table-column label="病人类型" align="center" prop="brly" :formatter="formatDict('PT')" show-overflow-tooltip/>
|
||||
<el-table-column label="性别" align="center" prop="brxb" :formatter="formatDict('SX')" show-overflow-tooltip/>
|
||||
<el-table-column label="生日" align="center" prop="brsr" width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.brsr, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="床号" align="center" prop="ch" width="50" show-overflow-tooltip/>
|
||||
<el-table-column label="诊断" align="center" prop="zd" width="150" show-overflow-tooltip/>
|
||||
<el-table-column label="条码类别" align="center" prop="bgddh" v-if="false" show-overflow-tooltip/>
|
||||
<el-table-column label="年龄" align="center" prop="nl" show-overflow-tooltip/>
|
||||
<el-table-column label="年龄单位" align="center" prop="nldw" :formatter="formatDict('AU')" show-overflow-tooltip/>
|
||||
<el-table-column label="采样时间" align="center" prop="cysj" width="180"show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.cysj, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table ref="tableRef" class="compact-form my-table" :data="reqmainList"
|
||||
@selection-change="handleSelectionChange" @select="handleSelect" height="100%" :cell-style="tableCellStyle">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="sqxmmc" width="200" show-overflow-tooltip />
|
||||
<el-table-column label="项目代码" align="center" prop="sqxmdh" width="100" show-overflow-tooltip />
|
||||
<el-table-column label="项目类别" align="center" prop="cp_xmlb" />
|
||||
<el-table-column label="样本类型" align="center" prop="yblx" />
|
||||
<el-table-column label="条码号" align="center" prop="sqh" width="150" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" align="center" prop="sqsj" width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.sqsj, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="病人姓名" align="center" prop="brxm" show-overflow-tooltip />
|
||||
<el-table-column label="申请医生" align="center" prop="sqys" :formatter="formatDict('SRD')" show-overflow-tooltip />
|
||||
<el-table-column label="序号" align="center" prop="xh" show-overflow-tooltip />
|
||||
<el-table-column label="数量" align="center" prop="sl" show-overflow-tooltip />
|
||||
<el-table-column label="单价" align="center" prop="dj" show-overflow-tooltip />
|
||||
<el-table-column label="状态" align="center" prop="zt" show-overflow-tooltip />
|
||||
<el-table-column label="计价" align="center" prop="jjzt">
|
||||
<template #default="scope">
|
||||
<el-checkbox :model-value="scope.row.jjzt === '1'" disabled>
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="病人代号" align="center" prop="brdh" show-overflow-tooltip />
|
||||
<el-table-column label="备注1" align="center" prop="detailBZ1" show-overflow-tooltip />
|
||||
<el-table-column label="备注2" align="center" prop="detailBZ2" show-overflow-tooltip />
|
||||
<el-table-column label="颜色" align="center" prop="cp_color" v-if="false" show-overflow-tooltip />
|
||||
<el-table-column label="确认标识" align="center" prop="cp_cflag" v-if="false" show-overflow-tooltip />
|
||||
<el-table-column label="科室" align="center" prop="ksdh" :formatter="formatDict('DP')" show-overflow-tooltip />
|
||||
<el-table-column label="病人类型" align="center" prop="brly" :formatter="formatDict('PT')" show-overflow-tooltip />
|
||||
<el-table-column label="性别" align="center" prop="brxb" :formatter="formatDict('SX')" show-overflow-tooltip />
|
||||
<el-table-column label="生日" align="center" prop="brsr" width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.brsr, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="床号" align="center" prop="ch" width="50" show-overflow-tooltip />
|
||||
<el-table-column label="诊断" align="center" prop="zd" width="150" show-overflow-tooltip />
|
||||
<el-table-column label="条码类别" align="center" prop="bgddh" v-if="false" show-overflow-tooltip />
|
||||
<el-table-column label="年龄" align="center" prop="nl" show-overflow-tooltip />
|
||||
<el-table-column label="年龄单位" align="center" prop="nldw" :formatter="formatDict('AU')" show-overflow-tooltip />
|
||||
<el-table-column label="采样时间" align="center" prop="cysj" width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.cysj, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<!-- 汇总行 -->
|
||||
<div class="table-summary">
|
||||
@ -172,6 +142,7 @@ import {
|
||||
printBarcodeall
|
||||
} from "@/api/mzcx/cydj.js";
|
||||
import PatSearchDialog from './components/OutPatList.vue'
|
||||
import { classCom } from '@/utils/classCom';
|
||||
const comDict = inject('comDict');
|
||||
// 字典数据存储
|
||||
const dictData = ref({});
|
||||
@ -190,9 +161,9 @@ const idsnew = computed(() => {
|
||||
});
|
||||
const single = ref(true);
|
||||
const freesingle = ref(true);
|
||||
const cardtypeOptions = ref([{"label": "就诊卡","value": 1},{"label": "医保卡","value": 2},{"label": "电子医保卡","value": 3},{"label": "身份证", "value": 4}])
|
||||
const showconfirmOptions = ref([{"label": "未打印", "value": 1},{"label": "已打印", "value": 11}])
|
||||
const subdayOptions = ref([{"label": "1天","value": 1},{"label": "3天", "value": 3},{"label": "1周","value": 7},{"label": "2周","value": 14},{"label": "1月", "value": 30},{"label": "3月", "value": 90},{"label": "1年","value": 365},{"label": "2年","value": 730}])
|
||||
const cardtypeOptions = ref([{ "label": "就诊卡", "value": 1 }, { "label": "医保卡", "value": 2 }, { "label": "电子医保卡", "value": 3 }, { "label": "身份证", "value": 4 }])
|
||||
const showconfirmOptions = ref([{ "label": "未打印", "value": 1 }, { "label": "已打印", "value": 11 }])
|
||||
const subdayOptions = ref([{ "label": "1天", "value": 1 }, { "label": "3天", "value": 3 }, { "label": "1周", "value": 7 }, { "label": "2周", "value": 14 }, { "label": "1月", "value": 30 }, { "label": "3月", "value": 90 }, { "label": "1年", "value": 365 }, { "label": "2年", "value": 730 }])
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
@ -203,7 +174,7 @@ const data = reactive({
|
||||
klx: null,
|
||||
zt: 1,
|
||||
subday: 3000,
|
||||
cardtype:null
|
||||
cardtype: null
|
||||
},
|
||||
rules: {
|
||||
brdh: [
|
||||
@ -232,7 +203,7 @@ const handleSelect = (selection, row, selected) => {
|
||||
|
||||
// 先收集需要自动勾选的行(避免在循环中修改数据)
|
||||
const rowsToSelect = reqmainList.value.filter(
|
||||
item => item.sqh === targetSqh && item.xh !== targetxh
|
||||
item => item.sqh === targetSqh && item.xh !== targetxh
|
||||
);
|
||||
|
||||
// 如果有需要自动勾选的行,才开启标志位
|
||||
@ -246,10 +217,10 @@ const handleSelect = (selection, row, selected) => {
|
||||
}
|
||||
};
|
||||
// 字典格式化方法
|
||||
const formatDict =(dictType) => {
|
||||
const formatDict = (dictType) => {
|
||||
return (row, column, value) => {
|
||||
// 从全局字典中获取映射值
|
||||
return dictData.value[dictType].find(item => String(item.value) === String(value).trim())?.label||value ;
|
||||
return dictData.value[dictType].find(item => String(item.value) === String(value).trim())?.label || value;
|
||||
};
|
||||
};
|
||||
// 定义“空数据”的判断函数
|
||||
@ -277,30 +248,30 @@ function getDateOffset(days) {
|
||||
const year = targetDate.getFullYear();
|
||||
const month = String(targetDate.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(targetDate.getDate()).padStart(2, '0');
|
||||
// const hours = String(targetDate.getHours()).padStart(2, '0');
|
||||
// const minutes = String(targetDate.getMinutes()).padStart(2, '0');
|
||||
// const hours = String(targetDate.getHours()).padStart(2, '0');
|
||||
// const minutes = String(targetDate.getMinutes()).padStart(2, '0');
|
||||
//const seconds = String(targetDate.getSeconds()).padStart(2, '0');
|
||||
// return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
// return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
return `${year}-${month}-${day} 00:00:00`;
|
||||
}
|
||||
function getSubday() {
|
||||
const days=0 - queryParams.value.subday;
|
||||
queryParams.value.stime=getDateOffset(days);
|
||||
queryParams.value.etime=getDateOffset(1);
|
||||
const days = 0 - queryParams.value.subday;
|
||||
queryParams.value.stime = getDateOffset(days);
|
||||
queryParams.value.etime = getDateOffset(1);
|
||||
}
|
||||
/** 查询采样登记列表 */
|
||||
function getList() {
|
||||
freesingle.value=true;
|
||||
if(isEmptyData(queryParams.value.brdh)) proxy.$modal.alert("请刷卡或输入门诊号!");
|
||||
freesingle.value = true;
|
||||
if (isEmptyData(queryParams.value.brdh)) proxy.$modal.alert("请刷卡或输入门诊号!");
|
||||
else {
|
||||
loading.value = true;
|
||||
getSubday();
|
||||
querySQD(queryParams.value).then(response => {
|
||||
if (isEmptyData(response.data)) proxy.$modal.alert("没有检索的数据!");
|
||||
reqmainList.value = response.data;
|
||||
// console.log('response:', response.data);
|
||||
// console.log('response:', response.data);
|
||||
loading.value = false;
|
||||
single.value=false;
|
||||
single.value = false;
|
||||
// 新增:数据加载完成后触发全选
|
||||
// 延迟执行(确保DOM已更新)
|
||||
setTimeout(() => {
|
||||
@ -314,8 +285,8 @@ function getList() {
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
// open.value = false;
|
||||
// reset();
|
||||
// open.value = false;
|
||||
// reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
@ -360,8 +331,8 @@ function reset() {
|
||||
zd: null,
|
||||
cysj: null
|
||||
};
|
||||
freesingle.value=false;
|
||||
single.value=false;
|
||||
freesingle.value = false;
|
||||
single.value = false;
|
||||
proxy.resetForm("reqmainRef");
|
||||
}
|
||||
|
||||
@ -376,8 +347,8 @@ function readCard() {
|
||||
|
||||
// 处理病人选择事件
|
||||
const handlePatientSelect = (patient) => {
|
||||
// console.log('选中的病人:', patient);
|
||||
queryParams.value.brdh=patient
|
||||
// console.log('选中的病人:', patient);
|
||||
queryParams.value.brdh = patient
|
||||
// 处理选中的病人数据
|
||||
handleQuery();
|
||||
};
|
||||
@ -404,7 +375,7 @@ function printSigne(row) {
|
||||
printBarcodeall(idsnew.value).then(response => {
|
||||
proxy.$modal.msgSuccess("打印成功");
|
||||
open.value = false;
|
||||
freesingle.value=false;
|
||||
freesingle.value = false;
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
@ -412,16 +383,16 @@ function printSigne(row) {
|
||||
|
||||
/** 打印回单 */
|
||||
function printBack(row) {
|
||||
if (idsnew.value.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (idsnew.value.length === 0) {
|
||||
return;
|
||||
}
|
||||
//console.log('idsnew:', idsnew.value)
|
||||
printBackpaper(idsnew.value).then(response => {
|
||||
proxy.$modal.msgSuccess("打印成功");
|
||||
open.value = false;
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
proxy.$modal.msgSuccess("打印成功");
|
||||
open.value = false;
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const totalRows = computed(() => {
|
||||
@ -439,8 +410,8 @@ const totalPrice = computed(() => {
|
||||
// 组件挂载时加载字典
|
||||
onMounted(async () => {
|
||||
// 加载病人来源字典
|
||||
const dictRefs = await comDict('PT', 'DP', 'SRD','BT','SX','AU');
|
||||
// 从 ref 中获取实际数据
|
||||
const dictRefs = await comDict('PT', 'DP', 'SRD', 'BT', 'SX', 'AU');
|
||||
// 从 ref 中获取实际数据
|
||||
dictData.value = {
|
||||
PT: toRaw(dictRefs.PT.value) || [],
|
||||
DP: toRaw(dictRefs.DP.value) || [],
|
||||
@ -458,9 +429,9 @@ const tableCellStyle = ({ row, column }) => {
|
||||
// 只对“项目类别”列生效
|
||||
if (column.label === '项目类别') {
|
||||
// 1. 转换颜色(十进制→十六进制)
|
||||
const bgColor = decimalToHexColor(row.cp_color);
|
||||
const bgColor = classCom.decimalToHexColor(row.cp_color);
|
||||
// 2. 自动计算文字颜色(确保和背景色对比度足够)
|
||||
const textColor = getContrastTextColor(bgColor);
|
||||
const textColor = classCom.getContrastTextColor(bgColor);
|
||||
|
||||
return {
|
||||
backgroundColor: bgColor, // 背景色(转换后的值)
|
||||
@ -472,39 +443,6 @@ const tableCellStyle = ({ row, column }) => {
|
||||
return {}; // 其他列保持默认样式
|
||||
};
|
||||
|
||||
// 十进制颜色值转十六进制颜色码(适配BGR转RGB)
|
||||
const decimalToHexColor = (decimal) => {
|
||||
if (!decimal && decimal !== 0) return '#FFFFFF'; // 空值默认白色
|
||||
|
||||
// 1. 十进制转十六进制(去除前缀0x,大写)
|
||||
let hex = parseInt(decimal, 10).toString(16).toUpperCase();
|
||||
|
||||
// 2. 不足6位则前面补0(确保是6位)
|
||||
if (hex.length < 6) {
|
||||
hex = hex.padStart(6, '0'); // 例如:192→"C0"→补0为"0000C0"
|
||||
}
|
||||
|
||||
// 3. BGR转RGB(反转字节顺序:前两位和后两位交换)
|
||||
// 例:80FFFF → 拆分为80、FF、FF → 反转后FF、FF、80 → FFFF80
|
||||
const r = hex.substring(4, 6); // 取后两位
|
||||
const g = hex.substring(2, 4); // 取中间两位
|
||||
const b = hex.substring(0, 2); // 取前两位
|
||||
const rgbHex = r + g + b;
|
||||
|
||||
return `#${rgbHex}`; // 最终颜色码
|
||||
};
|
||||
// 辅助函数:根据背景色计算文字颜色(黑/白)
|
||||
const getContrastTextColor = (bgColor) => {
|
||||
// 提取RGB值(如#FFFF80 → R=255, G=255, B=128)
|
||||
const r = parseInt(bgColor.slice(1, 3), 16);
|
||||
const g = parseInt(bgColor.slice(3, 5), 16);
|
||||
const b = parseInt(bgColor.slice(5, 7), 16);
|
||||
|
||||
// 计算亮度(标准公式)
|
||||
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
||||
// 亮度>0.5用黑色,否则用白色(确保清晰)
|
||||
return luminance > 0.5 ? '#333333' : '#FFFFFF';
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
@ -512,21 +450,31 @@ const getContrastTextColor = (bgColor) => {
|
||||
.app-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 90vh; /* 容器高度等于窗口高度 */
|
||||
height: 90vh;
|
||||
/* 容器高度等于窗口高度 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.compact-form {
|
||||
height: 75px; /* 固定高度 */
|
||||
height: 75px;
|
||||
/* 固定高度 */
|
||||
}
|
||||
|
||||
.mb8 {
|
||||
height: 30px; /* 固定高度 */
|
||||
height: 30px;
|
||||
/* 固定高度 */
|
||||
}
|
||||
.table-summary{
|
||||
height: 10px; /* 固定高度 */
|
||||
|
||||
.table-summary {
|
||||
height: 10px;
|
||||
/* 固定高度 */
|
||||
}
|
||||
|
||||
.table-container {
|
||||
flex: 1; /* 占满剩余高度 */
|
||||
overflow: hidden; /* 避免表格超出容器 */
|
||||
flex: 1;
|
||||
/* 占满剩余高度 */
|
||||
overflow: hidden;
|
||||
/* 避免表格超出容器 */
|
||||
}
|
||||
|
||||
.compact-form .el-form-item {
|
||||
@ -537,22 +485,32 @@ const getContrastTextColor = (bgColor) => {
|
||||
.compact-form .el-form-item__label {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__row td {
|
||||
padding: 1px 0; /* 减小行高 */
|
||||
padding: 1px 0;
|
||||
/* 减小行高 */
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__header-wrapper th {
|
||||
padding: 6px 0; /* 表头内边距 */
|
||||
background-color: #b3d8ff !important; /* 表头背景色(保留之前的设置) */
|
||||
color: #333; /* 文字颜色加深,提升可读性 */
|
||||
font-weight: 500; /* 文字加粗 */
|
||||
padding: 6px 0;
|
||||
/* 表头内边距 */
|
||||
background-color: #b3d8ff !important;
|
||||
/* 表头背景色(保留之前的设置) */
|
||||
color: #333;
|
||||
/* 文字颜色加深,提升可读性 */
|
||||
font-weight: 500;
|
||||
/* 文字加粗 */
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__cell {
|
||||
padding: 0 2px; /* 减小列间距 */
|
||||
padding: 0 2px;
|
||||
/* 减小列间距 */
|
||||
}
|
||||
|
||||
/* 可选:调整表格整体样式 */
|
||||
::v-deep .my-table {
|
||||
font-size: 13px; /* 适当减小字体 */
|
||||
font-size: 13px;
|
||||
/* 适当减小字体 */
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__cell,
|
||||
@ -560,17 +518,25 @@ const getContrastTextColor = (bgColor) => {
|
||||
border-width: 1px;
|
||||
border-color: #ebeef5;
|
||||
}
|
||||
|
||||
.card-content {
|
||||
max-height: 450px; /* 设置最大高度 */
|
||||
overflow-y: auto; /* 超出高度时显示垂直滚动条 */
|
||||
padding: 5px; /* 保持与卡片默认一致的内边距 */
|
||||
max-height: 450px;
|
||||
/* 设置最大高度 */
|
||||
overflow-y: auto;
|
||||
/* 超出高度时显示垂直滚动条 */
|
||||
padding: 5px;
|
||||
/* 保持与卡片默认一致的内边距 */
|
||||
}
|
||||
|
||||
.clickable:hover {
|
||||
cursor: pointer; /* 鼠标悬停时显示手型 */
|
||||
transition: all 0.3s; /* 平滑过渡效果 */
|
||||
cursor: pointer;
|
||||
/* 鼠标悬停时显示手型 */
|
||||
transition: all 0.3s;
|
||||
/* 平滑过渡效果 */
|
||||
color: blue;
|
||||
|
||||
}
|
||||
|
||||
/* 汇总行样式 */
|
||||
.table-summary {
|
||||
display: flex;
|
||||
@ -582,7 +548,9 @@ const getContrastTextColor = (bgColor) => {
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
font-weight: 500;
|
||||
line-height: 24px; /* 汇总行文字行高 */
|
||||
line-height: 24px;
|
||||
|
||||
/* 汇总行文字行高 */
|
||||
.summary-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -596,12 +564,16 @@ const getContrastTextColor = (bgColor) => {
|
||||
.summary-value {
|
||||
color: #303133;
|
||||
min-width: 40px;
|
||||
text-align: left;/* 核心:数值左对齐 */
|
||||
text-align: left;
|
||||
/* 核心:数值左对齐 */
|
||||
}
|
||||
|
||||
/* 单独设置"单价合计"的值为红色 */
|
||||
&:nth-child(3) .summary-value {
|
||||
color: #f56c6c; /* Element UI 红色主题色 */
|
||||
font-weight: 600; /* 可选:加粗字体 */
|
||||
color: #f56c6c;
|
||||
/* Element UI 红色主题色 */
|
||||
font-weight: 600;
|
||||
/* 可选:加粗字体 */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +32,6 @@
|
||||
// "allowUnknownInTemplate": true // 允许模板中使用未知属性
|
||||
// }
|
||||
},
|
||||
"include": ["src/**/*","src/**/*.ts", "src/**/*.vue", "src/**/*.tsx", "src/**/*.d.ts", "auto-imports.d.ts"], // **表示任意目录,而 * 表示任意文件。这表明 src 目录中的所有文件都将被编译
|
||||
"include": ["src/**/*","src/**/*.ts", "src/**/*.vue","src/**/**/*.vue", "src/**/*.tsx", "src/**/*.d.ts", "auto-imports.d.ts"], // **表示任意目录,而 * 表示任意文件。这表明 src 目录中的所有文件都将被编译
|
||||
"exclude": ["node_modules", "dist"] ,// 指示不需要编译的文件目录
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ export default defineConfig(({
|
||||
server: {
|
||||
port: 8888,
|
||||
host: true,
|
||||
open: true,
|
||||
open: false,
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
'/dev-api': {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user