2863 - Added monitor module
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-05-04 12:44:21 +02:00
parent deeb306b1a
commit db148c8177
16 changed files with 311 additions and 1 deletions

View File

@ -16,10 +16,11 @@ export default function moduleImport(moduleName) {
case 'travel' : return import('travel/front');
case 'worker' : return import('worker/front');
case 'invoiceOut' : return import('invoiceOut/front');
case 'invoiceIn' : return import('invoiceIn/front');
case 'invoiceIn' : return import('invoiceIn/front');
case 'route' : return import('route/front');
case 'entry' : return import('entry/front');
case 'account' : return import('account/front');
case 'supplier' : return import('supplier/front');
case 'monitor' : return import('monitor/front');
}
}

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1,5 @@
export * from './module';
import './main';
import './index/';
import './search-panel';

View File

@ -0,0 +1,160 @@
<vn-horizontal>
<vn-two class="vn-mr-md">
<vn-card>
<vn-crud-model
vn-id="ticketmodel"
url="Tickets/filter"
limit="20"
order="shippedDate DESC, shippedHour ASC, zoneLanding ASC">
</vn-crud-model>
<vn-table model="ticketmodel">
<vn-thead>
<vn-tr>
<vn-th shrink>
<vn-multi-check
model="ticketmodel">
</vn-multi-check>
</vn-th>
<vn-th class="icon-field"></vn-th>
<vn-th field="id">Id</vn-th>
<vn-th field="salesPersonFk" class="expendable">Salesperson</vn-th>
<vn-th field="shipped" shrink-date>Date</vn-th>
<vn-th>Hour</vn-th>
<vn-th field="hour" shrink>Closure</vn-th>
<vn-th field="nickname">Alias</vn-th>
<vn-th field="provinceFk" class="expendable">Province</vn-th>
<vn-th field="stateFk" >State</vn-th>
<vn-th field="zoneFk">Zone</vn-th>
<vn-th field="warehouseFk">Warehouse</vn-th>
<vn-th number>Total</vn-th>
<vn-th></vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
<a ng-repeat="ticket in ticketmodel.data"
class="clickable vn-tr search-result"
ui-sref="ticket.card.summary({id: {{::ticket.id}}})">
<vn-td>
<vn-check
ng-model="ticket.checked"
vn-click-stop>
</vn-check>
</vn-td>
<vn-td class="icon-field">
<vn-icon
ng-show="::ticket.isTaxDataChecked === 0"
translate-attr="{title: 'No verified data'}"
class="bright"
icon="icon-no036">
</vn-icon>
<vn-icon
ng-show="::ticket.hasTicketRequest"
translate-attr="{title: 'Purchase request'}"
class="bright"
icon="icon-100">
</vn-icon>
<vn-icon
ng-show="::ticket.isAvailable === 0"
translate-attr="{title: 'Not available'}"
class="bright"
vn-tooltip="Not available"
icon="icon-unavailable">
</vn-icon>
<vn-icon
ng-show="::ticket.isFreezed"
translate-attr="{title: 'Client frozen'}"
class="bright"
icon="icon-frozen">
</vn-icon>
<vn-icon
ng-show="::ticket.risk"
title="{{::$ctrl.$t('Risk')}}: {{ticket.risk}}"
class="bright"
icon="icon-risk">
</vn-icon>
</vn-td>
<vn-td shrink>{{::ticket.id}}</vn-td>
<vn-td class="expendable">
<span
title="{{::ticket.userName}}"
vn-click-stop="workerDescriptor.show($event, ticket.salesPersonFk)"
class="link">
{{::ticket.userName | dashIfEmpty}}
</span>
</vn-td>
<vn-td shrink-date>
<span class="chip {{$ctrl.compareDate(ticket.shipped)}}">
{{::ticket.shipped | date: 'dd/MM/yyyy'}}
</span>
</vn-td>
<vn-td shrink>{{::ticket.shipped | date: 'HH:mm'}}</vn-td>
<vn-td shrink>{{::ticket.zoneLanding | date: 'HH:mm'}}</vn-td>
<vn-td>
<span
title="{{::ticket.nickname}}"
vn-click-stop="clientDescriptor.show($event, ticket.clientFk)"
class="link">
{{::ticket.nickname}}
</span>
</vn-td>
<vn-td class="expendable">{{::ticket.province}}</vn-td>
<vn-td class="expendable">
<span
ng-show="ticket.refFk"
title="{{::ticket.refFk}}"
vn-click-stop="invoiceOutDescriptor.show($event, ticket.invoiceOutId)"
class="link">
{{::ticket.refFk}}
</span>
<span
ng-show="!ticket.refFk"
class="chip {{$ctrl.stateColor(ticket)}}">
{{ticket.state}}
</span>
</vn-td>
<vn-td>
<span
title="{{::ticket.zoneName}}"
vn-click-stop="zoneDescriptor.show($event, ticket.zoneFk)"
class="link">
{{::ticket.zoneName | dashIfEmpty}}
</span>
</vn-td>
<vn-td>{{::ticket.warehouse}}</vn-td>
<vn-td number>
<span class="chip {{$ctrl.totalPriceColor(ticket)}}">
{{::(ticket.totalWithVat ? ticket.totalWithVat : 0) | currency: 'EUR': 2}}
</span>
</vn-td>
<vn-td actions>
<vn-icon-button
vn-anchor="::{
state: 'ticket.card.sale',
params: {id: ticket.id},
target: '_blank'
}"
vn-tooltip="Go to lines"
icon="icon-lines">
</vn-icon-button>
<vn-icon-button
vn-click-stop="$ctrl.preview(ticket)"
vn-tooltip="Preview"
icon="preview">
</vn-icon-button>
</vn-td>
</a>
</vn-tbody>
</vn-table>
</vn-card>
</vn-two>
<vn-one>
<vn-vertical class="vn-mb-md">
<vn-card>
b
</vn-card>
</vn-vertical>
<vn-vertical>
<vn-card>c</vn-card>
</vn-vertical>
</vn-one>
</vn-horizontal>

