This commit is contained in:
@@ -455,8 +455,14 @@ export default {
|
|||||||
},
|
},
|
||||||
gotoIndex(val, oldVal) {
|
gotoIndex(val, oldVal) {
|
||||||
if (val != oldVal) {
|
if (val != oldVal) {
|
||||||
this.selectedRow = [{ index: val }];
|
let gotoIndex = val;
|
||||||
this.activeItemIndex = val;
|
if (val < 0) {
|
||||||
|
//it's a create request
|
||||||
|
gotoIndex = this.newItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.selectedRow = [{ index: gotoIndex }];
|
||||||
|
this.activeItemIndex = gotoIndex;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const el = this.$refs.expensetopform;
|
const el = this.$refs.expensetopform;
|
||||||
if (el) {
|
if (el) {
|
||||||
@@ -501,6 +507,7 @@ export default {
|
|||||||
this.$emit("change");
|
this.$emit("change");
|
||||||
this.selectedRow = [{ index: newIndex }];
|
this.selectedRow = [{ index: newIndex }];
|
||||||
this.activeItemIndex = newIndex;
|
this.activeItemIndex = newIndex;
|
||||||
|
return newIndex; //for create new on goto
|
||||||
},
|
},
|
||||||
unDeleteItem() {
|
unDeleteItem() {
|
||||||
this.value.items[this.activeWoItemIndex].expenses[
|
this.value.items[this.activeWoItemIndex].expenses[
|
||||||
|
|||||||
@@ -39,15 +39,112 @@
|
|||||||
<template v-if="hasData && hasSelection && pvm.rights.change">
|
<template v-if="hasData && hasSelection && pvm.rights.change">
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<v-subheader>{{ $ay.t("Add") }}</v-subheader>
|
<v-subheader>{{ $ay.t("Add") }}</v-subheader>
|
||||||
|
|
||||||
<v-list-item
|
<v-list-item
|
||||||
v-if="canAddUnit"
|
v-if="canAddUnit"
|
||||||
@click="newSubItem($ay.ayt.WorkOrderItemUnit)"
|
@click="newSubItem($ay.ayt().WorkOrderItemUnit)"
|
||||||
>
|
>
|
||||||
<v-list-item-icon>
|
<v-list-item-icon>
|
||||||
<v-icon>$ayiFan</v-icon>
|
<v-icon>$ayiFan</v-icon>
|
||||||
</v-list-item-icon>
|
</v-list-item-icon>
|
||||||
<v-list-item-title>{{ $ay.t("Unit") }}</v-list-item-title>
|
<v-list-item-title>{{ $ay.t("Unit") }}</v-list-item-title>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
|
<v-list-item
|
||||||
|
v-if="canAddScheduledUser"
|
||||||
|
@click="newSubItem($ay.ayt().WorkOrderItemScheduledUser)"
|
||||||
|
>
|
||||||
|
<v-list-item-icon>
|
||||||
|
<v-icon>$ayiUserClock</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-title>{{
|
||||||
|
$ay.t("WorkOrderItemScheduledUser")
|
||||||
|
}}</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
|
||||||
|
<v-list-item
|
||||||
|
v-if="canAddTask"
|
||||||
|
@click="newSubItem($ay.ayt().WorkOrderItemTask)"
|
||||||
|
>
|
||||||
|
<v-list-item-icon>
|
||||||
|
<v-icon>$ayiTasks</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-title>{{
|
||||||
|
$ay.t("WorkOrderItemTask")
|
||||||
|
}}</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
|
||||||
|
<v-list-item
|
||||||
|
v-if="canAddPart"
|
||||||
|
@click="newSubItem($ay.ayt().WorkOrderItemPart)"
|
||||||
|
>
|
||||||
|
<v-list-item-icon>
|
||||||
|
<v-icon>$ayiBoxes</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-title>{{
|
||||||
|
$ay.t("WorkOrderItemPart")
|
||||||
|
}}</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
|
||||||
|
<v-list-item
|
||||||
|
v-if="canAddLabor"
|
||||||
|
@click="newSubItem($ay.ayt().WorkOrderItemLabor)"
|
||||||
|
>
|
||||||
|
<v-list-item-icon>
|
||||||
|
<v-icon>$ayiHammer</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-title>{{
|
||||||
|
$ay.t("WorkOrderItemLabor")
|
||||||
|
}}</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
|
||||||
|
<v-list-item
|
||||||
|
v-if="canAddTravel"
|
||||||
|
@click="newSubItem($ay.ayt().WorkOrderItemTravel)"
|
||||||
|
>
|
||||||
|
<v-list-item-icon>
|
||||||
|
<v-icon>$ayiTruckMonster</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-title>{{
|
||||||
|
$ay.t("WorkOrderItemTravel")
|
||||||
|
}}</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
|
||||||
|
<v-list-item
|
||||||
|
v-if="canAddExpense"
|
||||||
|
@click="newSubItem($ay.ayt().WorkOrderItemExpense)"
|
||||||
|
>
|
||||||
|
<v-list-item-icon>
|
||||||
|
<v-icon>$ayiMoneyBillWave</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-title>{{
|
||||||
|
$ay.t("WorkOrderItemExpense")
|
||||||
|
}}</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
|
||||||
|
<v-list-item
|
||||||
|
v-if="canAddLoan"
|
||||||
|
@click="newSubItem($ay.ayt().WorkOrderItemLoan)"
|
||||||
|
>
|
||||||
|
<v-list-item-icon>
|
||||||
|
<v-icon>$ayiPlug</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-title>{{
|
||||||
|
$ay.t("WorkOrderItemLoan")
|
||||||
|
}}</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
|
||||||
|
<v-list-item
|
||||||
|
v-if="canAddOutsideService"
|
||||||
|
@click="newSubItem($ay.ayt().WorkOrderItemOutsideService)"
|
||||||
|
>
|
||||||
|
<v-list-item-icon>
|
||||||
|
<v-icon>$ayiLuggageCart</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-title>{{
|
||||||
|
$ay.t("WorkOrderItemOutsideService")
|
||||||
|
}}</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
</template>
|
</template>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
@@ -397,13 +494,7 @@
|
|||||||
@change="$emit('change')"
|
@change="$emit('change')"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col
|
<v-col cols="12" v-show="showTasks">
|
||||||
cols="12"
|
|
||||||
v-if="
|
|
||||||
pvm.subRights.tasks.visible &&
|
|
||||||
form().showMe(this, 'WorkOrderItemTasks')
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<GzWoItemTasks
|
<GzWoItemTasks
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:pvm="pvm"
|
:pvm="pvm"
|
||||||
@@ -414,13 +505,7 @@
|
|||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col
|
<v-col cols="12" v-show="showParts">
|
||||||
cols="12"
|
|
||||||
v-if="
|
|
||||||
pvm.subRights.parts.visible &&
|
|
||||||
form().showMe(this, 'WorkOrderItemPartList')
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<GzWoItemParts
|
<GzWoItemParts
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:pvm="pvm"
|
:pvm="pvm"
|
||||||
@@ -431,15 +516,7 @@
|
|||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col
|
<v-col cols="12" v-if="showPartRequests">
|
||||||
cols="12"
|
|
||||||
v-if="
|
|
||||||
pvm.useInventory &&
|
|
||||||
value.items[activeItemIndex].partRequests.length > 0 &&
|
|
||||||
pvm.subRights.partRequests.visible &&
|
|
||||||
form().showMe(this, 'WorkOrderItemPartRequestList')
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<GzWoItemPartRequests
|
<GzWoItemPartRequests
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:pvm="pvm"
|
:pvm="pvm"
|
||||||
@@ -450,13 +527,7 @@
|
|||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col
|
<v-col cols="12" v-show="showLabors">
|
||||||
cols="12"
|
|
||||||
v-if="
|
|
||||||
pvm.subRights.labors.visible &&
|
|
||||||
form().showMe(this, 'WorkOrderItemLaborList')
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<GzWoItemLabors
|
<GzWoItemLabors
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:pvm="pvm"
|
:pvm="pvm"
|
||||||
@@ -466,13 +537,7 @@
|
|||||||
@change="$emit('change')"
|
@change="$emit('change')"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col
|
<v-col cols="12" v-show="showTravels">
|
||||||
cols="12"
|
|
||||||
v-if="
|
|
||||||
pvm.subRights.travels.visible &&
|
|
||||||
form().showMe(this, 'WorkOrderItemTravelList')
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<GzWoItemTravels
|
<GzWoItemTravels
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:pvm="pvm"
|
:pvm="pvm"
|
||||||
@@ -482,13 +547,7 @@
|
|||||||
@change="$emit('change')"
|
@change="$emit('change')"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col
|
<v-col cols="12" v-show="showExpenses">
|
||||||
cols="12"
|
|
||||||
v-if="
|
|
||||||
pvm.subRights.expenses.visible &&
|
|
||||||
form().showMe(this, 'WorkOrderItemExpenseList')
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<GzWoItemExpenses
|
<GzWoItemExpenses
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:pvm="pvm"
|
:pvm="pvm"
|
||||||
@@ -499,13 +558,7 @@
|
|||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col
|
<v-col cols="12" v-show="showLoans">
|
||||||
cols="12"
|
|
||||||
v-if="
|
|
||||||
pvm.subRights.loans.visible &&
|
|
||||||
form().showMe(this, 'WorkOrderItemLoanList')
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<GzWoItemLoans
|
<GzWoItemLoans
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:pvm="pvm"
|
:pvm="pvm"
|
||||||
@@ -515,13 +568,7 @@
|
|||||||
@change="$emit('change')"
|
@change="$emit('change')"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col
|
<v-col cols="12" v-show="showOutsideServices">
|
||||||
cols="12"
|
|
||||||
v-if="
|
|
||||||
pvm.subRights.outsideServices.visible &&
|
|
||||||
form().showMe(this, 'WorkOrderItemOutsideServiceList')
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<GzWoItemOutsideServices
|
<GzWoItemOutsideServices
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:pvm="pvm"
|
:pvm="pvm"
|
||||||
@@ -798,10 +845,36 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
newSubItem(atype) {
|
newSubItem(atype) {
|
||||||
|
console.log("Newsubitem type: ", atype);
|
||||||
//new Id value to use (by convention goto negative will trigger create and then goto instead of simple goto)
|
//new Id value to use (by convention goto negative will trigger create and then goto instead of simple goto)
|
||||||
let newId = -Math.abs(Date.now());
|
let newId = -Math.abs(Date.now());
|
||||||
switch (atype) {
|
switch (atype) {
|
||||||
case window.$gz.WorkOrderItemUnit:
|
case window.$gz.type.WorkOrderItemOutsideService:
|
||||||
|
this.gotoOutsideServiceIndex = newId;
|
||||||
|
break;
|
||||||
|
case window.$gz.type.WorkOrderItemExpense:
|
||||||
|
this.gotoExpenseIndex = newId;
|
||||||
|
break;
|
||||||
|
case window.$gz.type.WorkOrderItemLabor:
|
||||||
|
this.gotoLaborIndex = newId;
|
||||||
|
break;
|
||||||
|
case window.$gz.type.WorkOrderItemLoan:
|
||||||
|
this.gotoLoanIndex = newId;
|
||||||
|
break;
|
||||||
|
case window.$gz.type.WorkOrderItemPart:
|
||||||
|
this.gotoPartIndex = newId;
|
||||||
|
break;
|
||||||
|
case window.$gz.type.WorkOrderItemTask:
|
||||||
|
this.gotoTaskIndex = newId;
|
||||||
|
break;
|
||||||
|
case window.$gz.type.WorkOrderItemScheduledUser:
|
||||||
|
this.gotoScheduledUserIndex = newId;
|
||||||
|
break;
|
||||||
|
case window.$gz.type.WorkOrderItemTravel:
|
||||||
|
this.gotoTravelIndex = newId;
|
||||||
|
break;
|
||||||
|
case window.$gz.type.WorkOrderItemUnit:
|
||||||
|
console.log("new unit id", newId);
|
||||||
this.gotoUnitIndex = newId;
|
this.gotoUnitIndex = newId;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1051,18 +1124,121 @@ and it's probably not a big list to fill anyway
|
|||||||
this.value.items[this.activeItemIndex].units.length > 0
|
this.value.items[this.activeItemIndex].units.length > 0
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
canAddScheduledUser: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.scheduledUsers.create &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemScheduledUserList")
|
||||||
|
);
|
||||||
|
},
|
||||||
showScheduledUsers: function() {
|
showScheduledUsers: function() {
|
||||||
return (
|
return (
|
||||||
this.pvm.subRights.scheduledUsers.visible &&
|
this.pvm.subRights.scheduledUsers.visible &&
|
||||||
this.form().showMe(this, "WorkOrderItemScheduledUserList") &&
|
this.form().showMe(this, "WorkOrderItemScheduledUserList") &&
|
||||||
this.value.items[this.activeItemIndex].scheduledUsers.length > 0
|
this.value.items[this.activeItemIndex].scheduledUsers.length > 0
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
canAddTask: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.tasks.create &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemTaskList")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
showTasks: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.tasks.visible &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemTaskList") &&
|
||||||
|
this.value.items[this.activeItemIndex].tasks.length > 0
|
||||||
|
);
|
||||||
|
},
|
||||||
|
canAddPart: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.parts.create &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
showParts: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.parts.visible &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||||
|
this.value.items[this.activeItemIndex].parts.length > 0
|
||||||
|
);
|
||||||
|
},
|
||||||
|
showPartRequests: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.useInventory &&
|
||||||
|
this.value.items[this.activeItemIndex].partRequests.length > 0 &&
|
||||||
|
this.pvm.subRights.partRequests.visible &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemPartRequestList")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
canAddLabor: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.labors.create &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
showLabors: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.labors.visible &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||||
|
this.value.items[this.activeItemIndex].labors.length > 0
|
||||||
|
);
|
||||||
|
},
|
||||||
|
canAddTravel: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.travels.create &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
showTravels: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.travels.visible &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||||
|
this.value.items[this.activeItemIndex].travels.length > 0
|
||||||
|
);
|
||||||
|
},
|
||||||
|
canAddExpense: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.expenses.create &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
showExpenses: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.expenses.visible &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||||
|
this.value.items[this.activeItemIndex].expenses.length > 0
|
||||||
|
);
|
||||||
|
},
|
||||||
|
canAddLoan: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.loans.create &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
showLoans: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.loans.visible &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||||
|
this.value.items[this.activeItemIndex].loans.length > 0
|
||||||
|
);
|
||||||
|
},
|
||||||
|
canAddOutsideService: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.outsideServices.create &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
showOutsideServices: function() {
|
||||||
|
return (
|
||||||
|
this.pvm.subRights.outsideServices.visible &&
|
||||||
|
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||||
|
this.value.items[this.activeItemIndex].outsideServices.length > 0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//TODO: Function status name from woitemstatusid
|
|
||||||
//and priority same
|
|
||||||
//this.pvm.pickLists.woItemStatus.find(x=>x.id==x.workorderItemStatusId)
|
|
||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user