This commit is contained in:
2020-11-14 00:58:43 +00:00
parent f0a64aad8c
commit 17f20d5d2e
5 changed files with 78 additions and 7 deletions

View File

@@ -5,6 +5,14 @@
todo: SEEDER
Seed sample customers from v7 specifically in addition to random ones?
todo: picklist empty null vs zero
test with customer and headofficeid
should have the empty selection pre-selected or maybe I need to do away with that since the clear button does the same thing?
todo: picklist clear doesn't trigger dirty change
maybe doesn't emit?
todo: Uifielddatatype Phone and TimeSpan support at client, translation keys etc
ay-customize.vue
gz-data-table.vue

View File

@@ -979,11 +979,11 @@ export default {
// Used by forms that need the option of an unselected
// item in a pick list
//
addNoSelectionItem(listArray) {
addNoSelectionItem(listArray, nullNotZero) {
if (listArray == undefined || listArray == null) {
listArray = [];
}
listArray.unshift({ name: "-", id: 0 });
listArray.unshift({ name: "-", id: nullNotZero ? null : 0 });
},
////////////////////////////////////
// Get validity of referenced control

View File

@@ -143,7 +143,7 @@ export default {
if (!this.showEditIcon) {
return null;
}
if (this.value != 0) {
if (this.value != null) {
return "$ayiEdit";
}
return "$ayiPlus";
@@ -185,8 +185,8 @@ export default {
}
}
//is it the no selection item?
if (val == 0) {
window.$gz.form.addNoSelectionItem(vm.searchResults);
if (val == null) {
window.$gz.form.addNoSelectionItem(vm.searchResults, true);
} else {
//Not here, better get it
let urlParams = "?ayaType=" + vm.ayaType + "&preId=" + vm.value;
@@ -274,7 +274,7 @@ export default {
throw new Error(res);
}
vm.searchResults = res.data;
window.$gz.form.addNoSelectionItem(vm.searchResults);
window.$gz.form.addNoSelectionItem(vm.searchResults, true);
vm.replaceLastSelection();
} catch (err) {
window.$gz.errorHandler.handleFormError(err);

View File

@@ -415,6 +415,68 @@
></gz-pick-list>
</v-col>
<v-col
v-if="form().showMe(this, 'BillHeadOffice')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-checkbox
v-model="obj.billHeadOffice"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
:label="$ay.t('CustomerBillHeadOffice')"
ref="billHeadOffice"
data-cy="billHeadOffice"
:error-messages="form().serverErrors(this, 'billHeadOffice')"
@change="fieldValueChanged('billHeadOffice')"
></v-checkbox>
</v-col>
<v-col
v-if="form().showMe(this, 'HeadOfficeID')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list
:ayaType="ayaTypes().HeadOffice"
:showEditIcon="true"
v-model="obj.headOfficeID"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
:label="$ay.t('HeadOffice')"
ref="headOfficeID"
data-cy="headOfficeID"
:error-messages="form().serverErrors(this, 'headOfficeID')"
@input="fieldValueChanged('headOfficeID')"
></gz-pick-list>
</v-col>
<v-col
v-if="form().showMe(this, 'ContractID')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list
:ayaType="ayaTypes().Contract"
:showEditIcon="true"
v-model="obj.contractID"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
:label="$ay.t('Contract')"
ref="contractID"
data-cy="contractID"
:error-messages="form().serverErrors(this, 'contractID')"
@input="fieldValueChanged('contractID')"
></gz-pick-list>
</v-col>
<!-- --------------------------------- -->
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
<v-textarea
v-model="obj.notes"

View File

@@ -172,7 +172,8 @@ export default {
mapUrls: [
{
name: "Apple",
value: "http://maps.apple.com/?q={ayaddress}<|>http://maps.apple.com/?ll={aylatitude},{aylongitude}"
value:
"http://maps.apple.com/?q={ayaddress}<|>http://maps.apple.com/?ll={aylatitude},{aylongitude}"
},
{
name: "Bing",