This commit is contained in:
2024-03-26 15:56:31 +08:00
parent 634e8b71ab
commit 0855ae42cd
547 changed files with 94818 additions and 60463 deletions

View File

@ -70,26 +70,25 @@
</style>
<script src="<%=GetFileUrlWithVersion("js/controls.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/schedule.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
<script type="text/javascript">
var iid = '<%=IID%>';
var scheduleUom = '<%=PmScheduleUom%>';
var scheduletype = '<%=ScheduleType%>';
var interval_label = getIntervalLabel();
var currentdate = "<%=CurrentDate %>";
var currentdate = "<%=CurrentDate %>";
function getIntervalLabel() {
switch (scheduletype) {
case "TBM": return "Days"; break;
case "TBM": return GetTextByKey("P_WO_DAYS", 'Days'); break;
case "ADM":
case "RDM":
if (scheduleUom === "Kilometre")
return "Kilometres"
return GetTextByKey("P_PM_KILOMETERS", 'Kilometers');
else
return "Miles";
return GetTextByKey("P_PM_MILES", 'Miles');
break;
default: return "Hours"; break;
default: return GetTextByKey("P_PM_HOURS", 'Hours');
}
}
@ -123,7 +122,8 @@
'Type': $('#sc_plantype').val(),
'Notes': notes,
'ScheduleUom': scheduleUom,
'Intervals': []
'Intervals': [],
'Enabled': $('#sc_enabled').prop('checked')
};
@ -208,7 +208,6 @@
next();
}
var editableSelectSchedule;
$(function () {
if (iid) {
$('#sc_plantype').val(scheduletype);
@ -253,7 +252,10 @@
pmquery('GETPMINTERVALBYSCHEDULEID', iid, function (data) {
$('#th_intervals').append(loadIntervals(data));
editableSelectSchedule = new $editableselect($("#dialog_schedule"));
$('#dialog_schedule').dropdown([], {
valueKey: 'PmScheduleID',
textKey: 'PmScheduleName'
});
getSchedules();
});
@ -282,15 +284,15 @@
tr.append('<th style="width: 150px;">' + GetTextByKey("P_PM_INTERVAL", "Interval") + '</th>');
tr.append('<th style="width: 180px;">' + GetTextByKey("P_PM_NOTIFICATIONPERIOD", "Notification Period") + '</th>');
tr.append('<th style="width: 80px;">' + GetTextByKey("P_PM_RECURRING", "Recurring") + '</th>');
//tr.append('<th style="width: 80px;">Predictive</th>');
//tr.app end('<th style="width: 80px;">Predictive</th>');
//tr.append('<th style="width: 100px;">Service Type</th>');
tr.append('<th style="width: 200px;">' + GetTextByKey("P_PM_SERVICEDESCRIPTION", "Service Description") + '</th>');
tr.append('<th style="width: 100px;">' + GetTextByKey("P_PM_EXPECTEDCOST", "Expected Cost") + '</th>');
tr.append('<th style="width: 80px;">' + GetTextByKey("P_PM_PRIORITY", "Priority") + '</th>');
tr.append($('<th style="width: 350px;" class="td_funcs"></th>')
.append($('<a onclick="return false;">' + GetTextByKey("P_PM_ADD", "Add") + '</a>').click(iid, _sc.addIntervalItem))
.append($('<div id="dialog_schedule" style="width: 150px; height: 22px;margin-left: 20px;float:left;"></div>'))
.append($('<a onclick="return false;" style="margin-left: 5px;">' + GetTextByKey("P_PM_COPYSCHEDULE", "Copy Schedule") + '</a>').click(function () {
.append($('<a onclick="return false;" style="margin-top:6px;">' + GetTextByKey("P_PM_ADD", "Add") + '</a>').click(iid, _sc.addIntervalItem))
.append($('<div id="dialog_schedule" style="width: 150px; margin-left: 20px;float:left;position: relative;" class="dropdown"></div>'))
.append($('<a onclick="return false;" style="margin-left: 5px;margin-top:6px;">' + GetTextByKey("P_PM_COPYSCHEDULE", "Copy Schedule") + '</a>').click(function () {
onCopySchedule();
})
)
@ -326,9 +328,8 @@
schedules.push(s);
}
}
editableSelectSchedule.datasource = schedules;
editableSelectSchedule.valuepath = "PmScheduleID"
editableSelectSchedule.displaypath = "PmScheduleName";
$('#dialog_schedule').dropdownSource(schedules);
}
}, function (err) {
@ -336,7 +337,7 @@
}
function onCopySchedule() {
var schedule = editableSelectSchedule.selecteditem();
var schedule = $('#dialog_schedule').dropdownItem();
if (schedule && schedule.Intervals && schedule.Intervals.length > 0) {
var tboby = $('#tbody_intervals');
for (var i = 0; i < schedule.Intervals.length; i++) {
@ -374,15 +375,21 @@
<td>
<input type="text" id="sc_name" value="<%=Schedule == null ? null : Schedule.PmScheduleName %>" maxlength="200" autocomplete="off" /></td>
</tr>
<tr>
<th style="width: 140px;" data-lgid="P_CRE_ENABLED_COLON">Enabled:</th>
<td>
<input type="checkbox" id="sc_enabled" <%=PmEnabled ? " checked=\"checked\"" : "" %> />
</td>
</tr>
<tr>
<th data-lgid="P_PM_PLANTYPE_COLON">Plan Type:</th>
<td>
<select id="sc_plantype" style="width: 150px;" disabled="disabled">
<option value="ADM">Absolute Distance</option>
<option value="PM">Absolute Hours</option>
<option value="RDM">Relative Distance</option>
<option value="HM">Relative Hours</option>
<option value="TBM">Relative Time</option>
<option value="ADM" data-lgid="P_PM_ABSOLUTEDISTANCE">Absolute Distance</option>
<option value="PM" data-lgid="P_PM_ABSOLUTEHOURS">Absolute Hours</option>
<option value="RDM" data-lgid="P_PM_RELATIVEDISTANCE">Relative Distance</option>
<option value="HM" data-lgid="P_PM_RELATIVEEHOURS">Relative Hours</option>
<option value="TBM" data-lgid="P_PM_RELATIVEETIME">Relative Time</option>
</select></td>
</tr>
<tr id="trScheduleUom" style="display: none;">
@ -405,7 +412,9 @@
</thead>
</table>
</div>
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
</div>
<div class="dialog" id="dialog_interval" style="display: none;">
<div class="dialog-title"><span class="title" data-lgid="P_PM_ADDINTERVAL">Add Interval</span><em class="dialog-close"></em></div>