This commit is contained in:
@@ -809,6 +809,7 @@ export default {
|
||||
|
||||
//dev error on form?
|
||||
if (!formControl) {
|
||||
debugger;
|
||||
throw `gzform::fieldValueChanged formControl is not found ref:${ref}, formReferences:${formReference} `;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
></gz-role-picker>
|
||||
</v-col>
|
||||
<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">
|
||||
{{ $ay.t("WorkOrderStatusColor") }}
|
||||
</span>
|
||||
@@ -94,7 +93,7 @@
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
|
||||
<!-- --------------------------------- -->
|
||||
<!------------------------------------->
|
||||
<v-col v-if="form().showMe(this, 'WorkOrderStatusNotes')" cols="12">
|
||||
<v-textarea
|
||||
v-model="obj.notes"
|
||||
@@ -138,7 +137,7 @@ export default {
|
||||
await initForm(vm);
|
||||
|
||||
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);
|
||||
|
||||
//id 0 means create a new record don't load one
|
||||
@@ -190,39 +189,18 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
||||
|
||||
obj:
|
||||
//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
|
||||
//I.E. Serial, usertype fields, ACTIVE
|
||||
//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
|
||||
/*
|
||||
{
|
||||
"data": {
|
||||
"id": 9,
|
||||
"concurrency": 7662916,
|
||||
"name": "Closed",
|
||||
"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
|
||||
},
|
||||
obj: {
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
name: null,
|
||||
active: true,
|
||||
notes: null,
|
||||
color: "#ffffff",
|
||||
selectRoles: 10,
|
||||
removeRoles: 10,
|
||||
completed: false,
|
||||
locked: false
|
||||
},
|
||||
formState: {
|
||||
ready: false,
|
||||
dirty: false,
|
||||
@@ -324,7 +302,6 @@ export default {
|
||||
valid: true,
|
||||
loading: false
|
||||
});
|
||||
vm.formState.readOnly = !vm.rights.change || vm.obj.status != 0;
|
||||
}
|
||||
} catch (error) {
|
||||
window.$gz.errorHandler.handleFormError(error, vm);
|
||||
@@ -471,7 +448,7 @@ async function clickHandler(menuItem) {
|
||||
function generateMenu(vm) {
|
||||
let menuOptions = {
|
||||
isMain: false,
|
||||
readOnly: vm.formState.readOnly || vm.obj.status != 0,
|
||||
readOnly: vm.formState.readOnly,
|
||||
icon: "$ayiFlag",
|
||||
title: "WorkOrderStatus",
|
||||
helpUrl: "svc-work-order-status",
|
||||
@@ -519,8 +496,10 @@ let JUST_DELETED = false;
|
||||
//
|
||||
//
|
||||
async function initForm(vm) {
|
||||
console.log("initform A");
|
||||
await fetchTranslatedText();
|
||||
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
|
||||
console.log("initform B");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user