This commit is contained in:
wyuu 2025-12-25 18:53:23 +08:00
parent d2e810ad98
commit 574fb9bc6e
13 changed files with 192 additions and 1759 deletions

View File

@ -107,3 +107,67 @@ export function querySjcs(data?: Object) {
params: data
});
}
// 查询检验项目排序
export function getitemsort(data?: Object) {
return request({
url: '/xminfo/getitemsort',
method: 'get',
params: data
});
}
// 保存检验项目排序
export function saveitemsort(data?: Object) {
return request({
url: '/xminfo/saveitemsort',
method: 'post',
data
});
}
// 查询检验项目通道号
export function getitemtdh(data?: Object) {
return request({
url: '/xminfo/getitemtdh',
method: 'get',
params: data
});
}
// 保存检验项目通道号
export function saveitemtdh(data?: Object) {
return request({
url: '/xminfo/saveitemtdh',
method: 'post',
data
});
}
// 删除检验项目通道号
export function delitemtdh(data?: Object) {
return request({
url: '/xminfo/delitemtdh',
method: 'get',
params: data
});
}
// 获取仪器参数
export function querydouble(data?: Object) {
return request({
url: '/xminfo/querydouble',
method: 'get',
params: data
});
}
// 保存仪器参数
export function savedouble(data?: Object) {
return request({
url: '/xminfo/savedouble',
method: 'post',
data
});
}
// 获取参数默认模板
export function querymbmc(data?: Object) {
return request({
url: '/xminfo/querymbmc',
method: 'get',
params: data
});
}

View File

@ -1,108 +0,0 @@
<template>
<!-- 通道号配置 -->
<div class="table-container">
<el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5">
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" @click="addItem">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" @click="delItem">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" @click="allClear">清除所有项目接口号</el-button>
</el-col>
</el-row>
<el-row :gutter="10" class="table-row">
<el-col :span="12" class="table-box">
<el-table :data="tableData" height="100%" border highlight-current-row>
<el-table-column label="通道号" align="center">
<template #default="scope">
<el-input v-model="scope.row.channel" placeholder="请输入通道号" class="full-width-input" />
</template>
</el-table-column>
<el-table-column label="项目" align="center">
<template #default="scope">
<SelectTable v-model:data="scope.row.xmid" :tableData="xmList" class="full-width-input" />
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="6">
<div class="tips">
说明:
“通道号”又称“接口代号”,是指仪器向电脑传送结果时项目的
标识符
接口代号对于一个仪器不可重复。
</div>
</el-col>
</el-row>
</div>
</template>
<script setup lang="ts">
import { queryXmInfoNewService } from '@/api/liswork/labItem/labItemApi';
const yq = defineModel<string>();
const tableData = ref<Array<{ channel: string }>>([]);
const handleSave = () => {
};
const addItem = () => {
tableData.value.push({ channel: '' })
};
const delItem = () => {
}
const allClear = () => {
}
const xmList = ref<Array<{ xmmc: string, xmid: string }>>([]);
const getXmList = () => {
queryXmInfoNewService({ yq: yq.value }).then((res: any) => {
xmList.value = res.rows.map((item: any) => {
return {
label: item.xmmc,
value: item.xmid.toString(),
}
})
})
};
watch(() => yq.value, (val) => {
if (val) {
getXmList();
}
}, { immediate: true });
</script>
<style scoped lang="scss">
.table-container {
height: calc(100% - 58px);
}
.table-toolbar {
margin-bottom: 8px;
height: 36px;
line-height: 36px;
}
.tips {
font-family: SourceHanSansCN, SourceHanSansCN;
font-size: 16px;
color: #409eff;
font-weight: 600;
}
.table-row {
height: calc(100% - 45px);
.table-box {
height: 100%;
}
}
</style>

View File

