diff --git a/client/core/src/drop-down/style.scss b/client/core/src/drop-down/style.scss index 626b68156..52adc1199 100644 --- a/client/core/src/drop-down/style.scss +++ b/client/core/src/drop-down/style.scss @@ -3,7 +3,7 @@ vn-drop-down { z-index: 9999; padding: 0 15px; margin-left: -15px; - + background: transparent; ul{ padding: 0; margin: 10px 0 0 0; diff --git a/client/core/src/tooltip/style.css b/client/core/src/tooltip/style.css index 943a92c9c..9d27976c0 100644 --- a/client/core/src/tooltip/style.css +++ b/client/core/src/tooltip/style.css @@ -6,7 +6,6 @@ position: fixed; background-color: #fff; padding: 15px; - max-width: 250px; color: #424242; z-index: 999; border: 1px solid #A7A7A7; @@ -23,6 +22,10 @@ height: 0; } +.tooltip-text{ + max-width: 250px; +} + .tooltip-down .tooltip-arrow { top: -15px; left: 50%; diff --git a/client/core/src/tooltip/tooltip.js b/client/core/src/tooltip/tooltip.js index d7620e41c..ff3f7472f 100644 --- a/client/core/src/tooltip/tooltip.js +++ b/client/core/src/tooltip/tooltip.js @@ -1,18 +1,41 @@ import {module} from '../module'; import './style.css'; -tooltip.$inject = ['$document', '$compile']; -function tooltip($document, $compile) { +tooltip.$inject = ['$document', '$compile', '$sce', '$templateCache', '$http']; +function tooltip($document, $compile, $sce, $templateCache, $http) { + function getTemplate(tooltipTemplateUrl) { + var template = $templateCache.get(tooltipTemplateUrl); + if (typeof template === 'undefined') { + template = $http.get(tooltipTemplateUrl).then(function onGetTemplateSuccess(response) { + return response.data; + }); + $templateCache.put(tooltipTemplateUrl, template); + } + return template; + } + return { restrict: 'A', - scope: true, + priority: -1, link: function(scope, element, attrs) { - var tip = $compile('
{{ text }}
')(scope); + var tip = $compile('
{{ text }}
')(scope); var tipClassName = 'tooltip'; var tipActiveClassName = 'tooltip-show'; scope.tipClass = [tipClassName]; - scope.text = attrs.vnTooltip; + scope.text = attrs.vnTooltip || ''; + + if (attrs.tooltipHtml) { + scope.isHtmlContent = true; + scope.htmlContent = $sce.trustAsHtml(attrs.tooltipHtml); + } else if (attrs.tooltipTemplate) { + var template = getTemplate(attrs.tooltipTemplate); + scope.isHtmlContent = true; + scope.htmlContent = $sce.trustAsHtml(template); + } else { + scope.isHtmlContent = false; + scope.htmlContent = null; + } if (attrs.tooltipPosition) { scope.tipClass.push('tooltip-' + attrs.tooltipPosition); diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index eb033eeff..e132f0033 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -26,15 +26,18 @@ - - + + - - + + + + + + + + - - - @@ -56,7 +59,7 @@ - + @@ -69,7 +72,9 @@ {{::ticket.lines}} {{::ticket.m3}} {{::ticket.boxes}} - + + + diff --git a/client/production/src/index/index.js b/client/production/src/index/index.js index 6b1706de3..c2d811af3 100644 --- a/client/production/src/index/index.js +++ b/client/production/src/index/index.js @@ -10,7 +10,12 @@ export default class ProductionIndex { this.tickets = []; this.lines = 0; this.meters = 0; - this.state = null; + this.actions = { + state: null, + worker: null, + hour: null + }; + this.hourItems = []; } get checkAll() { return this._checkAll; @@ -19,12 +24,6 @@ export default class ProductionIndex { this._checkAll = value; this.switchChecks(); } - /*get state() { - return this._state; - } - set state(value) { - this._state = value; - }*/ switchChecks() { let checks = this.$element[0].querySelectorAll('.list-body input[type="checkbox"]'); checks.forEach( @@ -42,11 +41,10 @@ export default class ProductionIndex { (_, i) => { ids.push(this.tickets[i].ticket); // Fake change state - this.tickets[i].state = this.state.name; + this.tickets[i].state = this.actions.state.name; } ); - console.log("TODO: call action -> endPoint with tickets's Ids", action, ids, this.state); - + console.log("TODO: call action -> endPoint with tickets's Ids", action, ids, this.actions); // TODO: call action -> endPoint with tickets's Ids } else { console.log("TODO: dialog with no items selected", action); @@ -70,9 +68,19 @@ export default class ProductionIndex { this.$.index.accept(); } $doCheck() { - if (this.state) { + if (this.actions.state) { this.doAction('changeState'); - this.state = null; + this.actions.state = null; + } + } + $onInit() { + for (let i = 6; i < 21; i++) { + let hour = [i].join(''); + if (hour.length === 1) { + hour = [0, i].join(''); + } + hour += ':00'; + this.hourItems.push({id: i, name: hour}); } } } diff --git a/client/production/src/index/more-info-tooltip.tpl.html b/client/production/src/index/more-info-tooltip.tpl.html new file mode 100644 index 000000000..085187043 --- /dev/null +++ b/client/production/src/index/more-info-tooltip.tpl.html @@ -0,0 +1,18 @@ + + + + PoblaciĆ³n + Provincia + ID_Cliente + Comercial + + + + + {{ticket.city}} + {{ticket.province}} + {{ticket.client}} + {{ticket.salePerson}} + + + \ No newline at end of file diff --git a/client/production/src/index/style.scss b/client/production/src/index/style.scss index cafeb13cb..63d0cd9a7 100644 --- a/client/production/src/index/style.scss +++ b/client/production/src/index/style.scss @@ -17,27 +17,4 @@ vn-production-index { .icon-square{ height: 36px; } - .list-header{ - border-bottom: 3px solid #9D9D9D; - font-weight: bold; - } - - .list-footer{ - border-top: 3px solid #9D9D9D; - font-weight: bold; - } - .list > vn-one, .list > [vn-one], .list > [vn-two], .list > vn-two{ - text-align: center; - } - .list > vn-none{ - min-width: 60px; - } - .list-body{ - padding: 4px 0px; - border-bottom: 1px solid #9D9D9D; - - i { - color: #ffa410; - } - } } \ No newline at end of file diff --git a/client/salix/src/styles/misc.scss b/client/salix/src/styles/misc.scss index c3712646e..604e40d51 100644 --- a/client/salix/src/styles/misc.scss +++ b/client/salix/src/styles/misc.scss @@ -35,4 +35,28 @@ html [vn-right], .vn-right{ } html [vn-left], .vn-left{ float: left; +} + +.list-header{ + border-bottom: 3px solid #9D9D9D; + font-weight: bold; + } + +.list-footer{ + border-top: 3px solid #9D9D9D; + font-weight: bold; +} +.list > vn-one, .list > [vn-one], .list > [vn-two], .list > vn-two{ + text-align: center; +} +.list > vn-none{ + min-width: 60px; +} +.list-body{ + padding: 4px 0px; + border-bottom: 1px solid #9D9D9D; + + i { + color: #ffa410; + } } \ No newline at end of file diff --git a/services/production/common/methods/ticket-state/change-state.js b/services/production/common/methods/ticket-state/change-state.js index 99254bd66..8951ec13e 100644 --- a/services/production/common/methods/ticket-state/change-state.js +++ b/services/production/common/methods/ticket-state/change-state.js @@ -32,7 +32,7 @@ module.exports = function(TicketState) { }; var changeState = function(tickets, state, cb){ - TicketState.update(where(tickets), {"state": state}, function(error, response){ + TicketState.updateAll(where(tickets), {"state": state}, function(error, response){ if(!error) cb(null, true); cb(error);