|
|
@@ -6714,13 +6714,20 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
-
|
|
|
- app.controller('EnterpriseCtrl', ['$scope', 'AccountEnterprise', 'toaster', '$state', '$modal', 'BaseService', 'ShipAddress', '$http', function($scope, AccountEnterprise, toaster, $state, $modal, BaseService, ShipAddress, $http){
|
|
|
+ // 企业信息设置
|
|
|
+ app.controller('EnterpriseCtrl', ['$scope', 'AccountEnterprise', 'toaster', '$state', '$modal', 'BaseService', 'ShipAddress', '$http', 'DeputyOrder', function($scope, AccountEnterprise, toaster, $state, $modal, BaseService, ShipAddress, $http, DeputyOrder){
|
|
|
BaseService.scrollBackToTop();
|
|
|
$scope.loading = true;
|
|
|
AccountEnterprise.get({}, function(data){
|
|
|
$scope.loading = false;
|
|
|
$scope.enterprise = data;
|
|
|
+
|
|
|
+ // 获取付款企业信息
|
|
|
+ DeputyOrder.paycompanies({enuu: $scope.enterprise.uu}, {}, function(data) {
|
|
|
+ $scope.pays = data;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
});
|
|
|
AccountEnterprise.growth({}, function(data){
|
|
|
if(data != null && data.length > 0) {
|
|
|
@@ -6778,6 +6785,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.ships = data;
|
|
|
});
|
|
|
|
|
|
+ // 判断是否是代采企业
|
|
|
+ DeputyOrder.isDeputyEnterprise({}, function(data) {
|
|
|
+ $scope.deputyEnter = data;
|
|
|
+ });
|
|
|
+
|
|
|
// 获取地址信息
|
|
|
$http.get('resources/citydata/city.json', {"Accept": "application/json;charset=utf-8", "Accept-Charset": "charset=utf-8"
|
|
|
}).then(function(response) {
|
|
|
@@ -6829,6 +6841,53 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+ // 新增付款企业
|
|
|
+ $scope.savePayCompany = function(pay) {
|
|
|
+ pay.address = pay.province + pay.city + pay.district;
|
|
|
+ DeputyOrder.savePaycompany( {}, pay, function(data) {
|
|
|
+ DeputyOrder.paycompanies({enuu: $scope.enterprise.uu}, {}, function(data) {
|
|
|
+ $scope.pays = data;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ toaster.pop('success', '提示', '保存成功');
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 删除付款企业
|
|
|
+ $scope.removePay = function(id, index) {
|
|
|
+ DeputyOrder.removePayCompany({id: id}, {}, function(data) {
|
|
|
+ $scope.pays.splice(index, 1);
|
|
|
+ toaster.pop('success', '提示', '付款企业信息删除成功');
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 编辑付款企业
|
|
|
+ $scope.editPay = function(pay, uu) {
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ animation: true,
|
|
|
+ templateUrl: 'static/tpl/index/approvalFlow/paycompany_modal.html',
|
|
|
+ controller: 'PayCompanyCtrl',
|
|
|
+ resolve: {
|
|
|
+ pay: function(){return pay;}
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ modalInstance.result.then(function() {
|
|
|
+ DeputyOrder.paycompanies({enuu: uu}, {}, function(data) {
|
|
|
+ $scope.pays = data;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }, function(){
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
// 设置logo
|
|
|
$scope.showImageDialog = function(modal) {
|
|
|
require([ 'jquery-uploadify' ], function() {
|
|
|
@@ -6847,10 +6906,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
}]);
|
|
|
|
|
|
// 编辑收货地址
|
|
|
- app.controller('ShipAddressCtrl', ['$scope', 'ShipAddress', 'ship', '$modalInstance', 'toaster', '$http', function($scope, ShipAddress, ship, $modalInstance, toaster, $http) {
|
|
|
+ app.controller('ShipAddressCtrl', ['$scope', 'DeputyOrder', 'pay', '$modalInstance', 'toaster', '$http', function($scope, DeputyOrder, pay, $modalInstance, toaster, $http) {
|
|
|
$scope.ship = ship;
|
|
|
|
|
|
// 获取地址信息
|
|
|
@@ -6860,7 +6920,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
});
|
|
|
|
|
|
// 新增收货地址保存
|
|
|
- $scope.saveShipAddress = function(ship) {
|
|
|
+ $scope.savePayCompany = function(pay) {
|
|
|
ship.address = ship.province + ship.city + ship.district;
|
|
|
ShipAddress.saveAddress( {}, ship, function(data) {
|
|
|
if(data.success) {
|
|
|
@@ -6878,6 +6938,36 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
+ // 编辑付款企业信息
|
|
|
+ app.controller('PayCompanyCtrl', ['$scope', 'ShipAddress', 'ship', '$modalInstance', 'toaster', '$http', function($scope, ShipAddress, ship, $modalInstance, toaster, $http) {
|
|
|
+ $scope.ship = ship;
|
|
|
+
|
|
|
+ // 获取地址信息
|
|
|
+ $http.get('resources/citydata/city.json', {"Accept": "application/json;charset=utf-8", "Accept-Charset": "charset=utf-8"
|
|
|
+ }).then(function(response) {
|
|
|
+ $scope.provinces = response.data;
|
|
|
+ });
|
|
|
+
|
|
|
+ // 新增收货地址保存
|
|
|
+ $scope.saveShipAddress = function(ship) {
|
|
|
+ pay.address = pay.province + pay.city + pay.district;
|
|
|
+ DeputyOrder.savePaycompany( {}, pay, function(data) {
|
|
|
+ DeputyOrder.paycompanies({enuu: $scope.enterprise.uu}, {}, function(data) {
|
|
|
+ $scope.pays = data;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ toaster.pop('success', '提示', '保存成功');
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
// 申请Saas Controller
|
|
|
app.controller('ApplySaasCtrl', ['$scope', '$modalInstance', 'enterprise', 'AccountEnterprise', 'toaster', '$http', function($scope, $modalInstance, enterprise, AccountEnterprise, toaster, $http){
|
|
|
$scope.enterprise = enterprise;
|
|
|
@@ -11092,7 +11182,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
app.controller('DbfindDeputyPayCompanyCtrl', ['$scope', 'toaster', '$upload', '$modalInstance', 'deputyuu', 'DeputyOrder', 'BaseService', 'ngTableParams', function($scope, toaster, $upload, $modalInstance, deputyuu, DeputyOrder, BaseService, ngTableParams) {
|
|
|
$scope.prod = false;
|
|
|
BaseService.scrollBackToTop();
|
|
|
- DeputyOrder.paycompanys({enuu: deputyuu}, {}, function(data) {
|
|
|
+ DeputyOrder.paycompanies({enuu: deputyuu}, {}, function(data) {
|
|
|
$scope.paycompanys = data;
|
|
|
}, function(response) {
|
|
|
toaster.pop('error', '提示', response.data);
|