From a3a75276ca9e7704407121b18a3c9ac1fcad8e40 Mon Sep 17 00:00:00 2001 From: wyuu Date: Mon, 2 Mar 2026 18:01:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/ruoyi.scss | 5 +- src/components/SelectTable/index.vue | 3 + src/hooks/lisData/dictData.ts | 5 + .../liswork/Issueorder/components/info.vue | 304 ++++++++++++++++++ src/views/liswork/Issueorder/index.vue | 144 +++++++++ .../statisticalAnalysis/report/index.vue | 118 +++++-- 6 files changed, 559 insertions(+), 20 deletions(-) create mode 100644 src/views/liswork/Issueorder/components/info.vue create mode 100644 src/views/liswork/Issueorder/index.vue diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss index c9cf9ce..d87144a 100644 --- a/src/assets/styles/ruoyi.scss +++ b/src/assets/styles/ruoyi.scss @@ -340,6 +340,7 @@ } .mytable-style { + .vxe-header--column { word-break: break-word; background-color: #1F6DD3 !important; @@ -359,7 +360,9 @@ padding: 0 !important; } - .vxe-table--render-default .vxe-body--column { + .vxe-table--render-default .vxe-body--column, + .vxe-footer--column, + .col--ellipsis { height: 1.875rem !important; line-height: 1.875rem !important; } diff --git a/src/components/SelectTable/index.vue b/src/components/SelectTable/index.vue index 2c19fe5..9f61dbf 100644 --- a/src/components/SelectTable/index.vue +++ b/src/components/SelectTable/index.vue @@ -58,6 +58,7 @@ import { ElEmpty } from 'element-plus'; import { comDict } from '@/utils/dict' import { getoptionselect } from '@/api/liswork/xtwh/localconfigApi' import { Emits, Props } from '@/types'; +import { getOptionSelect } from '@/hooks' const props = withDefaults(defineProps(), { placeholder: "请选择", @@ -175,6 +176,8 @@ const initData = async () => { })); dictRefs[props.dictType] = { value: dictList }; + + getOptionSelect(props.dictType, dictList); } else { dictRefs = await comDict(props.dictType); } diff --git a/src/hooks/lisData/dictData.ts b/src/hooks/lisData/dictData.ts index 10c2e2f..01c09d3 100644 --- a/src/hooks/lisData/dictData.ts +++ b/src/hooks/lisData/dictData.ts @@ -39,6 +39,11 @@ export const formatDict = (v: string, dictType: string) => { ); }; +// 通用接口获取的字典数据赋值方法 +export const getOptionSelect = (dictType: string, list: any[]) => { + dictData.value[dictType] = list || []; +}; + //仪器格式化方法 export const formatInstr = (v: string) => { return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc || v; diff --git a/src/views/liswork/Issueorder/components/info.vue b/src/views/liswork/Issueorder/components/info.vue new file mode 100644 index 0000000..afa3651 --- /dev/null +++ b/src/views/liswork/Issueorder/components/info.vue @@ -0,0 +1,304 @@ + + + + \ No newline at end of file diff --git a/src/views/liswork/Issueorder/index.vue b/src/views/liswork/Issueorder/index.vue new file mode 100644 index 0000000..2070287 --- /dev/null +++ b/src/views/liswork/Issueorder/index.vue @@ -0,0 +1,144 @@ +/** +* @file index.vue 科内开单 +* @author: w +* @since: 2026-03-02 +*/ + + + + + + \ No newline at end of file diff --git a/src/views/statisticalAnalysis/report/index.vue b/src/views/statisticalAnalysis/report/index.vue index 9f1455a..a25a666 100644 --- a/src/views/statisticalAnalysis/report/index.vue +++ b/src/views/statisticalAnalysis/report/index.vue @@ -46,20 +46,22 @@ - - - - @@ -118,9 +120,33 @@ const handletime = () => { // if (dayDiff === -1 || dayDiff === -2) return ElMessage.warning('请选择有效的日期范围'); } +const getSummaries = ({ columns, data }) => { + + const sumSamplecnt = tableData.value.reduce((sum, item) => sum + item.cp_samplecnt, 0) + const sumCnt = tableData.value.reduce((sum, item) => sum + item.cp_cnt, 0) + const sumAmt = tableData.value.reduce((sum, item) => sum + item.cp_amt, 0).toFixed(2) + + // 2. 定义合计行每一列的内容 + const footerData = columns.map((column, index) => { + switch (column.field) { + case tableColumns.value[0].prop: // 第一列显示“合计” + return '合计' + case 'cp_samplecnt': + return sumSamplecnt + case 'cp_cnt': + return sumCnt + case 'cp_amt': + return sumAmt + default: + return '' // 其他列空值 + } + }) + + return [footerData] +}; + const search = () => { const checkedCols = [...coloums.value, ...checkBoxs.value]; - console.log('checkedCols==>', checkedCols); const arr = []; tableColumns.value.forEach((tableItem, tableIndex) => { @@ -130,7 +156,7 @@ const search = () => { if (matchItem) { arr.push({ ...matchItem, - paramSort: tableIndex, + paramSequence: matchItem.paramSequence ? matchItem.paramSequence : tableIndex + 1, }); } }); @@ -140,10 +166,7 @@ const search = () => { ); unmatchedItems.forEach((item, unmatchIndex) => { - arr.push({ - ...item, - paramSort: tableColumns.value.length + unmatchIndex, - }); + arr.push({ ...item, }); }); const data = { @@ -151,9 +174,11 @@ const search = () => { Column: arr, Template: Template.value }; - console.log('data==>', data); + loading.value = true; getstatsQuery(data).then(res => { tableData.value = res.data + }).finally(() => { + loading.value = false; }) }; @@ -164,16 +189,15 @@ const handleCheckBoxChange = (val) => { const checkedCols = val.map(paramCode => { const matchItem = checkBoxs.value.find(item => item.paramCode === paramCode); - return matchItem ? { label: matchItem.paramName, prop: matchItem.paramCode } : null; + return matchItem ? { label: matchItem.paramName, prop: matchItem.paramCode, dictType: matchItem.remark } : null; }).filter(Boolean); // 过滤null - const fixedCols = coloums.value.map(item => ({ label: item.paramName, prop: item.paramCode, + dictType: item.remark, })); - tableColumns.value = [...checkedCols, ...fixedCols]; } @@ -186,6 +210,7 @@ const getParams = () => { key: item.paramCode, label: item.paramName, prop: item.paramCode, + dictType: item.remark, } }) @@ -229,7 +254,7 @@ onMounted(() => { .table-container { margin-top: 10px; - height: calc(100% - 80px); + height: calc(100% - 100px); } .tips { @@ -237,4 +262,59 @@ onMounted(() => { color: #3282F6; margin-bottom: 5px; } + +:deep(.el-table__footer-wrapper tfoot td.el-table__cell) { + color: #1f6dd3 !important; + font-weight: 700; + /* 可替换为任意颜色值 */ +} + + +:deep(.vxe-header--row th) { + border-color: #1F6DD3; + background-color: #1F6DD3; + color: #fff; +} + +:deep(.vxe-body--row td) { + border-color: #1F6DD3; +} + +:deep(.vxe-table--row-hover) { + background-color: #1F6DD3; +} + +:deep(.vxe-table--current-row) { + background-color: #1F6DD3; +} + +:deep(.el-table-header-cell) { + cursor: move; + user-select: none; +} + +// 表格边框 +:deep(.vxe-table--render-default.border--full .vxe-body--column) { + background-image: linear-gradient(#96B8D9, #96B8D9), linear-gradient(#96B8D9, #96B8D9) !important; +} + +// 表头边框 +:deep(.vxe-table--render-default.border--full .vxe-header--column) { + background-image: linear-gradient(#1F6DD3, #1F6DD3), linear-gradient(#1F6DD3, #1F6DD3) !important; +} + +:deep(.vxe-table--render-default.is--padding .vxe-body--column:not(.col--ellipsis)) { + padding: 0 !important; +} + +:deep(.vxe-table--render-default .vxe-footer--column:not(.col--ellipsis)) { + padding: 0 !important; + color: #1f6dd3 !important; + font-weight: 700; +} + +:deep(.vxe-header--gutter), +:deep(.col--gutter) { + display: none !important; +} \ No newline at end of file