This commit is contained in:
2021-05-27 17:07:25 +00:00
parent 9283dd4251
commit 1db8925484

View File

@@ -67,193 +67,158 @@
>{{ $ay.t("Undelete")
}}<v-icon right large>$ayiTrashRestoreAlt</v-icon></v-btn
>
<v-col
v-if="form().showMe(this, 'WorkOrderItemUnitStartDate')"
v-if="form().showMe(this, 'WorkOrderItemUnit')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-date-time-picker
:label="$ay.t('WorkOrderItemUnitStartDate')"
<gz-pick-list
:aya-type="$ay.ayt().Unit"
:show-edit-icon="true"
v-model="
value.items[activeWoItemIndex].units[activeItemIndex].startDate
"
:readonly="formState.readOnly"
:disabled="isDeleted"
:ref="
`Items[${activeWoItemIndex}].units[${activeItemIndex}].startDate`
"
data-cy="startDate"
:error-messages="
form().serverErrors(
this,
`Items[${activeWoItemIndex}].units[${activeItemIndex}].startDate`
)
"
@input="
fieldValueChanged(
`Items[${activeWoItemIndex}].units[${activeItemIndex}].startDate`
)
"
></gz-date-time-picker>
</v-col>
<v-col
v-if="form().showMe(this, 'WorkOrderItemUnitStopDate')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-date-time-picker
:label="$ay.t('WorkOrderItemUnitStopDate')"
v-model="
value.items[activeWoItemIndex].units[activeItemIndex].stopDate
"
:readonly="formState.readOnly"
:disabled="isDeleted"
:ref="
`Items[${activeWoItemIndex}].units[${activeItemIndex}].stopDate`
"
data-cy="stopDate"
:rules="[
form().datePrecedence(
this,
`Items[${activeWoItemIndex}].units[${activeItemIndex}].startDate`,
`Items[${activeWoItemIndex}].units[${activeItemIndex}].stopDate`
)
]"
:error-messages="
form().serverErrors(
this,
`Items[${activeWoItemIndex}].units[${activeItemIndex}].stopDate`
)
"
@input="
fieldValueChanged(
`Items[${activeWoItemIndex}].units[${activeItemIndex}].stopDate`
)
"
></gz-date-time-picker>
</v-col>
<v-col
v-if="form().showMe(this, 'WorkOrderItemUnitEstimatedQuantity')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-decimal
v-model="
value.items[activeWoItemIndex].units[activeItemIndex]
.estimatedQuantity
value.items[activeWoItemIndex].units[activeItemIndex].unitId
"
:readonly="formState.readOnly || isDeleted"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemUnitEstimatedQuantity')"
:label="$ay.t('Unit')"
:ref="
`Items[${activeWoItemIndex}].units[${activeItemIndex}].estimatedQuantity`
`Items[${activeWoItemIndex}].units[${activeItemIndex}].unitId`
"
data-cy="units.EstimatedQuantity"
data-cy="units.unitId"
:error-messages="
form().serverErrors(
this,
`Items[${activeWoItemIndex}].units[${activeItemIndex}].estimatedQuantity`
`Items[${activeWoItemIndex}].units[${activeItemIndex}].unitId`
)
"
:rules="[
form().decimalValid(
this,
`Items[${activeWoItemIndex}].units[${activeItemIndex}].estimatedQuantity`
),
form().required(
this,
`Items[${activeWoItemIndex}].units[${activeItemIndex}].estimatedQuantity`
@input="
fieldValueChanged(
`Items[${activeWoItemIndex}].units[${activeItemIndex}].unitId`
)
]"
"
@update:name="unitChange"
></gz-pick-list>
</v-col>
<v-col v-if="form().showMe(this, 'WorkOrderItemUnitNotes')" cols="12">
<v-textarea
v-model="
value.items[activeWoItemIndex].units[activeItemIndex].notes
"
:readonly="formState.readOnly"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemUnitNotes')"
:error-messages="
form().serverErrors(
this,
`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].notes`
)
"
:ref="
`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].notes`
"
data-cy="unitUnitNotes"
@input="
fieldValueChanged(`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].estimatedQuantity`)
].notes`)
"
></gz-decimal>
auto-grow
></v-textarea>
</v-col>
<v-col
v-if="form().showMe(this, 'WorkOrderItemUnitUserID')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list
:aya-type="$ay.ayt().User"
variant="tech"
:show-edit-icon="true"
v-model="
value.items[activeWoItemIndex].units[activeItemIndex].userId
"
:readonly="formState.readOnly || isDeleted"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemUnitUserID')"
:ref="
`Items[${activeWoItemIndex}].units[${activeItemIndex}].userId`
"
data-cy="units.userid"
<v-col v-if="form().showMe(this, 'WorkOrderItemUnitTags')" cols="12">
<gz-tag-picker
v-model="value.items[activeWoItemIndex].units[activeItemIndex].tags"
:readonly="formState.readOnly"
data-cy="unitTags"
:error-messages="
form().serverErrors(
this,
`Items[${activeWoItemIndex}].units[${activeItemIndex}].userId`
`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].tags`
)
"
:ref="
`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].tags`
"
@input="
fieldValueChanged(
`Items[${activeWoItemIndex}].units[${activeItemIndex}].userId`
)
fieldValueChanged(`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].tags`)
"
@update:name="userChange"
></gz-pick-list>
></gz-tag-picker>
</v-col>
<v-col
v-if="form().showMe(this, 'WorkOrderItemUnitServiceRateID')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list
:aya-type="$ay.ayt().ServiceRate"
:variant="'contractid:' + value.contractId"
:show-edit-icon="true"
<v-col cols="12">
<gz-custom-fields
v-model="
value.items[activeWoItemIndex].units[activeItemIndex]
.serviceRateId
value.items[activeWoItemIndex].units[activeItemIndex].customFields
"
:readonly="formState.readOnly || isDeleted"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemUnitServiceRateID')"
:form-key="formCustomTemplateKey"
:readonly="formState.readOnly"
:parent-v-m="this"
key-start-with="Items.WorkOrderItemUnitCustom"
:ref="
`Items[${activeWoItemIndex}].units[${activeItemIndex}].serviceRateId`
`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].customFields`
"
data-cy="units.serviceRateId"
data-cy="unitCustomFields"
:error-messages="
form().serverErrors(
this,
`Items[${activeWoItemIndex}].units[${activeItemIndex}].serviceRateId`
`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].customFields`
)
"
@input="
fieldValueChanged(
`Items[${activeWoItemIndex}].units[${activeItemIndex}].serviceRateId`
)
fieldValueChanged(`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].customFields`)
"
@update:name="rateChange"
></gz-pick-list>
></gz-custom-fields>
</v-col>
<v-col v-if="form().showMe(this, 'WorkOrderItemUnitWiki')" cols="12">
<gz-wiki
:aya-type="$ay.ayt().WorkOrderItem"
:aya-id="value.id"
:ref="
`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].wiki`
"
v-model="value.items[activeWoItemIndex].units[activeItemIndex].wiki"
:readonly="formState.readOnly"
@input="
fieldValueChanged(`Items[${activeWoItemIndex}].units[
${activeItemIndex}
].wiki`)
"
></gz-wiki
></v-col>
<v-col
v-if="form().showMe(this, 'WorkOrderItemUnitAttachments') && value.id"
cols="12"
>
<gz-attachments
:readonly="formState.readOnly"
:aya-type="$ay.ayt().WorkOrderItemUnit"
:aya-id="value.items[activeWoItemIndex].units[activeItemIndex].id"
></gz-attachments
></v-col>
</template>
</v-row>
</div>