@ -1,330 +0,0 @@
<!-- 系统全局选项 -->
<template>
<div class="sys_box">
<el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5">
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
</el-col>
</el-row>
<!-- 三列表格容器 -->
<div class="triple-table-wrapper">
<!-- 第一列表格 -->
<div class="table-panel table-1">
<el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" class="config-table"
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" />
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
<template #default="scope">
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
</template>
</el-table-column>
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
min-width="100" />
</el-table>
</div>
<!-- 第二列表格 -->
<div class="table-panel table-2">
<el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" class="config-table"
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" />
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
<template #default="scope">
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
</template>
</el-table-column>
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
min-width="100" />
</el-table>
</div>
<!-- 第三列表格 -->
<div class="table-panel table-3">
<el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" class="config-table"
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" />
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
<template #default="scope">
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
</template>
</el-table-column>
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
min-width="100" />
</el-table>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ElMessage, ElTree, TreeNode, ElMessageBox, ElBadge } from 'element-plus'
import { paramList, paramTree, getdef, updateParam } from '@/api/liswork/xtwh/ComOpt'
import { getFirstLetter } from '@/utils/pinyin'
// @ts-ignore
import DynamicInput from "@/views/liswork/xtwh/localconfig/components/DynamicInput.vue"
const emits = defineEmits(['updateTree'])
const yq = defineModel<string>()
interface RegDictItem {
configId: string | number
configSort: number
configCode: string
configName: string
configDefvalue: string | number
configOptiontype: string
remark: string
}
// 列表相关
const optiontype = ref<string>("SYSTEM")
const menuname = ref<string>("系统全局")
const regdictList = ref<RegDictItem[]>([])
const originRegdictList = ref<RegDictItem[]>([])
const loading = ref<boolean>(false)
const total = ref<number>(0)
// 选择相关
const ids = ref<(string | number)[]>([])
const single = ref<boolean>(true)
const multiple = ref<boolean>(true)
// ========== 核心:拆分三列表格数据 ==========
const tableData1 = computed<RegDictItem[]>(() => {
const splitSize = Math.ceil(total.value / 3) // 每列基础行数
return regdictList.value.slice(0, splitSize)
})
const tableData2 = computed<RegDictItem[]>(() => {
const splitSize = Math.ceil(total.value / 3)
return regdictList.value.slice(splitSize, splitSize * 2)
})
const tableData3 = computed<RegDictItem[]>(() => {
const splitSize = Math.ceil(total.value / 3)
return regdictList.value.slice(splitSize * 2)
})
const getList = async (): Promise<void> => {
loading.value = true
try {
const response = await paramList({ yq: yq.value, optiontype: optiontype.value })
regdictList.value = JSON.parse(JSON.stringify(response.data))
originRegdictList.value = JSON.parse(JSON.stringify(response.data))
total.value = response.data.length
} catch (error) {
ElMessage.error(`获取列表异常:${(error as Error).message}`)
} finally {
loading.value = false
}
}
const handleSelectionChange = (val: RegDictItem[]): void => {
ids.value = val.map(item => item.configId)
single.value = val.length === 1
multiple.value = val.length > 1
}
const handleSave = async (): Promise<void> => {
try {
loading.value = true
// 合并三列表格数据提交
const allData = [...tableData1.value, ...tableData2.value, ...tableData3.value]
const res = await updateParam(allData)
if (res.code == 0) {
ElMessage.success(res.msg || "保存成功")
originRegdictList.value = JSON.parse(JSON.stringify(allData))
// 更新树结构状态
emits('updateTree')
}
} catch (error) {
ElMessage.error(`保存失败:${(error as Error).message}`)
} finally {
loading.value = false
}
}
const handleCancelEdit = (): void => {
ElMessageBox.confirm(
"是否确认取消所有修改,恢复原始数据?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(() => {
regdictList.value = JSON.parse(JSON.stringify(originRegdictList.value))
ElMessage.success("已恢复原始数据!")
})
}
const handleRestoreDefault = async (): Promise<void> => {
ElMessageBox.confirm(
"是否确认还原所有默认值?此操作会覆盖当前修改!",
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "error"
}
).then(async () => {
loading.value = true
try {
const res = await getdef({ optiontype: optiontype.value })
regdictList.value = JSON.parse(JSON.stringify(res.data))
originRegdictList.value = JSON.parse(JSON.stringify(res.data))
total.value = res.data.length
ElMessage.success("还原默认值成功!")
} catch (error) {
ElMessage.error(`还原失败:${(error as Error).message}`)
} finally {
loading.value = false
}
})
}
watch(yq, (newVal) => {
if (newVal !== undefined) {
getList()
}
}, {
immediate: true,
deep: true
})
</script>
<style scoped lang="scss">
.sys_box {
height: calc(100% - 58px);
}
.table-toolbar {
margin-bottom: 8px;
height: 36px;
line-height: 36px;
}
// 三列表格容器
.triple-table-wrapper {
flex: 1;
height: calc(100% - 45px); // 减去标题行+工具栏高度
display: flex;
gap: 0px; // 表格间间距
overflow: hidden;
// 单个表格面板
.table-panel {
flex: 1; // 三列均等分
height: 100%;
overflow: hidden;
background: #fff;
border: 1px solid #e6e6e6;
border-radius: 4px;
// 细微间距优化
&.table-1 {
margin-right: 0px;
}
&.table-2 {
margin: 0 0px;
}
&.table-3 {
margin-left: 0px;
}
}
}
// 核心:清除表格内上下间隙
:deep(.config-table) {
// 清除表格整体的边框间距
border-collapse: collapse !important;
border-spacing: 0 !important;
// 清除表格头部间距
.el-table__header {
padding: 0 !important;
th {
padding: 0 !important;
border-bottom: 1px solid #e6e6e6 !important;
line-height: 25px !important;
height: 25px !important;
}
}
// 清除表格内容区间距
.el-table__body {
padding: 0 !important;
// 清除行间距
.el-table__row {
height: 25px !important;
line-height: 25px !important;
margin: 0 !important;
padding: 0 !important;
}
// 清除单元格内边距和间距
.el-table__cell {
padding: 0 4px !important; // 仅保留左右内边距,上下清零
height: 25px !important;
line-height: 25px !important;
vertical-align: middle !important;
font-size: 12px;
border-bottom: 1px solid #e6e6e6 !important;
border-right: 1px solid #e6e6e6 !important;
}
// 最后一列清除右侧边框
.el-table__cell:last-child {
border-right: none !important;
}
}
// 清除表格底部间距
.el-table__footer {
padding: 0 !important;
}
// 编辑输入框适配紧凑布局
.edit-input {
width: 95%;
margin: 0 !important;
padding: 0 !important;
:deep(.el-input__inner) {
padding: 0 5px;
height: 25px !important; // 缩小输入框高度适配紧凑行高
line-height: 25px !important;
font-size: 12px;
border: 1px solid #dcdfe6;
margin: 0 !important;
&:focus {
border-color: #409eff;
outline: none;
}
}
}
}
</style>

View File

