sync
This commit is contained in:
@@ -69,9 +69,16 @@ export default class InspectionWizard extends OptionBase {
|
||||
requestTemplates: option.requestTemplates
|
||||
});
|
||||
this._var.templateSelector = templateSelector;
|
||||
assetSelector.onSelected = asset => {
|
||||
assetSelector.onSelected = async asset => {
|
||||
this._var.asset = asset;
|
||||
this._var.template = null;
|
||||
if (typeof option.getAssetUncompletedInspection === 'function') {
|
||||
const report = await option.getAssetUncompletedInspection(asset.Id);
|
||||
if (report) {
|
||||
showAlert(assetSelector.title, this.r('FLTL_03601', 'The following inspection needs to be certified: ') + report.Value);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this._changePage(1);
|
||||
templateSelector.assetId = asset.Id;
|
||||
};
|
||||
@@ -98,12 +105,19 @@ export default class InspectionWizard extends OptionBase {
|
||||
},
|
||||
{
|
||||
text: this.r('FLTL_01973', 'Next'),
|
||||
trigger: () => {
|
||||
trigger: async () => {
|
||||
const asset = assetSelector.currentAsset;
|
||||
if (asset == null) {
|
||||
showAlert(assetSelector.title, this.r('FLTL_02269', 'Please select an Asset.'));
|
||||
return false;
|
||||
}
|
||||
if (typeof option.getAssetUncompletedInspection === 'function') {
|
||||
const report = await option.getAssetUncompletedInspection(asset.Id);
|
||||
if (report) {
|
||||
showAlert(assetSelector.title, this.r('FLTL_03601', 'The following inspection needs to be certified: ') + report.Value);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this._var.asset = asset;
|
||||
this._var.template = null;
|
||||
this._changePage(1);
|
||||
|
||||
Reference in New Issue
Block a user