depot and fix osai
This commit is contained in:
Vendored
+9
@@ -24,6 +24,15 @@ declare module server {
|
||||
tools: Tools
|
||||
}
|
||||
|
||||
export interface AvailableShankNc{
|
||||
id: number,
|
||||
magazineId: number,
|
||||
positionId: number,
|
||||
childsTools: Array<server.ToolNc>,
|
||||
balluf: number,
|
||||
magazinePositionType: number
|
||||
}
|
||||
|
||||
export interface MultiTools{
|
||||
id: number,
|
||||
name: string,
|
||||
|
||||
@@ -43,6 +43,10 @@ export default class depot extends Vue {
|
||||
return this.ncAvailableTools.filter(t => String(t.familyId).toLowerCase().indexOf(this.currentFilter) >= 0);
|
||||
}
|
||||
|
||||
public get getNcAvailableShank(){
|
||||
return this.ncAvailableShank.filter(t => String(t.id).toLowerCase().indexOf(this.currentFilter) >= 0);
|
||||
}
|
||||
|
||||
public getPayloadForAvaiableTools(index: number): any {
|
||||
if (index < this.getAvaiableMultiTools.length)
|
||||
return this.getAvaiableMultiTools[index];
|
||||
@@ -101,6 +105,7 @@ export default class depot extends Vue {
|
||||
public get availableMultiTools(): server.MultiTools[] { return (this.$store.state as AppModel).depot.availableMultiTool; }
|
||||
public get availableTools(): server.Tools[] { return (this.$store.state as AppModel).depot.availableTool; }
|
||||
public get ncAvailableTools(): server.ToolNc[] { return (this.$store.state as AppModel).depot.ncAvailableTool; }
|
||||
public get ncAvailableShank(): server.AvailableShankNc[] {return (this.$store.state as AppModel).depot.ncAvailableShank; }
|
||||
|
||||
public magazines: server.MagazineModel[] = (this.$store.state as AppModel).tooling.magazines;
|
||||
public enableModify: any = false;
|
||||
@@ -177,6 +182,7 @@ export default class depot extends Vue {
|
||||
else{
|
||||
return Promise.all([
|
||||
new DepotService().GetNcMagazine(this.$route.params.id),
|
||||
new DepotService().GetNcToolAvailable(),
|
||||
new DepotService().GetNcShankAvailable(),
|
||||
new ToolingService().GetNcMagazinePositionDepot(this.$route.params.id),
|
||||
new ToolingService().GetNcTools(),
|
||||
|
||||
@@ -124,9 +124,9 @@
|
||||
</div>
|
||||
<div class="list-vertical scrollable">
|
||||
<Container @drag-start="onDrag" @drag-end="onDragEnd" :shoud-animate-drop="disableDropAnimation" :get-child-payload="getPayloadForAvaiableTools" group-name="tools">
|
||||
<Draggable v-for="m in getAvaiableMultiTools" :key="m.id" >
|
||||
<Draggable v-for="m in getNcAvailableShank" :key="m.id" >
|
||||
<div>
|
||||
<tool :code="'tooling_shank_abbreviation' | localize('S%d',m.id)" :title="m.name" img-source="../assets/icons/Tools/Shanks.png" @click="openInfoShank(m.id)"></tool>
|
||||
<tool :code="'tooling_shank_abbreviation' | localize('S%d',m.id)" :title="m.id" img-source="../assets/icons/Tools/Shanks.png" @click="openInfoShank(m.id)"></tool>
|
||||
</div>
|
||||
</Draggable>
|
||||
<Draggable v-for="t in getNcAvaiableTools" :key="t.id">
|
||||
@@ -218,7 +218,27 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="depot-footer">
|
||||
<div class="depot-footer" v-if="typeNc == 'Demo'">
|
||||
<div class="depot-footer-left">
|
||||
<!-- <div class="depot-checkbox" >
|
||||
<input type="checkbox">
|
||||
<label></label>
|
||||
{{'depot_checkbox_viewstate_equipment' | localize('Visualizza stato utensili')}}
|
||||
</div> -->
|
||||
<div class="depot-checkbox">
|
||||
<input type="checkbox" v-model="checked" @change="viewStateTool()" value="1" id="depotCheckbox" name="" />
|
||||
<label for="depotCheckbox"></label>
|
||||
</div>
|
||||
<label class="depot-checkbox-label">{{'depot_checkbox_viewstate_equipment' | localize('Visualizza stato utensili')}}</label>
|
||||
</div>
|
||||
<div class="depot-footer-right">
|
||||
<div v-if="magazineLocked" class="lock-icon"><i class="fa fa-lock"></i></div>
|
||||
<button class="btn" v-if="editable" @click="toggleEdit()">{{'depot_button_cancel' | localize("Termina modifiche")}}</button>
|
||||
<button class="btn" v-if="!editable" :disabled="magazineLocked" @click="toggleEdit()">{{'depot_button_modify' | localize("Modifica")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="depot-footer" v-if="typeNc == 'Osai'">
|
||||
<div class="depot-footer-left">
|
||||
<!-- <div class="depot-checkbox" >
|
||||
<input type="checkbox">
|
||||
|
||||
@@ -422,6 +422,7 @@ export default class toolingEquipment extends Vue {
|
||||
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.pushOffset(model);
|
||||
this.disableList = false;
|
||||
this.enableModify = false;
|
||||
}));
|
||||
|
||||
@@ -432,6 +432,7 @@ export default class toolingShanks extends Vue {
|
||||
}
|
||||
else{
|
||||
awaiter(new ToolingService().addToolToShankNc(shank, model).then(response => {
|
||||
debugger
|
||||
this.selectTab(response);
|
||||
for (let l in this.selectedTool.childsTools) {
|
||||
if (this.selectedTool.childsTools[l].id <= 0) {
|
||||
@@ -440,6 +441,8 @@ export default class toolingShanks extends Vue {
|
||||
}
|
||||
this.disableList = false;
|
||||
this.checkChildsToolsenabled();
|
||||
this.enableEquipment = false;
|
||||
this.enableParameters = true;
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ export class DepotService extends baseRestService {
|
||||
|
||||
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);
|
||||
depotActions.updateNcAvailableShank(store, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ export class ToolingService extends baseRestService {
|
||||
|
||||
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});
|
||||
toolingActions.addToolToShankNc(store,{shank, model});
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ export interface DepotStoreModel {
|
||||
availableMultiTool:Array < server.MultiTools >
|
||||
availableTool:Array < server.Tools >
|
||||
ncAvailableTool: Array <server.ToolNc>
|
||||
ncAvailableShank: Array <server.AvailableShankNc>
|
||||
magazineStatusModel: server.MagazineStatus
|
||||
}
|
||||
|
||||
@@ -13,6 +14,7 @@ export interface DepotStoreModel {
|
||||
updateAvailableMultiTool(context, model:server.MultiTools[]);
|
||||
updateAvailableTool(context, model:server.Tools[]);
|
||||
updateNcAvailableTool(context, model: server.ToolNc[]);
|
||||
updateNcAvailableShank(context, model: server.AvailableShankNc[]);
|
||||
setMagazineStatusModel(context, model: server.MagazineStatus);
|
||||
}
|
||||
|
||||
@@ -21,6 +23,8 @@ export interface DepotStoreModel {
|
||||
depot:[],
|
||||
availableMultiTool:[],
|
||||
availableTool:[],
|
||||
ncAvailableTool: [],
|
||||
ncAvailableShank: [],
|
||||
magazineStatusModel: {action:0,destinationMagazine:0,destinationPosition:0,originMagazine:0,originPosition:0,tool:{}}
|
||||
}as DepotStoreModel,
|
||||
mutations: {
|
||||
@@ -67,6 +71,12 @@ export interface DepotStoreModel {
|
||||
store.ncAvailableTool.push(model[key]);
|
||||
}
|
||||
},
|
||||
UpdateNcAvailableShank(store, model: server.AvailableShankNc[]){
|
||||
store.ncAvailableShank = [];
|
||||
for(const key in model){
|
||||
store.ncAvailableShank.push(model[key]);
|
||||
}
|
||||
},
|
||||
SetMagazineStatusModel(store, model: server.MagazineStatusModel){
|
||||
|
||||
store.magazineStatusModel = model;
|
||||
@@ -92,6 +102,9 @@ export interface DepotStoreModel {
|
||||
updateNcAvailableTool(context, model: server.ToolNc[]){
|
||||
context.commit("UpdateNcAvailableTool", model);
|
||||
},
|
||||
updateNcAvailableShank(context, model: server.AvailableShankNc[]){
|
||||
context.commit("UpdateNcAvailableShank", model);
|
||||
},
|
||||
setMagazineStatusModel(context, model: server.MagazineStatus){
|
||||
context.commit("SetMagazineStatusModel", model);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user