|
|
@@ -1,6 +1,6 @@
|
|
|
-define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize'], function() {
|
|
|
+define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize', 'service/BaseInfo'], function() {
|
|
|
'use strict';
|
|
|
- var app = angular.module('myApp', [ 'toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule']);
|
|
|
+ var app = angular.module('myApp', [ 'toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices']);
|
|
|
app.init = function() {
|
|
|
angular.bootstrap(document, [ 'myApp' ]);
|
|
|
};
|
|
|
@@ -99,6 +99,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
url : "/order/:id",
|
|
|
templateUrl : "static/tpl/index/purc/order_detail.html",
|
|
|
controller: 'PurcOrderDetailCtrl'
|
|
|
+ }).state('purc.newOrder', {
|
|
|
+ url : "addOrder",
|
|
|
+ templateUrl : "static/tpl/index/purc/addOrder.html",
|
|
|
+ controller : 'PurcNewOrderCtrl'
|
|
|
}).state('sale.todo', {
|
|
|
url : "/todo",
|
|
|
templateUrl : "static/tpl/index/sale/todo.html"
|
|
|
@@ -130,7 +134,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
url : "/inquiry",
|
|
|
templateUrl : "static/tpl/index/sale/inquiry.html",
|
|
|
controller: 'SaleInquiryCtrl'
|
|
|
- //TODO 新添加模具询价
|
|
|
}).state('sale.inquirymould', {
|
|
|
url : "/mould",
|
|
|
templateUrl : "static/tpl/index/sale/inquiry_mould.html",
|
|
|
@@ -253,6 +256,63 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
url : "/role",
|
|
|
templateUrl : "static/tpl/index/account/role.html",
|
|
|
controller: 'RoleCtrl'
|
|
|
+ }).state('baseInfo', {//基础资料
|
|
|
+ //TODO
|
|
|
+ url : "/baseInfo",
|
|
|
+ views : {
|
|
|
+ "left-view" : {
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/left.html",
|
|
|
+ controller: 'LeftCtrl'
|
|
|
+
|
|
|
+ },
|
|
|
+ "right-view" : {
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/right.html"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).state('baseInfo.index', {
|
|
|
+ url : "",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/index.html",
|
|
|
+ controller: 'RightCtrl'
|
|
|
+ }).state('baseInfo.home', {
|
|
|
+ url : "/",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/index.html",
|
|
|
+ controller: 'RightCtrl'
|
|
|
+ }).state('baseInfo.prodList', {
|
|
|
+ url : "/prodList",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/prodList.html",
|
|
|
+ controller : 'ProductListCtrl'
|
|
|
+ }).state('baseInfo.uploadByBatch', {
|
|
|
+ url : "/uploadByBatch",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/uploadByBatch.html",
|
|
|
+ controller : 'UploadByBatchCtrl'
|
|
|
+ }).state('baseInfo.productDetail', {
|
|
|
+ url : "/prodList/:id",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/productDetail.html",
|
|
|
+ controller : 'ProductDetailCtrl'
|
|
|
+ }).state('baseInfo.newProdInfo', {
|
|
|
+ url : "/newProdInfo",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/newProdInfo.html",
|
|
|
+ controller : 'NewProdInfoCtrl'
|
|
|
+ }).state('baseInfo.enterpriseList', {
|
|
|
+ url : "/enterpriseList",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/enterpriseList.html",
|
|
|
+ controller : 'EnterpriseListCtrl'
|
|
|
+ }).state('baseInfo.myClient', {
|
|
|
+ url : "/myClient",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/myClient.html",
|
|
|
+ controller : 'MyClientCtrl'
|
|
|
+ }).state('baseInfo.mySupplier', {
|
|
|
+ url : "/mySupplier",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/mySupplier.html",
|
|
|
+ controller : 'MySupplierCtrl'
|
|
|
+ }).state('baseInfo.myRequest', {
|
|
|
+ url : "/myRquest",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/myRequest.html",
|
|
|
+ controller : 'AddPartnerRequestCtrl'
|
|
|
+ }).state('baseInfo.myMessage', {
|
|
|
+ url : "/myMessage",
|
|
|
+ templateUrl : "static/tpl/index/baseInfo/myMessage.html",
|
|
|
+ controller : 'AddPartnerMessageCtrl'
|
|
|
}).state('qc', {
|
|
|
url : "/qc",
|
|
|
views : {
|
|
|
@@ -577,6 +637,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.todo = data;
|
|
|
});
|
|
|
}]);
|
|
|
+
|
|
|
app.controller('TruckCtrl', ['$scope', '$rootScope', '$modal', 'SaleTruck', function($scope, $rootScope, $modal, SaleTruck){
|
|
|
SaleTruck.query({}, function(data){
|
|
|
$rootScope.truck = data;
|
|
|
@@ -1171,7 +1232,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
endDate: getDateTime($scope.condition.dateTo)
|
|
|
};
|
|
|
- console.log(getPurcStatus($scope.active));
|
|
|
PurcOrderItem[getPurcStatus($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
|
@@ -6753,5 +6813,915 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
};
|
|
|
}]);
|
|
|
|
|
|
+ /**
|
|
|
+ * 物料资料
|
|
|
+ */
|
|
|
+ app.controller('ProductListCtrl', ['$scope', 'GetProductInfo', 'ngTableParams', '$filter', 'BaseService', 'toaster', function($scope, GetProductInfo, ngTableParams, $filter, BaseService, toaster) {
|
|
|
+ $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 GetProductInfo;
|
|
|
+ };
|
|
|
+
|
|
|
+ $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 = $scope.keyword;
|
|
|
+ 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.deleteById = function(id) {
|
|
|
+ console.log(id);
|
|
|
+ GetProductInfo.deleteById({id: id}, function(data) {
|
|
|
+ toaster.pop("success", "提示", "删除成功");
|
|
|
+ }), function(response) {
|
|
|
+ toaster.pop("error", "删除失败", response);
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 物料批量上传
|
|
|
+ */
|
|
|
+ app.controller('UploadByBatchCtrl', ['$scope', 'GetProductInfo', '$upload', 'toaster', function($scope, GetProductInfo, $upload, toaster) {
|
|
|
+
|
|
|
+ // 通过excel批量上传物料
|
|
|
+ $scope.upload = function() {
|
|
|
+ var file = $scope.myFiles[0];
|
|
|
+ $upload.upload({
|
|
|
+ url: 'product/baseInfo/release/excel',
|
|
|
+ file: file,
|
|
|
+ method: 'POST'
|
|
|
+ }).success(function(data) {
|
|
|
+ console.log(data);
|
|
|
+ $scope.result = data;
|
|
|
+ $scope.success = $scope.result.success;
|
|
|
+ $scope.total = $scope.result.total;
|
|
|
+ $scope.alters = $scope.result.alters;
|
|
|
+ }).error(function(response) {
|
|
|
+ toaster.pop('error', response.data || response);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 查看范例
|
|
|
+ $scope.showImg = function() {
|
|
|
+ var src = "static/img/product/excel_releaseByBatch_eg.png", box = $('#image-box');
|
|
|
+ box.show();
|
|
|
+ box.find('img').attr('src', src);
|
|
|
+ box.find('a').click(function(){
|
|
|
+ box.hide();
|
|
|
+ });
|
|
|
+ box.dblclick(function(){
|
|
|
+ box.hide();
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 下载模板
|
|
|
+ $scope.download = function() {
|
|
|
+ window.location.href = 'product/baseInfo/upload/template';
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 物料详情
|
|
|
+ */
|
|
|
+ app.controller('ProductDetailCtrl', ['$scope', 'GetProductInfo', '$upload', 'ngTableParams', '$stateParams', 'toaster', function($scope, GetProductInfo, $upload, ngTableParams, $stateParams, toaster) {
|
|
|
+ var loadData = function() {
|
|
|
+ GetProductInfo.getOne({id: $stateParams.id}, function(data) {
|
|
|
+ $scope.prodInfo = data;
|
|
|
+ $scope.prodInfo.$editing = false;
|
|
|
+ $scope.loading = false;
|
|
|
+ });
|
|
|
+ };
|
|
|
+ loadData();
|
|
|
+
|
|
|
+ // 更新
|
|
|
+ $scope.update = function() {
|
|
|
+ $scope.prodInfo.$editing = true;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 取消
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $scope.prodInfo.$editing = false;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.submit = function(prodInfo) {
|
|
|
+ console.log(prodInfo);
|
|
|
+ GetProductInfo.update({}, prodInfo, function(data) {
|
|
|
+ toaster.pop("success", "提示", "提交成功");
|
|
|
+ }, function(res) {
|
|
|
+ toaster.pop("error", "提示" + res);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增物料
|
|
|
+ */
|
|
|
+ app.controller('NewProdInfoCtrl', ['$scope', 'GetProductInfo', '$upload', 'ngTableParams', '$stateParams', 'toaster', '$modal', 'ComponentActive', 'KindAPI', function($scope, GetProductInfo, $upload, ngTableParams, $stateParams, toaster, $modal, ComponentActive, KindAPI) {
|
|
|
+
|
|
|
+ $scope.prodInfo = {unit: 'PCS'};
|
|
|
+ // 选择类目
|
|
|
+ $scope.selectKind = function(uuids) {
|
|
|
+ $modal.open({
|
|
|
+ animation: true,
|
|
|
+ size: 'lg',
|
|
|
+ templateUrl: 'static/tpl/index/baseInfo/modal/product_kindChoose_modal.html',
|
|
|
+ controller: 'KindChooseCtrl',
|
|
|
+ }).result.then(function(data){
|
|
|
+ $scope.kindId = data;
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ templateUrl: 'static/tpl/index/baseInfo/modal/Component_KindChoose_modal.html',
|
|
|
+ controller: 'FindComponentCtrl',
|
|
|
+ size: 'lg',
|
|
|
+ resolve: {
|
|
|
+ KindId: function() {
|
|
|
+ return $scope.kindId;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ modalInstance.result.then(function(data) {
|
|
|
+ $scope.prodInfo.cmpUuId = data.uuid;
|
|
|
+ $scope.prodInfo.cmpCode = data.code;
|
|
|
+ $scope.prodInfo.brand = data.brand.nameEn;
|
|
|
+ }, function(){
|
|
|
+
|
|
|
+ });
|
|
|
+ }, function(){
|
|
|
+
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ //提交
|
|
|
+ $scope.submit = function(prodInfo){
|
|
|
+ GetProductInfo.addNewProd({}, prodInfo, function(data) {
|
|
|
+ toaster.pop("success", "提示", "提交成功");
|
|
|
+ //提交后跳转到详情页面,防止重复提交
|
|
|
+ window.location.href="#/baseInfo/prodList/"+data.id;
|
|
|
+ }, function(res) {
|
|
|
+ toaster.pop("error", "提示" + res);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 取消
|
|
|
+ $scope.cancel = function(){
|
|
|
+ $scope.prodInfo = angular.copy($scope.prodInfo);
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 类目选择模态框
|
|
|
+ */
|
|
|
+ app.controller('KindChooseCtrl', ['$scope', 'KindAPI', 'toaster', '$modalInstance', '$modal', function($scope, KindAPI, toaster, $modalInstance, $modal) {
|
|
|
+ $scope.kindId = null;
|
|
|
+ $scope.kinds = [[], [], [], []];
|
|
|
+ // 获取子类目
|
|
|
+ var getChildren = function(pid, deep) {
|
|
|
+ KindAPI.getChildren({parentId: pid}, function(data) {
|
|
|
+ $scope.kinds[deep] = data;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '获取子类目失败', response.data);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 改变节点选中状态
|
|
|
+ var changeStatus = function(item, deep) {
|
|
|
+ var kindId = null, level = 0;
|
|
|
+ angular.forEach($scope.kinds, function(ks, i) {
|
|
|
+ if(i > deep) {
|
|
|
+ $scope.kinds[i] = [];
|
|
|
+ } else {
|
|
|
+ angular.forEach(ks, function(k, j) {
|
|
|
+ if(i == deep) {
|
|
|
+ if(k.id == item.id) {
|
|
|
+ $scope.kinds[i][j].$active = true;
|
|
|
+ kindId = k.id;
|
|
|
+ } else {
|
|
|
+ k.$active = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 选择的节点
|
|
|
+ $scope.kindId = kindId;
|
|
|
+ $scope.active = item;
|
|
|
+ // 当前可操作的层级
|
|
|
+ if(deep < 3) {
|
|
|
+ $scope.activeDeep = deep + 1;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 节点点击后获取子类目,节点被选中
|
|
|
+ $scope.onItemClick = function(item, deep) {
|
|
|
+ changeStatus(item, deep);
|
|
|
+ if (!item.isLeaf) {
|
|
|
+ getChildren(item.id, deep + 1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 重新加载数据
|
|
|
+ function reload(deep) {
|
|
|
+ var pid;
|
|
|
+ if(deep) {
|
|
|
+ pid = $scope.actives[deep - 1].id;
|
|
|
+ } else {
|
|
|
+ pid = 0;
|
|
|
+ deep = 0;
|
|
|
+ }
|
|
|
+ getChildren(pid, deep);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 初始加载数据,获取第一层的类目
|
|
|
+ if($scope.actives) {
|
|
|
+ angular.forEach($scope.actives, function(v, k) {
|
|
|
+ KindAPI.getChildren({parentId: v.parentid}, function(data) {
|
|
|
+ $scope.kinds[k] = data;
|
|
|
+ angular.forEach($scope.kinds[k], function(kind, i){
|
|
|
+ if(kind.id == v.id) {
|
|
|
+ $scope.kinds[k][i].$active = true;
|
|
|
+ $scope.actives[k] = $scope.kinds[k][i];
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '获取子类目失败', response.data);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ reload();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 取消
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ };
|
|
|
+
|
|
|
+ // 确认选择
|
|
|
+ $scope.check = function() {
|
|
|
+ $modalInstance.close($scope.kindId);
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 器件筛选
|
|
|
+ */
|
|
|
+ app.controller('FindComponentCtrl', ['$scope', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'ComponentActive', 'KindId', function($scope, BaseService, ngTableParams, toaster, $modalInstance, ComponentActive, KindId) {
|
|
|
+ //状态
|
|
|
+ $scope.setActive = function (state){
|
|
|
+ if($scope.active != state) {
|
|
|
+ $scope.active = state;
|
|
|
+ if($scope.tableParams.page() == 1)
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ else
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ $scope.tableParams = 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;
|
|
|
+ pageParams.kindId = KindId;
|
|
|
+ ComponentActive.getComponentsByKindid(BaseService.parseParams(pageParams), function(page) {
|
|
|
+ console.log(page);
|
|
|
+ $scope.loading = false;
|
|
|
+ if(page) {
|
|
|
+ params.total(page.totalElement);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ $scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
|
|
|
+ }
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 取消
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ };
|
|
|
+
|
|
|
+ // 选择
|
|
|
+ $scope.check = function(data){
|
|
|
+ $modalInstance.close(data);
|
|
|
+ };
|
|
|
+
|
|
|
+ // 搜索框回车
|
|
|
+ $scope.onSearch = function() {
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 企业列表
|
|
|
+ */
|
|
|
+ app.controller('EnterpriseListCtrl', ['$scope', 'EnterpriseList', 'ngTableParams', '$filter', 'BaseService', 'toaster', 'AddPartner', function($scope, EnterpriseList, ngTableParams, $filter, BaseService, toaster, AddPartner) {
|
|
|
+ $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 EnterpriseList;
|
|
|
+ };
|
|
|
+
|
|
|
+ $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 = $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);
|
|
|
+ $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(uu) {
|
|
|
+ console.log(uu);
|
|
|
+ AddPartner.addPartner({uu: uu}, {}, function(data) {
|
|
|
+ toaster.pop('success', '提示', '请求发送成功');
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error','失败',response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增采购单
|
|
|
+ */
|
|
|
+ app.controller('PurcNewOrderCtrl',['$scope', '$modal', 'toaster', '$filter', 'newPurcOrder', function($scope, $modal, toaster, $filter, newPurcOrder) {
|
|
|
+ $scope.order = {
|
|
|
+ date : new Date(),
|
|
|
+ cust : {
|
|
|
+ uu : '',
|
|
|
+ },
|
|
|
+ orderItems : {
|
|
|
+ product : {},
|
|
|
+ $endDateOpen: false
|
|
|
+ },
|
|
|
+ };
|
|
|
+ // 查找客户
|
|
|
+ $scope.dbfindCust = function(){
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ templateUrl: 'static/tpl/index/purc/modal/purc_order_cust.html',
|
|
|
+ controller: 'DbfindCustCtrl',
|
|
|
+ size: 'lg',
|
|
|
+ resolve: {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ modalInstance.result.then(function(data) {
|
|
|
+ $scope.order.cust = data.myEnterprise;
|
|
|
+ $scope.order.custUser = data.myUser;
|
|
|
+ }, function(){
|
|
|
+
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ //商品信息
|
|
|
+ $scope.order.orderItems = [];
|
|
|
+ var item = {
|
|
|
+ code: null,
|
|
|
+ title: null,
|
|
|
+ spec: null,
|
|
|
+ unit: null,
|
|
|
+ qty: null,
|
|
|
+ price: null,
|
|
|
+ remark: null,
|
|
|
+ delivery: null
|
|
|
+ };
|
|
|
+ $scope.order.orderItems.push(item);
|
|
|
+ //增加商品
|
|
|
+ $scope.addProduct = function() {
|
|
|
+ $scope.order.orderItems.push({code: null, title: null, spec: null, unit: null, qty: null, price: null, remark: null, delivery: null});
|
|
|
+ };
|
|
|
+ //删除商品
|
|
|
+ $scope.deleteProduct = function(index) {
|
|
|
+ $scope.order.orderItems.splice(index, 1);
|
|
|
+ };
|
|
|
+
|
|
|
+ // 查找客户物料
|
|
|
+ $scope.dbfindCustProd = function(){
|
|
|
+ if($scope.order.cust.uu) {
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ templateUrl: 'static/tpl/index/purc/modal/purc_order_custProd.html',
|
|
|
+ controller: 'DbfindCustProdCtrl',
|
|
|
+ size: 'lg',
|
|
|
+ resolve: {
|
|
|
+ custUU: function() {
|
|
|
+ return $scope.order.cust.uu
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ modalInstance.result.then(function(data) {
|
|
|
+ $scope.order.orderItems.push(data);
|
|
|
+ for(var i = 0; i < $scope.order.orderItems.length; i++) {
|
|
|
+ if($scope.order.orderItems[i].code == null) {
|
|
|
+ $scope.order.orderItems.splice(i, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, function() {
|
|
|
+
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ toaster.pop('info', '提示', '请先选择供应商');
|
|
|
+ }
|
|
|
+ };
|
|
|
+ $scope.getMinDate = function(item) {
|
|
|
+ return $filter('date')(new Date, 'yyyy-MM-dd');
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.openDatePicker = function($event, openParam, index) {
|
|
|
+ $event.preventDefault();
|
|
|
+ $event.stopPropagation();
|
|
|
+ $scope.order.orderItems[index].$endDateOpen = !openParam;
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ // 保存
|
|
|
+ $scope.save = function(order){
|
|
|
+ $scope.loading = true;
|
|
|
+ if(!$scope.order.code) //新增,设单号
|
|
|
+ $scope.order.code = 'BMP' + $filter('date')(new Date(), 'yyMMddHHmmss_sss');
|
|
|
+ $scope.order.custUU = $scope.order.cust.uu;
|
|
|
+ $scope.order.custUserUU = $scope.order.custUser.userUU;
|
|
|
+ if($scope.order.date instanceof Date) {
|
|
|
+ $scope.order.date = $scope.order.date.getTime();
|
|
|
+ }
|
|
|
+ for(var i = 0; i < $scope.order.orderItems.length; i++) {
|
|
|
+ if($scope.order.orderItems[i].delivery instanceof Date) {
|
|
|
+ $scope.order.orderItems[i].delivery = $scope.order.orderItems[i].delivery.getTime();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(order);
|
|
|
+ newPurcOrder.save({}, $scope.order, function(data){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('success', '成功', '保存成功');
|
|
|
+ window.location.hash = '#/purc/order/'+data.id;
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '保存失败', response.data);
|
|
|
+ });
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 我的客户
|
|
|
+ */
|
|
|
+ app.controller('MyClientCtrl', ['$scope', 'VendorService', 'BaseService','AuthenticationService', 'ngTableParams', '$modal','toaster', function($scope, VendorService, BaseService, AuthenticationService,ngTableParams,$modal, toaster){
|
|
|
+ $scope.userInfoResult = true;
|
|
|
+ AuthenticationService.getAuthentication().success(function(data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ $scope.thisUser = data;
|
|
|
+ });
|
|
|
+ var getCustInfos = function(custuu) {
|
|
|
+ if(custuu) {
|
|
|
+ VendorService.userInfo.query({uu:custuu},null,function(data) {
|
|
|
+ $scope.custInfos = data;
|
|
|
+ var getPage = function(page, size){
|
|
|
+ if($scope.custInfos) {
|
|
|
+ var result = {};
|
|
|
+ result.totalCount = $scope.custInfos.length;
|
|
|
+ result.content = $scope.custInfos.slice((page - 1)*size, page * size);
|
|
|
+ if($scope.custInfos.length % size == 0) {
|
|
|
+ result.totalPage = ($scope.custInfos.length - $scope.custInfos.length % size) / size;
|
|
|
+ }else {
|
|
|
+ result.totalPage = ($scope.custInfos.length - $scope.custInfos.length % size) / size + 1;
|
|
|
+ }
|
|
|
+ result.first = page == 1;
|
|
|
+ result.last = page == result.totalPage;
|
|
|
+ result.page = page;
|
|
|
+ result.next = page - 0 + 1;
|
|
|
+ result.pre = page - 1;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $scope.userdata = getPage(1,4);
|
|
|
+ $scope.first = function (){
|
|
|
+ $scope.userdata = getPage($scope.userdata.pre,4);
|
|
|
+ }
|
|
|
+ $scope.last = function (){
|
|
|
+ $scope.userdata = getPage($scope.userdata.next,4);
|
|
|
+ }
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $scope.addUserInfo = function(customer) {
|
|
|
+ //TODO
|
|
|
+ if ($scope.thisUser.sys) {
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ animation: true,
|
|
|
+ templateUrl: 'static/tpl/index/account/add_userInfo.html',
|
|
|
+ controller: 'AddUserInfoCtrl',
|
|
|
+ resolve: {
|
|
|
+ customer: function() {
|
|
|
+ return customer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ modalInstance.result.then(function(changed, checked){
|
|
|
+ if(changed) {
|
|
|
+ if(checked)
|
|
|
+ $scope.newUser.roles = checked;
|
|
|
+ else
|
|
|
+ loadUsers();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ } else {
|
|
|
+ toaster.pop('error', '您不是管理员,无权限分配用户!');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $scope.showUserInfo = function(customer,boo) {
|
|
|
+ $scope.custInfo = customer;
|
|
|
+ if(boo) {
|
|
|
+ getCustInfos(customer.myEnterprise.uu);
|
|
|
+ $scope.userInfoResult = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $scope.customerParams = new ngTableParams({
|
|
|
+ page : 1,
|
|
|
+ count : 10
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
+ getData : function($defer, params) {
|
|
|
+ $scope.loading = true;
|
|
|
+ VendorService.customer.get(BaseService.parseParams(params.url()), function(page){
|
|
|
+ $scope.loading = false;
|
|
|
+ if(page) {
|
|
|
+ params.total(page.totalElements);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ }
|
|
|
+ $scope.totalCount = page.totalElements;
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 我的供应商
|
|
|
+ */
|
|
|
+ app.controller('MySupplierCtrl', ['$scope', 'VendorService', 'BaseService','AuthenticationService', 'ngTableParams', '$modal','toaster', function($scope, VendorService, BaseService, AuthenticationService,ngTableParams,$modal, toaster){
|
|
|
+ $scope.userInfoResult = true;
|
|
|
+ AuthenticationService.getAuthentication().success(function(data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ $scope.thisUser = data;
|
|
|
+ });
|
|
|
+ var getCustInfos = function(custuu) {
|
|
|
+ if(custuu) {
|
|
|
+ VendorService.userInfo.query({uu:custuu},null,function(data) {
|
|
|
+ $scope.custInfos = data;
|
|
|
+ var getPage = function(page, size){
|
|
|
+ if($scope.custInfos) {
|
|
|
+ var result = {};
|
|
|
+ result.totalCount = $scope.custInfos.length;
|
|
|
+ result.content = $scope.custInfos.slice((page - 1)*size, page * size);
|
|
|
+ if($scope.custInfos.length % size == 0) {
|
|
|
+ result.totalPage = ($scope.custInfos.length - $scope.custInfos.length % size) / size;
|
|
|
+ }else {
|
|
|
+ result.totalPage = ($scope.custInfos.length - $scope.custInfos.length % size) / size + 1;
|
|
|
+ }
|
|
|
+ result.first = page == 1;
|
|
|
+ result.last = page == result.totalPage;
|
|
|
+ result.page = page;
|
|
|
+ result.next = page - 0 + 1;
|
|
|
+ result.pre = page - 1;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $scope.userdata = getPage(1,4);
|
|
|
+ $scope.first = function (){
|
|
|
+ $scope.userdata = getPage($scope.userdata.pre,4);
|
|
|
+ }
|
|
|
+ $scope.last = function (){
|
|
|
+ $scope.userdata = getPage($scope.userdata.next,4);
|
|
|
+ }
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $scope.addUserInfo = function(customer) {
|
|
|
+ //TODO
|
|
|
+ if ($scope.thisUser.sys) {
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ animation: true,
|
|
|
+ templateUrl: 'static/tpl/index/account/add_userInfo.html',
|
|
|
+ controller: 'AddUserInfoCtrl',
|
|
|
+ resolve: {
|
|
|
+ customer: function() {
|
|
|
+ return customer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ modalInstance.result.then(function(changed, checked){
|
|
|
+ if(changed) {
|
|
|
+ if(checked)
|
|
|
+ $scope.newUser.roles = checked;
|
|
|
+ else
|
|
|
+ loadUsers();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ } else {
|
|
|
+ toaster.pop('error', '您不是管理员,无权限分配用户!');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $scope.showUserInfo = function(customer,boo) {
|
|
|
+ $scope.custInfo = customer;
|
|
|
+ if(boo) {
|
|
|
+ getCustInfos(customer.myEnterprise.uu);
|
|
|
+ $scope.userInfoResult = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $scope.customerParams = new ngTableParams({
|
|
|
+ page : 1,
|
|
|
+ count : 10
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
+ getData : function($defer, params) {
|
|
|
+ $scope.loading = true;
|
|
|
+ VendorService.customer.get(BaseService.parseParams(params.url()), function(page){
|
|
|
+ $scope.loading = false;
|
|
|
+ if(page) {
|
|
|
+ params.total(page.totalElements);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ }
|
|
|
+ $scope.totalCount = page.totalElements;
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 建立合作关系申请
|
|
|
+ */
|
|
|
+ app.controller('AddPartnerRequestCtrl', ['$scope', 'AddPartnerMyRequest', 'toaster', 'BaseService', 'ngTableParams', 'AddPartner', function($scope, AddPartnerMyRequest, toaster, BaseService, ngTableParams, AddPartner) {
|
|
|
+
|
|
|
+ $scope.active = 'todo';
|
|
|
+
|
|
|
+ var getRequestStatus = function(active) {
|
|
|
+ var fn = 'getAllRequest';
|
|
|
+ switch(active) {
|
|
|
+ case 'done':
|
|
|
+ fn = 'getRequestDone';break;
|
|
|
+ case 'todo':
|
|
|
+ fn = 'getRequestTodo';break;
|
|
|
+ case 'end':
|
|
|
+ fn = 'getRequestEnd';break;
|
|
|
+ }
|
|
|
+ return fn;
|
|
|
+ }
|
|
|
+ // 切换单据类型
|
|
|
+ $scope.setActive = function(state) {
|
|
|
+ if($scope.active != state) {
|
|
|
+ $scope.active = state;
|
|
|
+ if($scope.tableParams.page() == 1)
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ else
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 切换数据来源(正常数据 or 历史数据)
|
|
|
+ var getService = function() {
|
|
|
+ return AddPartnerMyRequest;
|
|
|
+ };
|
|
|
+ $scope.tableParams = new ngTableParams({ // ng-Table参数
|
|
|
+ page : 1,
|
|
|
+ count : 5,
|
|
|
+ sorting: {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ counts: [5, 10, 15, 25, 50],
|
|
|
+ getData : function($defer, params) { // 获取数据的方法
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ pageParams.searchFilter = { // 筛选条件
|
|
|
+ keyword: $scope.keyword,
|
|
|
+ };
|
|
|
+ getService()[getRequestStatus($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
+ console.log(page);
|
|
|
+ $scope.loading = false;
|
|
|
+ if(page) {
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ params.total(page.totalElements);
|
|
|
+ }
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 再次申请
|
|
|
+ $scope.reapply = function(id) {
|
|
|
+ AddPartner.reapply({id: id}, {}, function(data) {
|
|
|
+ toaster.pop('success', '提示', '请求发送成功');
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error','失败',response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 建立合作关系处理申请
|
|
|
+ */
|
|
|
+ app.controller('AddPartnerMessageCtrl', ['$scope', 'AddPartnerMyMessage', 'toaster', 'BaseService', 'ngTableParams', 'AddPartner', function($scope, AddPartnerMyMessage, toaster, BaseService, ngTableParams, AddPartner) {
|
|
|
+ $scope.active = 'todo';
|
|
|
+ var getMessagetStatus = function(active) {
|
|
|
+ var fn = 'getAllMessage';
|
|
|
+ switch(active) {
|
|
|
+ case 'done':
|
|
|
+ fn = 'getMessageDone';break;
|
|
|
+ case 'todo':
|
|
|
+ fn = 'getMessageTodo';break;
|
|
|
+ case 'end':
|
|
|
+ fn = 'getMessageEnd';break;
|
|
|
+ }
|
|
|
+ return fn;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 切换单据类型
|
|
|
+ $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 AddPartnerMyMessage;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.tableParams = new ngTableParams({ // ng-Table参数
|
|
|
+ page : 1,
|
|
|
+ count : 5,
|
|
|
+ sorting: {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ counts: [5, 10, 15, 25, 50],
|
|
|
+ getData : function($defer, params) { // 获取数据的方法
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ pageParams.searchFilter = { // 筛选条件
|
|
|
+ keyword: $scope.keyword,
|
|
|
+ };
|
|
|
+ getService()[getMessagetStatus($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
+ $scope.loading = false;
|
|
|
+ if(page) {
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ params.total(page.totalElements);
|
|
|
+ }
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 同意申请
|
|
|
+ $scope.agree = function(id) {
|
|
|
+ AddPartner.agreeRequest({id: id}, {}, function(data) {
|
|
|
+ toaster.pop('success', '提示', '操作成功');
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 拒绝申请
|
|
|
+ $scope.refuse = function(id, reason) {
|
|
|
+ AddPartner.refuseRequest({id: id, reason: reason}, {}, function(data) {
|
|
|
+ toaster.pop('success', '提示', '操作成功');
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
return app;
|
|
|
});
|