#795 ticket.services
This commit is contained in:
parent
706588d7dd
commit
fdf0c5f1c0
|
@ -198,6 +198,12 @@
|
||||||
"abstract": true,
|
"abstract": true,
|
||||||
"component": "ui-view"
|
"component": "ui-view"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"url": "/service",
|
||||||
|
"state": "ticket.card.service",
|
||||||
|
"component": "vn-ticket-service",
|
||||||
|
"description": "Service"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"url" : "/index",
|
"url" : "/index",
|
||||||
"state": "ticket.card.request.index",
|
"state": "ticket.card.request.index",
|
||||||
|
@ -226,6 +232,7 @@
|
||||||
{"state": "ticket.card.volume", "icon": "icon-volume"},
|
{"state": "ticket.card.volume", "icon": "icon-volume"},
|
||||||
{"state": "ticket.card.expedition", "icon": "icon-volum"},
|
{"state": "ticket.card.expedition", "icon": "icon-volum"},
|
||||||
{"state": "ticket.card.package.index", "icon": "icon-bucket"},
|
{"state": "ticket.card.package.index", "icon": "icon-bucket"},
|
||||||
|
{"state": "ticket.card.service"},
|
||||||
{"state": "ticket.card.tracking.index", "icon": "remove_red_eye"},
|
{"state": "ticket.card.tracking.index", "icon": "remove_red_eye"},
|
||||||
{"state": "ticket.card.saleChecked", "icon": "assignment"},
|
{"state": "ticket.card.saleChecked", "icon": "assignment"},
|
||||||
{"state": "ticket.card.components", "icon": "icon-components"},
|
{"state": "ticket.card.components", "icon": "icon-components"},
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
<vn-crud-model
|
||||||
|
vn-id="model"
|
||||||
|
url="/ticket/api/TicketServices"
|
||||||
|
link="{ticketFk: $ctrl.$stateParams.id}"
|
||||||
|
data="services" on-data-change="$ctrl.onDataChange()">
|
||||||
|
</vn-crud-model>
|
||||||
|
<vn-watcher
|
||||||
|
vn-id="watcher"
|
||||||
|
data="services"
|
||||||
|
form="form">
|
||||||
|
</vn-watcher>
|
||||||
|
<form name="form" ng-submit="$ctrl.onSubmit()">
|
||||||
|
<vn-card pad-large>
|
||||||
|
<vn-title>Service</vn-title>
|
||||||
|
<vn-one>
|
||||||
|
<vn-horizontal ng-repeat="service in services track by $index">
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
vn-focus
|
||||||
|
label="Description"
|
||||||
|
model="service.description"
|
||||||
|
rule="TicketService.description">
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Quantity"
|
||||||
|
model="service.quantity"
|
||||||
|
rule="TicketService.quantity">
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Price"
|
||||||
|
model="service.price"
|
||||||
|
rule="TicketService.price">
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-autocomplete vn-one
|
||||||
|
url="/api/TaxClasses"
|
||||||
|
label="Tax class"
|
||||||
|
show-field="description"
|
||||||
|
value-field="id"
|
||||||
|
field="service.taxClassFk">
|
||||||
|
</vn-autocomplete>
|
||||||
|
<vn-auto pad-medium-top>
|
||||||
|
<vn-icon
|
||||||
|
pointer
|
||||||
|
medium-grey
|
||||||
|
vn-tooltip="Remove service"
|
||||||
|
icon="delete"
|
||||||
|
ng-click="model.remove($index)">
|
||||||
|
</vn-icon>
|
||||||
|
</vn-one>
|
||||||
|
</vn-horizontal>
|
||||||
|
</vn-one>
|
||||||
|
<vn-one>
|
||||||
|
<vn-icon-button
|
||||||
|
pointer
|
||||||
|
vn-tooltip="Add service"
|
||||||
|
vn-bind="+"
|
||||||
|
icon="add_circle"
|
||||||
|
ng-click="$ctrl.add()">
|
||||||
|
</vn-icon-button>
|
||||||
|
</vn-one>
|
||||||
|
</vn-card>
|
||||||
|
<vn-button-bar>
|
||||||
|
<vn-submit label="Save"></vn-submit>
|
||||||
|
</vn-button-bar>
|
||||||
|
</form>
|
|
@ -0,0 +1,31 @@
|
||||||
|
import ngModule from '../module';
|
||||||
|
|
||||||
|
class Controller {
|
||||||
|
constructor($scope, $stateParams) {
|
||||||
|
this.$scope = $scope;
|
||||||
|
this.$stateParams = $stateParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
add() {
|
||||||
|
this.$scope.model.insert({
|
||||||
|
taxClassFk: 2,
|
||||||
|
quantity: 1,
|
||||||
|
ticketFk: this.$stateParams.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmit() {
|
||||||
|
this.$scope.watcher.check();
|
||||||
|
this.$scope.model.save().then(() => {
|
||||||
|
this.$scope.watcher.notifySaved();
|
||||||
|
this.$scope.model.refresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Controller.$inject = ['$scope', '$stateParams'];
|
||||||
|
|
||||||
|
ngModule.component('vnTicketService', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Controller
|
||||||
|
});
|
|
@ -0,0 +1,4 @@
|
||||||
|
Service: Servicios
|
||||||
|
Tax class: Tipo IVA
|
||||||
|
Add service: Añadir servicio
|
||||||
|
Remove service: Quitar servicio
|
|
@ -19,6 +19,7 @@ import './sale/editDiscount';
|
||||||
import './tracking/index';
|
import './tracking/index';
|
||||||
import './tracking/edit';
|
import './tracking/edit';
|
||||||
import './sale-checked';
|
import './sale-checked';
|
||||||
|
import './services';
|
||||||
import './component';
|
import './component';
|
||||||
import './sale-tracking';
|
import './sale-tracking';
|
||||||
import './picture';
|
import './picture';
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
{
|
{
|
||||||
"TaxClass": {
|
|
||||||
"dataSource": "vn"
|
|
||||||
},
|
|
||||||
"TaxCode": {
|
|
||||||
"dataSource": "vn"
|
|
||||||
},
|
|
||||||
"TaxType": {
|
|
||||||
"dataSource": "vn"
|
|
||||||
},
|
|
||||||
"ItemNiche": {
|
"ItemNiche": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
@ -23,9 +14,6 @@
|
||||||
"ItemPlacement": {
|
"ItemPlacement": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"ItemTaxCountry": {
|
|
||||||
"dataSource": "vn"
|
|
||||||
},
|
|
||||||
"Warehouse": {
|
"Warehouse": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
|
|
@ -28,7 +28,7 @@ module.exports = Self => {
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
let clientFk = address.clientFk;
|
let clientFk = address.clientFk;
|
||||||
console.log(address);
|
|
||||||
if (address.client().isFreezed)
|
if (address.client().isFreezed)
|
||||||
throw new UserError(`You can't create an order for a frozen client`);
|
throw new UserError(`You can't create an order for a frozen client`);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
"name": "TicketService",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "ticketService"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "Number",
|
||||||
|
"id": true,
|
||||||
|
"description": "Identifier"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "String",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"quantity": {
|
||||||
|
"type": "Number",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"price": {
|
||||||
|
"type": "Number",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"taxClassFk": {
|
||||||
|
"type": "Number",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"taxClass": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "TaxClass",
|
||||||
|
"foreignKey": "taxClassFk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,11 +5,11 @@
|
||||||
"AccessToken": {
|
"AccessToken": {
|
||||||
"dataSource": "salix",
|
"dataSource": "salix",
|
||||||
"relations": {
|
"relations": {
|
||||||
"user": {
|
"user": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "user",
|
"model": "user",
|
||||||
"foreignKey": "userId"
|
"foreignKey": "userId"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ACL": {
|
"ACL": {
|
||||||
|
@ -99,6 +99,21 @@
|
||||||
"TicketState":{
|
"TicketState":{
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
"TaxClass": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"TaxCode": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"TaxType": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"ItemTaxCountry": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"TicketService":{
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"Item": {
|
"Item": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue