Commit 8550b962 authored by gary's avatar gary

Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql

parents 367afd79 003d5779
......@@ -1543,24 +1543,51 @@ taxDocumentManageModule.directive('downLoadModule', function () {
controller: ['$scope', 'taxDocumentListService', '$translate','SweetAlert',
function ($scope, taxDocumentListService, $translate,SweetAlert) {
/* $scope.downloadAttachment = function () {
var checkedIDs = [
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
];
$("input[name='dataGridCheckBox']").each(function (index, item) {
if (item.checked) {
var cellId = $(item).attr("data-id");
checkedIDs.push(cellId);
}
});
taxDocumentListService.downloadAllFile({
"ids":checkedIDs
});
};*/
$scope.downloadAttachment = function () {
var checkedIDs = [];
var checkedUrls = [
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
];
$("input[name='dataGridCheckBox']").each(function (index, item) {
if (item.checked) {
var cellId = $(item).attr("data-id");
var cellUrl = $(item).attr("data-url");
checkedIDs.push(cellId);
checkedUrls.push(cellUrl);
}
});
if(checkedIDs.length === 1 && checkedUrls.length === 1){
simpDownload(checkedUrls[0]);
}else{
multiDownToZip(checkedIDs);
}
};
function simpDownload(url){
if (!url) return SweetAlert.warning($translate.instant("NeedChecked"));
// setTimeout(function () {
var frame = $('<iframe style="display: none;" class="multi-download"></iframe>');
frame.attr('src', url);
document.body.appendChild(frame[0]);
setTimeout(function () {
frame.remove();
}, 1000);
// }, 100);
}
function multiDownToZip(ids){
if (!ids.length) return SweetAlert.warning($translate.instant("NeedChecked"));
setTimeout(function(){
taxDocumentListService.downloadAllFile({
"ids":ids
});
},500);
}
/*$scope.downloadAttachment = function () {
var checkedURLs = [
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
......@@ -1589,7 +1616,7 @@ taxDocumentManageModule.directive('downLoadModule', function () {
}, _removeDelay);
}, _triggerDelay);
}
};
};*/
}]
}
});
......
......@@ -79,6 +79,7 @@ taxDocumentManageModule.factory('taxDocumentListService',
return jqFetch.get(apiInterceptor.webApiHostUrl + '/businessunit/getlist', params);
},
downloadAllFile:function(params){
$('#busy-indicator-container').show();
//post请求会自带http://etms.longi-silicon.com:8180//api/v1的前缀路径,get请求不会
var xhr = new XMLHttpRequest();
xhr.open('POST', apiInterceptor.webApiHostUrl + "/taxDoc/downloadAllFile", true);
......@@ -119,6 +120,7 @@ taxDocumentManageModule.factory('taxDocumentListService',
} else {
window.location = objectUrl;
}
$('#busy-indicator-container').hide();
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment