salix/modules/invoiceIn/front/dueDay/index.js

38 lines
864 B
JavaScript
Raw Permalink Normal View History

2022-02-07 11:24:08 +00:00
import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
add() {
this.$.model.insert({
2023-01-16 14:18:24 +00:00
dueDated: Date.vnNew(),
2022-02-07 11:24:08 +00:00
bankFk: this.vnConfig.local.bankFk
});
}
onSubmit() {
this.$.watcher.check();
this.$.model.save().then(() => {
this.$.watcher.notifySaved();
this.$.watcher.updateOriginalData();
this.card.reload();
});
}
2022-05-03 09:16:56 +00:00
bankSearchFunc($search) {
return /^\d+$/.test($search)
? {id: $search}
: {bank: {like: '%' + $search + '%'}};
}
2022-02-07 11:24:08 +00:00
}
ngModule.vnComponent('vnInvoiceInDueDay', {
template: require('./index.html'),
controller: Controller,
require: {
card: '^vnInvoiceInCard'
},
bindings: {
invoiceIn: '<'
}
});