|
|
@@ -3161,14 +3161,34 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// 平台询价单(未提交)
|
|
|
app.controller('UnapplyInquiryCtrl', ['$scope', 'PurchaseInquiry', 'ngTableParams', 'BaseService', 'toaster', function($scope, PurchaseInquiry, ngTableParams, BaseService, toaster) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
- $scope.status = 'InquiryUnSubmit';
|
|
|
+ $scope.active = 'done';
|
|
|
+ var getService = function() {
|
|
|
+ if($scope.active == 'todo') {
|
|
|
+ return PurchaseInquiry.getUnapply;
|
|
|
+ }
|
|
|
+ if($scope.active == 'done') {
|
|
|
+ return PurchaseInquiry.getSubmit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $scope.setActive = function(state) {
|
|
|
+ if($scope.active != state ) {
|
|
|
+ $scope.active = state;
|
|
|
+ if ($scope.tableParams.page() == 1) {
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ } else {
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$scope.tableParams = new ngTableParams({
|
|
|
page : 1,
|
|
|
count : 5,
|
|
|
sorting: {
|
|
|
- 'inquiry.date': 'desc',
|
|
|
- 'inquiry.enterprise.enName': 'asc',
|
|
|
- 'inquiry.code': 'asc'
|
|
|
+ 'date': 'desc',
|
|
|
+ 'enterprise.enName': 'asc',
|
|
|
+ 'code': 'asc'
|
|
|
}
|
|
|
}, {
|
|
|
total : 0,
|
|
|
@@ -3180,7 +3200,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
if ($scope.active == 'overdue') {
|
|
|
$scope.active = 'end';
|
|
|
}
|
|
|
- PurchaseInquiry.getUnapply(null, BaseService.parseParams(pageParams), function(page){
|
|
|
+ getService().call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
|
params.total(page.totalElements);
|