forked from hjnucsp/is2-2016-2-final
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from pikachu49/components-registerproductlot-r…
…egister-subrama #74 componentRegisterProduct Lot, forms and test
- Loading branch information
Showing
4 changed files
with
39 additions
and
19 deletions.
There are no files selected for viewing
31 changes: 26 additions & 5 deletions
31
src/server/statics/webapps/dashboard/src/app/components/RegisterProductLot/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,37 @@ | ||
import {Component} from '@angular/core'; | ||
import {Component, OnInit} from '@angular/core'; | ||
import {Lot} from '../../../../../../../../core/db-models/Lot.ts'; | ||
import {Resources} from '../../services/Resources.ts'; | ||
|
||
|
||
@Component({ | ||
styles: [require('./style.styl').toString()], | ||
template: require('./template.jade')(), | ||
}) | ||
export class RegisterProductLotComponent { | ||
export class RegisterProductLotComponent implements OnInit{ | ||
|
||
// Attributes | ||
|
||
lot: Lot; | ||
resources: Resources; | ||
// Methods | ||
constructor () { | ||
|
||
constructor (resources: Resources) { | ||
this.resources = resources; | ||
this.lot = { | ||
code: '', | ||
productId: '' | ||
} | ||
} | ||
|
||
ngOnInit () {} | ||
submitRegister () { | ||
this.resources.registerProductLot({ | ||
urlParams: {}, | ||
data: { | ||
code: this.lot.code, | ||
productId: this.lot.productId | ||
} | ||
}).subscribe((resp) => { | ||
console.log(resp); | ||
}) | ||
} | ||
} | ||
|
21 changes: 9 additions & 12 deletions
21
src/server/statics/webapps/dashboard/src/app/components/RegisterProductLot/template.jade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
h1 Register Product Lot Component | ||
|
||
form(name="add-estimation", method="post") | ||
div.input | ||
span.label Code: | ||
input(type="text", name="code") | ||
div.input | ||
span.label ProveedorId: | ||
input(type="text", name="proveedorId") | ||
|
||
div.actions | ||
input(type="submit", value="Registrar") | ||
div | ||
form | ||
p | ||
span code : | ||
input([(ngModel)]="lot.code", type="text", name="lotCode") | ||
|
||
span productId : | ||
input([(ngModel)]="lot.productId", type="text", name="lotProductId") | ||
p | ||
button((click)="submitRegister()") Submit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters