feat: añadidos chips
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
73ea928b33
commit
799c26796e
|
@ -0,0 +1,33 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('salePreparingList', {
|
||||
description: 'Returns a list with the lines of a ticket and its different states of preparation',
|
||||
accessType: 'READ',
|
||||
accepts: [{
|
||||
arg: 'id',
|
||||
type: 'number',
|
||||
required: true,
|
||||
description: 'The ticket id',
|
||||
http: {source: 'path'}
|
||||
}],
|
||||
returns: {
|
||||
type: 'object',
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/:id/salePreparingList`,
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.salePreparingList = async(ctx, id, options) => {
|
||||
const myOptions = {};
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
query = `CALL vn.salePreparingList(?)`;
|
||||
const [sales] = await Self.rawSql(query, [id], myOptions);
|
||||
|
||||
return sales;
|
||||
};
|
||||
};
|
|
@ -1,5 +1,6 @@
|
|||
module.exports = Self => {
|
||||
require('../methods/sale/getClaimableFromTicket')(Self);
|
||||
require('../methods/sale/salePreparingList')(Self);
|
||||
require('../methods/sale/reserve')(Self);
|
||||
require('../methods/sale/deleteSales')(Self);
|
||||
require('../methods/sale/updatePrice')(Self);
|
||||
|
|
|
@ -22,10 +22,11 @@
|
|||
<vn-tbody>
|
||||
<vn-tr ng-repeat="sale in sales">
|
||||
<vn-td center shrink>
|
||||
<vn-check
|
||||
vn-one ng-model="sale.isChecked.isChecked"
|
||||
disabled="true">
|
||||
</vn-check>
|
||||
<span class="chip {{::$ctrl.chipHasSaleGroupDetail(sale.id)}}"></span>
|
||||
<span class="chip {{::$ctrl.chipIsPreviousSelected($ctrl.salePreparingList.isPreviousSelected)}}"></span>
|
||||
<span class="chip {{::$ctrl.chipIsPrevious($ctrl.salePreparingList.isPrevious)}}"></span>
|
||||
<span class="chip {{::$ctrl.chipIsPrepared($ctrl.salePreparingList.isPrepared)}}"></span>
|
||||
<span class="chip {{::$ctrl.chipIsControled($ctrl.salePreparingList.isControled)}}"></span>
|
||||
</vn-td>
|
||||
<vn-td number>
|
||||
<span
|
||||
|
|
|
@ -17,12 +17,21 @@ class Controller extends Section {
|
|||
]
|
||||
};
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
const query = `Sales/${this.$params.id}/salePreparingList`;
|
||||
this.$http.get(query)
|
||||
.then(res => {
|
||||
this.salePreparingList = res.data;
|
||||
});
|
||||
}
|
||||
|
||||
showItemDescriptor(event, sale) {
|
||||
this.quicklinks = {
|
||||
btnThree: {
|
||||
icon: 'icon-transaction',
|
||||
state: `item.card.diary({
|
||||
id: ${sale.itemFk},
|
||||
id: ${sale.itemFk},
|
||||
warehouseFk: ${this.ticket.warehouseFk},
|
||||
lineFk: ${sale.id}
|
||||
})`,
|
||||
|
@ -31,6 +40,32 @@ class Controller extends Section {
|
|||
};
|
||||
this.$.itemDescriptor.show(event.target, sale.itemFk);
|
||||
}
|
||||
|
||||
chipHasSaleGroupDetail(saleId) {
|
||||
const salePreparing = this.salePreparingList.find(element => element.saleFk = saleId);
|
||||
if (salePreparing.hasSaleGroupDetail) return 'success';
|
||||
else return 'message';
|
||||
}
|
||||
|
||||
chipIsPreviousSelected(isActive) {
|
||||
if (isActive) return 'notice';
|
||||
else return 'message';
|
||||
}
|
||||
|
||||
chipIsPrevious(isActive) {
|
||||
if (isActive) return 'success';
|
||||
else return 'message';
|
||||
}
|
||||
|
||||
chipIsPrepared(isActive) {
|
||||
if (isActive) return 'warning';
|
||||
else return 'message';
|
||||
}
|
||||
|
||||
chipIsControled(isActive) {
|
||||
if (isActive) return 'warning';
|
||||
else return 'message';
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnTicketSaleChecked', {
|
||||
|
|
Loading…
Reference in New Issue