From 8b7b700017523681c750cf74bf5ac2b831201e81 Mon Sep 17 00:00:00 2001 From: wyuu Date: Wed, 13 May 2026 17:50:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E8=BE=93=E5=85=A5=E3=80=81?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/batch/index.ts | 27 + src/utils/groupHelper.ts | 145 ++++ src/views/lisquery/reportQuery/index.vue | 17 +- .../liswork/Issueorder/components/info.vue | 299 ++++--- .../Issueorder/components/setBilling.vue | 192 ----- src/views/liswork/Issueorder/index.vue | 739 +++++++++++++----- src/views/liswork/advancedReview/index.vue | 3 +- src/views/liswork/backApply/index.vue | 69 +- src/views/liswork/batchAdjustment/index.vue | 2 +- src/views/liswork/batchCheck/index.vue | 25 +- src/views/liswork/batchEntry/index.vue | 116 ++- src/views/liswork/batchPrint/index.vue | 12 +- .../components/setBatch/index.vue | 42 +- .../components/setParams/index.vue | 4 +- .../components/setProject/index.vue | 2 +- .../components/setRule/index.vue | 2 +- .../components/setSample/index.vue | 36 +- src/views/liswork/qualityControl/index.vue | 5 +- .../setEnterResult/components/dateTime.vue | 2 +- .../setEnterResult/components/project.vue | 2 +- .../liswork/qualityControl/summary/index.vue | 4 +- src/views/liswork/receive/index.vue | 10 +- src/views/liswork/visaRefusal/index.vue | 8 +- src/views/liswork/xtwh/mzcxconfig/index.vue | 2 +- .../statistics/screenMonitor/index.vue | 10 +- 25 files changed, 1126 insertions(+), 649 deletions(-) create mode 100644 src/api/batch/index.ts create mode 100644 src/utils/groupHelper.ts delete mode 100644 src/views/liswork/Issueorder/components/setBilling.vue diff --git a/src/api/batch/index.ts b/src/api/batch/index.ts new file mode 100644 index 0000000..4b8cbd1 --- /dev/null +++ b/src/api/batch/index.ts @@ -0,0 +1,27 @@ +//@ts-ignore js语法检查忽略 +import request from '@/utils/request'; + +// 获取模版数据 +export function getInputMdl(query?: Object) { + return request({ + url: '/batchIn/getInputMdl', + method: 'get', + params: query, + }); +} +// 获取模版明细数据 +export function getInputMdlDetail(query?: Object) { + return request({ + url: '/batchIn/getInputMdlDetail', + method: 'get', + params: query, + }); +} +// 确认模版数据 +export function confirmInputMdl(query?: Object) { + return request({ + url: '/batchIn/confirmInputMdl', + method: 'post', + data: query, + }); +} \ No newline at end of file diff --git a/src/utils/groupHelper.ts b/src/utils/groupHelper.ts new file mode 100644 index 0000000..607d73b --- /dev/null +++ b/src/utils/groupHelper.ts @@ -0,0 +1,145 @@ + +// 定义通用类型 +interface GroupOriginValues { + [key: string]: string | number | null | undefined +} + +interface GroupMetaItem { + groupSeq: number + key: string + originValues: GroupOriginValues + itemCount: number + firstRowIndex: number | null +} +// @ts-ignore +interface GroupedItem extends T { + rowSeq: number // 组内行序号 + groupSeq?: number // 组序号(可选) +} + +interface GroupData { + groupSeq: number + key: string + originValues: GroupOriginValues + items: GroupedItem[] +} + +interface UseGroupTableDataReturn { + tableData: ComputedRef<(GroupedItem & { [key: string]: string | number | '' })[]> + groupMeta: ComputedRef + groupedData: ComputedRef[]> +} + +/** + * 通用多字段分组函数 + * @param rawList - 原始数据列表 + * @param groupFields - 分组字段(单个字段传字符串,多个传数组) + * @param showFields - 每组仅第一条显示的字段 + * @param sortField - 排序字段(默认按orderDate降序) + * @param originalData - 原始数据赋值字段(可选) + * @returns 表格渲染数据 + 分组元信息 + */ +export function useGroupTableData>( + rawList: string[], + groupFields: string, + showFields: string | string[], + sortField: string = 'orderDate', + originalData: string[] +): UseGroupTableDataReturn { + // 处理参数格式:确保为数组 + const groupFieldArr = Array.isArray(groupFields) ? groupFields : [groupFields] + const showFieldArr = Array.isArray(showFields) ? showFields : [showFields] + + // 1. 核心分组逻辑 + const groupedData = computed[]>(() => { + const groups: Record[] + }> = {} + + rawList.forEach((item: any) => { + // 生成分组key(多字段拼接,避免重复) + const groupKey = groupFieldArr.map(field => item[field] ?? '').join('_') + + if (!groups[groupKey]) { + groups[groupKey] = { + key: groupKey, + originValues: groupFieldArr.reduce((obj, field) => { + obj[field] = item[field] ?? '' + return obj + }, {} as GroupOriginValues), + items: [] + } + } + // 处理仅第一条显示的字段 + showFieldArr.forEach((field, i) => { + originalData.forEach((v, _i) => { + if (i == _i) { + item[field] = item[v] + } + }) + }) + // 添加组内行序号 + groups[groupKey].items.push({ + ...item, + rowSeq: groups[groupKey].items.length + 1 + }) + }) + + // 2. 按指定字段降序排序分组 + const sortedGroupKeys = Object.keys(groups).sort((a, b) => { + const aSortValue = groups[a].originValues[sortField] ?? '' + const bSortValue = groups[b].originValues[sortField] ?? '' + // 兼容日期/字符串/数字排序 + if (aSortValue && bSortValue && !isNaN(new Date(aSortValue).getTime())) { + return new Date(bSortValue).getTime() - new Date(aSortValue).getTime() + } + return String(bSortValue).localeCompare(String(aSortValue)) + }) + + // 3. 生成带组序号的分组数据 + return sortedGroupKeys.map((key, groupIndex) => ({ + groupSeq: groupIndex + 1, + ...groups[key] + })) + }) + + // 4. 构造扁平化表格数据 + const tableData = computed(() => { + const result: (GroupedItem & { [key: string]: string | number | '' })[] = [] + groupedData.value.forEach(group => { + group.items.forEach((item, idx) => { + const processedItem = { ...item } + + // 处理仅第一条显示的字段 + showFieldArr.forEach(field => { + processedItem[field] = idx === 0 ? (item[field] ?? '') : '' + }) + + // 组序号仅每组第一条显示 + processedItem.groupSeq = idx === 0 ? group.groupSeq : '' + + result.push(processedItem) + }) + }) + return result + }) + + // 5. 生成分组元信息(用于合并单元格) + const groupMeta = computed(() => { + return groupedData.value.map(group => ({ + groupSeq: group.groupSeq, + key: group.key, + originValues: group.originValues, + itemCount: group.items.length, + firstRowIndex: null + })) + }) + + return { + tableData, + groupMeta, + groupedData + } +} \ No newline at end of file diff --git a/src/views/lisquery/reportQuery/index.vue b/src/views/lisquery/reportQuery/index.vue index a863a4e..1909f81 100644 --- a/src/views/lisquery/reportQuery/index.vue +++ b/src/views/lisquery/reportQuery/index.vue @@ -117,9 +117,9 @@   -   + @change="handletime" style="width: 46%" />   -   + @change="handletime" style="width: 46%" /> @@ -137,22 +137,15 @@   - - - - 搜索 - - - -
+ 搜索 勾选所有未打印 - 打印报告 - 编辑 + 打印报告 + 编辑
diff --git a/src/views/liswork/Issueorder/components/info.vue b/src/views/liswork/Issueorder/components/info.vue index d755b3f..4e789c5 100644 --- a/src/views/liswork/Issueorder/components/info.vue +++ b/src/views/liswork/Issueorder/components/info.vue @@ -1,117 +1,102 @@ @@ -251,26 +280,29 @@ onMounted(() => { } - - .compact-form { + .left-form { flex: 1; position: relative; height: 100%; overflow-y: auto; overflow-x: hidden; - + padding-top: 5px; .el-form-item { - margin-bottom: 0px; + margin-bottom: 8px; } - .el-form-item__label { + :deep(.el-form-item__label) { padding-bottom: 0px; color: #08355E; - font-size: 12px; + font-size: .875rem !important; } + :deep(.el-form-item__label:before) { + margin-right: 0 !important; + } + :deep(.el-form-item--default .el-form-item__label) { height: 27px !important; line-height: 27px !important; @@ -292,4 +324,51 @@ onMounted(() => { color: #08355E; } } + + +.sh_box { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0); + z-index: 9; + display: flex; + justify-content: center; + align-items: center; + writing-mode: vertical-rl; + font-weight: 500; + font-size: 100px; + + .text { + font-style: italic; + } + + // pointer-events: none; +} + +.cs_color { + color: rgba(40, 189, 187, 0.25); +} + +.sh_color { + color: rgba(238, 8, 8, 0.25); +} + +.cb_color { + color: rgba(0, 128, 0, 0.25); +} + +.eb_color { + color: rgba(255, 165, 0, 0.25); +} + +.sd_color { + color: rgb(233, 126, 32, .25); +} + +.default { + color: rgba(40, 189, 187, 0.25); +} \ No newline at end of file diff --git a/src/views/liswork/Issueorder/components/setBilling.vue b/src/views/liswork/Issueorder/components/setBilling.vue deleted file mode 100644 index 852ddcb..0000000 --- a/src/views/liswork/Issueorder/components/setBilling.vue +++ /dev/null @@ -1,192 +0,0 @@ -/** -* @file setBilling.vue 开单项目设置 -* @author: w -* @since: 2026-03-05 -*/ - - - - - \ No newline at end of file diff --git a/src/views/liswork/Issueorder/index.vue b/src/views/liswork/Issueorder/index.vue index 724b63f..d267c7a 100644 --- a/src/views/liswork/Issueorder/index.vue +++ b/src/views/liswork/Issueorder/index.vue @@ -1,108 +1,112 @@ /** * @file index.vue 科内开单 * @author: w -* @since: 2026-03-02 +* @since: 2026-03-09 */