HUGE REFACTOR / CLEANUP
if there is a issue it's probably something in here that was changed
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
|
||||
@@ -207,13 +207,13 @@ export default {
|
||||
},
|
||||
async upload() {
|
||||
//similar code in wiki-control
|
||||
let vm = this;
|
||||
let fileData = [];
|
||||
const vm = this;
|
||||
const fileData = [];
|
||||
for (let i = 0; i < vm.uploadFiles.length; i++) {
|
||||
let f = vm.uploadFiles[i];
|
||||
fileData.push({ name: f.name, lastModified: f.lastModified });
|
||||
}
|
||||
let at = {
|
||||
const at = {
|
||||
ayaId: vm.ayaId,
|
||||
ayaType: vm.ayaType,
|
||||
files: vm.uploadFiles,
|
||||
@@ -221,7 +221,7 @@ export default {
|
||||
notes: vm.notes ? vm.notes : ""
|
||||
};
|
||||
try {
|
||||
let res = await window.$gz.api.uploadAttachment(at);
|
||||
const res = await window.$gz.api.uploadAttachment(at);
|
||||
if (res.error) {
|
||||
window.$gz.errorHandler.handleFormError(res.error);
|
||||
} else {
|
||||
@@ -233,13 +233,13 @@ export default {
|
||||
}
|
||||
},
|
||||
async remove() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
try {
|
||||
if ((await window.$gz.dialog.confirmDelete()) !== true) {
|
||||
return;
|
||||
}
|
||||
|
||||
let res = await window.$gz.api.remove("attachment/" + vm.editId);
|
||||
const res = await window.$gz.api.remove("attachment/" + vm.editId);
|
||||
if (res.error) {
|
||||
window.$gz.errorHandler.handleFormError(res.error);
|
||||
} else {
|
||||
@@ -254,9 +254,9 @@ export default {
|
||||
}
|
||||
},
|
||||
async getList() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
try {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
"attachment/list?ayatype=" + vm.ayaType + "&ayaid=" + vm.ayaId
|
||||
);
|
||||
if (res.error) {
|
||||
@@ -274,12 +274,12 @@ export default {
|
||||
data = [];
|
||||
}
|
||||
|
||||
let timeZoneName = window.$gz.locale.getResolvedTimeZoneName();
|
||||
let languageName = window.$gz.locale.getResolvedLanguage();
|
||||
let hour12 = window.$gz.store.state.userOptions.hour12;
|
||||
let ret = [];
|
||||
const timeZoneName = window.$gz.locale.getResolvedTimeZoneName();
|
||||
const languageName = window.$gz.locale.getResolvedLanguage();
|
||||
const hour12 = window.$gz.store.state.userOptions.hour12;
|
||||
const ret = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let o = data[i];
|
||||
const o = data[i];
|
||||
//http://localhost:7575/api/v8/attachment/download/100?t=sssss
|
||||
ret.push({
|
||||
id: o.id,
|
||||
@@ -312,12 +312,11 @@ export default {
|
||||
});
|
||||
},
|
||||
async saveEdit() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
if (!vm.editName) {
|
||||
//todo: some error here, name is required..
|
||||
return;
|
||||
}
|
||||
//check if they differ first
|
||||
|
||||
let o = null;
|
||||
let i = 0;
|
||||
for (i = 0; i < vm.displayList.length; i++) {
|
||||
@@ -326,26 +325,18 @@ export default {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//any changes?
|
||||
|
||||
if (o.name == vm.editName && o.notes == vm.editNotes) {
|
||||
return;
|
||||
}
|
||||
|
||||
//post to server
|
||||
/*
|
||||
public uint Concurrency { get; set; }
|
||||
[Required]
|
||||
public string DisplayFileName { get; set; }
|
||||
public string Notes { get; set; }
|
||||
*/
|
||||
|
||||
let p = {
|
||||
const p = {
|
||||
concurrency: o.concurrency,
|
||||
displayFileName: vm.editName,
|
||||
notes: vm.editNotes
|
||||
};
|
||||
try {
|
||||
let res = await window.$gz.api.upsert("attachment/" + vm.editId, p);
|
||||
const res = await window.$gz.api.upsert("attachment/" + vm.editId, p);
|
||||
|
||||
if (res.error) {
|
||||
window.$gz.errorHandler.handleFormError(res.error);
|
||||
|
||||
@@ -62,9 +62,9 @@ export default {
|
||||
this.initializing = false;
|
||||
return;
|
||||
}
|
||||
let val = this.$refs.textField.$refs.input.value;
|
||||
const val = this.$refs.textField.$refs.input.value;
|
||||
|
||||
let parsedValue = parseCurrency(val, {
|
||||
const parsedValue = parseCurrency(val, {
|
||||
currency: this.currencyName,
|
||||
locale: this.languageName
|
||||
});
|
||||
|
||||
@@ -189,10 +189,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
@@ -226,20 +222,6 @@ export default {
|
||||
window.$gz.form.fieldValueChanged(this.parentVM, ref);
|
||||
}
|
||||
},
|
||||
// templateHasVisibleCustomFields() {
|
||||
// let template = this.$store.state.formCustomTemplate[this.formKey];
|
||||
// console.log(
|
||||
// "custom-fields-control templateHasVisibleCustomFields template=",
|
||||
// template
|
||||
// );
|
||||
// if (template == undefined) {
|
||||
// return false;
|
||||
// }
|
||||
// //iterate template and see if it has any custom fields set to display
|
||||
// //de-lodash
|
||||
// //return window.$gz. _.find(template, "type") != undefined;
|
||||
// return template.find(z => z.type != undefined);
|
||||
// },
|
||||
GetValueForField: function(dataKey) {
|
||||
let cData = {};
|
||||
//get the data out of the JSON string value
|
||||
@@ -254,15 +236,7 @@ export default {
|
||||
// - CURRENT TIME, DATE, DATETIME are pretty specific but all use a datetime string so any value not datetime like should be nulled
|
||||
// - CURRENT NUMBER, CURRENCY are also pretty specific but easy to identify if not fully numeric and then sb nulled or attempt to convert then null if not
|
||||
|
||||
//Get the field data type
|
||||
//https://lodash.com/docs#find
|
||||
//de-lodash
|
||||
// let ctrlType = window.$gz. _.find(
|
||||
// this.$store.state.formCustomTemplate[this.formKey],
|
||||
// ["dataKey", dataKey]
|
||||
// ).type;
|
||||
|
||||
let ctrlType = this.$store.state.formCustomTemplate[this.formKey].find(
|
||||
const ctrlType = this.$store.state.formCustomTemplate[this.formKey].find(
|
||||
z => z.dataKey == dataKey
|
||||
).type;
|
||||
|
||||
@@ -307,12 +281,10 @@ export default {
|
||||
ret = window.$gz.util.stringToBoolean(ret);
|
||||
break;
|
||||
}
|
||||
//The number 1?
|
||||
if (ret === 1) {
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
//The number 0?
|
||||
if (ret === 0) {
|
||||
ret = false;
|
||||
break;
|
||||
@@ -352,18 +324,14 @@ export default {
|
||||
cData[dataKey] = newValue.toString();
|
||||
}
|
||||
|
||||
//emit the new data so it syncs with the parent source
|
||||
let ret = JSON.stringify(cData);
|
||||
this.$emit("input", ret);
|
||||
this.$emit("input", JSON.stringify(cData));
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
availableCustomFields() {
|
||||
//item.type only exists for custom fields so they are the ones to return
|
||||
//In addition if there is a keyStartWith then there are multiple custom field controls on same form so that's a different route to take
|
||||
let template = this.$store.state.formCustomTemplate[this.formKey];
|
||||
// // debugger;
|
||||
// console.log("Template is: ", template);
|
||||
const template = this.$store.state.formCustomTemplate[this.formKey];
|
||||
|
||||
if (template != undefined) {
|
||||
if (this.keyStartWith != "") {
|
||||
|
||||
@@ -36,13 +36,7 @@
|
||||
</template>
|
||||
</template>
|
||||
<v-toolbar-title> {{ translatedTitle }} </v-toolbar-title>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<!-- <v-btn icon>
|
||||
<v-icon>mdi-heart</v-icon>
|
||||
</v-btn> -->
|
||||
|
||||
<v-menu bottom left>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn icon v-bind="attrs" v-on="on">
|
||||
|
||||
@@ -85,18 +85,15 @@ export default {
|
||||
},
|
||||
clicked: function(c, i) {
|
||||
if (i.length == 0) return; //Clicked outside any bar.
|
||||
let e = i[0]; //get index of bar clicked on
|
||||
// console.log(e._index);
|
||||
const e = i[0]; //get index of bar clicked on
|
||||
|
||||
//this gets the label
|
||||
//let x_value = this.obj.labels[e._index];
|
||||
//this gets the value
|
||||
//let y_value = this.obj.datasets[0].data[e._index];
|
||||
//this gets my custom id stuff
|
||||
//https://stackoverflow.com/a/42635435/8939
|
||||
let dataKeyValue = this.obj.datakeys[e._index];
|
||||
// console.log(x_value);
|
||||
// console.log(y_value);
|
||||
//console.log(dataKeyValue);
|
||||
const dataKeyValue = this.obj.datakeys[e._index];
|
||||
|
||||
alert(`STUB: OPEN ITEM (data: ${JSON.stringify(dataKeyValue)})`);
|
||||
//clickOnChart(lastHoveredIndex);
|
||||
|
||||
@@ -43,11 +43,11 @@ export default {
|
||||
computed: {},
|
||||
methods: {
|
||||
loadData: function() {
|
||||
let events = [];
|
||||
let now = new Date();
|
||||
let yy = now.getFullYear();
|
||||
let mm = now.getMonth() + 1;
|
||||
let dd = now.getDate();
|
||||
const events = [];
|
||||
const now = new Date();
|
||||
const yy = now.getFullYear();
|
||||
const mm = now.getMonth() + 1;
|
||||
const dd = now.getDate();
|
||||
events.push({
|
||||
id: 45,
|
||||
type: 34,
|
||||
|
||||
@@ -54,7 +54,7 @@ export default {
|
||||
moreClick() {
|
||||
const LIST_FORM_KEY = "widget-list";
|
||||
//get current settings for the form
|
||||
let formSettings = window.$gz.form.getFormSettings(LIST_FORM_KEY);
|
||||
const formSettings = window.$gz.form.getFormSettings(LIST_FORM_KEY);
|
||||
|
||||
//switch to an unsaved listview and substitute this dash widgets list view criteria
|
||||
formSettings.temp.page = 0;
|
||||
@@ -70,9 +70,9 @@ export default {
|
||||
});
|
||||
},
|
||||
async getDataFromApi() {
|
||||
let lv = LIST_VIEW;
|
||||
const lv = LIST_VIEW;
|
||||
lv.limit = this.maxListItems;
|
||||
let res = await window.$gz.api.post("data-list", lv);
|
||||
const res = await window.$gz.api.post("data-list", lv);
|
||||
if (!res.error) {
|
||||
this.obj = res.data;
|
||||
} else {
|
||||
|
||||
@@ -278,16 +278,6 @@
|
||||
:clearable="!formState.readOnly"
|
||||
:readonly="formState.readOnly"
|
||||
></gz-duration-picker>
|
||||
<!-- <v-text-field
|
||||
v-if="
|
||||
editItem.tempFilterOperator != null &&
|
||||
editItem.tempFilterOperator != '*NOVALUE*' &&
|
||||
editItem.tempFilterOperator != '*HASVALUE*'
|
||||
"
|
||||
v-model="editItem.tempFilterValue"
|
||||
:clearable="!formState.readOnly"
|
||||
type="number"
|
||||
></v-text-field> -->
|
||||
<v-btn
|
||||
large
|
||||
block
|
||||
@@ -401,17 +391,17 @@ export default {
|
||||
methods: {
|
||||
async saveAndExit() {
|
||||
//turn activeFilter into object json.parse
|
||||
let af = JSON.parse(this.activeFilter.filter);
|
||||
const af = JSON.parse(this.activeFilter.filter);
|
||||
|
||||
//remove column filter if it is already there to replace
|
||||
if (af.length != 0) {
|
||||
let index = af.findIndex(z => z.column == this.tableColumnData.fk);
|
||||
const index = af.findIndex(z => z.column == this.tableColumnData.fk);
|
||||
if (index > -1) {
|
||||
af.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
let newColumnFilter = {
|
||||
const newColumnFilter = {
|
||||
column: this.tableColumnData.fk,
|
||||
any: this.editItem.filter.any,
|
||||
items: []
|
||||
@@ -438,9 +428,11 @@ export default {
|
||||
this.activeFilter.filter = JSON.stringify(af);
|
||||
|
||||
//SAVE
|
||||
let res = await window.$gz.api.put("data-list-filter", this.activeFilter);
|
||||
const res = await window.$gz.api.put(
|
||||
"data-list-filter",
|
||||
this.activeFilter
|
||||
);
|
||||
if (res.error) {
|
||||
//throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
} else {
|
||||
this.close({ refresh: true });
|
||||
@@ -451,7 +443,7 @@ export default {
|
||||
},
|
||||
addFilterCondition(editItem) {
|
||||
// filter:[{column:"PartPartNumber",any:true/false,items:[{op: "=",value: "400735"}]}],
|
||||
let filterItem = { op: null, value: null, display: null };
|
||||
const filterItem = { op: null, value: null, display: null };
|
||||
let filterItemSet = false;
|
||||
|
||||
//DATE relative token?
|
||||
@@ -593,18 +585,17 @@ async function populateFieldDefinitions(vm) {
|
||||
//get the field defs from cache or store them
|
||||
//they are unchanging in a session so no need to fetch each time
|
||||
//only a server update would modify them from last value
|
||||
let storageKey = `dataListFields:${vm.dataListKey}`;
|
||||
const storageKey = `dataListFields:${vm.dataListKey}`;
|
||||
|
||||
let ss = sessionStorage.getItem(storageKey);
|
||||
const ss = sessionStorage.getItem(storageKey);
|
||||
if (ss) {
|
||||
vm.fieldDefinitions = JSON.parse(ss);
|
||||
return;
|
||||
} else {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
"data-list/listfields?DataListKey=" + vm.dataListKey
|
||||
);
|
||||
if (res.error) {
|
||||
//throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
} else {
|
||||
vm.fieldDefinitions = res.data;
|
||||
@@ -617,9 +608,8 @@ async function populateFieldDefinitions(vm) {
|
||||
//
|
||||
async function fetchActiveFilter(vm) {
|
||||
///api/v8/data-list-filter/{id}
|
||||
let res = await window.$gz.api.get(`data-list-filter/${vm.activeFilterId}`);
|
||||
const res = await window.$gz.api.get(`data-list-filter/${vm.activeFilterId}`);
|
||||
if (res.error) {
|
||||
//throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
} else {
|
||||
vm.activeFilter = res.data;
|
||||
@@ -898,8 +888,10 @@ function initEditItem(vm) {
|
||||
);
|
||||
}
|
||||
|
||||
let fld = vm.fieldDefinitions.find(z => z.fieldKey == vm.tableColumnData.fk);
|
||||
let o = {
|
||||
const fld = vm.fieldDefinitions.find(
|
||||
z => z.fieldKey == vm.tableColumnData.fk
|
||||
);
|
||||
const o = {
|
||||
key: fld.fieldKey,
|
||||
isFilterable: fld.isFilterable,
|
||||
enumType: fld.enumType,
|
||||
@@ -913,9 +905,9 @@ function initEditItem(vm) {
|
||||
|
||||
//re-hydrate the filter if already defined for this column
|
||||
//turn activeFilter into object json.parse
|
||||
let allActiveFilters = JSON.parse(vm.activeFilter.filter);
|
||||
const allActiveFilters = JSON.parse(vm.activeFilter.filter);
|
||||
|
||||
let af = allActiveFilters.find(z => z.column == vm.tableColumnData.fk);
|
||||
const af = allActiveFilters.find(z => z.column == vm.tableColumnData.fk);
|
||||
if (af) {
|
||||
o.filter.any = af.any;
|
||||
o.filter.items = af.items;
|
||||
@@ -934,7 +926,7 @@ function initEditItem(vm) {
|
||||
|
||||
//Add display text for filter item (same as in addFilterCondition)
|
||||
for (let j = 0; j < o.filter.items.length; j++) {
|
||||
let fi = o.filter.items[j];
|
||||
const fi = o.filter.items[j];
|
||||
fi.display = getDisplayForFilter(
|
||||
vm,
|
||||
o.uiFieldDataType,
|
||||
@@ -974,7 +966,7 @@ function getDisplayForFilter(
|
||||
|
||||
//DATE RELATIVE TOKEN FILTER
|
||||
if (uiFieldDataType === 1 && filterValue[0] == "*") {
|
||||
let valueDisplay = vm.selectLists.dateFilterTokens.find(
|
||||
const valueDisplay = vm.selectLists.dateFilterTokens.find(
|
||||
z => z.id == filterValue
|
||||
).name;
|
||||
|
||||
@@ -1001,7 +993,7 @@ function getDisplayForFilter(
|
||||
valueDisplay = window.$gz.locale.decimalLocalized(filterValue);
|
||||
break;
|
||||
case 6: //BOOL translate
|
||||
let tKey = filterValue ? "True" : "False";
|
||||
const tKey = filterValue ? "True" : "False";
|
||||
valueDisplay = vm.$ay.t(tKey);
|
||||
break;
|
||||
case 10: //ENUM translate
|
||||
@@ -1016,7 +1008,7 @@ function getDisplayForFilter(
|
||||
}
|
||||
|
||||
//Operator
|
||||
let opDisplay = vm.selectLists.stringFilterOperators.find(
|
||||
const opDisplay = vm.selectLists.stringFilterOperators.find(
|
||||
z => z.id == filterOperator
|
||||
).name;
|
||||
|
||||
|
||||
@@ -10,10 +10,7 @@
|
||||
<v-card-subtitle class="mt-1"
|
||||
>{{ activeFilterNameAtOpen }} {{ activeFilterCreator }}</v-card-subtitle
|
||||
>
|
||||
<!-- activefilter:{ "id": 2, "concurrency": 5029609, "userId": 1, "name": "-",
|
||||
"public": false, "defaultFilter": true, "listKey": "CustomerDataList", "filter": "[]" } -->
|
||||
<v-card-text>
|
||||
<!-- <div>activefilter:{{ activeFilter }}</div> -->
|
||||
<v-text-field
|
||||
:readonly="formState.readOnly"
|
||||
v-model="activeFilter.name"
|
||||
@@ -95,13 +92,13 @@ export default {
|
||||
async deleteFilter() {
|
||||
//prompt if a true delete and not a default filter "reset"
|
||||
if (!this.activeFilter.defaultFilter) {
|
||||
let dialogResult = await window.$gz.dialog.confirmDelete();
|
||||
const dialogResult = await window.$gz.dialog.confirmDelete();
|
||||
if (dialogResult != true) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let res = await window.$gz.api.remove(
|
||||
const res = await window.$gz.api.remove(
|
||||
`data-list-filter/${this.activeFilter.id}`
|
||||
);
|
||||
if (res.error) {
|
||||
@@ -113,7 +110,6 @@ export default {
|
||||
async saveAndExit(saveAs) {
|
||||
if (saveAs) {
|
||||
//SAVE AS
|
||||
|
||||
//strip ID
|
||||
delete this.activeFilter.id;
|
||||
delete this.activeFilter.concurrency;
|
||||
@@ -128,24 +124,22 @@ export default {
|
||||
this.activeFilter.name += " [" + this.$ay.t("Copy") + "]";
|
||||
}
|
||||
this.activeFilter.userId = window.$gz.store.state.userId;
|
||||
let res = await window.$gz.api.post(
|
||||
const res = await window.$gz.api.post(
|
||||
"data-list-filter",
|
||||
this.activeFilter
|
||||
);
|
||||
if (res.error) {
|
||||
//throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, this));
|
||||
} else {
|
||||
this.close({ refresh: true, newFilterId: res.data.id });
|
||||
}
|
||||
} else {
|
||||
//SAVE
|
||||
let res = await window.$gz.api.put(
|
||||
const res = await window.$gz.api.put(
|
||||
"data-list-filter",
|
||||
this.activeFilter
|
||||
);
|
||||
if (res.error) {
|
||||
//throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, this));
|
||||
} else {
|
||||
this.close({ refresh: true });
|
||||
@@ -162,7 +156,7 @@ export default {
|
||||
|
||||
//Get owner name
|
||||
if (!this.isSelfOwned) {
|
||||
let res = await window.$gz.api.post("pick-list/list", {
|
||||
const res = await window.$gz.api.post("pick-list/list", {
|
||||
ayaType: window.$gz.type.User,
|
||||
inactive: true,
|
||||
preselectedIds: [this.activeFilter.userId]
|
||||
@@ -200,9 +194,8 @@ async function initForm(vm) {
|
||||
//
|
||||
async function fetchActiveFilter(vm) {
|
||||
///api/v8/data-list-filter/{id}
|
||||
let res = await window.$gz.api.get(`data-list-filter/${vm.activeFilterId}`);
|
||||
const res = await window.$gz.api.get(`data-list-filter/${vm.activeFilterId}`);
|
||||
if (res.error) {
|
||||
//throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
} else {
|
||||
vm.activeFilter = res.data;
|
||||
|
||||
@@ -148,7 +148,6 @@
|
||||
<template v-if="c.t == 1">
|
||||
<!-- DATETIME -->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -163,7 +162,6 @@
|
||||
<template v-else-if="c.t == 2">
|
||||
<!-- DATE -->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -178,7 +176,6 @@
|
||||
<template v-else-if="c.t == 3">
|
||||
<!-- TIME -->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -193,7 +190,6 @@
|
||||
<template v-else-if="c.t == 4">
|
||||
<!-- TEXT (also maybe openable)-->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -208,7 +204,6 @@
|
||||
<template v-else-if="c.t == 5">
|
||||
<!-- INTEGER -->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -232,7 +227,6 @@
|
||||
<template v-else-if="c.t == 7">
|
||||
<!-- DECIMAL -->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -255,7 +249,6 @@
|
||||
<template v-else-if="c.t == 10">
|
||||
<!-- ENUM (translated to text on getdata) ALSO MAYBE OPENABLE -->
|
||||
<template v-if="c.i && c.ot">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -363,7 +356,6 @@
|
||||
<template v-if="c.t == 1">
|
||||
<!-- DATETIME -->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -378,7 +370,6 @@
|
||||
<template v-else-if="c.t == 2">
|
||||
<!-- DATE -->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -393,7 +384,6 @@
|
||||
<template v-else-if="c.t == 3">
|
||||
<!-- TIME -->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -408,7 +398,6 @@
|
||||
<template v-else-if="c.t == 4">
|
||||
<!-- TEXT (also maybe openable)-->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -423,7 +412,6 @@
|
||||
<template v-else-if="c.t == 5">
|
||||
<!-- INTEGER -->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -450,7 +438,6 @@
|
||||
<template v-else-if="c.t == 7">
|
||||
<!-- DECIMAL -->
|
||||
<template v-if="c.i && c.i != 0 && !c.nopen">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -473,7 +460,6 @@
|
||||
<template v-else-if="c.t == 10">
|
||||
<!-- ENUM (translated to text on getdata) ALSO MAYBE OPENABLE -->
|
||||
<template v-if="c.i && c.ot">
|
||||
<!-- openable object with an ID -->
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
@@ -527,7 +513,6 @@
|
||||
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* Xeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//NOTE: if get duplicate keys detected error here it's because whatever is the rowid column
|
||||
//has duplicate values in it and should be unique in every row
|
||||
@@ -572,7 +557,6 @@ export default {
|
||||
default: undefined
|
||||
},
|
||||
preFilterMode: {
|
||||
//{icon:null,viz:null,ayatype:null,id:null,clearable:false}
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
@@ -596,13 +580,12 @@ export default {
|
||||
watch: {
|
||||
dataTablePagingOptions: {
|
||||
async handler() {
|
||||
//{ "page": 1, "itemsPerPage": 10, "sortBy": [], "sortDesc": [], "groupBy": [], "groupDesc": [], "mustSort": false, "multiSort": false }
|
||||
//this code works around some weird bug that causes visible items to be selected in grid (only, not in actual selected array, just a visual thing)
|
||||
// when breakpoint is switched between wide and narrow either way. No idea why it happens but this fixes that issue and also ensures that there are no
|
||||
|
||||
//spurious fetches happening just because the view has changed
|
||||
//See what has changed and record it for processing
|
||||
let sortHasChanged = !(
|
||||
const sortHasChanged = !(
|
||||
window.$gz.util.isEqualArraysOfPrimitives(
|
||||
this.dataTablePagingOptions.sortBy,
|
||||
this.lastDataTablePagingOptions.sortBy
|
||||
@@ -613,7 +596,7 @@ export default {
|
||||
)
|
||||
);
|
||||
|
||||
let pagingHaschanged = !(
|
||||
const pagingHaschanged = !(
|
||||
this.lastDataTablePagingOptions.page ==
|
||||
this.dataTablePagingOptions.page &&
|
||||
this.lastDataTablePagingOptions.itemsPerPage ==
|
||||
@@ -682,15 +665,15 @@ export default {
|
||||
//Used by narrow view to get the "header" text for a column based on the column key
|
||||
getHeaderText(key) {
|
||||
//key format is row-column e.g."500-2"
|
||||
let columnIndex = key.split("-")[1];
|
||||
let header = this.headers[columnIndex];
|
||||
const columnIndex = key.split("-")[1];
|
||||
const header = this.headers[columnIndex];
|
||||
if (header && header.text) {
|
||||
return header.text;
|
||||
}
|
||||
return "";
|
||||
},
|
||||
async filter(item) {
|
||||
let res = await this.$refs.dataTableFilter.open(item);
|
||||
const res = await this.$refs.dataTableFilter.open(item);
|
||||
if (res && res.refresh == true) {
|
||||
this.getDataFromApi();
|
||||
}
|
||||
@@ -707,7 +690,7 @@ export default {
|
||||
setActiveFilter(this); //will not trigger refresh yet
|
||||
|
||||
//Call api method to clear this filter
|
||||
let res = await window.$gz.api.remove(
|
||||
const res = await window.$gz.api.remove(
|
||||
`data-list-filter/${this.activeFilterId}`
|
||||
);
|
||||
if (res.error) {
|
||||
@@ -727,7 +710,7 @@ export default {
|
||||
return null;
|
||||
},
|
||||
async editFilter() {
|
||||
let res = await this.$refs.dataTableFilterManager.open();
|
||||
const res = await this.$refs.dataTableFilterManager.open();
|
||||
if (res && res.refresh == true) {
|
||||
if (res.newFilterId) {
|
||||
//save as new filter, select it
|
||||
@@ -739,7 +722,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async mobileColumnFilterSelect() {
|
||||
let resHeaderItem = await this.$refs.dataTableMobileFilterColumnSelector.open(
|
||||
const resHeaderItem = await this.$refs.dataTableMobileFilterColumnSelector.open(
|
||||
this.headers,
|
||||
this.filterColor
|
||||
);
|
||||
@@ -749,24 +732,24 @@ export default {
|
||||
},
|
||||
keyArrayFromSortByArray(sortBy) {
|
||||
return sortBy.map(sortItem => {
|
||||
let val = this.headers.find(z => z.value == sortItem);
|
||||
const val = this.headers.find(z => z.value == sortItem);
|
||||
if (val) {
|
||||
return val.fk;
|
||||
}
|
||||
});
|
||||
},
|
||||
setSortIndicatorsFromDataListResponse(rsort) {
|
||||
let sortBy = [];
|
||||
let sortDesc = [];
|
||||
const sortBy = [];
|
||||
const sortDesc = [];
|
||||
if (rsort != null) {
|
||||
Object.keys(rsort).forEach((key, index) => {
|
||||
//Pull column header name "value" from "fk"matching "key" here from this.headers columns.c0 etc here from this.headers see above method
|
||||
let found = this.headers.find(z => z.fk == key);
|
||||
const found = this.headers.find(z => z.fk == key);
|
||||
if (found != null) {
|
||||
sortBy.push(found.value);
|
||||
|
||||
//if not null then push into the sortBy array
|
||||
let sort = rsort[key];
|
||||
const sort = rsort[key];
|
||||
if (sort == "-") {
|
||||
sortDesc.push(true);
|
||||
} else {
|
||||
@@ -783,7 +766,7 @@ export default {
|
||||
this.getDataFromApi();
|
||||
},
|
||||
getDataListSelection(ayaType) {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
//called when parent form needs the selected id's or the list view options needed to rehydrate the entire list of id's in the same order and filter
|
||||
//i.e. for reporting, batch operations etc
|
||||
|
||||
@@ -828,9 +811,6 @@ export default {
|
||||
params: {
|
||||
dataListKey: this.dataListKey,
|
||||
hiddenAffectiveColumns: this.hiddenAffectiveColumns
|
||||
// ,
|
||||
// formKey: this.formKey,
|
||||
// activeFilterId: this.activeFilterId
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -856,7 +836,7 @@ export default {
|
||||
//c.cst is styling added here by data builder in the form of an object with props set for compatibility with Vue
|
||||
//c.clr is a specific color coming from the server for items that support colors (reminders etc)
|
||||
if (c.cst || c.clr) {
|
||||
let clrBit = {};
|
||||
const clrBit = {};
|
||||
if (c.clr) {
|
||||
if (c.clr[0] != "#") {
|
||||
c.clr = "#" + c.clr;
|
||||
@@ -869,13 +849,13 @@ export default {
|
||||
}
|
||||
},
|
||||
async getDataFromApi(deSelectAll) {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
|
||||
if (vm.loading) {
|
||||
return;
|
||||
}
|
||||
//start with defaults
|
||||
let listOptions = {
|
||||
const listOptions = {
|
||||
DataListKey: vm.dataListKey,
|
||||
Limit: 5,
|
||||
Offset: 0
|
||||
@@ -911,7 +891,7 @@ export default {
|
||||
}
|
||||
|
||||
try {
|
||||
let res = await window.$gz.api.post("data-list", {
|
||||
const res = await window.$gz.api.post("data-list", {
|
||||
offset: listOptions.Offset,
|
||||
limit: listOptions.Limit,
|
||||
dataListKey: vm.dataListKey,
|
||||
@@ -973,7 +953,7 @@ export default {
|
||||
},
|
||||
async created() {
|
||||
//get pick lists
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
await initForm(vm);
|
||||
vm.loading = false;
|
||||
vm.getDataFromApi();
|
||||
@@ -986,11 +966,11 @@ function buildHeaders(columnData) {
|
||||
if (!columnData) {
|
||||
return [];
|
||||
}
|
||||
let ret = [];
|
||||
const ret = [];
|
||||
//iterate the columns
|
||||
for (let i = 0; i < columnData.length; i++) {
|
||||
let cm = columnData[i];
|
||||
let h = {};
|
||||
const cm = columnData[i];
|
||||
const h = {};
|
||||
h.text = window.$gz.translation.get(cm.cm);
|
||||
h.fk = cm.fk;
|
||||
h.value = "columns.c" + i.toString(); //+".v";
|
||||
@@ -1020,38 +1000,38 @@ function buildHeaders(columnData) {
|
||||
async function buildRecords(listData, columndefinitions, ridColumnOpenable) {
|
||||
//iterate data, build each object keyed with index name and display set to correct translated filter and then return
|
||||
|
||||
let ret = [];
|
||||
const ret = [];
|
||||
if (!listData) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
//cache display format stuff
|
||||
let timeZoneName = window.$gz.locale.getResolvedTimeZoneName();
|
||||
let languageName = window.$gz.locale.getResolvedLanguage();
|
||||
let hour12 = window.$gz.store.state.userOptions.hour12;
|
||||
let currencyName = window.$gz.locale.getCurrencyName();
|
||||
const timeZoneName = window.$gz.locale.getResolvedTimeZoneName();
|
||||
const languageName = window.$gz.locale.getResolvedLanguage();
|
||||
const hour12 = window.$gz.store.state.userOptions.hour12;
|
||||
const currencyName = window.$gz.locale.getCurrencyName();
|
||||
|
||||
//this will cache the first time it's required (if required)
|
||||
let availableRoles = null;
|
||||
|
||||
//comes as an array of arrays, needs to leave as an array of objects representing each row
|
||||
for (let iRow = 0; iRow < listData.length; iRow++) {
|
||||
let row = listData[iRow];
|
||||
const row = listData[iRow];
|
||||
//iterate row and build object representing row data keyed to index
|
||||
|
||||
//container object for row
|
||||
//id will be set later when code below encounters the id column which could be in any position (or not at all) but is identified by it's rid property
|
||||
let o = { id: undefined, columns: {} };
|
||||
const o = { id: undefined, columns: {} };
|
||||
|
||||
for (let iColumn = 0; iColumn < row.length; iColumn++) {
|
||||
let column = row[iColumn];
|
||||
const column = row[iColumn];
|
||||
|
||||
//rowId?
|
||||
if (column.rid) {
|
||||
o.id = column.i;
|
||||
}
|
||||
|
||||
let dataType = columndefinitions[iColumn].dt;
|
||||
const dataType = columndefinitions[iColumn].dt;
|
||||
let display = column.v;
|
||||
let cstStyle = null; //custom additional styling here in grid e.g. negative numbers etc
|
||||
|
||||
@@ -1175,12 +1155,12 @@ async function buildRecords(listData, columndefinitions, ridColumnOpenable) {
|
||||
"AuthorizationRoles"
|
||||
);
|
||||
}
|
||||
let roles = display;
|
||||
let roleNames = [];
|
||||
const roles = display;
|
||||
const roleNames = [];
|
||||
|
||||
if (roles != null && roles != 0) {
|
||||
for (let i = 0; i < availableRoles.length; i++) {
|
||||
let role = availableRoles[i];
|
||||
const role = availableRoles[i];
|
||||
if (!!(roles & role.id)) {
|
||||
roleNames.push(role.name);
|
||||
}
|
||||
@@ -1194,7 +1174,7 @@ async function buildRecords(listData, columndefinitions, ridColumnOpenable) {
|
||||
}
|
||||
}
|
||||
//build the row column object vm will be used by the datatable
|
||||
let columnObject = {
|
||||
const columnObject = {
|
||||
v: display,
|
||||
t: dataType,
|
||||
key: iRow + "-" + iColumn
|
||||
@@ -1244,9 +1224,9 @@ async function fetchTranslatedHeaderNames(columnData) {
|
||||
if (!columnData) {
|
||||
return;
|
||||
}
|
||||
let headerKeys = [];
|
||||
const headerKeys = [];
|
||||
for (let i = 0; i < columnData.length; i++) {
|
||||
let cm = columnData[i];
|
||||
const cm = columnData[i];
|
||||
headerKeys.push(cm.cm);
|
||||
}
|
||||
//Now fetch all the keys
|
||||
@@ -1261,9 +1241,9 @@ async function fetchEnums(columnData) {
|
||||
if (!columnData) {
|
||||
return;
|
||||
}
|
||||
let headerKeys = [];
|
||||
|
||||
for (let i = 0; i < columnData.length; i++) {
|
||||
let cm = columnData[i];
|
||||
const cm = columnData[i];
|
||||
if (cm.et) {
|
||||
await window.$gz.enums.fetchEnumList(cm.et);
|
||||
}
|
||||
@@ -1287,7 +1267,7 @@ async function initForm(vm) {
|
||||
////////////////////
|
||||
//
|
||||
async function fetchSavedFilterList(vm) {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
"data-list-filter/list?ListKey=" + vm.dataListKey
|
||||
);
|
||||
if (res.error) {
|
||||
@@ -1303,7 +1283,7 @@ async function fetchSavedFilterList(vm) {
|
||||
////////////////////
|
||||
//
|
||||
function saveFormSettings(vm) {
|
||||
let newFormSettings = {
|
||||
const newFormSettings = {
|
||||
temp: { page: vm.dataTablePagingOptions.page },
|
||||
saved: {
|
||||
itemsPerPage: vm.dataTablePagingOptions.itemsPerPage,
|
||||
@@ -1315,7 +1295,7 @@ function saveFormSettings(vm) {
|
||||
|
||||
//preserve anything not directly related to datatable
|
||||
//for now it's just the last report so nothing fancy here
|
||||
let formSettings = window.$gz.form.getFormSettings(vm.formKey);
|
||||
const formSettings = window.$gz.form.getFormSettings(vm.formKey);
|
||||
|
||||
if (formSettings != null && formSettings.saved != null) {
|
||||
if (formSettings.saved.lastReport != null) {
|
||||
@@ -1340,7 +1320,7 @@ function setActiveFilter(vm, desiredId) {
|
||||
}
|
||||
|
||||
//no specific id so attempt to set to default
|
||||
let dflt = vm.selectLists.savedFilters.find(z => z.default == true);
|
||||
const dflt = vm.selectLists.savedFilters.find(z => z.default == true);
|
||||
if (dflt) {
|
||||
vm.activeFilterId = dflt.id;
|
||||
return;
|
||||
@@ -1352,7 +1332,7 @@ function setActiveFilter(vm, desiredId) {
|
||||
////////////////////
|
||||
//
|
||||
function loadFormSettings(vm) {
|
||||
let formSettings = window.$gz.form.getFormSettings(vm.formKey);
|
||||
const formSettings = window.$gz.form.getFormSettings(vm.formKey);
|
||||
|
||||
//process SAVED formsettings
|
||||
if (formSettings.saved) {
|
||||
|
||||
@@ -58,15 +58,12 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
//******************************** NOTE: this control also captures the TIME even though it's DATE only, this is an intentional design decision to support field change to date or date AND time and is considered a display issue */
|
||||
export default {
|
||||
data: () => ({
|
||||
dlgdate: false,
|
||||
//cache display format stuff
|
||||
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
|
||||
languageName: window.$gz.locale.getResolvedLanguage()
|
||||
// defaultLocale: window.$gz.locale.get BrowserFirstLanguage().split("-", 1)[0]
|
||||
}),
|
||||
props: {
|
||||
label: { type: String, default: null },
|
||||
@@ -96,7 +93,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
setToday() {
|
||||
let v = window.$gz.locale
|
||||
const v = window.$gz.locale
|
||||
.nowUTC8601String(this.timeZoneName)
|
||||
.split("T")[0];
|
||||
this.updateDateValue(v);
|
||||
@@ -122,11 +119,11 @@ export default {
|
||||
this.dlgdate = false;
|
||||
},
|
||||
updateValue(theDate, theTime) {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
|
||||
if (!theDate) {
|
||||
let v = new Date();
|
||||
let fullYear = v.getFullYear();
|
||||
const v = new Date();
|
||||
const fullYear = v.getFullYear();
|
||||
let fullMonth = v.getMonth() + 1;
|
||||
if (fullMonth < 10) {
|
||||
fullMonth = "0" + fullMonth.toString();
|
||||
@@ -142,7 +139,7 @@ export default {
|
||||
theTime = "00:00:00";
|
||||
}
|
||||
|
||||
let ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
const ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
theDate + "T" + theTime,
|
||||
vm.timeZoneName
|
||||
);
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -58,11 +57,11 @@ export default {
|
||||
);
|
||||
},
|
||||
updateValue() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
let dateValue = vm.$refs.dateField.$refs.input.value;
|
||||
if (!dateValue) {
|
||||
let v = new Date();
|
||||
let fullYear = v.getFullYear();
|
||||
const v = new Date();
|
||||
const fullYear = v.getFullYear();
|
||||
let fullMonth = v.getMonth() + 1;
|
||||
if (fullMonth < 10) {
|
||||
fullMonth = "0" + fullMonth.toString();
|
||||
@@ -82,7 +81,7 @@ export default {
|
||||
timeValue = "00:00:00";
|
||||
}
|
||||
|
||||
let ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
const ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
dateValue + "T" + timeValue,
|
||||
vm.timeZoneName
|
||||
);
|
||||
|
||||
@@ -95,16 +95,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
export default {
|
||||
data: () => ({
|
||||
dlgdate: false,
|
||||
dlgtime: false,
|
||||
//cache display format stuff
|
||||
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
|
||||
languageName: window.$gz.locale.getResolvedLanguage(),
|
||||
hour12: window.$gz.locale.getHour12()
|
||||
//defaultLocale: window.$gz.locale.ge tBrowserFirstLanguage().split("-", 1)[0]
|
||||
}),
|
||||
props: {
|
||||
label: { type: String, default: null },
|
||||
@@ -134,14 +131,14 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
setToday() {
|
||||
let v = window.$gz.locale
|
||||
const v = window.$gz.locale
|
||||
.nowUTC8601String(this.timeZoneName)
|
||||
.split("T")[0];
|
||||
this.updateDateValue(v);
|
||||
this.dlgdate = false;
|
||||
},
|
||||
setNow() {
|
||||
let v = window.$gz.locale.nowUTC8601String().split("T")[1];
|
||||
const v = window.$gz.locale.nowUTC8601String().split("T")[1];
|
||||
this.updateTimeValue(v);
|
||||
this.dlgtime = false;
|
||||
},
|
||||
@@ -177,10 +174,10 @@ export default {
|
||||
this.dlgdate = false;
|
||||
},
|
||||
updateValue(theDate, theTime) {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
if (!theDate) {
|
||||
let v = new Date();
|
||||
let fullYear = v.getFullYear();
|
||||
const v = new Date();
|
||||
const fullYear = v.getFullYear();
|
||||
let fullMonth = v.getMonth() + 1;
|
||||
if (fullMonth < 10) {
|
||||
fullMonth = "0" + fullMonth.toString();
|
||||
@@ -196,7 +193,7 @@ export default {
|
||||
theTime = "00:00:00";
|
||||
}
|
||||
|
||||
let ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
const ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
theDate + "T" + theTime,
|
||||
vm.timeZoneName
|
||||
);
|
||||
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
|
||||
props: {
|
||||
label: { type: String, default: null },
|
||||
rules: { type: Array, default: undefined},
|
||||
rules: { type: Array, default: undefined },
|
||||
errorMessages: { type: Array, default: null },
|
||||
value: { type: String, default: null },
|
||||
readonly: { type: Boolean, default: false },
|
||||
@@ -79,11 +79,11 @@ export default {
|
||||
);
|
||||
},
|
||||
updateValue() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
let dateValue = vm.$refs.dateField.$refs.input.value;
|
||||
if (!dateValue) {
|
||||
let v = new Date();
|
||||
let fullYear = v.getFullYear();
|
||||
const v = new Date();
|
||||
const fullYear = v.getFullYear();
|
||||
let fullMonth = v.getMonth() + 1;
|
||||
if (fullMonth < 10) {
|
||||
fullMonth = "0" + fullMonth.toString();
|
||||
@@ -100,7 +100,7 @@ export default {
|
||||
timeValue = "00:00:00";
|
||||
}
|
||||
|
||||
let ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
const ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
dateValue + "T" + timeValue,
|
||||
vm.timeZoneName
|
||||
);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
></v-select>
|
||||
</template>
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
//bitwise selection of days of week
|
||||
//https://stackoverflow.com/a/24174625/8939
|
||||
|
||||
@@ -43,10 +42,10 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
selectedValue() {
|
||||
let ret = [];
|
||||
const ret = [];
|
||||
if (this.value != null && this.value != 0) {
|
||||
for (let i = 0; i < this.daysOfWeek.length; i++) {
|
||||
let day = this.daysOfWeek[i];
|
||||
const day = this.daysOfWeek[i];
|
||||
if (!!(this.value & day.id)) {
|
||||
ret.push(day.id);
|
||||
}
|
||||
@@ -60,7 +59,7 @@ export default {
|
||||
let newValue = 0;
|
||||
if (value != null && value != [] && value.length > 0) {
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
let day = value[i];
|
||||
const day = value[i];
|
||||
newValue = newValue | day;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
//### NOTE: THIS IS A DUPLICATE OF CURRENCYCONTROL AND THE ONLY DIFFERENCE IS THE "currency:" VALUE IS SET TO NULL IN THE TEMPLATE AND IN THE updateValue METHOD
|
||||
//https://dm4t2.github.io/vue-currency-input/guide/#introduction :value="formattedValue"
|
||||
//https://codesandbox.io/s/vue-template-kd7d1?fontsize=14&module=%2Fsrc%2FApp.vue
|
||||
@@ -47,8 +46,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
updateValue() {
|
||||
let val = this.$refs.textField.$refs.input.value;
|
||||
let parsedValue = parseCurrency(val, {
|
||||
const val = this.$refs.textField.$refs.input.value;
|
||||
const parsedValue = parseCurrency(val, {
|
||||
currency: null,
|
||||
locale: this.languageName
|
||||
});
|
||||
|
||||
@@ -69,20 +69,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
|
||||
/*https://alligator.io/vuejs/add-v-model-support/
|
||||
"TimeSpanDays": "days",
|
||||
"TimeSpanHours": "hours",
|
||||
"TimeSpanMinutes": "minutes",
|
||||
"TimeSpanSeconds": "seconds", */
|
||||
//example serialized json TimeSpans
|
||||
//seems to be DD.HH:MM:SS.ms at it's most characters
|
||||
//two colons always with an optional period at each end to separate days and ms
|
||||
//we don't support or need MS and can safely ignore them
|
||||
//so just look for a period at the top and the rest is split by colons
|
||||
//maybe split by colon first then subsplit first and last elements into days and MS
|
||||
//{"data":{"testTSDaysWMS":"22.10:15:22.0330000","testTSHMS":"05:16:33","testTS_DHMS":"5.10:15:33","testTS_MS":"00:15:33","testTS_S":"00:00:33","testTS_D":"22.00:00:00"}}
|
||||
export default {
|
||||
props: {
|
||||
label: { type: String, default: null },
|
||||
@@ -100,7 +86,7 @@ export default {
|
||||
return this.errorMessages != null && this.errorMessages.length > 0;
|
||||
},
|
||||
splitSpan() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
let theDays = 0;
|
||||
let theHours = 0;
|
||||
let theMinutes = 0;
|
||||
@@ -112,10 +98,10 @@ export default {
|
||||
theMinutes = 0;
|
||||
theSeconds = 0;
|
||||
} else {
|
||||
let work = vm.value.split(":");
|
||||
const work = vm.value.split(":");
|
||||
//has days?
|
||||
if (work[0].includes(".")) {
|
||||
let dh = work[0].split(".");
|
||||
const dh = work[0].split(".");
|
||||
theDays = Number(dh[0]);
|
||||
theHours = Number(dh[1]);
|
||||
} else {
|
||||
@@ -124,7 +110,7 @@ export default {
|
||||
theMinutes = Number(work[1]);
|
||||
//has milliseconds? (ignore them)
|
||||
if (work[2].includes(".")) {
|
||||
let dh = work[2].split(".");
|
||||
const dh = work[2].split(".");
|
||||
theSeconds = Number(dh[0]);
|
||||
} else {
|
||||
theSeconds = Number(work[2]);
|
||||
@@ -149,16 +135,14 @@ export default {
|
||||
return ret;
|
||||
},
|
||||
updateSpan() {
|
||||
//{"data":{"testTSDaysWMS":"22.10:15:22.0330000","testTSHMS":"05:16:33","testTS_DHMS":"5.10:15:33","testTS_MS":"00:15:33","testTS_S":"00:00:33","testTS_D":"22.00:00:00"}}
|
||||
// DD.HH:MM:SS.ms
|
||||
let ret = "";
|
||||
//NOTE: even though a user may type a text value into the input, because it's set to "Number"
|
||||
//it always has a value of zero if it's not a digit even though the user typed Q for example (firefox at least)
|
||||
//so no parsing here to handle weird entries is required AFAICT
|
||||
let daysValue = this.$refs.daysPicker.$refs.input.value || 0;
|
||||
let hoursValue = this.$refs.hoursPicker.$refs.input.value || 0;
|
||||
let minutesValue = this.$refs.minutesPicker.$refs.input.value || 0;
|
||||
let secondsValue = this.$refs.secondsPicker.$refs.input.value || 0;
|
||||
const daysValue = this.$refs.daysPicker.$refs.input.value || 0;
|
||||
const hoursValue = this.$refs.hoursPicker.$refs.input.value || 0;
|
||||
const minutesValue = this.$refs.minutesPicker.$refs.input.value || 0;
|
||||
const secondsValue = this.$refs.secondsPicker.$refs.input.value || 0;
|
||||
|
||||
if (daysValue > 0) {
|
||||
ret = `${daysValue}.`;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<script>
|
||||
export default {
|
||||
async created() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
await fetchTranslatedText(vm);
|
||||
//NOTE: if extension doesn't support a particular object add it here to the NoType default
|
||||
if (
|
||||
@@ -49,8 +49,8 @@ export default {
|
||||
return true;
|
||||
},
|
||||
async doAction() {
|
||||
let vm = this;
|
||||
let dialogResult = await window.$gz.dialog.confirmGeneric(
|
||||
const vm = this;
|
||||
const dialogResult = await window.$gz.dialog.confirmGeneric(
|
||||
"EraseMultipleObjectsWarning",
|
||||
"error"
|
||||
);
|
||||
@@ -61,33 +61,20 @@ export default {
|
||||
vm.$emit("ext-show-job-log", "clear");
|
||||
|
||||
//do the batch action
|
||||
let url = "job-operations/batch-delete";
|
||||
let body = this.dataListSelection;
|
||||
const url = "job-operations/batch-delete";
|
||||
const body = this.dataListSelection;
|
||||
|
||||
try {
|
||||
//call api route
|
||||
let jobId = await window.$gz.api.upsert(url, body);
|
||||
if (jobId.error) {
|
||||
//throw new Error(jobId.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(jobId, vm));
|
||||
}
|
||||
jobId = jobId.jobId; //it's in a sub key
|
||||
//indicate loading by setting on button
|
||||
vm.jobActive = true;
|
||||
|
||||
/* /// <summary>
|
||||
/// Job status for opsjobs
|
||||
/// </summary>
|
||||
public enum JobStatus : int
|
||||
{
|
||||
Absent=0,
|
||||
Sleeping = 1,
|
||||
Running = 2,
|
||||
Completed = 3,
|
||||
Failed = 4
|
||||
} */
|
||||
let jobStatus = 1;
|
||||
//get status
|
||||
|
||||
while (vm.jobActive == true) {
|
||||
await window.$gz.util.sleepAsync(1000);
|
||||
@@ -117,8 +104,6 @@ export default {
|
||||
vm.$emit("ext-close-refresh");
|
||||
} catch (error) {
|
||||
vm.jobActive = false;
|
||||
|
||||
//window.$gz.errorHandler.handleFormError(error, vm);
|
||||
window.$gz.eventBus.$emit("notify-error", vm.$ay.t("JobFailed"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,20 +36,16 @@ export default {
|
||||
},
|
||||
|
||||
async doAction() {
|
||||
//do the export and trigger download
|
||||
let vm = this;
|
||||
let url = `export/render/${vm.exportFormat}`;
|
||||
let body = this.dataListSelection;
|
||||
|
||||
try {
|
||||
//call api route
|
||||
let res = await window.$gz.api.upsert(url, body);
|
||||
const res = await window.$gz.api.upsert(
|
||||
`export/render/${this.exportFormat}`,
|
||||
this.dataListSelection
|
||||
);
|
||||
if (res.error) {
|
||||
//Error object constructor must be a string
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, this));
|
||||
}
|
||||
|
||||
let href = window.$gz.api.genericDownloadUrl(
|
||||
const href = window.$gz.api.genericDownloadUrl(
|
||||
"export/download/" + res.data
|
||||
);
|
||||
if (window.open(href, "DownloadExport") == null) {
|
||||
@@ -58,8 +54,8 @@ export default {
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
window.$gz.errorHandler.handleFormError(error, vm);
|
||||
window.$gz.eventBus.$emit("notify-error", vm.$ay.t("JobFailed"));
|
||||
window.$gz.errorHandler.handleFormError(error, this);
|
||||
window.$gz.eventBus.$emit("notify-error", this.$ay.t("JobFailed"));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<script>
|
||||
export default {
|
||||
created() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
|
||||
if (
|
||||
vm.dataListSelection.AType != 0 &&
|
||||
@@ -66,7 +66,7 @@ export default {
|
||||
window.open(this.$store.state.helpUrl + "ay-ex-tags", "_blank");
|
||||
},
|
||||
canDoAction() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
if (vm.action == "Replace" && !vm.replace) {
|
||||
return false;
|
||||
}
|
||||
@@ -76,57 +76,36 @@ export default {
|
||||
return false;
|
||||
},
|
||||
async doAction() {
|
||||
//do the batch action
|
||||
let vm = this;
|
||||
let url = "tag-list/";
|
||||
let body = this.dataListSelection;
|
||||
switch (vm.action) {
|
||||
switch (this.action) {
|
||||
case "Add":
|
||||
url += `batch-add/${vm.tag}`;
|
||||
url += `batch-add/${this.tag}`;
|
||||
break;
|
||||
case "Remove":
|
||||
url += `batch-remove/${vm.tag}`;
|
||||
url += `batch-remove/${this.tag}`;
|
||||
break;
|
||||
case "Replace":
|
||||
url += `batch-replace/${vm.tag}?toTag=${vm.replace}`;
|
||||
url += `batch-replace/${this.tag}?toTag=${this.replace}`;
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
//call api route
|
||||
let jobId = await window.$gz.api.upsert(url, body);
|
||||
let jobId = await window.$gz.api.upsert(url, this.dataListSelection);
|
||||
if (jobId.error) {
|
||||
//throw new Error(jobId.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(jobId, vm));
|
||||
throw new Error(window.$gz.errorHandler.errorToString(jobId, this));
|
||||
}
|
||||
jobId = jobId.jobId; //it's in a sub key
|
||||
//indicate loading by setting on button
|
||||
vm.jobActive = true;
|
||||
jobId = jobId.jobId;
|
||||
this.jobActive = true;
|
||||
|
||||
/* /// <summary>
|
||||
/// Job status for opsjobs
|
||||
/// </summary>
|
||||
public enum JobStatus : int
|
||||
{
|
||||
Absent=0,
|
||||
Sleeping = 1,
|
||||
Running = 2,
|
||||
Completed = 3,
|
||||
Failed = 4
|
||||
} */
|
||||
let jobStatus = 1;
|
||||
//get status
|
||||
|
||||
while (vm.jobActive == true) {
|
||||
while (this.jobActive == true) {
|
||||
await window.$gz.util.sleepAsync(1000);
|
||||
//check if done
|
||||
jobStatus = await window.$gz.api.get(
|
||||
`job-operations/status/${jobId}`
|
||||
);
|
||||
if (jobStatus.error) {
|
||||
//throw new Error(jobStatus.error);
|
||||
throw new Error(
|
||||
window.$gz.errorHandler.errorToString(jobStatus, vm)
|
||||
window.$gz.errorHandler.errorToString(jobStatus, this)
|
||||
);
|
||||
}
|
||||
jobStatus = jobStatus.data;
|
||||
@@ -134,36 +113,29 @@ export default {
|
||||
throw new Error("Job failed");
|
||||
}
|
||||
if (jobStatus == 3) {
|
||||
vm.jobActive = false;
|
||||
this.jobActive = false;
|
||||
}
|
||||
}
|
||||
//Here if it's completed successfully
|
||||
window.$gz.eventBus.$emit("notify-success", vm.$ay.t("JobCompleted"));
|
||||
window.$gz.eventBus.$emit("notify-success", this.$ay.t("JobCompleted"));
|
||||
} catch (error) {
|
||||
vm.jobActive = false;
|
||||
window.$gz.errorHandler.handleFormError(error, vm);
|
||||
window.$gz.eventBus.$emit("notify-error", vm.$ay.t("JobFailed"));
|
||||
this.jobActive = false;
|
||||
window.$gz.errorHandler.handleFormError(error, this);
|
||||
window.$gz.eventBus.$emit("notify-error", this.$ay.t("JobFailed"));
|
||||
}
|
||||
},
|
||||
normalize(value) {
|
||||
if (!value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//Must be lowercase per rules
|
||||
//This may be naive when we get international cust omers but for now supporting utf-8 and it appears it's safe to do this with unicode
|
||||
//This may be naive when we get international customers but for now supporting utf-8 and it appears it's safe to do this with unicode
|
||||
value = value.toLowerCase();
|
||||
//No spaces in tags, replace with dashes
|
||||
|
||||
value = value.split(" ").join("-");
|
||||
//Remove multiple dash sequences
|
||||
value = value.replace(/-+/g, "-");
|
||||
|
||||
//Ensure doesn't start or end with a dash
|
||||
value = value.replace(/^\-+-\-+$/g, "");
|
||||
// inObj = inObj.Trim("-");
|
||||
//No longer than 255 characters
|
||||
// inObj = StringUtil.MaxLength(inObj, 255);
|
||||
return value;
|
||||
},
|
||||
normalizeTag(value) {
|
||||
|
||||
@@ -64,7 +64,6 @@ export default {
|
||||
},
|
||||
headers: [],
|
||||
errorObj: [],
|
||||
//cache display format stuff
|
||||
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
|
||||
languageName: window.$gz.locale.getResolvedLanguage(),
|
||||
hour12: window.$gz.locale.getHour12()
|
||||
@@ -79,22 +78,20 @@ export default {
|
||||
}`;
|
||||
},
|
||||
async handleError(jobId) {
|
||||
let vm = this;
|
||||
|
||||
if (!jobId || jobId == "00000000-0000-0000-0000-000000000000") {
|
||||
throw "Error: extension triggered handleError with empty jobId";
|
||||
}
|
||||
|
||||
if (jobId == "clear") {
|
||||
vm.errorObj = [];
|
||||
this.errorObj = [];
|
||||
return;
|
||||
}
|
||||
|
||||
let res = await window.$gz.api.get(`job-operations/logs/${jobId}`);
|
||||
const res = await window.$gz.api.get(`job-operations/logs/${jobId}`);
|
||||
if (res.data) {
|
||||
let ret = [];
|
||||
const ret = [];
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
let o = res.data[i];
|
||||
const o = res.data[i];
|
||||
ret.push({
|
||||
id: i,
|
||||
created: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||
@@ -111,9 +108,9 @@ export default {
|
||||
});
|
||||
}
|
||||
|
||||
vm.errorObj = ret;
|
||||
this.errorObj = ret;
|
||||
} else {
|
||||
vm.errorObj = [];
|
||||
this.errorObj = [];
|
||||
}
|
||||
},
|
||||
open(dls) {
|
||||
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
}
|
||||
this.options = Object.assign(this.options, options);
|
||||
this.maxWidth = Math.floor(window.innerWidth * 0.9);
|
||||
let calculatedWidth = Math.floor(window.innerWidth * 0.5);
|
||||
const calculatedWidth = Math.floor(window.innerWidth * 0.5);
|
||||
if (calculatedWidth < 290) {
|
||||
this.width = 290;
|
||||
} else if (calculatedWidth > 800) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<!-- <v-scale-transition> -->
|
||||
<v-snackbar
|
||||
data-cy="gznotify"
|
||||
:value="isVisible"
|
||||
@@ -19,13 +18,9 @@
|
||||
{{ this.$root.$gz.translation.get("More") }}
|
||||
</v-btn>
|
||||
</v-snackbar>
|
||||
<!-- </v-scale-transition> -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* XXXeslint-disable */
|
||||
const DEFAULT_NOTIFY_OPTIONS = { type: "info", timeout: 3000 };
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
isVisible: false,
|
||||
@@ -43,16 +38,13 @@ export default {
|
||||
if (!options.message) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!options.type) {
|
||||
options.type = DEFAULT_NOTIFY_OPTIONS.type;
|
||||
}
|
||||
if (!options.timeout) {
|
||||
options.timeout = DEFAULT_NOTIFY_OPTIONS.timeout;
|
||||
}
|
||||
//add it to the queue
|
||||
this.notificationQueue.push(options);
|
||||
|
||||
//trigger the notification queue handler if it isn't already in action
|
||||
if (!this.processing) {
|
||||
this.handleNotifications();
|
||||
@@ -64,12 +56,10 @@ export default {
|
||||
if (this.notificationQueue.length > 0) {
|
||||
//Move the next item into the current slot
|
||||
this.currentNotification = this.notificationQueue.shift();
|
||||
|
||||
//If don't use nextTick then don't get all visible when multiple in sequence
|
||||
this.$nextTick(() => {
|
||||
this.isVisible = true;
|
||||
});
|
||||
|
||||
//Show it for the designated time before moving on to the next
|
||||
setTimeout(() => {
|
||||
this.isVisible = false;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
//### NOTE: THIS IS A DUPLICATE OF CURRENCYCONTROL AND THE ONLY DIFFERENCE IS THE "currency:" VALUE IS SET TO NULL IN THE TEMPLATE AND IN THE updateValue METHOD
|
||||
//https://dm4t2.github.io/vue-currency-input/guide/#introduction :value="formattedValue"
|
||||
//https://codesandbox.io/s/vue-template-kd7d1?fontsize=14&module=%2Fsrc%2FApp.vue
|
||||
@@ -48,8 +47,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
updateValue() {
|
||||
let val = this.$refs.textField.$refs.input.value;
|
||||
let parsedValue = parseCurrency(val, {
|
||||
const val = this.$refs.textField.$refs.input.value;
|
||||
const parsedValue = parseCurrency(val, {
|
||||
currency: null,
|
||||
locale: this.languageName
|
||||
});
|
||||
|
||||
@@ -39,10 +39,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* Xeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.fetchValueIfNotPresent();
|
||||
@@ -113,24 +109,21 @@ export default {
|
||||
this.fetchValueIfNotPresent();
|
||||
},
|
||||
searchEntry(val, oldVal) {
|
||||
let vm = this;
|
||||
//clear any local entryError
|
||||
vm.clearErrors();
|
||||
this.clearErrors();
|
||||
//if the search entry is in the results list then it's a drop down selection not a typed search so bail
|
||||
for (let i = 0; i < vm.searchResults.length; i++) {
|
||||
if (vm.searchResults[i].name == val) {
|
||||
for (let i = 0; i < this.searchResults.length; i++) {
|
||||
if (this.searchResults[i].name == val) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!val || vm.fetching || !vm.initialized) {
|
||||
if (!vm.initialized) {
|
||||
vm.$nextTick(() => {
|
||||
vm.initialized = true;
|
||||
if (!val || this.fetching || !this.initialized) {
|
||||
if (!this.initialized) {
|
||||
this.$nextTick(() => {
|
||||
this.initialized = true;
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
this.doSearch(val);
|
||||
},
|
||||
entryError(val) {
|
||||
@@ -183,9 +176,7 @@ export default {
|
||||
//simulate empty selection:
|
||||
e = window.$gz.form.getNoSelectionItem(true);
|
||||
}
|
||||
|
||||
this.lastSelection = e;
|
||||
|
||||
//this is required for the control to update and parent form to detect it
|
||||
this.$emit("input", e.id);
|
||||
//this is sometimes required for forms that need more than the ID (contract etc)
|
||||
@@ -194,63 +185,55 @@ export default {
|
||||
},
|
||||
fetchValueIfNotPresent() {
|
||||
//is there a value that might require fetching?
|
||||
|
||||
let vm = this;
|
||||
let val = vm.value;
|
||||
const val = this.value;
|
||||
if (val == null) {
|
||||
return;
|
||||
}
|
||||
//check if it's in the list of items we have here
|
||||
for (let i = 0; i < vm.searchResults.length; i++) {
|
||||
if (vm.searchResults[i].id == val) {
|
||||
for (let i = 0; i < this.searchResults.length; i++) {
|
||||
if (this.searchResults[i].id == val) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
//is it the no selection item?
|
||||
if (val == null) {
|
||||
window.$gz.form.addNoSelectionItem(vm.searchResults, true);
|
||||
window.$gz.form.addNoSelectionItem(this.searchResults, true);
|
||||
} else {
|
||||
//Not here, better get it
|
||||
let pickListParams = {
|
||||
ayaType: vm.ayaType,
|
||||
preselectedIds: [vm.value]
|
||||
const pickListParams = {
|
||||
ayaType: this.ayaType,
|
||||
preselectedIds: [this.value]
|
||||
};
|
||||
|
||||
if (vm.variant != null) {
|
||||
pickListParams["listVariant"] = vm.variant;
|
||||
if (this.variant != null) {
|
||||
pickListParams["listVariant"] = this.variant;
|
||||
}
|
||||
|
||||
if (vm.template != null) {
|
||||
pickListParams["template"] = vm.template;
|
||||
if (this.template != null) {
|
||||
pickListParams["template"] = this.template;
|
||||
}
|
||||
|
||||
vm.getList(pickListParams);
|
||||
this.getList(pickListParams);
|
||||
}
|
||||
},
|
||||
replaceLastSelection() {
|
||||
let vm = this;
|
||||
//check if searchResults has last selection, if not then add it back in again
|
||||
if (vm.lastSelection == null) {
|
||||
if (this.lastSelection == null) {
|
||||
//it might be initializing
|
||||
for (let i = 0; i < vm.searchResults.length; i++) {
|
||||
if (vm.searchResults[i].id == vm.value) {
|
||||
vm.lastSelection = vm.searchResults[i];
|
||||
for (let i = 0; i < this.searchResults.length; i++) {
|
||||
if (this.searchResults[i].id == this.value) {
|
||||
this.lastSelection = this.searchResults[i];
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < vm.searchResults.length; i++) {
|
||||
if (vm.searchResults[i].id == vm.lastSelection.id) {
|
||||
for (let i = 0; i < this.searchResults.length; i++) {
|
||||
if (this.searchResults[i].id == this.lastSelection.id) {
|
||||
return; //already there
|
||||
}
|
||||
}
|
||||
//Not there so insert it
|
||||
vm.searchResults.push(vm.lastSelection);
|
||||
this.searchResults.push(this.lastSelection);
|
||||
},
|
||||
dropdown(e) {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
//check if we have only the initial loaded item and no selection item
|
||||
if (vm.searchResults.length < 3) {
|
||||
//get the default list
|
||||
@@ -272,72 +255,48 @@ export default {
|
||||
//need to do a case insensitive filter and hopefully it mirrors postgres at the backend
|
||||
return item.name.toLowerCase().indexOf(queryText.toLowerCase()) > -1;
|
||||
}
|
||||
|
||||
//split out just the text search part
|
||||
// let searchText = queryText;
|
||||
// if (queryText.includes(" ")) {
|
||||
// //get the non tag part of query if possible
|
||||
// //ignore bad condition of too many terms
|
||||
// let searchTerms = queryText.split(" ");
|
||||
// if (searchTerms[0].includes("..")) {
|
||||
// searchText = searchTerms[1];
|
||||
// } else {
|
||||
// searchText = searchTerms[0];
|
||||
// }
|
||||
// }
|
||||
},
|
||||
getList: async function(pickListParams) {
|
||||
/*
|
||||
public AyaType AyaType { get; set; }
|
||||
public string Query { get; set; }
|
||||
public bool Inactive { get; set; }
|
||||
public List<long> PreselectedIds { get; set; }
|
||||
public string ListVariant { get; set; }
|
||||
//"{\"ayaType\":8,\"preselectedIds\":[1,3,5,7]}"
|
||||
}
|
||||
|
||||
*/
|
||||
let vm = this;
|
||||
if (vm.fetching) {
|
||||
if (this.fetching) {
|
||||
return;
|
||||
}
|
||||
vm.fetching = true;
|
||||
this.fetching = true;
|
||||
//default params for when called on init
|
||||
if (!pickListParams) {
|
||||
pickListParams = {
|
||||
ayaType: vm.ayaType
|
||||
ayaType: this.ayaType
|
||||
};
|
||||
|
||||
if (vm.value != null) {
|
||||
pickListParams["preselectedIds"] = [vm.value];
|
||||
if (this.value != null) {
|
||||
pickListParams["preselectedIds"] = [this.value];
|
||||
}
|
||||
|
||||
if (vm.includeInactive) {
|
||||
if (this.includeInactive) {
|
||||
pickListParams["inactive"] = true;
|
||||
}
|
||||
if (vm.variant != null) {
|
||||
pickListParams["listVariant"] = vm.variant;
|
||||
if (this.variant != null) {
|
||||
pickListParams["listVariant"] = this.variant;
|
||||
}
|
||||
if (vm.template != null) {
|
||||
pickListParams["template"] = vm.template;
|
||||
if (this.template != null) {
|
||||
pickListParams["template"] = this.template;
|
||||
}
|
||||
}
|
||||
try {
|
||||
let res = await window.$gz.api.upsert("pick-list/list", pickListParams);
|
||||
const res = await window.$gz.api.upsert(
|
||||
"pick-list/list",
|
||||
pickListParams
|
||||
);
|
||||
|
||||
vm.fetching = false;
|
||||
//We never expect there to be no data here
|
||||
this.fetching = false;
|
||||
if (!res.hasOwnProperty("data")) {
|
||||
return Promise.reject(res);
|
||||
}
|
||||
vm.searchResults = res.data;
|
||||
if (vm.allowNoSelection) {
|
||||
window.$gz.form.addNoSelectionItem(vm.searchResults, true);
|
||||
this.searchResults = res.data;
|
||||
if (this.allowNoSelection) {
|
||||
window.$gz.form.addNoSelectionItem(this.searchResults, true);
|
||||
}
|
||||
vm.replaceLastSelection();
|
||||
this.replaceLastSelection();
|
||||
} catch (err) {
|
||||
window.$gz.errorHandler.handleFormError(err);
|
||||
vm.fetching = false;
|
||||
this.fetching = false;
|
||||
}
|
||||
},
|
||||
doSearch: debounce(function(searchFor) {
|
||||
@@ -345,7 +304,7 @@ export default {
|
||||
//https://vuejs.org/v2/guide/migration.html#debounce-Param-Attribute-for-v-model-removed
|
||||
//-----------------
|
||||
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
let isATwoTermQuery = false;
|
||||
let queryTerms = [];
|
||||
//NOTE: empty query is valid; it means get the top 100 ordered by template order
|
||||
@@ -354,9 +313,7 @@ export default {
|
||||
emptyQuery = true;
|
||||
} else {
|
||||
//Pre-process the query to validate and send conditionally
|
||||
|
||||
//get the discrete search terms and verify there are max two
|
||||
|
||||
if (searchFor.includes(" ")) {
|
||||
queryTerms = searchFor.split(" ");
|
||||
if (queryTerms.length > 2) {
|
||||
@@ -412,20 +369,17 @@ export default {
|
||||
}
|
||||
|
||||
//build parameter
|
||||
let pickListParams = { ayaType: vm.ayaType };
|
||||
//let urlParams = "?ayaType=" + vm.ayaType;
|
||||
const pickListParams = { ayaType: vm.ayaType };
|
||||
if (!emptyQuery) {
|
||||
let query = queryTerms[0];
|
||||
if (queryTerms[1] != "[?]") {
|
||||
query += " " + queryTerms[1];
|
||||
}
|
||||
//urlParams += "&query=" + query;
|
||||
pickListParams["query"] = query;
|
||||
}
|
||||
|
||||
if (vm.includeInactive) {
|
||||
pickListParams["inactive"] = true;
|
||||
//urlParams += "&inactive=true";
|
||||
}
|
||||
if (vm.variant != null) {
|
||||
pickListParams["listVariant"] = vm.variant;
|
||||
|
||||
@@ -461,10 +461,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
import GzWoAddress from "./work-order-address.vue";
|
||||
import GZDaysOfWeek from "./days-of-week-control.vue";
|
||||
export default {
|
||||
|
||||
@@ -437,10 +437,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -506,7 +502,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].expenses.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].expenses.length;
|
||||
|
||||
//#################################### IMPORTANT ##################################################
|
||||
//NOTE: default values are critical and must match server validation ExpenseValidateAsync for restricted users
|
||||
@@ -532,7 +528,7 @@ export default {
|
||||
chargeToCustomer: false,
|
||||
isDirty: true,
|
||||
pmItemId: this.value.items[this.activeWoItemIndex].id,
|
||||
uid: Date.now() //used for error tracking / display
|
||||
uid: Date.now()
|
||||
});
|
||||
this.$emit("change");
|
||||
this.selectedRow = [{ index: newIndex }];
|
||||
@@ -586,11 +582,6 @@ export default {
|
||||
this.activeItemIndex
|
||||
].isDirty = true;
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
|
||||
// //set viz if applicable
|
||||
// if(ref==""){
|
||||
// let selectedPartWarehouse = vm.$refs.partWarehouseId.getFullSelectionValue();
|
||||
// }
|
||||
}
|
||||
},
|
||||
itemRowClasses: function(item) {
|
||||
@@ -637,7 +628,7 @@ export default {
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemExpenseName")) {
|
||||
headers.push({
|
||||
|
||||
@@ -439,10 +439,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -526,7 +522,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].labors.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].labors.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].labors.push({
|
||||
id: 0,
|
||||
@@ -702,7 +698,6 @@ export default {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
//---
|
||||
},
|
||||
computed: {
|
||||
isDeleted: function() {
|
||||
@@ -723,11 +718,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemLaborServiceStartDate")) {
|
||||
headers.push({
|
||||
@@ -992,7 +983,6 @@ export default {
|
||||
canDeleteAll: function() {
|
||||
return this.pvm.rights.change && !this.value.userIsRestrictedType;
|
||||
}
|
||||
//----
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -409,10 +409,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -484,7 +480,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].loans.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].loans.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].loans.push({
|
||||
id: 0,
|
||||
@@ -606,11 +602,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemLoanUnit")) {
|
||||
headers.push({
|
||||
@@ -878,8 +870,6 @@ export default {
|
||||
canDeleteAll: function() {
|
||||
return this.pvm.rights.change && !this.value.userIsRestrictedType;
|
||||
}
|
||||
|
||||
//----
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -591,10 +591,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -669,7 +665,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].outsideServices
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].outsideServices
|
||||
.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].outsideServices.push({
|
||||
@@ -801,11 +797,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemOutsideServiceUnit")) {
|
||||
headers.push({
|
||||
|
||||
@@ -465,10 +465,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -561,7 +557,7 @@ export default {
|
||||
if (!partId || partId == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`part/serials/${partId}`);
|
||||
const res = await window.$gz.api.get(`part/serials/${partId}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -598,7 +594,7 @@ export default {
|
||||
this.$emit("change");
|
||||
},
|
||||
async addPartAssembly() {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
`part-assembly/${this.selectedPartAssembly}`
|
||||
);
|
||||
if (res.data && res.data.items) {
|
||||
@@ -713,7 +709,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].parts.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].parts.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].parts.push({
|
||||
id: 0,
|
||||
@@ -861,11 +857,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemPartPartID")) {
|
||||
headers.push({
|
||||
|
||||
@@ -303,10 +303,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -407,7 +403,7 @@ export default {
|
||||
].serviceRateViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].scheduledUsers
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].scheduledUsers
|
||||
.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].scheduledUsers.push({
|
||||
@@ -600,11 +596,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemScheduledUserStartDate")) {
|
||||
headers.push({
|
||||
|
||||
@@ -311,10 +311,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -371,7 +367,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async addTaskGroup() {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
`task-group/${this.selectedTaskGroup}`
|
||||
);
|
||||
if (res.data && res.data.items) {
|
||||
@@ -391,7 +387,7 @@ export default {
|
||||
}
|
||||
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].tasks.length;
|
||||
let incompleteViz = this.pvm.selectLists.woItemTaskCompletionTypes.find(
|
||||
const incompleteViz = this.pvm.selectLists.woItemTaskCompletionTypes.find(
|
||||
s => s.id == 1 //incomplete
|
||||
).name;
|
||||
res.data.items.forEach(z => {
|
||||
@@ -443,7 +439,7 @@ export default {
|
||||
}
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].tasks.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].tasks.length;
|
||||
this.value.items[this.activeWoItemIndex].tasks.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
@@ -557,11 +553,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemTaskSequence")) {
|
||||
headers.push({
|
||||
|
||||
@@ -470,10 +470,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -543,7 +539,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].travels.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].travels.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].travels.push({
|
||||
id: 0,
|
||||
@@ -741,11 +737,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemTravelStartDate")) {
|
||||
headers.push({
|
||||
|
||||
@@ -338,10 +338,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -412,7 +408,7 @@ export default {
|
||||
if (!id || id == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`unit/active-contract/${id}`);
|
||||
const res = await window.$gz.api.get(`unit/active-contract/${id}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -434,7 +430,7 @@ export default {
|
||||
.t("ApplyUnitContract")
|
||||
.replace("{0}", res.data.name);
|
||||
|
||||
let dialogResult = await window.$gz.dialog.confirmGenericPreTranslated(
|
||||
const dialogResult = await window.$gz.dialog.confirmGenericPreTranslated(
|
||||
prompt,
|
||||
"question"
|
||||
);
|
||||
@@ -457,27 +453,13 @@ export default {
|
||||
if (!id || id == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`unit/service-warranty-info/${id}`);
|
||||
const res = await window.$gz.api.get(`unit/service-warranty-info/${id}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
window.$gz.errorHandler.errorToString(res, this)
|
||||
);
|
||||
} else {
|
||||
/* {
|
||||
"recentWorkOrders":[{"serial":10,"id":10,"serviceDate":"2021-01-19T22:00:00Z"},{"serial":8,"id":8,"serviceDate":"2021-04-08T22:00:00Z"},{"serial":7,"id":7,"serviceDate":"2021-04-18T20:00:00Z"}],
|
||||
"purchaseDate":"2019-03-12T09:37:52.930923Z",
|
||||
"purchasedFromVendor":null,
|
||||
"purchaseFromVendorId":null,
|
||||
"purchaseReceiptNumber":"139736",
|
||||
"lifeTimeWarranty":false,
|
||||
"warrantyExpiryDate":"2019-04-12T09:37:52.930923Z",
|
||||
"warrantyTerms":"Shipping parts and service"}
|
||||
|
||||
"UnitPurchasedDate": "Purchased Date",
|
||||
"UnitPurchaseFromID": "Purchased From",
|
||||
"UnitReceipt": "Receipt Number",
|
||||
*/
|
||||
const r = res.data;
|
||||
|
||||
let WarrantyInfo = `${this.$ay.t("Warranty")}: `;
|
||||
@@ -511,7 +493,7 @@ export default {
|
||||
this.pvm.hour12
|
||||
);
|
||||
}
|
||||
let PurchaseInfo = `${this.$ay.t(
|
||||
const PurchaseInfo = `${this.$ay.t(
|
||||
"UnitPurchaseFromID"
|
||||
)}: ${PurchasedFrom}<br/>${this.$ay.t(
|
||||
"UnitPurchasedDate"
|
||||
@@ -536,11 +518,11 @@ export default {
|
||||
RecentWorkOrderList = "-";
|
||||
}
|
||||
|
||||
let RecentWorkOrderInfo = `${this.$ay.t(
|
||||
const RecentWorkOrderInfo = `${this.$ay.t(
|
||||
"RecentWorkOrders"
|
||||
)}:${RecentWorkOrderList}`;
|
||||
|
||||
let d = `<div>${WarrantyInfo}<br/>${PurchaseInfo}<br/>${RecentWorkOrderInfo}</div>`;
|
||||
const d = `<div>${WarrantyInfo}<br/>${PurchaseInfo}<br/>${RecentWorkOrderInfo}</div>`;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].units[
|
||||
this.activeItemIndex
|
||||
@@ -561,7 +543,7 @@ export default {
|
||||
this.selectedBulkUnits.splice(0);
|
||||
this.availableBulkUnits.splice(0);
|
||||
|
||||
let res = await window.$gz.api.post(`unit/bulk-add-selection-list`, {
|
||||
const res = await window.$gz.api.post(`unit/bulk-add-selection-list`, {
|
||||
tags: this.selectedBulkUnitTags,
|
||||
restrictToCustomerId: this.selectedBulkUnitCustomer
|
||||
});
|
||||
@@ -610,21 +592,7 @@ export default {
|
||||
await this.updateContractIfApplicable();
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].units.length;
|
||||
// {
|
||||
// "0": {
|
||||
// "id": 53,
|
||||
// "concurrency": 9586762,
|
||||
// "notes": "Aut modi molestias molestiae ipsa id.",
|
||||
// "wiki": null,
|
||||
// "customFields": null,
|
||||
// "tags": [],
|
||||
// "unitId": 4,
|
||||
// "unitViz": "83429560",
|
||||
// "pmItemId": 22
|
||||
// }
|
||||
// }
|
||||
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].units.length;
|
||||
this.value.items[this.activeWoItemIndex].units.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
@@ -699,11 +667,6 @@ export default {
|
||||
this.activeItemIndex
|
||||
].isDirty = true;
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
|
||||
// //set viz if applicable
|
||||
// if(ref==""){
|
||||
// let selectedPartWarehouse = vm.$refs.partWarehouseId.getFullSelectionValue();
|
||||
// }
|
||||
}
|
||||
},
|
||||
itemRowClasses: function(item) {
|
||||
@@ -745,11 +708,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemUnit")) {
|
||||
headers.push({
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<div v-if="value != null" class="mt-8">
|
||||
<v-row>
|
||||
<!-- Title and menu -->
|
||||
<v-col cols="12">
|
||||
<v-menu offset-y max-width="600px">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
@@ -613,10 +612,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
import GzPMItemUnits from "../components/pm-item-units.vue";
|
||||
import GzPMItemScheduledUsers from "../components/pm-item-scheduled-users.vue";
|
||||
import GzPMItemLabors from "../components/pm-item-labors.vue";
|
||||
@@ -674,7 +669,7 @@ export default {
|
||||
watch: {
|
||||
goto(val, oldVal) {
|
||||
if (val != oldVal) {
|
||||
let navto = { woitemindex: null, childindex: null };
|
||||
const navto = { woitemindex: null, childindex: null };
|
||||
//find the item in question then trigger the nav
|
||||
let keepgoing = true;
|
||||
this.value.items.forEach((z, itemindex) => {
|
||||
@@ -822,7 +817,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
newItem() {
|
||||
let newIndex = this.value.items.length;
|
||||
const newIndex = this.value.items.length;
|
||||
|
||||
this.value.items.push({
|
||||
id: 0,
|
||||
@@ -861,7 +856,7 @@ export default {
|
||||
},
|
||||
newSubItem(atype) {
|
||||
//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());
|
||||
const newId = -Math.abs(Date.now());
|
||||
switch (atype) {
|
||||
case window.$gz.type.WorkOrderItemOutsideService:
|
||||
this.gotoOutsideServiceIndex = newId;
|
||||
@@ -968,7 +963,7 @@ export default {
|
||||
return this.value.items[this.activeItemIndex].deleted === true;
|
||||
},
|
||||
headerList: function() {
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemSequence")) {
|
||||
headers.push({
|
||||
|
||||
@@ -473,9 +473,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
import GzQuoteState from "./quote-state.vue";
|
||||
import GzWoAddress from "./work-order-address.vue";
|
||||
export default {
|
||||
|
||||
@@ -437,10 +437,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -506,7 +502,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].expenses.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].expenses.length;
|
||||
|
||||
//#################################### IMPORTANT ##################################################
|
||||
//NOTE: default values are critical and must match server validation ExpenseValidateAsync for restricted users
|
||||
@@ -586,11 +582,6 @@ export default {
|
||||
this.activeItemIndex
|
||||
].isDirty = true;
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
|
||||
// //set viz if applicable
|
||||
// if(ref==""){
|
||||
// let selectedPartWarehouse = vm.$refs.partWarehouseId.getFullSelectionValue();
|
||||
// }
|
||||
}
|
||||
},
|
||||
itemRowClasses: function(item) {
|
||||
@@ -633,11 +624,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemExpenseName")) {
|
||||
headers.push({
|
||||
|
||||
@@ -439,10 +439,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -526,7 +522,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].labors.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].labors.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].labors.push({
|
||||
id: 0,
|
||||
@@ -723,11 +719,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemLaborServiceStartDate")) {
|
||||
headers.push({
|
||||
|
||||
@@ -409,10 +409,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -484,7 +480,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].loans.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].loans.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].loans.push({
|
||||
id: 0,
|
||||
@@ -606,11 +602,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemLoanUnit")) {
|
||||
headers.push({
|
||||
|
||||
@@ -591,10 +591,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -669,7 +665,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].outsideServices
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].outsideServices
|
||||
.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].outsideServices.push({
|
||||
@@ -801,11 +797,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemOutsideServiceUnit")) {
|
||||
headers.push({
|
||||
|
||||
@@ -465,10 +465,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -561,7 +557,7 @@ export default {
|
||||
if (!partId || partId == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`part/serials/${partId}`);
|
||||
const res = await window.$gz.api.get(`part/serials/${partId}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -598,7 +594,7 @@ export default {
|
||||
this.$emit("change");
|
||||
},
|
||||
async addPartAssembly() {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
`part-assembly/${this.selectedPartAssembly}`
|
||||
);
|
||||
if (res.data && res.data.items) {
|
||||
@@ -713,7 +709,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].parts.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].parts.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].parts.push({
|
||||
id: 0,
|
||||
@@ -861,11 +857,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemPartPartID")) {
|
||||
headers.push({
|
||||
|
||||
@@ -303,10 +303,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -407,7 +403,7 @@ export default {
|
||||
].serviceRateViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].scheduledUsers
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].scheduledUsers
|
||||
.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].scheduledUsers.push({
|
||||
@@ -600,11 +596,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemScheduledUserStartDate")) {
|
||||
headers.push({
|
||||
|
||||
@@ -311,10 +311,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -371,7 +367,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async addTaskGroup() {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
`task-group/${this.selectedTaskGroup}`
|
||||
);
|
||||
if (res.data && res.data.items) {
|
||||
@@ -390,7 +386,7 @@ export default {
|
||||
this.value.items[this.activeWoItemIndex].tasks.splice(0, 1);
|
||||
}
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].tasks.length;
|
||||
let incompleteViz = this.pvm.selectLists.woItemTaskCompletionTypes.find(
|
||||
const incompleteViz = this.pvm.selectLists.woItemTaskCompletionTypes.find(
|
||||
s => s.id == 1 //incomplete
|
||||
).name;
|
||||
res.data.items.forEach(z => {
|
||||
@@ -442,7 +438,7 @@ export default {
|
||||
}
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].tasks.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].tasks.length;
|
||||
this.value.items[this.activeWoItemIndex].tasks.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
@@ -556,11 +552,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemTaskSequence")) {
|
||||
headers.push({
|
||||
|
||||
@@ -470,10 +470,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -543,7 +539,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].travels.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].travels.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].travels.push({
|
||||
id: 0,
|
||||
@@ -741,11 +737,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemTravelStartDate")) {
|
||||
headers.push({
|
||||
|
||||
@@ -338,10 +338,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -412,7 +408,7 @@ export default {
|
||||
if (!id || id == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`unit/active-contract/${id}`);
|
||||
const res = await window.$gz.api.get(`unit/active-contract/${id}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -434,7 +430,7 @@ export default {
|
||||
.t("ApplyUnitContract")
|
||||
.replace("{0}", res.data.name);
|
||||
|
||||
let dialogResult = await window.$gz.dialog.confirmGenericPreTranslated(
|
||||
const dialogResult = await window.$gz.dialog.confirmGenericPreTranslated(
|
||||
prompt,
|
||||
"question"
|
||||
);
|
||||
@@ -457,27 +453,13 @@ export default {
|
||||
if (!id || id == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`unit/service-warranty-info/${id}`);
|
||||
const res = await window.$gz.api.get(`unit/service-warranty-info/${id}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
window.$gz.errorHandler.errorToString(res, this)
|
||||
);
|
||||
} else {
|
||||
/* {
|
||||
"recentWorkOrders":[{"serial":10,"id":10,"serviceDate":"2021-01-19T22:00:00Z"},{"serial":8,"id":8,"serviceDate":"2021-04-08T22:00:00Z"},{"serial":7,"id":7,"serviceDate":"2021-04-18T20:00:00Z"}],
|
||||
"purchaseDate":"2019-03-12T09:37:52.930923Z",
|
||||
"purchasedFromVendor":null,
|
||||
"purchaseFromVendorId":null,
|
||||
"purchaseReceiptNumber":"139736",
|
||||
"lifeTimeWarranty":false,
|
||||
"warrantyExpiryDate":"2019-04-12T09:37:52.930923Z",
|
||||
"warrantyTerms":"Shipping parts and service"}
|
||||
|
||||
"UnitPurchasedDate": "Purchased Date",
|
||||
"UnitPurchaseFromID": "Purchased From",
|
||||
"UnitReceipt": "Receipt Number",
|
||||
*/
|
||||
const r = res.data;
|
||||
|
||||
let WarrantyInfo = `${this.$ay.t("Warranty")}: `;
|
||||
@@ -511,7 +493,7 @@ export default {
|
||||
this.pvm.hour12
|
||||
);
|
||||
}
|
||||
let PurchaseInfo = `${this.$ay.t(
|
||||
const PurchaseInfo = `${this.$ay.t(
|
||||
"UnitPurchaseFromID"
|
||||
)}: ${PurchasedFrom}<br/>${this.$ay.t(
|
||||
"UnitPurchasedDate"
|
||||
@@ -536,11 +518,11 @@ export default {
|
||||
RecentWorkOrderList = "-";
|
||||
}
|
||||
|
||||
let RecentWorkOrderInfo = `${this.$ay.t(
|
||||
const RecentWorkOrderInfo = `${this.$ay.t(
|
||||
"RecentWorkOrders"
|
||||
)}:${RecentWorkOrderList}`;
|
||||
|
||||
let d = `<div>${WarrantyInfo}<br/>${PurchaseInfo}<br/>${RecentWorkOrderInfo}</div>`;
|
||||
const d = `<div>${WarrantyInfo}<br/>${PurchaseInfo}<br/>${RecentWorkOrderInfo}</div>`;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].units[
|
||||
this.activeItemIndex
|
||||
@@ -561,7 +543,7 @@ export default {
|
||||
this.selectedBulkUnits.splice(0);
|
||||
this.availableBulkUnits.splice(0);
|
||||
|
||||
let res = await window.$gz.api.post(`unit/bulk-add-selection-list`, {
|
||||
const res = await window.$gz.api.post(`unit/bulk-add-selection-list`, {
|
||||
tags: this.selectedBulkUnitTags,
|
||||
restrictToCustomerId: this.selectedBulkUnitCustomer
|
||||
});
|
||||
@@ -610,20 +592,7 @@ export default {
|
||||
await this.updateContractIfApplicable();
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].units.length;
|
||||
// {
|
||||
// "0": {
|
||||
// "id": 53,
|
||||
// "concurrency": 9586762,
|
||||
// "notes": "Aut modi molestias molestiae ipsa id.",
|
||||
// "wiki": null,
|
||||
// "customFields": null,
|
||||
// "tags": [],
|
||||
// "unitId": 4,
|
||||
// "unitViz": "83429560",
|
||||
// "quoteItemId": 22
|
||||
// }
|
||||
// }
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].units.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].units.push({
|
||||
id: 0,
|
||||
@@ -699,11 +668,6 @@ export default {
|
||||
this.activeItemIndex
|
||||
].isDirty = true;
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
|
||||
// //set viz if applicable
|
||||
// if(ref==""){
|
||||
// let selectedPartWarehouse = vm.$refs.partWarehouseId.getFullSelectionValue();
|
||||
// }
|
||||
}
|
||||
},
|
||||
itemRowClasses: function(item) {
|
||||
@@ -745,11 +709,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemUnit")) {
|
||||
headers.push({
|
||||
|
||||
@@ -613,10 +613,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
import GzQuoteItemUnits from "../components/quote-item-units.vue";
|
||||
import GzQuoteItemScheduledUsers from "../components/quote-item-scheduled-users.vue";
|
||||
import GzQuoteItemLabors from "../components/quote-item-labors.vue";
|
||||
@@ -674,7 +670,7 @@ export default {
|
||||
watch: {
|
||||
goto(val, oldVal) {
|
||||
if (val != oldVal) {
|
||||
let navto = { woitemindex: null, childindex: null };
|
||||
const navto = { woitemindex: null, childindex: null };
|
||||
//find the item in question then trigger the nav
|
||||
let keepgoing = true;
|
||||
this.value.items.forEach((z, itemindex) => {
|
||||
@@ -822,7 +818,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
newItem() {
|
||||
let newIndex = this.value.items.length;
|
||||
const newIndex = this.value.items.length;
|
||||
|
||||
this.value.items.push({
|
||||
id: 0,
|
||||
@@ -861,7 +857,7 @@ export default {
|
||||
},
|
||||
newSubItem(atype) {
|
||||
//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());
|
||||
const newId = -Math.abs(Date.now());
|
||||
switch (atype) {
|
||||
case window.$gz.type.WorkOrderItemOutsideService:
|
||||
this.gotoOutsideServiceIndex = newId;
|
||||
@@ -968,7 +964,7 @@ export default {
|
||||
return this.value.items[this.activeItemIndex].deleted === true;
|
||||
},
|
||||
headerList: function() {
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemSequence")) {
|
||||
headers.push({
|
||||
|
||||
@@ -136,10 +136,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -197,7 +193,7 @@ export default {
|
||||
}
|
||||
},
|
||||
getStateForDisplay(state) {
|
||||
let ret = {
|
||||
const ret = {
|
||||
id: Date.now,
|
||||
name: "??",
|
||||
color: "#ffffff",
|
||||
@@ -259,7 +255,7 @@ export default {
|
||||
return this.value.states != null && this.value.states.length > 0;
|
||||
},
|
||||
stateDisplayList() {
|
||||
let ret = [];
|
||||
const ret = [];
|
||||
this.value.states.forEach(z => {
|
||||
ret.push(this.getStateForDisplay(z));
|
||||
});
|
||||
@@ -281,7 +277,7 @@ export default {
|
||||
|
||||
//ok, only thing left to check is if the current user can unlock this
|
||||
//get remove roles required for current state
|
||||
let cs = this.pvm.currentState;
|
||||
const cs = this.pvm.currentState;
|
||||
if (cs.removeRoles == null || cs.removeRoles == 0) {
|
||||
//no state set yet
|
||||
return true;
|
||||
|
||||
@@ -88,27 +88,28 @@ export default {
|
||||
});
|
||||
},
|
||||
async renderReport(reportId, reportName) {
|
||||
let vm = this;
|
||||
if (vm.$route.params.recordid == 0) {
|
||||
if (this.$route.params.recordid == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
let reportDataOptions = vm.reportDataOptions;
|
||||
const reportDataOptions = this.reportDataOptions;
|
||||
if (!reportDataOptions) {
|
||||
this.reject("Missing report data unable to render report");
|
||||
}
|
||||
reportDataOptions.ReportId = reportId;
|
||||
//Meta data from client for use by report script
|
||||
reportDataOptions.ClientMeta = window.$gz.api.reportClientMetaData();
|
||||
vm.rendering = true;
|
||||
let url = "report/render";
|
||||
this.rendering = true;
|
||||
|
||||
let res = await window.$gz.api.upsert(url, reportDataOptions);
|
||||
vm.rendering = false;
|
||||
const res = await window.$gz.api.upsert(
|
||||
"report/render",
|
||||
reportDataOptions
|
||||
);
|
||||
this.rendering = false;
|
||||
if (res.error) {
|
||||
this.reject(res);
|
||||
} else {
|
||||
let reportUrl = window.$gz.api.reportDownloadUrl(res.data);
|
||||
const reportUrl = window.$gz.api.reportDownloadUrl(res.data);
|
||||
if (window.open(reportUrl, "Report") == null) {
|
||||
this.reject(
|
||||
"Problem displaying report in new window. Browser must allow pop-ups to view reports; check your browser setting"
|
||||
@@ -123,7 +124,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async open(reportDataOptions, preSelectReportId) {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
if (reportDataOptions == null) {
|
||||
throw new Error("report-selector:Open missing reportDataOptions");
|
||||
}
|
||||
@@ -135,7 +136,7 @@ export default {
|
||||
this.preSelectReportId = preSelectReportId;
|
||||
if (!preSelectReportId) {
|
||||
//get report list from server
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
`report/list/${reportDataOptions.AType}`
|
||||
);
|
||||
if (res.error) {
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
></v-select>
|
||||
</template>
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
export default {
|
||||
async created() {
|
||||
await window.$gz.enums.fetchEnumList("AuthorizationRoles");
|
||||
let rawRoles = window.$gz.enums.getSelectionList("AuthorizationRoles");
|
||||
const rawRoles = window.$gz.enums.getSelectionList("AuthorizationRoles");
|
||||
if (this.limitSelectionTo == null) {
|
||||
this.availableRoles = rawRoles;
|
||||
} else {
|
||||
@@ -55,10 +54,10 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
selectedValue() {
|
||||
let ret = [];
|
||||
const ret = [];
|
||||
if (this.value != null && this.value != 0) {
|
||||
for (let i = 0; i < this.availableRoles.length; i++) {
|
||||
let role = this.availableRoles[i];
|
||||
const role = this.availableRoles[i];
|
||||
if (!!(this.value & role.id)) {
|
||||
ret.push(role.id);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ export default {
|
||||
let newValue = 0;
|
||||
if (value != null && value != [] && value.length > 0) {
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
let role = value[i];
|
||||
const role = value[i];
|
||||
newValue = newValue | role;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,26 +32,10 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* eslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
//this was the original code that was working for months, even years then suddenly stopped working after a vue update
|
||||
// beforeUpdate() {
|
||||
// console.log("TAG-PICKER: beforeupdate called");
|
||||
// //Set the initial list items based on the record items, this only needs to be called once at init
|
||||
// if (!this.initialized && this.value != null && this.value.length > 0) {
|
||||
// console.log("TAG-PICKER: beforeupdate init in if statement");
|
||||
// this.sourcetags = this.value;
|
||||
// this.initialized = true;
|
||||
// }
|
||||
// },
|
||||
created() {
|
||||
|
||||
//Set the initial list items based on the record items, this only needs to be called once at init
|
||||
if (!this.initialized && this.value != null && this.value.length > 0) {
|
||||
|
||||
this.sourcetags = this.value;
|
||||
this.initialized = true;
|
||||
}
|
||||
@@ -66,25 +50,29 @@ export default {
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
default: [],
|
||||
default() {
|
||||
return [];
|
||||
},
|
||||
type: Array
|
||||
},
|
||||
// value: Array,
|
||||
label: String,
|
||||
label: {
|
||||
type: String,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
readonly: { type: Boolean, default: false },
|
||||
rules: { type: Array, default: undefined },
|
||||
errorMessages: { type: Array, default: null }
|
||||
},
|
||||
watch: {
|
||||
async tagSearchEntry(val) {
|
||||
let vm = this;
|
||||
if (!val || vm.tagSearchUnderway) {
|
||||
if (!val || this.tagSearchUnderway) {
|
||||
return;
|
||||
}
|
||||
vm.tagSearchUnderway = true;
|
||||
this.tagSearchUnderway = true;
|
||||
try {
|
||||
let res = await window.$gz.api.get("tag-list/list?query=" + val); //roles
|
||||
|
||||
const res = await window.$gz.api.get("tag-list/list?query=" + val);
|
||||
//We never expect there to be no data here
|
||||
if (!res.hasOwnProperty("data")) {
|
||||
throw new Error(res);
|
||||
@@ -92,8 +80,8 @@ export default {
|
||||
//adding this to the property will automatically have it cached by the autocomplete component
|
||||
//as cache-items has been set so this just needs to be set here once and all is well in future
|
||||
//Any search will be kept for later so this is very efficient
|
||||
vm.sourcetags = res.data;
|
||||
vm.tagSearchUnderway = false;
|
||||
this.sourcetags = res.data;
|
||||
this.tagSearchUnderway = false;
|
||||
} catch (err) {
|
||||
window.$gz.errorHandler.handleFormError(err);
|
||||
}
|
||||
@@ -112,8 +100,8 @@ export default {
|
||||
if (this.tagSearchEntry == null || this.tagSearchEntry == "") {
|
||||
return false;
|
||||
}
|
||||
let searchTag = this.normalizeTag(this.tagSearchEntry);
|
||||
if (this.value.some((z) => z == searchTag)) return false;
|
||||
const searchTag = this.normalizeTag(this.tagSearchEntry);
|
||||
if (this.value.some(z => z == searchTag)) return false;
|
||||
return true;
|
||||
},
|
||||
input(e) {
|
||||
|
||||
@@ -57,17 +57,14 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
//NOTE: this control also captures the date even though it's time only
|
||||
//this is an intentional design decision to support field change to date or date AND time and is considered a display issue
|
||||
export default {
|
||||
data: () => ({
|
||||
dlgtime: false,
|
||||
//cache display format stuff
|
||||
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
|
||||
languageName: window.$gz.locale.getResolvedLanguage(),
|
||||
hour12: window.$gz.locale.getHour12()
|
||||
// defaultLocale: window.$gz.locale.g etBrowserFirstLanguage().split("-", 1)[0]
|
||||
}),
|
||||
props: {
|
||||
label: { type: String, default: null },
|
||||
@@ -97,7 +94,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
setNow() {
|
||||
let v = window.$gz.locale
|
||||
const v = window.$gz.locale
|
||||
.nowUTC8601String(this.timeZoneName)
|
||||
.split("T")[1];
|
||||
this.updateTimeValue(v);
|
||||
@@ -123,11 +120,11 @@ export default {
|
||||
this.updateValue(this.dateValue, v);
|
||||
},
|
||||
updateValue(theDate, theTime) {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
|
||||
if (!theDate) {
|
||||
let v = new Date();
|
||||
let fullYear = v.getFullYear();
|
||||
const v = new Date();
|
||||
const fullYear = v.getFullYear();
|
||||
let fullMonth = v.getMonth() + 1;
|
||||
if (fullMonth < 10) {
|
||||
fullMonth = "0" + fullMonth.toString();
|
||||
@@ -138,12 +135,10 @@ export default {
|
||||
}
|
||||
theDate = fullYear + "-" + fullMonth + "-" + fullDay;
|
||||
}
|
||||
|
||||
if (!theTime) {
|
||||
theTime = "00:00:00";
|
||||
}
|
||||
|
||||
let ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
const ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
theDate + "T" + theTime,
|
||||
vm.timeZoneName
|
||||
);
|
||||
|
||||
@@ -23,20 +23,16 @@
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
//==========================================
|
||||
//==========================================
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
timeZoneName: window.$gz.locale.getResolvedTimeZoneName()
|
||||
};
|
||||
},
|
||||
|
||||
props: {
|
||||
label: { type: String, default: null },
|
||||
rules: { type: Array, default: undefined},
|
||||
rules: { type: Array, default: undefined },
|
||||
errorMessages: { type: Array, default: null },
|
||||
value: { type: String, default: null },
|
||||
readonly: { type: Boolean, default: false },
|
||||
@@ -61,14 +57,13 @@ export default {
|
||||
);
|
||||
},
|
||||
updateValue() {
|
||||
let vm = this;
|
||||
let dateValue = window.$gz.locale.utcDateStringToLocal8601DateOnlyString(
|
||||
vm.value,
|
||||
vm.timeZoneName
|
||||
this.value,
|
||||
this.timeZoneName
|
||||
);
|
||||
if (!dateValue) {
|
||||
let v = new Date();
|
||||
let fullYear = v.getFullYear();
|
||||
const v = new Date();
|
||||
const fullYear = v.getFullYear();
|
||||
let fullMonth = v.getMonth() + 1;
|
||||
if (fullMonth < 10) {
|
||||
fullMonth = "0" + fullMonth.toString();
|
||||
@@ -79,17 +74,15 @@ export default {
|
||||
}
|
||||
dateValue = fullYear + "-" + fullMonth + "-" + fullDay;
|
||||
}
|
||||
|
||||
let timeValue = vm.$refs.timeField.$refs.input.value;
|
||||
let timeValue = this.$refs.timeField.$refs.input.value;
|
||||
if (!timeValue) {
|
||||
timeValue = "00:00:00";
|
||||
}
|
||||
|
||||
let ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
const ret = window.$gz.locale.localTimeDateStringToUTC8601String(
|
||||
dateValue + "T" + timeValue,
|
||||
vm.timeZoneName
|
||||
this.timeZoneName
|
||||
);
|
||||
vm.$emit("input", ret);
|
||||
this.$emit("input", ret);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -333,7 +333,6 @@
|
||||
<script>
|
||||
import marked from "marked";
|
||||
import DOMPurify from "dompurify";
|
||||
|
||||
export default {
|
||||
created() {
|
||||
// Add a hook to make all links open a new window
|
||||
@@ -355,7 +354,6 @@ export default {
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
//cleanup
|
||||
DOMPurify.removeAllHooks();
|
||||
},
|
||||
data() {
|
||||
@@ -420,14 +418,16 @@ export default {
|
||||
return "";
|
||||
}
|
||||
//replace attachment urls with tokenized local urls
|
||||
let src = this.localVal.replace(/\[ATTACH:(.*)\]/g, function(match, p1) {
|
||||
const src = this.localVal.replace(/\[ATTACH:(.*)\]/g, function(
|
||||
match,
|
||||
p1
|
||||
) {
|
||||
return window.$gz.api.attachmentDownloadUrl(p1);
|
||||
});
|
||||
|
||||
return DOMPurify.sanitize(marked(src, { breaks: true }));
|
||||
},
|
||||
onResize() {
|
||||
// this.editAreaHeight = window.innerHeight / 2;
|
||||
this.editAreaHeight = window.innerHeight * 0.8;
|
||||
},
|
||||
toggleReveal() {
|
||||
@@ -451,10 +451,9 @@ export default {
|
||||
}
|
||||
},
|
||||
getSelectedRange(forceBlock) {
|
||||
let bodyTextArea = this.$refs.editArea.$el.querySelector("textarea");
|
||||
const bodyTextArea = this.$refs.editArea.$el.querySelector("textarea");
|
||||
this.selection.start = bodyTextArea.selectionStart;
|
||||
this.selection.end = bodyTextArea.selectionEnd;
|
||||
|
||||
//some edits only work on a block so if user is just clicked on a line then add make a selection
|
||||
if (forceBlock) {
|
||||
//add a character to selection forward if possible but if not then go backward one
|
||||
@@ -474,7 +473,7 @@ export default {
|
||||
this.selection.startOfBlock = this.selection.start;
|
||||
if (this.selection.start > 0) {
|
||||
//find linefeed prior to current start
|
||||
let indexOfLineFeed = this.localVal.lastIndexOf(
|
||||
const indexOfLineFeed = this.localVal.lastIndexOf(
|
||||
"\n",
|
||||
this.selection.start
|
||||
);
|
||||
@@ -491,14 +490,14 @@ export default {
|
||||
this.selection.endOfBlock = this.selection.end;
|
||||
if (this.selection.end > 0) {
|
||||
//find linefeed prior to current start
|
||||
let indexOfLineFeed = this.localVal.indexOf("\n", this.selection.end);
|
||||
const indexOfLineFeed = this.localVal.indexOf("\n", this.selection.end);
|
||||
if (indexOfLineFeed != -1) {
|
||||
this.selection.endOfBlock = indexOfLineFeed;
|
||||
}
|
||||
}
|
||||
},
|
||||
setSelectedRange(start, end) {
|
||||
let bodyTextArea = this.$refs.editArea.$el.querySelector("textarea");
|
||||
const bodyTextArea = this.$refs.editArea.$el.querySelector("textarea");
|
||||
bodyTextArea.setSelectionRange(start, end);
|
||||
},
|
||||
getSelectedText() {
|
||||
@@ -545,9 +544,9 @@ export default {
|
||||
//the purpose of this is only to change the selection if it's got an extra space to the right
|
||||
//because double clicking on a word with another word after it causes the space to be included
|
||||
this.getSelectedRange();
|
||||
let temp = this.getSelectedText();
|
||||
let tempTrimmed = temp.trimEnd();
|
||||
let diff = temp.length - tempTrimmed.length;
|
||||
const temp = this.getSelectedText();
|
||||
const tempTrimmed = temp.trimEnd();
|
||||
const diff = temp.length - tempTrimmed.length;
|
||||
if (diff != 0) {
|
||||
//there were some spaces so update the selection range
|
||||
//force selection to be shorter by diff
|
||||
@@ -568,7 +567,6 @@ export default {
|
||||
} else {
|
||||
return "$ayiEyeSlash";
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this.currentView) {
|
||||
@@ -646,7 +644,7 @@ export default {
|
||||
case "heading":
|
||||
{
|
||||
this.getSelectedRange(true); //special forces
|
||||
let prepend = "#".repeat(ex) + " ";
|
||||
const prepend = "#".repeat(ex) + " ";
|
||||
let s = this.getSelectedBlock();
|
||||
s = s.replace(/\n/gi, "\n" + prepend);
|
||||
if (s.length > 0 && s[0] != "\n") {
|
||||
@@ -688,7 +686,7 @@ export default {
|
||||
case "ol":
|
||||
{
|
||||
if (this.selection.hasSelection) {
|
||||
let s = this.getSelectedBlock();
|
||||
const s = this.getSelectedBlock();
|
||||
let ret = "\n1. ";
|
||||
let listItem = 1;
|
||||
for (let i = 0; i < s.length; i++) {
|
||||
@@ -769,7 +767,7 @@ export default {
|
||||
if (!url.includes(":")) {
|
||||
url = "https://" + url;
|
||||
}
|
||||
let t = "[" + this.linkText + "](" + url + ")";
|
||||
const t = "[" + this.linkText + "](" + url + ")";
|
||||
// [MY Awesome LINK](www.ayanova.com)
|
||||
this.replaceSelectedText(t);
|
||||
}
|
||||
@@ -801,7 +799,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
let txt = this.imageText;
|
||||
const txt = this.imageText;
|
||||
//force it to a full url so it doesn't attempt to open it as a SPA window
|
||||
if (!url.includes(":")) {
|
||||
url = "https://" + url;
|
||||
@@ -819,11 +817,7 @@ export default {
|
||||
break;
|
||||
default:
|
||||
throw new Error(`wiki-control: ${editType} NOT IMPLEMENTED`);
|
||||
break;
|
||||
}
|
||||
|
||||
// //emit input event to parent form for dirty tracking
|
||||
// this.handleInput(this.localVal);
|
||||
},
|
||||
openLinkMenu(e) {
|
||||
e.preventDefault();
|
||||
@@ -848,18 +842,18 @@ export default {
|
||||
});
|
||||
},
|
||||
async getAttachments() {
|
||||
let vm = this;
|
||||
const vm = this;
|
||||
try {
|
||||
vm.attachments = [];
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
"attachment/list?ayatype=" + vm.ayaType + "&ayaid=" + vm.ayaId
|
||||
);
|
||||
if (res.error) {
|
||||
window.$gz.errorHandler.handleFormError(res.error);
|
||||
} else {
|
||||
let ret = [];
|
||||
const ret = [];
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
let o = res.data[i];
|
||||
const o = res.data[i];
|
||||
|
||||
if (
|
||||
window.$gz.util.isImageAttachment(
|
||||
@@ -884,22 +878,22 @@ export default {
|
||||
},
|
||||
async upload() {
|
||||
//similar code in attachment-control upload
|
||||
let vm = this;
|
||||
let at = {
|
||||
const vm = this;
|
||||
const at = {
|
||||
ayaId: vm.ayaId,
|
||||
ayaType: vm.ayaType,
|
||||
files: vm.uploadFiles,
|
||||
notes: ""
|
||||
};
|
||||
try {
|
||||
let res = await window.$gz.api.uploadAttachment(at);
|
||||
const res = await window.$gz.api.uploadAttachment(at);
|
||||
|
||||
if (res.error) {
|
||||
window.$gz.errorHandler.handleFormError(res.error);
|
||||
} else {
|
||||
let ret = [];
|
||||
const ret = [];
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
let o = res.data[i];
|
||||
const o = res.data[i];
|
||||
|
||||
//let them attach any file type to the wiki since it supports it anyway
|
||||
ret.push({
|
||||
@@ -914,9 +908,9 @@ export default {
|
||||
//NOW iterate upload files list and insert into wiki based on attachments
|
||||
//insert into wiki
|
||||
for (let i = 0; i < vm.uploadFiles.length; i++) {
|
||||
let upFile = vm.uploadFiles[i];
|
||||
const upFile = vm.uploadFiles[i];
|
||||
for (let j = 0; j < vm.attachments.length; j++) {
|
||||
let atFile = vm.attachments[j];
|
||||
const atFile = vm.attachments[j];
|
||||
if (upFile.name == atFile.name) {
|
||||
//found it
|
||||
this.insertUrl(atFile.url, atFile.name);
|
||||
@@ -944,7 +938,7 @@ export default {
|
||||
//if an image then put it directly in viewable, if not an image then make a link and keep as an attach
|
||||
} else {
|
||||
//maybe an url?
|
||||
let url = ev.dataTransfer.getData("text");
|
||||
const url = ev.dataTransfer.getData("text");
|
||||
this.insertUrl(url);
|
||||
}
|
||||
},
|
||||
@@ -956,7 +950,7 @@ export default {
|
||||
//it's an attachment url so fixup accordingly
|
||||
//i paramter added by gzapi::attachmentDownloadUrl function
|
||||
isImageUrl = url.includes("&i=");
|
||||
let m = url.match(/attachment\/download\/(.*)\?t=/);
|
||||
const m = url.match(/attachment\/download\/(.*)\?t=/);
|
||||
if (m.length > 1) {
|
||||
url = "[ATTACH:" + m[1] + "]";
|
||||
} else {
|
||||
@@ -993,12 +987,8 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//handle accordingly
|
||||
}
|
||||
}
|
||||
|
||||
//----------end methods----------
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -351,20 +351,15 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
openDialog: false,
|
||||
openSelectDialog: false,
|
||||
selectType: 1, //1==service / physical, 2==billing / postal
|
||||
alternateAddresses: [] //{objectName:"NAME-Type",addressViz:"summary",addressFields:{address:aaa,city:aaa,region:aaa,country:ccc, code:ccc, lat:lll, long:lll}}
|
||||
selectType: 1,
|
||||
alternateAddresses: []
|
||||
};
|
||||
},
|
||||
|
||||
props: {
|
||||
value: {
|
||||
default: null,
|
||||
@@ -374,7 +369,6 @@ export default {
|
||||
default: null,
|
||||
type: Object
|
||||
},
|
||||
|
||||
formKey: { type: String, default: "" }, //used to grab template from store
|
||||
readonly: Boolean,
|
||||
disabled: Boolean
|
||||
@@ -471,17 +465,17 @@ export default {
|
||||
window.$gz.util.copyToClipboard(ret);
|
||||
/* todo maybe down the road if asked for?
|
||||
|
||||
if(mAddressType==AddressTypes.Physical)
|
||||
{
|
||||
if(mLatitude!=0 || mLongitude!=0)
|
||||
{
|
||||
sb.Append(" \r\n");
|
||||
sb.Append(LongitudeToString(mLongitude));
|
||||
sb.Append(" ");
|
||||
sb.Append(LatitudeToString(mLatitude));
|
||||
sb.Append(" \r\n");
|
||||
}
|
||||
} */
|
||||
if(mAddressType==AddressTypes.Physical)
|
||||
{
|
||||
if(mLatitude!=0 || mLongitude!=0)
|
||||
{
|
||||
sb.Append(" \r\n");
|
||||
sb.Append(LongitudeToString(mLongitude));
|
||||
sb.Append(" ");
|
||||
sb.Append(LatitudeToString(mLatitude));
|
||||
sb.Append(" \r\n");
|
||||
}
|
||||
} */
|
||||
},
|
||||
AddressCopyPostalToClipBoard() {
|
||||
let ret = "";
|
||||
@@ -512,14 +506,13 @@ export default {
|
||||
},
|
||||
async GeoCapture() {
|
||||
try {
|
||||
//window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||
let loc = await window.$gz.util.getGeoLocation();
|
||||
const loc = await window.$gz.util.getGeoLocation();
|
||||
this.value.latitude = loc.latitude;
|
||||
this.fieldValueChanged("latitude");
|
||||
this.value.longitude = loc.longitude;
|
||||
this.fieldValueChanged("longitude");
|
||||
} catch (ex) {
|
||||
//window.$gz.errorHandler.handleFormError(ex, vm);
|
||||
//could fail on some platforms
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -547,7 +540,7 @@ async function populateAlternateAddresses(vm) {
|
||||
const ispostal = vm.selectType == 2;
|
||||
const wo = vm.value;
|
||||
if (wo.customerId != null) {
|
||||
let res = await window.$gz.api.get(`customer/address/${wo.customerId}`);
|
||||
const res = await window.$gz.api.get(`customer/address/${wo.customerId}`);
|
||||
if (res.data) {
|
||||
//customer first
|
||||
if (ispostal) {
|
||||
@@ -579,13 +572,13 @@ async function populateAlternateAddresses(vm) {
|
||||
//Unit addresses
|
||||
//Units only have physical addresses
|
||||
if (!ispostal) {
|
||||
let unitIdList = [];
|
||||
const unitIdList = [];
|
||||
vm.value.items.forEach(i => {
|
||||
i.units.forEach(async u => {
|
||||
if (u.unitId != null && !unitIdList.includes(u.unitId)) {
|
||||
unitIdList.push(u.unitId);
|
||||
//get address
|
||||
let res = await window.$gz.api.get(`unit/address/${u.unitId}`);
|
||||
const res = await window.$gz.api.get(`unit/address/${u.unitId}`);
|
||||
if (res.data) {
|
||||
vm.alternateAddresses.push({
|
||||
name: res.data.unit.name,
|
||||
@@ -605,7 +598,7 @@ async function populateAlternateAddresses(vm) {
|
||||
//
|
||||
function formatAddress(o) {
|
||||
//Format address(es) as compact as possible
|
||||
let ret = { physical: "", postal: "" };
|
||||
const ret = { physical: "", postal: "" };
|
||||
|
||||
//Physical
|
||||
if (!window.$gz.util.stringIsNullOrEmpty(o.address)) {
|
||||
|
||||
@@ -447,9 +447,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
import GzWoState from "./work-order-state.vue";
|
||||
import GzWoAddress from "./work-order-address.vue";
|
||||
import GzWoSignature from "./work-order-signature.vue";
|
||||
@@ -477,14 +474,12 @@ export default {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
form() {
|
||||
return window.$gz.form;
|
||||
},
|
||||
async fieldValueChanged(ref) {
|
||||
if (!this.formState.loading && !this.formState.readonly) {
|
||||
//flag this record dirty so it gets picked up by save
|
||||
this.value.isDirty = true;
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
}
|
||||
|
||||
@@ -437,10 +437,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -506,7 +502,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].expenses.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].expenses.length;
|
||||
|
||||
//#################################### IMPORTANT ##################################################
|
||||
//NOTE: default values are critical and must match server validation ExpenseValidateAsync for restricted users
|
||||
@@ -586,11 +582,6 @@ export default {
|
||||
this.activeItemIndex
|
||||
].isDirty = true;
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
|
||||
// //set viz if applicable
|
||||
// if(ref==""){
|
||||
// let selectedPartWarehouse = vm.$refs.partWarehouseId.getFullSelectionValue();
|
||||
// }
|
||||
}
|
||||
},
|
||||
itemRowClasses: function(item) {
|
||||
@@ -633,11 +624,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemExpenseName")) {
|
||||
headers.push({
|
||||
|
||||
@@ -439,10 +439,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -526,7 +522,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].labors.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].labors.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].labors.push({
|
||||
id: 0,
|
||||
@@ -723,11 +719,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemLaborServiceStartDate")) {
|
||||
headers.push({
|
||||
|
||||
@@ -413,10 +413,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -488,7 +484,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].loans.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].loans.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].loans.push({
|
||||
id: 0,
|
||||
@@ -610,11 +606,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemLoanUnit")) {
|
||||
headers.push({
|
||||
|
||||
@@ -591,10 +591,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -669,7 +665,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].outsideServices
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].outsideServices
|
||||
.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].outsideServices.push({
|
||||
@@ -801,11 +797,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemOutsideServiceUnit")) {
|
||||
headers.push({
|
||||
|
||||
@@ -89,10 +89,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -190,15 +186,6 @@ export default {
|
||||
form() {
|
||||
return window.$gz.form;
|
||||
},
|
||||
// fieldValueChanged(ref) {
|
||||
// if (!this.formState.loading && !this.formState.readonly) {
|
||||
// //flag this record dirty so it gets picked up by save
|
||||
// this.value.items[this.activeWoItemIndex].partRequests[
|
||||
// this.activeItemIndex
|
||||
// ].isDirty = true;
|
||||
// window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
// }
|
||||
// },
|
||||
itemRowClasses: function(item) {
|
||||
let ret = "";
|
||||
const isDeleted =
|
||||
@@ -241,11 +228,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemPartRequestPartID")) {
|
||||
headers.push({
|
||||
|
||||
@@ -465,10 +465,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -561,7 +557,7 @@ export default {
|
||||
if (!partId || partId == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`part/serials/${partId}`);
|
||||
const res = await window.$gz.api.get(`part/serials/${partId}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -598,7 +594,7 @@ export default {
|
||||
this.$emit("change");
|
||||
},
|
||||
async addPartAssembly() {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
`part-assembly/${this.selectedPartAssembly}`
|
||||
);
|
||||
if (res.data && res.data.items) {
|
||||
@@ -696,7 +692,6 @@ export default {
|
||||
].quantity`);
|
||||
}
|
||||
},
|
||||
|
||||
warehouseChange(newName) {
|
||||
this.value.items[this.activeWoItemIndex].parts[
|
||||
this.activeItemIndex
|
||||
@@ -713,8 +708,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].parts.length;
|
||||
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].parts.length;
|
||||
this.value.items[this.activeWoItemIndex].parts.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
@@ -861,11 +855,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemPartPartID")) {
|
||||
headers.push({
|
||||
|
||||
@@ -303,10 +303,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -407,7 +403,7 @@ export default {
|
||||
].serviceRateViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].scheduledUsers
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].scheduledUsers
|
||||
.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].scheduledUsers.push({
|
||||
@@ -600,11 +596,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemScheduledUserStartDate")) {
|
||||
headers.push({
|
||||
|
||||
@@ -311,10 +311,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -371,7 +367,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async addTaskGroup() {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
`task-group/${this.selectedTaskGroup}`
|
||||
);
|
||||
if (res.data && res.data.items) {
|
||||
@@ -391,7 +387,7 @@ export default {
|
||||
}
|
||||
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].tasks.length;
|
||||
let incompleteViz = this.pvm.selectLists.woItemTaskCompletionTypes.find(
|
||||
const incompleteViz = this.pvm.selectLists.woItemTaskCompletionTypes.find(
|
||||
s => s.id == 1 //incomplete
|
||||
).name;
|
||||
res.data.items.forEach(z => {
|
||||
@@ -443,7 +439,7 @@ export default {
|
||||
}
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].tasks.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].tasks.length;
|
||||
this.value.items[this.activeWoItemIndex].tasks.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
@@ -557,11 +553,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemTaskSequence")) {
|
||||
headers.push({
|
||||
|
||||
@@ -472,10 +472,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -545,7 +541,7 @@ export default {
|
||||
].taxCodeViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].travels.length;
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].travels.length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].travels.push({
|
||||
id: 0,
|
||||
@@ -743,11 +739,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemTravelStartDate")) {
|
||||
headers.push({
|
||||
|
||||
@@ -344,10 +344,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -444,7 +440,7 @@ export default {
|
||||
if (!id || id == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`unit/work-order-info/${id}`);
|
||||
const res = await window.$gz.api.get(`unit/work-order-info/${id}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -469,7 +465,7 @@ export default {
|
||||
.t("ApplyUnitContract")
|
||||
.replace("{0}", res.data.name);
|
||||
|
||||
let dialogResult = await window.$gz.dialog.confirmGenericPreTranslated(
|
||||
const dialogResult = await window.$gz.dialog.confirmGenericPreTranslated(
|
||||
prompt,
|
||||
"question"
|
||||
);
|
||||
@@ -493,27 +489,13 @@ export default {
|
||||
if (!id || id == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`unit/service-warranty-info/${id}`);
|
||||
const res = await window.$gz.api.get(`unit/service-warranty-info/${id}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
window.$gz.errorHandler.errorToString(res, this)
|
||||
);
|
||||
} else {
|
||||
/* {
|
||||
"recentWorkOrders":[{"serial":10,"id":10,"serviceDate":"2021-01-19T22:00:00Z"},{"serial":8,"id":8,"serviceDate":"2021-04-08T22:00:00Z"},{"serial":7,"id":7,"serviceDate":"2021-04-18T20:00:00Z"}],
|
||||
"purchaseDate":"2019-03-12T09:37:52.930923Z",
|
||||
"purchasedFromVendor":null,
|
||||
"purchaseFromVendorId":null,
|
||||
"purchaseReceiptNumber":"139736",
|
||||
"lifeTimeWarranty":false,
|
||||
"warrantyExpiryDate":"2019-04-12T09:37:52.930923Z",
|
||||
"warrantyTerms":"Shipping parts and service"}
|
||||
|
||||
"UnitPurchasedDate": "Purchased Date",
|
||||
"UnitPurchaseFromID": "Purchased From",
|
||||
"UnitReceipt": "Receipt Number",
|
||||
*/
|
||||
const r = res.data;
|
||||
|
||||
let WarrantyInfo = `${this.$ay.t("Warranty")}: `;
|
||||
@@ -547,7 +529,7 @@ export default {
|
||||
this.pvm.hour12
|
||||
);
|
||||
}
|
||||
let PurchaseInfo = `${this.$ay.t(
|
||||
const PurchaseInfo = `${this.$ay.t(
|
||||
"UnitPurchaseFromID"
|
||||
)}: ${PurchasedFrom}<br/>${this.$ay.t(
|
||||
"UnitPurchasedDate"
|
||||
@@ -572,11 +554,11 @@ export default {
|
||||
RecentWorkOrderList = "-";
|
||||
}
|
||||
|
||||
let RecentWorkOrderInfo = `${this.$ay.t(
|
||||
const RecentWorkOrderInfo = `${this.$ay.t(
|
||||
"RecentWorkOrders"
|
||||
)}:${RecentWorkOrderList}`;
|
||||
|
||||
let d = `<div>${WarrantyInfo}<br/>${PurchaseInfo}<br/>${RecentWorkOrderInfo}</div>`;
|
||||
const d = `<div>${WarrantyInfo}<br/>${PurchaseInfo}<br/>${RecentWorkOrderInfo}</div>`;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].units[
|
||||
this.activeItemIndex
|
||||
@@ -597,7 +579,7 @@ export default {
|
||||
this.selectedBulkUnits.splice(0);
|
||||
this.availableBulkUnits.splice(0);
|
||||
|
||||
let res = await window.$gz.api.post(`unit/bulk-add-selection-list`, {
|
||||
const res = await window.$gz.api.post(`unit/bulk-add-selection-list`, {
|
||||
tags: this.selectedBulkUnitTags,
|
||||
restrictToCustomerId: this.selectedBulkUnitCustomer
|
||||
});
|
||||
@@ -646,21 +628,7 @@ export default {
|
||||
await this.handleUnitChange();
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].units.length;
|
||||
// {
|
||||
// "0": {
|
||||
// "id": 53,
|
||||
// "concurrency": 9586762,
|
||||
// "notes": "Aut modi molestias molestiae ipsa id.",
|
||||
// "wiki": null,
|
||||
// "customFields": null,
|
||||
// "tags": [],
|
||||
// "unitId": 4,
|
||||
// "unitViz": "83429560",
|
||||
// "workOrderItemId": 22
|
||||
// }
|
||||
// }
|
||||
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].units.length;
|
||||
this.value.items[this.activeWoItemIndex].units.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
@@ -735,11 +703,6 @@ export default {
|
||||
this.activeItemIndex
|
||||
].isDirty = true;
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
|
||||
// //set viz if applicable
|
||||
// if(ref==""){
|
||||
// let selectedPartWarehouse = vm.$refs.partWarehouseId.getFullSelectionValue();
|
||||
// }
|
||||
}
|
||||
},
|
||||
itemRowClasses: function(item) {
|
||||
@@ -781,11 +744,7 @@ export default {
|
||||
},
|
||||
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemUnit")) {
|
||||
headers.push({
|
||||
|
||||
@@ -1,25 +1,6 @@
|
||||
<template>
|
||||
<div v-if="value != null" class="mt-8">
|
||||
<!-- {{
|
||||
{
|
||||
isRestrictedType: value.userIsRestrictedType,
|
||||
isTechRestricted: value.userIsTechRestricted,
|
||||
subfull: value.userIsSubContractorFull,
|
||||
subRestricted: value.userIsSubContractorRestricted,
|
||||
showLabors: showLabors,
|
||||
showTravels: showTravels,
|
||||
showExpenses: showExpenses,
|
||||
showLoans: showLoans,
|
||||
showOutsideServices: showOutsideServices,
|
||||
showParts: showParts,
|
||||
showPartRequests: showPartRequests,
|
||||
showScheduledUsers: showScheduledUsers,
|
||||
showTasks: showTasks,
|
||||
showUnits: showUnits
|
||||
}
|
||||
}} -->
|
||||
<v-row>
|
||||
<!-- Title and menu -->
|
||||
<v-col cols="12">
|
||||
<v-menu offset-y max-width="600px">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
@@ -708,10 +689,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
import GzWoItemUnits from "../components/work-order-item-units.vue";
|
||||
import GzWoItemScheduledUsers from "../components/work-order-item-scheduled-users.vue";
|
||||
import GzWoItemLabors from "../components/work-order-item-labors.vue";
|
||||
@@ -774,7 +751,7 @@ export default {
|
||||
watch: {
|
||||
goto(val, oldVal) {
|
||||
if (val != oldVal) {
|
||||
let navto = { woitemindex: null, childindex: null };
|
||||
const navto = { woitemindex: null, childindex: null };
|
||||
//find the item in question then trigger the nav
|
||||
let keepgoing = true;
|
||||
this.value.items.forEach((z, itemindex) => {
|
||||
@@ -945,9 +922,9 @@ export default {
|
||||
|
||||
//Self copy to current workorder??
|
||||
if (this.copyItemWoNumber == this.value.serial) {
|
||||
let newIndex = this.value.items.length;
|
||||
const newIndex = this.value.items.length;
|
||||
|
||||
let wi = JSON.parse(
|
||||
const wi = JSON.parse(
|
||||
JSON.stringify(this.value.items[this.activeItemIndex])
|
||||
);
|
||||
|
||||
@@ -965,7 +942,7 @@ export default {
|
||||
}
|
||||
}
|
||||
//get id from number then push open
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
"workorder/id-from-number/" + this.copyItemWoNumber
|
||||
);
|
||||
if (res.error) {
|
||||
@@ -986,7 +963,7 @@ export default {
|
||||
this.copyItemDialog = false;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items.length;
|
||||
const newIndex = this.value.items.length;
|
||||
|
||||
this.value.items.push({
|
||||
id: 0,
|
||||
@@ -1027,7 +1004,7 @@ export default {
|
||||
},
|
||||
newSubItem(atype) {
|
||||
//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());
|
||||
const newId = -Math.abs(Date.now());
|
||||
switch (atype) {
|
||||
case window.$gz.type.WorkOrderItemOutsideService:
|
||||
this.gotoOutsideServiceIndex = newId;
|
||||
@@ -1134,32 +1111,7 @@ export default {
|
||||
return this.value.items[this.activeItemIndex].deleted === true;
|
||||
},
|
||||
headerList: function() {
|
||||
/*
|
||||
public uint Concurrency { get; set; }
|
||||
public string Notes { get; set; }//Was Summary
|
||||
public string Wiki { get; set; }
|
||||
public string CustomFields { get; set; }
|
||||
public List<string> Tags { get; set; } = new List<string>();
|
||||
|
||||
[Required]
|
||||
public long WorkOrderId { get; set; }
|
||||
public string TechNotes { get; set; }
|
||||
public long? WorkOrderItemStatusId { get; set; }
|
||||
public long? WorkOrderItemPriorityId { get; set; }
|
||||
public DateTime RequestDate { get; set; }
|
||||
public bool WarrantyService { get; set; } = false;
|
||||
|
||||
|
||||
IN ORDER: notes, status, date, priority, warranty, tags
|
||||
|
||||
except they will not prefill at server but will be set here since the wo differs from the po in that there is no instant update with new viz fields to populate from server
|
||||
and it's probably not a big list to fill anyway
|
||||
|
||||
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemSequence")) {
|
||||
headers.push({
|
||||
@@ -1229,9 +1181,6 @@ and it's probably not a big list to fill anyway
|
||||
value: "tags"
|
||||
});
|
||||
}
|
||||
|
||||
// headers.push({ text: "", value: "actions" });
|
||||
|
||||
return headers;
|
||||
},
|
||||
itemList: function() {
|
||||
@@ -1365,7 +1314,6 @@ and it's probably not a big list to fill anyway
|
||||
!this.value.userIsSubContractorRestricted
|
||||
);
|
||||
},
|
||||
|
||||
canAddLabor: function() {
|
||||
return this.form().showMe(this, "WorkOrderItemLaborList");
|
||||
},
|
||||
|
||||
@@ -109,15 +109,11 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
import vueSignature from "vue-signature";
|
||||
export default {
|
||||
components: {
|
||||
vueSignature
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
selectedStatus: null,
|
||||
@@ -131,7 +127,6 @@ export default {
|
||||
tempName: null
|
||||
};
|
||||
},
|
||||
|
||||
props: {
|
||||
value: {
|
||||
default: null,
|
||||
@@ -149,7 +144,6 @@ export default {
|
||||
readonly: Boolean,
|
||||
disabled: Boolean
|
||||
},
|
||||
|
||||
methods: {
|
||||
showSign() {
|
||||
if (this.readonly) return;
|
||||
@@ -164,16 +158,13 @@ export default {
|
||||
save() {
|
||||
let svg = this.$refs.sigCtrl.save("image/svg+xml");
|
||||
if (this.$refs.sigCtrl.isEmpty()) {
|
||||
//console.log("IS EMPTY");
|
||||
svg = null;
|
||||
}
|
||||
this.setSig(svg);
|
||||
this.setCaptured(window.$gz.locale.nowUTC8601String());
|
||||
this.setName(this.tempName);
|
||||
//console.log("SVG size IS ", svg == null ? 0 : svg.length);
|
||||
this.value.isDirty = true;
|
||||
this.pvm.formState.dirty = true;
|
||||
|
||||
this.$emit("change");
|
||||
this.openDialog = false;
|
||||
},
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<div class="mb-n2 ml-10">
|
||||
<span class="text-caption">{{ $ay.t("WorkOrderStatus") }}</span>
|
||||
</div>
|
||||
|
||||
<template>
|
||||
<div class="mb-6 mb-sm-0">
|
||||
<v-btn icon class="ml-n1 mr-2" @click="openDialog = true">
|
||||
@@ -22,7 +21,6 @@
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<v-row justify="center">
|
||||
<v-dialog v-model="openDialog" max-width="600px">
|
||||
<v-card>
|
||||
@@ -68,8 +66,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- append-outer-icon="$ayiPlus"
|
||||
@click:append-outer="addState()" -->
|
||||
<template v-if="canAdd">
|
||||
<div class="mt-8">
|
||||
<v-autocomplete
|
||||
@@ -136,10 +132,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -177,12 +169,10 @@ export default {
|
||||
this.value.states = this.value.states.filter(
|
||||
z => z.concurrency != null
|
||||
);
|
||||
|
||||
//is it a different state?
|
||||
if (this.selectedStatus == this.pvm.currentState.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
//push in new state
|
||||
this.value.states.push({
|
||||
workOrderId: this.value.id,
|
||||
@@ -197,7 +187,7 @@ export default {
|
||||
}
|
||||
},
|
||||
getStateForDisplay(state) {
|
||||
let ret = {
|
||||
const ret = {
|
||||
id: Date.now,
|
||||
name: "??",
|
||||
color: "#ffffff",
|
||||
@@ -259,7 +249,7 @@ export default {
|
||||
return this.value.states != null && this.value.states.length > 0;
|
||||
},
|
||||
stateDisplayList() {
|
||||
let ret = [];
|
||||
const ret = [];
|
||||
this.value.states.forEach(z => {
|
||||
ret.push(this.getStateForDisplay(z));
|
||||
});
|
||||
@@ -270,28 +260,23 @@ export default {
|
||||
if (!this.pvm.rights.change) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//not currently locked, user has rights to do it so allow it
|
||||
if (!this.value.isLockedAtServer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//locked, confirm if user can change it
|
||||
//if any role then no problem
|
||||
|
||||
//ok, only thing left to check is if the current user can unlock this
|
||||
//only thing left to check is if the current user can unlock this
|
||||
//get remove roles required for current state
|
||||
let cs = this.pvm.currentState;
|
||||
const cs = this.pvm.currentState;
|
||||
if (cs.removeRoles == null || cs.removeRoles == 0) {
|
||||
//no state set yet
|
||||
return true;
|
||||
}
|
||||
|
||||
//ok, need to check the role here against current user roles to see if this is valid
|
||||
//need to check the role here against current user roles to see if this is valid
|
||||
if (window.$gz.role.hasRole(cs.removeRoles)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user