Compare commits

..

No commits in common. "18bf54c3e41c35cea10d3d45e7b632afb78a3737" and "b9707b3659ce037844e6449f63f0163bbe5b5801" have entirely different histories.

13 changed files with 70 additions and 97 deletions

View File

@ -116,9 +116,9 @@ export function getqcval(data?: Object) {
}) })
} }
// 保存质控数据(当天所有项目) // 保存质控数据(当天所有项目)
export function saveqcvalItem(data?: Object) { export function saveqcvalmonth(data?: Object) {
return request({ return request({
url: '/qc/saveqcvalitem', url: '/qc/saveqcvalmonth',
method: 'post', method: 'post',
data data
}) })
@ -140,9 +140,9 @@ export function getqcvalmonth(data?: Object) {
}) })
} }
//保存质控数据(单项目一个月) //保存质控数据(单项目一个月)
export function saveQcvalMonth(data?: Object) { export function saveQcvalItem(data?: Object) {
return request({ return request({
url: '/qc/saveqcvalmonth', url: '/qc/saveqcvalitem',
method: 'post', method: 'post',
data data
}) })

View File

@ -35,8 +35,8 @@
<el-table-column v-for="field in props.fields" :prop="field.prop" :label="field.label" <el-table-column v-for="field in props.fields" :prop="field.prop" :label="field.label"
:width="field.width" show-overflow-tooltip align="center" /> :width="field.width" show-overflow-tooltip align="center" />
</el-table> --> </el-table> -->
<vxe-table class="mytable-style" ref="tableRef" border resizable max-height="350px" <vxe-table class="mytable-style" ref="tableRef" border resizable highlight-current-row max-height="350px"
:row-config="{ isHover: true, keyField: 'value', height: 30, isCurrent: true }" :data="filterData" :row-config="{ isHover: true, keyField: 'value', height: 30 }" :data="filterData"
:current-row="currentRow" @current-change="currentChange" :current-row="currentRow" @current-change="currentChange"
:tooltip-config="{ appendToBody: true, zIndex: 3000 }" :show-overflow="true" :tooltip-config="{ appendToBody: true, zIndex: 3000 }" :show-overflow="true"
:scroll-y="{ enabled: true, rSize: 30, height: '100%' }"> :scroll-y="{ enabled: true, rSize: 30, height: '100%' }">

View File

@ -16,7 +16,8 @@
<vxe-table :data="tableData" :loading="loading" border :checkbox-config="config.checkboxConfig" <vxe-table :data="tableData" :loading="loading" border :checkbox-config="config.checkboxConfig"
:height="scrollYConfig.height" @checkbox-change="handleCheckboxChange" :row-config="rowConfig" :height="scrollYConfig.height" @checkbox-change="handleCheckboxChange" :row-config="rowConfig"
:show-overflow="showOverflow" @current-change="handleRowClick" ref="tableRef" :size="size" :show-overflow="showOverflow" @current-change="handleRowClick" ref="tableRef" :size="size"
:current-row="currentRow" :scroll-y="scrollYConfig" :tooltip-config="{ appendToBody: true, zIndex: 3000 }" :current-row="currentRow" :highlight-current-row="highlightCurrentRow" :scroll-y="scrollYConfig"
:tooltip-config="{ appendToBody: true, zIndex: 3000 }"
:header-cell-class-name="enableColumnDrag ? 'el-table-header-cell' : ''" v-bind="$attrs"> :header-cell-class-name="enableColumnDrag ? 'el-table-header-cell' : ''" v-bind="$attrs">
<!-- 动态渲染列 --> <!-- 动态渲染列 -->
<template v-for="(column, i) in columns" :key="`${column.field}-${i}`"> <template v-for="(column, i) in columns" :key="`${column.field}-${i}`">
@ -73,9 +74,7 @@ const props = defineProps({
// 行配置 // 行配置
rowConfig: { rowConfig: {
type: Object, type: Object,
default: () => ({ default: () => ({ isHover: true, height: 30 })
isHover: true, height: 30, isCurrent: true, keyField: '_index'
})
}, },
// 表格配置 // 表格配置
config: { config: {
@ -87,7 +86,7 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: true default: true
}, },
// 是否高亮当前行 已废弃 // 是否高亮当前行
highlightCurrentRow: { highlightCurrentRow: {
type: Boolean, type: Boolean,
default: true default: true

View File

@ -178,7 +178,6 @@ interface OriginalItem {
yq: string | null; yq: string | null;
ld: string | null; ld: string | null;
zkrq: string | null; zkrq: string | null;
daynum?: number | undefined;
} }
// 定义原始数据的接口 // 定义原始数据的接口
@ -201,7 +200,6 @@ interface ResultItem {
xmmc: string; xmmc: string;
sd: string; sd: string;
zkbz: string; zkbz: string;
daynum?: number | undefined;
cs1: string; cs1: string;
cs2: string; cs2: string;
cs3: string; cs3: string;

View File

@ -72,8 +72,9 @@
:columns="columns"></right-toolbar> --> :columns="columns"></right-toolbar> -->
</el-row> </el-row>
<CustomVxeTable :table-data="tableData" :loading="loading" :columns="columns" @current-change="rowHandle" <CustomVxeTable :table-data="tableData" :loading="loading" :columns="columns"
size="small" :row-style="rowClassNameHd" :cell-style="cellStyleHd" class="mytable-style" ref="tableRef" :row-config="{ isHover: true, keyField: '_index' }" @current-change="rowHandle" size="small"
:row-style="rowClassNameHd" :cell-style="cellStyleHd" class="mytable-style" ref="tableRef"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" @selection-change="selectionChange" :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" @selection-change="selectionChange"
:config="tableConfig" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"> :config="tableConfig" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd">
<template #dy="{ row }"> <template #dy="{ row }">

View File

@ -87,10 +87,11 @@
:columns="columns"></right-toolbar> --> :columns="columns"></right-toolbar> -->
</el-row> </el-row>
<CustomVxeTable :table-data="tableData" :loading="loading" :columns="columns" @current-change="rowHandle" <CustomVxeTable :table-data="tableData" :loading="loading" :columns="columns"
size="small" :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style" :row-config="{ isHover: true, keyField: '_index' }" @current-change="rowHandle" size="small"
ref="tableRefs" :cell-style="cellStyleHd" @selection-change="selectionChange" :config="tableConfig" :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style" ref="tableRefs"
:enable-column-drag="true" @column-drag-end="handleColumnDragEnd"> :cell-style="cellStyleHd" @selection-change="selectionChange" :config="tableConfig" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd">
<template #dybz="{ row }"> <template #dybz="{ row }">
<svg-icon v-if="row.dybz == 1" icon-class="lvgou" /> <svg-icon v-if="row.dybz == 1" icon-class="lvgou" />
</template> </template>
@ -356,15 +357,10 @@ const rowHandle = (row: any) => {
reportResult(data).then((res: any) => { reportResult(data).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
rightTableData.value = res.data rightTableData.value = res.data
if (res.data.length) {
nextTick(() => { nextTick(() => {
rightTableRef.value.setCurrentRow(res.data[0]) rightTableRef.value.setCurrentRow(res.data[0])
}) })
xmrowHandle(res.data[0]) xmrowHandle(res.data[0])
} else {
bottomTableData.value = []
}
} }
}) })
} }

View File

@ -70,17 +70,26 @@
</el-form> </el-form>
</el-row> </el-row>
</div> </div>
<div class="mb8 mt10"> <el-row :gutter="10" class="mb8 mt10">
<el-col :span="1.5">
<el-button type="primary" plain icon="Edit" :size="aotuSize" @click="selectStatusRows">勾选所有未打印</el-button> <el-button type="primary" plain icon="Edit" :size="aotuSize" @click="selectStatusRows">勾选所有未打印</el-button>
</el-col>
<el-col :span="1.5">
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="Upload" :size="aotuSize" @click="printPdf">打印报告</el-button> <el-button type="primary" plain icon="Upload" :size="aotuSize" @click="printPdf">打印报告</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="edit" :size="aotuSize" @click="editHandle">编辑</el-button> <el-button type="primary" plain icon="edit" :size="aotuSize" @click="editHandle">编辑</el-button>
</div> </el-col>
</el-row>
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="16" class="right-table"> <el-col :span="16" class="right-table">
<CustomVxeTable :table-data="tableData" :loading="loading" :columns="columns" @current-change="rowHandle" <CustomVxeTable :table-data="tableData" :loading="loading" :columns="columns"
size="small" :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style" :row-config="{ isHover: true, keyField: '_index' }" @current-change="rowHandle" size="small"
ref="tableRefs" :cell-style="cellStyleHd" @selection-change="selectionChange" :config="tableConfig" :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style" ref="tableRefs"
:enable-column-drag="true" @column-drag-end="handleColumnDragEnd"> :cell-style="cellStyleHd" @selection-change="selectionChange" :config="tableConfig" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd">
<template #dybz="{ row }"> <template #dybz="{ row }">
<svg-icon v-if="row.dybz == 1" icon-class="lvgou" /> <svg-icon v-if="row.dybz == 1" icon-class="lvgou" />
</template> </template>
@ -120,6 +129,7 @@
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted } from 'vue'; import { ref, reactive, toRaw, computed, watch, nextTick, onMounted } from 'vue';
import CustomTable from '@/components/elTable/index.vue' import CustomTable from '@/components/elTable/index.vue'
import CustomVxeTable from '@/components/vxeTable/index.vue' import CustomVxeTable from '@/components/vxeTable/index.vue'
import { useRouter } from 'vue-router'
import { reportList, reportPrintPdf, reportResult, reportMedList, reportFsresult } from '@/api/checkCode/index' import { reportList, reportPrintPdf, reportResult, reportMedList, reportFsresult } from '@/api/checkCode/index'
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import SelectTable from '@/components/SelectTable/index.vue'; import SelectTable from '@/components/SelectTable/index.vue';
@ -132,10 +142,8 @@ import { comDict } from '@/utils/dict'
import { usePrintStore } from '@/store/modules/printStore' import { usePrintStore } from '@/store/modules/printStore'
//@ts-ignore //@ts-ignore
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { useRoute, useRouter } from 'vue-router' import { useRoute } from 'vue-router'
const route = useRoute() const route = useRoute()
const router = useRouter();
const aotuSize = classCom.useAutoSize(); const aotuSize = classCom.useAutoSize();
const tableRefs = ref() const tableRefs = ref()
@ -234,7 +242,6 @@ const columns = ref([
{ field: 'ybh', title: '样本号', align: 'center', resizable: true, width: 60 }, { field: 'ybh', title: '样本号', align: 'center', resizable: true, width: 60 },
{ field: 'yqmc', title: '仪器名称', align: 'center', resizable: true, width: 150 }, { field: 'yqmc', title: '仪器名称', align: 'center', resizable: true, width: 150 },
{ field: 'yqdl', title: '仪器', align: 'center', resizable: true, width: 100 }, { field: 'yqdl', title: '仪器', align: 'center', resizable: true, width: 100 },
]) ])
const selectionChange = (selection: any) => { const selectionChange = (selection: any) => {
@ -269,15 +276,10 @@ const rowHandle = (row: any) => {
reportResult(data).then((res: any) => { reportResult(data).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
rightTableData.value = res.data rightTableData.value = res.data
if (res.data.length) {
nextTick(() => { nextTick(() => {
rightTableRef.value.setCurrentRow(res.data[0]) rightTableRef.value.setCurrentRow(res.data[0])
}) })
xmrowHandle(res.data[0]) xmrowHandle(res.data[0])
} else {
bottomTableData.value = []
}
} }
}) })
} }
@ -314,23 +316,11 @@ const printPdf = () => {
} }
const editHandle = () => { const editHandle = () => {
if (!Info.value.ybh) return // Info.value
if (Info.value.yqdl == '细菌仪') { if (Info.value.yqdl == '细菌仪') {
router.push({
name: 'Micro', // 必须用 name 跳转,不能用 path
state: { // 核心:参数存在 state 中
id: 123,
name: '测试参数',
}
});
} else { } else {
router.push({
name: 'Work',
state: {
id: 123,
name: '测试参数',
}
});
} }
} }
@ -559,7 +549,7 @@ onMounted(async () => {
const startDate = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD'); 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'); const endDate = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD');
// queryParams.times = [startDate, endDate]; queryParams.times = [startDate, endDate];
getList() getList()

View File

@ -1,8 +1,9 @@
<template> <template>
<div class="table-container"> <div class="table-container">
<ContextMenu :items="contextMenuItems" @select="handleMenuSelect" menu-width="200"> <ContextMenu :items="contextMenuItems" @select="handleMenuSelect" menu-width="200">
<CommonTable :table-data="labPatList" :loading="loading" :columns="tableColumns" @current-change="handleRowClick" <CommonTable :table-data="labPatList" :loading="loading" :columns="tableColumns"
size="small" :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :row-style="rowStyle" :row-config="{ isHover: true, keyField: 'ybh' }" @current-change="handleRowClick" size="small"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :row-style="rowStyle"
:cell-style="cellStyle" class="mytable-style" ref="tableRef" :enable-column-drag="true" :cell-style="cellStyle" class="mytable-style" ref="tableRef" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd"> @column-drag-end="handleColumnDragEnd">
<!-- 完成状态列 --> <!-- 完成状态列 -->

View File

@ -26,7 +26,8 @@
<el-row :gutter="10" class="table-row"> <el-row :gutter="10" class="table-row">
<el-col :span="8" class="table-col left-table"> <el-col :span="8" class="table-col left-table">
<CustomVxeTable ref="leftTableRef" class="mytable-style" :table-data="tableData" :columns="columns" <CustomVxeTable ref="leftTableRef" class="mytable-style" :table-data="tableData" :columns="columns"
@current-change="batchClick" :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }"> :row-config="{ isHover: true, keyField: 'batchno' }" @current-change="batchClick"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }">
<template #conc="{ row }"> <template #conc="{ row }">
{{concList.find(item => item.value == row.conc)?.label || row.conc}} {{concList.find(item => item.value == row.conc)?.label || row.conc}}
</template> </template>
@ -39,6 +40,7 @@
<div style="height:59%" class="mb8"> <div style="height:59%" class="mb8">
<CustomVxeTable ref="topTableRef" class="mytable-style" :table-data="topTableData" :columns="topColumns" <CustomVxeTable ref="topTableRef" class="mytable-style" :table-data="topTableData" :columns="topColumns"
:cell-render-delay="10" :loading="loading" @current-change="rowClick" :cell-render-delay="10" :loading="loading" @current-change="rowClick"
:row-config="{ isHover: true, keyField: 'xmdh' }"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }"> :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }">
<template #xmdh="{ row }"> <template #xmdh="{ row }">
{{ row.xmdh }} {{ row.xmmc }} {{ row.xmdh }} {{ row.xmmc }}

