This commit is contained in:
wyuu 2026-05-22 09:15:31 +08:00
parent 079e6836e9
commit e022b6861a
7 changed files with 154 additions and 93 deletions

View File

@ -205,7 +205,7 @@
</div>
</template>
<script setup lang="ts">
<script setup lang="ts" name="ReportQuery">
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted } from 'vue';
import CustomTable from '@/components/elTable/index.vue'
import CustomVxeTable from '@/components/vxeTable/index.vue'
@ -215,7 +215,6 @@ import SelectTable from '@/components/SelectTable/index.vue';
import { ElMessage, ElMessageBox } from 'element-plus'
import { classCom } from '@/utils/classCom'
import { HiprintPrinter } from '@/utils/hiprintPrinter';
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
// @ts-ignore
import { listhospital } from "@/api/regional/dict/hospital.js";
// @ts-ignore
@ -709,7 +708,7 @@ const getinstrGroupOptions = () => {
getComDicts({ zdlb: 'GROUP' }).then((res: any) => {
instrGroupOptions.value = res.data
instrGroupOptions.value.push({ zddh: 'ALL', zdmc: '所有仪器' })
// getYqConfig()
getYqConfig()
});
}
const instrOptions = ref([])

View File

@ -82,7 +82,7 @@
</div>
</template>
<script setup>
<script setup name="Qcgraph">
import { getGroupInstrdList } from '@/api/liswork/work/LisWork';
import dayjs from 'dayjs';
import { queryBatch, queryBatchXm } from '@/api/liswork/qualityControl';

View File

@ -5,7 +5,7 @@
*/
<template>
<div class="sys_box">
<div class="app-container">
<el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5">
<el-button type="success" plain icon="Check" @click="handleSave">保存</el-button>
@ -22,8 +22,7 @@
<div class="triple-table-wrapper">
<!-- 第一列表格 -->
<div class="table-panel table-1">
<el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" class="config-table"
border height="100%">
<el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" border height="100%">
<el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip width="250" />
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip>
@ -38,8 +37,7 @@
<!-- 第二列表格 -->
<div class="table-panel table-2">
<el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" class="config-table"
border height="100%">
<el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" border height="100%">
<el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip width="250" />
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip>
@ -54,8 +52,8 @@
<!-- 第三列表格 -->
<div class="table-panel table-3">
<el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" class="config-table"
style="width: 100%" border height="100%">
<el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" style="width: 100%"
border height="100%">
<el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip width="250" />
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip>
@ -210,44 +208,20 @@ watch(yq, (newVal) => {
</script>
<style scoped lang="scss">
.sys_box {
height: calc(100% - 58px);
padding-top: 8px;
}
.table-toolbar {
margin-bottom: 5px;
}
// 三列表格容器
.triple-table-wrapper {
flex: 1;
height: calc(100% - 45px); // 减去标题行+工具栏高度
height: calc(100% - 105px);
display: flex;
gap: 0px; // 表格间间距
overflow: hidden;
gap: 10px; // 表格间间距
// 单个表格面板
.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;
}
}
}
</style>

View File

