replaced most of the translate.instant for $t
This commit is contained in:
parent
648c87e763
commit
7d5dc776c1
|
@ -192,7 +192,7 @@ export default class Autocomplete extends Field {
|
||||||
|
|
||||||
if (this.translateFields) {
|
if (this.translateFields) {
|
||||||
if (this.translateFields.indexOf(this.showField) > -1)
|
if (this.translateFields.indexOf(this.showField) > -1)
|
||||||
this.input.value = this.$translate.instant(display);
|
this.input.value = this.$t(display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,7 @@ export default class DropDown extends Popover {
|
||||||
if (this.translateFields) {
|
if (this.translateFields) {
|
||||||
option = Object.assign({}, option);
|
option = Object.assign({}, option);
|
||||||
for (let field of this.translateFields)
|
for (let field of this.translateFields)
|
||||||
option[field] = this.$translate.instant(option[field]);
|
option[field] = this.$t(option[field]);
|
||||||
}
|
}
|
||||||
|
|
||||||
let li = this.document.createElement('li');
|
let li = this.document.createElement('li');
|
||||||
|
|
|
@ -36,7 +36,7 @@ export default class Searchbar extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.searchState = `${this.baseState}.index`;
|
this.searchState = `${this.baseState}.index`;
|
||||||
this.placeholder = this.$translate.instant('Search by', {
|
this.placeholder = this.$t('Search by', {
|
||||||
module: this.baseState
|
module: this.baseState
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ class Controller extends Section {
|
||||||
this.$http.post(query, saleToAdd).then(() => {
|
this.$http.post(query, saleToAdd).then(() => {
|
||||||
this.$.addSales.hide();
|
this.$.addSales.hide();
|
||||||
this.$.model.refresh();
|
this.$.model.refresh();
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
|
|
||||||
if (this.aclService.hasAny(['salesAssistant']))
|
if (this.aclService.hasAny(['salesAssistant']))
|
||||||
this.$state.go('claim.card.development');
|
this.$state.go('claim.card.development');
|
||||||
|
@ -90,7 +90,7 @@ class Controller extends Section {
|
||||||
deleteClaimedSale() {
|
deleteClaimedSale() {
|
||||||
let query = `ClaimBeginnings/${this.sale.id}`;
|
let query = `ClaimBeginnings/${this.sale.id}`;
|
||||||
this.$http.delete(query).then(() => {
|
this.$http.delete(query).then(() => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.model.remove(this.sale);
|
this.$.model.remove(this.sale);
|
||||||
this.calculateTotals();
|
this.calculateTotals();
|
||||||
});
|
});
|
||||||
|
@ -100,7 +100,7 @@ class Controller extends Section {
|
||||||
let params = {id: id, quantity: claimedQuantity};
|
let params = {id: id, quantity: claimedQuantity};
|
||||||
let query = `ClaimBeginnings/`;
|
let query = `ClaimBeginnings/`;
|
||||||
this.$http.patch(query, params).then(() => {
|
this.$http.patch(query, params).then(() => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.calculateTotals();
|
this.calculateTotals();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ class Controller extends Section {
|
||||||
showEditPopover(event, saleClaimed) {
|
showEditPopover(event, saleClaimed) {
|
||||||
if (this.isEditable) {
|
if (this.isEditable) {
|
||||||
if (!this.aclService.hasAny(['salesAssistant']))
|
if (!this.aclService.hasAny(['salesAssistant']))
|
||||||
return this.vnApp.showError(this.$translate.instant('Insuficient permisos'));
|
return this.vnApp.showError(this.$t('Insuficient permisos'));
|
||||||
|
|
||||||
this.saleClaimed = saleClaimed;
|
this.saleClaimed = saleClaimed;
|
||||||
this.$.editPopover.parent = event.target;
|
this.$.editPopover.parent = event.target;
|
||||||
|
@ -175,7 +175,7 @@ class Controller extends Section {
|
||||||
this.calculateTotals();
|
this.calculateTotals();
|
||||||
this.clearDiscount();
|
this.clearDiscount();
|
||||||
|
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.vnApp.showError(err.message);
|
this.vnApp.showError(err.message);
|
||||||
});
|
});
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Controller extends Section {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.client.defaultAddressFk = res.data.defaultAddressFk;
|
this.client.defaultAddressFk = res.data.defaultAddressFk;
|
||||||
this.sortAddresses();
|
this.sortAddresses();
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ class Controller extends Section {
|
||||||
add() {
|
add() {
|
||||||
this.$.model.insert({
|
this.$.model.insert({
|
||||||
clientFk: this.client.id,
|
clientFk: this.client.id,
|
||||||
name: this.$translate.instant('Phone'),
|
name: this.$t('Phone'),
|
||||||
phone: null
|
phone: null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Controller extends Section {
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
if (this.$.form.$invalid)
|
if (this.$.form.$invalid)
|
||||||
return this.vnApp.showError(this.$translate.instant('Some fields are invalid'));
|
return this.vnApp.showError(this.$t('Some fields are invalid'));
|
||||||
|
|
||||||
let query = `creditClassifications/createWithInsurance`;
|
let query = `creditClassifications/createWithInsurance`;
|
||||||
let data = this.creditClassification;
|
let data = this.creditClassification;
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
get contentTypesInfo() {
|
get contentTypesInfo() {
|
||||||
return this.$translate.instant('ContentTypesInfo', {
|
return this.$t('ContentTypesInfo', {
|
||||||
allowedContentTypes: this.allowedContentTypes
|
allowedContentTypes: this.allowedContentTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ class Controller extends Section {
|
||||||
warehouseId: warehouseId,
|
warehouseId: warehouseId,
|
||||||
companyId: companyId,
|
companyId: companyId,
|
||||||
dmsTypeId: dmsType.id,
|
dmsTypeId: dmsType.id,
|
||||||
description: this.$translate.instant('ClientFileDescription', {
|
description: this.$t('ClientFileDescription', {
|
||||||
dmsTypeName: dmsType.name,
|
dmsTypeName: dmsType.name,
|
||||||
clientId: this.client.id,
|
clientId: this.client.id,
|
||||||
clientName: this.client.name
|
clientName: this.client.name
|
||||||
|
@ -83,7 +83,7 @@ class Controller extends Section {
|
||||||
};
|
};
|
||||||
this.$http(options).then(res => {
|
this.$http(options).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.watcher.updateOriginalData();
|
this.$.watcher.updateOriginalData();
|
||||||
this.$state.go('client.card.dms.index');
|
this.$state.go('client.card.dms.index');
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
get contentTypesInfo() {
|
get contentTypesInfo() {
|
||||||
return this.$translate.instant('ContentTypesInfo', {
|
return this.$t('ContentTypesInfo', {
|
||||||
allowedContentTypes: this.allowedContentTypes
|
allowedContentTypes: this.allowedContentTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ class Controller extends Section {
|
||||||
};
|
};
|
||||||
this.$http(options).then(res => {
|
this.$http(options).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.watcher.updateOriginalData();
|
this.$.watcher.updateOriginalData();
|
||||||
this.$state.go('client.card.dms.index');
|
this.$state.go('client.card.dms.index');
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ export default class Controller extends Section {
|
||||||
onAcceptEt() {
|
onAcceptEt() {
|
||||||
const query = `Clients/${this.client.id}/addressesPropagateRe`;
|
const query = `Clients/${this.client.id}/addressesPropagateRe`;
|
||||||
return this.$http.patch(query, {isEqualizated: this.client.isEqualizated}).then(
|
return this.$http.patch(query, {isEqualizated: this.client.isEqualizated}).then(
|
||||||
() => this.vnApp.showMessage(this.$translate.instant('Equivalent tax spreaded'))
|
() => this.vnApp.showMessage(this.$t('Equivalent tax spreaded'))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,11 @@ class Controller extends Component {
|
||||||
throw new Error(`The town can't be empty`);
|
throw new Error(`The town can't be empty`);
|
||||||
|
|
||||||
this.$http.patch(`postcodes`, this.data).then(res => {
|
this.$http.patch(`postcodes`, this.data).then(res => {
|
||||||
this.vnApp.showMessage(this.$translate.instant('The postcode has been saved'));
|
this.vnApp.showMessage(this.$t('The postcode has been saved'));
|
||||||
this.emit('response', {$response: res.data});
|
this.emit('response', {$response: res.data});
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.vnApp.showError(this.$translate.instant(e.message));
|
this.vnApp.showError(this.$t(e.message));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Controller extends Section {
|
||||||
|
|
||||||
sendSample() {
|
sendSample() {
|
||||||
this.send(false, () => {
|
this.send(false, () => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Notification sent!'));
|
this.vnApp.showSuccess(this.$t('Notification sent!'));
|
||||||
this.$state.go('client.card.sample.index');
|
this.$state.go('client.card.sample.index');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -66,13 +66,13 @@ class Controller extends Section {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!params.recipient)
|
if (!params.recipient)
|
||||||
return this.vnApp.showError(this.$translate.instant('Email cannot be blank'));
|
return this.vnApp.showError(this.$t('Email cannot be blank'));
|
||||||
|
|
||||||
if (!sampleType)
|
if (!sampleType)
|
||||||
return this.vnApp.showError(this.$translate.instant('Choose a sample'));
|
return this.vnApp.showError(this.$t('Choose a sample'));
|
||||||
|
|
||||||
if (sampleType.hasCompany && !this.clientSample.companyFk)
|
if (sampleType.hasCompany && !this.clientSample.companyFk)
|
||||||
return this.vnApp.showError(this.$translate.instant('Choose a company'));
|
return this.vnApp.showError(this.$t('Choose a company'));
|
||||||
|
|
||||||
if (sampleType.hasCompany)
|
if (sampleType.hasCompany)
|
||||||
params.companyId = this.clientSample.companyFk;
|
params.companyId = this.clientSample.companyFk;
|
||||||
|
|
|
@ -27,12 +27,12 @@ class Controller extends Section {
|
||||||
throw new Error(`The message it's too long`);
|
throw new Error(`The message it's too long`);
|
||||||
|
|
||||||
this.$http.post(`Clients/${this.$params.id}/sendSms`, this.sms).then(res => {
|
this.$http.post(`Clients/${this.$params.id}/sendSms`, this.sms).then(res => {
|
||||||
this.vnApp.showMessage(this.$translate.instant('SMS sent!'));
|
this.vnApp.showMessage(this.$t('SMS sent!'));
|
||||||
|
|
||||||
if (res.data) this.emit('send', {response: res.data});
|
if (res.data) this.emit('send', {response: res.data});
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.vnApp.showError(this.$translate.instant(e.message));
|
this.vnApp.showError(this.$t(e.message));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,10 @@ export default class Controller extends Section {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$http.patch(`Accounts/${this.client.id}`, account).then(res => {
|
this.$http.patch(`Accounts/${this.client.id}`, account).then(res => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.vnApp.showError(this.$translate.instant(e.message));
|
this.vnApp.showError(this.$t(e.message));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ class Controller extends Component {
|
||||||
agencyModeId: this.order.agencyModeFk
|
agencyModeId: this.order.agencyModeFk
|
||||||
};
|
};
|
||||||
this.$http.post(`Orders/new`, params).then(res => {
|
this.$http.post(`Orders/new`, params).then(res => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$state.go('order.card.catalog', {id: res.data});
|
this.$state.go('order.card.catalog', {id: res.data});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ class Controller extends Section {
|
||||||
let params = {priority: priority};
|
let params = {priority: priority};
|
||||||
let query = `Tickets/${id}/`;
|
let query = `Tickets/${id}/`;
|
||||||
this.$http.patch(query, params).then(() => {
|
this.$http.patch(query, params).then(() => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.model.refresh();
|
this.$.model.refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ class Controller extends Section {
|
||||||
let params = {routeFk: null};
|
let params = {routeFk: null};
|
||||||
let query = `Tickets/${this.selectedTicket}/`;
|
let query = `Tickets/${this.selectedTicket}/`;
|
||||||
this.$http.patch(query, params).then(() => {
|
this.$http.patch(query, params).then(() => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Ticket removed from route'));
|
this.vnApp.showSuccess(this.$t('Ticket removed from route'));
|
||||||
this.updateVolume();
|
this.updateVolume();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ class Controller extends Section {
|
||||||
guessPriority() {
|
guessPriority() {
|
||||||
let query = `Routes/${this.$params.id}/guessPriority/`;
|
let query = `Routes/${this.$params.id}/guessPriority/`;
|
||||||
this.$http.get(query).then(() => {
|
this.$http.get(query).then(() => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Order changed'));
|
this.vnApp.showSuccess(this.$t('Order changed'));
|
||||||
this.$.model.refresh();
|
this.$.model.refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ class Controller extends Section {
|
||||||
if (matches && matches.length)
|
if (matches && matches.length)
|
||||||
this.insert(matches[1]);
|
this.insert(matches[1]);
|
||||||
else
|
else
|
||||||
this.vnApp.showError(this.$translate.instant('Ticket not found'));
|
this.vnApp.showError(this.$t('Ticket not found'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNaN(ticketId))
|
if (!isNaN(ticketId))
|
||||||
|
@ -169,12 +169,12 @@ class Controller extends Section {
|
||||||
insert(id) {
|
insert(id) {
|
||||||
const params = {routeFk: this.route.id};
|
const params = {routeFk: this.route.id};
|
||||||
this.$http.patch(`Tickets/${id}`, params).then(() => {
|
this.$http.patch(`Tickets/${id}`, params).then(() => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.model.refresh();
|
this.$.model.refresh();
|
||||||
this.card.reload();
|
this.card.reload();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
if (error.status == 404)
|
if (error.status == 404)
|
||||||
return this.vnApp.showError(this.$translate.instant('Ticket not found'));
|
return this.vnApp.showError(this.$t('Ticket not found'));
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ class Controller extends Component {
|
||||||
async onStepChange() {
|
async onStepChange() {
|
||||||
if (this.isFormInvalid()) {
|
if (this.isFormInvalid()) {
|
||||||
return this.vnApp.showError(
|
return this.vnApp.showError(
|
||||||
this.$translate.instant('Some fields are invalid')
|
this.$t('Some fields are invalid')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ class Controller extends Component {
|
||||||
return true;
|
return true;
|
||||||
}, err => {
|
}, err => {
|
||||||
this.vnApp.showError(
|
this.vnApp.showError(
|
||||||
this.$translate.instant(err.data.error.message)
|
this.$t(err.data.error.message)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ class Controller extends Component {
|
||||||
this.ticket.shipped = params.shipped;
|
this.ticket.shipped = params.shipped;
|
||||||
} else {
|
} else {
|
||||||
return this.vnApp.showError(
|
return this.vnApp.showError(
|
||||||
this.$translate.instant(`No delivery zone available for this landing date`)
|
this.$t(`No delivery zone available for this landing date`)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -230,7 +230,7 @@ class Controller extends Component {
|
||||||
this.ticket.shipped = res.data.shipped;
|
this.ticket.shipped = res.data.shipped;
|
||||||
} else {
|
} else {
|
||||||
return this.vnApp.showError(
|
return this.vnApp.showError(
|
||||||
this.$translate.instant(`No delivery zone available for this landing date`)
|
this.$t(`No delivery zone available for this landing date`)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -63,7 +63,7 @@ class Controller extends Component {
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
if (!this.ticket.option) {
|
if (!this.ticket.option) {
|
||||||
return this.vnApp.showError(
|
return this.vnApp.showError(
|
||||||
this.$translate.instant('Choose an option')
|
this.$t('Choose an option')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class Controller extends Component {
|
||||||
|
|
||||||
this.$http.post(query, params).then(res => {
|
this.$http.post(query, params).then(res => {
|
||||||
this.vnApp.showMessage(
|
this.vnApp.showMessage(
|
||||||
this.$translate.instant(`The ticket has been unrouted`)
|
this.$t(`The ticket has been unrouted`)
|
||||||
);
|
);
|
||||||
this.card.reload();
|
this.card.reload();
|
||||||
this.$state.go('ticket.card.summary', {id: this.$params.id});
|
this.$state.go('ticket.card.summary', {id: this.$params.id});
|
||||||
|
|
|
@ -120,7 +120,7 @@ class Controller extends Component {
|
||||||
warehouseId: this.ticket.warehouseFk,
|
warehouseId: this.ticket.warehouseFk,
|
||||||
};
|
};
|
||||||
this.$http.post(`Tickets/new`, params).then(res => {
|
this.$http.post(`Tickets/new`, params).then(res => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$state.go('ticket.card.summary', {id: res.data.id});
|
this.$state.go('ticket.card.summary', {id: res.data.id});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ class Controller extends Component {
|
||||||
this.$http.post(`Stowaways/`, params)
|
this.$http.post(`Stowaways/`, params)
|
||||||
.then(() => this.cardReload())
|
.then(() => this.cardReload())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.dialog.hide();
|
this.$.dialog.hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
get contentTypesInfo() {
|
get contentTypesInfo() {
|
||||||
return this.$translate.instant('ContentTypesInfo', {
|
return this.$t('ContentTypesInfo', {
|
||||||
allowedContentTypes: this.allowedContentTypes
|
allowedContentTypes: this.allowedContentTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ class Controller extends Section {
|
||||||
warehouseId: warehouseId,
|
warehouseId: warehouseId,
|
||||||
companyId: this.ticket.companyFk,
|
companyId: this.ticket.companyFk,
|
||||||
dmsTypeId: dmsTypeId,
|
dmsTypeId: dmsTypeId,
|
||||||
description: this.$translate.instant('FileDescription', {
|
description: this.$t('FileDescription', {
|
||||||
ticketId: this.ticket.id,
|
ticketId: this.ticket.id,
|
||||||
clientId: this.ticket.client.id,
|
clientId: this.ticket.client.id,
|
||||||
clientName: this.ticket.client.name
|
clientName: this.ticket.client.name
|
||||||
|
@ -81,7 +81,7 @@ class Controller extends Section {
|
||||||
};
|
};
|
||||||
this.$http(options).then(res => {
|
this.$http(options).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.watcher.updateOriginalData();
|
this.$.watcher.updateOriginalData();
|
||||||
this.$state.go('ticket.card.dms.index');
|
this.$state.go('ticket.card.dms.index');
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
get contentTypesInfo() {
|
get contentTypesInfo() {
|
||||||
return this.$translate.instant('ContentTypesInfo', {
|
return this.$t('ContentTypesInfo', {
|
||||||
allowedContentTypes: this.allowedContentTypes
|
allowedContentTypes: this.allowedContentTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ class Controller extends Section {
|
||||||
};
|
};
|
||||||
this.$http(options).then(res => {
|
this.$http(options).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.watcher.updateOriginalData();
|
this.$.watcher.updateOriginalData();
|
||||||
this.$state.go('ticket.card.dms.index');
|
this.$state.go('ticket.card.dms.index');
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
<vn-icon
|
<vn-icon
|
||||||
ng-show="ticket.risk"
|
ng-show="ticket.risk"
|
||||||
class="bright"
|
class="bright"
|
||||||
vn-tooltip="{{::$ctrl.$translate.instant('Risk')}}: {{ticket.risk}}"
|
vn-tooltip="{{::$ctrl.$t('Risk')}}: {{ticket.risk}}"
|
||||||
icon="icon-risk">
|
icon="icon-risk">
|
||||||
</vn-icon>
|
</vn-icon>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
|
|
|
@ -281,7 +281,7 @@ class Controller extends Section {
|
||||||
const params = {salesIds: saleIds, newDiscount: this.edit.discount};
|
const params = {salesIds: saleIds, newDiscount: this.edit.discount};
|
||||||
const query = `Tickets/${this.$params.id}/updateDiscount`;
|
const query = `Tickets/${this.$params.id}/updateDiscount`;
|
||||||
this.$http.post(query, params).then(() => {
|
this.$http.post(query, params).then(() => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
|
|
||||||
for (let sale of sales)
|
for (let sale of sales)
|
||||||
sale.discount = this.edit.discount;
|
sale.discount = this.edit.discount;
|
||||||
|
|
|
@ -27,12 +27,12 @@ class Controller extends Component {
|
||||||
throw new Error(`The message it's too long`);
|
throw new Error(`The message it's too long`);
|
||||||
|
|
||||||
this.$http.post(`Tickets/${this.$params.id}/sendSms`, this.sms).then(res => {
|
this.$http.post(`Tickets/${this.$params.id}/sendSms`, this.sms).then(res => {
|
||||||
this.vnApp.showMessage(this.$translate.instant('SMS sent!'));
|
this.vnApp.showMessage(this.$t('SMS sent!'));
|
||||||
|
|
||||||
if (res.data) this.emit('send', {response: res.data});
|
if (res.data) this.emit('send', {response: res.data});
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.vnApp.showError(this.$translate.instant(e.message));
|
this.vnApp.showError(this.$t(e.message));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
<vn-icon
|
<vn-icon
|
||||||
ng-show="sale.claimBeginning.claimFk"
|
ng-show="sale.claimBeginning.claimFk"
|
||||||
icon="icon-claims"
|
icon="icon-claims"
|
||||||
vn-tooltip="{{::$ctrl.$translate.instant('Claim')}}: {{::sale.claimBeginning.claimFk}}">
|
vn-tooltip="{{::$ctrl.$t('Claim')}}: {{::sale.claimBeginning.claimFk}}">
|
||||||
</vn-icon>
|
</vn-icon>
|
||||||
</a>
|
</a>
|
||||||
<vn-icon
|
<vn-icon
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Controller extends Section {
|
||||||
params.code = 'OK';
|
params.code = 'OK';
|
||||||
|
|
||||||
this.$http.post(`TicketTrackings/changeState`, params).then(() => {
|
this.$http.post(`TicketTrackings/changeState`, params).then(() => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
if (this.card)
|
if (this.card)
|
||||||
this.card.reload();
|
this.card.reload();
|
||||||
else
|
else
|
||||||
|
|
|
@ -56,7 +56,7 @@ class Controller extends Section {
|
||||||
this.$http.post(`TicketTrackings/changeState`, this.params).then(() => {
|
this.$http.post(`TicketTrackings/changeState`, this.params).then(() => {
|
||||||
this.$.watcher.updateOriginalData();
|
this.$.watcher.updateOriginalData();
|
||||||
this.card.reload();
|
this.card.reload();
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$state.go('ticket.card.tracking.index');
|
this.$state.go('ticket.card.tracking.index');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ describe('Ticket', () => {
|
||||||
|
|
||||||
expect(controller.card.reload).toHaveBeenCalledWith();
|
expect(controller.card.reload).toHaveBeenCalledWith();
|
||||||
expect(controller.$.watcher.updateOriginalData).toHaveBeenCalledWith();
|
expect(controller.$.watcher.updateOriginalData).toHaveBeenCalledWith();
|
||||||
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith(controller.$translate.instant('Data saved!'));
|
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith(controller.$t('Data saved!'));
|
||||||
expect(controller.$state.go).toHaveBeenCalledWith('ticket.card.tracking.index');
|
expect(controller.$state.go).toHaveBeenCalledWith('ticket.card.tracking.index');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -28,7 +28,7 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
get contentTypesInfo() {
|
get contentTypesInfo() {
|
||||||
return this.$translate.instant('ContentTypesInfo', {
|
return this.$t('ContentTypesInfo', {
|
||||||
allowedContentTypes: this.allowedContentTypes
|
allowedContentTypes: this.allowedContentTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ class Controller extends Section {
|
||||||
warehouseId: warehouseId,
|
warehouseId: warehouseId,
|
||||||
companyId: companyId,
|
companyId: companyId,
|
||||||
dmsTypeId: dmsTypeId,
|
dmsTypeId: dmsTypeId,
|
||||||
description: this.$translate.instant('FileDescription', {
|
description: this.$t('FileDescription', {
|
||||||
travelId: this.travel.id
|
travelId: this.travel.id
|
||||||
}).toUpperCase()
|
}).toUpperCase()
|
||||||
};
|
};
|
||||||
|
@ -97,7 +97,7 @@ class Controller extends Section {
|
||||||
data: this.dms.files
|
data: this.dms.files
|
||||||
};
|
};
|
||||||
this.$http(options).then(res => {
|
this.$http(options).then(res => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.watcher.updateOriginalData();
|
this.$.watcher.updateOriginalData();
|
||||||
this.$state.go('travel.card.thermograph.index');
|
this.$state.go('travel.card.thermograph.index');
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,7 +24,7 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
get contentTypesInfo() {
|
get contentTypesInfo() {
|
||||||
return this.$translate.instant('ContentTypesInfo', {
|
return this.$t('ContentTypesInfo', {
|
||||||
allowedContentTypes: this.allowedContentTypes
|
allowedContentTypes: this.allowedContentTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ class Controller extends Section {
|
||||||
};
|
};
|
||||||
this.$http(options).then(res => {
|
this.$http(options).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.watcher.updateOriginalData();
|
this.$.watcher.updateOriginalData();
|
||||||
this.$state.go('travel.card.thermograph.index');
|
this.$state.go('travel.card.thermograph.index');
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Controller extends Section {
|
||||||
const thermographId = data[this.thermographIndex].id;
|
const thermographId = data[this.thermographIndex].id;
|
||||||
const query = `Travels/deleteThermograph?id=${thermographId}`;
|
const query = `Travels/deleteThermograph?id=${thermographId}`;
|
||||||
this.$http.delete(query).then(() => {
|
this.$http.delete(query).then(() => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Thermograph deleted'));
|
this.vnApp.showSuccess(this.$t('Thermograph deleted'));
|
||||||
this.$.model.remove(this.thermographIndex);
|
this.$.model.remove(this.thermographIndex);
|
||||||
this.thermographIndex = null;
|
this.thermographIndex = null;
|
||||||
});
|
});
|
||||||
|
|
|
@ -58,7 +58,7 @@ class Controller extends Section {
|
||||||
this.$.treeview.create(item);
|
this.$.treeview.create(item);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.vnApp.showError(this.$translate.instant(e.message));
|
this.vnApp.showError(this.$t(e.message));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
get contentTypesInfo() {
|
get contentTypesInfo() {
|
||||||
return this.$translate.instant('ContentTypesInfo', {
|
return this.$t('ContentTypesInfo', {
|
||||||
allowedContentTypes: this.allowedContentTypes
|
allowedContentTypes: this.allowedContentTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ class Controller extends Section {
|
||||||
warehouseId: warehouseId,
|
warehouseId: warehouseId,
|
||||||
companyId: companyId,
|
companyId: companyId,
|
||||||
dmsTypeId: dmsType.id,
|
dmsTypeId: dmsType.id,
|
||||||
description: this.$translate.instant('WorkerFileDescription', {
|
description: this.$t('WorkerFileDescription', {
|
||||||
dmsTypeName: dmsType.name,
|
dmsTypeName: dmsType.name,
|
||||||
workerId: this.worker.id,
|
workerId: this.worker.id,
|
||||||
workerName: this.worker.name
|
workerName: this.worker.name
|
||||||
|
@ -83,7 +83,7 @@ class Controller extends Section {
|
||||||
};
|
};
|
||||||
this.$http(options).then(res => {
|
this.$http(options).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.watcher.updateOriginalData();
|
this.$.watcher.updateOriginalData();
|
||||||
this.$state.go('worker.card.dms.index');
|
this.$state.go('worker.card.dms.index');
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
get contentTypesInfo() {
|
get contentTypesInfo() {
|
||||||
return this.$translate.instant('ContentTypesInfo', {
|
return this.$t('ContentTypesInfo', {
|
||||||
allowedContentTypes: this.allowedContentTypes
|
allowedContentTypes: this.allowedContentTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ class Controller extends Section {
|
||||||
};
|
};
|
||||||
this.$http(options).then(res => {
|
this.$http(options).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
this.$.watcher.updateOriginalData();
|
this.$.watcher.updateOriginalData();
|
||||||
this.$state.go('worker.card.dms.index');
|
this.$state.go('worker.card.dms.index');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue