|
|
@@ -269,13 +269,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}
|
|
|
}
|
|
|
}).state('baseInfo.index', {
|
|
|
- url : "",
|
|
|
- templateUrl : "static/tpl/index/baseInfo/index.html",
|
|
|
- controller: 'RightCtrl'
|
|
|
+ url : "/enterpriseList",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/enterpriseList.html",
|
|
|
+ controller: 'EnterpriseListCtrl'
|
|
|
}).state('baseInfo.home', {
|
|
|
- url : "/",
|
|
|
- templateUrl : "static/tpl/index/baseInfo/index.html",
|
|
|
- controller: 'RightCtrl'
|
|
|
+ url : "/enterpriseList",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/enterpriseList.html",
|
|
|
+ controller: 'EnterpriseListCtrl'
|
|
|
}).state('baseInfo.prodList', {
|
|
|
url : "/prodList",
|
|
|
templateUrl : "static/tpl/index/baseInfo/prodList.html",
|
|
|
@@ -7262,7 +7262,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
/**
|
|
|
* 企业列表
|
|
|
*/
|
|
|
- app.controller('EnterpriseListCtrl', ['$scope', 'EnterpriseList', 'ngTableParams', '$filter', 'BaseService', 'toaster', 'AddPartner', function($scope, EnterpriseList, ngTableParams, $filter, BaseService, toaster, AddPartner) {
|
|
|
+ app.controller('EnterpriseListCtrl', ['$scope', 'getAccountUserSpace', 'ngTableParams', '$filter', 'BaseService', 'toaster', 'AddPartner', function($scope, getAccountUserSpace, ngTableParams, $filter, BaseService, toaster, AddPartner) {
|
|
|
$scope.active = 'all';
|
|
|
$scope.agreedText = '全部';
|
|
|
$scope.dateZoneText = '一个月内';
|
|
|
@@ -7290,7 +7290,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
}
|
|
|
};
|
|
|
var getService = function() {
|
|
|
- return EnterpriseList;
|
|
|
+ return getAccountUserSpace;
|
|
|
};
|
|
|
|
|
|
$scope.tableParams = new ngTableParams({
|
|
|
@@ -7306,7 +7306,6 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
var pageParams = params.url();
|
|
|
pageParams.keyword = $scope.keyword;
|
|
|
getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page) {
|
|
|
- console.log(page);
|
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
|
params.total(page.totalElement);
|
|
|
@@ -7326,15 +7325,21 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
$scope.tableParams.reload();
|
|
|
};
|
|
|
|
|
|
- // 增加合作关系
|
|
|
- $scope.addPartner = function(uu) {
|
|
|
- console.log(uu);
|
|
|
- AddPartner.addPartner({uu: uu}, {}, function(data) {
|
|
|
- toaster.pop('success', '提示', '请求发送成功');
|
|
|
+ // 添加合作关系
|
|
|
+ $scope.addPartner = function(name, businessCode) {
|
|
|
+ AddPartner.addPartner({name: name, businessCode: businessCode}, {}, function(data) {
|
|
|
+ if(data.success) {
|
|
|
+ toaster.pop("success", '添加成功', data.success);
|
|
|
+ }
|
|
|
+ if(data.error) {
|
|
|
+ toaster.pop("error", '添加失败', data.error);
|
|
|
+ }
|
|
|
}, function(response) {
|
|
|
toaster.pop('error','失败',response.data);
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ $scope.status = 'enList';
|
|
|
}]);
|
|
|
|
|
|
/**
|
|
|
@@ -7481,6 +7486,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
var getCustInfos = function(custuu) {
|
|
|
if(custuu) {
|
|
|
VendorService.userInfo.query({uu:custuu},null,function(data) {
|
|
|
+ console.log(data);
|
|
|
$scope.custInfos = data;
|
|
|
var getPage = function(page, size){
|
|
|
if($scope.custInfos) {
|
|
|
@@ -7672,7 +7678,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
/**
|
|
|
* 建立合作关系申请
|
|
|
*/
|
|
|
- app.controller('AddPartnerRequestCtrl', ['$scope', 'AddPartnerMyRequest', 'toaster', 'BaseService', 'ngTableParams', 'AddPartner', function($scope, AddPartnerMyRequest, toaster, BaseService, ngTableParams, AddPartner) {
|
|
|
+ app.controller('AddPartnerRequestCtrl', ['$scope', 'AddPartnerMyRequest', 'toaster', 'BaseService', 'ngTableParams', 'AddPartner', '$timeout', function($scope, AddPartnerMyRequest, toaster, BaseService, ngTableParams, AddPartner, $timeout) {
|
|
|
|
|
|
$scope.active = 'todo';
|
|
|
|
|
|
@@ -7714,15 +7720,13 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
getData : function($defer, params) { // 获取数据的方法
|
|
|
$scope.loading = true;
|
|
|
var pageParams = params.url();
|
|
|
- pageParams.searchFilter = { // 筛选条件
|
|
|
- keyword: $scope.keyword,
|
|
|
- };
|
|
|
+ pageParams.keyword = $scope.keyword;
|
|
|
getService()[getRequestStatus($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
- console.log(page);
|
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
|
+ params.total(page.totalElement);
|
|
|
$defer.resolve(page.content);
|
|
|
- params.total(page.totalElements);
|
|
|
+ $scope.keywordXls = angular.copy(pageParams.keyword);//保存当前取值的关键词
|
|
|
}
|
|
|
}, function(response){
|
|
|
$scope.loading = false;
|
|
|
@@ -7734,30 +7738,69 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
// 再次申请
|
|
|
$scope.reapply = function(id) {
|
|
|
AddPartner.reapply({id: id}, {}, function(data) {
|
|
|
- toaster.pop('success', '提示', '请求发送成功');
|
|
|
+ toaster.pop('success', '提示', '操作成功');
|
|
|
}, function(response) {
|
|
|
toaster.pop('error','失败',response.data);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 添加为供应商
|
|
|
- $scope.addSupplier = function(id) {
|
|
|
- AddPartner.addSupplier({id: id}, {}, function(data) {
|
|
|
- toaster.pop('success', '提示', '添加供应商成功');
|
|
|
+ $scope.addSupplier = function(vendUID) {
|
|
|
+ AddPartner.addSupplier({businessCode: vendUID}, {}, function(data) {
|
|
|
+ if(data.success) {
|
|
|
+ toaster.pop('success', '提示', data.success);
|
|
|
+ }
|
|
|
+ if(data.error) {
|
|
|
+ toaster.pop('error','提示', data.error);
|
|
|
+ }
|
|
|
}, function(response) {
|
|
|
toaster.pop('error', '失败', response.data);
|
|
|
})
|
|
|
};
|
|
|
|
|
|
// 添加客户
|
|
|
- $scope.addCust = function(id) {
|
|
|
- AddPartner.addCust({id: id}, {}, function(data) {
|
|
|
- toaster.pop('success', '提示', '添加客户成功');
|
|
|
+ $scope.addCust = function(vendUID) {
|
|
|
+ AddPartner.addCust({businessCode: vendUID}, {}, function(data) {
|
|
|
+ if(data.success) {
|
|
|
+ toaster.pop('success', '提示', data.success);
|
|
|
+ }
|
|
|
+ if(data.error) {
|
|
|
+ toaster.pop('error','提示', data.error);
|
|
|
+ }
|
|
|
}, function(response) {
|
|
|
toaster.pop('error', '失败', response.data);
|
|
|
})
|
|
|
};
|
|
|
|
|
|
+ // 搜索框回车
|
|
|
+ $scope.onSearch = function() {
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ // 同意申请
|
|
|
+ $scope.agree = function(id) {
|
|
|
+ AddPartner.agreeRequest({id: id}, {}, function(data) {
|
|
|
+ toaster.pop('success', '提示', '操作成功');
|
|
|
+ $timeout(function() {
|
|
|
+ window.location.reload();
|
|
|
+ }, 500);
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 拒绝申请
|
|
|
+ $scope.refuse = function(id, reason) {
|
|
|
+ AddPartner.refuseRequest({id: id, reason: reason}, {}, function(data) {
|
|
|
+ toaster.pop('success', '提示', '操作成功');
|
|
|
+ $timeout(function() {
|
|
|
+ window.location.reload();
|
|
|
+ }, 500);
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
$scope.status = 'send';
|
|
|
}]);
|
|
|
@@ -7812,9 +7855,11 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
};
|
|
|
getService()[getMessagetStatus($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
|
+ console.log(page);
|
|
|
if(page) {
|
|
|
+ params.total(page.totalElement);
|
|
|
$defer.resolve(page.content);
|
|
|
- params.total(page.totalElements);
|
|
|
+ $scope.keywordXls = angular.copy(pageParams.keyword);//保存当前取值的关键词
|
|
|
}
|
|
|
}, function(response){
|
|
|
$scope.loading = false;
|
|
|
@@ -7884,6 +7929,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
app.controller('SearchCustInfoCtrl', ['$scope', '$modalInstance', 'suuorname', 'FaApCheck', function($scope, $modalInstance, suuorname, FaApCheck) {
|
|
|
$scope.getData = function(){
|
|
|
FaApCheck.getAllCustomers(function(data) {
|
|
|
+ console.log(data);
|
|
|
$scope.custs= data;
|
|
|
angular.forEach($scope.data, function(item) {
|
|
|
item:{
|