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