|
|
@@ -237,6 +237,7 @@ define([ 'app/app' ], function(app) {
|
|
|
// $scope.isPcbStore = $rootScope.isPcbStore
|
|
|
// 上传Excel批量发布(大量)
|
|
|
$scope.upload = function() {
|
|
|
+ Loading.hide();
|
|
|
if(($scope.batch.myFiles == null) || ($scope.batch.myFiles.length == 0)) {
|
|
|
return ;
|
|
|
}
|
|
|
@@ -245,30 +246,31 @@ define([ 'app/app' ], function(app) {
|
|
|
toaster.pop('info', '请选择需要上传的文件');
|
|
|
return;
|
|
|
}
|
|
|
- if ($rootScope.$$productOn.tab === 'bathOnPerson') {
|
|
|
- var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency, isPerson : 1};
|
|
|
- } else {
|
|
|
- var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency, ignoreImport : $scope.ignoreImport};
|
|
|
- }
|
|
|
+ // if ($rootScope.$$productOn.tab === 'bathOnPerson') {
|
|
|
+ // var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency, isPerson : 1};
|
|
|
+ // } else {
|
|
|
+ // var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency, ignoreImport : $scope.ignoreImport};
|
|
|
+ // }
|
|
|
|
|
|
var uploadUrl = '/trade/purchaseProduct/personal/release/excel';
|
|
|
// var uploadUrl = $rootScope.isPcbStore ? 'release/product/release/excel/pcb' : 'release/product/release/excel';
|
|
|
// 上传文件进度条
|
|
|
// $scope.uploadProgressText = ''
|
|
|
- $scope.showCanvas = false
|
|
|
- $upload.upload({
|
|
|
- url: uploadUrl,
|
|
|
- file: file,
|
|
|
- method: 'POST',
|
|
|
- params : param
|
|
|
- }).progress(function(evt) {
|
|
|
- clearInterval($scope.AnimationCanvas)
|
|
|
- $scope.showCanvas = true
|
|
|
- var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
|
|
|
- drawFrame(progressPercentage)
|
|
|
- // $scope.uploadProgressText = progressPercentage + '%'
|
|
|
- // console.log('progess:' + progressPercentage + '%' + evt.config.file.name);
|
|
|
- }).success(function(data) {
|
|
|
+ $scope.showCanvas = false;
|
|
|
+ $upload.upload({
|
|
|
+ url: uploadUrl,
|
|
|
+ file: file,
|
|
|
+ method: 'POST'
|
|
|
+ // params : param
|
|
|
+ }).progress(function(evt) {
|
|
|
+ clearInterval($scope.AnimationCanvas)
|
|
|
+ $scope.showCanvas = true
|
|
|
+ var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
|
|
|
+ drawFrame(progressPercentage)
|
|
|
+
|
|
|
+ // $scope.uploadProgressText = progressPercentage + '%'
|
|
|
+ // console.log('progess:' + progressPercentage + '%' + evt.config.file.name);
|
|
|
+ }).success(function(data) {
|
|
|
$scope.selectFile(' ');
|
|
|
$scope.batch.myFiles = [];
|
|
|
$scope.proInfo = data.info;
|
|
|
@@ -294,28 +296,28 @@ define([ 'app/app' ], function(app) {
|
|
|
// }
|
|
|
// if(!message) {
|
|
|
// message = '没有提交任何信息'
|
|
|
- // }
|
|
|
- if ($scope.result.filter && $scope.result.filter > 0) {
|
|
|
- toaster.pop('warning', '警告', '存在导入失败产品,可下载导入失败表格查看详情');
|
|
|
- } else {
|
|
|
- toaster.pop('success', '提示', '上传完成');
|
|
|
- }
|
|
|
- $scope.showCanvas = false
|
|
|
- $scope.relTableParams.page(1);
|
|
|
+ // }
|
|
|
+ if ($scope.result.filter && $scope.result.filter > 0) {
|
|
|
+ toaster.pop('warning', '警告', '存在导入失败产品,可下载导入失败表格查看详情');
|
|
|
+ } else {
|
|
|
+ toaster.pop('success', '提示', '上传完成');
|
|
|
+ }
|
|
|
+ $scope.showCanvas = false;
|
|
|
+ $scope.relTableParams.page(1);
|
|
|
$scope.relTableParams.reload();
|
|
|
- if ($rootScope.$$productOn.tab === 'bathOnPerson') {
|
|
|
- publicPersonProduct();
|
|
|
- }
|
|
|
- }).error(function(response) {
|
|
|
- $scope.result = {};
|
|
|
- $scope.result.total = 0;
|
|
|
- $scope.pageParams.number = 0;
|
|
|
- $scope.pageParams.content = null;
|
|
|
- $scope.pageParams.totalElements = 0;
|
|
|
- $scope.pageParams.totalPages = 0;
|
|
|
- toaster.pop('error', response.data || response);
|
|
|
- $scope.showCanvas = false
|
|
|
- })
|
|
|
+ // if ($rootScope.$$productOn.tab === 'bathOnPerson') {
|
|
|
+ // publicPersonProduct();
|
|
|
+ // }
|
|
|
+ }).error(function(response) {
|
|
|
+ $scope.result = {};
|
|
|
+ $scope.result.total = 0;
|
|
|
+ $scope.pageParams.number = 0;
|
|
|
+ $scope.pageParams.content = null;
|
|
|
+ $scope.pageParams.totalElements = 0;
|
|
|
+ $scope.pageParams.totalPages = 0;
|
|
|
+ toaster.pop('error', response.data || response);
|
|
|
+ $scope.showCanvas = false
|
|
|
+ })
|
|
|
};
|
|
|
|
|
|
// 下载模板
|