@ -1,330 +0,0 @@
<!-- 系统全局选项 -->
<template>
<div class="sys_box">
<el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5">
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
</el-col>
</el-row>
<!-- 三列表格容器 -->
<div class="triple-table-wrapper">
<!-- 第一列表格 -->
<div class="table-panel table-1">
<el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" class="config-table"
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" />
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
<template #default="scope">
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
</template>
</el-table-column>
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
min-width="100" />
</el-table>
</div>
<!-- 第二列表格 -->
<div class="table-panel table-2">
<el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" class="config-table"
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" />
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
<template #default="scope">
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
</template>
</el-table-column>
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
min-width="100" />
</el-table>
</div>
<!-- 第三列表格 -->
<div class="table-panel table-3">
<el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" class="config-table"
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" />
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
<template #default="scope">
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
</template>
</el-table-column>
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
min-width="100" />
</el-table>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ElMessage, ElTree, TreeNode, ElMessageBox, ElBadge } from 'element-plus'
import { paramList, paramTree, getdef, updateParam } from '@/api/liswork/xtwh/ComOpt'
import { getFirstLetter } from '@/utils/pinyin'
// @ts-ignore
import DynamicInput from "@/views/liswork/xtwh/localconfig/components/DynamicInput.vue"
const emits = defineEmits(['updateTree'])
const yq = defineModel<string>()
interface RegDictItem {
configId: string | number
configSort: number
configCode: string
configName: string
configDefvalue: string | number
configOptiontype: string
remark: string
}
// 列表相关
const optiontype = ref<string>("INPUT")
const menuname = ref<string>("界面设定")
const regdictList = ref<RegDictItem[]>([])
const originRegdictList = ref<RegDictItem[]>([])
const loading = ref<boolean>(false)
const total = ref<number>(0)
// 选择相关
const ids = ref<(string | number)[]>([])
const single = ref<boolean>(true)
const multiple = ref<boolean>(true)
// ========== 核心:拆分三列表格数据 ==========
const tableData1 = computed<RegDictItem[]>(() => {
const splitSize = Math.ceil(total.value / 3) // 每列基础行数
return regdictList.value.slice(0, splitSize)
})
const tableData2 = computed<RegDictItem[]>(() => {
const splitSize = Math.ceil(total.value / 3)
return regdictList.value.slice(splitSize, splitSize * 2)
})
const tableData3 = computed<RegDictItem[]>(() => {
const splitSize = Math.ceil(total.value / 3)
return regdictList.value.slice(splitSize * 2)
})
const getList = async (): Promise<void> => {
loading.value = true
try {
const response = await paramList({ yq: yq.value, optiontype: optiontype.value })
regdictList.value = JSON.parse(JSON.stringify(response.data))
originRegdictList.value = JSON.parse(JSON.stringify(response.data))
total.value = response.data.length
} catch (error) {
ElMessage.error(`获取列表异常:${(error as Error).message}`)
} finally {
loading.value = false
}
}
const handleSelectionChange = (val: RegDictItem[]): void => {
ids.value = val.map(item => item.configId)
single.value = val.length === 1
multiple.value = val.length > 1
}
const handleSave = async (): Promise<void> => {
try {
loading.value = true
// 合并三列表格数据提交
const allData = [...tableData1.value, ...tableData2.value, ...tableData3.value]
const res = await updateParam(allData)
if (res.code == 0) {
ElMessage.success(res.msg || "保存成功")
originRegdictList.value = JSON.parse(JSON.stringify(allData))
// 更新树结构状态
emits('updateTree')
}
} catch (error) {
ElMessage.error(`保存失败:${(error as Error).message}`)
} finally {
loading.value = false
}
}
const handleCancelEdit = (): void => {
ElMessageBox.confirm(
"是否确认取消所有修改,恢复原始数据?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(() => {
regdictList.value = JSON.parse(JSON.stringify(originRegdictList.value))
ElMessage.success("已恢复原始数据!")
})
}
const handleRestoreDefault = async (): Promise<void> => {
ElMessageBox.confirm(
"是否确认还原所有默认值?此操作会覆盖当前修改!",
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "error"
}
).then(async () => {
loading.value = true
try {
const res = await getdef({ optiontype: optiontype.value })
regdictList.value = JSON.parse(JSON.stringify(res.data))
originRegdictList.value = JSON.parse(JSON.stringify(res.data))
total.value = res.data.length
ElMessage.success("还原默认值成功!")
} catch (error) {
ElMessage.error(`还原失败:${(error as Error).message}`)
} finally {
loading.value = false
}
})
}
watch(yq, (newVal) => {
if (newVal !== undefined) {
getList()
}
}, {
immediate: true,
deep: true
})
</script>
<style scoped lang="scss">
.sys_box {
height: calc(100% - 58px);
}
.table-toolbar {
margin-bottom: 8px;
height: 36px;
line-height: 36px;
}
// 三列表格容器
.triple-table-wrapper {
flex: 1;
height: calc(100% - 45px); // 减去标题行+工具栏高度
display: flex;
gap: 0px; // 表格间间距
overflow: hidden;
// 单个表格面板
.table-panel {
flex: 1; // 三列均等分
height: 100%;
overflow: hidden;
background: #fff;
border: 1px solid #e6e6e6;
border-radius: 4px;
// 细微间距优化
&.table-1 {
margin-right: 0px;
}
&.table-2 {
margin: 0 0px;
}
&.table-3 {
margin-left: 0px;
}
}
}
// 核心:清除表格内上下间隙
:deep(.config-table) {
// 清除表格整体的边框间距
border-collapse: collapse !important;
border-spacing: 0 !important;
// 清除表格头部间距
.el-table__header {
padding: 0 !important;
th {
padding: 0 !important;
border-bottom: 1px solid #e6e6e6 !important;
line-height: 25px !important;
height: 25px !important;
}
}
// 清除表格内容区间距
.el-table__body {
padding: 0 !important;
// 清除行间距
.el-table__row {
height: 25px !important;
line-height: 25px !important;
margin: 0 !important;
padding: 0 !important;
}
// 清除单元格内边距和间距
.el-table__cell {
padding: 0 4px !important; // 仅保留左右内边距,上下清零
height: 25px !important;
line-height: 25px !important;
vertical-align: middle !important;
font-size: 12px;
border-bottom: 1px solid #e6e6e6 !important;
border-right: 1px solid #e6e6e6 !important;
}
// 最后一列清除右侧边框
.el-table__cell:last-child {
border-right: none !important;
}
}
// 清除表格底部间距
.el-table__footer {
padding: 0 !important;
}
// 编辑输入框适配紧凑布局
.edit-input {
width: 95%;
margin: 0 !important;
padding: 0 !important;
:deep(.el-input__inner) {
padding: 0 5px;
height: 25px !important; // 缩小输入框高度适配紧凑行高
line-height: 25px !important;
font-size: 12px;
border: 1px solid #dcdfe6;
margin: 0 !important;
&:focus {
border-color: #409eff;
outline: none;
}
}
}
}
</style>

View File

