|
|
@@ -466,6 +466,25 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
url : '/inquiryList/:id',
|
|
|
templateUrl : "static/tpl/index/baseInfo/inquiryItem_detail.html",
|
|
|
controller : 'PublicInquiryListDetailCtrl'
|
|
|
+ }).state('baseInfo.vendorInfo', {
|
|
|
+ url : '/enume/vendorInfo',
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/vendorsInfo.html",
|
|
|
+ controller : 'VendorsInfoCtrl'
|
|
|
+ }).state('baseInfo.customerInfo', {
|
|
|
+ url : '/enume/customerInfo',
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/customersInfo.html",
|
|
|
+ controller : 'CustomersInfoCtrl'
|
|
|
+ }).state('baseInfo.enume', {
|
|
|
+ url : '/enume',
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/vendorAndCustomer.html",
|
|
|
+ }).state('baseInfo.partner', {
|
|
|
+ url : '/partner',
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/addPartners.html",
|
|
|
+ controller : 'AddPartnersCtrl'
|
|
|
+ }).state('baseInfo.partner_searchresult', {
|
|
|
+ url : '/search?keyword=',
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/searchresult.html",
|
|
|
+ controller : 'EnterpriseSearchCtrl'
|
|
|
}).state('qc', {
|
|
|
url : "/qc",
|
|
|
views : {
|
|
|
@@ -9766,7 +9785,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
/**
|
|
|
* 我的供应商
|
|
|
*/
|
|
|
- app.controller('PurcVendorCtrl', ['$scope', 'Vendor', 'BaseService','AuthenticationService', 'ngTableParams', '$modal','toaster', '$rootScope', function($scope, Vendor, BaseService, AuthenticationService,ngTableParams,$modal, toaster, $rootScope){
|
|
|
+ app.controller('PurcVendorCtrl', ['$scope', 'Vendor', 'BaseService','AuthenticationService', 'ngTableParams', '$modal','toaster', '$rootScope', 'VendorInfo', function($scope, Vendor, BaseService, AuthenticationService,ngTableParams,$modal, toaster, $rootScope, VendorInfo){
|
|
|
BaseService.scrollBackToTop();
|
|
|
// 搜索框回车
|
|
|
$scope.onSearch = function(keyword) {
|
|
|
@@ -12870,5 +12889,216 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// };
|
|
|
}]);
|
|
|
|
|
|
- return app;
|
|
|
+ // 基础资料客户详情
|
|
|
+ app.controller('CustomersInfoCtrl', ['$scope', 'VendorService', 'BaseService','AuthenticationService', 'ngTableParams', '$modal','toaster', 'VendorInfo', function($scope, VendorService, BaseService, AuthenticationService,ngTableParams,$modal, toaster, VendorInfo){
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $scope.status = 'customer';
|
|
|
+ $scope.userInfoResult = true;
|
|
|
+ AuthenticationService.getAuthentication().success(function(data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ $scope.thisUser = data;
|
|
|
+ });
|
|
|
+ $scope.customerParams = new ngTableParams({
|
|
|
+ page : 1,
|
|
|
+ count : 10
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
+ getData : function($defer, params) {
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ pageParams.keyword = $scope.keyword;
|
|
|
+ VendorService.customer.get(BaseService.parseParams(pageParams), function(page){
|
|
|
+ $scope.loading = false;
|
|
|
+ if(page) {
|
|
|
+ params.total(page.totalElement);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ }
|
|
|
+ $scope.totalCount = page.totalElement;
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 搜索框回车
|
|
|
+ $scope.onSearch = function(keyword) {
|
|
|
+ $scope.customerParams.page(1);
|
|
|
+ $scope.customerParams.reload();
|
|
|
+ $scope.tip = keyword;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 查看详情
|
|
|
+ $scope.viewDetail = function(id) {
|
|
|
+ console.log(id);
|
|
|
+ window.location.hash = "#/sale/customer/" + id;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 取消合作关系
|
|
|
+ $scope.relieve = function(id) {
|
|
|
+ VendorInfo.relieve({id: id}, {}, function(data) {
|
|
|
+ toaster.pop('success', '提示', '取消合作关系成功');
|
|
|
+ $scope.customerParams.page(1);
|
|
|
+ $scope.customerParams.reload();
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ // 基础资料供应商
|
|
|
+ app.controller('VendorsInfoCtrl', ['$scope', 'Vendor', 'BaseService','AuthenticationService', 'ngTableParams', '$modal','toaster', '$rootScope', 'VendorInfo', function($scope, Vendor, BaseService, AuthenticationService,ngTableParams,$modal, toaster, $rootScope, VendorInfo){
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $scope.status = 'vendor';
|
|
|
+ // 搜索框回车
|
|
|
+ $scope.onSearch = function(keyword) {
|
|
|
+ $scope.keyword = keyword;
|
|
|
+ $scope.customerParams.page(1);
|
|
|
+ $scope.customerParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.customerParams = new ngTableParams({
|
|
|
+ page : 1,
|
|
|
+ count : 10
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
+ getData : function($defer, params) {
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ pageParams.keyword = $scope.keyword;
|
|
|
+ Vendor.getVendor.call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
+ $scope.loading = false;
|
|
|
+ if(page) {
|
|
|
+ params.total(page.totalElements);
|
|
|
+ $scope.total = page.totalElement;
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ }
|
|
|
+ $scope.totalCount = page.totalElements;
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 查看供应商详情
|
|
|
+ $scope.VendorDetail = function(id, uu) {
|
|
|
+ $rootScope.vendorId = id;
|
|
|
+ $rootScope.vendoruu = uu;
|
|
|
+ window.location.hash = "#/purc/vendor/"+$rootScope.vendorId;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 向企业购买
|
|
|
+ $scope.purcByEn = function(businessCode) {
|
|
|
+ $rootScope.businessCode = businessCode;
|
|
|
+ window.location.hash = "#/purc/addOrder";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 取消合作关系
|
|
|
+ $scope.relieve = function(id) {
|
|
|
+ VendorInfo.relieve({id: id}, {}, function(data) {
|
|
|
+ toaster.pop('success', '提示', '取消合作关系成功');
|
|
|
+ $scope.customerParams.page(1);
|
|
|
+ $scope.customerParams.reload();
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ // 企业圈搜索界面
|
|
|
+ app.controller('AddPartnersCtrl', ['$scope', '$rootScope', function($scope, $rootScope) {
|
|
|
+ $scope.onSearch = function(keyword) {
|
|
|
+ $rootScope.enterpriseKeyword = keyword;
|
|
|
+ window.location.hash = "#/baseInfo/search?keyword=" + $rootScope.enterpriseKeyword;
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
+ // 企业圈搜索结果
|
|
|
+ app.controller('EnterpriseSearchCtrl', ['$scope', 'getAccountUserSpace', 'ngTableParams', '$filter', 'BaseService', 'toaster', 'AddPartner', '$rootScope', function($scope, getAccountUserSpace, ngTableParams, $filter, BaseService, toaster, AddPartner, $rootScope) {
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $scope.active = 'all';
|
|
|
+ $scope.agreedText = '全部';
|
|
|
+ $scope.dateZoneText = '一个月内';
|
|
|
+ $scope.condition = {dateZone: 1};
|
|
|
+ $scope.currency = Symbol.currency;//将币别转化为对应的符号
|
|
|
+ $scope.changeAgreed = function(agreed) {
|
|
|
+ $scope.condition.agreed = agreed;
|
|
|
+ $scope.agreedText = typeof agreed == 'undefined' ? '全部' : (agreed == 1 ? '已同意' : '不同意');
|
|
|
+ $scope.condition.$agreedOpen = false;
|
|
|
+ };
|
|
|
+ $scope.changeDateZone = function(zone) {
|
|
|
+ $scope.condition.dateZone = zone;
|
|
|
+ $scope.dateZoneText = typeof zone == 'undefined' ? '半年前' : (zone == 1 ? '一个月内' : '半年内');
|
|
|
+ $scope.condition.$dateZoneOpen = false;
|
|
|
+ getDateCondition(zone, $scope.condition);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+ $scope.setActive = function(state) {
|
|
|
+ if($scope.active != state) {
|
|
|
+ $scope.active = state;
|
|
|
+ if($scope.tableParams.page() == 1)
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ else
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var getService = function() {
|
|
|
+ return getAccountUserSpace;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
+ page : 1,
|
|
|
+ count : 5,
|
|
|
+ sorting: {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
+ getData : function($defer, params) {
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ pageParams.keyword = $rootScope.enterpriseKeyword;
|
|
|
+ $scope.tip = $rootScope.enterpriseKeyword;
|
|
|
+ getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page) {
|
|
|
+ $scope.loading = false;
|
|
|
+ if(page) {
|
|
|
+ params.total(page.totalElement);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ $scope.keywordXls = angular.copy(pageParams.keyword);//保存当前取值的关键词
|
|
|
+ }
|
|
|
+ }, function(response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 搜索框回车
|
|
|
+ $scope.onSearch = function() {
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ // 添加合作关系
|
|
|
+ $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';
|
|
|
+ }]);
|
|
|
+ return app;
|
|
|
});
|