This commit is contained in:
@@ -1,103 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<template v-if="pickMode">
|
||||
<gz-pick-list
|
||||
:aya-type="$ay.ayt().TaxCode"
|
||||
:show-edit-icon="true"
|
||||
:value="value"
|
||||
:readonly="readonly"
|
||||
:disabled="disabled"
|
||||
:label="label"
|
||||
:error-messages="errorMessages"
|
||||
@input="emitInput($event)"
|
||||
@update:name="emitName"
|
||||
></gz-pick-list>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="mb-n2 ml-10">
|
||||
<span class="text-caption">{{ label }}</span>
|
||||
</div>
|
||||
<div class="mb-6 mb-sm-0">
|
||||
<v-btn icon class="ml-n1 mr-2" @click="picking = true">
|
||||
<v-icon>$ayiEdit</v-icon>
|
||||
</v-btn>
|
||||
<span>{{ display }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
picking: false //display picker
|
||||
};
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
display: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
rules: { type: Array, default: undefined },
|
||||
errorMessages: { type: Array, default: null },
|
||||
readonly: { type: Boolean, default: false },
|
||||
disabled: { type: Boolean, default: false },
|
||||
|
||||
ayaType: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
includeInactive: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
showEditIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
allowNoSelection: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
canClear: { type: Boolean, default: true },
|
||||
label: { type: String, default: "" }
|
||||
},
|
||||
watch: {
|
||||
display() {
|
||||
this.picking = false; //this is to attempt to make the picker go away when the record changes to another, otherwise it seems to stick
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
emitInput(e) {
|
||||
this.$emit("input", e);
|
||||
this.picking = false;
|
||||
},
|
||||
emitName(e) {
|
||||
this.$emit("update:name", e);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pickMode: function() {
|
||||
//show picker if nothing selected or display name is empty
|
||||
if (this.picking) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.display == null || this.display == "" || this.display == "-") {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -278,7 +278,7 @@
|
||||
></gz-currency>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
<!-- <v-col
|
||||
v-if="form().showMe(this, 'WorkOrderItemExpenseChargeTaxCodeID')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
@@ -314,6 +314,42 @@
|
||||
"
|
||||
@update:name="taxCodeChange"
|
||||
></gz-tax-picker>
|
||||
</v-col> -->
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'WorkOrderItemExpenseChargeTaxCodeID')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-pick-list
|
||||
:aya-type="$ay.ayt().TaxCode"
|
||||
:show-edit-icon="true"
|
||||
v-model="
|
||||
value.items[activeWoItemIndex].expenses[activeItemIndex]
|
||||
.chargeTaxCodeId
|
||||
"
|
||||
:readonly="formState.readOnly || isDeleted"
|
||||
:disabled="isDeleted"
|
||||
:label="$ay.t('WorkOrderItemExpenseChargeTaxCodeID')"
|
||||
:ref="
|
||||
`Items[${activeWoItemIndex}].expenses[${activeItemIndex}].chargeTaxCodeId`
|
||||
"
|
||||
data-cy="expenseChargeTaxCode"
|
||||
:error-messages="
|
||||
form().serverErrors(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].expenses[${activeItemIndex}].chargeTaxCodeId`
|
||||
)
|
||||
"
|
||||
@input="
|
||||
fieldValueChanged(
|
||||
`Items[${activeWoItemIndex}].expenses[${activeItemIndex}].chargeTaxCodeId`
|
||||
)
|
||||
"
|
||||
@update:name="taxCodeChange"
|
||||
></gz-pick-list>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
@@ -427,11 +463,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
import GzTaxPicker from "./tax-picker.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GzTaxPicker
|
||||
},
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user