|
@@ -1,6 +1,6 @@
|
|
|
define([ 'app/app' ], function(app) {
|
|
define([ 'app/app' ], function(app) {
|
|
|
'use strict';
|
|
'use strict';
|
|
|
- app.register.controller('vendor_onSaleCtrl', ['$scope', '$rootScope', 'Goods', '$modal', 'toaster', 'Loading', 'StoreInfo', 'AuthenticationService', '$q', 'StoreCms', 'NumberService', 'Enterprise', 'ByteCountService', 'DistributionRule', function ($scope, $rootScope, Goods, $modal, toaster, Loading, StoreInfo, AuthenticationService, $q, StoreCms, NumberService, Enterprise, ByteCountService, DistributionRule) {
|
|
|
|
|
|
|
+ app.register.controller('vendor_onSaleCtrl', ['$scope', '$rootScope', 'Goods', '$modal', 'toaster', 'Loading', 'StoreInfo', 'AuthenticationService', '$q', 'StoreCms', 'NumberService', 'Enterprise', 'ByteCountService', 'DistributionRule', '$http', function ($scope, $rootScope, Goods, $modal, toaster, Loading, StoreInfo, AuthenticationService, $q, StoreCms, NumberService, Enterprise, ByteCountService, DistributionRule, $http) {
|
|
|
$rootScope.active = 'vendor_material';
|
|
$rootScope.active = 'vendor_material';
|
|
|
$scope.keyword = '';
|
|
$scope.keyword = '';
|
|
|
$scope.tab = 'onSale';
|
|
$scope.tab = 'onSale';
|
|
@@ -1574,43 +1574,66 @@ define([ 'app/app' ], function(app) {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
function downloadByJs(url, keyword, type) {
|
|
function downloadByJs(url, keyword, type) {
|
|
|
- var form = $("<form>"); //定义一个form表单
|
|
|
|
|
- form.attr('style', 'display:none'); //在form表单中添加查询参数
|
|
|
|
|
- form.attr('target', '');
|
|
|
|
|
- form.attr('method', 'get');
|
|
|
|
|
- form.attr('action', url);
|
|
|
|
|
-
|
|
|
|
|
- var input1 = $('<input>');
|
|
|
|
|
- input1.attr('type', 'hidden');
|
|
|
|
|
- input1.attr('name', 'keyword');
|
|
|
|
|
- input1.attr('value', keyword);
|
|
|
|
|
-
|
|
|
|
|
- var input2 = $('<input>');
|
|
|
|
|
- input1.attr('type', 'hidden');
|
|
|
|
|
- input1.attr('name', 'isSelfSupport');
|
|
|
|
|
- input1.attr('value', type);
|
|
|
|
|
-
|
|
|
|
|
- $('body').append(form); //将表单放置在web中
|
|
|
|
|
- form.append(input1); //将查询参数控件提交到表单上
|
|
|
|
|
- form.append(input2);
|
|
|
|
|
- form.submit();
|
|
|
|
|
|
|
+ $http({
|
|
|
|
|
+ method: 'get',
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ url: url,
|
|
|
|
|
+ params: {
|
|
|
|
|
+ keyword: keyword,
|
|
|
|
|
+ isSelfSupport: type
|
|
|
|
|
+ }
|
|
|
|
|
+ }).success(function (data) {
|
|
|
|
|
+ var form = $("<form>"); //定义一个form表单
|
|
|
|
|
+ form.attr('style', 'display:none'); //在form表单中添加查询参数
|
|
|
|
|
+ form.attr('target', '');
|
|
|
|
|
+ form.attr('method', 'get');
|
|
|
|
|
+ form.attr('action', url);
|
|
|
|
|
+
|
|
|
|
|
+ var input1 = $('<input>');
|
|
|
|
|
+ input1.attr('type', 'hidden');
|
|
|
|
|
+ input1.attr('name', 'keyword');
|
|
|
|
|
+ input1.attr('value', keyword);
|
|
|
|
|
+
|
|
|
|
|
+ var input2 = $('<input>');
|
|
|
|
|
+ input1.attr('type', 'hidden');
|
|
|
|
|
+ input1.attr('name', 'isSelfSupport');
|
|
|
|
|
+ input1.attr('value', type);
|
|
|
|
|
+
|
|
|
|
|
+ $('body').append(form); //将表单放置在web中
|
|
|
|
|
+ form.append(input1); //将查询参数控件提交到表单上
|
|
|
|
|
+ form.append(input2);
|
|
|
|
|
+ form.submit();
|
|
|
|
|
+ }).error(function (response) {
|
|
|
|
|
+ toaster.pop('error', response);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function downloadSelectedByJs(url, idList) {
|
|
function downloadSelectedByJs(url, idList) {
|
|
|
- var form = $("<form>"); //定义一个form表单
|
|
|
|
|
- form.attr('style', 'display:none'); //在form表单中添加查询参数
|
|
|
|
|
- form.attr('target', '');
|
|
|
|
|
- form.attr('method', 'get');
|
|
|
|
|
- form.attr('action', url);
|
|
|
|
|
-
|
|
|
|
|
- var input1 = $('<input>');
|
|
|
|
|
- input1.attr('type', 'hidden');
|
|
|
|
|
- input1.attr('name', 'ids');
|
|
|
|
|
- input1.attr('value', idList);
|
|
|
|
|
-
|
|
|
|
|
- $('body').append(form); //将表单放置在web中
|
|
|
|
|
- form.append(input1); //将查询参数控件提交到表单上
|
|
|
|
|
- form.submit();
|
|
|
|
|
|
|
+ $http({
|
|
|
|
|
+ method: 'get',
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ url: url,
|
|
|
|
|
+ params: {
|
|
|
|
|
+ ids: idList
|
|
|
|
|
+ }
|
|
|
|
|
+ }).success(function (data) {
|
|
|
|
|
+ var form = $("<form>"); //定义一个form表单
|
|
|
|
|
+ form.attr('style', 'display:none'); //在form表单中添加查询参数
|
|
|
|
|
+ form.attr('target', '');
|
|
|
|
|
+ form.attr('method', 'get');
|
|
|
|
|
+ form.attr('action', url);
|
|
|
|
|
+
|
|
|
|
|
+ var input1 = $('<input>');
|
|
|
|
|
+ input1.attr('type', 'hidden');
|
|
|
|
|
+ input1.attr('name', 'ids');
|
|
|
|
|
+ input1.attr('value', idList);
|
|
|
|
|
+
|
|
|
|
|
+ $('body').append(form); //将表单放置在web中
|
|
|
|
|
+ form.append(input1); //将查询参数控件提交到表单上
|
|
|
|
|
+ form.submit();
|
|
|
|
|
+ }).error(function (response) {
|
|
|
|
|
+ toaster.pop('error', response);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 下载模板
|
|
// 下载模板
|