diff --git a/src/views/modules/print/rePrintPoPart.vue b/src/views/modules/print/rePrintPoPart.vue index a31abd0..f868c7e 100644 --- a/src/views/modules/print/rePrintPoPart.vue +++ b/src/views/modules/print/rePrintPoPart.vue @@ -147,6 +147,24 @@ @click="freezeStatus"> 冻结 + + + 导出 + + @@ -962,7 +980,13 @@ export default { labelTemplateList: [], printerList: [], printLoading: false, - multiPartNoTip: '' + multiPartNoTip: '', + // 导出相关 + exportData: [], + exportName: "实时库存数据", + exportHeader: ["实时库存数据"], + exportFooter: [], + exportLoading: false } }, components: { @@ -1455,6 +1479,42 @@ export default { } }).catch() }) + }, + // 导出相关方法 + exportFields() { + let json = {} + this.columnList.forEach((item) => { + json[item.columnLabel] = item.columnProp + }) + return json + }, + async createExportData() { + // 构建查询参数,获取所有数据(不分页) + const params = { + ...this.searchData, + page: 1, + limit: 999999 // 获取所有数据 + } + try { + const {data} = await getKuCunLabelData(params) + if (data.code === 0) { + return data.page.list || [] + } else { + this.$message.error('获取导出数据失败') + return [] + } + } catch (error) { + this.$message.error('获取导出数据失败:' + error.message) + return [] + } + }, + startDownload() { + this.exportLoading = true + this.exportName = "实时库存数据_" + this.dayjs().format('YYYYMMDDHHmmss') + }, + finishDownload() { + this.exportLoading = false + this.$message.success('导出成功') } }, created() { @@ -1654,6 +1714,24 @@ export default { border-color: #ebb563; } +/* 导出按钮样式 */ +.export-btn { + display: inline-block; +} + +.export-btn .el-button { + border-radius: 4px; + padding: 5px 10px; + font-size: 12px; + font-weight: 500; + transition: all 0.3s ease; +} + +.export-btn .el-button:hover { + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); +} + /* 响应式设计 */ @media (max-width: 1200px) { .search-actions {