salix/modules/monitor/front/index/orders/index.js

33 lines
805 B
JavaScript
Raw Normal View History

2021-05-11 07:43:15 +00:00
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());
}
}
2021-05-11 07:43:15 +00:00
ngModule.vnComponent('vnMonitorSalesOrders', {
template: require('./index.html'),
controller: Controller
2021-05-11 07:43:15 +00:00
});