This commit is contained in:
wyuu 2026-01-16 16:53:36 +08:00
parent 18bf54c3e4
commit d8197cfb4d
12 changed files with 259 additions and 127 deletions

View File

@ -107,6 +107,14 @@ export function queryValXmdh(data?: Object) {
params: data
})
}
// 保存质控品参数
export function saveBtQcSample(data?: Object) {
return request({
url: '/qc/saveQcSample',
method: 'post',
data
})
}
// 查询质控品录入
export function getqcval(data?: Object) {
return request({

View File

@ -1,5 +1,6 @@
// @ts-ignore
import request from '@/utils/request'
import { ElLoading, ElMessage } from 'element-plus'
// 查询数据列表
export function queryLabPatList(query?: Object) {
@ -154,10 +155,23 @@ export function printsample(query?: Object) {
// 打印报告单
export function printListwork(query?: Object) {
// 1. 开启 loading 效果
const loadingInstance = ElLoading.service({
lock: true,
text: '数据加载中...',
background: 'rgba(0, 0, 0, 0.7)'
})
// 2. 发起请求并处理 loading 关闭
return request({
url: '/liswork/print',
method: 'get',
params: query
}).finally(() => {
loadingInstance.close()
}).catch((error: any) => {
ElMessage.error('数据加载失败,请稍后重试')
throw error
})
}
// 查询默认值

View File

@ -146,7 +146,7 @@ const handleDataEcho = () => {
} else if (props.tableData) {
row = props.tableData?.find((item: any) => props.objKey && item[props.objKey] === props.data)
}
selectShowValue.value = row ? (props.keyValue ? `${row[props.value]} ${row[props.label]}` : (props.label ? row[props.label] : (props.value ? row[props.value] : ''))) : '';
selectShowValue.value = row ? (props.keyValue ? `${row[props.value]} ${row[props.label]}` : (props.label ? row[props.label] : (props.value ? row[props.value] : ''))) : props.data;
}
};

View File

@ -4,10 +4,14 @@
<div ref="compactForm">
<el-row :gutter="10" class="compact-form" v-show="showSearch">
<el-form :model="queryParams" ref="queryRef" :inline="true" :size="aotuSize" :rules="queryRules">
<el-form-item label="日期:" prop="failed1">
<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" style="width: 28rem;" />
<el-form-item label="开始时间:" prop="st">
<el-date-picker v-model="queryParams.st" type="date" 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="et">
<el-date-picker v-model="queryParams.et" type="date" 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="yljg">
@ -17,7 +21,7 @@
</el-form-item> -->
<el-form-item label="条码状态:" prop="zt">
<el-select v-model="queryParams.zt" placeholder="请选择" style="width: 8rem;" clearable>
<el-option v-for="item in dictData.ST" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in lis_reqcx_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="" prop="queryType">
@ -68,8 +72,6 @@
<el-col :span="1.5">
<el-button type="warning" :size="aotuSize" plain @click="sendSampleHandle">清单打印</el-button>
</el-col>
<!-- <right-toolbar v-model:showSearch="showSearch" @updateColumns="updateColumns" @queryTable="handleQuery"
:columns="columns"></right-toolbar> -->
</el-row>
<CustomVxeTable :table-data="tableData" :loading="loading" :columns="columns" @current-change="rowHandle"
@ -80,7 +82,7 @@
<svg-icon v-if="row.zt != 1" icon-class="lvgou" />
</template>
<template #jzbz="{ row }">
{{ row.jzbz == '1' ? '急' : '' }}
<div style="color: #f00;"> {{ row.jzbz == '1' ? '急' : '' }}</div>
</template>
<template #jjzt="{ row }">
{{ row.jjzt == '1' ? '计价' : '无' }}
@ -185,7 +187,9 @@ const userStore = useUserStore()
const printStore = usePrintStore();
//@ts-ignore
import { getDicts } from '@/api/system/dict/data'
//@ts-ignore
const { proxy } = getCurrentInstance();
const { lis_reqcx_type } = proxy.useDict("lis_reqcx_type"); //参数类别
const compactForm = ref<HTMLElement | null>(null);
const lisReqs: any = ref([])
const nickName = ref('')
@ -194,7 +198,8 @@ const title = ref('采样登记')
const sqhText = ref('')
const tableRef = ref()
interface QueryParams {
times: string[]; // 明确类型为字符串元组
st: string;
et: string;
yljg: string;
zt: string;
queryType: string;
@ -204,8 +209,8 @@ interface QueryParams {
}
// 提交表单数据
const queryParams = reactive<QueryParams>({
times: ['2025-07-18 00:00:00', '2025-07-18 23:59:59'],
// times: [],
st: '2025-07-18 00:00:00',
et: '2025-07-18 23:59:59',
yljg: '1',
zt: '',
queryType: '',
@ -306,9 +311,9 @@ const cellStyleHd = ({ row, column, rowIndex, columnIndex }: {
columnIndex: number;
}) => {
// console.log(row, column, rowIndex, columnIndex);
if (column.title == "急" && row.jzbz == "1") {
return { color: '#f00' };
}
// if (column.title == "急" && row.jzbz == "1") {
// return { backgroundColor: `transparent !important`, color: '#f00' };
// }
if (column.title == "类别") {
const bgColor = classCom.decimalToHexColor(row.bkcolor);
@ -329,6 +334,12 @@ const rowClassNameHd = ({ row, rowIndex }: {
row: any;
rowIndex: number;
}) => {
if (row.zt.trim()) {
const bgColor = lisReqs.value.find((item: any) => item.value == row.zt.trim())?.elTagClass || '#FFF';
return {
backgroundColor: `${bgColor} !important`,
};
}
return 'custom-row-class'; // 返回自定义类名
};
@ -590,14 +601,13 @@ const timeDate = () => {
// 计算前6天的日期(当天 + 前6天 = 7天)
const startOfWeek = today.subtract(6, 'day');
const startDate = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD HH:mm:ss');
const endDate = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD HH:mm:ss');
queryParams.st = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD HH:mm:ss');
queryParams.et = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD HH:mm:ss');
queryParams.times = [startDate, endDate];
}
onMounted(async () => {
timeDate()
// timeDate()
queryParams.ksdh = (route.query.deptcode as string) ? (route.query.deptcode as string) : '';
queryParams.userid = (route.query.userid as string) ? (route.query.userid as string) : '';
@ -641,12 +651,11 @@ const formatDict = (v: string, dictType: string) => {
const handletime = (val: Array<string>) => {
// console.log('时间', val);
// 校验日期格式
const dayDiff = getDayDiff(val[0], val[1]);
const dayDiff = getDayDiff(queryParams.st, queryParams.et);
if (dayDiff === -1) return ElMessage.warning('请选择有效的日期范围');
//校验是否超过7天
if (dayDiff > 7) return ElMessage.warning('查询时间范围不能超过7天,请重新选择');
// if (dayDiff > 7) return ElMessage.warning('查询时间范围不能超过7天,请重新选择');
}
// 生成条码
@ -654,17 +663,11 @@ const printHandle = () => {
const data = {
dept: queryParams.ksdh,
userid: queryParams.userid,
st: '',
et: '',
st: queryParams.st,
et: queryParams.et,
yljg: queryParams.yljg
}
if (queryParams.times && queryParams.times.length) {
data.st = queryParams.times[0]
data.et = queryParams.times[1]
} else {
data.st = ''
data.et = ''
}
addObj(data).then((res: any) => {
if (res.code == 0) {
getList()
@ -689,8 +692,8 @@ const getList = () => {
const data = {
dept: queryParams.ksdh,
userid: queryParams.userid,
st: queryParams.times[0],
et: queryParams.times[1],
st: queryParams.st,
et: queryParams.et,
yljg: queryParams.yljg,
queryType: queryParams.queryType,
queryValue: queryParams.queryValue,
@ -702,19 +705,13 @@ const getList = () => {
if (!data.userid) return ElMessage.warning('用户userid不能为空!')
// 校验日期格式
const dayDiff = getDayDiff(queryParams.times[0], queryParams.times[1]);
const dayDiff = getDayDiff(queryParams.st, queryParams.et);
if (dayDiff === -1) return ElMessage.warning('请选择有效的日期范围');
//校验是否超过7天
if (dayDiff > 7) return ElMessage.warning('查询时间范围不能超过7天,请重新选择');
if (queryParams.times && queryParams.times.length > 0) {
data.st = queryParams.times[0]
data.et = queryParams.times[1]
} else {
data.st = ''
data.et = ''
}
// if (dayDiff > 7) return ElMessage.warning('查询时间范围不能超过7天,请重新选择');
loading.value = true;
fetchCodeList(data).then((response: any) => {

View File

@ -6,9 +6,13 @@
<el-form :model="queryParams" ref="queryRef" label-width="100px" :rules="queryRules" style="width: 100%;">
<el-row>
<el-col :span="6">
<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 label="开始时间:" prop="st">
<el-date-picker v-model="queryParams.st" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="handletime" />
</el-form-item>
<el-form-item label="结束时间:" prop="et">
<el-date-picker v-model="queryParams.et" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="handletime" />
</el-form-item>
</el-col>
@ -199,7 +203,8 @@ const options = ref([
{ label: '复制正常数据', value: 'Y' },
])
interface QueryParams {
times: string[]; // 明确类型为字符串元组
st: string,
et: string,
alarmflag: boolean,
jzbz: boolean,
ksdh: string,
@ -215,8 +220,10 @@ interface QueryParams {
// 提交表单数据
const queryParams = reactive<QueryParams>({
times: ['2025-08-19', '2025-08-19'],
// times: ['2025-08-19', '2025-08-19'],
// ksdh: '0203',
st: '',
et: '',
ksdh: '0210',
brlyname: '',
sqh: '25080109476',
@ -246,10 +253,10 @@ const queryRules = ref({
const handletime = (val: Array<string>) => {
// console.log('时间', val);
// 校验日期格式
const dayDiff = getDayDiff(val[0], val[1]);
const dayDiff = getDayDiff(queryParams.st, queryParams.et);
if (dayDiff === -1) return ElMessage.warning('请选择有效的日期范围');
//校验是否超过7天
if (dayDiff > 7) return ElMessage.warning('查询时间范围不能超过7天,请重新选择');
// if (dayDiff > 7) return ElMessage.warning('查询时间范围不能超过7天,请重新选择');
}
// 时间线数据
@ -846,10 +853,10 @@ onMounted(async () => {
// 计算前6天的日期(当天 + 前6天 = 7天)
const startOfWeek = today.subtract(6, 'day');
const startDate = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD');
const endDate = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD');
queryParams.st = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD');
queryParams.et = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD');
queryParams.times = [startDate, endDate];
queryParams.ksdh = (route.query.deptcode as string) ? (route.query.deptcode as string) : '';
queryParams.userid = (route.query.userid as string) ? (route.query.userid as string) : '';
queryParams.brdh = (route.query.brdh as string) ? (route.query.brdh as string) : '';
@ -899,8 +906,8 @@ const getList = () => {
brdh: queryParams.brdh,
ch: queryParams.ch,
userid: queryParams.userid,
st: '',
et: '',
st: queryParams.st,
et: queryParams.et,
yljg: queryParams.yljg,
}
@ -908,19 +915,12 @@ const getList = () => {
if (!data.yljg) return ElMessage.error('医疗机构yljg不能为空');
if (!data.userid) return ElMessage.error('用户userid不能为空');
// 校验日期格式
const dayDiff = getDayDiff(queryParams.times[0], queryParams.times[1]);
const dayDiff = getDayDiff(queryParams.st, queryParams.et);
if (dayDiff === -1) return ElMessage.warning('请选择有效的日期范围');
//校验是否超过7天
if (dayDiff > 7) return ElMessage.warning('查询时间范围不能超过7天,请重新选择');
// if (dayDiff > 7) return ElMessage.warning('查询时间范围不能超过7天,请重新选择');
if (queryParams.times && queryParams.times.length) {
data.st = queryParams.times[0]
data.et = queryParams.times[1]
} else {
data.st = ''
data.et = ''
}
loading.value = true
reportList(data).then((res: any) => {
if (res.code == 0) {

View File

@ -84,6 +84,9 @@
<template #dybz="{ row }">
<svg-icon v-if="row.dybz == 1" icon-class="lvgou" />
</template>
<template #jgbz="{ row }">
<el-checkbox :model-value="row.jgbz == '2'" readonly />
</template>
<template #alarmflag="{ row }">
{{ row.alarmflag == 1 ? '危' : '' }}
</template>
@ -217,24 +220,38 @@ const tableData = ref([])
const columns = ref([
{ type: 'selection', field: '', title: '', resizable: true, align: 'center', width: 40 },
{ field: 'dybz', title: '印', align: 'center', resizable: true, slotName: 'dybz', width: 40 },
{ field: 'jzbz', title: '急', align: 'center', resizable: true, slotName: 'jzbz', width: 40 },
{ field: 'alarmflag', title: '危', align: 'center', resizable: true, slotName: 'alarmflag', width: 40 },
{ field: 'brdh', title: '病人代号', align: 'center', resizable: true, sortable: true, width: 100 },
{ field: 'brxm', title: '病人姓名', align: 'center', resizable: true, width: 60 },
{ field: 'jgbz', title: '审', align: 'center', resizable: true, slotName: 'jgbz', width: 40 },
{ field: 'yljg', title: '医疗机构', align: 'center', resizable: true, width: 130 },
{ field: 'yqdl', title: '检验仪器', align: 'center', resizable: true, width: 80 },
{ field: 'jyrqname', title: '标本日期', align: 'center', resizable: true, width: 80 },
{ field: 'ybh', title: '标本号', align: 'center', resizable: true, width: 60 },
// { field: 'jzbz', title: '急', align: 'center', resizable: true, slotName: 'jzbz', width: 40 },
// { field: 'alarmflag', title: '危', align: 'center', resizable: true, slotName: 'alarmflag', width: 40 },
{ field: 'brxm', title: '姓名', align: 'center', resizable: true, width: 50 },
{ field: 'brdh', title: '住院号', align: 'center', resizable: true, sortable: true, width: 100 },
{ field: 'sqh', title: '申请号', align: 'center', resizable: true, width: 100 },
{ field: 'brlyname', title: '病人类型', align: 'center', resizable: true, width: 60 },
{ field: 'brxbname', title: '性别', align: 'center', resizable: true, width: 40 },
{ field: 'nl', title: '年龄', align: 'center', resizable: true, width: 40 },
{ field: 'ksname', title: '科室', align: 'center', resizable: true, width: 90 },
{ field: 'ch', title: '床号', align: 'center', resizable: true, width: 50 },
{ field: 'jymd', title: '检验目的', align: 'center', resizable: true, width: 200 },
{ field: 'yblxname', title: '样本类型', align: 'center', resizable: true, width: 60 },
{ field: 'sqsj', title: '送检时间', align: 'center', resizable: true, width: 150 },
{ field: 'confirmtime', title: '报告时间', align: 'center', resizable: true, sortable: true, width: 150 },
{ field: 'sjysname', title: '送检医生', align: 'center', resizable: true, width: 80 },
{ field: 'brlyname', title: '病人类型', align: 'center', resizable: true, width: 80 },
{ field: 'yljg', title: '医疗机构', align: 'center', resizable: true, width: 150 },
{ field: 'jyrqname', title: '检验日期', align: 'center', resizable: true, width: 100 },
{ field: 'ybh', title: '样本号', align: 'center', resizable: true, width: 60 },
{ field: 'yqmc', title: '仪器名称', align: 'center', resizable: true, width: 150 },
{ field: 'yqdl', title: '仪器', align: 'center', resizable: true, width: 100 },
{ field: 'bbsjsj', title: '送检时间', align: 'center', resizable: true, width: 80 },
{ field: 'cysj', title: '采样时间', align: 'center', resizable: true, width: 80 },
{ field: 'jysh', title: '检验医生', align: 'center', resizable: true, width: 80 },
{ field: 'dysj', title: '报告日期', align: 'center', resizable: true, width: 80 },
{ field: 'yblxname', title: '标本', align: 'center', resizable: true, width: 50 },
{ field: 'fb', title: '费别', align: 'center', resizable: true, width: 50 },
{ field: 'hdys', title: '核对医生', align: 'center', resizable: true, width: 60 },
{ field: 'zd', title: '临床诊断', align: 'center', resizable: true, width: 100 },
{ field: 'bz', title: '备注', align: 'center', resizable: true, width: 100 },
{ field: 'sjysname', title: '审核人', align: 'center', resizable: true, width: 60 },
{ field: 'confirmtime', title: '审核时间', align: 'center', resizable: true, width: 80 },
{ field: 'zh', title: '最后修改人', align: 'center', resizable: true, width: 100 },
{ field: 'zhtime', title: '最后修改时间', align: 'center', resizable: true, width: 100 },
{ field: 'sfz', title: '身份证', align: 'center', resizable: true, width: 100 },
{ field: 'phone', title: '病人联系方式', align: 'center', resizable: true, width: 100 },
{ field: 'jsphone', title: '家属联系方式', align: 'center', resizable: true, width: 100 },
])
const selectionChange = (selection: any) => {
@ -319,16 +336,20 @@ const editHandle = () => {
router.push({
name: 'Micro', // 必须用 name 跳转,不能用 path
state: { // 核心:参数存在 state 中
id: 123,
name: '测试参数',
yq: Info.value.yq,
jyrq: Info.value.jyrq,
lisgroup: Info.value.lisgroup,
ybh: Info.value.ybh,
}
});
} else {
router.push({
name: 'Work',
state: {
id: 123,
name: '测试参数',
yq: Info.value.yq,
jyrq: Info.value.jyrq,
lisgroup: Info.value.lisgroup,
ybh: Info.value.ybh,
}
});
}

View File

@ -204,10 +204,6 @@ const queryParams = ref({
const activeName = ref('first');
const total = ref(0)
const ybs = ref(0)
const ws = ref(0)
const wjs = ref(0)
const activeTab = ref('LabPatList')
const tabList = ref([
{ label: '标本列表', value: 'LabPatList' },
@ -405,12 +401,13 @@ const previewHandle = (url: string) => {
pdfUrl.value = `data:application/pdf;base64,${url}`
previewShow.value = true
}
const handleinstrGroupChange = (val: any) => {
const handleinstrGroupChange = () => {
queryParams.value.yq = ''
getYqConfig()
}
const mbStore = useCommonStore();
const yqHandleChange = (val: any) => {
const yqHandleChange = () => {
queryParams.value.ybh = ''
zbLabResuts.value = [];
labPat.value = {}
mbStore.setLxsrList([]);
@ -719,9 +716,19 @@ const fetchlabPatList = () => {
loading.value = false;
originalLabPatList.value = res.data;
if (res.data.length > 0) {
if (queryParams.value.ybh) {
const index = labPatList.value.findIndex((item: any) => item.ybh == queryParams.value.ybh)
if (index !== -1) {
highlightRowIndex.value = index;
const row = labPatList.value[index];
setTimeout(() => { labPatListRef.value.setCurrentRow(row); }, 10)
selectJob(row);
}
} else {
highlightRowIndex.value = 0;
setTimeout(() => { labPatListRef.value.setCurrentRow(res.data[0]) }, 10)
selectJob(res.data[0])
}
} else {
labInfo.value = {}
labPat.value = {}
@ -730,13 +737,6 @@ const fetchlabPatList = () => {
}
})
}
// 计算样本数
const getTotals = () => {
ybs.value = labPatList.value.length
ws.value = labPatList.value.filter((item: any) => item.jgbz != 2).length
wjs.value = labPatList.value.filter((item: any) => item.alarmflag == 1).length
}
loadinstrGroupOptions()
fetchlabPatList()
@ -772,8 +772,37 @@ const getSysList = () => {
}
getSysList()
// 定义参数类型(类型安全)
interface RouteStateParams {
yq: string;
jyrq: string;
lisgroup: string;
ybh: string;
}
// 报告查询跳转后操作
const getParams = () => {
const state = history.state as Partial<RouteStateParams>;
// 只读取一次参数
if (state && state.yq) {
queryParams.value.yq = state.yq;
queryParams.value.jyrq = state.jyrq ?? queryParams.value.jyrq;
queryParams.value.instrGroup = state.lisgroup ?? queryParams.value.instrGroup;
queryParams.value.ybh = state.ybh ?? queryParams.value.ybh;
getSysList()
getYqConfig()
fetchlabPatList()
sendMessage()
// 读取后清空 state 刷新/回退不重复读取
history.replaceState({}, document.title);
}
};
const userList = ref([]);
onMounted(async () => {
getParams()
const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 }
listUser(data).then((res: any) => {
userList.value = res.rows;
@ -797,6 +826,10 @@ onMounted(async () => {
initSocket()
});
onActivated(() => {
getParams()
})
const initSocket = () => {
initWebSocket({
fullUrl: `ws://47.97.125.165:8904/ws/instr/${mbStore.fingerprint}`,

View File

@ -10,6 +10,7 @@
@click="handleBatchDelete">删除</el-button>
<el-button class="btn_green btns_box" :size="autoSize" :disabled="labPat.jgbz == 2"
@click="zhHandel">组合项目</el-button>
<el-button type="primary" plain class=" btns_box" @click="printHandle(1)">打印</el-button>
</div>
<ContextMenu :items="contextMenuItems" @select="handleMenuSelect">
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :enable-column-drag="true"
@ -812,6 +813,20 @@ const zhHandel = () => {
combinedRef.value.open()
};
const printHandle = (type: number) => {
const data = {
jyrq: labPat.value.jyrq,
yq: labPat.value.yq,
ybh: labPat.value.ybh,
sqh: labPat.value.sqh
}
printListwork(data).then((res: any) => {
if (res.code == 0) {
classCom.printBase64PDF(res.data)
}
})
};
const combinedHandel = (row: any) => {
if (props.labPat.jgbz != null && props.labPat.jgbz != 0 && props.labPat.jgbz != 'C') return ElMessage.warning('已审核结果不可添加模板项目');
const data = {

View File

@ -18,7 +18,6 @@
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
<el-button type="primary" plain @click="copyBzHandle">复制靶值</el-button>
<el-button type="primary" plain @click="addBzHandle">新增靶值</el-button>
<el-button type="danger" plain @click="delBzHandle">删除靶值</el-button>
<el-button type="primary" plain @click="">计算</el-button>
</el-col>
</el-row>
@ -80,7 +79,8 @@
</div>
<div style="height:40%">
<CustomTable ref="rightTableRef" :data="bottomTableData" :columns="bottomColumns" :enableColumnDrag="true"
@column-drag-end="columnDragEnd" :config="{ border: true, highlightCurrentRow: true, height: '100%' }">
@column-drag-end="columnDragEnd"
:config="{ border: true, highlightCurrentRow: true, height: '100%', actionWidth: 80 }">
<template #xmdh="{ row }">
{{ row.xmdh }} {{ row.xmmc }}
</template>
@ -90,6 +90,9 @@
<template #sjph="{ row }">
{{ formatDict(row.sjph, 'LOT') }}
</template>
<template #action="{ row }">
<el-button type="danger" text @click="delBzHandle(row)">删除</el-button>
</template>
</CustomTable>
</div>
</el-col>
@ -158,10 +161,11 @@
</template>
<script setup lang="ts">
import { queryBatch, queryValXmdh, queryBatchXm, delBatchno, addBatchno, updateBatchno } from '@/api/liswork/qualityControl'
import { queryBatch, queryValXmdh, queryBatchXm, delBatchno, addBatchno, updateBatchno, saveBtQcSample } from '@/api/liswork/qualityControl'
import { templateRef } from '@vueuse/core'
import { formatDict, getDictData, dictData } from '@/hooks';
import { ElMessage, ElMessageBox } from 'element-plus'
import { log } from 'vxe-pc-ui';
const yq = defineModel<string>()
const title = ref('新增批号')
@ -375,23 +379,26 @@ const addBzHandle = () => {
item.zkbz = ''
item.sd = ''
item.cv = ''
item.bc = ''
item.ksrq = ''
item.stopdate = ''
item.ff = ''
item.sjph = ''
item.qccv = ''
})
}
const delBzHandle = () => {
ElMessageBox.confirm('是否确认删除选中数据?', '提示', {
const delBzHandle = (row: any) => {
ElMessageBox.confirm('确定要删除这个靶值吗,可能会影响其区间内的质控计算?', '提示', {
type: 'warning'
}).then(() => {
console.log("🚀 ~ delBzHandle ~ row:", row)
})
}
const handleSave = () => {
console.log(topTableData.value)
saveBtQcSample(topTableData.value).then((res: any) => {
if (res.code == 0) {
ElMessage.success('保存成功')
rowClick(topTableData.value[0])
}
})
}
const handleSave = () => { }
watch(yq, (val) => {
if (val) {

View File

@ -39,6 +39,7 @@
<div class="table-box">
<CustomVxeTable class="mytable-style" ref="tableRef" :table-data="tableData" :columns="columns"
:rowConfig="{ isHover: true, height: 30, isCurrent: false }"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :cell-style="cellStyleHd">
<template #cs1="{ row }">
<el-input v-model="row.cs1" class="full-width-input" />
@ -145,8 +146,11 @@ const getXmList = () => {
const getXmInfo = () => {
getqcvalmonth({ yq: yq.value, ...queryParams.value, zkph: activeName.value }).then((res: any) => {
const mergedResult = mergeDataByXmdh(res.data);
tableData.value = mergedResult
if (res.data.cs1) {
tableData.value = mergeDataByXmdh(res.data);
} else {
tableData.value = []
}
})
}
// 合并数据
@ -225,6 +229,8 @@ watch(yq, (val) => {
queryValue({ yq: yq.value, xxdh: 'QCSAMPLECNT' }).then((res: any) => {
zkps.value = Number(res.data) || 1
})
queryParams.value.xmdh = ''
tableData.value = []
getXmList()
}
}, { immediate: true })

View File

@ -123,8 +123,11 @@ const tabClick = (tab: { paneName: number }) => {
const getXmList = () => {
getqcval({ yq: yq.value, zkrq: zkrq.value, zkph: activeName.value }).then((res: any) => {
const mergedResult = mergeDataByXmdh(res.data);
tableData.value = mergedResult
if (res.data.cs1) {
tableData.value = mergeDataByXmdh(res.data);
} else {
tableData.value = []
}
})
}
// 合并数据

View File

@ -296,14 +296,13 @@ const previewHandle = (url: string) => {
pdfUrl.value = `data:application/pdf;base64,${url}`
previewShow.value = true
}
const handleinstrGroupChange = (val: any) => {
const handleinstrGroupChange = () => {
queryParams.value.yq = ''
// labResuts.value = []
// labPat.value = {}
getYqConfig()
}
const yqHandleChange = (val: any) => {
const yqHandleChange = () => {
queryParams.value.ybh = ''
labResuts.value = []
labPat.value = {}
mbStore.setLxsrList([]);
@ -596,9 +595,20 @@ const fetchlabPatList = () => {
originalLabPatList.value = res.data
loading.value = false;
if (res.data.length > 0) {
// 跳转传过来的样本
if (queryParams.value.ybh) {
const index = labPatList.value.findIndex((item: any) => item.ybh == queryParams.value.ybh)
if (index !== -1) {
highlightRowIndex.value = index;
const row = labPatList.value[index];
setTimeout(() => { labPatListRef.value.setCurrentRow(row); }, 100)
selectJob(row);
}
} else {
highlightRowIndex.value = 0;
setTimeout(() => { labPatListRef.value.setCurrentRow(res.data[0]); }, 100)
selectJob(res.data[0])
}
getTotals()
} else {
handleCreate()
@ -652,19 +662,33 @@ const userList = ref([]);
// 定义参数类型(类型安全)
interface RouteStateParams {
id: number;
name: string;
yq: string;
jyrq: string;
lisgroup: string;
ybh: string;
}
onMounted(async () => {
// 报告查询跳转后操作
const getParams = () => {
const state = history.state as Partial<RouteStateParams>;
console.log("🚀 ~ state:", state)
// 只读取一次参数
if (state && state.id) {
if (state && state.yq) {
queryParams.value.yq = state.yq;
queryParams.value.jyrq = state.jyrq ?? queryParams.value.jyrq;
queryParams.value.instrGroup = state.lisgroup ?? queryParams.value.instrGroup;
queryParams.value.ybh = state.ybh ?? queryParams.value.ybh;
getSysList()
getYqConfig()
fetchlabPatList()
sendMessage()
// 读取后清空 state 刷新/回退不重复读取
history.replaceState({}, document.title);
}
};
onMounted(async () => {
getParams()
const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 }
listUser(data).then((res: any) => {
@ -687,6 +711,10 @@ onMounted(async () => {
initSocket()
});
onActivated(() => {
getParams()
})
const initSocket = () => {
initWebSocket({
fullUrl: `ws://47.97.125.165:8904/ws/instr/${mbStore.fingerprint}`,