|
@@ -1136,7 +1136,7 @@ $(document).ready(() => {
|
|
// 批量下载
|
|
// 批量下载
|
|
$('#bach-download').click(function() {
|
|
$('#bach-download').click(function() {
|
|
const fileIds = [];
|
|
const fileIds = [];
|
|
- const type = $(this).prop('type');
|
|
|
|
|
|
+ const type = $(this).attr('type');
|
|
let node = ''
|
|
let node = ''
|
|
if (type === 'curr') {
|
|
if (type === 'curr') {
|
|
node = '#nodelist-table .check-file:checked'
|
|
node = '#nodelist-table .check-file:checked'
|
|
@@ -1149,9 +1149,25 @@ $(document).ready(() => {
|
|
});
|
|
});
|
|
|
|
|
|
if (fileIds.length) {
|
|
if (fileIds.length) {
|
|
- const url = `/tender/${relaTender.id}/measure/stage/${relaStage.order}/download/compresse-file?fileIds=${JSON.stringify(fileIds)}`;
|
|
|
|
- $('#zipDown').attr('href', url);
|
|
|
|
- $("#zipDown")[0].click();
|
|
|
|
|
|
+ if (fileIds.length > 10) {
|
|
|
|
+ return toastr.warning(`最大允许10个文件(当前${fileIds.length}个)`)
|
|
|
|
+ }
|
|
|
|
+ toastr.success('正在进行压缩文件...', '', { timeOut: 0, extendedTimeOut: 0})
|
|
|
|
+ $(this).attr('disabled', "true")
|
|
|
|
+ const btn = $(this)
|
|
|
|
+ postCompressFile(`/tender/${relaTender.id}/measure/stage/${relaStage.order}/download/compresse-file`, {fileIds}, function(result) {
|
|
|
|
+ toastr.clear()
|
|
|
|
+ toastr.success('压缩文件成功')
|
|
|
|
+ btn.removeAttr('disabled')
|
|
|
|
+ const href = window.URL.createObjectURL(result)
|
|
|
|
+ $('#zipDown').attr('href', href);
|
|
|
|
+ $('#zipDown').attr('download', `${relaTender.name}-计量台账-第${relaStage.order}期-附件.zip`);
|
|
|
|
+ $("#zipDown")[0].click();
|
|
|
|
+ }, () => {
|
|
|
|
+ btn.removeAttr('disabled')
|
|
|
|
+ toastr.clear()
|
|
|
|
+ toastr.error('批量下载失败')
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|