View File

@ -0,0 +1,18 @@
import ngModule from '../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
openSummary(supplier, event) {
if (event.defaultPrevented) return;
event.preventDefault();
event.stopPropagation();
this.supplierSelected = supplier;
this.$.dialogSummarySupplier.show();
}
}
ngModule.vnComponent('vnMonitorIndex', {
template: require('./index.html'),
controller: Controller
});

View File

@ -0,0 +1,5 @@
Payment deadline: Plazo de pago
Pay day: Dia de pago
Account: Cuenta
Pay method: Metodo de pago
Tax number: Nif

View File

@ -0,0 +1 @@
Accounts: Cuentas

View File

@ -0,0 +1 @@
<vn-log url="SupplierLogs" origin-id="$ctrl.$params.id"></vn-log>

View File

@ -0,0 +1,7 @@
import ngModule from '../module';
import Section from 'salix/components/section';
ngModule.vnComponent('vnSupplierLog', {
template: require('./index.html'),
controller: Section,
});

View File

@ -0,0 +1,12 @@
<!-- <vn-portal slot="topbar">
<vn-searchbar
vn-focus
panel="vn-supplier-search-panel"
info="Search suppliers by id, name or alias"
model="model">
</vn-searchbar>
</vn-portal> -->
<vn-portal slot="menu">
<vn-left-menu></vn-left-menu>
</vn-portal>
<ui-view></ui-view>

View File

@ -0,0 +1,9 @@
import ngModule from '../module';
import ModuleMain from 'salix/components/module-main';
export default class Monitor extends ModuleMain {}
ngModule.vnComponent('vnMonitor', {
controller: Monitor,
template: require('./index.html')
});

View File

@ -0,0 +1,3 @@
import {ng} from 'core/vendor';
export default ng.module('monitor', ['salix']);

View File

@ -0,0 +1,29 @@
{
"module": "monitor",
"name": "Monitors",
"icon" : "icon-supplier",
"dependencies": ["ticket", "item"],
"validations" : true,
"menus": {
"main": [
{"state": "monitor.index", "icon": "leaderboard"}
],
"card": []
},
"keybindings": [],
"routes": [
{
"url": "/monitor",
"state": "monitor",
"abstract": true,
"component": "vn-monitor",
"description": "Monitors"
},
{
"url": "/index?q",
"state": "monitor.index",
"component": "vn-monitor-index",
"description": "Sales monitor"
}
]
}

View File

@ -0,0 +1,46 @@
<div class="search-panel">
<form ng-submit="$ctrl.onSearch()">
<vn-horizontal>
<vn-textfield
vn-one
label="General search"
ng-model="filter.search"
info="Search suppliers by id, name or alias"
vn-focus>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Alias"
ng-model="filter.nickname">
</vn-textfield>
<vn-textfield
vn-one
label="Tax number"
ng-model="filter.nif">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
label="Province"
ng-model="filter.provinceFk"
url="Provinces"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
vn-one
label="Country"
ng-model="filter.countryFk"
url="countries"
show-field="country"
value-field="id">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal class="vn-mt-lg">
<vn-submit label="Search"></vn-submit>
</vn-horizontal>
</form>
</div>

View File

@ -0,0 +1,7 @@
import ngModule from '../module';
import SearchPanel from 'core/components/searchbar/search-panel';
ngModule.vnComponent('vnSupplierSearchPanel', {
template: require('./index.html'),
controller: SearchPanel
});

View File

@ -0,0 +1,4 @@
Province: Provincia
Country: País
Tax number: NIF / CIF
Search suppliers by id, name or alias: Busca proveedores por id, nombre o alias