@ -1,389 +0,0 @@
<template>
<!-- 参数列表 -->
<div>
<el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5">
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
</el-col>
</el-row>
<el-form ref="form" :model="formData" :rules="rules" label-width="120px" class="form-inline" inline>
<div class="title">说明:公式中阴阳对照请用NC,PC表示</div>
<el-row>
<el-col :span="8">
<el-form-item label="测试波长" prop="csbc">
<el-select v-model="formData.csbc" style="width: 12rem;">
<el-option v-for="item in dzList" :key="item.lgph" :value="item.lgph" :label="item.bc" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" style="display: flex;">
<el-form-item label="参考波长" prop="ckbc">
<el-select v-model="formData.ckbc" style="width: 12rem;">
<el-option v-for="item in dzList" :key="item.lgph" :value="item.lgph" :label="item.bc" />
</el-select>
</el-form-item>
<el-button type="primary" @click="openDz">滤光片波长对照表</el-button>
</el-col>
<el-col :span="8">
<el-form-item label="阳性判断公式" prop="yxgs">
<el-input v-model="formData.yxgs" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="上灰区" prop="shq">
<el-input v-model="formData.shq">
<template #append>% </template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="下灰区" prop="xhq">
<el-input v-model="formData.xhq">
<template #append>% </template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="阴性对照下限" prop="negxx">
<el-input v-model="formData.negxx" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="阳性对照下限" prop="posxx">
<el-input v-model="formData.posxx" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="阴性对照上限" prop="negsx">
<el-input v-model="formData.negsx" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="阳性对照上限" prop="possx">
<el-input v-model="formData.possx" />
</el-form-item>
</el-col>
<el-col :span="6">
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="8">
<el-form-item label="项目性质" prop="xmxz">
<el-radio-group v-model="formData.xmxz">
<el-radio value="1">定性</el-radio>
<el-radio value="2">定量</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="移动模式" prop="ydfs">
<el-radio-group v-model="formData.ydfs">
<el-radio value="1">连续</el-radio>
<el-radio value="2">步进</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="测试模式" prop="csms">
<el-radio-group v-model="formData.csms">
<el-radio value="1">终点法</el-radio>
<el-radio value="2">两点法</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="振板频率" prop="zbpl">
<el-radio-group v-model="formData.zbpl">
<el-radio value="1">高</el-radio>
<el-radio value="2">中</el-radio>
<el-radio value="3">低</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="空白形式" prop="kbms">
<el-radio-group v-model="formData.kbms">
<el-radio value="1">空气</el-radio>
<el-radio value="2">试剂</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="振板时间" prop="zbsj">
<el-input v-model="formData.zbsj">
<template #append>秒</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="8">
<el-form-item label="默认模板" prop="mrmb">
<el-select v-model="formData.mrmb" style="width: 12rem;">
<!-- <el-option v-for="item in sjtableData" :key="item.sjph" :value="item.sjph" :label="item.sjph" /> -->
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" style="display: flex;">
<el-form-item label="默认试剂" prop="mrsjph">
<el-select v-model="formData.mrsjph" style="width: 12rem;">
<el-option v-for="item in sjtableData" :key="item.sjph" :value="item.sjph" :label="item.sjph" />
</el-select>
</el-form-item>
<el-button type="primary" @click="sjHandle">试剂维护</el-button>
</el-col>
</el-row>
</el-form>
<!-- 波长对照表 -->
<el-dialog v-model="dialogVisible" title="滤光波长对照表" draggable :close-on-click-modal="false" width="500px">
<div class="mb5">
<el-button type="primary" @click="savaItem">保存</el-button>
<el-button type="primary" @click="addItem">新增</el-button>
<el-button type="danger" @click="delItem">删除</el-button>
</div>
<el-table :data="dzList" style="width: 100%" height="450" border highlight-current-row
@row-click="handleRowClick">
<el-table-column type="index" width="50" label="No" align="center" />
<el-table-column label="滤光片号" prop="lgph">
<template #default="scope">
<el-input v-model="scope.row.lgph" class="full-width-input" />
</template>
</el-table-column>
<el-table-column label="波长" prop="bc">
<template #default="scope">
<el-input v-model="scope.row.bc" class="full-width-input" />
</template>
</el-table-column>
</el-table>
</el-dialog>
<!-- 试剂维护 -->
<el-dialog v-model="sjShow" title="试剂维护" draggable :close-on-click-modal="false" width="700px">
<div class="mb5">
<el-button type="primary" @click="sjsavaItem">保存</el-button>
<el-button type="primary" @click="sjaddItem">新增</el-button>
<el-button type="danger" @click="sjdelItem">删除</el-button>
</div>
<el-table :data="sjtableData" height="400px" border highlight-current-row @row-click="sjRowClick">
<el-table-column label="试剂批号" prop="sjph" width="120">
<template #default="scope">
<el-input v-model="scope.row.sjph" class="full-width-input" />
</template>
</el-table-column>
<el-table-column label="厂商" prop="sjcs">
<template #default="scope">
<el-select v-model="scope.row.sjcs" class="full-width-input" filterable allow-create>
<el-option v-for="item in cjList" :label="item.na" :value="item.no" />
</el-select>
</template>
</el-table-column>
<el-table-column label="有效期" prop="yxq">
<template #default="scope">
<el-date-picker v-model="scope.row.yxq" type="datetime" placeholder="0000:00:00 00:00:00"
format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="方法" prop="csff">
<template #default="scope">
<SelectTable v-model:data="scope.row.csff" :tableData="dictData.MD" class="full-width-input" />
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { queryFilter, addXmFilter, delXmFilter, addXmLot, delXmLot, queryXmLot, querySjcs } from '@/api/liswork/xtwh/ComOpt'
import { ElMessage } from 'element-plus';
import { formatDict, dictData } from '@/hooks'
import { get } from 'lodash';
const yq = defineModel<string>()
const dialogVisible = ref(false)
const formData = ref({
csbc: '',
ckbc: '',
yxgs: '',
shq: '',
xhq: '',
negxx: '',
posxx: '',
negsx: '',
possx: '',
xmxz: '1',
ydfs: '1',
csms: '1',
zbpl: '1',
kbms: '1',
zbsj: '',
mrmb: '',
mrsjph: ''
});
const rules = ref({
csbc: [
{ required: true, message: '请选择测试波长', trigger: 'change' }
],
yxgs: [
{ required: true, message: '请输入阳性判断公式', trigger: 'blur' }
]
});
const form = ref();
const handleSave = () => {
form.value.validate((valid: boolean) => {
if (valid) {
console.log('submit!')
}
})
}
const handleCancelEdit = () => {
console.log('取消修改')
}
const handleRestoreDefault = () => {
console.log('还原默认')
}
const dzList = ref<Array<{ lgph: string, bc: string, yq?: string }>>([])
const getDzList = () => {
selectRow.value = null
queryFilter({ yq: yq.value }).then((res: any) => {
dzList.value = res.data
})
}
const selectRow = ref()
const handleRowClick = (row: any) => {
selectRow.value = row
}
const openDz = () => {
getDzList()
dialogVisible.value = true
}
const savaItem = () => {
const flag = dzList.value.every(item => item.bc && item.lgph)
if (!flag) return ElMessage.warning('请检查滤光片号和波长填写!')
addXmFilter(dzList.value).then((res: any) => {
if (res.code == 0) {
ElMessage.success('保存成功!')
getDzList()
}
})
}
const addItem = () => {
dzList.value.push({ lgph: '', bc: '', yq: yq.value })
}
const delItem = () => {
if (!selectRow.value) return ElMessage.warning('请选择要删除的行!')
if (selectRow.value.lgph) {
delXmFilter(selectRow.value)
}
dzList.value = dzList.value.filter(item => item.lgph != selectRow.value.lgph)
selectRow.value = null
}
interface sjList {
sjcs: string, sjph: string, yq: string, yxq: string, csff: string
}
const sjShow = ref(false)
const sjtableData = ref<sjList[]>([])
const sjHandle = () => {
getSjList()
getSjcjList()
sjShow.value = true
}
const sjRowClick = (row: any) => {
selectRow.value = row
}
const getSjList = () => {
selectRow.value = null
queryXmLot({ yq: yq.value }).then((res: any) => {
sjtableData.value = res.data
})
}
const sjsavaItem = () => {
sjtableData.value.forEach(item => {
item.yq = yq.value || ''
})
addXmLot(sjtableData.value).then((res: any) => {
if (res.code == 0) {
ElMessage.success('保存成功!')
getSjList()
getSjcjList()
}
})
}
const sjaddItem = () => {
sjtableData.value.push({
sjcs: '',
sjph: '',
yxq: '',
csff: '',
yq: yq.value || '',
})
}
const sjdelItem = () => {
if (!selectRow.value) return ElMessage.warning('请选择要删除的行!')
if (selectRow.value.sjph) {
delXmLot(selectRow.value)
}
sjtableData.value = sjtableData.value.filter(item => item.sjph != selectRow.value.sjph)
selectRow.value = null
}
const cjList = ref<Array<{ no: string, na: string }>>([])
const getSjcjList = () => {
querySjcs({ yq: yq.value }).then((res: any) => {
cjList.value = res.data
})
}
watch(yq, (newVal) => {
getDzList()
getSjList()
}, {
immediate: true,
deep: true
})
</script>
<style scoped lang="scss">
.table-toolbar {
margin-bottom: 8px;
height: 36px;
line-height: 36px;
}
.title {
font-family: SourceHanSansCN, SourceHanSansCN;
font-size: 16px;
color: #409eff;
font-weight: 600;
margin-bottom: 8px;
}
</style>

