|
|
@@ -760,6 +760,19 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
};
|
|
|
|
|
|
}]);
|
|
|
+
|
|
|
+ app.filter('getkey', ['$sce', '$rootScope', function($sce, $rootScope) {
|
|
|
+ var search = $rootScope.searchKeyword;
|
|
|
+ return function(content, search) {
|
|
|
+ content = encodeURI(content);
|
|
|
+ search = encodeURI(search);
|
|
|
+ var reg = new RegExp(search, 'gim');
|
|
|
+ var result = content.replace(reg,'<font color="red">$&</font>');
|
|
|
+ result = decodeURI(result);
|
|
|
+ return $sce.trustAsHtml(result);
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
// TODO
|
|
|
app.controller('TopSearchCtrl', ['$scope', '$rootScope', 'getAccountUserSpace', 'ngTableParams', 'toaster', 'BaseService', 'AddPartner', '$filter', '$stateParams', 'SearchProd', '$sce', function($scope, $rootScope, getAccountUserSpace, ngTableParams, toaster, BaseService, AddPartner, $filter, $stateParams, SearchProd, $sce) {
|
|
|
$scope.active = 'all';
|
|
|
@@ -7428,6 +7441,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
$scope.success = $scope.result.success;
|
|
|
$scope.total = $scope.result.total;
|
|
|
$scope.alters = $scope.result.alters;
|
|
|
+ $scope.infos = $scope.result.infos;
|
|
|
}).error(function(response) {
|
|
|
toaster.pop('error', response.data || response);
|
|
|
});
|
|
|
@@ -7878,7 +7892,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
getData : function($defer, params) {
|
|
|
$scope.loading = true;
|
|
|
var pageParams = params.url();
|
|
|
- pageParams.keyword = $rootScope.keyword;
|
|
|
+ pageParams.keyword = $scope.keyword;
|
|
|
getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page) {
|
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
|
@@ -7919,7 +7933,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
/**
|
|
|
* 新增采购单
|
|
|
*/
|
|
|
- app.controller('PurcNewOrderCtrl',['$scope', '$modal', 'toaster', '$filter', 'addtoCart', '$rootScope', 'VendorInfo', 'ngTableParams', 'BaseService', 'Product', 'newPurcOrder', function($scope, $modal, toaster, $filter, addtoCart, $rootScope, VendorInfo, ngTableParams, BaseService, Product, newPurcOrder) {
|
|
|
+ app.controller('PurcNewOrderCtrl',['$scope', '$modal', 'toaster', '$filter', 'addtoCart', '$rootScope', 'VendorInfo', 'ngTableParams', 'BaseService', 'Product', 'newPurcOrder', 'cartOperation', function($scope, $modal, toaster, $filter, addtoCart, $rootScope, VendorInfo, ngTableParams, BaseService, Product, newPurcOrder, cartOperation) {
|
|
|
$scope.order = {
|
|
|
date : new Date(),
|
|
|
cust : {
|
|
|
@@ -7935,6 +7949,11 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
},
|
|
|
};
|
|
|
|
|
|
+ // 获取供应商列表
|
|
|
+ cartOperation.vendorInfo({}, function(data) {
|
|
|
+ console.log(data);
|
|
|
+ });
|
|
|
+
|
|
|
if($rootScope.businessCode) {
|
|
|
VendorInfo.getVendorInfo({businessCode: $rootScope.businessCode}, {}, function(data) {
|
|
|
$scope.order.cust.enName = data.vendorEnterprise.enName;
|
|
|
@@ -7979,6 +7998,8 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//商品信息
|
|
|
$scope.order.orderItems = [];
|
|
|
var item = {
|
|
|
@@ -8046,12 +8067,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
|
|
|
// 选择
|
|
|
$scope.check = 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);
|
|
|
- }
|
|
|
- }
|
|
|
+ $scope.order.orderItems.push({code: data.code, title: data.title, spec: data.spec, unit: data.unit, qty: null, price: null, remark: null, delivery: null});
|
|
|
};
|
|
|
|
|
|
// 搜索框回车
|
|
|
@@ -9346,6 +9362,12 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ $scope.openDatePicker = function($event, deOrder, openParam) {
|
|
|
+ $event.preventDefault();
|
|
|
+ $event.stopPropagation();
|
|
|
+ deOrder[openParam] = !deOrder[openParam];
|
|
|
+ };
|
|
|
+
|
|
|
}]);
|
|
|
|
|
|
/**
|