电子档案文件导出修改
This commit is contained in:
parent
48b9317066
commit
b9474a15d1
|
|
@ -123,7 +123,7 @@
|
|||
</el-breadcrumb>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" v-if="showType==1" :data="tableDataList" @selection-change="handleSelectionChange" row-key="detailsId">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column type="selection" width="55" align="center" :selectable="selectable" :reserve-selection="true"/>
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template slot-scope="scope">
|
||||
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
|
||||
|
|
@ -643,7 +643,15 @@ export default {
|
|||
this.ids = selection.map((item) => item);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
},
|
||||
//是否可用勾选框
|
||||
selectable(row) {
|
||||
if (row.docType != '文件夹') {
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
//******查看************
|
||||
handleView(row) {
|
||||
console.log(row)
|
||||
|
|
@ -780,26 +788,28 @@ export default {
|
|||
/** 导出按钮作 */
|
||||
handleExport() {
|
||||
let arr=[]
|
||||
this.ids.forEach(item=>{
|
||||
let errorList = []
|
||||
this.ids.forEach(item=>{
|
||||
console.log(item)
|
||||
if(item.docType=='文件夹'){
|
||||
errorList.push(item.detailsId)
|
||||
}
|
||||
arr.push(item.detailsId)
|
||||
})
|
||||
downloadFileApi({'ids':arr.join(',')}).then((res) => {
|
||||
downloadFile({
|
||||
fileName: "文件档案下载.zip",
|
||||
fileData: res,
|
||||
fileType: "text/html;charset=UTF-8",
|
||||
});
|
||||
});
|
||||
// this.download(
|
||||
// "/material/archives/download",
|
||||
// {'ids':arr.join(',')},
|
||||
// `文件档案下载_${new Date().getTime()}.zip`
|
||||
// );
|
||||
|
||||
|
||||
|
||||
|
||||
console.log(errorList.length)
|
||||
if(errorList.length==0){
|
||||
downloadFileApi({'ids':arr.join(',')}).then((res) => {
|
||||
downloadFile({
|
||||
fileName: "文件档案下载.zip",
|
||||
fileData: res,
|
||||
fileType: "text/html;charset=UTF-8",
|
||||
});
|
||||
})
|
||||
}else{
|
||||
this.$modal.msgError("所选文件中包含文件夹,文件夹不能下载");
|
||||
}
|
||||
},
|
||||
|
||||
//切换展示模式
|
||||
changeShowType(val){
|
||||
this.showType=val;
|
||||
|
|
|
|||
Loading…
Reference in New Issue