View File

@ -40,6 +40,9 @@
<div class="table-box"> <div class="table-box">
<CustomVxeTable class="mytable-style" ref="tableRef" :table-data="tableData" :columns="columns" <CustomVxeTable class="mytable-style" ref="tableRef" :table-data="tableData" :columns="columns"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :cell-style="cellStyleHd"> :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :cell-style="cellStyleHd">
<template #zkrq="{ row, $index }">
{{ $index + 1 }}
</template>
<template #cs1="{ row }"> <template #cs1="{ row }">
<el-input v-model="row.cs1" class="full-width-input" /> <el-input v-model="row.cs1" class="full-width-input" />
</template> </template>
@ -67,7 +70,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getqcvalmonth, queryXmItem, saveQcvalMonth } from '@/api/liswork/qualityControl/index' import { getqcvalmonth, queryXmItem, saveQcvalItem } from '@/api/liswork/qualityControl/index'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { ResultItem, OriginalData, OriginalItem } from '@/types/index' import { ResultItem, OriginalData, OriginalItem } from '@/types/index'
import { queryValue } from '@/api/liswork/xtwh/ComOpt' import { queryValue } from '@/api/liswork/xtwh/ComOpt'
@ -87,7 +90,7 @@ const tabList = [
const tableData = ref<ResultItem[]>([]) const tableData = ref<ResultItem[]>([])
const columns = ref([ const columns = ref([
{ field: 'daynum', title: '日期', resizable: true, width: 50, align: 'center' }, { field: 'zkrq', title: '日期', resizable: true, width: 50, slotName: 'zkrq', align: 'center' },
{ field: 'cs1', title: '次数1', resizable: true, slotName: 'cs1' }, { field: 'cs1', title: '次数1', resizable: true, slotName: 'cs1' },
{ field: 'cs2', title: '次数2', resizable: true, slotName: 'cs2' }, { field: 'cs2', title: '次数2', resizable: true, slotName: 'cs2' },
{ field: 'cs3', title: '次数3', resizable: true, slotName: 'cs3' }, { field: 'cs3', title: '次数3', resizable: true, slotName: 'cs3' },
@ -188,7 +191,6 @@ const mergeDataByXmdh = (rawData: OriginalData): ResultItem[] => {
xmmc: baseItem.xmmc || '', xmmc: baseItem.xmmc || '',
sd: baseItem.sd || '', sd: baseItem.sd || '',
zkbz: baseItem.zkbz || '', zkbz: baseItem.zkbz || '',
daynum: baseItem.daynum,
cs1: '', cs1: '',
cs2: '', cs2: '',
cs3: '', cs3: '',
@ -212,7 +214,7 @@ const mergeDataByXmdh = (rawData: OriginalData): ResultItem[] => {
return result; return result;
} }
const handleSave = () => { const handleSave = () => {
saveQcvalMonth(tableData.value).then((res: any) => { saveQcvalItem(tableData.value).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
ElMessage.success('保存成功') ElMessage.success('保存成功')
getXmInfo() getXmInfo()

View File

@ -32,8 +32,8 @@
<div class="table-box"> <div class="table-box">
<CustomVxeTable class="mytable-style" ref="tableRef" :table-data="tableData" :columns="columns" <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"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :cell-style="cellStyleHd"> :highlightCurrentRow="false">
<template #xmdh="{ row }"> <template #xmdh="{ row }">
{{ row.xmdh }} {{ row.xmmc }} {{ row.xmdh }} {{ row.xmmc }}
</template> </template>
@ -64,7 +64,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getqcval, saveqcvalItem } from '@/api/liswork/qualityControl/index' import { getqcval, saveqcvalmonth } from '@/api/liswork/qualityControl/index'
import { queryValue } from '@/api/liswork/xtwh/ComOpt' import { queryValue } from '@/api/liswork/xtwh/ComOpt'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { color } from 'echarts'; import { color } from 'echarts';
@ -188,7 +188,7 @@ const mergeDataByXmdh = (rawData: OriginalData): ResultItem[] => {
} }
const handleSave = () => { const handleSave = () => {
saveqcvalItem(tableData.value).then((res: any) => { saveqcvalmonth(tableData.value).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
getXmList() getXmList()
ElMessage.success('保存成功') ElMessage.success('保存成功')

View File

@ -649,23 +649,7 @@ const getSysList = () => {
getSysList() getSysList()
const userList = ref([]); const userList = ref([]);
// 定义参数类型(类型安全)
interface RouteStateParams {
id: number;
name: string;
}
onMounted(async () => { onMounted(async () => {
const state = history.state as Partial<RouteStateParams>;
console.log("🚀 ~ state:", state)
// 只读取一次参数
if (state && state.id) {
// 读取后清空 state 刷新/回退不重复读取
history.replaceState({}, document.title);
}
const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 } const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 }
listUser(data).then((res: any) => { listUser(data).then((res: any) => {
userList.value = res.rows; userList.value = res.rows;

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="table-container"> <div class="table-container">
<ContextMenu :items="contextMenuItems" @select="handleMenuSelect" menu-width="200"> <ContextMenu :items="contextMenuItems" @select="handleMenuSelect" menu-width="200">
<CommonTable :table-data="labPatList" :loading="loading" :columns="tableColumns" @current-change="handleRowClick" <CommonTable :table-data="labPatList" :loading="loading" :columns="tableColumns"
size="small" :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :row-style="rowStyle" :row-config="{ isHover: true, keyField: 'ybh' }" @current-change="handleRowClick" size="small"
:cell-style="cellStyle" class="mytable-style" ref="tableRef" :enable-column-drag="true" :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :row-style="rowStyle" :cell-style="cellStyle"
@column-drag-end="handleColumnDragEnd"> class="mytable-style" ref="tableRef" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd">
<!-- 完成状态列 --> <!-- 完成状态列 -->
<template #finish="{ row }"> <template #finish="{ row }">
<svg-icon v-if="row.finish == 1" icon-class="lvgou" /> <svg-icon v-if="row.finish == 1" icon-class="lvgou" />