|
|
@@ -945,60 +945,42 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// 跳转到B2C
|
|
|
$scope.b2cLink = function (url) {
|
|
|
AccountEnterprise.getB2cUrl({}, function(data) {
|
|
|
- window.location.href = data.url + url;
|
|
|
+ if (url == '/help/home') {
|
|
|
+ window.open(data.url + url, '_target')
|
|
|
+ } else {
|
|
|
+ window.location.href = data.url + url;
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
}]);
|
|
|
|
|
|
app.controller('AdController', ['$scope', '$modal', '$interval', function($scope, $modal, $interval) {
|
|
|
- $scope.adStart = false;
|
|
|
- $modal.open({
|
|
|
- templateUrl: 'static/tpl/index/home/modal/notice.html',
|
|
|
- controller: 'NotifyCtrl'
|
|
|
- }).result.then(function (s) {
|
|
|
- $scope.adStart = true;
|
|
|
- // 广告操作
|
|
|
- $scope.count = 5;
|
|
|
- $scope.bannerShow = true;
|
|
|
- $scope.imgAnmiation = false;
|
|
|
- $scope.jingKongAnmiation = true;
|
|
|
- $scope.imgShow = true;
|
|
|
- $scope.Times = $interval(function () {
|
|
|
- $scope.count--;
|
|
|
- if ($scope.count <= 0) {
|
|
|
- $scope.count = 5;
|
|
|
- $scope.jingKongAnmiation = false;
|
|
|
- $interval.cancel($scope.Times);
|
|
|
- $scope.closeClick();
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
- // 金控广告动画设置
|
|
|
- $scope.closeClick = function () {
|
|
|
- $scope.jingKongAnmiation = false;
|
|
|
- if ($scope.bannerShow === false) {
|
|
|
- $scope.imgAnmiation = false;
|
|
|
- $scope.imgShow = false;
|
|
|
- } else {
|
|
|
- $scope.bannerShow = false;
|
|
|
- $scope.imgAnmiation = true;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }]);
|
|
|
-
|
|
|
- app.controller('NotifyCtrl', ['$scope', '$modalInstance', '$interval', function($scope, $modalInstance, $interval) {
|
|
|
+ // 广告操作
|
|
|
$scope.count = 5;
|
|
|
- $scope.intervalTime = $interval(function () {
|
|
|
+ $scope.bannerShow = true;
|
|
|
+ $scope.imgAnmiation = false;
|
|
|
+ $scope.jingKongAnmiation = true;
|
|
|
+ $scope.imgShow = true;
|
|
|
+ $scope.Times = $interval(function () {
|
|
|
$scope.count--;
|
|
|
- if ($scope.count === 0) {
|
|
|
- $scope.lockstatus = false;
|
|
|
- $interval.cancel($scope.intervalTime)
|
|
|
- $scope.close()
|
|
|
+ if ($scope.count <= 0) {
|
|
|
+ $scope.count = 5;
|
|
|
+ $scope.jingKongAnmiation = false;
|
|
|
+ $interval.cancel($scope.Times);
|
|
|
+ $scope.closeClick();
|
|
|
}
|
|
|
}, 1000);
|
|
|
- $scope.close = function() {
|
|
|
- $modalInstance.close();
|
|
|
+ // 金控广告动画设置
|
|
|
+ $scope.closeClick = function () {
|
|
|
+ $scope.jingKongAnmiation = false;
|
|
|
+ if ($scope.bannerShow === false) {
|
|
|
+ $scope.imgAnmiation = false;
|
|
|
+ $scope.imgShow = false;
|
|
|
+ } else {
|
|
|
+ $scope.bannerShow = false;
|
|
|
+ $scope.imgAnmiation = true;
|
|
|
+ }
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
@@ -24415,7 +24397,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
AccountEnterprise.getB2cUrl({}, function(data) {
|
|
|
window.location.href = data.url + '/search?w=' + encodeURI($scope.keyword) + '&type=' + $scope.searchType;
|
|
|
});
|
|
|
- console.log(window.location.href, '123')
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -24455,15 +24436,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
keyword: $scope.keyword,
|
|
|
type: $scope.searchType
|
|
|
};
|
|
|
-
|
|
|
- $http.get('search/similarKeywords', {
|
|
|
- params : params
|
|
|
- }).success(function(data){
|
|
|
- $scope.associates = data;// 联想词数组
|
|
|
- console.log('1', data)
|
|
|
- }).error(function(response) {
|
|
|
- console.log(response)
|
|
|
- });
|
|
|
+ AccountEnterprise.getB2cUrl({}, function(data) {
|
|
|
+ $http.get(data.url + '/search/similarKeywords', {
|
|
|
+ params : params
|
|
|
+ }).success(function(data){
|
|
|
+ $scope.associates = data;// 联想词数组
|
|
|
+ }).error(function(response) {
|
|
|
+ console.log(response)
|
|
|
+ });
|
|
|
+ })
|
|
|
} else {
|
|
|
$scope.associates = [];// 联想词数组
|
|
|
}
|
|
|
@@ -24487,10 +24468,17 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
|
|
|
// 热词
|
|
|
- $scope.hotwords = [{name : 'SCT2080KEC', url :'product#/component/1100400300009990/'},
|
|
|
- {name : '电池组', url : 'product#/kinds/346'},
|
|
|
- {name : 'Vishay',url : 'product#/brand/30327265e42a871be050007f01003d96/'},
|
|
|
- {name : 'Panasonic Battery', url : 'product#/brand/30327265e4e7871be050007f01003d96/'}];
|
|
|
+ $scope.hotwords = [{name : 'SCT2080KEC', url : 'product/component/1100400300009990/', id : 0},
|
|
|
+ {name : '电池组', url : 'product/kinds/346', id : 1},
|
|
|
+ {name : 'Vishay',url : 'product/brand/30327265e42a871be050007f01003d96/', id : 2},
|
|
|
+ {name : 'Panasonic Battery', url : 'product/brand/30327265e4e7871be050007f01003d96/', id : 3}];
|
|
|
+
|
|
|
+ // 热门搜索跳转
|
|
|
+ angular.forEach($scope.hotwords, function (value, key) {
|
|
|
+ AccountEnterprise.getB2cUrl({}, function(data) {
|
|
|
+ $scope.hotwords[key].url = data.url + '/' + value.url
|
|
|
+ })
|
|
|
+ })
|
|
|
|
|
|
// 跳转到B2C
|
|
|
$scope.b2cLink = function (url) {
|
|
|
@@ -24504,17 +24492,17 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
/**
|
|
|
* 树结构
|
|
|
*/
|
|
|
- app.controller('treeController', function($scope){
|
|
|
+ app.controller('treeController', function($scope, $location){
|
|
|
$scope.roleList = [
|
|
|
- { "roleName" : "卖家中心(销售)", "roleId" : "role1", "children" : [
|
|
|
- { "roleName" : "商务管理", "roleId" : "role1-1", "collapsed" : true, "children" : [
|
|
|
+ { "roleName" : "卖家中心(销售)", "roleId" : "role1", 'path': 'sale', level: 0, collapsed: true, "children" : [
|
|
|
+ { "roleName" : "商务管理", "roleId" : "role1-1", collapsed: true, "children" : [
|
|
|
{ "roleName" : "客户采购询价", "roleId" : "role1-1-1", 'link' : '#/sale/inquiry', "children" : [] },
|
|
|
{ "roleName" : "客户公共询价", "roleId" : "role1-1-2", 'link' : '#/sale/pubinquiry', "children" : [] },
|
|
|
{ "roleName" : "客户模具询价", "roleId" : "role1-1-3", 'link' : '#/sale/mould', "children" : [] },
|
|
|
{ "roleName" : "主动报价", "roleId" : "role1-1-4", 'link' : '#/sale/quotation/list', "children" : [] },
|
|
|
{ "roleName" : "客户招标", "roleId" : "role1-1-5", 'link' : '#/sale/tender', "children" : [] }
|
|
|
] },
|
|
|
- { "roleName" : "订单管理", "roleId" : "role1-2", "collapsed" : true, "children" : [
|
|
|
+ { "roleName" : "订单管理", "roleId" : "role1-2", collapsed: true, "children" : [
|
|
|
{ "roleName" : "客户采购订单", "roleId" : "role1-2-1", 'link' : '#/sale/order', "children" : [] },
|
|
|
{ "roleName" : "客户采购变更单", "roleId" : "role1-2-2", 'link' : '#/sale/change', "children" : [] },
|
|
|
{ "roleName" : "客户委外单", "roleId" : "role1-2-3", 'link' : '#/sale/maketodo/makeorder', "children" : [] },
|
|
|
@@ -24522,7 +24510,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
{ "roleName" : "客户发货提醒", "roleId" : "role1-2-5", 'link' : '#/sale/notice', "children" : [] },
|
|
|
{ "roleName" : "发货单", "roleId" : "role1-2-6", 'link' : '#/sale/send', "children" : [] }
|
|
|
]},
|
|
|
- { "roleName" : "客户出入库", "roleId" : "role1-3", "collapsed" : true, "children" : [
|
|
|
+ { "roleName" : "客户出入库", "roleId" : "role1-3", collapsed: true, "children" : [
|
|
|
{ "roleName" : "MRB单", "roleId" : "role1211", 'link' : '#/sale/MRB', "children" : [] },
|
|
|
{ "roleName" : "不良品出库单", "roleId" : "role1-3-1", 'link' : '#/sale/badOut', "children" : [] },
|
|
|
{ "roleName" : "不良品入库单", "roleId" : "role1-3-2", 'link' : '#/sale/badIn', "children" : [] },
|
|
|
@@ -24531,19 +24519,19 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
{ "roleName" : "客户委外验收单", "roleId" : "role1-3-5", 'link' : '#/sale/makeaccept', "children" : [] },
|
|
|
{ "roleName" : "客户委外验退单", "roleId" : "role1-3-6", 'link' : '#/sale/makereturns', "children" : [] }
|
|
|
] },
|
|
|
- { "roleName" : "样品管理", "roleId" : "role1-4", "collapsed" : true, "children" : [
|
|
|
+ { "roleName" : "样品管理", "roleId" : "role1-4", collapsed: true, "children" : [
|
|
|
{ "roleName" : "客户打样申请", "roleId" : "role1-4-1", 'link' : '#/sale/sample', "children" : [] },
|
|
|
{ "roleName" : "客户认定单", "roleId" : "role1-4-2", 'link' : '#/sale/approval', "children" : [] }
|
|
|
] },
|
|
|
- { "roleName" : "基础资料", "roleId" : "role1-5", "collapsed" : true, "children" : [
|
|
|
+ { "roleName" : "基础资料", "roleId" : "role1-5", collapsed: true, "children" : [
|
|
|
{ "roleName" : "客户资料", "roleId" : "role1-5-1", 'link' : '#/sale/customer', "children" : [] },
|
|
|
{ "roleName" : "绩效考核", "roleId" : "role1-5-2", 'link' : '#/sale/vendorPerformanceAssess', "children" : [] },
|
|
|
{ "roleName" : "产品导入", "roleId" : "role1-5-3", 'link' : '#/sale/prodList', "children" : [] }
|
|
|
- ] },
|
|
|
+ ] }
|
|
|
]},
|
|
|
|
|
|
- { "roleName" : "买家中心(采购)", "roleId" : "role2", "children" : [
|
|
|
- { "roleName" : "采购管理", "roleId" : "role2-1", "collapsed" : true, "children" : [
|
|
|
+ { "roleName" : "买家中心(采购)", "roleId" : "role2", 'path': 'purc', level: 0, collapsed: true, "children" : [
|
|
|
+ { "roleName" : "采购管理", "roleId" : "role2-1", collapsed: true, "children" : [
|
|
|
{ "roleName" : "供应商资料", "roleId" : "role2-1-1", 'link' : '#/purc/vendor', "children" : [] },
|
|
|
{ "roleName" : "供应商服务", "roleId" : "role2-1-2", 'link' : '#/purc/vendor/serve', "children" : [] },
|
|
|
{ "roleName" : "采购物料", "roleId" : "role2-1-3", 'link' : '#/purc/product', "children" : [] },
|
|
|
@@ -24557,19 +24545,19 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
] }
|
|
|
]},
|
|
|
|
|
|
- { "roleName" : "财务", "roleId" : "role3", "children" : [
|
|
|
- { "roleName" : "应收", "roleId" : "role3-1", "collapsed" : true, "children" : [
|
|
|
+ { "roleName" : "财务", "roleId" : "role3", 'path': 'fa', level: 0, collapsed: true, "children" : [
|
|
|
+ { "roleName" : "应收", "roleId" : "role3-1", collapsed: true, "children" : [
|
|
|
{ "roleName" : "发票", "roleId" : "role3-1-1", 'link' : '#/fa/apBill', "children" : [] },
|
|
|
{ "roleName" : "应收对账单", "roleId" : "role3-1-2", 'link' : '#/fa/apCheck', "children" : [] }
|
|
|
] },
|
|
|
- { "roleName" : "应付", "roleId" : "role3-2", "collapsed" : true, "children" : [
|
|
|
+ { "roleName" : "应付", "roleId" : "role3-2", collapsed: true, "children" : [
|
|
|
{ "roleName" : "应付对账单", "roleId" : "role3-2-1", 'link' : '#/fa/arCheck', "children" : [] }
|
|
|
]}
|
|
|
]},
|
|
|
- { "roleName" : "企业圈", "roleId" : "role4", 'link' : '#/baseInfo/enterpriseList', "children" : [
|
|
|
+ { "roleName" : "企业圈", "roleId" : "role4", 'link' : '#/baseInfo/enterpriseList', level: 0, "children" : [
|
|
|
]},
|
|
|
- { "roleName" : "基础设置", "roleId" : "role5", "children" : [
|
|
|
- { "roleName" : "企业设置", "roleId" : "role5-1", "collapsed" : true, "children" : [
|
|
|
+ { "roleName" : "基础设置", "roleId" : "role5", 'path': 'approvalFlow', collapsed: true, level: 0, "children" : [
|
|
|
+ { "roleName" : "企业设置", "roleId" : "role5-1", collapsed: true, "children" : [
|
|
|
{ "roleName" : "企业信息", "roleId" : "role5-1-1", 'link' : '#/approvalFlow/enterprise', "children" : [] },
|
|
|
{ "roleName" : "物料信息", "roleId" : "role5-1-2", 'link' : '#/approvalFlow/product', "children" : [] },
|
|
|
{ "roleName" : "我的产品库", "roleId" : "role5-1-3", 'link' : '#/approvalFlow/userProduct', "children" : [] },
|
|
|
@@ -24580,14 +24568,79 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
]}
|
|
|
]}
|
|
|
];
|
|
|
+ $scope.currentObj = {};
|
|
|
+ var hasChildrenObj = function (target) {
|
|
|
+ var flag = false;
|
|
|
+ if ($scope.currentObj.roleId && target && target.children) {
|
|
|
+ angular.forEach(target.children, function (item) {
|
|
|
+ if (item.roleId == $scope.currentObj.roleId) {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ if (item.children.length && hasChildrenObj(item)) {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+ }
|
|
|
+ var roopCall = function (arr, callBack) {
|
|
|
+ angular.forEach(arr, function (item) {
|
|
|
+ if (item.children && item.children.length) {
|
|
|
+ roopCall(item.children, callBack);
|
|
|
+ }
|
|
|
+ callBack(item);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ var initObj = function (arr, flag) {
|
|
|
+ angular.forEach(arr, function (item) {
|
|
|
+ if (flag) {
|
|
|
+ item.collapsed = false;
|
|
|
+ }
|
|
|
+ if (item.children && item.children.length) {
|
|
|
+ initObj(item.children, item.path && item.path == $location.$$path.split('/')[1]);
|
|
|
+ } else {
|
|
|
+ if (item.link && item.link.split('#')[1] == $location.$$path) {
|
|
|
+ item.selected = 'selected';
|
|
|
+ $scope.currentObj = item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ initObj($scope.roleList);
|
|
|
+ var initClose = function () {
|
|
|
+ roopCall($scope.roleList, function (item) {
|
|
|
+ item.collapsed = !hasChildrenObj(item);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ initClose();
|
|
|
+ var closeRow = function (arr) {
|
|
|
+ angular.forEach(arr, function (item) {
|
|
|
+ item.selected = undefined;
|
|
|
+ if (item.children) {
|
|
|
+ closeRow(item.children);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
$scope.$watch( 'myTree.currentNode', function( newObj, oldObj ) {
|
|
|
if( $scope.myTree && angular.isObject($scope.myTree.currentNode) ) {
|
|
|
- console.log( 'Node Selected!!' );
|
|
|
- // console.log( $scope.myTree.currentNode );
|
|
|
- console.log(newObj, '123');
|
|
|
+ $scope.currentObj = newObj;
|
|
|
if (newObj.link) {
|
|
|
window.location.href = newObj.link
|
|
|
}
|
|
|
+ closeRow($scope.roleList);
|
|
|
+ newObj.selected = 'selected';
|
|
|
+ roopCall($scope.roleList, function (item) {
|
|
|
+ // if ((!hasChildrenObj(item) && (item.roleId != $scope.currentObj.roleId))) {
|
|
|
+ // item.collapsed = true;
|
|
|
+ // }
|
|
|
+ // if ($scope.currentObj.roleId == item.roleId && item.children.length) {
|
|
|
+ // // angular.forEach(item.children, function (obj) {
|
|
|
+ // // obj.col
|
|
|
+ // // })
|
|
|
+ // item.collapsed = false;
|
|
|
+ // }
|
|
|
+ item.collapsed = !hasChildrenObj(item) && (item.roleId != $scope.currentObj.roleId);
|
|
|
+ })
|
|
|
}
|
|
|
}, false);
|
|
|
})
|