|
@@ -93,6 +93,18 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
|
|
|
url : "/notice",
|
|
url : "/notice",
|
|
|
templateUrl : "static/tpl/index/sale/notice.html",
|
|
templateUrl : "static/tpl/index/sale/notice.html",
|
|
|
controller: 'SaleNoticeCtrl'
|
|
controller: 'SaleNoticeCtrl'
|
|
|
|
|
+ }).state('sale.send', {
|
|
|
|
|
+ url : "/send",
|
|
|
|
|
+ templateUrl : "static/tpl/index/sale/send.html",
|
|
|
|
|
+ controller: 'SaleSendCtrl'
|
|
|
|
|
+ }).state('sale.accept', {
|
|
|
|
|
+ url : "/accept",
|
|
|
|
|
+ templateUrl : "static/tpl/index/sale/accept.html",
|
|
|
|
|
+ controller: 'SaleAcceptCtrl'
|
|
|
|
|
+ }).state('sale.returns', {
|
|
|
|
|
+ url : "/returns",
|
|
|
|
|
+ templateUrl : "static/tpl/index/sale/returns.html",
|
|
|
|
|
+ controller: 'SaleReturnsCtrl'
|
|
|
}).state('user', {
|
|
}).state('user', {
|
|
|
url : "/user",
|
|
url : "/user",
|
|
|
views : {
|
|
views : {
|
|
@@ -113,6 +125,18 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
|
|
|
templateUrl : "static/tpl/index/qc/right.html"
|
|
templateUrl : "static/tpl/index/qc/right.html"
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }).state('qc.badIn', {
|
|
|
|
|
+ url : "/badIn",
|
|
|
|
|
+ templateUrl : "static/tpl/index/qc/badIn.html",
|
|
|
|
|
+ controller: 'SaleBadInCtrl'
|
|
|
|
|
+ }).state('qc.badOut', {
|
|
|
|
|
+ url : "/badOut",
|
|
|
|
|
+ templateUrl : "static/tpl/index/qc/badOut.html",
|
|
|
|
|
+ controller: 'SaleBadOutCtrl'
|
|
|
|
|
+ }).state('qc.MRB', {
|
|
|
|
|
+ url : "/MRB",
|
|
|
|
|
+ templateUrl : "static/tpl/index/qc/MRB.html",
|
|
|
|
|
+ controller: 'SaleMRBCtrl'
|
|
|
}).state('fa', {
|
|
}).state('fa', {
|
|
|
url : "/fa",
|
|
url : "/fa",
|
|
|
views : {
|
|
views : {
|
|
@@ -125,6 +149,21 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 表示符号
|
|
|
|
|
+ */
|
|
|
|
|
+ app.factory('Symbol', function(){
|
|
|
|
|
+ return {
|
|
|
|
|
+ currency: function(cur) {
|
|
|
|
|
+ if(cur == 'RMB') return '¥';
|
|
|
|
|
+ else if(cur == 'USD') return '$';
|
|
|
|
|
+ else if(cur == 'EUR') return '€';
|
|
|
|
|
+ else return cur;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
app.controller('MyCtrl', function($scope, $rootScope) {
|
|
app.controller('MyCtrl', function($scope, $rootScope) {
|
|
|
$rootScope.$on('$locationChangeSuccess', function(evt, newUrl) {
|
|
$rootScope.$on('$locationChangeSuccess', function(evt, newUrl) {
|
|
|
var routeState = newUrl.substr(newUrl.indexOf('#/') + 2);
|
|
var routeState = newUrl.substr(newUrl.indexOf('#/') + 2);
|
|
@@ -680,6 +719,386 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 发货单
|
|
|
|
|
+ */
|
|
|
|
|
+ app.controller('SaleSendCtrl', function($scope, $rootScope, $filter, PurcChange, ngTableParams, toaster, BaseService, PurcChangeHis){
|
|
|
|
|
+ $rootScope.active = 'change';
|
|
|
|
|
+ $scope.active = 'todo';
|
|
|
|
|
+ $scope.agreedText = '全部';
|
|
|
|
|
+ $scope.dateZoneText = '一个月内';
|
|
|
|
|
+ $scope.condition = {dateZone: 1};
|
|
|
|
|
+ $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;
|
|
|
|
|
+ };
|
|
|
|
|
+ $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 $scope.condition.dateZone ? PurcChange : PurcChangeHis;
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
|
|
+ page : 1,
|
|
|
|
|
+ count : 5,
|
|
|
|
|
+ sorting: {
|
|
|
|
|
+ date: 'desc'
|
|
|
|
|
+ }
|
|
|
|
|
+ }, {
|
|
|
|
|
+ total : 0,
|
|
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
|
|
+ getData : function($defer, params) {
|
|
|
|
|
+ $scope.loading = true;
|
|
|
|
|
+ getService()[getState($scope.active)].call(null, BaseService.parseParams(params.url()), function(page){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ if(page) {
|
|
|
|
|
+ params.total(page.totalElements);
|
|
|
|
|
+ $defer.resolve(page.content);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.onReplyClick = function(change) {
|
|
|
|
|
+ if(change.agreed) {
|
|
|
|
|
+ var reply = {id: change.id, agreed: Number(change.$agreed), replyRemark: change.replyRemark};
|
|
|
|
|
+ $scope.loading = true;
|
|
|
|
|
+ PurcChange.reply({changeId: change.id}, reply, function(){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ toaster.pop('info', '提示', '回复成功');
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ }, function(response){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ toaster.pop('error', '回复失败', response.data);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 客户采购验收
|
|
|
|
|
+ */
|
|
|
|
|
+ app.controller('SaleAcceptCtrl', function($scope, $rootScope, $filter, PurcAccept, ngTableParams, toaster, BaseService, Symbol){
|
|
|
|
|
+ $rootScope.active = 'accept';
|
|
|
|
|
+ $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;
|
|
|
|
|
+ };
|
|
|
|
|
+ $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 PurcAccept;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
|
|
+ page : 1,
|
|
|
|
|
+ count : 5,
|
|
|
|
|
+ sorting: {
|
|
|
|
|
+ date: 'desc'
|
|
|
|
|
+ }
|
|
|
|
|
+ }, {
|
|
|
|
|
+ total : 0,
|
|
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
|
|
+ getData : function($defer, params) {
|
|
|
|
|
+ $scope.loading = true;
|
|
|
|
|
+ getService()[getState($scope.active)].call(null, BaseService.parseParams(params.url()), function(page){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ if(page) {
|
|
|
|
|
+ params.total(page.totalElements);
|
|
|
|
|
+ $defer.resolve(page.content);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 客户采购验退
|
|
|
|
|
+ */
|
|
|
|
|
+ app.controller('SaleReturnsCtrl', function($scope, $rootScope, $filter, PurcReturn, ngTableParams, toaster, BaseService, Symbol){
|
|
|
|
|
+ $rootScope.active = 'returns';
|
|
|
|
|
+ $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;
|
|
|
|
|
+ };
|
|
|
|
|
+ $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 PurcReturn;
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
|
|
+ page : 1,
|
|
|
|
|
+ count : 5,
|
|
|
|
|
+ sorting: {
|
|
|
|
|
+ date: 'desc'
|
|
|
|
|
+ }
|
|
|
|
|
+ }, {
|
|
|
|
|
+ total : 0,
|
|
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
|
|
+ getData : function($defer, params) {
|
|
|
|
|
+ $scope.loading = true;
|
|
|
|
|
+ getService()[getState($scope.active)].call(null, BaseService.parseParams(params.url()), function(page){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ if(page) {
|
|
|
|
|
+ params.total(page.totalElements);
|
|
|
|
|
+ $defer.resolve(page.content);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 客户不良品入库
|
|
|
|
|
+ */
|
|
|
|
|
+ app.controller('SaleBadInCtrl', function($scope, $rootScope, $filter, PurcBadIn, ngTableParams, toaster, BaseService, Symbol){
|
|
|
|
|
+ $rootScope.active = 'badIn';
|
|
|
|
|
+ $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;
|
|
|
|
|
+ };
|
|
|
|
|
+ $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 PurcBadIn;
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
|
|
+ page : 1,
|
|
|
|
|
+ count : 5,
|
|
|
|
|
+ sorting: {
|
|
|
|
|
+ date: 'desc'
|
|
|
|
|
+ }
|
|
|
|
|
+ }, {
|
|
|
|
|
+ total : 0,
|
|
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
|
|
+ getData : function($defer, params) {
|
|
|
|
|
+ $scope.loading = true;
|
|
|
|
|
+ getService()[getState($scope.active)].call(null, BaseService.parseParams(params.url()), function(page){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ if(page) {
|
|
|
|
|
+ params.total(page.totalElements);
|
|
|
|
|
+ $defer.resolve(page.content);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 客户不良品出库
|
|
|
|
|
+ */
|
|
|
|
|
+ app.controller('SaleBadOutCtrl', function($scope, $rootScope, $filter, PurcBadOut, ngTableParams, toaster, BaseService, Symbol){
|
|
|
|
|
+ $rootScope.active = 'badOut';
|
|
|
|
|
+ $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;
|
|
|
|
|
+ };
|
|
|
|
|
+ $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 PurcBadOut;
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
|
|
+ page : 1,
|
|
|
|
|
+ count : 5,
|
|
|
|
|
+ sorting: {
|
|
|
|
|
+ date: 'desc'
|
|
|
|
|
+ }
|
|
|
|
|
+ }, {
|
|
|
|
|
+ total : 0,
|
|
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
|
|
+ getData : function($defer, params) {
|
|
|
|
|
+ $scope.loading = true;
|
|
|
|
|
+ getService()[getState($scope.active)].call(null, BaseService.parseParams(params.url()), function(page){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ if(page) {
|
|
|
|
|
+ params.total(page.totalElements);
|
|
|
|
|
+ $defer.resolve(page.content);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 客户MRB
|
|
|
|
|
+ */
|
|
|
|
|
+ app.controller('SaleMRBCtrl', function($scope, $rootScope, $filter, PurcMRB, ngTableParams, toaster, BaseService, Symbol){
|
|
|
|
|
+ $rootScope.active = 'MRB';
|
|
|
|
|
+ $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;
|
|
|
|
|
+ };
|
|
|
|
|
+ $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 PurcMRB;
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
|
|
+ page : 1,
|
|
|
|
|
+ count : 5,
|
|
|
|
|
+ sorting: {
|
|
|
|
|
+ date: 'desc'
|
|
|
|
|
+ }
|
|
|
|
|
+ }, {
|
|
|
|
|
+ total : 0,
|
|
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
|
|
+ getData : function($defer, params) {
|
|
|
|
|
+ $scope.loading = true;
|
|
|
|
|
+ getService()[getState($scope.active)].call(null, BaseService.parseParams(params.url()), function(page){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ if(page) {
|
|
|
|
|
+ params.total(page.totalElements);
|
|
|
|
|
+ $defer.resolve(page.content);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 计算时间差
|
|
* 计算时间差
|
|
|
*/
|
|
*/
|