条码生成接口联调

This commit is contained in:
wyuu 2025-08-28 17:47:20 +08:00
parent 6a37d14707
commit 17bd08bea0
8 changed files with 481 additions and 370 deletions

View File

@ -18,4 +18,12 @@ export function fetchCodeList(query?: Object) {
method: 'get',
params: query,
});
}
// 查询项目
export function fetchCodeDetail(query?: Object) {
return request({
url: 'zyreq/detail',
method: 'get',
params: query,
});
}

View File

@ -2,37 +2,45 @@ import request from '@/utils/request'
// 查询字典数据列表
export function queryComDictListService(query) {
return request({
url: '/comdict/query',
method: 'get',
params: query
})
return request({
url: '/comdict/query',
method: 'get',
params: query
})
}
//增加字典数据
export function addComDictService(data) {
return request({
url: '/comdict/add',
method: 'post',
data
})
return request({
url: '/comdict/add',
method: 'post',
data
})
}
//修改字典数据
export function updateComDictService(data) {
return request({
url: '/comdict/update',
method: 'post',
data
})
return request({
url: '/comdict/update',
method: 'post',
data
})
}
//删除字典数据
export function delComDictService(data) {
return request({
url: '/comdict/del',
method: 'delete',
data
})
}
// 根据字典类型查询字典数据信息
export function getComDicts(zdlb) {
return request({
url: '/comdict/getComDicts',
method: 'get',
params: zdlb
})
}
return request({
url: '/comdict/getComDicts',
method: 'get',
params: zdlb
})
}

View File

@ -1,7 +1,7 @@
<template>
<div class="custom-table-wrapper">
<!-- 表格主体 -->
<el-table ref="tableRef" :data="tableData" :loading="loading" :stripe="config.stripe || false"
<el-table ref="tableRef" :data="tableData" v-loading="loading" :stripe="config.stripe || false"
:border="config.border" :fit="config.fit !== true" :show-header="config.showHeader !== false"
:highlight-current-row="config.highlightCurrentRow || false" :row-class-name="config.rowClassName"
:header-cell-style="config.headerCellStyle" :cell-style="config.cellStyle" :max-height="config.maxHeight"
@ -23,7 +23,7 @@
:min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'left'" :sortable="item.sortable"
:show-overflow-tooltip="item.showOverflowTooltip !== false">
<template #default="scope">
<slot :name="item.slot" :row="scope.row" :column="scope.column" :$index="scope.$index" />
<slot :name="item.slot" :row="scope.row" />
</template>
</el-table-column>

61
src/utils/classCom.ts Normal file
View File

@ -0,0 +1,61 @@
/**
* 颜色处理工具类
* 提供十进制颜色值转十六进制颜色码(支持BGR转RGB)及文字对比度计算功能
*/
function decimalToHexColor(decimal: number | string): string {
// 处理空值和非数字情况
if (decimal === undefined || decimal === null || decimal === '') {
return '#FFFFFF';
}
// 统一转换为数字类型
const num = typeof decimal === 'string' ? parseFloat(decimal) : decimal;
if (isNaN(num)) {
return '#FFFFFF';
}
// 十进制转十六进制并转为大写
let hex = Math.floor(num).toString(16).toUpperCase();
// 确保十六进制字符串为6位,不足则补0
if (hex.length < 6) {
hex = hex.padStart(6, '0');
}
// BGR转RGB(交换前后两位)
const r = hex.substring(4, 6);
const g = hex.substring(2, 4);
const b = hex.substring(0, 2);
const rgbHex = r + g + b;
return `#${rgbHex}`;
}
/**
* 根据背景色计算对比度文字颜色(黑/白)
* @param bgColor 十六进制背景色(如#FFFF80)
* @returns 对比度文字颜色(#333333或#FFFFFF)
*/
function getContrastTextColor(bgColor: string): string {
// 验证颜色格式
if (!/^#([0-9A-F]{6})$/i.test(bgColor)) {
throw new Error('Invalid hex color format. Expected #RRGGBB');
}
// 提取RGB分量
const r = parseInt(bgColor.slice(1, 3), 16);
const g = parseInt(bgColor.slice(3, 5), 16);
const b = parseInt(bgColor.slice(5, 7), 16);
// 计算亮度(标准 luminance 公式)
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
// 根据亮度返回对比色
return luminance > 0.5 ? '#333333' : '#FFFFFF';
}
export const classCom = { decimalToHexColor, getContrastTextColor }

View File

@ -1,4 +1,4 @@
// src/utils/print-utils.ts
// src/utils/hiprintPrinter.ts
import { io, Socket } from "socket.io-client";
import { ElMessage, ElMessageBox } from 'element-plus'
import { usePrintStore } from '@/store/modules/printStore'

View File

