sync
This commit is contained in:
+29
-16
@@ -266,7 +266,7 @@ export default class AddWorkOrder extends OptionBase {
|
||||
TravelTimeCost: -1,
|
||||
LaborCost: -1,
|
||||
HourlyRate: -1,
|
||||
InspectionTemplateId: -1,
|
||||
InspectionTemplateId: [],
|
||||
...status,
|
||||
...assetstatus
|
||||
};
|
||||
@@ -325,7 +325,7 @@ export default class AddWorkOrder extends OptionBase {
|
||||
tabIndex: tabIndex + 5,
|
||||
htmlTemplate: it => createElement('span', 'wo-color-line',
|
||||
createElement('em', em => em.style.backgroundColor = it.Color),
|
||||
createElement('label', label => label.innerText = it.Name)
|
||||
createElement('label', label => nullOrEmpty(it.Name) ? label.innerHTML = ' ' : label.innerText = it.Name)
|
||||
),
|
||||
search: true,
|
||||
textKey: 'Name',
|
||||
@@ -549,11 +549,6 @@ export default class AddWorkOrder extends OptionBase {
|
||||
})
|
||||
),
|
||||
displayElement(createElement('span', 'wo-company-name'), allowCustomer),
|
||||
createElement('span', span => {
|
||||
span.className = 'wo-title';
|
||||
span.innerText = this.r('FLTL_02834', 'Status:');
|
||||
}),
|
||||
dropStatus.create(),
|
||||
createElement('span', span => {
|
||||
span.className = 'wo-title wo-title-required wo-sub-line wo-status-closed';
|
||||
span.innerText = this.r('FLTL_00617', 'Completed Date:');
|
||||
@@ -614,7 +609,12 @@ export default class AddWorkOrder extends OptionBase {
|
||||
displayElement(span, false);
|
||||
}
|
||||
}),
|
||||
displayElement(dropDepartment.create(), allowCustomer)
|
||||
displayElement(dropDepartment.create(), allowCustomer),
|
||||
createElement('span', span => {
|
||||
span.className = 'wo-title';
|
||||
span.innerText = this.r('FLTL_02834', 'Status:');
|
||||
}),
|
||||
dropStatus.create()
|
||||
)
|
||||
);
|
||||
dropStatus.onSelected = item => {
|
||||
@@ -926,21 +926,23 @@ export default class AddWorkOrder extends OptionBase {
|
||||
|
||||
let locs = [];
|
||||
const loc = this._var.el.dropLocation.selected?.ID;
|
||||
if (loc > 0)
|
||||
if (loc > 0) {
|
||||
locs.push(loc);
|
||||
const subLocs = this._var.params?.Locations.filter(l => l.PId == loc).map(l => l.Id);
|
||||
locs = locs.concat(subLocs);
|
||||
const subLocs = this._var.params?.Locations.filter(l => l.PId == loc).map(l => l.Id);
|
||||
locs = locs.concat(subLocs);
|
||||
}
|
||||
|
||||
let depts = [];
|
||||
const dept = this._var.el.dropDepartment.selected?.Id;
|
||||
if (dept > 0)
|
||||
if (dept > 0) {
|
||||
depts.push(dept);
|
||||
const subDepts = this._var.params?.Departments.filter(d => d.PId == dept).map(d => d.Id);
|
||||
depts = depts.concat(subDepts);
|
||||
const subDepts = this._var.params?.Departments.filter(d => d.PId == dept).map(d => d.Id);
|
||||
depts = depts.concat(subDepts);
|
||||
}
|
||||
|
||||
const workOrderStatus = this._var.params?.Statuses;
|
||||
|
||||
const ss = workOrderStatus.filter((s) => {
|
||||
let ss = workOrderStatus.filter((s) => {
|
||||
if (s.WorkOrderTypes?.length > 0 && !s.WorkOrderTypes.some(t => t.toLowerCase() == wotype?.toLowerCase()))
|
||||
return false;
|
||||
|
||||
@@ -953,6 +955,17 @@ export default class AddWorkOrder extends OptionBase {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
this._var.el.dropStatus.source = ss;
|
||||
ss = [{ Id: '-1', Name: '', Color: 'yellow' }, ...ss];
|
||||
const dropStatus = this._var.el.dropStatus;
|
||||
let sid = dropStatus.selected?.Id;
|
||||
if (!sid || !ss.some(s => s.Id == sid)) {
|
||||
const defaultStatus = ss.find(s => s.DefaultOnOpen);
|
||||
if (defaultStatus != null)
|
||||
sid = defaultStatus.Id;
|
||||
else
|
||||
sid = '-1'
|
||||
}
|
||||
dropStatus.source = ss;
|
||||
dropStatus.select(sid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user