This commit is contained in:
2021-09-22 18:02:44 +00:00
parent 33d2359c21
commit c51df5119e

View File

@@ -70,7 +70,7 @@
:type="viewType" :type="viewType"
:locale="languageName" :locale="languageName"
:event-more-text="$ay.t('More')" :event-more-text="$ay.t('More')"
:first-time="formSetting.firstTime" :first-time="formUserOptions.firstTime"
@click:event="showMoreInfo" @click:event="showMoreInfo"
@click:more="viewDay" @click:more="viewDay"
@click:date="viewDay" @click:date="viewDay"
@@ -460,7 +460,6 @@ export default {
//formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY, //formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
focus: "", focus: "",
viewType: "month", viewType: "month",
firstTime: "8:00",
selectedEvent: {}, selectedEvent: {},
selectedElement: null, selectedElement: null,
moreInfoDialog: false, moreInfoDialog: false,
@@ -490,7 +489,7 @@ export default {
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(), timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
languageName: window.$gz.locale.getResolvedLanguage(), languageName: window.$gz.locale.getResolvedLanguage(),
hour12: window.$gz.locale.getHour12(), hour12: window.$gz.locale.getHour12(),
formSetting: { firstTime: "8:00" } formUserOptions: {}
}; };
}, },
methods: { methods: {
@@ -893,6 +892,7 @@ export default {
nativeEvent.stopPropagation(); nativeEvent.stopPropagation();
}, },
async fetchEvents({ start, end }) { async fetchEvents({ start, end }) {
console.log("Fetching events");
try { try {
window.$gz.form.deleteAllErrorBoxErrors(this); window.$gz.form.deleteAllErrorBoxErrors(this);
let res = await window.$gz.api.post("schedule/personal", { let res = await window.$gz.api.post("schedule/personal", {
@@ -906,10 +906,10 @@ export default {
`${end.date}T23:59:59`, `${end.date}T23:59:59`,
this.timeZoneName this.timeZoneName
), ),
colorSource: 4, wisuColorSource: this.formUserOptions.wisuColorSource,
workOrders: true, wisu: this.formUserOptions.wisu, //workorder item scheduled user records
reviews: true, reviews: this.formUserOptions.reviews,
reminders: true reminders: this.formUserOptions.reminders
}); });
if (res.error) { if (res.error) {
@@ -1063,7 +1063,7 @@ function generateMenu(vm) {
async function initForm(vm) { async function initForm(vm) {
await fetchTranslatedText(vm); await fetchTranslatedText(vm);
getFormSettings(vm); getFormSettings(vm);
getFormUserOptions(vm); await getFormUserOptions(vm);
} }
function getFormSettings(vm) { function getFormSettings(vm) {
@@ -1089,18 +1089,39 @@ function saveFormSettings(vm) {
//////////////////// ////////////////////
// //
async function getFormUserOptions(vm) { async function getFormUserOptions(vm) {
let res = await window.$gz.api.get( let res = await window.$gz.api.get(`form-user-options/${FORM_KEY}`);
`form-user-options/list?formKey=${FORM_KEY}` if (res.error) {
); vm.formState.serverError = res.error;
console.log("getuseroptions:", res); window.$gz.form.setErrorBoxErrors(vm);
// if (res.error) { } else {
// console.log("getuseroptions:",res) if (res.data == null) {
// } else { console.log("getFormUserOptions null setting default");
//make a default
vm.formUserOptions = {
firstTime: "00:00",
wisuColorSource: 4,
wisu: true,
reviews: true,
reminders: true
};
} else {
vm.formUserOptions = res.data;
}
}
}
// vm.selectLists.savedFilters = res.data; ////////////////////
// //confirm we still have the current active filter id //
// setActiveFilter(vm, vm.activeFilterId); async function saveFormUserOptions(vm) {
// } let res = await window.$gz.api.upsert(
"form-user-options",
vm.formUserOptions
);
if (res.error) {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
}
} }
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////