This commit is contained in:
2025-12-24 10:55:40 +08:00
parent eec9d6045c
commit 752bb23571
25 changed files with 2348 additions and 816 deletions

View File

@@ -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);