View File

@ -1,12 +0,0 @@
<!-- 报告界面参数 -->
<template>
<div>
报告界面参数
</div>
</template>
<script setup lang="ts">
</script>
<style scoped></style>

View File

@ -1,164 +0,0 @@
<template>
<!-- 整体排序 -->
<div class="sort_box">
<el-row :gutter="10" class="table-row">
<el-col :span="20" class="table-box">
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :config="tableConfig"
@row-click="handleRowClick">
<template #sort="{ row }">
<el-input v-model="row.sort" class="full-width-input" />
</template>
</CustomTable>
</el-col>
<el-col :span="4">
<el-row :gutter="10" class="table-toolbar">
<!-- <el-col :span="1.5">
<el-radio-group v-model="radio" @change="radioChange">
<el-radio value="1">上下移动调整</el-radio>
<el-radio value="2">手工输入工号</el-radio>
</el-radio-group>
</el-col> -->
<el-col :span="1.5">
<el-button type="primary" @click="refresh">刷新</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" @click="cpHandle">存盘</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" :disabled="radio == '2'" @click="firstHandle">首位</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button type="primary" icon="top" :disabled="radio == '2'" @click="prevHandle">上移</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" icon="bottom" :disabled="radio == '2'" @click="nextHandle">下移</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button type="primary" :disabled="radio == '2'" @click="lastHadnle">末位</el-button>
</el-col>
</el-row>
</el-col>
</el-row>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { formatDict, dictData } from '@/hooks';
const props = defineProps({
dataList: {
type: Array,
default: []
}
});
interface DataItem {
xmid: string | number;
xmmc: string | number;
sort: string | number;
}
const currentIndex = ref(0);
const radio = ref('1');
const tableRef = ref();
const dataList = ref<DataItem[]>([]);
const columns = ref([
{ prop: 'xmid', label: '项目ID', visible: true, align: 'center', },
{ prop: 'xmmc', label: '项目名称', visible: true, align: 'center', },
{ prop: 'sort', label: '整体排序', visible: true, align: 'center', slot: "sort" },
]);
const tableConfig = ref({
border: true, // 边框
height: '100%', // 高度
highlightCurrentRow: true, // 高亮当前行
key: 'xmid'
})
//退拽属性
const handleColumnDragEnd = (data: any) => {
// 更新列配置
dataList.value = data.list;
}
const handleRowClick = (row: DataItem) => {
currentIndex.value = dataList.value.indexOf(row);
}
const getList = () => {
}
const refresh = () => {
getList();
}
const cpHandle = () => {
}
const firstHandle = () => {
currentIndex.value = 0;
tableRef.value.setCurrentRow(dataList.value[0]);
tableRef.value.setScrollTop(0)
}
const lastHadnle = () => {
currentIndex.value = dataList.value.length - 1;
tableRef.value.setCurrentRow(dataList.value[currentIndex.value]);
tableRef.value.setScrollTop(dataList.value.length)
}
onMounted(() => {
for (let index = 0; index < 20; index++) {
dataList.value.push(
{ xmid: 'ID' + index, xmmc: 'xmmc' + index, sort: '', }
)
}
})
</script>
<style scoped lang="scss">
.sort_box {
height: calc(100% - 58px);
padding-top: 8px;
}
.table-toolbar {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
.el-col {
width: 50%;
}
.el-button {
width: 80%;
margin-top: 20px;
}
}
.table-row {
height: 100%;
flex: 3;
.table-box {
height: 100%;
}
}
/* 可拖拽表格行样式提示 */
:deep(.drag-table .el-table__row) {
cursor: move;
/* 鼠标移入行显示拖拽光标 */
transition: background-color 0.2s;
}
</style>

View File

