|
@@ -40,7 +40,7 @@
|
|
|
</el-button>
|
|
|
</HcTooltip>
|
|
|
<HcTooltip keys="other-first-item-down-print">
|
|
|
- <el-button hc-btn :disabled="tableSelectionKeys.length <= 0">
|
|
|
+ <el-button hc-btn :disabled="tableSelectionKeys.length <= 0" :loading="printLoading" @click="batchPrint">
|
|
|
<HcIcon name="printer"/>
|
|
|
<span>预览/打印</span>
|
|
|
</el-button>
|
|
@@ -655,6 +655,25 @@ const showReportFinish = () => {
|
|
|
showReportModal.value = false
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+//打印
|
|
|
+const printLoading = ref(false)
|
|
|
+const batchPrint = async () => {
|
|
|
+ const rows = tableSelectionKeys.value;
|
|
|
+ const ids = rowsToId(rows)
|
|
|
+ //批量下载
|
|
|
+ printLoading.value = true
|
|
|
+ const { error, code, data } = await firstApi.batchPrint({
|
|
|
+ ids: ids
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ printLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ console.log(data)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//拼接ID
|
|
|
const rowsToId = (rows) => {
|
|
|
return rows.map((obj) => {
|