7/17 添加公区收益

This commit is contained in:
Zy
2026-07-21 17:32:22 +08:00
parent 37970c547b
commit 0c4c9676b5
41 changed files with 1583 additions and 132 deletions

View File

@@ -34,13 +34,15 @@
</el-col>
<el-col :span="14"> </el-col>
<el-col :span="5" style="text-align: right">
<el-button type="warning" @click="exportCurrentPage">导出当前页</el-button>
<el-button type="warning" @click="exportAll">导出所有</el-button>
<el-button type="primary" @click="exportCurrentPage">导出当前页</el-button>
<el-button type="primary" @click="exportAll">导出所有</el-button>
<el-button type="primary" @click="exportChecked">导出选中</el-button>
</el-col>
</el-row>
</template>
<el-table v-loading="loading" border :data="itemList">
<el-table v-loading="loading" border :data="itemList" @selectionChange="handleChange">
<el-table-column type="selection" width="55" />
<el-table-column label="日期" width="100" align="center" prop="statDate" />
<el-table-column label="计划巡检任务" width="120" align="center" prop="totalPlans" />
<el-table-column label="按时完成" align="center" prop="completedTasks" />
@@ -125,6 +127,26 @@ const exportAll = () => {
`巡检月报_${new Date().toLocaleString()}.xlsx`
);
};
const multipleSelection = ref([]);
function handleChange(val) {
multipleSelection.value = val;
}
const exportChecked = () => {
if (multipleSelection.value.length > 0) {
const listValue = multipleSelection.value.map((item) => item.id);
console.log(listValue);
proxy?.download(
'/inspection/data/export/selected',
{
list: listValue.join(','),
dataType: '3'
},
`巡检月报_选中${listValue.length}条数据_${new Date().toLocaleString()}.xlsx`
);
} else {
ElMessage.warning('请选择数据');
}
};
onMounted(() => {
getList();
});