This commit is contained in:
2021-09-08 23:33:01 +00:00
parent 63eafdc904
commit 52e8de0bf3
2 changed files with 149 additions and 136 deletions

View File

@@ -11,8 +11,13 @@
Customer UI
CSR techs ui accept to wo etc
CSR V8Migrate
List (customer)
create new (customer)
TEST all as HO user as well as Cust user
HO variant picklist for customer specfiically adn other shit like unit lists etc
CSR V8Migrate
GetLastReport is not implemented anywhere but is useful adn key
new testing cases
Schedule form
@@ -717,3 +722,4 @@ BUILD 130 CHANGES OF NOTE
- evalution seed data generation: removed redundant initial call to erase database from client as well as redundant check for existing data before prompting to erase
- CustomerServiceRequest Service user interface: completed with accept and reject fully coded, now has link to wo and workorderitem has link back to csr, ready for reporting
- About form: fixed bug that allowed customer / ho type user to view license info

View File

@@ -5,11 +5,13 @@
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
<v-form ref="form">
<v-row>
<v-col cols="12" sm="6" lg="4" xl="3">
<h1>UNDER CONSTRUCTION</h1>
<h2>
Copied from service csr and not modified yet for customer usage
</h2>
<v-col
v-if="$store.state.userType == 4"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list
:aya-type="ayaTypes().Customer"
show-edit-icon
@@ -19,6 +21,7 @@
:label="$ay.t('Customer')"
ref="customerId"
data-cy="customerId"
variant="ho"
></gz-pick-list>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
@@ -26,7 +29,6 @@
:color="priorityColor()"
:item-color="priorityColor()"
v-model="obj.priority"
readonly
:items="selectLists.priorities"
item-text="name"
item-value="id"
@@ -36,50 +38,10 @@
append-icon=""
>
<template v-slot:prepend
><v-icon :color="priorityColor()">
$ayiCircle
</v-icon>
><v-icon :color="priorityColor()"> $ayiCircle </v-icon>
</template></v-select
>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-picker
:label="$ay.t('Created')"
v-model="obj.dateRequested"
readonly
ref="dateRequested"
data-cy="dateRequested"
></gz-date-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-select
v-model="obj.status"
:items="selectLists.status"
item-text="name"
item-value="id"
readonly
:label="$ay.t('CustomerServiceRequestStatus')"
ref="status"
data-cy="status"
append-icon=""
></v-select>
</v-col>
TODO: INSERT GLOBAL HTML formatted INFO HERE FROM GLOBAL SETTINGS IF
NON-EMPTY
<!-- //MIGRATE_OUTSTANDING put workorder picklist here and show if has a woitemid or whatever is required to link to the wo -->
<!-- ---------------------------------- -->
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
v-model="obj.name"
:readonly="formState.readOnly"
:label="$ay.t('CustomerServiceRequestTitle')"
:rules="[form().required(this, 'name')]"
:error-messages="form().serverErrors(this, 'name')"
ref="name"
data-cy="name"
@input="fieldValueChanged('name')"
></v-text-field>
</v-col>
<v-col
v-if="
@@ -107,6 +69,80 @@
</v-col>
<v-col
v-if="form().showMe(this, 'CustomerServiceRequestItemUnitID')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list
:aya-type="ayaTypes().Unit"
:variant="'customerid:' + obj.customerId"
v-model="obj.unitId"
:readonly="formState.readOnly"
:label="$ay.t('CustomerServiceRequestItemUnitID')"
ref="unitId"
data-cy="unitId"
:error-messages="form().serverErrors(this, 'unitId')"
@input="fieldValueChanged('unitId')"
></gz-pick-list>
</v-col>
<v-col cols="12">
<v-text-field
v-model="obj.name"
:readonly="formState.readOnly"
:label="$ay.t('CustomerServiceRequestTitle')"
:rules="[form().required(this, 'name')]"
:error-messages="form().serverErrors(this, 'name')"
ref="name"
data-cy="name"
@input="fieldValueChanged('name')"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'CustomerServiceRequestDetails')"
cols="12"
>
<v-textarea
v-model="obj.notes"
:readonly="formState.readOnly"
:label="$ay.t('CustomerServiceRequestDetails')"
:error-messages="form().serverErrors(this, 'notes')"
ref="notes"
data-cy="notes"
@input="fieldValueChanged('notes')"
auto-grow
></v-textarea>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-picker
:label="$ay.t('Created')"
v-model="obj.dateRequested"
readonly
ref="dateRequested"
data-cy="dateRequested"
></gz-date-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-select
v-model="obj.status"
:items="selectLists.status"
item-text="name"
item-value="id"
readonly
:label="$ay.t('CustomerServiceRequestStatus')"
ref="status"
data-cy="status"
append-icon=""
></v-select>
</v-col>
<!-- TODO: INSERT GLOBAL HTML formatted INFO HERE FROM GLOBAL SETTINGS IF
NON-EMPTY -->
<!-- <v-col
v-if="form().showMe(this, 'CustomerServiceRequestRequestedBy')"
cols="12"
sm="6"
@@ -125,47 +161,11 @@
:error-messages="form().serverErrors(this, 'requestedByUserId')"
@input="fieldValueChanged('requestedByUserId')"
></gz-pick-list>
</v-col>
<v-col
v-if="form().showMe(this, 'CustomerServiceRequestItemUnitID')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list
:aya-type="ayaTypes().Unit"
:variant="'customerid:' + obj.customerId"
show-edit-icon
v-model="obj.unitId"
:readonly="formState.readOnly"
:label="$ay.t('CustomerServiceRequestItemUnitID')"
ref="unitId"
data-cy="unitId"
:error-messages="form().serverErrors(this, 'unitId')"
@input="fieldValueChanged('unitId')"
></gz-pick-list>
</v-col>
</v-col> -->
<!-- --------------------------------- -->
<v-col
v-if="form().showMe(this, 'CustomerServiceRequestDetails')"
cols="12"
>
<v-textarea
v-model="obj.notes"
:readonly="formState.readOnly"
:label="$ay.t('CustomerServiceRequestDetails')"
:error-messages="form().serverErrors(this, 'notes')"
ref="notes"
data-cy="notes"
@input="fieldValueChanged('notes')"
auto-grow
></v-textarea>
</v-col>
<v-col v-if="form().showMe(this, 'Tags')" cols="12">
<!-- <v-col v-if="form().showMe(this, 'Tags')" cols="12">
<gz-tag-picker
v-model="obj.tags"
:readonly="formState.readOnly"
@@ -176,7 +176,7 @@
></gz-tag-picker>
</v-col>
<v-col cols="12">
<v-col cols="12">
<gz-custom-fields
v-model="obj.customFields"
:form-key="formCustomTemplateKey"
@@ -206,7 +206,7 @@
:aya-type="ayaType"
:aya-id="obj.id"
></gz-attachments
></v-col>
></v-col> -->
</v-row>
</v-form>
<v-row justify="center">
@@ -286,6 +286,12 @@ export default {
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
}
} else {
//NEW
//
if (this.$store.state.userType == 3) {
//Customer specific user
this.obj.customerId = this.$store.state.customerRights.entityId;
}
window.$gz.form.setFormState({
vm: vm,
loading: false
@@ -366,7 +372,7 @@ export default {
customerId: null,
unitId: null,
workOrderItemId: null,
requestedByUserId: null, //window.$gz.store.state.userId, for outside version of this form
requestedByUserId: this.$store.state.userId, //window.$gz.store.state.userId, for outside version of this form
customerReferenceNumber: null,
status: 0,
priority: 0
@@ -755,13 +761,14 @@ function generateMenu(vm) {
readOnly: vm.formState.readOnly || vm.obj.status != 0,
icon: "$ayiConciergeBell",
title: "CustomerServiceRequest",
helpUrl: "svc-csr",
formData: {
ayaType: window.$gz.type.CustomerServiceRequest,
recordId: vm.$route.params.recordid,
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
recordName: vm.obj.name
},
helpUrl: "customer-csr",
hideSearch: true,
// formData: {
// ayaType: window.$gz.type.CustomerServiceRequest,
// recordId: vm.$route.params.recordid,
// formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
// recordName: vm.obj.name
// },
menuItems: []
};
@@ -789,50 +796,50 @@ function generateMenu(vm) {
});
}
//REPORTS
//Report not Print, print is a further option
menuOptions.menuItems.push({
title: "Report",
icon: "$ayiFileAlt",
key: FORM_KEY + ":report",
vm: vm
});
// //REPORTS
// //Report not Print, print is a further option
// menuOptions.menuItems.push({
// title: "Report",
// icon: "$ayiFileAlt",
// key: FORM_KEY + ":report",
// vm: vm
// });
//get last report selected
let lastReport = window.$gz.form.getLastReport(FORM_KEY);
if (lastReport != null) {
menuOptions.menuItems.push({
title: lastReport.name,
icon: "$ayiFileAlt",
key: FORM_KEY + ":report:" + lastReport.id,
vm: vm
});
}
// //get last report selected
// let lastReport = window.$gz.form.getLastReport(FORM_KEY);
// if (lastReport != null) {
// menuOptions.menuItems.push({
// title: lastReport.name,
// icon: "$ayiFileAlt",
// key: FORM_KEY + ":report:" + lastReport.id,
// vm: vm
// });
// }
menuOptions.menuItems.push({ divider: true, inset: false });
// menuOptions.menuItems.push({ divider: true, inset: false });
if (vm.obj.status == 0) {
menuOptions.menuItems.push({
title: "CustomerServiceRequestAcceptToNew",
icon: null,
key: FORM_KEY + ":acceptnew",
vm: vm
});
// if (vm.obj.status == 0) {
// menuOptions.menuItems.push({
// title: "CustomerServiceRequestAcceptToNew",
// icon: null,
// key: FORM_KEY + ":acceptnew",
// vm: vm
// });
menuOptions.menuItems.push({
title: "CustomerServiceRequestAcceptToExisting",
icon: null,
key: FORM_KEY + ":acceptexisting",
vm: vm
});
// menuOptions.menuItems.push({
// title: "CustomerServiceRequestAcceptToExisting",
// icon: null,
// key: FORM_KEY + ":acceptexisting",
// vm: vm
// });
menuOptions.menuItems.push({
title: "CustomerServiceRequestReject",
icon: null,
key: FORM_KEY + ":reject",
vm: vm
});
}
// menuOptions.menuItems.push({
// title: "CustomerServiceRequestReject",
// icon: null,
// key: FORM_KEY + ":reject",
// vm: vm
// });
// }
menuOptions.menuItems.push({ divider: true, inset: false });