|
|
@@ -28,6 +28,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
|
|
|
url : "/notice",
|
|
|
templateUrl : "static/tpl/index_mobile/sale/notice_list.html",
|
|
|
controller: 'SaleNoticeListCtrl'
|
|
|
+ }).state('sale.accept', {// 销售,验收单列表
|
|
|
+ url : "/accept",
|
|
|
+ templateUrl : "static/tpl/index_mobile/sale/accept_list.html",
|
|
|
+ controller: 'SaleAcceptListCtrl'
|
|
|
+ }).state('sale.return', {// 销售,退货单列表
|
|
|
+ url : "/return",
|
|
|
+ templateUrl : "static/tpl/index_mobile/sale/return_list.html",
|
|
|
+ controller: 'SaleReturnListCtrl'
|
|
|
}).state('sale.order_detail', {// 销售,订单详情
|
|
|
url : "/order/:id",
|
|
|
templateUrl : "static/tpl/index_mobile/sale/order_detail.html",
|
|
|
@@ -44,7 +52,15 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
|
|
|
url: '/notice/:id',
|
|
|
templateUrl: 'static/tpl/index_mobile/sale/notice_detail.html',
|
|
|
controller: 'SaleNoticeCtrl'
|
|
|
- });
|
|
|
+ }).state('sale.accept_detail', {// 销售,验收单详情
|
|
|
+ url: '/accept/:id',
|
|
|
+ templateUrl: 'static/tpl/index_mobile/sale/accept_detail.html',
|
|
|
+ controller: 'SaleAcceptCtrl'
|
|
|
+ }).state('sale.return_detail', {// 销售,退货单详情
|
|
|
+ url: '/return/:id',
|
|
|
+ templateUrl: 'static/tpl/index_mobile/sale/return_detail.html',
|
|
|
+ controller: 'SaleReturnCtrl'
|
|
|
+ })
|
|
|
}]);
|
|
|
|
|
|
app.factory('StatusCode', function(){
|
|
|
@@ -688,8 +704,171 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
|
|
|
$scope.logShow = false;
|
|
|
}
|
|
|
};
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 客户验收单列表*/
|
|
|
+ app.controller('SaleAcceptListCtrl',['$scope','BaseService','PurcAccept','toaster',function($scope,BaseService,PurcAccept,toaster){
|
|
|
+ $scope.data = {};// 列表数据
|
|
|
+ var pageParams = {// 页面参数
|
|
|
+ page : 1,
|
|
|
+ count : 5,
|
|
|
+ sorting: {
|
|
|
+ date: 'desc'
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 加载数据
|
|
|
+ var getData = function(add) {
|
|
|
+ $scope.loading = true;
|
|
|
+ PurcAccept.getAll(BaseService.parseParams(pageParams),null,function(data){
|
|
|
+ if(add) {
|
|
|
+ data.content = $scope.data.content.concat(data.content);
|
|
|
+ $scope.data = data;
|
|
|
+ } else {
|
|
|
+ $scope.data = data;
|
|
|
+ console.log($scope.data);
|
|
|
+ }
|
|
|
+ $scope.loading = false;
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '加载数据失败', response.data);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ getData();//初始获取数据
|
|
|
+
|
|
|
+ $scope.getMoreData = function() {
|
|
|
+ pageParams.page ++;
|
|
|
+ getData(true);
|
|
|
+ };
|
|
|
+
|
|
|
+ // 获取物料种类数
|
|
|
+ $scope.getProdKind = function(accept) {
|
|
|
+ var kind = 0;
|
|
|
+ angular.forEach(accept.acceptItems, function(item){
|
|
|
+ kind = item.number;
|
|
|
+ });
|
|
|
+ return kind;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 获取物料总数
|
|
|
+ $scope.getProdCount = function(accept) {
|
|
|
+ var count = 0;
|
|
|
+ angular.forEach(accept.acceptItems, function(item){
|
|
|
+ count += (item.qty || 0);
|
|
|
+ });
|
|
|
+ return count;
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 客户验收单详情
|
|
|
+ */
|
|
|
+ app.controller('SaleAcceptCtrl',['$scope','$stateParams','PurcAccept','Symbol','toaster',function($scope,$stateParams,PurcAccept,Symbol,toaster){
|
|
|
+ $scope.loading = true;
|
|
|
+ $scope.symbol = Symbol.currency;//把币别转化为符号
|
|
|
|
|
|
+ PurcAccept.get({id:$stateParams.id}, function(data){
|
|
|
+ $scope.accept = data;
|
|
|
+ $scope.loading = false;
|
|
|
+ },function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '加载失败', response.data);
|
|
|
+ });
|
|
|
|
|
|
+ //查看更多
|
|
|
+ $scope.page = 1;
|
|
|
+ $scope.count = 4;
|
|
|
+ $scope.showMore = function(length){
|
|
|
+ length = $scope.accept.acceptItems.length;
|
|
|
+ $scope.page ++;
|
|
|
+ }
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 客户验退单列表
|
|
|
+ */
|
|
|
+ app.controller('SaleReturnListCtrl',['$scope','BaseService','PurcReturn','toaster',function($scope,BaseService,PurcReturn,toaster){
|
|
|
+ $scope.data = {};// 列表数据
|
|
|
+ var pageParams = {// 页面参数
|
|
|
+ page : 1,
|
|
|
+ count : 5,
|
|
|
+ sorting: {
|
|
|
+ date: 'desc'
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 加载数据
|
|
|
+ var getData = function(add) {
|
|
|
+ $scope.loading = true;
|
|
|
+ PurcReturn.getAll(BaseService.parseParams(pageParams),null,function(data){
|
|
|
+ if(add) {
|
|
|
+ data.content = $scope.data.content.concat(data.content);
|
|
|
+ $scope.data = data;
|
|
|
+ } else {
|
|
|
+ $scope.data = data;
|
|
|
+ console.log($scope.data);
|
|
|
+ }
|
|
|
+ $scope.loading = false;
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '加载数据失败', response.data);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ getData();
|
|
|
+
|
|
|
+ $scope.getMoreData = function() {
|
|
|
+ pageParams.page ++;
|
|
|
+ getData(true);
|
|
|
+ };
|
|
|
+
|
|
|
+ // 获取物料种类数
|
|
|
+ $scope.getProdKind = function(returns) {
|
|
|
+ var kind = 0;
|
|
|
+ angular.forEach(returns.returnItems, function(item){
|
|
|
+ kind = item.number;
|
|
|
+ });
|
|
|
+ return kind;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 获取物料总数
|
|
|
+ $scope.getProdCount = function(returns) {
|
|
|
+ var count = 0;
|
|
|
+ angular.forEach(returns.returnItems, function(item){
|
|
|
+ count += (item.qty || 0);
|
|
|
+ });
|
|
|
+ return count;
|
|
|
+ };
|
|
|
+ }])
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 客户验退单详情
|
|
|
+ * */
|
|
|
+ app.controller('SaleReturnCtrl',['$scope','$stateParams','PurcReturn','Symbol','toaster',function($scope,$stateParams,PurcReturn,Symbol,toaster){
|
|
|
+ $scope.symbol = Symbol.currency;//把币别转化为符号
|
|
|
+ $scope.loading = true;
|
|
|
+ PurcReturn.get({id:$stateParams.id},function(data){
|
|
|
+ $scope.returns = data;
|
|
|
+ $scope.loading = false;
|
|
|
+ },function(response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '加载失败', response.data);
|
|
|
+ });
|
|
|
+
|
|
|
+ //点击加载更多
|
|
|
+ $scope.page = 1;
|
|
|
+ $scope.count = 4;
|
|
|
+ $scope.showMore = function(length){
|
|
|
+ length = $scope.accept.acceptItems.length;
|
|
|
+ $scope.page ++;
|
|
|
+ }
|
|
|
+
|
|
|
}]);
|
|
|
return app;
|
|
|
});
|