模板统计

This commit is contained in:
wyuu 2026-07-13 16:08:26 +08:00
parent 3eb9a9d9f1
commit 6f7f7a1d09

View File

@ -19,6 +19,35 @@
<template v-for="item in Parameter">
<el-form-item :label="item.paramOptiontype == '0' ? '' : item.paramName"
:class="{ 'checkbox-form-item': item.paramOptiontype == '0' }">
<template v-if="item.paramOptiontype == '0'">
<el-checkbox v-model="item.paramDefvalue" :label="item.paramName" true-value="1" false-value="0" />
</template>
<template v-if="item.paramOptiontype == '1'">
<el-select v-model="item.paramDefvalue" style="width:120px">
<el-option v-for="item in item.remark" :label="item.label" :value="item.value" />
</el-select>
</template>
<template v-if="item.paramOptiontype == '2'">
<SelectTable v-model:data="item.paramDefvalue" :dictType="item.remark" :optionselect="true"
placeholder="请选择" style="width:150px" size="small" />
</template>
<template v-if="item.paramOptiontype == '3'">
<el-select v-model="item.paramDefvalue" multiple filterable style="width:200px">
<el-option v-for="item in dictData[item.remark]" :label="item.label" :value="item.value" />
</el-select>
</template>
<template v-if="item.paramOptiontype == '4'">
<!-- 特殊处理 -->
</template>
<template v-if="item.paramOptiontype == '5'">
<el-input v-model="item.paramDefvalue" placeholder="请输入" />
</template>
<template v-if="item.paramOptiontype == '6'">
<el-input v-model="item.paramDefvalue" type="number" placeholder="请输入" />
</template>
<template v-if="item.paramOptiontype == '7'">
<el-date-picker v-model="item.paramDefvalue" type="date" format="YYYY-MM-DD"
value-format="YYYY-MM-DD" @change="handletime" style="width:120px" />
@ -28,15 +57,6 @@
<el-time-picker v-model="item.paramDefvalue" value-format="HH:mm:ss" format="HH:mm:ss"
style="width:100px" />
</template>
<template v-if="item.paramOptiontype == '2'">
<SelectTable v-model:data="item.paramDefvalue" :dictType="item.remark" :optionselect="true"
placeholder="请选择" style="width:150px" size="small" />
</template>
<template v-if="item.paramOptiontype == '0'">
<el-checkbox v-model="item.paramDefvalue" :label="item.paramName" true-value="1" false-value="0" />
</template>
</el-form-item>
</template>
</div>
@ -58,16 +78,16 @@
</el-col>
</el-row>
</el-form>
<!-- statsType==1 查询表格 0 统计 -->
<div class="print_box">
<div class="print_content">
<div class="title">{{ formatDict(userStore.sysLoginParam.loginYLJG, 'HOS') }}</div>
<div class="print_content" :style="{ width: Template.statsType == 1 ? '100%' : '70%' }">
<div class="title" v-if="statsTitle">{{ formatDict(userStore.sysLoginParam.loginYLJG, 'HOS') }}</div>
<div class="content">{{ statsTitle }}</div>
<div class="table-container bb_table">
<div class="table-container bb_table" :style="{ height: `calc(100% - ${statsTitle ? '70px' : '15px'})` }">
<vxe-table :data="tableData" border v-loading="loading" height="100%"
:tooltip-config="{ appendToBody: true, zIndex: 3000 }" show-footer :footer-method="getSummaries"
:scroll-y="{ enabled: true, rSize: 30, height: '100%', }" show-footer-overflow>
<vxe-column v-for="col in tableColumns" :key="col.prop" :title="col.label" :field="col.prop" width="100"
<vxe-column v-for="col in tableColumns" :key="col.prop" :title="col.label" :field="col.prop" width="120"
show-overflow align="center">
<template #default="scope">
{{ col.dictType ? formatDict(scope.row[col.prop], col.dictType) : scope.row[col.prop] }}
@ -80,7 +100,7 @@
<!-- 视觉移出屏幕,页面看不见,但DOM完整存在用于iframe打印 -->
<div class="print-only-wrap" id="printWrap">
<div class="title">{{ formatDict(userStore.sysLoginParam.loginYLJG, 'HOS') }}</div>
<div class="title" v-if="!statsTitle">{{ formatDict(userStore.sysLoginParam.loginYLJG, 'HOS') }}</div>
<div class="content">{{ statsTitle }}</div>
<!-- 原生完整table,无滚动、无虚拟DOM,所有数据全部渲染 -->
<table class="print-table" border="1" cellpadding="0" cellspacing="0">
@ -127,7 +147,7 @@ const queryParams = ref({
statItems: []
})
const Parameter = ref([])
const statsTitle = ref('' || '报告统计')
const statsTitle = ref('')
const tableData = ref([])
const loading = ref(false)
const sumColoums = ref([]) //计算列
@ -374,6 +394,18 @@ const getParams = () => {
checkBoxs.value = res.data.Column.filter(item => item.paramSequence == 0) //选择列 paramSequence==0
Template.value = res.data.Template //模板
statsTitle.value = res.data.Template.statsTitle //统计标题
Parameter.value.forEach(item => {
// 如果是多选类型,则将字典数据转换为数组
if (item.paramOptiontype == 1 && item.remark) {
const obj = JSON.parse(item.remark);
item.remark = Object.entries(obj).map(([value, label]) => ({ label, value }));
}
if (item.paramOptiontype == 3 && item.remark) {
getDictData(item.remark)
}
})
})
};
@ -492,7 +524,6 @@ onMounted(() => {
}
.table-container {
height: calc(100% - 70px);
padding: 10px;
}