@ -1,352 +0,0 @@
<template>
<div class="app-container">
<el-row :gutter="20" class="main-row">
<!-- 左侧树区域 -->
<el-col :span="4" :xs="24" class="tree-col">
<el-input v-model="deptName" placeholder="请输入仪器名称" clearable prefix-icon="Search" class="tree-search-input" />
<el-radio-group v-model="radiotype" @change="radioChange">
<el-radio value="1" size="large">仪器组</el-radio>
<el-radio value="2" size="large">所有仪器</el-radio>
</el-radio-group>
<div class="tree-container">
<el-tree :data="deptOptions" :props="treeProps" expand-on-click-node :filter-node-method="filterNode"
ref="deptTreeRef" node-key="id" highlight-current :expanded-keys="expandedKeys"
@node-click="handleNodeClick">
<!-- 自定义树节点模板:新增newflag徽章 -->
<template #default="{ node, data }">
<span class="tree-node-content">
{{ node.label }}
<!-- 新节点徽章:newflag=1时显示黄色"新"标 -->
<el-badge v-if="data.newflag === '1'" value="new" class="new-node-badge" />
</span>
</template>
</el-tree>
</div>
</el-col>
<!-- 右侧列表区域 -->
<el-col :span="20" :xs="24" class="table-col">
<el-row :gutter="10" class="yq-title-row">
<h1 class="yq-title">仪器: {{ yqmc }}</h1>
</el-row>
<el-tabs v-model="activeName" type="card" class="tabs_box">
<el-tab-pane v-for="tab in tabList" :key="tab.key" :label="tab.label" :name="tab.key" />
</el-tabs>
<!-- 动态组件渲染 -->
<component :is="currentComponent" :key="activeName" v-model="queryParams.yq" @updateTree="getDeptTree" />
</el-col>
</el-row>
</div>
</template>
<script setup name="ComOpt" lang="ts">
import { ref, watch, nextTick, computed } from 'vue'
import { ElMessage, ElTree, TreeNode, ElMessageBox, ElBadge } from 'element-plus'
import { paramList, paramTree, getdef, updateParam } from '@/api/liswork/xtwh/ComOpt'
import { getFirstLetter } from '@/utils/pinyin'
import { formatDict, getDictData, dictData } from '@/hooks';
import SysGlobal from './components/sysGlobal/index.vue'
import SysInput from './components/sysInput/index.vue'
import SysReport from './components/sysReport/index.vue'
import SysParameter from './components/sysParameter/index.vue'
import SysChannel from './components/sysChannel/index.vue'
import SysSort from './components/sysSort/index.vue'
// ========== TypeScript 类型定义 ==========
interface InstrTreeNode {
id: string
label: string
lx: string
newflag: string // 新增newflag字段
children?: InstrTreeNode[]
}
interface ParamTreeResponse {
code: string
msg: string
data: InstrTreeNode[]
url: null | string
method: null | string
params: null | any
problemId: null | string
}
interface QueryParams {
yq?: string | undefined
xxdh?: string | undefined
xxqz?: string | undefined
groupId?: string | undefined
}
const radiotype = ref<string>("1")
// ========== 响应式变量 ==========
// 树相关
const deptTreeRef = ref<InstanceType<typeof ElTree>>()
const deptOptions = ref<InstrTreeNode[]>([])
const deptName = ref<string>("")
const yqmc = ref<string>("")
const expandedKeys = ref<string[]>([])
const isFiltering = ref<boolean>(false)
const treeProps = ref({
label: 'label',
children: 'children',
isLeaf: (data: Record<string, any>) => !data.children || data.children.length === 0
})
// 查询参数
const queryParams = ref<QueryParams>({
yq: undefined,
xxdh: undefined,
xxqz: undefined,
groupId: undefined
})
const tabList = [
{ key: 'SysGlobal', label: '全局设定', component: SysGlobal },
{ key: 'SysInput', label: '界面设定', component: SysInput },
{ key: 'SysParameter', label: '参数', component: SysParameter },
{ key: 'SysChannel', label: '通道号', component: SysChannel },
{ key: 'SysSort', label: '项目排序', component: SysSort },
{ key: 'SysReport', label: '报告单设置', component: SysReport },
]
const activeName = ref('SysSort')
// 计算当前要渲染的组件
const currentComponent = computed(() => {
return tabList.find(tab => tab.key === activeName.value)?.component || 'SysGlobal'
})
const treeData = ref<InstrTreeNode[]>([])
const radioChange = (val: string) => {
if (val == "1") {
deptOptions.value = treeData.value
} else {
const result = [];
// 遍历外层数组的每个分组
for (let i = 0; i < treeData.value.length; i++) {
const group = treeData.value[i];
if (group.children && Array.isArray(group.children)) {
for (let j = 0; j < group.children.length; j++) {
result.push(group.children[j]);
}
}
}
deptOptions.value = result
}
}
// ========== 树操作核心方法 ==========
const forceExpandSingleNode = (nodeId: string): void => {
expandedKeys.value = []
nextTick(() => {
expandedKeys.value = [nodeId]
// deptTreeRef.value?.expand(nodeId, false)
})
}
const handleNodeClick = (data: InstrTreeNode): void => {
if (isFiltering.value) {
queryParams.value.groupId = data.id === "-1" ? undefined : data.id
return
}
if (data.children && data.children.length > 0) {
const isExpanded = expandedKeys.value.includes(data.id)
expandedKeys.value = isExpanded ? [] : [data.id]
!isExpanded && forceExpandSingleNode(data.id)
} else {
queryParams.value.yq = data.id
yqmc.value = data.label
}
}
// ========== 检索过滤逻辑 ==========
const filterNode = (value: string, data: any, _node: TreeNode): boolean => {
if (!value) return true
const keyword = value.trim().toUpperCase()
const nodeLabel = data.label?.toLowerCase() || ''
const nodePinyinFirst = data.label ? getFirstLetter(data.label).toUpperCase() : ''
const currentMatch = nodeLabel.includes(keyword.toLowerCase()) || nodePinyinFirst.includes(keyword)
const childrenMatch = (data.children || []).some((child: any) => filterNode(value, child, _node))
return currentMatch || childrenMatch
}
const debounceFilter = (() => {
let timer: number | undefined
return (val: string): void => {
clearTimeout(timer)
timer = setTimeout(() => {
isFiltering.value = true
deptTreeRef.value?.filter(val)
if (val) {
expandedKeys.value = []
const expandMatched = (nodes: InstrTreeNode[]) => {
nodes.forEach(node => {
if (filterNode(val, node, {} as TreeNode) && node.children?.length) {
expandedKeys.value.push(node.id)
}
node.children && expandMatched(node.children)
})
}
expandMatched(deptOptions.value)
} else {
expandedKeys.value = []
}
isFiltering.value = false
}, 300)
}
})()
watch(deptName, debounceFilter, { immediate: false })
// ========== 业务逻辑 ==========
const getDeptTree = async (): Promise<void> => {
try {
const response = await paramTree() as ParamTreeResponse
if (response.code === "0" && response.data) {
treeData.value = response.data
radioChange('1')
if (!expandedKeys.value.length) {
// 默认展开第一个一级节点的子级
nextTick(() => {
if (deptOptions.value.length > 0) {
const firstLevelNode = deptOptions.value[0]
if (firstLevelNode && firstLevelNode.children && firstLevelNode.children.length > 0) {
expandedKeys.value = [firstLevelNode.id]
const firstChildNode = firstLevelNode.children[0]
queryParams.value.yq = firstChildNode.id
yqmc.value = firstChildNode.label
deptTreeRef.value?.setCurrentKey(firstChildNode.id)
}
}
})
}
} else {
ElMessage.warning(response.msg || "获取树数据失败")
}
} catch (error) {
ElMessage.error(`获取树数据异常:${(error as Error).message}`)
}
}
onMounted(() => {
getDictData('XMGL', 'MD')
})
// ========== 初始化 ==========
getDeptTree()
</script>
<style lang="scss" scoped>
.app-container {
width: 100%;
height: 90vh;
display: flex;
flex-direction: column;
overflow: hidden;
padding: 8px;
box-sizing: border-box;
}
.main-row {
display: flex;
flex: 1;
height: 100%;
overflow: hidden;
}
.tree-col {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
.tree-container {
flex: 1;
height: 100%;
overflow: auto;
background: #fff;
border: 1px solid #e6e6e6;
border-radius: 4px;
padding: 8px;
// 核心:树选中节点样式
:deep(.el-tree) {
--el-tree-node-transition-duration: 0.2s;
.el-tree-node__children {
transition: all var(--el-tree-node-transition-duration) ease-in-out;
}
.el-tree-node__expand-icon.is-leaf {
display: none;
}
// 选中节点的背景色(蓝色)+ 文字白色
.el-tree-node.is-current>.el-tree-node__content {
background-color: #409eff !important;
color: #ffffff !important;
}
// 选中节点hover样式(加深蓝色)
.el-tree-node.is-current>.el-tree-node__content:hover {
background-color: #1e88e5 !important;
}
// 树节点内容容器样式
.tree-node-content {
display: inline-flex;
align-items: center;
gap: 4px; // 徽章和文字间距
height: 100%;
}
// 新节点徽章样式
.new-node-badge {
--el-badge-font-size: 10px !important;
--el-badge-height: 16px !important;
--el-badge-padding: 0 4px !important;
--el-badge-warning-color: #FFEC24 !important; // 黄色徽章
--el-badge-warning-bg-color: #fff7e6 !important; // 浅黄色背景
--el-badge-border-radius: 2px !important; // 圆角优化
// 徽章文字样式
.el-badge__content {
font-size: 10px !important;
line-height: 16px !important;
padding: 0 4px !important;
height: 16px !important;
}
}
}
}
}
.table-col {
height: 100%;
// 仪器标题行样式
.yq-title-row {
margin-bottom: 8px;
.yq-title {
font-family: SourceHanSansCN, SourceHanSansCN;
font-size: 16px; // 缩小h1字体(默认24px→16px)
color: #409eff; // 蓝色(Element Plus主题色)
font-weight: 600;
margin: 0; // 清除默认margin
line-height: 1.2;
}
}
}
</style>

