2952-ticket.sale-checked #1246

Merged
vicent merged 19 commits from 2952-ticket.sale-checked into dev 2023-01-10 13:33:05 +00:00
6 changed files with 113 additions and 21 deletions
Showing only changes of commit 8880a83b89 - Show all commits

View File

@ -29,7 +29,7 @@ vn-table {
& > tbody {
display: table-row-group;
}
& > vn-tfoot,
& > vn-tfoot,
& > .vn-tfoot,
& > tfoot {
border-top: $border;
@ -42,7 +42,7 @@ vn-table {
height: 48px;
}
vn-thead, .vn-thead,
vn-tbody, .vn-tbody,
vn-tbody, .vn-tbody,
vn-tfoot, .vn-tfoot,
thead, tbody, tfoot {
& > * {
@ -153,6 +153,18 @@ vn-table {
background-color: $color-font-bg-dark;
color: $color-font-bg;
}
&.dark-notice {
background-color: $color-notice;
color: $color-font-bg;
}
&.yellow {
background-color: $color-yellow;
color: $color-font-bg;
}
&.pink {
background-color: $color-pink;
color: $color-font-bg;
}
}
vn-icon-menu {
display: inline-block;
@ -194,7 +206,7 @@ vn-table.scrollable > .vn-table,
}
vn-thead th,
vn-thead vn-th,
vn-thead vn-th,
thead vn-th,
thead th {
border-bottom: $border;
@ -217,4 +229,4 @@ vn-table.scrollable.lg,
.tableWrapper {
overflow-x: auto;
}
}

View File

@ -101,6 +101,8 @@ $color-marginal: #222;
$color-success: #a3d131;
$color-notice: #32b1ce;
$color-alert: #fa3939;
$color-pink: #ff99cc;
$color-yellow: #ffff00;
$color-button: $color-secondary;
$color-spacer: rgba(255, 255, 255, .3);

View File

@ -10,7 +10,7 @@ module.exports = Self => {
http: {source: 'path'}
}],
returns: {
type: 'object',
type: ['object'],
root: true
},
http: {

View File

@ -17,16 +17,18 @@
<vn-th field="itemFk" number>Item</vn-th>
<vn-th field="concept">Description</vn-th>
<vn-th field="quantity" number>Quantity</vn-th>
<vn-th></vn-th>
<vn-th></vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="sale in sales">
<vn-td center shrink>
<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 center>
<span class="chip {{::$ctrl.chipHasSaleGroupDetail(sale.id)}} vn-mx-xs chip2" vn-tooltip="has saleGroupDetail"></span>
<span class="chip {{::$ctrl.chipIsPreviousSelected()}} vn-ml-xs" vn-tooltip="is previousSelected"></span>
<span class="chip {{::$ctrl.chipIsPrevious()}} vn-mr-xs" vn-tooltip="is previous"></span>
<span class="chip {{::$ctrl.chipIsPrepared()}} vn-mx-xs" vn-tooltip="is prepared"></span>
<span class="chip {{::$ctrl.chipIsControled()}} vn-mx-xs" vn-tooltip="is controled"></span>
</vn-td>
<vn-td number>
<span
@ -49,6 +51,20 @@
</vn-fetched-tags>
</vn-td>
<vn-td number>{{::sale.quantity}}</vn-td>
<vn-td center>
<vn-icon-button
vn-click-stop="$ctrl.showSaleTracking(sale)"
vn-tooltip="Status log"
icon="history">
</vn-icon-button>
</vn-td>
<vn-td>
<vn-icon-button
vn-click-stop="$ctrl.showLog(expedition)"
vn-tooltip="Status log"
icon="icon-inventory">
</vn-icon-button>
</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>
@ -59,3 +75,52 @@
warehouse-fk="$ctrl.ticket.warehouseFk"
ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover>
<vn-popup vn-id="saleTracking">
<vn-crud-model
vn-id="modelSaleTracking"
url="SaleTrackings/listSaleTracking"
link="{saleFk: $ctrl.saleId}"
limit="20"
data="sales"
order="itemFk DESC"
auto-load="true">
</vn-crud-model>
<vn-data-viewer model="modelSaleTracking">
<vn-card class="vn-w-lg">
<vn-table model="modelSaleTracking">
<vn-thead>
<vn-tr>
<vn-th field="quantity" number>Quantity</vn-th>
<vn-th field="originalQuantity" number>Original</vn-th>
<vn-th field="workerFk">Worker</vn-th>
<vn-th field="state" shrink>State</vn-th>
<vn-th field="created" expand>Created</vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="sale in sales">
<vn-td number>{{::sale.quantity}}</vn-td>
<vn-td number>{{::sale.originalQuantity}}</vn-td>
<vn-td expand>
<span
class="link"
ng-click="workerDescriptor.show($event, sale.workerFk)">
{{::sale.userNickname | dashIfEmpty}}
</span>
</vn-td>
<vn-td shrink>{{::sale.state}}</vn-td>
<vn-td expand>{{::sale.created | date: 'dd/MM/yyyy HH:mm'}}</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>
</vn-card>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="worker-descriptor">
</vn-worker-descriptor-popover>
</vn-popup>

View File

@ -1,5 +1,6 @@
import ngModule from '../module';
import Section from 'salix/components/section';
import './style.scss';
class Controller extends Section {
constructor($element, $) {
@ -42,30 +43,35 @@ class Controller extends Section {
}
chipHasSaleGroupDetail(saleId) {
const salePreparing = this.salePreparingList.find(element => element.saleFk = saleId);
if (salePreparing.hasSaleGroupDetail) return 'success';
this.salePreparing = this.salePreparingList.find(element => element.saleFk == saleId);
if (this.salePreparing.hasSaleGroupDetail) return 'pink';
else return 'message';
}
chipIsPreviousSelected(isActive) {
if (isActive) return 'notice';
chipIsPreviousSelected() {
if (this.salePreparing.isPreviousSelected) return 'notice';
else return 'message';
}
chipIsPrevious(isActive) {
if (isActive) return 'success';
chipIsPrevious() {
if (this.salePreparing.isPrevious) return 'dark-notice';
else return 'message';
}
chipIsPrepared(isActive) {
if (isActive) return 'warning';
chipIsPrepared() {
if (this.salePreparing.isPrepared) return 'warning';
else return 'message';
}
chipIsControled(isActive) {
if (isActive) return 'warning';
chipIsControled() {
if (this.salePreparing.isControled) return 'yellow';
else return 'message';
}
showSaleTracking(sale) {
this.saleId = sale.id;
this.$.saleTracking.show();
}
}
ngModule.vnComponent('vnTicketSaleChecked', {

View File

@ -0,0 +1,7 @@
@import "variables";
.chip {
display: inline-block;
min-width: 10px;
min-height: 20px;
}