This commit is contained in:
@@ -809,6 +809,7 @@ export default {
|
|||||||
|
|
||||||
//dev error on form?
|
//dev error on form?
|
||||||
if (!formControl) {
|
if (!formControl) {
|
||||||
|
debugger;
|
||||||
throw `gzform::fieldValueChanged formControl is not found ref:${ref}, formReferences:${formReference} `;
|
throw `gzform::fieldValueChanged formControl is not found ref:${ref}, formReferences:${formReference} `;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,6 @@
|
|||||||
></gz-role-picker>
|
></gz-role-picker>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<!-- https://vuetifyjs.com/en/components/color-pickers -->
|
|
||||||
<span class="v-label v-label--active theme--light">
|
<span class="v-label v-label--active theme--light">
|
||||||
{{ $ay.t("WorkOrderStatusColor") }}
|
{{ $ay.t("WorkOrderStatusColor") }}
|
||||||
</span>
|
</span>
|
||||||
@@ -94,7 +93,7 @@
|
|||||||
></v-checkbox>
|
></v-checkbox>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<!-- --------------------------------- -->
|
<!------------------------------------->
|
||||||
<v-col v-if="form().showMe(this, 'WorkOrderStatusNotes')" cols="12">
|
<v-col v-if="form().showMe(this, 'WorkOrderStatusNotes')" cols="12">
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="obj.notes"
|
v-model="obj.notes"
|
||||||
@@ -138,7 +137,7 @@ export default {
|
|||||||
await initForm(vm);
|
await initForm(vm);
|
||||||
|
|
||||||
vm.rights = window.$gz.role.getRights(window.$gz.type.WorkOrderStatus);
|
vm.rights = window.$gz.role.getRights(window.$gz.type.WorkOrderStatus);
|
||||||
vm.formState.readOnly = !vm.rights.change || vm.obj.status != 0;
|
vm.formState.readOnly = !vm.rights.change;
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
|
|
||||||
//id 0 means create a new record don't load one
|
//id 0 means create a new record don't load one
|
||||||
@@ -190,39 +189,18 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
||||||
|
obj: {
|
||||||
obj:
|
id: 0,
|
||||||
//IMPORTANT NOTE: Fields that are NON NULLABLE in the schema for the table but *are* hideable **MUST** have a default value set here or else there will be no way to save the record
|
concurrency: 0,
|
||||||
//I.E. Serial, usertype fields, ACTIVE
|
name: null,
|
||||||
//Also, if it's a non-nullable Enum backed field then it should have a valid selection i.e. not zero if there is no zero
|
active: true,
|
||||||
/*
|
notes: null,
|
||||||
{
|
color: "#ffffff",
|
||||||
"data": {
|
selectRoles: 10,
|
||||||
"id": 9,
|
removeRoles: 10,
|
||||||
"concurrency": 7662916,
|
completed: false,
|
||||||
"name": "Closed",
|
locked: false
|
||||||
"active": true,
|
},
|
||||||
"notes": null,
|
|
||||||
"color": "#ffffff",
|
|
||||||
"selectRoles": 10,
|
|
||||||
"removeRoles": 10,
|
|
||||||
"completed": true,
|
|
||||||
"locked": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
id: 0,
|
|
||||||
concurrency: 0,
|
|
||||||
name: null,
|
|
||||||
active: true,
|
|
||||||
notes: null,
|
|
||||||
color: "#ffffff",
|
|
||||||
selectRoles: 10,
|
|
||||||
removeRoles: 10,
|
|
||||||
completed: false,
|
|
||||||
locked: false
|
|
||||||
},
|
|
||||||
formState: {
|
formState: {
|
||||||
ready: false,
|
ready: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
@@ -324,7 +302,6 @@ export default {
|
|||||||
valid: true,
|
valid: true,
|
||||||
loading: false
|
loading: false
|
||||||
});
|
});
|
||||||
vm.formState.readOnly = !vm.rights.change || vm.obj.status != 0;
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.$gz.errorHandler.handleFormError(error, vm);
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
@@ -471,7 +448,7 @@ async function clickHandler(menuItem) {
|
|||||||
function generateMenu(vm) {
|
function generateMenu(vm) {
|
||||||
let menuOptions = {
|
let menuOptions = {
|
||||||
isMain: false,
|
isMain: false,
|
||||||
readOnly: vm.formState.readOnly || vm.obj.status != 0,
|
readOnly: vm.formState.readOnly,
|
||||||
icon: "$ayiFlag",
|
icon: "$ayiFlag",
|
||||||
title: "WorkOrderStatus",
|
title: "WorkOrderStatus",
|
||||||
helpUrl: "svc-work-order-status",
|
helpUrl: "svc-work-order-status",
|
||||||
@@ -519,8 +496,10 @@ let JUST_DELETED = false;
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
async function initForm(vm) {
|
async function initForm(vm) {
|
||||||
|
console.log("initform A");
|
||||||
await fetchTranslatedText();
|
await fetchTranslatedText();
|
||||||
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
|
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
|
||||||
|
console.log("initform B");
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user