refactoring client service osai

This commit is contained in:
Alessandro Francia
2018-08-08 09:30:41 +02:00
parent c712362acd
commit 0635a69dc5
21 changed files with 1197 additions and 212 deletions
+24
View File
@@ -1360,3 +1360,27 @@
}
}
}
.objects-job{
width: 456px;
height: 72px;
border-radius: 2px;
background-color: @color-background-white;
box-shadow: 0 1px 2px 0 @color-black-40;
display: flex;
flex-flow: row;
align-items: center;
.objects-job-image{
margin-left: 8px;
}
.objects-job-title{
margin-left: 24px;
font-size: 18px;
font-weight: 600;
line-height: 1.11;
color: @color-greyish-brown;
}
}
.min{
height: 40px;
}
@@ -0,0 +1,110 @@
// out: false, sourceMap: false, main: ../style.less
@import "colors.less";
.job-editor-container{
height: 100%;
width: 100%;
display: flex;
justify-content: center;
padding-top: 104px;
.job-editor-box{
width: 1808px;
height: 872px;
border-radius: 2px;
background-color: @color-background-white;
box-shadow: 0 1px 2px 0 @color-black-40;
.job-editor-header{
width: 100%;
height: 79px;
display: flex;
flex-flow: row;
align-items: center;
border-bottom: solid 2px @color-whitethree;
.title{
width: 145px;
justify-content: flex-start;
margin-left: 23px;
font-size: 20px;
color: @color-darkish-blue;
label{
width: 145px;
height: 24px;
}
}
.search-job{
display: flex;
flex-flow: row;
margin-left: 24px;
input{
width: 288px;
height: 48px;
border-radius: 2px;
}
}
.group-button{
display: flex;
flex-flow: row;
width: 100%;
justify-content: flex-end;
}
}
.job-editor-body{
width: 100%;
height: 711px;
display: flex;
flex-flow: row;
align-items: center;
.job-editor-column-left{
width: 488px;
height: 711px;
display: flex;
flex-flow: column;
justify-content: flex-start;
.column-left-title{
display: flex;
justify-content: center;
width: 100%;
margin-top: 24px;
margin-bottom: 23px;
span{
width: 456px;
font-size: 18px;
line-height: 1.11;
color: @color-greyish-brown;
}
}
.column-left-objects-big, .column-left-objects-small{
display: flex;
justify-content: center;
width: 100%;
margin: 8px 0;
}
}
.job-editor-body-box{
width: 1320px;
height: 711px;
display: flex;
justify-content: flex-end;
background-color: @color-whitethree;
}
}
.job-editor-footer{
display: flex;
flex-flow: row;
align-items: center;
width: 100%;
height: 78px;
border-top: solid 2px @color-whitethree;
.button-left{
display: flex;
width: 100%;
justify-content: flex-start;
}
.button-right{
display: flex;
width: 100%;
justify-content: flex-end;
}
}
}
}
@@ -30,6 +30,7 @@
@import "production.less";
@import "create-queue.less";
@import "program-management.less";
@import "job-editor.less";
@background-color: rgb(216, 216, 216);
@handle-width: 48px;
+103
View File
@@ -1383,6 +1383,35 @@
display: flex;
flex-flow: column;
justify-content: flex-start;
.box-image{
display: flex;
justify-content: center;
height: 415px;
width: 752px;
}
.box-text{
height: 104px;
width: 834px;
display: flex;
flex-flow: column;
margin: 0 auto;
.title{
display: flex;
font-size: 18px;
line-height: 1;
color: @color-darkish-blue;
}
.text{
display: flex;
margin-left: 14px;
width: 820px;
height: 72px;
font-size: 18px;
line-height: 1;
margin-top: 14px;
color: @color-greyish-brown;
}
}
.box-tag-tool {
height: 100%;
width: 100%;
@@ -1408,6 +1437,80 @@
width: 96px;
}
}
.box-tag-times{
width: 100%;
height: 100%;
display: flex;
flex-flow: column;
align-items: center;
.row-time{
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
flex-flow: row;
font-size: 18px;
font-weight: 600;
line-height: 1.11;
color: @color-greyish-brown;
margin-top: 39px;
.box-time-to-use{
display: flex;
float: left;
flex-flow: column;
label{
margin-bottom: 36px;
}
}
.box-time-average-time{
display: flex;
float: right;
flex-flow: column;
label{
margin-bottom: 36px;
}
}
}
.box-history-time{
.box-history-time-title{
width: 100%;
display: flex;
justify-content: center;
margin-top: 64px;
}
table{
width: 720px;
height: 240px;
border-radius: 2px;
border: solid 1px @color-label-grey;
table-layout: fixed;
tr{
width: 100%;
display: table;
}
thead tr{
height: 48px;
}
tbody{
display: block;
width: 720px;
height: 192px;
tr{
height: 64px;
width: 100%;
td{
text-align: center;
div{
margin: 0 auto;
}
}
}
}
tr:nth-child(even) {background: #dddddd}
tr:nth-child(odd) {background: #FFF}
}
}
}
}
}
.modal-edit-job-footer {
+236
View File
@@ -1309,6 +1309,35 @@
flex-flow: column;
justify-content: flex-start;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-image {
display: flex;
justify-content: center;
height: 415px;
width: 752px;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-text {
height: 104px;
width: 834px;
display: flex;
flex-flow: column;
margin: 0 auto;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-text .title {
display: flex;
font-size: 18px;
line-height: 1;
color: #002680;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-text .text {
display: flex;
margin-left: 14px;
width: 820px;
height: 72px;
font-size: 18px;
line-height: 1;
margin-top: 14px;
color: #4b4b4b;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-tool {
height: 100%;
width: 100%;
@@ -1334,6 +1363,82 @@
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-params .input-box .control input {
width: 96px;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times {
width: 100%;
height: 100%;
display: flex;
flex-flow: column;
align-items: center;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .row-time {
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
flex-flow: row;
font-size: 18px;
font-weight: 600;
line-height: 1.11;
color: #4b4b4b;
margin-top: 39px;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .row-time .box-time-to-use {
display: flex;
float: left;
flex-flow: column;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .row-time .box-time-to-use label {
margin-bottom: 36px;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .row-time .box-time-average-time {
display: flex;
float: right;
flex-flow: column;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .row-time .box-time-average-time label {
margin-bottom: 36px;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .box-history-time .box-history-time-title {
width: 100%;
display: flex;
justify-content: center;
margin-top: 64px;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .box-history-time table {
width: 720px;
height: 240px;
border-radius: 2px;
border: solid 1px #979797;
table-layout: fixed;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .box-history-time table tr {
width: 100%;
display: table;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .box-history-time table thead tr {
height: 48px;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .box-history-time table tbody {
display: block;
width: 720px;
height: 192px;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .box-history-time table tbody tr {
height: 64px;
width: 100%;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .box-history-time table tbody tr td {
text-align: center;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .box-history-time table tbody tr td div {
margin: 0 auto;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .box-history-time table tr:nth-child(even) {
background: #dddddd;
}
.modal.modal-edit-job .modal-edit-job-body .modal-edit-job-box .box-tag-times .box-history-time table tr:nth-child(odd) {
background: #FFF;
}
.modal.modal-edit-job .modal-edit-job-footer {
height: 78px;
border-top: solid 2px #979797;
@@ -5457,6 +5562,29 @@ footer .container button.big:before {
.selected-path-drive.dark * {
color: #fff !important;
}
.objects-job {
width: 456px;
height: 72px;
border-radius: 2px;
background-color: #fff;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
display: flex;
flex-flow: row;
align-items: center;
}
.objects-job .objects-job-image {
margin-left: 8px;
}
.objects-job .objects-job-title {
margin-left: 24px;
font-size: 18px;
font-weight: 600;
line-height: 1.11;
color: #4b4b4b;
}
.min {
height: 40px;
}
@keyframes selectedanimation {
0% {
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
@@ -11526,6 +11654,114 @@ footer .container button.big:before {
align-items: center;
justify-content: center;
}
.job-editor-container {
height: 100%;
width: 100%;
display: flex;
justify-content: center;
padding-top: 104px;
}
.job-editor-container .job-editor-box {
width: 1808px;
height: 872px;
border-radius: 2px;
background-color: #fff;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
}
.job-editor-container .job-editor-box .job-editor-header {
width: 100%;
height: 79px;
display: flex;
flex-flow: row;
align-items: center;
border-bottom: solid 2px #e7e7e7;
}
.job-editor-container .job-editor-box .job-editor-header .title {
width: 145px;
justify-content: flex-start;
margin-left: 23px;
font-size: 20px;
color: #002680;
}
.job-editor-container .job-editor-box .job-editor-header .title label {
width: 145px;
height: 24px;
}
.job-editor-container .job-editor-box .job-editor-header .search-job {
display: flex;
flex-flow: row;
margin-left: 24px;
}
.job-editor-container .job-editor-box .job-editor-header .search-job input {
width: 288px;
height: 48px;
border-radius: 2px;
}
.job-editor-container .job-editor-box .job-editor-header .group-button {
display: flex;
flex-flow: row;
width: 100%;
justify-content: flex-end;
}
.job-editor-container .job-editor-box .job-editor-body {
width: 100%;
height: 711px;
display: flex;
flex-flow: row;
align-items: center;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-column-left {
width: 488px;
height: 711px;
display: flex;
flex-flow: column;
justify-content: flex-start;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-column-left .column-left-title {
display: flex;
justify-content: center;
width: 100%;
margin-top: 24px;
margin-bottom: 23px;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-column-left .column-left-title span {
width: 456px;
font-size: 18px;
line-height: 1.11;
color: #4b4b4b;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-column-left .column-left-objects-big,
.job-editor-container .job-editor-box .job-editor-body .job-editor-column-left .column-left-objects-small {
display: flex;
justify-content: center;
width: 100%;
margin: 8px 0;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box {
width: 1320px;
height: 711px;
display: flex;
justify-content: flex-end;
background-color: #e7e7e7;
}
.job-editor-container .job-editor-box .job-editor-footer {
display: flex;
flex-flow: row;
align-items: center;
width: 100%;
height: 78px;
border-top: solid 2px #e7e7e7;
}
.job-editor-container .job-editor-box .job-editor-footer .button-left {
display: flex;
width: 100%;
justify-content: flex-start;
}
.job-editor-container .job-editor-box .job-editor-footer .button-right {
display: flex;
width: 100%;
justify-content: flex-end;
}
a,
a:visited,
a:hover,
+7 -1
View File
@@ -97,6 +97,12 @@ export const DepotActionUnloading = () =>
export const DepotActionGeneric = () =>
import ("./components/tooling/depot-action-generic.vue");
export const JobEditor = () =>
import ("./components/job-editor.vue");
export const ObjectsJob = () =>
import ("./modules/base-components/cards/objects-job.vue");
// export const Utilities = () =>
// import ("./components/utilities.vue");
@@ -153,4 +159,4 @@ export const TestEmpty = () =>
import ("./components/test-empty.vue");
export const TestHeader = () =>
import ("./components/test-status.vue");
import ("./components/test-status.vue");
import ("./components/test-status.vue");
+7 -1
View File
@@ -44,7 +44,9 @@ import {
ModalLoadProgram,
ProgramManagement,
ModalJobAddParameter,
ModalEditJob
ModalEditJob,
JobEditor,
ObjectsJob
} from "./app.modules";
export let routes = [
@@ -90,6 +92,10 @@ export let routes = [
{ path: "/depot-action-unloading", component: DepotActionUnloading, meta: { title: "Step - Depot-Action-Unloading", area: "depot-action-unloading" } },
{ path: "/depot-action-generic", component: DepotActionGeneric, meta: { title: "Step - Depot-Action-Generic", area: "depot-action-generic" } },
{ path: "/job-editor", component: JobEditor, meta: { title: "Job-Editor", area: "job-editor" } },
{ path: "/objects-job", component: ObjectsJob, meta: { title: "Objects Job", area: "objects-jobs" } },
{ path: "/program-management", component: ProgramManagement, meta: { title: "Step - Program-Management", area: "program-management" } },
{ path: "/maintenance-progress", component: MaintenanceProgress, meta: { title: "Step - Maintenance-Progress", area: "maintenance-progress" } },
@@ -0,0 +1,7 @@
import Vue from "vue";
import Component from "vue-class-component";
import {objectsJob} from "src/modules/base-components/cards";
declare let $: any;
@Component({ components: { objectsJob } })
export default class JobEditor extends Vue {
}
@@ -0,0 +1,49 @@
<template>
<div class="job-editor-container">
<div class="job-editor-box">
<div class="job-editor-header">
<div class="title">
<label>Job editor</label>
</div>
<div class="search-job">
<input type="text">
<button class="btn"><i class="fa fa-folder"></i></button>
</div>
<div class="group-button">
<button class="btn"><i class="fa fa-clone"></i></button>
<button class="btn"><i class="fa fa-trash"></i></button>
</div>
</div>
<div class="job-editor-body">
<div class="job-editor-column-left">
<div class="column-left-title">
<span>Trascina nella parte centrale della pagina gli oggetti che desideri aggiungere al job</span>
</div>
<div class="column-left-objects-big">
<objects-job title="Part program"></objects-job>
</div>
<div class="column-left-objects-small">
<objects-job title="Pausa"></objects-job>
</div>
</div>
<div class="job-editor-body-box">
<div class="job-editor-body-box-left">
</div>
<div class="job-editor-body-box-right">
</div>
</div>
</div>
<div class="job-editor-footer">
<div class="button-left">
<button class="btn">Svuota job</button>
</div>
<div class="button-right">
<button class="btn btn-success">Salva</button>
</div>
</div>
</div>
</div>
</template>
<script src="./job-editor.ts" lang="ts"></script>
@@ -95,6 +95,8 @@ export default class depot extends Vue {
public draggingTool: any = null;
public draggingPosition: number = null;
public typeNc: string = "Osai";
@Watch("searchText")
public applyFilter(n) {
this.currentFilter = n.toLowerCase();
@@ -139,13 +141,25 @@ export default class depot extends Vue {
async loadData() {
return Promise.all([
new DepotService().GetMagazine(this.$route.params.id),
new DepotService().GetToolAvailable(),
new ToolingService().GetMagazinePositionDepot(this.$route.params.id),
new ToolingService().GetTools(),
new ToolingService().GetShanks()
]);
if(this.typeNc == "Demo"){
return Promise.all([
new DepotService().GetMagazine(this.$route.params.id),
new DepotService().GetToolAvailable(),
new ToolingService().GetMagazinePositionDepot(this.$route.params.id),
new ToolingService().GetTools(),
new ToolingService().GetShanks()
]);
}
else{
return Promise.all([
new DepotService().GetNcMagazine(this.$route.params.id),
new DepotService().GetNcShankAvailable(),
new ToolingService().GetNcMagazinePositionDepot(this.$route.params.id),
new ToolingService().GetNcTools(),
new ToolingService().GetNcShanks()
]);
}
}
updated() {
@@ -234,11 +248,20 @@ export default class depot extends Vue {
this.depotId = id;
this.$router.push({ name: 'tooling-depot', params: { id: id } });
awaiter (Promise.all([
if(this.typeNc == "Demo"){
awaiter (Promise.all([
new DepotService().GetMagazine(id),
new ToolingService().GetMagazinePositionDepot(id),
new ToolingService().GetTools()
]));
}
else{
awaiter (Promise.all([
new DepotService().GetNcMagazine(id),
new ToolingService().GetNcMagazinePositionDepot(id),
new ToolingService().GetNcTools()
]));
}
// this.magazines;
}
@@ -283,17 +306,34 @@ export default class depot extends Vue {
this.draggingIn = false;
this.draggingTool = null;
var toolToAdd = event.payload;
new DepotService().AddToolToDepot(this.depotId, position, { toolId: toolToAdd.id }).then(response => {
if(this.typeNc == "Demo"){
new DepotService().AddToolToDepot(this.depotId, position, { toolId: toolToAdd.id }).then(response => {
});
}
else{
new DepotService().AddToolToDepotNc(this.depotId, position, { toolId: toolToAdd.id }).then(response => {
});
}
});
}
}
public removeToolsToDepot(position, toolToAdd) {
if (this.editable)
new DepotService().RemoveToolToDepot(this.depotId, position).then(response => {
if (this.editable){
if(this.typeNc == "Demo"){
new DepotService().RemoveToolToDepot(this.depotId, position).then(response => {
});
}
else{
new DepotService().RemoveToolToDepotNc(this.depotId, position).then(response => {
});
}
}
});
}
public goToPosition(index) {
@@ -32,30 +32,32 @@ export default class toolingEquipment extends Vue {
public searchText: string = "";
public currentFilter: string = "";
public typeNc: string = "Osai";
@Watch("searchText")
public applyFilter(n) {
this.currentFilter = n.toLowerCase();
// this.currentFilter = this.searchText.toLowerCase();
}
@Watch("magazineStatusModel")
public modalBlockMagazine(){
if(this.magazineStatusModel.action == 0){
ModalHelper.HideModal("modal2");
}
else if(this.magazineStatusModel.action == 1){
ModalHelper.ShowModal(DepotActionLoading, "modal2");
}
else if(this.magazineStatusModel.action == 2){
ModalHelper.ShowModal(DepotActionUnloading, "modal2");
}
else if(this.magazineStatusModel.action == 4){
ModalHelper.ShowModal(DepotActionTransfer, "modal2");
}
else if(this.magazineStatusModel.action == 5){
ModalHelper.ShowModal(DepotActionGeneric, "modal2");
}
}
// @Watch("magazineStatusModel")
// public modalBlockMagazine(){
// if(this.magazineStatusModel.action == 0){
// ModalHelper.HideModal("modal2");
// }
// else if(this.magazineStatusModel.action == 1){
// ModalHelper.ShowModal(DepotActionLoading, "modal2");
// }
// else if(this.magazineStatusModel.action == 2){
// ModalHelper.ShowModal(DepotActionUnloading, "modal2");
// }
// else if(this.magazineStatusModel.action == 4){
// ModalHelper.ShowModal(DepotActionTransfer, "modal2");
// }
// else if(this.magazineStatusModel.action == 5){
// ModalHelper.ShowModal(DepotActionGeneric, "modal2");
// }
// }
public toolsConfiguration: server.ToolsConfiguration[] = null;
@@ -92,10 +94,20 @@ export default class toolingEquipment extends Vue {
async mounted() {
awaiter (Promise.all([
new ToolingService().GetTools(),
new ToolingService().GetToolsConfiguration()
]));
if(this.typeNc == "Demo"){
awaiter (Promise.all([
new ToolingService().GetTools(),
new ToolingService().GetToolsConfiguration()
]));
}
else{
awaiter (Promise.all([
new ToolingService().GetNcTools(),
new ToolingService().GetToolsConfiguration()
]));
}
this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
@@ -113,7 +125,7 @@ export default class toolingEquipment extends Vue {
this.$nextTick(() => this.scrollList(this.tools.indexOf(tool)));
}
}
this.modalBlockMagazine();
// this.modalBlockMagazine();
}
public scrollList(top){
@@ -295,24 +307,48 @@ export default class toolingEquipment extends Vue {
}
async save(item) {
await awaiter(new ToolingService().SetSiemensTool(item).then(response => {
this.selectedTool = response;
let htmlelement = this.$refs.toolList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
if(this.typeNc == "Demo"){
await awaiter(new ToolingService().SetSiemensTool(item).then(response => {
this.selectedTool = response;
let htmlelement = this.$refs.toolList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
this.disableList = false;
}));
}
else{
await awaiter(new ToolingService().SetNcTool(item).then(response => {
this.selectedTool = response;
let htmlelement = this.$refs.toolList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
this.disableList = false;
}));
}
this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
this.disableList = false;
}));
}
async modifyTool(model) {
await awaiter(new ToolingService().UpdateSiemensTool(model).then(response => {
this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
this.disableList = false;
this.enableModify = false;
}));
if(this.typeNc == "Demo"){
await awaiter(new ToolingService().UpdateSiemensTool(model).then(response => {
this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
this.disableList = false;
this.enableModify = false;
}));
}
else{
await awaiter(new ToolingService().UpdateNcTool(model).then(response => {
this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
this.disableList = false;
this.enableModify = false;
}));
}
}
async saveEdge(tool, model) {
@@ -372,9 +408,16 @@ export default class toolingEquipment extends Vue {
ModalHelper.AskConfirm(this.$options.filters.localize("modal_confirm_delete", "Richiesta di conferma"),
this.$options.filters.localize("modal_confirm_delete_tool", "Confermi la cancellazione del tool?"),
() => {
awaiter(new ToolingService().DeleteTool(model).then(response => {
this.selectedTool = null;
}));
if(this.typeNc == "Demo"){
awaiter(new ToolingService().DeleteTool(model).then(response => {
this.selectedTool = null;
}));
}
else{
awaiter(new ToolingService().DeleteNcTool(model).then(response => {
this.selectedTool = null;
}));
}
}, null);
}
@@ -24,29 +24,31 @@ export default class toolingFamilies extends Vue {
public searchText: string = "";
public currentFilter : string = "";
public typeNc: string = "Osai";
@Watch("searchText")
public applyFilter(n) {
this.currentFilter = n.toLowerCase();
}
@Watch("magazineStatusModel")
public modalBlockMagazine(){
if(this.magazineStatusModel.action == 0){
ModalHelper.HideModal("modal2");
}
else if(this.magazineStatusModel.action == 1){
ModalHelper.ShowModal(DepotActionLoading, "modal2");
}
else if(this.magazineStatusModel.action == 2){
ModalHelper.ShowModal(DepotActionUnloading, "modal2");
}
else if(this.magazineStatusModel.action == 4){
ModalHelper.ShowModal(DepotActionTransfer, "modal2");
}
else if(this.magazineStatusModel.action == 5){
ModalHelper.ShowModal(DepotActionGeneric, "modal2");
}
}
// @Watch("magazineStatusModel")
// public modalBlockMagazine(){
// if(this.magazineStatusModel.action == 0){
// ModalHelper.HideModal("modal2");
// }
// else if(this.magazineStatusModel.action == 1){
// ModalHelper.ShowModal(DepotActionLoading, "modal2");
// }
// else if(this.magazineStatusModel.action == 2){
// ModalHelper.ShowModal(DepotActionUnloading, "modal2");
// }
// else if(this.magazineStatusModel.action == 4){
// ModalHelper.ShowModal(DepotActionTransfer, "modal2");
// }
// else if(this.magazineStatusModel.action == 5){
// ModalHelper.ShowModal(DepotActionGeneric, "modal2");
// }
// }
public get categories(): string[] {
let cat: Set<string> = new Set<string>();
@@ -66,10 +68,18 @@ export default class toolingFamilies extends Vue {
async mounted() {
awaiter (Promise.all([
new ToolingService().GetFamilies(),
new ToolingService().GetToolsConfiguration()
]));
if(this.typeNc == "Demo"){
awaiter (Promise.all([
new ToolingService().GetFamilies(),
new ToolingService().GetToolsConfiguration()
]));
}
else{
awaiter (Promise.all([
new ToolingService().GetNcFamilies(),
new ToolingService().GetToolsConfiguration()
]));
}
this.familyConfiguration = (this.$store.state as AppModel).tooling.familyConfiguration;
@@ -77,7 +87,7 @@ export default class toolingFamilies extends Vue {
this.scrollTop -= (delta * 40);
e.preventDefault();
});
this.modalBlockMagazine();
// this.modalBlockMagazine();
}
updated() {
$('.tab-box-scroll').mousewheel(function (e, delta) {
@@ -143,22 +153,42 @@ export default class toolingFamilies extends Vue {
async save(item) {
awaiter (new ToolingService().SetFamily(item).then(response => {
this.selectedTool = response;
let htmlelement = this.$refs.familyList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.familyConfiguration = (this.$store.state as AppModel).tooling.familyConfiguration;
this.disableList = false;
}));
if(this.typeNc == "Demo"){
awaiter (new ToolingService().SetFamily(item).then(response => {
this.selectedTool = response;
let htmlelement = this.$refs.familyList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.familyConfiguration = (this.$store.state as AppModel).tooling.familyConfiguration;
this.disableList = false;
}));
}
else{
awaiter (new ToolingService().SetNcFamily(item).then(response => {
this.selectedTool = response;
let htmlelement = this.$refs.familyList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.familyConfiguration = (this.$store.state as AppModel).tooling.familyConfiguration;
this.disableList = false;
}));
}
}
async modifyFamily(model) {
awaiter (new ToolingService().UpdateFamily(model).then(response => {
this.familyConfiguration = (this.$store.state as AppModel).tooling.familyConfiguration;
this.disableList = false;
}));
if(this.typeNc == "Demo"){
awaiter (new ToolingService().UpdateFamily(model).then(response => {
this.familyConfiguration = (this.$store.state as AppModel).tooling.familyConfiguration;
this.disableList = false;
}));
}
else{
awaiter (new ToolingService().UpdateNcFamily(model).then(response => {
this.familyConfiguration = (this.$store.state as AppModel).tooling.familyConfiguration;
this.disableList = false;
}));
}
}
@@ -173,8 +203,16 @@ export default class toolingFamilies extends Vue {
}
async deleteFamily(model) {
awaiter (new ToolingService().DeleteFamily(model).then(response => {
this.selectedTool = null;
}));
if(this.typeNc == "Demo"){
awaiter (new ToolingService().DeleteFamily(model).then(response => {
this.selectedTool = null;
}));
}
else{
awaiter (new ToolingService().DeleteNcFamily(model).then(response => {
this.selectedTool = null;
}));
}
}
}
@@ -28,38 +28,48 @@ export default class toolingMagPos extends Vue {
this.currentFilter = n.toLowerCase();
}
@Watch("magazineStatusModel")
public modalBlockMagazine(){
if(this.magazineStatusModel.action == 0){
ModalHelper.HideModal("modal2");
}
else if(this.magazineStatusModel.action == 1){
ModalHelper.ShowModal(DepotActionLoading, "modal2");
}
else if(this.magazineStatusModel.action == 2){
ModalHelper.ShowModal(DepotActionUnloading, "modal2");
}
else if(this.magazineStatusModel.action == 4){
ModalHelper.ShowModal(DepotActionTransfer, "modal2");
}
else if(this.magazineStatusModel.action == 5){
ModalHelper.ShowModal(DepotActionGeneric, "modal2");
}
}
// @Watch("magazineStatusModel")
// public modalBlockMagazine(){
// if(this.magazineStatusModel.action == 0){
// ModalHelper.HideModal("modal2");
// }
// else if(this.magazineStatusModel.action == 1){
// ModalHelper.ShowModal(DepotActionLoading, "modal2");
// }
// else if(this.magazineStatusModel.action == 2){
// ModalHelper.ShowModal(DepotActionUnloading, "modal2");
// }
// else if(this.magazineStatusModel.action == 4){
// ModalHelper.ShowModal(DepotActionTransfer, "modal2");
// }
// else if(this.magazineStatusModel.action == 5){
// ModalHelper.ShowModal(DepotActionGeneric, "modal2");
// }
// }
public selectedTool: any = null;
public enableModify: any = false;
public disableList: any = false;
public typeNc: string = "Osai";
mounted() {
awaiter (Promise.all([
new ToolingService().GetMagazinesPositions(),
new ToolingService().GetToolsConfiguration()
]));
if(this.typeNc == "Demo"){
awaiter (Promise.all([
new ToolingService().GetMagazinesPositions(),
new ToolingService().GetToolsConfiguration()
]));
}
else{
awaiter (Promise.all([
new ToolingService().GetNcMagazinesPositions(),
new ToolingService().GetToolsConfiguration()
]));
}
this.magposConfiguration = (this.$store.state as AppModel).tooling.magazinePosConfiguration;
this.modalBlockMagazine();
// this.modalBlockMagazine();
}
public selectTool(item){
@@ -79,11 +89,19 @@ export default class toolingMagPos extends Vue {
this.enableModify = false;
}
async modifyMagPos(model) {
awaiter(new ToolingService().UpdateMagPos(model).then(response => {
this.magposConfiguration = (this.$store.state as AppModel).tooling.magazinePosConfiguration;
this.disableList = false;
this.enableModify = false;
}));
if(this.typeNc == "Demo"){
awaiter(new ToolingService().UpdateMagPos(model).then(response => {
this.magposConfiguration = (this.$store.state as AppModel).tooling.magazinePosConfiguration;
this.disableList = false;
this.enableModify = false;
}));
}
else{
awaiter(new ToolingService().UpdateNcMagPos(model).then(response => {
this.magposConfiguration = (this.$store.state as AppModel).tooling.magazinePosConfiguration;
this.disableList = false;
this.enableModify = false;
}));
}
}
}
@@ -35,30 +35,31 @@ export default class toolingShanks extends Vue {
public searchText: string = "";
public currentFilter: string = "";
public typeNc: string = "Osai";
@Watch("searchText")
public applyFilter(n) {
this.currentFilter = n.toLowerCase();
}
@Watch("magazineStatusModel")
public modalBlockMagazine(){
if(this.magazineStatusModel.action == 0){
ModalHelper.HideModal("modal2");
}
else if(this.magazineStatusModel.action == 1){
ModalHelper.ShowModal(DepotActionLoading, "modal2");
}
else if(this.magazineStatusModel.action == 2){
ModalHelper.ShowModal(DepotActionUnloading, "modal2");
}
else if(this.magazineStatusModel.action == 4){
ModalHelper.ShowModal(DepotActionTransfer, "modal2");
}
else if(this.magazineStatusModel.action == 5){
ModalHelper.ShowModal(DepotActionGeneric, "modal2");
}
}
// @Watch("magazineStatusModel")
// public modalBlockMagazine(){
// if(this.magazineStatusModel.action == 0){
// ModalHelper.HideModal("modal2");
// }
// else if(this.magazineStatusModel.action == 1){
// ModalHelper.ShowModal(DepotActionLoading, "modal2");
// }
// else if(this.magazineStatusModel.action == 2){
// ModalHelper.ShowModal(DepotActionUnloading, "modal2");
// }
// else if(this.magazineStatusModel.action == 4){
// ModalHelper.ShowModal(DepotActionTransfer, "modal2");
// }
// else if(this.magazineStatusModel.action == 5){
// ModalHelper.ShowModal(DepotActionGeneric, "modal2");
// }
// }
public get availableTools(): server.Tools[] { return (this.$store.state as AppModel).depot.availableTool; }
@@ -88,11 +89,18 @@ export default class toolingShanks extends Vue {
public enableAddChildsTools: any = false;
async mounted() {
awaiter (Promise.all([
new ToolingService().GetShanks(),
new ToolingService().GetToolsConfiguration()
]));
if(this.typeNc == "Demo"){
awaiter (Promise.all([
new ToolingService().GetShanks(),
new ToolingService().GetToolsConfiguration()
]));
}
else{
awaiter (Promise.all([
new ToolingService().GetNcShanks(),
new ToolingService().GetToolsConfiguration()
]));
}
this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration;
this.childToolsShank = (this.$store.state as AppModel).tooling.childToolsShank;
@@ -109,7 +117,7 @@ export default class toolingShanks extends Vue {
this.scrollTop -= (delta * 40);
e.preventDefault();
});
this.modalBlockMagazine();
// this.modalBlockMagazine();
}
async updated() {
@@ -283,38 +291,75 @@ export default class toolingShanks extends Vue {
}
async save(item) {
awaiter(new ToolingService().SetShank(item).then(response => {
this.selectedTool = response;
let htmlelement = this.$refs.shankList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
if(this.typeNc == "Demo"){
awaiter(new ToolingService().SetShank(item).then(response => {
this.selectedTool = response;
let htmlelement = this.$refs.shankList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration;
this.disableList = false;
}));
}
else{
awaiter(new ToolingService().SetNcShank(item).then(response => {
this.selectedTool = response;
let htmlelement = this.$refs.shankList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration;
this.disableList = false;
}));
}
this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration;
this.disableList = false;
}));
}
async modifyShank(model) {
if(this.typeNc == "Demo"){
awaiter(new ToolingService().UpdateShank(model).then(response => {
this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration;
this.disableList = false;
this.enableModify = false;
}));
}
else{
awaiter(new ToolingService().UpdateNcShank(model).then(response => {
this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration;
this.disableList = false;
this.enableModify = false;
}));
}
awaiter(new ToolingService().UpdateShank(model).then(response => {
this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration;
this.disableList = false;
this.enableModify = false;
}));
}
public addToolsToShank(shank) {
let model = this.toolSelected;
model.multitoolId = this.posSelected;
awaiter(new ToolingService().addToolToShank(shank, model).then(response => {
this.selectTab(response);
for (let l in this.selectedTool.childsTools) {
if (this.selectedTool.childsTools[l].id <= 0) {
this.selectedTool.childsTools.splice(l, 1);
if(this.typeNc == "Demo"){
awaiter(new ToolingService().addToolToShank(shank, model).then(response => {
this.selectTab(response);
for (let l in this.selectedTool.childsTools) {
if (this.selectedTool.childsTools[l].id <= 0) {
this.selectedTool.childsTools.splice(l, 1);
}
}
}
this.disableList = false;
this.checkChildsToolsenabled();
}))
this.disableList = false;
this.checkChildsToolsenabled();
}))
}
else{
awaiter(new ToolingService().addToolToShankNc(shank, model).then(response => {
this.selectTab(response);
for (let l in this.selectedTool.childsTools) {
if (this.selectedTool.childsTools[l].id <= 0) {
this.selectedTool.childsTools.splice(l, 1);
}
}
this.disableList = false;
this.checkChildsToolsenabled();
}))
}
// new ToolingService().SetEdgeData(tool,model).then(response => {
// this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
// this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
@@ -327,15 +372,28 @@ export default class toolingShanks extends Vue {
this.$options.filters.localize("modal_confirm_delete_tool_inshank", "Confermi la rimozione del tool dal codolo?"),
() => {
let model = this.selectedEquipment;
awaiter(new ToolingService().removeToolToShank(shank, model).then(response => {
this.disableList = false;
this.enableParameters = true;
this.enableModify = false;
this.enableEquipment = false;
this.selectedEquipment = null;
this.checkChildsToolsenabled();
}))
if(this.typeNc == "Demo"){
awaiter(new ToolingService().removeToolToShank(shank, model).then(response => {
this.disableList = false;
this.enableParameters = true;
this.enableModify = false;
this.enableEquipment = false;
this.selectedEquipment = null;
this.checkChildsToolsenabled();
}))
}
else{
awaiter(new ToolingService().removeToolToShankNc(shank, model).then(response => {
this.disableList = false;
this.enableParameters = true;
this.enableModify = false;
this.enableEquipment = false;
this.selectedEquipment = null;
this.checkChildsToolsenabled();
}))
}
}, null);
// new ToolingService().SetEdgeData(tool,model).then(response => {
// this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
@@ -349,13 +407,24 @@ export default class toolingShanks extends Vue {
ModalHelper.AskConfirm(this.$options.filters.localize("modal_confirm_delete", "Richiesta di conferma"),
this.$options.filters.localize("modal_confirm_delete_shank", "Confermi la cancellazione del codolo?"),
() => {
awaiter(new ToolingService().DeleteShank(model).then(response => {
this.selectedEquipment = null;
this.enableEquipment = false;
this.enableParameters = true;
this.enableModify = false;
this.disableList = false;
}));
if(this.typeNc == "Demo"){
awaiter(new ToolingService().DeleteShank(model).then(response => {
this.selectedEquipment = null;
this.enableEquipment = false;
this.enableParameters = true;
this.enableModify = false;
this.disableList = false;
}));
}
else{
awaiter(new ToolingService().DeleteNcShank(model).then(response => {
this.selectedEquipment = null;
this.enableEquipment = false;
this.enableParameters = true;
this.enableModify = false;
this.disableList = false;
}));
}
}, null);
}
}
+19 -19
View File
@@ -30,28 +30,28 @@ export default class Tooling extends Vue {
// return (this.$store.state as AppModel).tooling.magazines;
// }
@Watch("magazineStatusModel")
public modalBlockMagazine() {
if (this.magazineStatusModel.action == 0) {
ModalHelper.HideModal("modal2");
}
else if (this.magazineStatusModel.action == 1) {
ModalHelper.ShowModal(DepotActionLoading, "modal2");
}
else if (this.magazineStatusModel.action == 2) {
ModalHelper.ShowModal(DepotActionUnloading, "modal2");
}
else if (this.magazineStatusModel.action == 4) {
ModalHelper.ShowModal(DepotActionTransfer, "modal2");
}
else if (this.magazineStatusModel.action == 5) {
ModalHelper.ShowModal(DepotActionGeneric, "modal2");
}
}
// @Watch("magazineStatusModel")
// public modalBlockMagazine() {
// if (this.magazineStatusModel.action == 0) {
// ModalHelper.HideModal("modal2");
// }
// else if (this.magazineStatusModel.action == 1) {
// ModalHelper.ShowModal(DepotActionLoading, "modal2");
// }
// else if (this.magazineStatusModel.action == 2) {
// ModalHelper.ShowModal(DepotActionUnloading, "modal2");
// }
// else if (this.magazineStatusModel.action == 4) {
// ModalHelper.ShowModal(DepotActionTransfer, "modal2");
// }
// else if (this.magazineStatusModel.action == 5) {
// ModalHelper.ShowModal(DepotActionGeneric, "modal2");
// }
// }
async mounted() {
// await new ToolingService().GetToolsConfiguration();
this.modalBlockMagazine();
// this.modalBlockMagazine();
}
@@ -6,5 +6,6 @@ import inputBox from "./input-box.vue";
import cardAssistedTooling from "./card-assisted-tooling.vue";
import cardToolDepot from "./card-tool-depot.vue";
import maintenanceCard from "./maintenance-card.vue";
import objectsJob from "./objects-job.vue"
export { cardUtilities, tool, detailCard, equipment, inputBox, cardAssistedTooling, cardToolDepot, maintenanceCard };
export { cardUtilities, tool, detailCard, equipment, inputBox, cardAssistedTooling, cardToolDepot, maintenanceCard, objectsJob };
@@ -0,0 +1,25 @@
<template>
<!-- <div class="test-container"> -->
<div class="objects-job" :class="{'min': min}">
<div class="objects-job-image">
<img :src="imgSource" />
</div>
<div class="objects-job-title">
<label>{{title}}</label>
</div>
</div>
<!-- </div> -->
</template>
<script>
export default {
props:{
imgSource: {default:"../assets/icons/_png/keyboard-dots-24x48.png"},
title: {default:""},
min: {default: false}
},
methods:{
}
}
</script>
@@ -19,7 +19,19 @@
</div>
</div>
<div class="modal-edit-job-box" v-if="selectedTab == 'ParBase'">
<div class="box-image">
</div>
<div class="box-text">
<div class="title">
<label>Descrizione</label>
</div>
<div class="text">
<span>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
</span>
</div>
</div>
</div>
<div class="modal-edit-job-box" v-if="selectedTab == 'Utensili'">
<div class="box-tag-tool">
@@ -38,16 +50,49 @@
</div>
<div class="modal-edit-job-box" v-if="selectedTab == 'Tempi'">
<div class="box-tag-times">
<div class="box-time-to-use">
<label>Tempo da utilizzare</label>
<input type="text" />>
</div>
<div class="box-time-average-time">
<label>Tempo medio</label>
<span>00 : 23' : 12"</span>
<div class="row-time">
<div class="box-time-to-use">
<label>Tempo da utilizzare</label>
<input type="text" />
</div>
<div class="box-time-average-time">
<label>Tempo medio</label>
<span>00 : 23' : 12"</span>
</div>
</div>
<div class="box-history-time">
<label>Storico tempi</label>
<div class="box-history-time-title">
<label>Storico tempi</label>
</div>
<table>
<thead>
<tr>
<th>{{'modal_edit_job_table_selection' | localize("Selezione")}}</th>
<th>{{'modal_edit_job_table_date' | localize("Data")}}</th>
<th>{{'modal_edit_job_table_start_time' | localize("Ora inizio")}}</th>
<th>{{'modal_edit_job_table_medium_override' | localize("Override medio")}}</th>
<th>{{'modal_edit_job_table_total_time' | localize("T totale")}}</th>
</tr>
</thead>
<tbody class="scrollable">
<tr>
<td colspan="1"><div><input type="checkbox"></div></td>
<td colspan="1"><div><label>12/03/2016</label></div></td>
<td colspan="1"><div><label>15:24:53</label></div></td>
<td colspan="1"><div><label>100%</label></div></td>
<td colspan="1"><div><label>15:24:53</label></div></td>
</tr>
<tr>
<td colspan="1"><div><input type="checkbox"></div></td>
<td colspan="1"><div><label>12/03/2016</label></div></td>
<td colspan="1"><div><label>15:24:53</label></div></td>
<td colspan="1"><div><label>100%</label></div></td>
<td colspan="1"><div><label>15:24:53</label></div></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
+27
View File
@@ -10,6 +10,12 @@ export class DepotService extends baseRestService {
return result;
}
async GetNcMagazine(magazineId: any){
let result = await this.Get<server.DepotModel[]>(this.BASE_URL + "nc/magazine/" + magazineId + "/mounted_shanks");
depotActions.updateDepot(store, result);
return result;
}
async GetToolAvailable() {
let result = await this.Get < any > (this.BASE_URL + "magazine/available_tools");
depotActions.updateAvailableMultiTool(store, result.multiTools);
@@ -17,6 +23,13 @@ export class DepotService extends baseRestService {
return result;
}
async GetNcShankAvailable(){
let result = await this.Get<any>(this.BASE_URL + "nc/magazine/available_shanks");
depotActions.updateAvailableMultiTool(store, result.multiTools);
depotActions.updateAvailableTool(store, result.tools);
return result;
}
async AddToolToDepot(magazineId, positionId, toolId) {
let result = await this.Put < any > (this.BASE_URL + "magazine/" + magazineId + "/load/position/" + positionId, toolId);
depotActions.setDepot(store, result);
@@ -24,6 +37,13 @@ export class DepotService extends baseRestService {
return result;
}
async AddToolToDepotNc(magazineId, positionId, toolId) {
let result = await this.Put < any > (this.BASE_URL + "nc/magazine/" + magazineId + "/load/position/" + positionId, toolId);
depotActions.setDepot(store, result);
this.GetNcShankAvailable();
return result;
}
async RemoveToolToDepot(magazineId, positionId) {
let result = await this.Put < any > (this.BASE_URL + "magazine/" + magazineId + "/unload/position/" + positionId, {});
depotActions.removeToolFromDepot(store, {magazineId:magazineId, positionId:positionId}as server.DepotModel);
@@ -31,6 +51,13 @@ export class DepotService extends baseRestService {
return result;
}
async RemoveToolToDepotNc(magazineId, positionId) {
let result = await this.Put < any > (this.BASE_URL + "nc/magazine/" + magazineId + "/unload/position/" + positionId, {});
depotActions.removeToolFromDepot(store, {magazineId:magazineId, positionId:positionId}as server.DepotModel);
this.GetNcShankAvailable();
return result;
}
// async GetToolTableConfiguration() {
// let result = await this.Get<server.ToolTableInfoModel>(
// "api/tool_table/configuration"
+118
View File
@@ -12,27 +12,57 @@ export class ToolingService extends baseRestService {
toolingActions.updateTools(store, result);
}
async GetNcTools(){
let result = await this.Get<server.Tool[]>(this.BASE_URL + "nc/tools");
toolingActions.updateTools(store, result);
}
async GetFamilies() {
let result = await this.Get<server.Families[]>(this.BASE_URL + "families");
toolingActions.clearFamilies(store);
toolingActions.updateFamilies(store, result);
}
async GetNcFamilies(){
let result = await this.Get<server.Families[]>(this.BASE_URL + "nc/families");
toolingActions.clearFamilies(store);
toolingActions.updateFamilies(store, result);
}
async GetShanks() {
let result = await this.Get<server.Shanks[]>(this.BASE_URL + "shanks");
toolingActions.updateShanks(store, result);
}
async GetNcShanks(){
let result = await this.Get<server.Shanks[]>(this.BASE_URL + "nc/shanks");
toolingActions.updateShanks(store, result);
}
async GetMagazinesPositions() {
let result = await this.Get<server.MagazinesPositions[]>(
this.BASE_URL + "magazines_positions"
);
toolingActions.updateMagazinesPositions(store, result);
}
async GetNcMagazinesPositions(){
let result = await this.Get<server.MagazinesPositions[]>(this.BASE_URL + "nc/magazines_positions");
toolingActions.updateMagazinesPositions(store, result);
}
async GetMagazinePosition(id) {
let result = await this.Get<server.MagazinesPositions[]>(
this.BASE_URL + "magazine/" + id + "/positions"
);
toolingActions.updateMagPos(store, result);
}
async GetNcMagazinePosition(id){
let result = await this.Get<server.MagazinesPositions[]>(this.BASE_URL + "nc/magazine/" + id + "/positions");
toolingActions.updateMagPos(store, result);
}
async GetToolsConfiguration() {
let result = await this.Get<server.ToolTableInfoModel>(
"api/configuration/tool_manager"
@@ -81,6 +111,13 @@ export class ToolingService extends baseRestService {
toolingActions.updateFamily(store, response);
return response;
}
async SetNcFamily(model: any){
var response = await this.Post<any>(this.BASE_URL + "nc/family", model);
toolingActions.updateNcFamily(store, response);
return response;
}
async UpdateFamily(model: server.Families){
var response = await this.Put<any>(this.BASE_URL + "family/" + (model as any).oldName , model);
// debo salvare il modello perch le families non hanno ID e quindi devo utilizzare il vecchio ID che mi genero lato client.
@@ -89,28 +126,63 @@ export class ToolingService extends baseRestService {
toolingActions.updateFamily(store, model);
return response;
}
async UpdateNcFamily(model: server.Families){
var response = await this.Put<any>(this.BASE_URL + "nc/family/" + model.id, model);
toolingActions.updateNcFamily(store, model);
return response;
}
async SetShank(model: any) {
var response = await this.Post<any>(this.BASE_URL + "shank", model);
toolingActions.updateShank(store, response);
return response;
}
async SetNcShank(model: any){
var response = await this.Post<any>(this.BASE_URL + "nc/shank", model);
toolingActions.updateShank(store, response);
return response;
}
async SetSiemensTool(model: any) {
var response = await this.Post<any>(this.BASE_URL + "siemens/tool", model);
toolingActions.updateTool(store, response);
return response;
}
async SetNcTool(model: any){
var response = await this.Post<any>(this.BASE_URL + "nc/tool", model);
toolingActions.updateTool(store, response);
return response;
}
async UpdateSiemensTool(model: any){
var response = await this.Put<any>(this.BASE_URL + "siemens/tool/" + model.id, model);
// debo salvare il modello perch le families non hanno ID e quindi devo utilizzare il vecchio ID che mi genero lato client.
toolingActions.updateTool(store, model);
return response;
}
async UpdateNcTool(model: any){
var response = await this.Put<any>(this.BASE_URL + "nc/tool/" + model.id, model);
toolingActions.updateTool(store, model);
return response;
}
async DeleteTool(model: any) {
var result = await this.Delete<any>(this.BASE_URL + "tool/" + model.id);
toolingActions.deleteTool(store, model);
return result;
}
async DeleteNcTool(model: any){
var result = await this.Delete<any>(this.BASE_URL + "nc/tool/" + model.id);
toolingActions.deleteTool(store, model);
return result;
}
async SetEdgeData(tool: any,model: any){
var result = await this.Post<any>(this.BASE_URL + "tool/" + tool.id + "/edge", model);
@@ -135,34 +207,73 @@ export class ToolingService extends baseRestService {
return result;
}
async DeleteNcFamily(model: any){
var result = await this.Delete<any>(this.BASE_URL + "nc/family/" + model.id);
toolingActions.deleteNcFamily(store,model);
return result;
}
async DeleteShank(model: any) {
var result = await this.Delete<any>(this.BASE_URL + "shank/" + model.id);
toolingActions.deleteShank(store, model);
return result;
}
async DeleteNcShank(model: any){
var result = await this.Delete<any>(this.BASE_URL + "nc/shank/" + model.id);
toolingActions.deleteShank(store, model);
return result;
}
async UpdateShank(model: server.Shanks){
var response = await this.Put<server.Shanks>(this.BASE_URL + "shank/" + model.id, model);
toolingActions.updateShank(store, model);
return response;
}
async UpdateNcShank(model: any){
var response = await this.Put<any>(this.BASE_URL + "nc/shank/" + model.id, model);
toolingActions.updateShank(store, model);
return response;
}
async UpdateMagPos(model: server.MagazinesPositions){
var response = await this.Put<server.MagazinesPositions>(this.BASE_URL + "magazine/" + model.magazineId + "/position/" + model.positionId, model);
toolingActions.updateMagazinePosition(store, model);
return response;
}
async UpdateNcMagPos(model: server.MagazinesPositions){
var response = await this.Put<server.MagazinesPositions>(this.BASE_URL + "nc/magazine/" + model.magazineId + "/position/" + model.positionId, model);
toolingActions.updateMagazinePosition(store, model);
return response;
}
async addToolToShank(shank: any, model: any){
var response = await this.Put<any>(this.BASE_URL + "shank/"+ shank.id + "/load/" + model.multitoolId + "/tool/" + model.id, model);
console.log(response);
toolingActions.addToolToShank(store,{shank, model});
return response;
}
async addToolToShankNc(shank: any, model: any){
var response = await this.Put<any>(this.BASE_URL + "nc/shank/"+ shank.id + "/load/tool/" + model.id, model);
toolingActions.addToolToShank(store,{shank, model});
return response;
}
async removeToolToShank(shank: any, model: any){
var response = await this.Put<any>(this.BASE_URL + "shank/"+ shank.id + "/unload/" + model.multitoolId, model);
toolingActions.removeToolToShank(store,{shank, model});
return response;
}
async removeToolToShankNc(shank: any, model: any){
var response = await this.Put<any>(this.BASE_URL + "nc/shank/"+ shank.id + "/unload/tool/" + model.id, model);
toolingActions.removeToolToShank(store,{shank, model});
return response;
}
async GetMagazinePositionDepot(id) {
let result = await this.Get<server.MagazinesPositions[]>(
this.BASE_URL + "magazine/" + id + "/positions"
@@ -170,4 +281,11 @@ export class ToolingService extends baseRestService {
toolingActions.setMagPosDepot(store, result);
}
async GetNcMagazinePositionDepot(id) {
let result = await this.Get<server.MagazinesPositions[]>(
this.BASE_URL + "nc/magazine/" + id + "/positions"
);
toolingActions.setMagPosDepot(store, result);
}
}
+19
View File
@@ -5,6 +5,7 @@ export interface ToolingStoreModel {
toolsConfiguration: Array<server.ToolsConfiguration>
tools: Array<server.Tool>
families: Array<server.Families>
ncFamilies: Array<server.Families>
shanks: Array<server.Shanks>
magPosDepot: Array<server.MagazinesPositions>
magazinesPositions: Array<server.MagazinesPositions>
@@ -37,6 +38,7 @@ export interface ToolingActions {
updateTools(context, model: server.Tool[]);
updateFamily(context, model: server.Families);
updateNcFamily(context, model: server.Families);
updateFamilies(context, model: server.Families[]);
updateShank(context, model: server.Shanks);
@@ -63,6 +65,7 @@ export interface ToolingActions {
setMagPosDepot(context, model: server.MagazinesPositions[]);
deleteFamily(context, familyName: string);
deleteNcFamily(context, familyId: number);
deleteShank(context, model: server.Shanks);
deleteTool(context, model: server.Tool);
deleteEdgeData(context, {tool,model});
@@ -89,6 +92,8 @@ export const toolingStore = {
tools: [],
_families: new Map<string, server.Families>(),
families: [],
_ncFamilies: new Map<number, server.Families>(),
ncFamilies: [],
_shanks: new Map<number, server.Shanks>(),
magPosDepot:[],
shanks: [],
@@ -180,6 +185,10 @@ export const toolingStore = {
store._families.set(model.uid, model);
store.families = Array.from(store._families.values());
},
UpdateNcFamily(store, model: any){
store._ncFamilies.set(model.id, model);
store.ncFamilies = Array.from(store._ncFamilies.value());
},
UpdateShank(store, model: server.Shanks) {
store._shanks.set(model.id, model);
store.shanks = Array.from(store._shanks.values());
@@ -227,6 +236,10 @@ export const toolingStore = {
store._families.delete(model.uid);
store.families = Array.from(store._families.values());
},
DeleteNcFamily(store, model: server.Families){
store._ncFamilies.delete(model.id);
store.ncFamilies = Array.from(store._ncFamilies.value());
},
DeleteShank(store, model: server.Shanks) {
store._shanks.delete(model.id);
store.shanks = Array.from(store._shanks.values());
@@ -345,6 +358,9 @@ export const toolingStore = {
deleteFamily(context, familyname: string) {
context.commit("DeleteFamily", familyname);
},
deleteNcFamily(context, familyId: number){
context.commit("DeleteNcFamily", familyId);
},
deleteShank(context, model: server.Shanks) {
context.commit("DeleteShank", model);
},
@@ -390,6 +406,9 @@ export const toolingStore = {
updateFamily(context, model: server.Families) {
context.commit("UpdateFamily", model);
},
updateNcFamily(context, model: server.Families){
context.commit("UpdateNcFamily", model);
},
updateFamilies(context, model: server.Families[]) {
for (const key in model) {
const element = model[key];