This commit is contained in:
@@ -1,6 +1,24 @@
|
||||
<template>
|
||||
<div>
|
||||
barebones template
|
||||
<v-btn @click="logit()">log</v-btn>
|
||||
<!-- value:{{ value }} display:{{ display }} -->
|
||||
<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>
|
||||
<v-btn @click="picking = true">edit</v-btn>
|
||||
{{ display }}
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -10,34 +28,68 @@
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
picking: false //display picker
|
||||
};
|
||||
},
|
||||
|
||||
props: {
|
||||
value: {
|
||||
default: null,
|
||||
type: Object
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
pvm: {
|
||||
default: null,
|
||||
type: Object
|
||||
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 },
|
||||
|
||||
formKey: { type: String, default: "" }, //used to grab template from store
|
||||
readonly: Boolean,
|
||||
disabled: Boolean
|
||||
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: "" }
|
||||
},
|
||||
|
||||
methods: {
|
||||
form() {
|
||||
return window.$gz.form;
|
||||
logit() {
|
||||
console.log("I have:", { value: this.value, display: this.display });
|
||||
},
|
||||
fieldValueChanged(ref) {
|
||||
if (!this.pvm.formState.loading && !this.pvm.formState.readonly) {
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
}
|
||||
emitInput(e) {
|
||||
//console.log("emit input", e);
|
||||
this.$emit("input", e);
|
||||
this.picking = false;
|
||||
},
|
||||
emitName(e) {
|
||||
//console.log("emit name", e);
|
||||
this.$emit("update:name", e);
|
||||
}
|
||||
},
|
||||
computed: {}
|
||||
computed: {
|
||||
pickMode: function() {
|
||||
if (this.picking) {
|
||||
return true;
|
||||
}
|
||||
if (this.value == null || this.display == null || this.display == "") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -306,6 +306,44 @@
|
||||
></gz-decimal>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'WorkOrderItemLaborTaxRateSaleID')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-tax-picker
|
||||
:show-edit-icon="true"
|
||||
v-model="
|
||||
value.items[activeWoItemIndex].labors[activeItemIndex]
|
||||
.taxCodeSaleId
|
||||
"
|
||||
:display="
|
||||
value.items[activeWoItemIndex].labors[activeItemIndex].taxName
|
||||
"
|
||||
:readonly="formState.readOnly || isDeleted"
|
||||
:disabled="isDeleted"
|
||||
:label="$ay.t('WorkOrderItemLaborTaxRateSaleID')"
|
||||
:ref="
|
||||
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].taxCodeSaleId`
|
||||
"
|
||||
data-cy="laborTaxCodeSaleId"
|
||||
:error-messages="
|
||||
form().serverErrors(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].taxCodeSaleId`
|
||||
)
|
||||
"
|
||||
@input="
|
||||
fieldValueChanged(
|
||||
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].taxCodeSaleId`
|
||||
)
|
||||
"
|
||||
@update:name="taxCodeChange"
|
||||
></gz-tax-picker>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'WorkOrderItemLaborTaxRateSaleID')"
|
||||
cols="12"
|
||||
@@ -323,7 +361,6 @@
|
||||
:readonly="formState.readOnly || isDeleted"
|
||||
:disabled="isDeleted"
|
||||
:label="$ay.t('WorkOrderItemLaborTaxRateSaleID')"
|
||||
:hint="laborTaxRateSaleHint"
|
||||
:ref="
|
||||
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].taxCodeSaleId`
|
||||
"
|
||||
@@ -427,6 +464,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
import GzTaxPicker from "./tax-picker.vue";
|
||||
/*
|
||||
|
||||
"cost": 0,
|
||||
@@ -452,6 +490,9 @@ l.Add(new FormField { TKey = "LineTotal", FieldKey = "LaborLineTotalViz", TKeySe
|
||||
|
||||
*/
|
||||
export default {
|
||||
components: {
|
||||
GzTaxPicker
|
||||
},
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user