This commit is contained in:
2021-02-09 20:49:56 +00:00
parent c7452857be
commit 38b2344bb4
4 changed files with 42 additions and 32 deletions

View File

@@ -6,9 +6,17 @@
<v-form ref="form" v-if="formState.ready">
<v-row>
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
<v-col cols="12" v-if="customername">
<v-btn @click="goToCustomer"> {{ customername }}</v-btn>
<v-col cols="12">
<gz-pick-list
readonly
v-model="obj.customerId"
:aya-type="ayaTypes().Customer"
:show-edit-icon="true"
:label="$ay.t('Customer')"
></gz-pick-list>
</v-col>
<v-col cols="12">
<v-textarea
v-model="obj.notes"
@@ -77,7 +85,6 @@ export default {
vm.rights = window.$gz.role.getRights(window.$gz.type.CustomerNote);
vm.formState.readOnly = !vm.rights.change;
window.$gz.eventBus.$on("menu-click", clickHandler);
this.customername = this.$route.params.customername;
//id 0 means create a new record don't load one
if (vm.$route.params.recordid != 0) {
//is there already an obj from a prior operation?
@@ -190,15 +197,6 @@ export default {
}
},
methods: {
goToCustomer() {
this.$router.push({
name: "customer-edit",
params: {
recordid: this.obj.customerId
}
});
},
canSave: function() {
return this.formState.valid && this.formState.dirty;
},

View File

@@ -2,20 +2,30 @@
<div>
<gz-report-selector ref="reportSelector"></gz-report-selector>
<gz-extensions
:ayaType="ayType"
:selectedItems="selectedItems"
:aya-type="ayType"
:selected-items="selectedItems"
ref="extensions"
>
</gz-extensions>
{{ customername }}
<v-row>
<v-col cols="12">
<gz-pick-list
readonly
v-model="customerId"
:aya-type="ayaTypes().Customer"
:show-edit-icon="true"
:label="$ay.t('Customer')"
></gz-pick-list>
</v-col>
</v-row>
<gz-data-table
ref="gzdatatable"
formKey="cust-customer-notes"
dataListKey="CustomerNoteDataList"
:showSelect="rights.read"
form-key="cust-customer-notes"
data-list-key="CustomerNoteDataList"
:show-select="rights.read"
:reload="reload"
:clientCriteria="clientCriteria"
v-on:selection-change="handleSelected"
:client-criteria="clientCriteria"
@selection-change="handleSelected"
data-cy="customerNotesTable"
>
</gz-data-table>
@@ -31,7 +41,7 @@
const FORM_KEY = "cust-customer-notes";
export default {
created() {
this.customername = this.$route.params.customername;
this.customerId = parseInt(this.$route.params.customerid);
//MIXED STATIC But with provided criteria FILTER
this.clientCriteria = this.customerId.toString();
@@ -45,7 +55,7 @@ export default {
data() {
return {
customerId: undefined,
customername: undefined,
// customername: undefined,
clientCriteria: undefined,
rights: window.$gz.role.defaultRightsObject(),
ayType: window.$gz.type.CustomerNote,
@@ -56,6 +66,9 @@ export default {
methods: {
handleSelected(selected) {
this.selectedItems = selected;
},
ayaTypes: function() {
return window.$gz.type;
}
}
};
@@ -75,8 +88,7 @@ async function clickHandler(menuItem) {
name: "customer-note-edit",
params: {
recordid: 0,
customerid: m.vm.customerId,
customername: m.vm.customername
customerid: m.vm.customerId
}
});
break;

View File

@@ -2,15 +2,15 @@
<div>
<gz-report-selector ref="reportSelector"></gz-report-selector>
<div v-if="formState.ready">
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
<v-form ref="form">
<v-row>
<v-col cols="12">
<gz-pick-list
readonly
v-model="selectedPartId"
:ayaType="ayaTypes().Part"
:showEditIcon="true"
:aya-type="ayaTypes().Part"
:show-edit-icon="true"
:label="$ay.t('Part')"
ref="selectedPartId"
data-cy="selectedPartId"
@@ -19,8 +19,8 @@
<v-col cols="12">
<gz-pick-list
v-model="selectedPartWarehouseId"
:ayaType="ayaTypes().PartWarehouse"
:showEditIcon="true"
:aya-type="ayaTypes().PartWarehouse"
:show-edit-icon="true"
:label="$ay.t('PartSerialWarehouseID')"
ref="partWarehouseId"
data-cy="partWarehouseId"