|
|
@@ -4,11 +4,65 @@
|
|
|
*/
|
|
|
define(['app/app', 'calendar'], function(app) {
|
|
|
'use strict';
|
|
|
- app.register.controller('vendorIndexCtrl', ['$scope', 'toaster', 'VendorService', '$rootScope', 'News', '$filter', '$modal', 'DistributionRule', '$q', 'User', function($scope, toaster, VendorService, $rootScope, News, $filter, $modal, DistributionRule, $q, User) {
|
|
|
+ app.register.controller('vendorIndexCtrl', ['$scope', 'toaster', 'VendorService', '$rootScope', 'News', '$filter', '$modal', 'DistributionRule', '$q', 'User', 'ngTableParams', 'BaseService', 'Enterprise', function($scope, toaster, VendorService, $rootScope, News, $filter, $modal, DistributionRule, $q, User, ngTableParams, BaseService, Enterprise) {
|
|
|
$rootScope.active = 'index';
|
|
|
$scope.count = 0;
|
|
|
$scope.userInfo = $rootScope.userInfo;
|
|
|
|
|
|
+ // 申请
|
|
|
+ $scope.auditApply = function (status, id, UU) {
|
|
|
+ var param = {
|
|
|
+ userUU: UU,
|
|
|
+ id: id,
|
|
|
+ status: status
|
|
|
+ }
|
|
|
+ Enterprise.auditApply(param, {}, function (data) {
|
|
|
+ applyToEnterpriseTableParams();
|
|
|
+ }, function (error) {
|
|
|
+ console.log(error);
|
|
|
+ $defer.resolve([]);
|
|
|
+ params.total(0);
|
|
|
+ $scope.totalPages = 0;
|
|
|
+ toaster.pop('error', '数据获取失败,请重新刷新页面!');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //table设置
|
|
|
+ var applyToEnterpriseTableParams = function () {
|
|
|
+ $scope.applyToEnterpriseTableParams = new ngTableParams({
|
|
|
+ page : 1,
|
|
|
+ count : 5
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ getData : function ($defer, params) {
|
|
|
+ var param = BaseService.parseParams(params.url());
|
|
|
+ param.page = param.page;
|
|
|
+ param.size = param.count;
|
|
|
+ param.spaceUU = $scope.userInfo.enterprise.uu;
|
|
|
+ // 状态为申请中
|
|
|
+ param.status = 311;
|
|
|
+ Enterprise.findApplyToMall(param, {}, function (page) {
|
|
|
+ console.log(page);
|
|
|
+ $defer.resolve(page.content || []);
|
|
|
+ params.total(page.totalElements);
|
|
|
+ $scope.totalPages = page.totalPages;
|
|
|
+ $scope.content = page.content;
|
|
|
+ }, function (error) {
|
|
|
+ console.log(error);
|
|
|
+ $defer.resolve([]);
|
|
|
+ params.total(0);
|
|
|
+ $scope.totalPages = 0;
|
|
|
+ toaster.pop('error', '数据获取失败,请重新刷新页面!');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ applyToEnterpriseTableParams();
|
|
|
+
|
|
|
+ $scope.findMore = function () {
|
|
|
+ window.location.href = '#/account/management/';
|
|
|
+ $rootScope.tab = 'bind';
|
|
|
+ }
|
|
|
+
|
|
|
$scope.toAccount = function(){
|
|
|
User.isDevOrProd(null, function(data){
|
|
|
$scope.isProd = data.data;
|