feat(client): add back route 'updatePortfolio'
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-02-18 13:56:18 +01:00
parent b4c4c6dfff
commit 578685e05e
4 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,20 @@
module.exports = function(Self) {
Self.remoteMethodCtx('updatePortfolio', {
description: 'Update salesPeson potfolio weight',
accessType: 'READ',
accepts: [],
returns: {
type: 'Object',
root: true
},
http: {
path: `/updatePortfolio`,
verb: 'GET'
}
});
Self.updatePortfolio = async() => {
query = `CALL bs.vendedores_updatePortfolio()`;
return await Self.rawSql(query);
};
};

View File

@ -29,6 +29,7 @@ module.exports = Self => {
require('../methods/client/updateAddress')(Self);
require('../methods/client/consumption')(Self);
require('../methods/client/createReceipt')(Self);
require('../methods/client/updatePortfolio')(Self);
// Validations

View File

@ -68,7 +68,8 @@
value-field="id"
where="{role: 'salesPerson'}"
label="Salesperson"
vn-acl="salesAssistant">
vn-acl="salesAssistant"
on-change="$ctrl.updatePortfolio()">
</vn-autocomplete>
<vn-autocomplete
vn-one

View File

@ -7,6 +7,13 @@ export default class Controller extends Section {
? {id: $search}
: {name: {like: '%' + $search + '%'}};
}
updatePortfolio() {
// if (this.newDiscount != claimedSale.discount) {
const query = `Clients/updatePortfolio`;
this.$http.get(query);
// }
}
}
ngModule.vnComponent('vnClientBasicData', {