|
@@ -69,9 +69,15 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
icon="icon icon-export-white"
|
|
|
- @click="toBatchDownload"
|
|
|
+ @click="toBatchDownloadCardPdf"
|
|
|
>批量下载
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="icon icon-export-white"
|
|
|
+ @click="toBatchDownloadPackage"
|
|
|
+ >数据包下载
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -240,6 +246,7 @@ import {
|
|
|
cardConfigInfos,
|
|
|
cardTemplateDetail,
|
|
|
cardDownloadApi,
|
|
|
+ cardPackageDownloadApi,
|
|
|
} from "../api";
|
|
|
import ImportFileDialog from "@/components/ImportFileDialog.vue";
|
|
|
import ModifyCard from "../components/ModifyCard.vue";
|
|
@@ -448,12 +455,19 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
- toBatchDownload() {
|
|
|
+ toBatchDownloadCardPdf() {
|
|
|
if (!this.selectedIds.length) {
|
|
|
this.$message.error("请选择数据");
|
|
|
return;
|
|
|
}
|
|
|
- this.toDownload(this.selectedIds);
|
|
|
+ this.toDownloadCardPdf(this.selectedIds);
|
|
|
+ },
|
|
|
+ toBatchDownloadPackage() {
|
|
|
+ if (!this.selectedIds.length) {
|
|
|
+ this.$message.error("请选择数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.toDownloadPackage(this.selectedIds);
|
|
|
},
|
|
|
async toBatchDelete() {
|
|
|
if (!this.selectedIds.length) {
|
|
@@ -523,7 +537,7 @@ export default {
|
|
|
this.$message.success("删除成功!");
|
|
|
this.deletePageLastItem();
|
|
|
},
|
|
|
- async toDownload(ids) {
|
|
|
+ async toDownloadCardPdf(ids) {
|
|
|
if (this.downloading) return;
|
|
|
this.downloading = true;
|
|
|
|
|
@@ -537,6 +551,20 @@ export default {
|
|
|
if (!res) return;
|
|
|
this.$message.success("下载成功!");
|
|
|
},
|
|
|
+ async toDownloadPackage(ids) {
|
|
|
+ if (this.downloading) return;
|
|
|
+ this.downloading = true;
|
|
|
+
|
|
|
+ const res = await downloadByApi(() => {
|
|
|
+ return cardPackageDownloadApi(ids);
|
|
|
+ }).catch((e) => {
|
|
|
+ this.$message.error(e || "下载失败,请重新尝试!");
|
|
|
+ });
|
|
|
+ this.downloading = false;
|
|
|
+
|
|
|
+ if (!res) return;
|
|
|
+ this.$message.success("下载成功!");
|
|
|
+ },
|
|
|
cacheSearchInfo() {
|
|
|
window.sessionStorage.setItem(
|
|
|
"card-mamange",
|