diff --git a/src/utils/classCom.ts b/src/utils/classCom.ts index 4819eb4..a76fcf7 100644 --- a/src/utils/classCom.ts +++ b/src/utils/classCom.ts @@ -1,3 +1,4 @@ +import { ref, onMounted, onUnmounted, Ref } from 'vue'; /** * 颜色处理工具类 @@ -104,9 +105,19 @@ function base64ToBlob(base64: string) { return new Blob([bytes], { type: 'application/pdf' }); } +// 计算两个日期的天数差(支持带时分秒) +const getDayDiff = (start: string, end: string): number => { + const startTime = new Date(start).getTime(); + const endTime = new Date(end).getTime(); + if (isNaN(startTime) || isNaN(endTime)) { + return -2; // -2 表示日期无效 + } + + const dayDiff = Math.ceil((endTime - startTime) / (24 * 60 * 60 * 1000)); + return dayDiff < 0 ? -1 : dayDiff; // -1 表示结束时间早于开始时间,>=0 为正常天数 +}; -import { ref, onMounted, onUnmounted, Ref } from 'vue'; /** * 自动根据屏幕分辨率切换按钮尺寸(small/default) @@ -150,4 +161,4 @@ function useAutoSize() { return autoSize; } -export const classCom = { decimalToHexColor, convertHexToNumber, getContrastTextColor, printBase64PDF, printPDF, useAutoSize } +export const classCom = { decimalToHexColor, convertHexToNumber, getContrastTextColor, printBase64PDF, printPDF, useAutoSize, getDayDiff } diff --git a/src/views/checkCode/index.vue b/src/views/checkCode/index.vue index 7718ee5..5569e1e 100644 --- a/src/views/checkCode/index.vue +++ b/src/views/checkCode/index.vue @@ -7,12 +7,12 @@ label-width="80px"> + style="width: 10rem;" @change="handletime" /> + @change="handletime" style="width: 10rem;" /> @@ -455,11 +453,11 @@ const cyColumns = ref([ // 表格配置 const cyTableConfig = ref({ border: true, // 边框 - height: '100%', // 高度 + height: '70vh', // 高度 highlightCurrentRow: true, // 高亮当前行 }) - +const sqhRef = useTemplateRef('sqhRef') // 采样登记 const openBlock = (value: string) => { @@ -495,8 +493,19 @@ const openBlock = (value: string) => { } else { title.value = value dialogVisible.value = true + + setTimeout(() => { + sqhRef.value?.focus() + }, 30); } } + +const closeHadnle = () => { + const selections = tableRef.value.allSelection() + if (selections.length <= 0) return ElMessage.warning('请选择数据!') + +} + // 采样读取 const sqdQuery = () => { const index = cyTableData.value.findIndex((item: any) => item.sqh == sqhText.value) @@ -509,9 +518,17 @@ const sqdQuery = () => { userid: queryParams.userid, status: 12, yljg: queryParams.yljg + }).then((res: any) => { + if (res.code == 0) { + cyTableData.value = cyTableData.value.concat(res.data) + } }) - cyTableData.value = cyTableData.value.concat(res.data) } + }).finally(() => { + sqhText.value = '' + nextTick(() => { + sqhRef.value?.focus() + }) }) } // 关闭弹窗清空 @@ -622,6 +639,7 @@ const timeDate = () => { } onMounted(async () => { + // 获取当前时间 7天内的数据 timeDate() queryParams.ksdh = (route.query.deptcode as string) ? (route.query.deptcode as string) : ''; diff --git a/src/views/statisticalAnalysis/applicationSingle/index.vue b/src/views/statisticalAnalysis/applicationSingle/index.vue new file mode 100644 index 0000000..e9b5a78 --- /dev/null +++ b/src/views/statisticalAnalysis/applicationSingle/index.vue @@ -0,0 +1,16 @@ +/** +* @file index.vue 申请单统计 +* @author: w +* @since: 2026-01-27 +*/ + + + + + + + + + \ No newline at end of file diff --git a/src/views/statisticalAnalysis/report/index.vue b/src/views/statisticalAnalysis/report/index.vue new file mode 100644 index 0000000..fde04bc --- /dev/null +++ b/src/views/statisticalAnalysis/report/index.vue @@ -0,0 +1,223 @@ +/** +* @file index.vue 报告统计 +* @author: w +* @since: 2026-01-27 +*/ + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 时间段: + + + + + {{ item.label }} + + + + + + + {{ formatDict(userStore.sysLoginParam.loginYLJG, 'HOS') }} + 工作量统计表 + + + + + + + + + + + \ No newline at end of file