@ -45,7 +45,7 @@
</div>
</template>
<script setup lang="ts">
<script setup lang="ts" name="SetEnterResult">
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'
@ -57,12 +57,12 @@ import DateTime from './components/dateTime.vue';
const mbStore = useCommonStore();
// ========== TypeScript 类型定义 ==========
interface InstrTreeNode {
id: string
label: string
lx: string
newflag: string // 新增newflag字段
newflag: string
children?: InstrTreeNode[]
}
@ -85,7 +85,6 @@ interface QueryParams {
const radiotype = ref<string>("1")
// ========== 响应式变量 ==========
// 树相关
const deptTreeRef = ref<InstanceType<typeof ElTree>>()
const deptOptions = ref<InstrTreeNode[]>([])
@ -130,7 +129,7 @@ const radioChange = (val: string) => {
}
}
// ========== 树操作核心方法 ==========
const forceExpandSingleNode = (nodeId: string): void => {
expandedKeys.value = []
nextTick(() => {

View File

@ -191,7 +191,7 @@
</div>
</template>
<script setup lang="ts">
<script setup lang="ts" name="Summary">
import dayjs from 'dayjs'
const searchForm = ref({

View File

@ -155,7 +155,7 @@
</div>
</template>
<script setup>
<script setup name="WestGard">
import { getComDicts } from "@/api/liswork/dict/ComDict";
import { getGroupInstrdList } from "@/api/liswork/work/LisWork";
import { qcgraphList, querySample, qcCalc, saveBtQcSample } from "@/api/liswork/qualityControl/index";

View File

@ -5,21 +5,61 @@
<el-button type="primary" plain icon="Plus" @click="openAddRuleDialog">新增</el-button>
</div>
<div class="left-table-area">
<el-table :data="ruleList" border style="width: 100%" highlight-current-row show-overflow-tooltip height="100%">
<el-table-column prop="bglqdh" label="规则代号" width="100" align="center" />
<el-table-column prop="bglqmc" label="规则名称" width="300" />
<el-table-column prop="bz" label="备注" />
<el-table-column label="操作" align="center" fixed="right" width="160">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="openEditRuleDialog(scope.row)">编辑</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 左右布局容器 -->
<div class="main-layout">
<!-- 左侧规则列表 -->
<div class="left-table-area">
<el-table ref="tableRef" :data="ruleList" border style="width: 100%" highlight-current-row show-overflow-tooltip
height="100%" @row-click="handleRowClick">
<el-table-column prop="bglqdh" label="规则代号" width="100" align="center" />
<el-table-column prop="bglqmc" label="规则名称" width="200" />
<el-table-column prop="bz" label="备注" />
<el-table-column label="操作" align="center" fixed="right" width="160">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="openEditRuleDialog(scope.row)">编辑</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 右侧规则详情展示区 -->
<div class="right-detail-area">
<div class="detail-content">
<div class="rule-base-info">
<el-descriptions title="规则基本信息" border label-width="120">
<el-descriptions-item label="规则代号" :span="24">{{ currentRule.bglqdh }}</el-descriptions-item>
<el-descriptions-item label="规则名称" :span="24">{{ currentRule.bglqmc }}</el-descriptions-item>
<el-descriptions-item label="备注" :span="24">{{ currentRule.bz }}</el-descriptions-item>
</el-descriptions>
</div>
<div class="detail-table-header">
<span>规则明细</span>
</div>
<el-table :data="rightFormList" border style="width: 100%;" class="detail-table" height="calc(100% - 120px)"
show-overflow-tooltip>
<el-table-column prop="weekday" label="起始日期" width="100" align="center">
<template #default="scope">
{{ getWeekLabel(scope.row.weekday) }}
</template>
</el-table-column>
<el-table-column prop="weekday1" label="截止日期" width="100" align="center">
<template #default="scope">
{{ getWeekLabel(scope.row.weekday1) }}
</template>
</el-table-column>
<el-table-column prop="kssj" label="起始时间" width="100" align="center" />
<el-table-column prop="jssj" label="截止时间" width="100" align="center" />
<el-table-column prop="bglqsm" label="报告领取声明" />
<el-table-column prop="bgxss" label="所需小时数" width="100" align="center" />
</el-table>
</div>
</div>
</div>
<!-- 新增/编辑规则弹窗 -->
<!-- 新增/编辑规则弹窗 -->
<el-dialog v-model="ruleDialogVisible" :title="isAddRule ? '新增规则' : '编辑规则'" width="800px" @close="resetRuleForm"
:close-on-click-modal="false" :draggable="true">
<el-form :model="ruleForm" label-width="80px" class="rule-form" ref="ruleFormRef">
@ -120,8 +160,11 @@ interface Rule {
addFlag: boolean
}
const ruleList = ref<Rule[]>([])
// 当前选中的规则w
const currentRule: any = ref({})
const currentBglqdh = ref(-1)
const tableRef = useTemplateRef('tableRef')
// 弹窗相关
const ruleDialogVisible = ref(false)
const isAddRule = ref(true) // 区分新增/编辑规则
const ruleFormRef = ref<FormInstance>()
@ -147,10 +190,26 @@ interface Detail {
status: boolean
}
const detailFormList = ref<Detail[]>([])
const rightFormList = ref<Detail[]>([])
// 根据值获取星期标签
const getWeekLabel = (value: string) => {
const day = weekDays.find(item => item.value === value)
return day ? day.label : '-'
}
// 行点击事件 - 加载规则详情
const handleRowClick = (row: Rule) => {
currentRule.value = row
getDetailList(row.bglqdh)
}
// 查询规则列表
const handleQuery = () => {
getList()
// 清空右侧详情
currentRule.value = null
rightFormList.value = []
}
// 获取规则列表
@ -162,6 +221,18 @@ const getList = () => {
item.originalData = {}
item.status = false
})
if (res.data.length) {
const Index = res.data.findIndex(item => item.bglqdh == currentBglqdh.value)
currentRule.value = Index > -1 ? res.data[Index] : res.data[0]
getDetailList(Index > -1 ? res.data[Index].bglqdh : res.data[0].bglqdh)
nextTick(() => {
tableRef.value.setCurrentRow(Index > -1 ? res.data[Index] : res.data[0])
tableRef.value.setScrollTop(Index * 30)
})
} else {
currentRule.value = null
rightFormList.value = []
}
}
})
}
@ -177,9 +248,8 @@ const openAddRuleDialog = () => {
// 生成新的规则代号
const maxDh = Math.max(...ruleList.value.map(item => item.bglqdh), 0) + 1
ruleForm.value.bglqdh = maxDh
// 清空明细列表
detailFormList.value = []
ruleForm.value.bglqmc = ''
ruleForm.value.bz = ''
}
// 打开编辑规则弹窗
@ -202,6 +272,7 @@ const getDetailList = (bglqdh: number) => {
...item,
xh: index + 1
}))
rightFormList.value = res.data
}
})
}
@ -265,7 +336,6 @@ const saveRule = () => {
ruleFormRef.value.validate((valid) => {
if (!valid) return
// 构造提交数据
const ruleData = {
ruleList: [{ ...ruleForm.value, addFlag: isAddRule.value, status: true }],
@ -278,6 +348,7 @@ const saveRule = () => {
if (res.code == 0) {
ElMessage.success('规则新增成功');
ruleDialogVisible.value = false
currentBglqdh.value = ruleForm.value.bglqdh
getList()
}
})
@ -288,7 +359,9 @@ const saveRule = () => {
if (res.code == 0) {
ElMessage.success('规则修改成功');
ruleDialogVisible.value = false
currentBglqdh.value = ruleForm.value.bglqdh
getList()
}
})
}
@ -306,18 +379,10 @@ const handleDelete = (row: Rule) => {
type: 'warning',
}
).then(() => {
// 新增未保存的规则直接删除
if (row.addFlag) {
ruleList.value = ruleList.value.filter(item => item.bglqdh !== row.bglqdh)
ElMessage.success('删除成功');
return
}
// 调用删除接口
rptgetruleDel({ bglqdh: row.bglqdh }).then((res: any) => {
if (res.code == 0) {
ElMessage.success('删除成功');
ruleList.value = ruleList.value.filter(item => item.bglqdh !== row.bglqdh)
getList()
}
})
})
@ -380,14 +445,52 @@ onMounted(() => {
box-sizing: border-box;
}
.mb20 {
margin-bottom: 20px;
.mb5 {
margin-bottom: 10px;
}
.left-table-area {
/* 主布局 - 左右分栏 */
.main-layout {
display: flex;
gap: 10px;
height: calc(100% - 40px);
}
/* 左侧表格区域 */
.left-table-area {
flex: 1;
height: 100%;
min-width: 600px;
}
/* 右侧详情区域 */
.right-detail-area {
flex: 1;
height: 100%;
min-width: 600px;
border: 1px solid #1890ff;
border-radius: 4px;
padding: 10px;
box-sizing: border-box;
display: flex;
flex-direction: column;
}
/* 详情内容区 */
.detail-content {
height: 100%;
display: flex;
flex-direction: column;
gap: 10px;
}
/* 规则基本信息 */
.rule-base-info {
margin-bottom: 10px;
}
.rule-form {
margin-bottom: 15px;
}
@ -404,25 +507,11 @@ onMounted(() => {
align-items: center;
}
.full-width-input {
width: 100%;
}
/* 替换::v-deep为:deep() */
:deep(.custom-table th) {
background-color: #f5f7fa;
}
:deep(.detail-table th) {
background-color: #f0faff;
}
:deep(.el-table .el-table__cell) {
padding: 5px 0;
}
:deep(.el-input__inner) {
padding: 5px 10px;
height: 32px;
/* 描述列表样式优化 */
:deep(.el-descriptions__title) {
font-weight: 700;
font-size: 16px;
color: #1890ff;
}
</style>