This commit is contained in:
2018-01-10 14:09:34 +01:00
parent d1de2210e6
commit 6366bbc6a8
19 changed files with 776 additions and 162 deletions
+18 -2
View File
@@ -20,7 +20,7 @@ dbo.offersInit = function () {
init: function () {
var vm = dbo.offersModel;
// vm.refreshOffers();
vm.refreshOffers();
},
newOffer: function () {
@@ -97,8 +97,24 @@ dbo.offersInit = function () {
var vm = dbo.offersModel;
dbo.offerDataService.getAllOffers( vm.archive() ? 'T' : 'F', function ( data ) {
vm.offers( data );
vm.offers.removeAll();
$.each( data, function ( i, p ) {
vm.offers.push( new vm.Offer( p ) );
} )
} );
},
Offer: function ( data ) {
this.id = data.id;
this.acceptance_chance = data.acceptance_chance;
this.projectNumber = data.project ? data.project.projectnumber : null;
this.customerName = data.customer ? data.customer.name : null;
this.customer_id = data.customer_id;
this.startdate = data.startdate ? dbo.helpers.mysql2date( data.startdate ) : null;
this.rejectdate = data.rejectdate ? dbo.helpers.mysql2date( data.rejectdate ) : null;
this.accepteddate = data.accepteddate ? dbo.helpers.mysql2date( data.accepteddate ) : null;
this.acceptance_chance = data.acceptance_chance ? data.acceptance_chance : 0;
this.archive = data.archive;
}