This commit is contained in:
2021-05-19 19:45:47 +00:00
parent 24cd6b76d8
commit 1ce5449e51
3 changed files with 52 additions and 63 deletions

View File

@@ -8,6 +8,8 @@
return-object
:items="searchResults"
:label="label"
:hint="hint"
persistent-hint
item-text="name"
item-value="id"
item-disabled="!active"
@@ -87,6 +89,10 @@ export default {
variant: {
type: String,
default: null
},
hint: {
type: String,
default: null
}
},
watch: {

View File

@@ -323,6 +323,7 @@
:readonly="formState.readOnly || isDeleted"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemLaborTaxRateSaleID')"
:hint="laborTaxRateSaleHint"
:ref="
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].taxCodeSaleId`
"
@@ -384,50 +385,6 @@
></gz-currency>
</v-col>
<!-- <v-col
v-if="form().showMe(this, 'WorkOrderItemLaborBasePrice')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-currency
v-model="
value.items[activeWoItemIndex].labors[activeItemIndex].basePrice
"
:readonly="formState.readOnly || isDeleted"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemLaborBasePrice')"
:ref="
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].basePrice`
"
data-cy="laborbasePrice"
:error-messages="
form().serverErrors(
this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].basePrice`
)
"
:rules="[
form().decimalValid(
this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].basePrice`
),
form().required(
this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].basePrice`
)
]"
@input="
fieldValueChanged(`Items[${activeWoItemIndex}].labors[
${activeItemIndex}
].basePrice`)
"
></gz-currency>
</v-col>
-->
<v-col
v-if="form().showMe(this, 'WorkOrderItemLaborServiceDetails')"
cols="12"
@@ -893,6 +850,31 @@ export default {
this.pvm.rights.change &&
this.pvm.subRights.labors.delete
);
},
laborTaxRateSaleHint: function() {
if (this.activeItemIndex == null || this.activeWoItemIndex == null) {
return null;
}
console.log(
"laborTaxRateSaleHint",
this.value.items[this.activeWoItemIndex].labors[this.activeItemIndex]
.taxCodeSaleId
);
if (
this.value.items[this.activeWoItemIndex].labors[this.activeItemIndex]
.taxCodeSaleId == null &&
this.value.items[this.activeWoItemIndex].labors[this.activeItemIndex]
.taxName != null
) {
return (
'"' +
this.value.items[this.activeWoItemIndex].labors[this.activeItemIndex]
.taxName +
'"'
);
} else {
return null;
}
}
}
};