View File

@ -71,7 +71,7 @@
</el-row>
</el-form>
</div>
<div>
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
@size-change="sizeChange" @page-change="currentChange" @row-click="rowHandle">
<template #patAge="{ row }">
@ -84,7 +84,7 @@
{{ row.patSex == 1 ? '男' : '女' }}
</template>
</CustomTable>
</div>
<!-- 样本流程 -->
<div class="time-line-box">
<div v-for="(item, i) in timelineItems" :key="i" class="time-line-item">

View File

@ -60,7 +60,7 @@
<el-button type="primary" @click="qsHandle(110)">标本拒签</el-button>
<el-button type="primary" plain @click="bbThHandle">标本退回</el-button>
</div>
<div style="height: calc(100% - 180px)">
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
<template #patAge="{ row }">
@ -73,7 +73,7 @@
{{ row.patSex == 1 ? '男' : '女' }}
</template>
</CustomTable>
</div>
</div>
</template>
@ -113,7 +113,7 @@ const columns: any = ref([
])
const tableConfig = ref({
border: true, // 边框
height: '68vh', // 高度
height: '100%', // 高度
highlightCurrentRow: true, // 高亮当前行
// fit: true, // 列宽自适应
})

View File

@ -60,6 +60,7 @@
<el-button type="primary" @click="thHandle(90)">申请作废</el-button>
</div>
<div style="height: calc(100% - 180px)">
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
<template #patAge="{ row }">
@ -73,6 +74,7 @@
</template>
</CustomTable>
</div>
</div>
</template>
<script setup lang="ts">
@ -109,7 +111,7 @@ const columns: any = ref([
])
const tableConfig = ref({
border: true, // 边框
height: '68vh', // 高度
height: '100%', // 高度
highlightCurrentRow: true, // 高亮当前行
// fit: true, // 列宽自适应
})

View File

