case 1690

This commit is contained in:
2021-11-24 22:51:13 +00:00
parent 3af79a591b
commit 672ca0e3c5

View File

@@ -162,39 +162,90 @@
</v-col>
</v-row>
</v-form>
<!-- <v-row justify="center">
<v-dialog v-model="woSelectorDialog" persistent max-width="300px">
<v-card>
<v-card-title>
<span class="text-h5">{{
$ay.t("CustomerServiceRequestAcceptToExisting")
}}</span>
</v-card-title>
<v-card-text>
<gz-pick-list
:aya-type="ayaTypes().WorkOrder"
:variant="'customerid:' + obj.customerId"
:show-edit-icon="false"
v-model="selectedWOId"
:label="$ay.t('WorkOrder')"
></gz-pick-list>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="blue darken-1"
text
@click="woSelectorDialog = false"
>{{ $ay.t("Cancel") }}</v-btn
>
<v-btn color="blue darken-1" text @click="accept(selectedWOId)">{{
$ay.t("OK")
}}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-row> -->
<!-- ################################################################################-->
<!-- ########################## UNIT ADD FORM #####################################-->
<!-- ################################################################################-->
<template>
<v-row justify="center">
<v-dialog max-width="1600px" v-model="addUnitDialog">
<v-card>
<v-card-title> </v-card-title>
<v-card-text>
<v-row>
<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
:include-inactive="true"
v-model="unitObj.customerId"
:label="$ay.t('Customer')"
ref="customerId"
data-cy="customerId"
variant="ho"
template="[{'fld':'customername'}]"
></gz-pick-list>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
v-model="unitObj.serial"
:readonly="formState.readOnly"
:label="$ay.t('UnitSerial')"
:rules="[form().required(this, 'serial')]"
:error-messages="form().serverErrors(this, 'serial')"
ref="serial"
data-cy="serial"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
v-model="unitObj.description"
:readonly="formState.readOnly"
:label="$ay.t('UnitDescription')"
ref="description"
data-cy="description"
:error-messages="form().serverErrors(this, 'description')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-pick-list
:aya-type="ayaTypes().UnitModel"
show-edit-icon
v-model="unitObj.unitModelId"
:readonly="formState.readOnly"
:label="$ay.t('UnitModel')"
ref="unitModelId"
data-cy="unitModelId"
:error-messages="form().serverErrors(this, 'unitModelId')"
></gz-pick-list>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-btn text @click="addUnitDialog = false" color="primary">{{
$ay.t("Cancel")
}}</v-btn>
<v-spacer></v-spacer>
<v-btn
:disabled="unitObj.serial == null"
color="primary"
text
@click="addUnit()"
class="ml-4"
data-cy="csrUnitAdd"
>{{ $ay.t("Add") }}</v-btn
>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
</template>
</div>
<v-overlay :value="!formState.ready || formState.loading">
<v-progress-circular indeterminate :size="64" />
@@ -236,6 +287,7 @@ export default {
if (this.$store.state.userType == 3) {
//Customer specific user
this.obj.customerId = this.$store.state.customerRights.entityId;
this.unitObj.customerId = this.$store.state.customerRights.entityId;
}
window.$gz.form.setFormState({
vm: vm,
@@ -307,7 +359,14 @@ export default {
serverError: {}
},
rights: window.$gz.role.defaultRightsObject(),
ayaType: window.$gz.type.CustomerServiceRequest
ayaType: window.$gz.type.CustomerServiceRequest,
addUnitDialog: false,
unitObj: {
serial: null,
description: null,
unitModelId: null,
customerId: null
}
};
},
watch: {
@@ -339,7 +398,10 @@ export default {
}
},
methods: {
showAddUnitDialog: function() {},
showAddUnitDialog: function() {
this.addUnitDialog = true;
},
addUnit: function() {},
unitListVariant: function() {
return `customerid: ${this.obj.customerId}`;
},
@@ -688,7 +750,10 @@ async function fetchTranslatedText() {
"CustomerServiceRequestCustom14",
"CustomerServiceRequestCustom15",
"CustomerServiceRequestCustom16",
"AddNewUnit"
"AddNewUnit",
"UnitDescription",
"UnitModel",
"UnitSerial"
]);
}