|
|
@ -147,6 +147,24 @@ |
|
|
@click="freezeStatus"> |
|
|
@click="freezeStatus"> |
|
|
冻结 |
|
|
冻结 |
|
|
</el-button> |
|
|
</el-button> |
|
|
|
|
|
<download-excel |
|
|
|
|
|
:fields="exportFields()" |
|
|
|
|
|
:data="exportData" |
|
|
|
|
|
type="xls" |
|
|
|
|
|
:name="exportName" |
|
|
|
|
|
:header="exportHeader" |
|
|
|
|
|
:footer="exportFooter" |
|
|
|
|
|
:fetch="createExportData" |
|
|
|
|
|
:before-generate="startDownload" |
|
|
|
|
|
:before-finish="finishDownload" |
|
|
|
|
|
worksheet="实时库存数据" |
|
|
|
|
|
class="export-btn"> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="success" |
|
|
|
|
|
icon="el-icon-download"> |
|
|
|
|
|
导出 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</download-excel> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
@ -962,7 +980,13 @@ export default { |
|
|
labelTemplateList: [], |
|
|
labelTemplateList: [], |
|
|
printerList: [], |
|
|
printerList: [], |
|
|
printLoading: false, |
|
|
printLoading: false, |
|
|
multiPartNoTip: '' |
|
|
|
|
|
|
|
|
multiPartNoTip: '', |
|
|
|
|
|
// 导出相关 |
|
|
|
|
|
exportData: [], |
|
|
|
|
|
exportName: "实时库存数据", |
|
|
|
|
|
exportHeader: ["实时库存数据"], |
|
|
|
|
|
exportFooter: [], |
|
|
|
|
|
exportLoading: false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
components: { |
|
|
components: { |
|
|
@ -1455,6 +1479,42 @@ export default { |
|
|
} |
|
|
} |
|
|
}).catch() |
|
|
}).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() { |
|
|
created() { |
|
|
@ -1654,6 +1714,24 @@ export default { |
|
|
border-color: #ebb563; |
|
|
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) { |
|
|
@media (max-width: 1200px) { |
|
|
.search-actions { |
|
|
.search-actions { |
|
|
|