33 lines
805 B
JavaScript
33 lines
805 B
JavaScript
import ngModule from '../../module';
|
|
import Section from 'salix/components/section';
|
|
import './style.scss';
|
|
|
|
export default class Controller extends Section {
|
|
get checked() {
|
|
const rows = this.$.model.data || [];
|
|
const checkedRows = [];
|
|
for (let row of rows) {
|
|
if (row.checked)
|
|
checkedRows.push(row.id);
|
|
}
|
|
|
|
return checkedRows;
|
|
}
|
|
|
|
get totalChecked() {
|
|
return this.checked.length;
|
|
}
|
|
|
|
onDelete() {
|
|
const params = {deletes: this.checked};
|
|
const query = `SalesMonitors/deleteOrders`;
|
|
this.$http.post(query, params).then(
|
|
() => this.$.model.refresh());
|
|
}
|
|
}
|
|
|
|
ngModule.vnComponent('vnMonitorSalesOrders', {
|
|
template: require('./index.html'),
|
|
controller: Controller
|
|
});
|