Browse Source

增加 一键下载功能

java8
赵宏斌 4 months ago
parent
commit
b603c4eac5
  1. 22
      src/views/modules/eam/com_project_proof_record.vue
  2. 38
      src/views/modules/eam/eamProjectPartInfo.vue

22
src/views/modules/eam/com_project_proof_record.vue

@ -64,6 +64,7 @@
<el-tabs style="font-size: 12px;margin-top: -5px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
<el-tab-pane label="打样文档" name="proofDocument">
<el-button type="primary" icon="el-icon-upload" v-if="isUpload" style="margin-top: -3px;" @click="uploadOtherDocument()">上传其他文档</el-button>
<el-button type="primary" v-loading="this.downloadLoading" v-if="proofDocumentList.length>0" style="margin-top: -3px;" @click="dowloadAllFile()">一键下载</el-button>
<el-table
@header-dragend="handleColumnResize"
:data="proofDocumentList"
@ -727,6 +728,7 @@
currentRow:'',
fileContentList:[],
proofDocumentList:[],
downloadLoading: false,
proofDocumentListDefinition:[],
fileList: [],
copyDocumentList: [],
@ -2183,6 +2185,19 @@
};
this.uploadDialog = true
},
async dowloadAllFile(){
this.downloadLoading = true
let oldList = this.proofDocumentList
let list = oldList.filter(item => {
return item.documentId !== null
})
for (const item of list) {
await this.viewDocumentFile(item, true)
this.downloadFile(this.partProofingDocumentFileList[0])
await new Promise(resolve => setTimeout(resolve, 500))
}
this.downloadLoading = false
},
sendMailHandle(row) {
sendMailHandle(row).then(({data}) => {
if (data && data.code === 0) {
@ -2237,7 +2252,7 @@
});
}
},
viewDocumentFile(row) {
async viewDocumentFile(row,flag) {
let inData = {
id: row.documentId,
orderRef1: row.site,
@ -2251,11 +2266,14 @@
page: 1,
limit: 1000
}
searchProjectConfirmatorFileList(inData).then(({data}) => {
await searchProjectConfirmatorFileList(inData).then(({data}) => {
if (data && data.code === 0){
this.partProofingDocumentFileList = data.page.list;
}
})
if(flag){
return
}
this.viewDocumentFileVisible = true
},
//

38
src/views/modules/eam/eamProjectPartInfo.vue

@ -1272,6 +1272,7 @@
<el-button type="primary" v-if="!this.authUpdate" icon="el-icon-upload" style="margin-top: -5px" @click="projectDocumentList()">文档清单定义</el-button>
<el-button type="primary" v-if="this.proofingCurrentRow.status !== '草稿'" icon="el-icon-upload" style="margin-top: -5px" @click="uploadOtherDocument()">上传其他文档</el-button>
<el-button type="primary" v-if="this.sendMassMailFlag === true && !this.authUpdate" style="margin-top: -5px" @click="sendMassMailHandle()">邮件提醒</el-button>
<el-button type="primary" v-loading="this.downloadLoading" v-if="projectOtherDocumentList.length>0" style="margin-top: -3px;" @click="dowloadAllFile()">一键下载</el-button>
<el-table
:data="projectOtherDocumentList"
border
@ -1348,6 +1349,7 @@
</el-tab-pane>
<el-tab-pane label="所有文档" name="allDocument">
<el-button type="primary" v-if="this.proofingCurrentRow.status !== '草稿' && !this.authUpdate" icon="el-icon-upload" style="margin-top: -5px" @click="projectProductionValidationDocument()">选择生产确认文档</el-button>
<el-button type="primary" v-loading="this.downloadLoading" v-if="projectAllDocumentList.length>0" style="margin-top: -3px;" @click="dowloadAllFile2()">一键下载</el-button>
<el-table
:data="projectAllDocumentList"
border
@ -1905,6 +1907,7 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
otherDocumentCurrentRow: {},
projectAllDocumentCurrentRow: {},
fileList: [],
downloadLoading: false,
projectOtherDocumentList: [],
extraProjectDocumentList: [],
projectDocumentSelection: [],
@ -4750,6 +4753,34 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
}
})
},
//
async dowloadAllFile(){
this.downloadLoading = true
let oldList = this.projectOtherDocumentList
let list = oldList.filter(item => {
return this.shouldShowDelete(item) || item.projectPhase === 'SOP文档'
})
for (const item of list) {
await this.viewMassDocumentFile(item, true)
this.downloadFile(this.projectConfirmatorFileList[0])
await new Promise(resolve => setTimeout(resolve, 500))
}
this.downloadLoading = false
},
//
async dowloadAllFile2(){
this.downloadLoading = true
let oldList = this.projectAllDocumentList
let list = oldList.filter(item => {
return this.shouldShowDelete(item) || item.uploadedFlag === 'Y'
})
for (const item of list) {
await this.viewMassDocumentFile(item, true)
this.downloadFile(this.projectConfirmatorFileList[0])
await new Promise(resolve => setTimeout(resolve, 500))
}
this.downloadLoading = false
},
cancelModalStatus (row) {
this.modalData = {
site: row.site,
@ -6077,7 +6108,7 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
})
this.viewDocumentFileVisible = true
},
viewMassDocumentFile(row) {
async viewMassDocumentFile(row,flag) {
let inData = {
orderRef1: row.site,
orderRef2: row.proofingId,
@ -6091,11 +6122,14 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
page: 1,
limit: 1000
}
searchProjectConfirmatorFileList(inData).then(({data}) => {
await searchProjectConfirmatorFileList(inData).then(({data}) => {
if (data && data.code === 0){
this.projectConfirmatorFileList = data.page.list;
}
})
if (flag){
return
}
this.viewMassDocumentFileVisible = true
},
deleteFile(row) {

Loading…
Cancel
Save