|
|
@@ -1,6 +1,6 @@
|
|
|
-define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize', 'service/BaseInfo', 'service/Cart', 'service/ApprovalFlow', 'service/DeputyOrder', 'service/Product', 'service/Token', 'service/ProductUsers', 'service/File', 'service/PublicInquiry', 'service/Customer', 'service/PurcChange'], function () {
|
|
|
+define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize', 'service/BaseInfo', 'service/Cart', 'service/ApprovalFlow', 'service/DeputyOrder', 'service/Product', 'service/Token', 'service/ProductUsers', 'service/File', 'service/PublicInquiry', 'service/Customer', 'service/PurcChange', 'angularTreeview'], function () {
|
|
|
'use strict';
|
|
|
- var app = angular.module('myApp', ['toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'common.directives', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices', 'CartServices', 'ApprvoalFlowService', 'DeputyOrderService', 'ProductInfoServices', 'TokenService', 'ProductUserService', 'ui.tour', 'FileService', 'publicInquiryService', 'CustomerService', 'changeService']);
|
|
|
+ var app = angular.module('myApp', ['toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'common.directives', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices', 'CartServices', 'ApprvoalFlowService', 'DeputyOrderService', 'ProductInfoServices', 'TokenService', 'ProductUserService', 'ui.tour', 'FileService', 'publicInquiryService', 'CustomerService', 'changeService', 'angularTreeview']);
|
|
|
app.init = function () {
|
|
|
angular.bootstrap(document, ['myApp']);
|
|
|
};
|
|
|
@@ -51,7 +51,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
url: "/sale",
|
|
|
views: {
|
|
|
"left-view": {
|
|
|
- templateUrl: "static/tpl/index/sale/left.html",
|
|
|
+ templateUrl: "static/tpl/index/common/leftAll.html",
|
|
|
controller: 'LeftCtrl'
|
|
|
},
|
|
|
"right-view": {
|
|
|
@@ -72,7 +72,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
url: "/purc",
|
|
|
views: {
|
|
|
"left-view": {
|
|
|
- templateUrl: "static/tpl/index/purc/left.html",
|
|
|
+ templateUrl: "static/tpl/index/common/leftAll.html",
|
|
|
controller: 'LeftCtrl'
|
|
|
},
|
|
|
"right-view": {
|
|
|
@@ -637,7 +637,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
url: "/fa",
|
|
|
views: {
|
|
|
"left-view": {
|
|
|
- templateUrl: "static/tpl/index/fa/left.html"
|
|
|
+ templateUrl: "static/tpl/index/common/leftAll.html"
|
|
|
},
|
|
|
"right-view": {
|
|
|
templateUrl: "static/tpl/index/fa/right.html"
|
|
|
@@ -746,7 +746,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
url: "/approvalFlow",
|
|
|
views: {
|
|
|
"left-view": {
|
|
|
- templateUrl: "static/tpl/index/approvalFlow/left.html"
|
|
|
+ templateUrl: "static/tpl/index/common/leftAll.html"
|
|
|
},
|
|
|
"right-view": {
|
|
|
templateUrl: "static/tpl/index/approvalFlow/right.html",
|
|
|
@@ -887,7 +887,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- app.controller('MyCtrl', ['$scope', '$rootScope', '$modal', 'toaster', function ($scope, $rootScope, $modal, toaster) {
|
|
|
+ app.controller('MyCtrl', ['$scope', '$rootScope', '$modal', 'toaster', 'AccountEnterprise', function ($scope, $rootScope, $modal, toaster, AccountEnterprise) {
|
|
|
$rootScope.$on('$locationChangeSuccess', function (evt, newUrl) {
|
|
|
var routeState = newUrl.substr(newUrl.indexOf('#/') + 2);
|
|
|
if (routeState.indexOf('/') > -1)
|
|
|
@@ -942,6 +942,12 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$rootScope.active = active;
|
|
|
window.location.href = "#/purc/purchaseinquiry";
|
|
|
}
|
|
|
+ // 跳转到B2C
|
|
|
+ $scope.b2cLink = function (url) {
|
|
|
+ AccountEnterprise.getB2cUrl({}, function(data) {
|
|
|
+ window.location.href = data.url + url;
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
}]);
|
|
|
|
|
|
@@ -1556,6 +1562,17 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ // 打开登录模态框
|
|
|
+ $scope.signinModal = function() {
|
|
|
+ // 跳转账户中心
|
|
|
+ AuthenticationService.redirectSignin();
|
|
|
+ };
|
|
|
+ // 注册
|
|
|
+ $scope.registerModal = function() {
|
|
|
+ // 跳转账户中心
|
|
|
+ AuthenticationService.redirectRegister();
|
|
|
+ };
|
|
|
+
|
|
|
$scope.switchto = function (enUU) {// 切换企业
|
|
|
AuthenticationService.reSignin(enUU).success(function (response) {
|
|
|
console.log(response);
|
|
|
@@ -1596,6 +1613,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
}]);
|
|
|
|
|
|
+
|
|
|
app.controller('LogOutCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance) {
|
|
|
$scope.close = function (confirm) {
|
|
|
$modalInstance.close(confirm);
|
|
|
@@ -24375,5 +24393,203 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
}]);
|
|
|
|
|
|
+ /**
|
|
|
+ * B2C搜索
|
|
|
+ */
|
|
|
+ app.controller('SearchCtrl', ['$scope', '$http', '$rootScope', 'SessionService', 'AccountEnterprise', function($scope, $http, $rootScope, SessionService, AccountEnterprise) {
|
|
|
+
|
|
|
+ // 默认搜索类型
|
|
|
+ $scope.searchType = 'component';
|
|
|
+
|
|
|
+ // 选搜索类型
|
|
|
+ $scope.setTypeClick = function (type) {
|
|
|
+ $scope.searchType = type
|
|
|
+ $scope.search()
|
|
|
+ };
|
|
|
+
|
|
|
+ // 搜索
|
|
|
+ $scope.search = function() {
|
|
|
+ if($scope.keyword) {
|
|
|
+ SessionService.set('brand', true);
|
|
|
+ SessionService.unset('component');
|
|
|
+ AccountEnterprise.getB2cUrl({}, function(data) {
|
|
|
+ window.location.href = data.url + '/search?w=' + encodeURI($scope.keyword) + '&type=' + $scope.searchType;
|
|
|
+ });
|
|
|
+ console.log(window.location.href, '123')
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 搜索框获得焦点,显示联想框
|
|
|
+ $scope.onFocus = function() {
|
|
|
+ $scope.associate = true;
|
|
|
+ $scope.selectIndex = -1;
|
|
|
+ if(!$scope.keyword) $scope.keyword = '';
|
|
|
+ };
|
|
|
+
|
|
|
+ // 搜索框失去焦点,关闭联想框
|
|
|
+ $scope.onBlur = function() {
|
|
|
+ $scope.associate = false;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 搜索框通过按键选取想要的联想词
|
|
|
+ $scope.onKeyup = function() {
|
|
|
+ if($scope.associates && $scope.associates.length) {
|
|
|
+ if(event.keyCode == 40) { //监听到按下键
|
|
|
+ $scope.selectIndex ++;
|
|
|
+ if($scope.selectIndex >= $scope.associates.length) $scope.selectIndex = 0;
|
|
|
+ $scope.keyword = $scope.associates[$scope.selectIndex];
|
|
|
+ } else if(event.keyCode == 38) { //监听到按上键
|
|
|
+ $scope.selectIndex --;
|
|
|
+ if($scope.selectIndex < 0) $scope.selectIndex = $scope.associates.length - 1;
|
|
|
+ $scope.keyword = $scope.keyword = $scope.associates[$scope.selectIndex];
|
|
|
+ } else if(event.keyCode == 13) { //确定键
|
|
|
+ $scope.search();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 输入框内容变化,获取新的联想词
|
|
|
+ $scope.onChange = function() {
|
|
|
+ if ($scope.keyword) {
|
|
|
+ var params = {
|
|
|
+ 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)
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $scope.associates = [];// 联想词数组
|
|
|
+ }
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ // 点击联想词
|
|
|
+ $scope.onAssociateClick = function(component) {
|
|
|
+ $scope.keyword = component;
|
|
|
+ $scope.search();
|
|
|
+ };
|
|
|
+
|
|
|
+ // 鼠标进入联想词框,不能关闭联想词框
|
|
|
+ $scope.onAssociateEnter = function() {
|
|
|
+ $scope.associateEnter = true;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 鼠标离开联想词框,可以关闭联想词框
|
|
|
+ $scope.onAssociateLeave = function() {
|
|
|
+ $scope.associateEnter = false;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 热词
|
|
|
+ $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/'}];
|
|
|
+
|
|
|
+ // 跳转到B2C
|
|
|
+ $scope.b2cLink = function (url) {
|
|
|
+ AccountEnterprise.getB2cUrl({}, function(data) {
|
|
|
+ window.location.href = data.url + url;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 树结构
|
|
|
+ */
|
|
|
+ app.controller('treeController', function($scope){
|
|
|
+ $scope.roleList = [
|
|
|
+ { "roleName" : "卖家中心(销售)", "roleId" : "role1", "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-1", 'link' : '#/sale/order', "children" : [] },
|
|
|
+ { "roleName" : "客户采购变更单", "roleId" : "role1-2-2", 'link' : '#/sale/change', "children" : [] },
|
|
|
+ { "roleName" : "客户委外单", "roleId" : "role1-2-3", 'link' : '#/sale/maketodo/makeorder', "children" : [] },
|
|
|
+ { "roleName" : "委外变更单", "roleId" : "role1-2-4", 'link' : '#/sale/makechange', "children" : [] },
|
|
|
+ { "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" : "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" : [] },
|
|
|
+ { "roleName" : "客户采购验收单", "roleId" : "role1-3-3", 'link' : '#/sale/accept', "children" : [] },
|
|
|
+ { "roleName" : "客户采购验退单", "roleId" : "role1-3-4", 'link' : '#/sale/returns', "children" : [] },
|
|
|
+ { "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-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-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-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" : [] },
|
|
|
+ { "roleName" : "采购招标", "roleId" : "role2-1-4", 'link' : '#/purc/tender', "children" : [] },
|
|
|
+ { "roleName" : "采购询价", "roleId" : "role2-1-5", 'link' : '#/purc/purchaseinquiry', "children" : [] },
|
|
|
+ { "roleName" : "公共询价", "roleId" : "role2-1-6", 'link' : '#/purc/publicInquiry', "children" : [] },
|
|
|
+ { "roleName" : "采购订单", "roleId" : "role2-1-7", 'link' : '#/purc/order', "children" : [] },
|
|
|
+ { "roleName" : "采购变更单", "roleId" : "role2-1-8", 'link' : '#/purc/change', "children" : [] },
|
|
|
+ { "roleName" : "代采订单", "roleId" : "role2-1-9", 'link' : '#/purc/deputy', "children" : [] },
|
|
|
+ { "roleName" : "委外订单", "roleId" : "role2-1-10", 'link' : '#/purc/makeoutorder', "children" : [] }
|
|
|
+ ] }
|
|
|
+ ]},
|
|
|
+
|
|
|
+ { "roleName" : "财务", "roleId" : "role3", "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-1", 'link' : '#/fa/arCheck', "children" : [] }
|
|
|
+ ]}
|
|
|
+ ]},
|
|
|
+ { "roleName" : "企业圈", "roleId" : "role4", 'link' : '#/baseInfo/enterpriseList', "children" : [
|
|
|
+ ]},
|
|
|
+ { "roleName" : "基础设置", "roleId" : "role5", "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" : [] },
|
|
|
+ { "roleName" : "人员信息", "roleId" : "role5-1-4", 'link' : '#/approvalFlow/user', "children" : [] },
|
|
|
+ { "roleName" : "角色权限", "roleId" : "role5-1-5", 'link' : '#/approvalFlow/role', "children" : [] },
|
|
|
+ { "roleName" : "审批流", "roleId" : "role5-1-6", 'link' : '#/approvalFlow/flow', "children" : [] },
|
|
|
+ { "roleName" : "操作日志", "roleId" : "role5-1-7", 'link' : '#/approvalFlow/log', "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');
|
|
|
+ if (newObj.link) {
|
|
|
+ window.location.href = newObj.link
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, false);
|
|
|
+ })
|
|
|
return app;
|
|
|
});
|