@ -4,15 +4,39 @@
<el-form :model="queryParams" ref="queryRef" label-width="5rem" style="width: 100%;" :size="aotuSize">
<el-row :gutter="10">
<el-col :span="5">
<el-form-item label="所属医院:" prop="DstHospName">
<el-form-item label="委托机构:" prop="SrcHospName">
<SelectTable v-model:data="queryParams.SrcHospName" :fields="ksdhFields" :tableData="hosList"
label="label" :size="aotuSize" value="value" objKey="value" :border="true" placeholder="请选择委托机构" />
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="检测医院:" prop="DstHospName">
<SelectTable v-model:data="queryParams.DstHospName" :fields="ksdhFields" :tableData="hosList"
label="label" :size="aotuSize" value="label" objKey="label" :border="true" placeholder="请选择" />
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="标本类型:" prop="SampleTypeName">
<el-select v-model="queryParams.SampleTypeName" placeholder="请选择" clearable>
<el-option v-for="item in regdictList" :label="item.dictName" :value="item.dictCode" />
<el-form-item label="条码号:" prop="Barcode">
<el-input v-model="queryParams.Barcode" placeholder="请输入条码号" clearable />
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="姓名:" prop="PatName">
<el-input v-model="queryParams.PatName" placeholder="请输入姓名" clearable />
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="申请项目:" prop="checkPUR">
<el-input v-model="queryParams.checkPUR" placeholder="请输入申请项目" clearable />
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="时间类型:" prop="DateType">
<el-select v-model="queryParams.DateType" placeholder="请选择">
<el-option label="登记时间" value="登记时间" />
<el-option label="采样时间" value="采样时间" />
<el-option label="送出时间" value="送出时间" />
<el-option label="签收时间" value="签收时间" />
</el-select>
</el-form-item>
</el-col>
@ -31,20 +55,31 @@
</div>
<div class="mb10">
<!-- <el-button type="primary" @click="thHandle(20)">重新采集</el-button>
<el-button type="primary" @click="thHandle(20)">重新采集</el-button>
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
</div>
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
@size-change="sizeChange" @page-change="currentChange">
<el-button type="primary" @click="thHandle(90)">申请作废</el-button>
</div>
<div style="height: calc(100% - 180px)">
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
<template #patAge="{ row }">
{{ row.patAge }}{{ row.ageUnit }}
</template>
<template #status="{ row }">
{{ formatDict(row.status, regdictList) }}
</template>
<template #patSex="{ row }">
{{ row.patSex == 1 ? '男' : '女' }}
</template>
</CustomTable>
</div>
</div>
</template>
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue'
import { sampleTypeCount } from '@/api/regional/index'
import { querySampleSignBack, sampleSign } from '@/api/regional/index'
import SelectTable from '@/components/SelectTable/index.vue';
import { classCom } from '@/utils/classCom';
// @ts-ignore
@ -53,28 +88,32 @@ import { listhospital } from "@/api/regional/dict/hospital.js";
import { listregdict } from "@/api/regional/dict/regdict.js";
import { ElMessage } from 'element-plus';
const aotuSize = classCom.useAutoSize();
import dayjs from 'dayjs';
const today = dayjs().format('YYYY-MM-DD');
const queryParams: any = ref({
pageSize: 50,
pageNum: 1,
times: [today, today]
})
const tableData: any = ref([])
const columns: any = ref([
{ prop: 'srchospname', label: '所属医院', align: 'center', visible: true, },
{ prop: 'sampletypecode', label: '标本代码', align: 'center', visible: true, },
{ prop: 'sampletypename', label: '标本类别', align: 'center', visible: true, },
{ prop: 'sl', label: '数量(份)', align: 'center', visible: true, },
{ type: 'selection', align: 'center', visible: true, width: 40 },
{ prop: 'barcode', label: '条码号', align: 'center', visible: true, },
{ prop: 'patName', label: '姓名', align: 'center', visible: true, width: 60 },
{ prop: 'patSex', label: '性别', align: 'center', visible: true, width: 60, slot: "patSex" },
{ prop: 'patAge', label: '年龄', align: 'center', visible: true, slot: "patAge", width: 60 },
{ prop: 'checkPUR', label: '申请项目', align: 'center', visible: true, width: 200 },
{ prop: 'srcHospName', label: '委托机构', align: 'center', visible: true, width: 200 },
{ prop: 'srcHospName', label: '检测机构', align: 'center', visible: true, width: 200 },
{ prop: 'Status', label: '标本状态', align: 'center', visible: true, slot: "status" },
{ prop: 'backReasons', label: '退回理由', align: 'center', visible: true, width: 150 },
{ prop: 'affirmTime', label: '采样时间', align: 'center', visible: true, width: 150 },
{ prop: 'backUserName', label: '操作人', align: 'center', visible: true, },
{ prop: 'backTime', label: '操作时间', align: 'center', visible: true, width: 150 },
])
const tableConfig = ref({
border: true, // 边框
height: '75vh', // 高度
height: '100%', // 高度
highlightCurrentRow: true, // 高亮当前行
summary: true,
summaryField: ['sl'],//计算列总和
sumText: '合计'
// fit: true, // 列宽自适应
})
const pagination = ref({
@ -91,7 +130,15 @@ const ksdhFields = ref([
const barcodes = ref([])
const tableRefs = ref(null)
const thHandle = (val: number) => {
if (!barcodes.value.length) return ElMessage.warning('请选择数据!')
sampleSign({ status: val, barcode: barcodes.value }).then((res: any) => {
if (res.code == 0) {
ElMessage.success('操作成功!')
handleQuery()
}
})
}
const handleSelectionChange = (val: any) => {
barcodes.value = val.map((item: any) => item.barcode)
}
@ -121,12 +168,11 @@ const resetHandle = () => {
queryParams.value = {
pageSize: 50,
pageNum: 1,
times: [today, today]
}
handleQuery()
}
const getList = () => {
sampleTypeCount(queryParams.value).then((res: any) => {
querySampleSignBack(queryParams.value).then((res: any) => {
tableData.value = res.rows
pagination.value.total = res.total
})
@ -134,7 +180,7 @@ const getList = () => {
const hosList = ref([])
const regdictList: any = ref([])
onMounted(() => {
handleQuery()
getList()
listhospital().then((res: any) => {
hosList.value = res.rows.map((item: any) => {
return {
@ -144,8 +190,8 @@ onMounted(() => {
})
})
listregdict({ pageSize: 100, pageNum: 1, dictType: 'BT' }).then((res: any) => {
regdictList.value = res.rows
listregdict({ pageSize: 100, pageNum: 1, dictType: 'ZT' }).then((res: any) => {
regdictList.value = res.rows;
})
})
@ -156,6 +202,8 @@ const formatDict = (v: string, arr: Array<any>) => {
<style scoped lang="scss">
.compact-form {
height: 5rem;
.el-form-item {
margin-bottom: 5px;
}

View File

@ -35,11 +35,13 @@
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
</div>
<div style="height: calc(100% - 100px);">
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
@size-change="sizeChange" @page-change="currentChange">
</CustomTable>
</div>
</div>
</template>
<script setup lang="ts">
@ -71,7 +73,7 @@ const columns: any = ref([
])
const tableConfig = ref({
border: true, // 边框
height: '75vh', // 高度
height: '100%', // 高度
highlightCurrentRow: true, // 高亮当前行
summary: true,
summaryField: ['sl', 'cost'],//计算列总和
@ -165,6 +167,8 @@ const formatDict = (v: string, arr: Array<any>) => {
<style scoped lang="scss">
.compact-form {
height: 2.5rem;
.el-form-item {
margin-bottom: 5px;
}