Add line on change item
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
b9a482fc37
commit
d51356f11b
|
@ -118,7 +118,7 @@
|
||||||
show-field="name"
|
show-field="name"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
search-function="$ctrl.itemSearchFunc($search)"
|
search-function="$ctrl.itemSearchFunc($search)"
|
||||||
on-change="sale.quantity && $ctrl.onChangeQuantity(sale)"
|
on-change="$ctrl.onChangeQuantity(sale)"
|
||||||
order="id DESC"
|
order="id DESC"
|
||||||
tabindex="1">
|
tabindex="1">
|
||||||
<tpl-item>
|
<tpl-item>
|
||||||
|
|
|
@ -464,9 +464,11 @@ class Controller {
|
||||||
* Updates the sale quantity for existing instance
|
* Updates the sale quantity for existing instance
|
||||||
*/
|
*/
|
||||||
onChangeQuantity(sale) {
|
onChangeQuantity(sale) {
|
||||||
|
if (!sale.quantity) return;
|
||||||
|
|
||||||
if (!sale.id)
|
if (!sale.id)
|
||||||
this.addSale(sale);
|
return this.addSale(sale);
|
||||||
else
|
|
||||||
this.updateQuantity(sale);
|
this.updateQuantity(sale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue