|
@@ -3209,8 +3209,10 @@ $(document).ready(() => {
|
|
|
const tabPanel = $(this).attr('fujian-content');
|
|
|
if (tabPanel !== 'syfujian') {
|
|
|
$('#showPage').hide();
|
|
|
+ $('#bach-download').prop('type', 'curr');
|
|
|
} else {
|
|
|
$('#showPage').show();
|
|
|
+ $('#bach-download').prop('type', 'all')
|
|
|
}
|
|
|
$('#showAttachment').hide();
|
|
|
});
|
|
@@ -3450,34 +3452,41 @@ $(document).ready(() => {
|
|
|
|
|
|
// 批量下载
|
|
|
$('#bach-download').click(function() {
|
|
|
- const fileIds = []
|
|
|
- $('.tab-pane.active.show .list-table .check-file:checked').each(function() {
|
|
|
- const fileId = $(this).attr('file-id')
|
|
|
- fileId && fileIds.push(fileId)
|
|
|
- })
|
|
|
+ const fileIds = [];
|
|
|
+ const type = $(this).prop('type');
|
|
|
+ let node = ''
|
|
|
+ if (type === 'curr') {
|
|
|
+ node = '#nodelist-table .check-file:checked'
|
|
|
+ } else {
|
|
|
+ node = '#alllist-table .check-file:checked'
|
|
|
+ }
|
|
|
+ $(node).each(function() {
|
|
|
+ const fileId = $(this).attr('file-id');
|
|
|
+ fileId && fileIds.push(fileId);
|
|
|
+ });
|
|
|
|
|
|
if (fileIds.length) {
|
|
|
- const url = `/tender/${tender.id}/measure/stage/${stage.order}/download/compresse-file?fileIds=${JSON.stringify(fileIds)}`
|
|
|
- $('#zipDown').attr('href', url)
|
|
|
- $("#zipDown")[0].click()
|
|
|
+ const url = `/tender/${tender.id}/measure/stage/${stage.order}/download/compresse-file?fileIds=${JSON.stringify(fileIds)}`;
|
|
|
+ $('#zipDown').attr('href', url);
|
|
|
+ $("#zipDown")[0].click();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 监听附件check是否选中
|
|
|
$('.list-table').on('click', '.check-file', function() {
|
|
|
- const checkedList = $(this).parents('.list-table').children().find('input:checked')
|
|
|
- const childs = $(this).parents('.list-table').children().length
|
|
|
- const checkBox = $(this).parents('.list-table').parent().find('.check-all-file')
|
|
|
+ const checkedList = $(this).parents('.list-table').children().find('input:checked');
|
|
|
+ const childs = $(this).parents('.list-table').children().length;
|
|
|
+ const checkBox = $(this).parents('.list-table').parent().find('.check-all-file');
|
|
|
if (checkedList.length === childs) {
|
|
|
- checkBox.prop("checked", true)
|
|
|
+ checkBox.prop("checked", true);
|
|
|
} else {
|
|
|
- checkBox.prop("checked", false)
|
|
|
+ checkBox.prop("checked", false);
|
|
|
}
|
|
|
});
|
|
|
$('.check-all-file').click(function() {
|
|
|
- const isCheck = $(this).is(':checked')
|
|
|
+ const isCheck = $(this).is(':checked');
|
|
|
$(this).parents('table').find('.list-table').each(function() {
|
|
|
- $(this).find('input:checkbox').prop("checked", isCheck)
|
|
|
+ $(this).find('input:checkbox').prop("checked", isCheck);
|
|
|
})
|
|
|
});
|
|
|
|