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