case 4504

This commit is contained in:
2023-04-15 19:18:34 +00:00
parent 59308214fa
commit 6ed59628e0

View File

@@ -16,6 +16,7 @@
:error-messages="form().serverErrors(this, 'customerId')"
:rules="[form().required(this, 'customerId')]"
@input="fieldValueChanged('customerId')"
@update:name="customerChanged"
></gz-pick-list>
</v-col>
@@ -708,6 +709,24 @@ export default {
// years: 1
// });
},
async customerChanged() {
const id = this.obj.customerId;
if (!id || id == 0) {
return;
}
const res = await window.$gz.api.get(`customer/${id}`);
if (res.error) {
window.$gz.eventBus.$emit(
"notify-warning",
window.$gz.errorHandler.errorToString(res, this)
);
} else {
//Use customer record to update stuff here
this.obj.fetchEmail = res.data.emailAddress;
this.obj.regTo = res.data.name;
this.obj.dbId = res.data.dbId;
}
},
canSave: function() {
return this.formState.valid && this.formState.dirty;
},
@@ -1197,7 +1216,7 @@ async function fetchTranslatedText() {
"OriginalOrderDate",
"LicenseRegTo",
"LicenseFetchEmail",
"LicenseDBID"
"DatabaseID"
]);
}