@ -4,22 +4,23 @@
<el-row :gutter="10" class="compact-form" v-show="showSearch">
<el-form :model="queryParams" ref="queryRef" :inline="true" :rules="queryRules">
<el-form-item label="日期:" prop="failed1">
<el-date-picker v-model="queryParams.failed1" type="daterange" range-separator="-" start-placeholder="开始时间"
end-placeholder="结束时间" />
<el-date-picker v-model="queryParams.failed1" type="datetimerange" range-separator="-"
start-placeholder="开始时间" end-placeholder="结束时间" format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss" @change="handletime" />
</el-form-item>
<el-form-item label="医疗机构:" prop="failed2">
<el-select v-model="queryParams.failed2" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
<el-form-item label="医疗机构:" prop="yljg">
<el-select v-model="queryParams.yljg" placeholder="请选择">
<el-option v-for="item in dictData.HOS" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="条码状态:" prop="failed3">
<el-select v-model="queryParams.failed3" placeholder="请选择" style="width: 120px;">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
<el-form-item label="条码状态:" prop="zt">
<el-select v-model="queryParams.zt" placeholder="请选择" style="width: 120px;">
<el-option v-for="item in dictData.ST" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="" prop="failed4">
<el-select v-model="queryParams.failed4" placeholder="请选择">
<el-select v-model="queryParams.failed4" placeholder="请选择" style="width:120px">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
@ -74,17 +75,36 @@
:columns="columns"></right-toolbar>
</el-row>
<CustomTable :data="tableData" :columns="columns" :config="tableConfig" :loading="loading">
<template #tfailed5="{ row }">
{{ row.tfailed5 }}
<CustomTable :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
@row-click="rowHandle">
<template #jzbz="{ row }">
{{ row.jzbz == '1' ? '急诊' : '非急诊' }}
</template>
<template #jjzt="{ row }">
{{ row.jjzt == '1' ? '计价' : '无' }}
</template>
<template #brly="{ row }">
{{ formatDict(row.brly, 'PT') }}
</template>
<template #zt="{ row }">
{{ formatDict(row.zt, 'ST') }}
</template>
<template #yljg="{ row }">
{{ formatDict(row.yljg, 'HOS') }}
</template>
</CustomTable>
</el-col>
<el-col :span="8" class="right-table">
<div class="title"> 项目 </div>
<el-button type="danger" class="mb10">拆分选中项目</el-button>
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig" :loading="loading">
<!-- <el-button type="danger" class="mb10">拆分选中项目</el-button> -->
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig">
<template #jjzt="{ row }">
{{ row.jjzt == '1' ? '计价' : '无' }}
</template>
<template #zt="{ row }">
{{ formatDict(row.zt, 'ST') }}
</template>
</CustomTable>
</el-col>
</el-row>
@ -110,7 +130,7 @@
</el-row>
<el-button type="primary" plain>保存</el-button>
</div>
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig" :loading="loading">
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig">
</CustomTable>
</el-dialog>
@ -134,7 +154,7 @@
</el-row>
<el-button type="primary" plain>保存</el-button>
</div>
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig" :loading="loading">
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig">
</CustomTable>
</el-dialog>
@ -143,12 +163,16 @@
</template>
<script setup lang="ts">
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted, onUnmounted } from 'vue';
import { HiprintPrinter } from '@/utils/print-utils';
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted, } from 'vue';
import { HiprintPrinter } from '@/utils/hiprintPrinter';
import { classCom } from '@/utils/classCom';
import CustomTable from '@/components/tableCom/index.vue'
import { useRouter } from 'vue-router'
import { usePrintStore } from '@/store/modules/printStore' // 引入 Pinia store
import { fetchCodeList, addObj } from '@/api/checkCode/index'
import { usePrintStore } from '@/store/modules/printStore'
import { fetchCodeList, addObj, fetchCodeDetail } from '@/api/checkCode/index'
import { TableColumnCtx } from 'element-plus';
//@ts-ignore
import { comDict } from '@/utils/dict'
import { ElMessage, ElMessageBox } from 'element-plus'
const router = useRouter()
const printStore = usePrintStore();
@ -165,9 +189,9 @@ const openSj = () => {
}
// 提交表单数据
const queryParams = reactive({
failed1: [],
failed2: '',
failed3: '',
failed1: ['2025-07-18 00:00:00', '2025-07-18 23:59:59'],
yljg: '1',
zt: '',
failed4: '',
failed5: '',
});
@ -195,62 +219,54 @@ const options = [
},
]
interface DictData {
SX?: Array<any>;
HOS?: Array<any>;
[key: string]: any[] | undefined; // 添加索引签名以支持动态访问
}
// 字典数据存储
const dictData = ref<DictData>({});
const handleQuery = async () => {
const valid = await queryRef.value.validate().catch(() => { });
if (!valid) return false;
getList()
}
// 重置
const resetQuery = () => {
queryRef.value?.resetFields();
// download([20221201167817]).then(() => {
// console.log('重置成功');
// }).catch(() => {
// console.log('重置失败');
// });
getList()
}
const loading = false;
const loading = ref(true);
// 数据源
const tableData = [
{
id: 1, tfailed2: '张三', tfailed1: 24, tfailed3: '男', tfailed4: '血常规', tfailed5: '常规检查',
tfailed6: '无', tfailed7: '否', tfailed8: '血液样本', tfailed9: '1234567890', tfailed10: '内科', tfailed11: 'A1234567890',
tfailed12: '待处理', tfailed13: '门诊', tfailed14: '王医生', tfailed15: '2023-10-01 10:00', tfailed16: '计价标志', tfailed17: '执行医生', tfailed18: '送检人', tfailed19: '医疗机构'
},
{
id: 2, tfailed2: '李四', tfailed1: 25, tfailed3: '男', tfailed4: '血常规', tfailed5: '常规检查',
tfailed6: '无', tfailed7: '否', tfailed8: '血液样本', tfailed9: '1234567890', tfailed10: '内科', tfailed11: 'A1234567890',
tfailed12: '待处理', tfailed13: '门诊', tfailed14: '王医生', tfailed15: '2023-10-01 10:00', tfailed16: '计价标志', tfailed17: '执行医生', tfailed18: '送检人', tfailed19: '医疗机构'
}
]
const tableData = ref([])
// 配置项
const columns = ref([
{ prop: 'tfailed1', label: '床号', visible: true, key: 0, sortable: true, width: '110px' },
{ prop: 'tfailed2', label: '姓名', visible: true, key: 1, width: '110px' },
{ prop: 'tfailed3', label: '性别', align: 'center', visible: true, key: 2, },
{ prop: 'tfailed4', label: '项目名称', align: 'center', visible: true, key: 3, width: '110px' },
{ prop: 'tfailed5', label: '类别', align: 'center', visible: true, key: 4, slot: 'tfailed5', width: '110px' },
{ prop: 'tfailed6', label: '采样提示', align: 'center', visible: true, key: 5, width: '110px' },
{ prop: 'tfailed7', label: '急诊', align: 'center', visible: true, key: 6, width: '110px' },
{ prop: 'tfailed8', label: '样本类型', align: 'center', visible: true, key: 7, width: '110px' },
{ prop: 'tfailed9', label: '病人号', align: 'center', visible: true, key: 8, width: '110px' },
{ prop: 'tfailed10', label: '科室名称', align: 'center', visible: true, key: 9, width: '110px' },
{ prop: 'tfailed11', label: '申请号/条码', align: 'center', visible: true, key: 10, width: '110px' },
{ prop: 'tfailed12', label: '状态', align: 'center', visible: true, key: 11, width: '110px' },
{ prop: 'tfailed13', label: '病人来源', align: 'center', visible: true, key: 12, width: '110px' },
{ prop: 'tfailed14', label: '申请医生', align: 'center', visible: true, key: 13, width: '110px' },
{ prop: 'tfailed15', label: '申请时间', align: 'center', visible: true, key: 14, width: '150px' },
{ prop: 'tfailed16', label: '计价标志', align: 'center', visible: true, key: 15, width: '110px' },
{ prop: 'tfailed17', label: '执行医生', align: 'center', visible: true, key: 16, width: '110px' },
{ prop: 'tfailed18', label: '送检人', align: 'center', visible: true, key: 17, width: '110px' },
{ prop: 'tfailed19', label: '医疗机构', align: 'center', visible: true, key: 18, width: '110px' },
{ prop: 'ch', label: '床号', visible: true, key: 0, sortable: true, },
{ prop: 'brxm', label: '姓名', visible: true, key: 1, },
{ prop: 'brxbname', label: '性别', align: 'center', visible: true, key: 2, },
{ prop: 'jymd', label: '项目名称', align: 'center', visible: true, key: 3, width: '140px' },
{ prop: 'bgddhname', label: '类别', align: 'center', visible: true, key: 4, width: '120px' },
{ prop: 'sampletips', label: '采样提示', align: 'center', visible: true, key: 5, width: '110px' },
{ prop: 'jzbz', label: '急诊', align: 'center', visible: true, slot: 'jzbz', key: 6, width: '110px' },
{ prop: 'yblx', label: '样本类型', align: 'center', visible: true, key: 7, width: '110px' },
{ prop: 'brdh', label: '病人号', align: 'center', visible: true, key: 8, width: '110px' },
{ prop: 'ksname', label: '科室名称', align: 'center', visible: true, key: 9, width: '110px' },
{ prop: 'sqh', label: '申请号/条码', align: 'center', visible: true, key: 10, width: '110px' },
{ prop: 'zt', label: '状态', align: 'center', visible: true, key: 11, slot: 'zt', width: '110px' },
{ prop: 'brly', label: '病人来源', align: 'center', visible: true, key: 12, slot: 'brly', width: '110px' },
{ prop: 'sqysname', label: '申请医生', align: 'center', visible: true, key: 13, width: '110px' },
{ prop: 'sqsj', label: '申请时间', align: 'center', visible: true, key: 14, width: '170px' },
{ prop: 'jjzt', label: '计价标志', align: 'center', visible: true, key: 15, slot: 'jjzt', },
{ prop: 'zxysname', label: '执行医生', align: 'center', visible: true, key: 16, },
{ prop: 'bbsjrname', label: '送检人', align: 'center', visible: true, key: 17, },
{ prop: 'yljg', label: '医疗机构', align: 'center', visible: true, slot: 'yljg', key: 18, width: '170px' },
])
// 单元格样式
const cellStyleHd = ({ row, column, rowIndex, columnIndex }: {
row: any;
@ -259,19 +275,35 @@ const cellStyleHd = ({ row, column, rowIndex, columnIndex }: {
columnIndex: number;
}) => {
// console.log(row, column, rowIndex, columnIndex);
if (row.tfailed5 == "常规检查" && columnIndex == 5) {
// console.log(row, column, rowIndex, columnIndex);
if (column.label == "急诊" && row.jzbz == "1") {
return { background: '#f00 !important', color: '#fff' };
}
if (column.label == "类别") {
const bgColor = classCom.decimalToHexColor(row.bkcolor);
const textColor = classCom.getContrastTextColor(bgColor);
return {
backgroundColor: `${bgColor} !important`,
color: textColor,
};
}
};
const rowClassNameHd = ({ row, rowIndex }: {
row: any;
rowIndex: number;
}) => {
return 'custom-row-class'; // 返回自定义类名
};
// 表格配置
// 点击行
const rowHandle = (row: any, column: TableColumnCtx<any>, event: Event) => {
console.log(row);
getRightTable(row)
};
// 左侧表格配置
const tableConfig = ref({
// stripe: true, // 斑马纹
border: false, // 边框
@ -283,8 +315,27 @@ const tableConfig = ref({
rowClassName: rowClassNameHd,
fit: true
})
// 右侧数据源
const rightTableData = ref([])
// 配置项
const rightColumns = ref([
{ prop: 'sqxmdh', label: '项目代号', visible: true, key: 0, sortable: true, width: '110px' },
{ prop: 'sqxmmc', label: '项目名称', visible: true, key: 1, width: '120px' },
{ prop: 'dj', label: '单价', align: 'center', visible: true, key: 2 },
{ prop: 'sl', label: '数量', align: 'center', visible: true, key: 3 },
{ prop: 'zt', label: '状态', align: 'center', visible: true, slot: 'zt', key: 4 },
{ prop: 'jjzt', label: '计价标志', align: 'center', visible: true, slot: 'jjzt', key: 5 },
])
// 表格配置
const rightTableConfig = ref({
// stripe: true, // 斑马纹
border: false, // 边框
// selection: true, // 多选框
index: false, // 序号
height: '100%', // 高度
highlightCurrentRow: true, // 高亮当前行
})
interface ColumnItem {
prop: string;
@ -300,49 +351,41 @@ const updateColumns = (arr: Array<ColumnItem>) => {
columns.value = arr
};
const getRightTable = (row: any) => {
fetchCodeDetail({ sqh: row.sqh }).then((res: any) => {
if (res.code == 0) {
rightTableData.value = res.data
}
})
}
// 右侧数据源
const rightTableData = [
{
id: 1, tfailed1: 'P001', tfailed2: '项目A', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
},
{
id: 1, tfailed1: 'P002', tfailed2: '项目B', tfailed3: 100, tfailed4: 2, tfailed5: '待处理', tfailed6: '是',
},
]
// 配置项
const rightColumns = ref([
{ prop: 'tfailed1', label: '项目代号', visible: true, key: 0, sortable: true, width: '110px' },
{ prop: 'tfailed2', label: '项目名称', visible: true, key: 1 },
{ prop: 'tfailed3', label: '单价', align: 'center', visible: true, key: 2 },
{ prop: 'tfailed4', label: '数量', align: 'center', visible: true, key: 3 },
{ prop: 'tfailed5', label: '状态', align: 'center', visible: true, key: 4 },
{ prop: 'tfailed6', label: '计价标志', align: 'center', visible: true, key: 5 },
])
// 表格配置
const rightTableConfig = ref({
// stripe: true, // 斑马纹
border: false, // 边框
selection: true, // 多选框
index: false, // 序号
height: '100%', // 高度
highlightCurrentRow: true, // 高亮当前行
})
const goReport = () => {
// 跳转到报告查询页面
router.push('/report')
};
onMounted(() => {
onMounted(async () => {
adjustTableHeight();
getList()
// 加载病人来源字典
const dictRefs = await comDict('PT', 'HOS', 'ST');
// 从 ref 中获取实际数据
dictData.value = {
PT: toRaw(dictRefs.PT.value) || [],
HOS: toRaw(dictRefs.HOS.value) || [],
ST: toRaw(dictRefs.ST.value) || [],
};
});
// 字典格式化方法
const formatDict = (v: string, dictType: string) => {
// 从全局字典中获取映射值
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label;
};
// 计算table高度
watch(showSearch, () => {
nextTick(() => {
@ -355,20 +398,23 @@ function adjustTableHeight() {
// 获取高度
heightForm.value = compactForm.value.offsetHeight;
tableConfig.value.height = `calc(75vh - ${heightForm.value}px)`; // 设置表格容器的高度
rightTableConfig.value.height = `calc(75vh - ${heightForm.value}px)`; // 设置表格容器的高度
rightTableConfig.value.height = `calc(79vh - ${heightForm.value}px)`;
}
}
const handletime = (val: Array<string>) => {
console.log(val);
}
// 生成条码
const printHandle = () => {
const data = {
dept: 123,
dept: '0235',
userid: 'lis',
st: '2025-01-01 00:00:00',
et: '2025-05-21 23:59:59',
yljg: 1
st: queryParams.failed1[0],
et: queryParams.failed1[1],
yljg: queryParams.yljg
}
addObj(data).then((res: any) => {
if (res.code == 0) {
@ -380,9 +426,19 @@ const printHandle = () => {
// 查询申请单
const getList = () => {
fetchCodeList({ sqh: '20221201167864' }).then((response: any) => {
loading.value = true;
const data = {
dept: '0235',
userid: 'lis',
st: queryParams.failed1[0],
et: queryParams.failed1[1],
yljg: queryParams.yljg
}
fetchCodeList(data).then((response: any) => {
if (response.code == 0) {
loading.value = false;
tableData.value = response.data
getRightTable(response.data[0])
}
})
}

View File

@ -1,7 +1,7 @@
<script setup>
import { computed, reactive, ref, onMounted, nextTick } from "vue";
import { getToken } from "@/utils/auth";
import { queryComDictListService, addComDictService, updateComDictService } from "../../../api/liswork/dict/ComDict.js";
import { queryComDictListService, addComDictService, updateComDictService, delComDictService } from "../../../api/liswork/dict/ComDict.js";
const { proxy } = getCurrentInstance();
@ -59,7 +59,7 @@ const defaultProps = {
id: 'zddh'
}
const info = ref({})
watch(zdlbmc, (val) => {
console.log(ref(treeRef.value));
@ -107,8 +107,6 @@ function getTypeList() {
/** 查询字典明细列表 */
function getList() {
loading.value = true;
queryComDictListService(queryParams.value).then(response => {
typeDetail.value = response.rows;
@ -155,13 +153,19 @@ function handleAdd() {
//修改
function handleUpdate(row) {
form.value = row
reset()
form.value = row.zdlb ? row : info.value
open.value = true;
}
//删除
function handleDelete() {
function handleDelete(row) {
proxy.$modal.confirm('是否确认删除字典名称为"' + row.zdmc + '"的数据项?').then(function () {
return delComDictService(row);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => { });
}
/** 导入按钮操作 */
function handleImport() {
@ -198,7 +202,8 @@ const handleFileSuccess = (response, file, fileList) => {
//多选框选中数据
function handleSelectionChange() {
function handleSelectionChange(selection) {
info.value = selection[0]
single.value = selection.length != 1;
}
@ -215,21 +220,22 @@ function submitForm() {
if (valid) {
if (form.value.zdlb != undefined && form.value.zdlb != '') {
updateComDictService(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
}).catch(error => {
reset();
});
if (response.code == 0) {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
}
})
} else {
form.value.zdlb = queryParams.value.zdlb;
form.value.yljg = 1;
addComDictService(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
}).catch(error => {
form.value.zdlb = '';
});
if (response.code == 0) {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
}
})
}
}
});
@ -290,10 +296,10 @@ onMounted(() => {
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
v-hasPermi="['system:dict:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
v-hasPermi="['system:dict:remove']">删除</el-button>
</el-col>
</el-col> -->
<el-col :span="1.5">
<el-button type="info" plain icon="Upload" @click="handleImport"
v-hasPermi="['system:dict:import']">导入</el-button>
@ -309,7 +315,7 @@ onMounted(() => {
<el-table-column label='字典类型' align="center" prop="zdlb" :show-overflow-tooltip="true" />
<el-table-column label="明细代号" align="center" prop="zddh" />
<el-table-column label="名称" align="center" prop="zdmc" :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="bz" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
<template #default="{ row }">
<el-button link type="primary" icon="Edit" @click="handleUpdate(row)"

View File

@ -1,149 +1,119 @@
<template>
<div class="app-container">
<el-row :gutter="5" class="compact-form" :span="24" >
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-position="left" >
<el-col :span="24" :xs="24">
<el-form-item label="" label-width="0px" prop="brdh" >
<el-row :gutter="5" class="compact-form" :span="24">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-position="left">
<el-col :span="24" :xs="24">
<el-form-item label="" label-width="0px" prop="brdh">
<el-col :span="6">
<div> 就诊卡号/病历号/磁卡号: </div>
<el-input
v-model="queryParams.brdh"
placeholder="就诊卡号/病历号/磁卡号"
clearable
@keyup.enter="handleQuery"
/>
</el-col>
<el-col :span="2">
<el-radio-group v-model="queryParams.zt" size="default">
<el-radio v-for="(item, index) in showconfirmOptions" :key="index" :label="item.value"
:disabled="item.disabled">{{item.label}}</el-radio>
</el-radio-group>
</el-col>
<el-col :span="1"> <div> 申请获取期限: </div></el-col>
<el-col :span="6">
<el-radio-group v-model="queryParams.subday" size="default">
<el-radio v-for="(item, index) in subdayOptions" :key="index" :label="item.value"
:disabled="item.disabled">{{item.label}}</el-radio>
</el-radio-group>
</el-col>
<el-col :span="2">
<el-select v-model="queryParams.cardtype" placeholder="卡类型" clearable :style="{width: '100%'}">
<el-option v-for="(item, index) in cardtypeOptions" :key="index" :label="item.label"
:value="item.value" :disabled="item.disabled"></el-option>
</el-select>
</el-col>
<el-col :span="1.5">
<el-button type="primary" icon="Search" @click="readCard">读卡</el-button>
</el-col>
<el-col :span="1.5">
<PatSearchDialog @select="handlePatientSelect"/>
<el-col :span="6">
<div> 就诊卡号/病历号/磁卡号: </div>
<el-input v-model="queryParams.brdh" placeholder="就诊卡号/病历号/磁卡号" clearable @keyup.enter="handleQuery" />
</el-col>
</el-form-item>
</el-col>
<el-col :span="2">
<el-radio-group v-model="queryParams.zt" size="default">
<el-radio v-for="(item, index) in showconfirmOptions" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-col>
<el-col :span="1">
<div> 申请获取期限: </div>
</el-col>
<el-col :span="6">
</el-form>
<el-radio-group v-model="queryParams.subday" size="default">
<el-radio v-for="(item, index) in subdayOptions" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-col>
<el-col :span="2">
<el-select v-model="queryParams.cardtype" placeholder="卡类型" clearable :style="{ width: '100%' }">
<el-option v-for="(item, index) in cardtypeOptions" :key="index" :label="item.label" :value="item.value"
:disabled="item.disabled"></el-option>
</el-select>
</el-col>
<el-col :span="1.5">
<el-button type="primary" icon="Search" @click="readCard">读卡</el-button>
</el-col>
<el-col :span="1.5">
<PatSearchDialog @select="handlePatientSelect" />
</el-col>
</el-form-item>
</el-col>
</el-form>
</el-row>
<el-row :gutter="5" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Search"
@click="handleQuery"
v-hasPermi="['system:reqmain:Search']"
>查询</el-button>
<el-button type="primary" plain icon="Search" @click="handleQuery"
v-hasPermi="['system:reqmain:Search']">查询</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Printer"
:disabled="single"
@click="printAll"
v-hasPermi="['system:reqmain:add']"
>打印</el-button>
<el-button type="success" plain icon="Printer" :disabled="single" @click="printAll"
v-hasPermi="['system:reqmain:add']">打印</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Printer"
:disabled="single"
@click="printSigne"
v-hasPermi="['system:reqmain:edit']"
>单打条码</el-button>
<el-button type="success" plain icon="Printer" :disabled="single" @click="printSigne"
v-hasPermi="['system:reqmain:edit']">单打条码</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Printer"
:disabled="freesingle"
@click="printBack"
v-hasPermi="['system:reqmain:edit']"
>单打回单</el-button>
<el-button type="danger" plain icon="Printer" :disabled="freesingle" @click="printBack"
v-hasPermi="['system:reqmain:edit']">单打回单</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Delete"
@click="cancel"
v-hasPermi="['system:reqmain:export']"
>取消采样</el-button>
<el-button type="warning" plain icon="Delete" @click="cancel"
v-hasPermi="['system:reqmain:export']">取消采样</el-button>
</el-col>
</el-row>
<el-row :gutter="5" class="table-container">
<el-table ref="tableRef" class="compact-form my-table" :data="reqmainList" @selection-change="handleSelectionChange" @select="handleSelect" height="100%" :cell-style="tableCellStyle">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目名称" align="center" prop="sqxmmc" width="200" show-overflow-tooltip/>
<el-table-column label="项目代码" align="center" prop="sqxmdh" width="100" show-overflow-tooltip/>
<el-table-column label="项目类别" align="center" prop="cp_xmlb" />
<el-table-column label="样本类型" align="center" prop="yblx" />
<el-table-column label="条码号" align="center" prop="sqh" width="150" show-overflow-tooltip/>
<el-table-column label="申请时间" align="center" prop="sqsj" width="180" show-overflow-tooltip>
<template #default="scope">
<span>{{ parseTime(scope.row.sqsj, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="病人姓名" align="center" prop="brxm" show-overflow-tooltip/>
<el-table-column label="申请医生" align="center" prop="sqys" :formatter="formatDict('SRD')" show-overflow-tooltip/>
<el-table-column label="序号" align="center" prop="xh" show-overflow-tooltip/>
<el-table-column label="数量" align="center" prop="sl" show-overflow-tooltip/>
<el-table-column label="单价" align="center" prop="dj" show-overflow-tooltip/>
<el-table-column label="状态" align="center" prop="zt" show-overflow-tooltip/>
<el-table-column label="计价" align="center" prop="jjzt" >
<template #default="scope">
<el-checkbox :model-value="scope.row.jjzt === '1'" disabled>
</el-checkbox>
</template>
</el-table-column>
<el-table-column label="病人代号" align="center" prop="brdh" show-overflow-tooltip/>
<el-table-column label="备注1" align="center" prop="detailBZ1" show-overflow-tooltip/>
<el-table-column label="备注2" align="center" prop="detailBZ2" show-overflow-tooltip/>
<el-table-column label="颜色" align="center" prop="cp_color" v-if="false" show-overflow-tooltip/>
<el-table-column label="确认标识" align="center" prop="cp_cflag" v-if="false" show-overflow-tooltip/>
<el-table-column label="科室" align="center" prop="ksdh" :formatter="formatDict('DP')" show-overflow-tooltip/>
<el-table-column label="病人类型" align="center" prop="brly" :formatter="formatDict('PT')" show-overflow-tooltip/>
<el-table-column label="性别" align="center" prop="brxb" :formatter="formatDict('SX')" show-overflow-tooltip/>
<el-table-column label="生日" align="center" prop="brsr" width="180" show-overflow-tooltip>
<template #default="scope">
<span>{{ parseTime(scope.row.brsr, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="床号" align="center" prop="ch" width="50" show-overflow-tooltip/>
<el-table-column label="诊断" align="center" prop="zd" width="150" show-overflow-tooltip/>
<el-table-column label="条码类别" align="center" prop="bgddh" v-if="false" show-overflow-tooltip/>
<el-table-column label="年龄" align="center" prop="nl" show-overflow-tooltip/>
<el-table-column label="年龄单位" align="center" prop="nldw" :formatter="formatDict('AU')" show-overflow-tooltip/>
<el-table-column label="采样时间" align="center" prop="cysj" width="180"show-overflow-tooltip>
<template #default="scope">
<span>{{ parseTime(scope.row.cysj, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
</el-table>
<el-table ref="tableRef" class="compact-form my-table" :data="reqmainList"
@selection-change="handleSelectionChange" @select="handleSelect" height="100%" :cell-style="tableCellStyle">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目名称" align="center" prop="sqxmmc" width="200" show-overflow-tooltip />
<el-table-column label="项目代码" align="center" prop="sqxmdh" width="100" show-overflow-tooltip />
<el-table-column label="项目类别" align="center" prop="cp_xmlb" />
<el-table-column label="样本类型" align="center" prop="yblx" />
<el-table-column label="条码号" align="center" prop="sqh" width="150" show-overflow-tooltip />
<el-table-column label="申请时间" align="center" prop="sqsj" width="180" show-overflow-tooltip>
<template #default="scope">
<span>{{ parseTime(scope.row.sqsj, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="病人姓名" align="center" prop="brxm" show-overflow-tooltip />
<el-table-column label="申请医生" align="center" prop="sqys" :formatter="formatDict('SRD')" show-overflow-tooltip />
<el-table-column label="序号" align="center" prop="xh" show-overflow-tooltip />
<el-table-column label="数量" align="center" prop="sl" show-overflow-tooltip />
<el-table-column label="单价" align="center" prop="dj" show-overflow-tooltip />
<el-table-column label="状态" align="center" prop="zt" show-overflow-tooltip />
<el-table-column label="计价" align="center" prop="jjzt">
<template #default="scope">
<el-checkbox :model-value="scope.row.jjzt === '1'" disabled>
</el-checkbox>
</template>
</el-table-column>
<el-table-column label="病人代号" align="center" prop="brdh" show-overflow-tooltip />
<el-table-column label="备注1" align="center" prop="detailBZ1" show-overflow-tooltip />
<el-table-column label="备注2" align="center" prop="detailBZ2" show-overflow-tooltip />
<el-table-column label="颜色" align="center" prop="cp_color" v-if="false" show-overflow-tooltip />
<el-table-column label="确认标识" align="center" prop="cp_cflag" v-if="false" show-overflow-tooltip />
<el-table-column label="科室" align="center" prop="ksdh" :formatter="formatDict('DP')" show-overflow-tooltip />
<el-table-column label="病人类型" align="center" prop="brly" :formatter="formatDict('PT')" show-overflow-tooltip />
<el-table-column label="性别" align="center" prop="brxb" :formatter="formatDict('SX')" show-overflow-tooltip />
<el-table-column label="生日" align="center" prop="brsr" width="180" show-overflow-tooltip>
<template #default="scope">
<span>{{ parseTime(scope.row.brsr, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="床号" align="center" prop="ch" width="50" show-overflow-tooltip />
<el-table-column label="诊断" align="center" prop="zd" width="150" show-overflow-tooltip />
<el-table-column label="条码类别" align="center" prop="bgddh" v-if="false" show-overflow-tooltip />
<el-table-column label="年龄" align="center" prop="nl" show-overflow-tooltip />
<el-table-column label="年龄单位" align="center" prop="nldw" :formatter="formatDict('AU')" show-overflow-tooltip />
<el-table-column label="采样时间" align="center" prop="cysj" width="180" show-overflow-tooltip>
<template #default="scope">
<span>{{ parseTime(scope.row.cysj, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<!-- 汇总行 -->
<div class="table-summary">
@ -172,6 +142,7 @@ import {
printBarcodeall
} from "@/api/mzcx/cydj.js";
import PatSearchDialog from './components/OutPatList.vue'
import { classCom } from '@/utils/classCom';
const comDict = inject('comDict');
// 字典数据存储
const dictData = ref({});
@ -190,9 +161,9 @@ const idsnew = computed(() => {
});
const single = ref(true);
const freesingle = ref(true);
const cardtypeOptions = ref([{"label": "就诊卡","value": 1},{"label": "医保卡","value": 2},{"label": "电子医保卡","value": 3},{"label": "身份证", "value": 4}])
const showconfirmOptions = ref([{"label": "未打印", "value": 1},{"label": "已打印", "value": 11}])
const subdayOptions = ref([{"label": "1天","value": 1},{"label": "3天", "value": 3},{"label": "1周","value": 7},{"label": "2周","value": 14},{"label": "1月", "value": 30},{"label": "3月", "value": 90},{"label": "1年","value": 365},{"label": "2年","value": 730}])
const cardtypeOptions = ref([{ "label": "就诊卡", "value": 1 }, { "label": "医保卡", "value": 2 }, { "label": "电子医保卡", "value": 3 }, { "label": "身份证", "value": 4 }])
const showconfirmOptions = ref([{ "label": "未打印", "value": 1 }, { "label": "已打印", "value": 11 }])
const subdayOptions = ref([{ "label": "1天", "value": 1 }, { "label": "3天", "value": 3 }, { "label": "1周", "value": 7 }, { "label": "2周", "value": 14 }, { "label": "1月", "value": 30 }, { "label": "3月", "value": 90 }, { "label": "1年", "value": 365 }, { "label": "2年", "value": 730 }])
const data = reactive({
form: {},
@ -203,7 +174,7 @@ const data = reactive({
klx: null,
zt: 1,
subday: 3000,
cardtype:null
cardtype: null
},
rules: {
brdh: [
@ -232,7 +203,7 @@ const handleSelect = (selection, row, selected) => {
// 先收集需要自动勾选的行(避免在循环中修改数据)
const rowsToSelect = reqmainList.value.filter(
item => item.sqh === targetSqh && item.xh !== targetxh
item => item.sqh === targetSqh && item.xh !== targetxh
);
// 如果有需要自动勾选的行,才开启标志位
@ -246,10 +217,10 @@ const handleSelect = (selection, row, selected) => {
}
};
// 字典格式化方法
const formatDict =(dictType) => {
const formatDict = (dictType) => {
return (row, column, value) => {
// 从全局字典中获取映射值
return dictData.value[dictType].find(item => String(item.value) === String(value).trim())?.label||value ;
return dictData.value[dictType].find(item => String(item.value) === String(value).trim())?.label || value;
};
};
// 定义“空数据”的判断函数
@ -277,30 +248,30 @@ function getDateOffset(days) {
const year = targetDate.getFullYear();
const month = String(targetDate.getMonth() + 1).padStart(2, '0');
const day = String(targetDate.getDate()).padStart(2, '0');
// const hours = String(targetDate.getHours()).padStart(2, '0');
// const minutes = String(targetDate.getMinutes()).padStart(2, '0');
// const hours = String(targetDate.getHours()).padStart(2, '0');
// const minutes = String(targetDate.getMinutes()).padStart(2, '0');
//const seconds = String(targetDate.getSeconds()).padStart(2, '0');
// return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
// return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
return `${year}-${month}-${day} 00:00:00`;
}
function getSubday() {
const days=0 - queryParams.value.subday;
queryParams.value.stime=getDateOffset(days);
queryParams.value.etime=getDateOffset(1);
const days = 0 - queryParams.value.subday;
queryParams.value.stime = getDateOffset(days);
queryParams.value.etime = getDateOffset(1);
}
/** 查询采样登记列表 */
function getList() {
freesingle.value=true;
if(isEmptyData(queryParams.value.brdh)) proxy.$modal.alert("请刷卡或输入门诊号!");
freesingle.value = true;
if (isEmptyData(queryParams.value.brdh)) proxy.$modal.alert("请刷卡或输入门诊号!");
else {
loading.value = true;
getSubday();
querySQD(queryParams.value).then(response => {
if (isEmptyData(response.data)) proxy.$modal.alert("没有检索的数据!");
reqmainList.value = response.data;
// console.log('response:', response.data);
// console.log('response:', response.data);
loading.value = false;
single.value=false;
single.value = false;
// 新增:数据加载完成后触发全选
// 延迟执行(确保DOM已更新)
setTimeout(() => {
@ -314,8 +285,8 @@ function getList() {
// 取消按钮
function cancel() {
// open.value = false;
// reset();
// open.value = false;
// reset();
}
// 表单重置
@ -360,8 +331,8 @@ function reset() {
zd: null,
cysj: null
};
freesingle.value=false;
single.value=false;
freesingle.value = false;
single.value = false;
proxy.resetForm("reqmainRef");
}
@ -376,8 +347,8 @@ function readCard() {
// 处理病人选择事件
const handlePatientSelect = (patient) => {
// console.log('选中的病人:', patient);
queryParams.value.brdh=patient
// console.log('选中的病人:', patient);
queryParams.value.brdh = patient
// 处理选中的病人数据
handleQuery();
};
@ -404,7 +375,7 @@ function printSigne(row) {
printBarcodeall(idsnew.value).then(response => {
proxy.$modal.msgSuccess("打印成功");
open.value = false;
freesingle.value=false;
freesingle.value = false;
}).catch(() => {
});
}
@ -412,16 +383,16 @@ function printSigne(row) {
/** 打印回单 */
function printBack(row) {
if (idsnew.value.length === 0) {
return;
}
if (idsnew.value.length === 0) {
return;
}
//console.log('idsnew:', idsnew.value)
printBackpaper(idsnew.value).then(response => {
proxy.$modal.msgSuccess("打印成功");
open.value = false;
}).catch(() => {
});
}
proxy.$modal.msgSuccess("打印成功");
open.value = false;
}).catch(() => {
});
}
const totalRows = computed(() => {
@ -439,8 +410,8 @@ const totalPrice = computed(() => {
// 组件挂载时加载字典
onMounted(async () => {
// 加载病人来源字典
const dictRefs = await comDict('PT', 'DP', 'SRD','BT','SX','AU');
// 从 ref 中获取实际数据
const dictRefs = await comDict('PT', 'DP', 'SRD', 'BT', 'SX', 'AU');
// 从 ref 中获取实际数据
dictData.value = {
PT: toRaw(dictRefs.PT.value) || [],
DP: toRaw(dictRefs.DP.value) || [],
@ -458,9 +429,9 @@ const tableCellStyle = ({ row, column }) => {
// 只对“项目类别”列生效
if (column.label === '项目类别') {
// 1. 转换颜色(十进制→十六进制)
const bgColor = decimalToHexColor(row.cp_color);
const bgColor = classCom.decimalToHexColor(row.cp_color);
// 2. 自动计算文字颜色(确保和背景色对比度足够)
const textColor = getContrastTextColor(bgColor);
const textColor = classCom.getContrastTextColor(bgColor);
return {
backgroundColor: bgColor, // 背景色(转换后的值)
@ -472,39 +443,6 @@ const tableCellStyle = ({ row, column }) => {
return {}; // 其他列保持默认样式
};
// 十进制颜色值转十六进制颜色码(适配BGR转RGB)
const decimalToHexColor = (decimal) => {
if (!decimal && decimal !== 0) return '#FFFFFF'; // 空值默认白色
// 1. 十进制转十六进制(去除前缀0x,大写)
let hex = parseInt(decimal, 10).toString(16).toUpperCase();
// 2. 不足6位则前面补0(确保是6位)
if (hex.length < 6) {
hex = hex.padStart(6, '0'); // 例如:192→"C0"→补0为"0000C0"
}
// 3. BGR转RGB(反转字节顺序:前两位和后两位交换)
// 例:80FFFF → 拆分为80、FF、FF → 反转后FF、FF、80 → FFFF80
const r = hex.substring(4, 6); // 取后两位
const g = hex.substring(2, 4); // 取中间两位
const b = hex.substring(0, 2); // 取前两位
const rgbHex = r + g + b;
return `#${rgbHex}`; // 最终颜色码
};
// 辅助函数:根据背景色计算文字颜色(黑/白)
const getContrastTextColor = (bgColor) => {
// 提取RGB值(如#FFFF80 → R=255, G=255, B=128)
const r = parseInt(bgColor.slice(1, 3), 16);
const g = parseInt(bgColor.slice(3, 5), 16);
const b = parseInt(bgColor.slice(5, 7), 16);
// 计算亮度(标准公式)
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
// 亮度>0.5用黑色,否则用白色(确保清晰)
return luminance > 0.5 ? '#333333' : '#FFFFFF';
};
</script>
@ -512,21 +450,31 @@ const getContrastTextColor = (bgColor) => {
.app-container {
display: flex;
flex-direction: column;
height: 90vh; /* 容器高度等于窗口高度 */
height: 90vh;
/* 容器高度等于窗口高度 */
overflow: hidden;
}
.compact-form {
height: 75px; /* 固定高度 */
height: 75px;
/* 固定高度 */
}
.mb8 {
height: 30px; /* 固定高度 */
height: 30px;
/* 固定高度 */
}
.table-summary{
height: 10px; /* 固定高度 */
.table-summary {
height: 10px;
/* 固定高度 */
}
.table-container {
flex: 1; /* 占满剩余高度 */
overflow: hidden; /* 避免表格超出容器 */
flex: 1;
/* 占满剩余高度 */
overflow: hidden;
/* 避免表格超出容器 */
}
.compact-form .el-form-item {
@ -537,22 +485,32 @@ const getContrastTextColor = (bgColor) => {
.compact-form .el-form-item__label {
padding-bottom: 0px;
}
::v-deep .my-table .el-table__row td {
padding: 1px 0; /* 减小行高 */
padding: 1px 0;
/* 减小行高 */
}
::v-deep .my-table .el-table__header-wrapper th {
padding: 6px 0; /* 表头内边距 */
background-color: #b3d8ff !important; /* 表头背景色(保留之前的设置) */
color: #333; /* 文字颜色加深,提升可读性 */
font-weight: 500; /* 文字加粗 */
padding: 6px 0;
/* 表头内边距 */
background-color: #b3d8ff !important;
/* 表头背景色(保留之前的设置) */
color: #333;
/* 文字颜色加深,提升可读性 */
font-weight: 500;
/* 文字加粗 */
}
::v-deep .my-table .el-table__cell {
padding: 0 2px; /* 减小列间距 */
padding: 0 2px;
/* 减小列间距 */
}
/* 可选:调整表格整体样式 */
::v-deep .my-table {
font-size: 13px; /* 适当减小字体 */
font-size: 13px;
/* 适当减小字体 */
}
::v-deep .my-table .el-table__cell,
@ -560,17 +518,25 @@ const getContrastTextColor = (bgColor) => {
border-width: 1px;
border-color: #ebeef5;
}
.card-content {
max-height: 450px; /* 设置最大高度 */
overflow-y: auto; /* 超出高度时显示垂直滚动条 */
padding: 5px; /* 保持与卡片默认一致的内边距 */
max-height: 450px;
/* 设置最大高度 */
overflow-y: auto;
/* 超出高度时显示垂直滚动条 */
padding: 5px;
/* 保持与卡片默认一致的内边距 */
}
.clickable:hover {
cursor: pointer; /* 鼠标悬停时显示手型 */
transition: all 0.3s; /* 平滑过渡效果 */
cursor: pointer;
/* 鼠标悬停时显示手型 */
transition: all 0.3s;
/* 平滑过渡效果 */
color: blue;
}
/* 汇总行样式 */
.table-summary {
display: flex;
@ -582,7 +548,9 @@ const getContrastTextColor = (bgColor) => {
border: 1px solid #ebeef5;
border-radius: 4px;
font-weight: 500;
line-height: 24px; /* 汇总行文字行高 */
line-height: 24px;
/* 汇总行文字行高 */
.summary-item {
display: flex;
align-items: center;
@ -596,12 +564,16 @@ const getContrastTextColor = (bgColor) => {
.summary-value {
color: #303133;
min-width: 40px;
text-align: left;/* 核心:数值左对齐 */
text-align: left;
/* 核心:数值左对齐 */
}
/* 单独设置"单价合计"的值为红色 */
&:nth-child(3) .summary-value {
color: #f56c6c; /* Element UI 红色主题色 */
font-weight: 600; /* 可选:加粗字体 */
color: #f56c6c;
/* Element UI 红色主题色 */
font-weight: 600;
/* 可选:加粗字体 */
}
}
}