This commit is contained in:
2023-01-04 00:47:02 +00:00
parent 359b301657
commit b46d35a212
2 changed files with 66 additions and 206 deletions

View File

@@ -242,6 +242,13 @@ export default {
});
break;
case socktype.TrialLicenseRequest:
vm.$router.push({
name: "trial-request-edit",
params: { recordid: tid.id }
});
break;
case socktype.SubscriptionServer:
vm.$router.push({
name: "subscription-server-edit",

View File

@@ -5,8 +5,7 @@
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
<v-form ref="form">
<v-row dense>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="companyName"
v-model="obj.companyName"
@@ -20,7 +19,7 @@
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="contactName"
v-model="obj.contactName"
@@ -34,9 +33,6 @@
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="dbId"
@@ -51,7 +47,7 @@
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-email
ref="email"
v-model="obj.email"
@@ -63,12 +59,12 @@
></gz-email>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox
ref="emailValidated"
v-model="obj.emailValidated"
dense
:readonly="formState.readOnly"
readonly
:label="$sock.t('TrialLicenseRequestEmailValidated')"
data-cy="emailValidated"
:error-messages="form().serverErrors(this, 'emailValidated')"
@@ -76,33 +72,25 @@
></v-checkbox>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="requested"
v-model="obj.requested"
:label="$sock.t('TrialLicenseRequestRequested')"
:rules="[form().required(this, 'requested')]"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'requested')"
data-cy="requested"
@input="fieldValueChanged('requested')"
readonly
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="processed"
v-model="obj.processed"
:label="$sock.t('TrialLicenseRequestProcessed')"
:rules="[form().required(this, 'processed')]"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'processed')"
data-cy="processed"
@input="fieldValueChanged('processed')"
readonly
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="fetchedOn"
v-model="obj.fetchedOn"
@@ -115,140 +103,52 @@
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-pick-list
ref="customerId"
v-model="obj.customerId"
:aya-type="sockTypes().Customer"
show-edit-icon
:readonly="formState.readOnly"
:label="$sock.t('Customer')"
:error-messages="form().serverErrors(this, 'customerId')"
@input="fieldValueChanged('customerId')"
></gz-pick-list>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="created"
v-model="obj.created"
:label="$sock.t('Created')"
:rules="[form().required(this, 'created')]"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'created')"
data-cy="created"
@input="fieldValueChanged('created')"
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-select
ref="dataCenter"
v-model="obj.dataCenter"
ref="status"
v-model="obj.status"
dense
:items="selectLists.dataCenters"
:items="selectLists.trailRequestStatus"
item-text="name"
item-value="id"
:label="$sock.t('SubServerDatacenter')"
:error-messages="form().serverErrors(this, 'dataCenter')"
:rules="[form().required(this, 'dataCenter')]"
@input="fieldValueChanged('dataCenter')"
readonly
:label="$sock.t('TrialLicenseRequestStatus')"
data-cy="status"
></v-select>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-select
ref="timeZone"
v-model="obj.timeZone"
dense
:items="selectLists.timeZones"
:label="$sock.t('SubServerTimeZone')"
:error-messages="form().serverErrors(this, 'timeZone')"
:rules="[form().required(this, 'timeZone')]"
@input="fieldValueChanged('timeZone')"
></v-select>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="lastUpdated"
v-model="obj.lastUpdated"
:label="$sock.t('SubServerLastUpdated')"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'lastUpdated')"
data-cy="lastUpdated"
@input="fieldValueChanged('lastUpdated')"
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="trialCompany"
v-model="obj.trialCompany"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerTrialCompany')"
data-cy="trialCompany"
:error-messages="form().serverErrors(this, 'trialCompany')"
@input="fieldValueChanged('trialCompany')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="trialContact"
v-model="obj.trialContact"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerTrialContact')"
data-cy="trialContact"
:error-messages="form().serverErrors(this, 'trialContact')"
@input="fieldValueChanged('trialContact')"
></v-text-field>
</v-col>
<v-col v-if="form().showMe(this, 'SubServerNotes')" cols="12">
<v-textarea
ref="notes"
v-model="obj.notes"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerNotes')"
:error-messages="form().serverErrors(this, 'notes')"
data-cy="notes"
auto-grow
@input="fieldValueChanged('notes')"
></v-textarea>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox
ref="active"
v-model="obj.active"
ref="perpetual"
v-model="obj.perpetual"
dense
:readonly="formState.readOnly"
:label="$sock.t('Active')"
data-cy="active"
:error-messages="form().serverErrors(this, 'active')"
@change="fieldValueChanged('active')"
readonly
:label="$sock.t('TrialLicenseRequestPerpetual')"
></v-checkbox>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="rejectReason"
v-model="obj.rejectReason"
dense
:readonly="formState.readOnly"
:label="$sock.t('TrialLicenseRequestRejectReason')"
:error-messages="form().serverErrors(this, 'rejectReason')"
data-cy="rejectReason"
@input="fieldValueChanged('rejectReason')"
></v-text-field>
</v-col>
<v-col v-if="form().showMe(this, 'SubServerNotes')" cols="12">
<v-textarea
ref="key"
v-model="obj.key"
dense
readonly
:label="$sock.t('LicenseKey')"
auto-grow
></v-textarea>
</v-col>
<!-- --------------------------------- -->
<v-col v-if="form().showMe(this, 'Tags')" cols="12">
@@ -296,7 +196,7 @@ export default {
tags: []
},
selectLists: {
dataCenters: []
trailRequestStatus: []
},
formState: {
ready: false,
@@ -568,18 +468,7 @@ async function clickHandler(menuItem) {
case "save":
m.vm.submit();
break;
case "delete":
m.vm.remove();
break;
case "new":
m.vm.$router.push({
name: "trial-request-edit",
params: { recordid: 0 }
});
break;
case "duplicate":
m.vm.duplicate();
break;
case "report":
{
const res = await m.vm.$refs.reportSelector.open(
@@ -595,29 +484,7 @@ async function clickHandler(menuItem) {
window.$gz.form.setLastReportMenuItem(FORM_KEY, res, m.vm);
}
break;
// case "terminal":
// alert("putty -agent -ssh sportseffect.onayanova.com");
// break;
// case "QuoteList":
// m.vm.$router.push({
// name: "svc-quotes",
// params: {
// aType: m.vm.sockType,
// objectId: m.vm.obj.id,
// name: m.vm.obj.name
// }
// });
// break;
// case "PMList":
// m.vm.$router.push({
// name: "svc-pms",
// params: {
// aType: m.vm.sockType,
// objectId: m.vm.obj.id,
// name: m.vm.obj.name
// }
// });
// break;
default:
window.$gz.eventBus.$emit(
"notify-warning",
@@ -673,32 +540,6 @@ function generateMenu(vm) {
});
}
if (vm.rights.change) {
menuOptions.menuItems.push({
title: "New",
icon: "$sockiPlus",
key: FORM_KEY + ":new",
vm: vm
});
}
if (vm.rights.change && vm.$route.params.recordid != 0) {
menuOptions.menuItems.push({
title: "Duplicate",
icon: "$sockiClone",
key: FORM_KEY + ":duplicate",
vm: vm
});
}
if (vm.rights.delete && vm.$route.params.recordid != 0) {
menuOptions.menuItems.push({
title: "Delete",
icon: "$sockiTrashAlt",
surface: false,
key: FORM_KEY + ":delete",
vm: vm
});
}
menuOptions.menuItems.push({ divider: true, inset: false });
// menuOptions.menuItems.push({
@@ -734,6 +575,7 @@ let JUST_DELETED = false;
async function initForm(vm) {
await fetchTranslatedText();
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY, vm);
await populateSelectionLists(vm);
}
//////////////////////////////////////////////////////////
@@ -753,9 +595,20 @@ async function fetchTranslatedText() {
"TrialLicenseRequestStatus",
"TrialLicenseRequestRejectReason",
"TrialLicenseRequestFetchedOn",
"TrialLicenseRequestPerpetual"
"TrialLicenseRequestPerpetual",
"LicenseKey"
]);
}
//////////////////////
//
//
async function populateSelectionLists(vm) {
//ensure the pick lists required are pre-fetched
await window.$gz.enums.fetchEnumList("trialrequeststatus");
vm.selectLists.trailRequestStatus = window.$gz.enums.getSelectionList(
"trialrequeststatus"
);
}
/*
"CREATE TABLE atriallicenserequest (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, dbid TEXT NOT NULL, companyname TEXT NOT NULL, "
+ "contactname TEXT NOT NULL, email TEXT NOT NULL, emailconfirmcode TEXT NOT NULL, emailvalidated BOOL DEFAULT false, "