|
|
@@ -3139,7 +3139,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
|
|
|
// 查找供应商
|
|
|
app.controller('DbfindVendorCtrl', ['$scope', 'Vendor', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance','$rootScope', function($scope, Vendor, BaseService, ngTableParams, toaster, $modalInstance, $rootScope){
|
|
|
- console.log($rootScope);
|
|
|
$scope.tableParams = new ngTableParams({
|
|
|
page : 1,
|
|
|
count : 25
|
|
|
@@ -7996,8 +7995,8 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
// 查找客户
|
|
|
$scope.dbfindCust = function(){
|
|
|
var modalInstance = $modal.open({
|
|
|
- templateUrl: 'static/tpl/index/purc/modal/purc_order_cust.html',
|
|
|
- controller: 'DbfindCustCtrl',
|
|
|
+ templateUrl: 'static/tpl/index/purc/modal/purc_order_vendor.html',
|
|
|
+ controller: 'DbfindVendorInfoCtrl',
|
|
|
size: 'lg',
|
|
|
resolve: {
|
|
|
|
|
|
@@ -8005,8 +8004,8 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
});
|
|
|
|
|
|
modalInstance.result.then(function(data) {
|
|
|
- $scope.order.cust = data.myEnterprise;
|
|
|
- $scope.order.custUser = data.myUser;
|
|
|
+ $scope.order.cust = data.vendorEnterprise;
|
|
|
+ $scope.order.custUser = data.vendorUser;
|
|
|
$scope.order.orderItems = [];
|
|
|
var item = {
|
|
|
code: null,
|
|
|
@@ -8211,17 +8210,61 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
|
|
|
// 新增收货地址保存
|
|
|
$scope.saveShipAddress = function(ship) {
|
|
|
- ShipAddress.saveAddress( {}, ship, function(data) {
|
|
|
- if(data.success) {
|
|
|
- toaster.pop('success', '提示', data.success);
|
|
|
- }
|
|
|
- if(data.error) {
|
|
|
- toaster.pop('error', '提示', data.error);
|
|
|
- }
|
|
|
- });
|
|
|
+ ship.address = ship.province + ship.city + ship.district;
|
|
|
+ console.log(ship);
|
|
|
+// ShipAddress.saveAddress( {}, ship, function(data) {
|
|
|
+// if(data.success) {
|
|
|
+// toaster.pop('success', '提示', data.success);
|
|
|
+// }
|
|
|
+// if(data.error) {
|
|
|
+// toaster.pop('error', '提示', data.error);
|
|
|
+// }
|
|
|
+// });
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
+ // 查找供应商
|
|
|
+ app.controller('DbfindVendorInfoCtrl', ['$scope', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'Vendor', function($scope, BaseService, ngTableParams, toaster, $modalInstance, 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);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ }
|
|
|
+ $scope.totalCount = page.totalElements;
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.check = function(vendor){
|
|
|
+ $modalInstance.close(vendor);
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+
|
|
|
/**
|
|
|
* 我的客户
|
|
|
*/
|