front: send message action
This commit is contained in:
parent
fcfef2c8b7
commit
fabe0cde7c
|
@ -0,0 +1,4 @@
|
|||
<div class="multi-check {{$ctrl.className}}">
|
||||
<vn-check model="$ctrl.checkAll"></vn-check>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,34 @@
|
|||
import {module} from '../module';
|
||||
import './multi-check.scss';
|
||||
|
||||
export default class MultiCheck {
|
||||
constructor($element) {
|
||||
this.$element = $element;
|
||||
this._checkAll = false;
|
||||
this._checkType = '';
|
||||
}
|
||||
get checkAll() {
|
||||
return this._checkAll;
|
||||
}
|
||||
set checkAll(value) {
|
||||
this._checkAll = value;
|
||||
}
|
||||
get checkType() {
|
||||
return this._checkType;
|
||||
}
|
||||
set checkType(value) {
|
||||
this._checkType = value;
|
||||
}
|
||||
}
|
||||
MultiCheck.$inject = ['$element'];
|
||||
|
||||
module.component('vnMultiCheck', {
|
||||
template: require('./multi-check.html'),
|
||||
controller: MultiCheck,
|
||||
bindings: {
|
||||
options: '<',
|
||||
container: '@',
|
||||
className: '@?'
|
||||
}
|
||||
});
|
||||
|
|
@ -65,13 +65,14 @@ export default class ProductionIndex {
|
|||
}
|
||||
);
|
||||
}
|
||||
_publishComment(tickets) {
|
||||
this.$http.post(`/production/api/TicketStates/sendMessage`, {tickets: tickets}).then(
|
||||
_sendMessage(tickets) {
|
||||
this.$http.post(`/production/api/TicketStates/messageSend`, {tickets: tickets}).then(
|
||||
() => {
|
||||
this.vnApp.showMessage(this.$translate.instant('Success: message send!'));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// End Actions Callbacks
|
||||
doAction(action) {
|
||||
let checks = this.$element[0].querySelectorAll('.list-body input[type="checkbox"]:checked');
|
||||
|
@ -83,7 +84,7 @@ export default class ProductionIndex {
|
|||
(_, i) => {
|
||||
ids.push(this.tickets[i].ticketFk);
|
||||
index.push(i);
|
||||
tickets.push(this.tickets[i]);
|
||||
tickets.push({ticketFk: this.tickets[i].ticketFk, salesPersonFk: this.tickets[i].salesPersonFk});
|
||||
}
|
||||
);
|
||||
switch (action) {
|
||||
|
@ -91,7 +92,7 @@ export default class ProductionIndex {
|
|||
this._changeState(ids, this.actions.state.id, this.actions.state.name, index);
|
||||
break;
|
||||
case 'addComment':
|
||||
this._publishComment(tickets);
|
||||
this._sendMessage(tickets);
|
||||
break;
|
||||
case 'markPrinted':
|
||||
this._changeState(ids, 4, 'Impreso', index);
|
||||
|
|
Loading…
Reference in New Issue