feat(client): add back route 'updatePortfolio'
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
b4c4c6dfff
commit
578685e05e
|
@ -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);
|
||||||
|
};
|
||||||
|
};
|
|
@ -29,6 +29,7 @@ module.exports = Self => {
|
||||||
require('../methods/client/updateAddress')(Self);
|
require('../methods/client/updateAddress')(Self);
|
||||||
require('../methods/client/consumption')(Self);
|
require('../methods/client/consumption')(Self);
|
||||||
require('../methods/client/createReceipt')(Self);
|
require('../methods/client/createReceipt')(Self);
|
||||||
|
require('../methods/client/updatePortfolio')(Self);
|
||||||
|
|
||||||
// Validations
|
// Validations
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,8 @@
|
||||||
value-field="id"
|
value-field="id"
|
||||||
where="{role: 'salesPerson'}"
|
where="{role: 'salesPerson'}"
|
||||||
label="Salesperson"
|
label="Salesperson"
|
||||||
vn-acl="salesAssistant">
|
vn-acl="salesAssistant"
|
||||||
|
on-change="$ctrl.updatePortfolio()">
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
|
|
|
@ -7,6 +7,13 @@ export default class Controller extends Section {
|
||||||
? {id: $search}
|
? {id: $search}
|
||||||
: {name: {like: '%' + $search + '%'}};
|
: {name: {like: '%' + $search + '%'}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updatePortfolio() {
|
||||||
|
// if (this.newDiscount != claimedSale.discount) {
|
||||||
|
const query = `Clients/updatePortfolio`;
|
||||||
|
this.$http.get(query);
|
||||||
|
// }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngModule.vnComponent('vnClientBasicData', {
|
ngModule.vnComponent('vnClientBasicData', {
|
||||||
|
|
Loading…
Reference in New Issue