This commit is contained in:
@@ -57,6 +57,8 @@
|
|||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
:pvm="pvm"
|
:pvm="pvm"
|
||||||
data-cy="woState"
|
data-cy="woState"
|
||||||
|
:all-states="pvm.selectLists.wostatus"
|
||||||
|
:allowed-states="pvm.selectLists.allowedwostatus"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
|
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
|
||||||
|
|||||||
@@ -34,11 +34,13 @@
|
|||||||
<v-list-item-title>{{ item }}</v-list-item-title>
|
<v-list-item-title>{{ item }}</v-list-item-title>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-list> -->
|
</v-list> -->
|
||||||
<template v-for="item in value.states">
|
<!-- <template v-for="item in stateDisplayList">
|
||||||
<div :key="item.id">
|
<div :key="item.id">
|
||||||
{{ item }}
|
{{ item }}
|
||||||
|
{{ item.user }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template> -->
|
||||||
|
{{ stateDisplayList }}
|
||||||
|
|
||||||
<template v-if="canAdd">
|
<template v-if="canAdd">
|
||||||
<div>
|
<div>
|
||||||
@@ -179,7 +181,10 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedStatus: null,
|
selectedStatus: null,
|
||||||
openDialog: false
|
openDialog: false,
|
||||||
|
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
|
||||||
|
languageName: window.$gz.locale.getResolvedLanguage(),
|
||||||
|
hour12: window.$gz.locale.getHour12()
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -192,6 +197,14 @@ export default {
|
|||||||
default: null,
|
default: null,
|
||||||
type: Object
|
type: Object
|
||||||
},
|
},
|
||||||
|
allStates: {
|
||||||
|
default: null,
|
||||||
|
type: Array
|
||||||
|
},
|
||||||
|
allowedStates: {
|
||||||
|
default: null,
|
||||||
|
type: Array
|
||||||
|
},
|
||||||
formKey: { type: String, default: "" }, //used to grab template from store
|
formKey: { type: String, default: "" }, //used to grab template from store
|
||||||
readonly: Boolean,
|
readonly: Boolean,
|
||||||
disabled: Boolean
|
disabled: Boolean
|
||||||
@@ -215,6 +228,7 @@ export default {
|
|||||||
workOrderId: this.value.id,
|
workOrderId: this.value.id,
|
||||||
workOrderStatusId: this.selectedStatus,
|
workOrderStatusId: this.selectedStatus,
|
||||||
userId: window.$gz.store.state.userId,
|
userId: window.$gz.store.state.userId,
|
||||||
|
userViz: window.$gz.store.state.userName,
|
||||||
created: window.$gz.locale.nowUTC8601String()
|
created: window.$gz.locale.nowUTC8601String()
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -225,6 +239,35 @@ export default {
|
|||||||
this.pvm.formState.dirty = true;
|
this.pvm.formState.dirty = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getStateForDisplay(state) {
|
||||||
|
let ret = {
|
||||||
|
id: Date.now,
|
||||||
|
name: "??",
|
||||||
|
color: "#ffffff",
|
||||||
|
locked: false,
|
||||||
|
completed: false,
|
||||||
|
timeStamp: "??",
|
||||||
|
user: "??"
|
||||||
|
};
|
||||||
|
const s = this.allStates.find(z => z.id == state.workOrderStatusId);
|
||||||
|
if (s == null) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
//make for display
|
||||||
|
ret.id = state.id;
|
||||||
|
ret.name = s.name;
|
||||||
|
ret.color = s.color;
|
||||||
|
ret.locked = s.locked;
|
||||||
|
ret.completed = s.completed;
|
||||||
|
ret.user = state.userViz;
|
||||||
|
ret.timeStamp = window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
|
state.created,
|
||||||
|
this.timeZoneName,
|
||||||
|
this.languageName,
|
||||||
|
this.hour12
|
||||||
|
);
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
form() {
|
form() {
|
||||||
return window.$gz.form;
|
return window.$gz.form;
|
||||||
},
|
},
|
||||||
@@ -248,6 +291,16 @@ export default {
|
|||||||
hasState() {
|
hasState() {
|
||||||
return this.value.states != null && this.value.states.length > 0;
|
return this.value.states != null && this.value.states.length > 0;
|
||||||
},
|
},
|
||||||
|
stateDisplayList() {
|
||||||
|
let ret = [];
|
||||||
|
this.value.states.forEach(z => {
|
||||||
|
console.log("z", z);
|
||||||
|
let d = this.getStateForDisplay(z);
|
||||||
|
console.log("d", d);
|
||||||
|
ret.push(d);
|
||||||
|
});
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
canAdd: function() {
|
canAdd: function() {
|
||||||
//first check most obvious disqualifying properties
|
//first check most obvious disqualifying properties
|
||||||
if (!this.pvm.rights.change || !this.pvm.subRights.states.create) {
|
if (!this.pvm.rights.change || !this.pvm.subRights.states.create) {
|
||||||
@@ -279,4 +332,231 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"all": [
|
||||||
|
{
|
||||||
|
"id": 9,
|
||||||
|
"concurrency": 7790330,
|
||||||
|
"name": "Closed",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#f2f2f2",
|
||||||
|
"selectRoles": 10,
|
||||||
|
"removeRoles": 10,
|
||||||
|
"completed": true,
|
||||||
|
"locked": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"concurrency": 7790306,
|
||||||
|
"name": "Manager approval required",
|
||||||
|
"active": true,
|
||||||
|
"notes": "Use to lock workorder and wait for approval from manager",
|
||||||
|
"color": "#c00000",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 10,
|
||||||
|
"completed": false,
|
||||||
|
"locked": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"concurrency": 7790309,
|
||||||
|
"name": "Needs to be assigned",
|
||||||
|
"active": true,
|
||||||
|
"notes": "Waiting for technicians to be assigned to this work",
|
||||||
|
"color": "#80ffff",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 124927,
|
||||||
|
"completed": false,
|
||||||
|
"locked": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"concurrency": 7790312,
|
||||||
|
"name": "Scheduled",
|
||||||
|
"active": true,
|
||||||
|
"notes": "Scheduled / ready for service",
|
||||||
|
"color": "#00ff00",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 124927,
|
||||||
|
"completed": false,
|
||||||
|
"locked": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"concurrency": 7790315,
|
||||||
|
"name": "Service completed",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#ff0000",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 10,
|
||||||
|
"completed": true,
|
||||||
|
"locked": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 5,
|
||||||
|
"concurrency": 7790318,
|
||||||
|
"name": "Waiting on customer approval",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#8080ff",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 124927,
|
||||||
|
"completed": false,
|
||||||
|
"locked": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"concurrency": 7790321,
|
||||||
|
"name": "Waiting on parts",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#c0c000",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 124927,
|
||||||
|
"completed": false,
|
||||||
|
"locked": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 7,
|
||||||
|
"concurrency": 7790324,
|
||||||
|
"name": "Waiting on warranty return",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#ff00ff",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 124927,
|
||||||
|
"completed": false,
|
||||||
|
"locked": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 8,
|
||||||
|
"concurrency": 7790327,
|
||||||
|
"name": "Waiting to be invoiced",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#ffc0c0",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 32842,
|
||||||
|
"completed": false,
|
||||||
|
"locked": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"allowed": [
|
||||||
|
{
|
||||||
|
"id": 9,
|
||||||
|
"concurrency": 7790330,
|
||||||
|
"name": "Closed",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#f2f2f2",
|
||||||
|
"selectRoles": 10,
|
||||||
|
"removeRoles": 10,
|
||||||
|
"completed": true,
|
||||||
|
"locked": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"concurrency": 7790306,
|
||||||
|
"name": "Manager approval required",
|
||||||
|
"active": true,
|
||||||
|
"notes": "Use to lock workorder and wait for approval from manager",
|
||||||
|
"color": "#c00000",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 10,
|
||||||
|
"completed": false,
|
||||||
|
"locked": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"concurrency": 7790309,
|
||||||
|
"name": "Needs to be assigned",
|
||||||
|
"active": true,
|
||||||
|
"notes": "Waiting for technicians to be assigned to this work",
|
||||||
|
"color": "#80ffff",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 124927,
|
||||||
|
"completed": false,
|
||||||
|
"locked": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"concurrency": 7790312,
|
||||||
|
"name": "Scheduled",
|
||||||
|
"active": true,
|
||||||
|
"notes": "Scheduled / ready for service",
|
||||||
|
"color": "#00ff00",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 124927,
|
||||||
|
"completed": false,
|
||||||
|
"locked": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"concurrency": 7790315,
|
||||||
|
"name": "Service completed",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#ff0000",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 10,
|
||||||
|
"completed": true,
|
||||||
|
"locked": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 5,
|
||||||
|
"concurrency": 7790318,
|
||||||
|
"name": "Waiting on customer approval",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#8080ff",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 124927,
|
||||||
|
"completed": false,
|
||||||
|
"locked": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"concurrency": 7790321,
|
||||||
|
"name": "Waiting on parts",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#c0c000",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 124927,
|
||||||
|
"completed": false,
|
||||||
|
"locked": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 7,
|
||||||
|
"concurrency": 7790324,
|
||||||
|
"name": "Waiting on warranty return",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#ff00ff",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 124927,
|
||||||
|
"completed": false,
|
||||||
|
"locked": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 8,
|
||||||
|
"concurrency": 7790327,
|
||||||
|
"name": "Waiting to be invoiced",
|
||||||
|
"active": true,
|
||||||
|
"notes": null,
|
||||||
|
"color": "#ffc0c0",
|
||||||
|
"selectRoles": 124927,
|
||||||
|
"removeRoles": 32842,
|
||||||
|
"completed": false,
|
||||||
|
"locked": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user