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

@ -15,29 +15,6 @@
white-space: nowrap;
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
line-height: 32px;
}
.dialog-content table td.label {
width: 130px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.dialog-content table td input,
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 250px;
height: 18px;
padding: 1px;
}
#dialog_machines .dialog-content table td input {
width: auto;
}
@ -129,13 +106,7 @@
background: #000;
opacity: 0.2;
}
.div_filter .dropdown {
width: 100px;
}
</style>
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
<script src="../js/jquery.datetimepicker.full.js"></script>
<script src="<%=GetFileUrlWithVersion("js/controls.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../fic/js/utility.js")%>" type="text/javascript"></script>
<script type="text/javascript">
@ -146,25 +117,46 @@
}
function OnRefresh() {
showloading(true);
var type = $('#typeselectinput').find("option:selected").val();
var startdate = htmlencode($('#startdatetxt').val());
var enddate = htmlencode($('#enddatetxt').val());
var begindate = $('#startdatetxt').val();
var enddate = $('#enddatetxt').val();
if (begindate && !$('#startdatetxt').is(':valid')) {
showAlert(GetTextByKey('P_WOS_SURVEYSENTBEGINDATEISINVALID', "Survey sent begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (enddate && !$('#enddatetxt').is(':valid')) {
showAlert(GetTextByKey('P_WOS_SURVEYSENTENDDATEISINVALID', "Survey sent end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (begindate && enddate && begindate > enddate) {
showAlert(GetTextByKey("P_WOS_SURVEYSENTENDDATEMUSTBELATERTHANBEGINDATE", "Survey sent end date must be later than begin date."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
var wostartdate = htmlencode($('#wostartdatetxt').val());
var woenddate = htmlencode($('#woenddatetxt').val());
if (wostartdate && !$('#wostartdatetxt').is(':valid')) {
showAlert(GetTextByKey('P_WOS_WORKORDERCOMPLETEDBEGINDATEISINVALID', "Work order completed begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (woenddate && !$('#woenddatetxt').is(':valid')) {
showAlert(GetTextByKey('P_WOS_WORKORDERCOMPLETEDENDDATEISINVALID', "Work order completed end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (wostartdate && woenddate && wostartdate > woenddate) {
showAlert(GetTextByKey("P_WOS_WORKORDERCOMPLETEDENDDATEMUSTBELATERTHANBEGINDATE", "Work order completed end date must be later than begin date."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
var searchtxt = "";
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
var locations = [];
if (locationparam)
locations = locationparam.selectedvalue;
var advisors = [];
if (advisorparam)
advisors = advisorparam.selectedvalue;
var locations = $("#div_locations").dropdownVals();
var advisors = $("#div_advisors").dropdownVals();
var template = $('#templateselectinput').find("option:selected").val();
var param = JSON.stringify([type, startdate, enddate, searchtxt, JSON.stringify(locations), JSON.stringify(advisors), template, wostartdate, woenddate]);
showloading(true);
var param = JSON.stringify([type, begindate, enddate, searchtxt, JSON.stringify(locations), JSON.stringify(advisors), template, wostartdate, woenddate]);
param = htmlencode(param);
if (drilldownparams == null) {
@ -207,9 +199,9 @@
else if (r.Status === 1)
statusstr = GetTextByKey('P_WOS_REPLIED', 'Replied');
else if (r.Status === 2)
statusstr = GetTextByKey('P_WOS_XXX', 'No Sent');
statusstr = GetTextByKey('P_WOS_NOSENT', 'No Sent');
else if (r.Status === 3)
statusstr = GetTextByKey('P_WOS_XXX', 'Do Not Send');
statusstr = GetTextByKey('P_WOS_DONOTSEND', 'Do Not Send');
for (var j in r) {
if (j === "SentTime") {
r[j] = { DisplayValue: r["SentTimeStr"], Value: r[j] };
@ -222,8 +214,7 @@
}
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_dt.setData(rows);
@ -231,28 +222,23 @@
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#surveylist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#surveylist');
var list_columns = [
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } },
{ name: 'WorkOrderNumber', caption: GetTextByKey("P_WO_WORKORDERNUMBER", "Work Order Number"), valueIndex: 'WorkOrderNumber', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'SurveyName', caption: GetTextByKey("P_WOS_SURVEYNAME", "Survey Name"), valueIndex: 'SurveyName', css: { 'width': 150, 'text-align': 'left' } },
{ name: 'SurveyName', caption: GetTextByKey("P_WOS_SURVEYNAME", "Survey Name"), valueIndex: 'SurveyName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'Status', caption: GetTextByKey("P_WO_STATUS", "Status"), valueIndex: 'Status', allowFilter: true, css: { 'width': 160, 'text-align': 'left' } },
{ name: 'SentTime', caption: GetTextByKey("P_WOS_SENTDATE", "Sent Date"), valueIndex: 'SentTime', css: { 'width': 130, 'text-align': 'left' } },
{ name: 'SubmitTime', caption: GetTextByKey("P_WOS_REPLYDATE", "Reply Date"), valueIndex: 'SubmitTime', css: { 'width': 130, 'text-align': 'left' } },
{ name: 'CustomerName', caption: GetTextByKey("P_WOS_CUSTOMERNAME", "Customer Name"), valueIndex: 'CustomerName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'ContactName', caption: GetTextByKey("P_WOS_CONTACTNAME", "Contact Name"), valueIndex: 'ContactName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'ContactNumber', caption: GetTextByKey("P_WOS_CONTACTNUMBER", "Contact Number"), valueIndex: 'ContactNumber', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'ContactNumber', caption: GetTextByKey("P_WOS_CONTACTNUMBER", "Contact Number"), valueIndex: 'ContactNumberStr', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
//{ name: 'AssetVIN', caption: GetTextByKey("P_WO_VIN", "VIN"), valueIndex: 'AssetVIN', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'LocationName', caption: GetTextByKey("P_WO_LOCATION", "Location"), valueIndex: 'LocationName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'AdvisorName', caption: GetTextByKey("P_WO_ADVISOR", "Advisor"), valueIndex: 'AdvisorName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
{ name: 'AssetMake', caption: GetTextByKey("P_WO_MAKE", "Make"), valueIndex: 'AssetMake', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'AssetModel', caption: GetTextByKey("P_WO_MODEL", "Model"), valueIndex: 'AssetModel', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'DoNotSend', caption: GetTextByKey("P_JS_XXX", "Do Not Send"), valueIndex: 'DoNotSend', type: 3, css: { 'width': 90, 'text-align': 'center' } },
{ name: 'DoNotSend', caption: GetTextByKey("P_WOS_DONOTSEND", "Do Not Send"), valueIndex: 'DoNotSend', allowFilter: true, type: 3, css: { 'width': 90, 'text-align': 'center' } },
//{ name: 'AssetType', caption: GetTextByKey("P_WO_ASSETTYPE", "Asset Type"), valueIndex: 'AssetType', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Detail', caption: "", css: { 'width': 30, 'text-align': 'center' } },
{ name: 'DownloadPDF', caption: "", css: { 'width': 30, 'text-align': 'center' } },
@ -272,6 +258,9 @@
col.key = list_columns[hd].valueIndex;
col.allowFilter = list_columns[hd].allowFilter;
col.type = list_columns[hd].type;
if (col.name === "DoNotSend") {
col.filterSource = [{ Value: true, DisplayValue: GetTextByKey('P_UTILITY_YES', 'Yes') }, { Value: false, DisplayValue: GetTextByKey('P_UTILITY_NO', 'No') }];
}
if (col.name === "Selected") {
col.allcheck = true;
col.events = {
@ -285,8 +274,14 @@
};
}
}
if (col.name === "DoNotSend") {
else if (col.name === "Status") {
col.sortFilter = function (a, b) {
a = a.Status.DisplayValue;
b = b.Status.DisplayValue;
return a > b ? 1 : (a < b ? -1 : 0);
};
}
else if (col.name === "DoNotSend") {
col.events = {
onchange: function () {
var item = this;
@ -299,11 +294,11 @@
};
}
}
if (col.name === "Surveys") {
else if (col.name === "Surveys") {
col.sortable = false;
col.isurl = true;
col.text = "\uf15c";
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "file-lines";
col.events = {
onclick: function () {
onSendWOSurveys(this);
@ -317,11 +312,9 @@
display: (item.Status.Value == 2 && item.Contacts.length > 0) ? '' : 'none'
};
};
col.attrs = { 'title': GetTextByKey("P_XXXXX", 'Send Survey') };
col.attrs = { 'title': GetTextByKey("P_WOS_SENDSURVEY", 'Send Survey') };
}
if (col.name === "WorkOrderNumber" || col.name === "SurveyName") {
col.isurl = true;
else if (col.name === "WorkOrderNumber" || col.name === "SurveyName") {
//col.sortable = false;
col.events = {
onclick: function () {
@ -337,9 +330,10 @@
}
}
else if (col.name === "Detail") {
col.isurl = true;
col.text = "\uf0c9";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "bars";
col.events = {
onclick: function () {
openSurveyDetail();
@ -355,9 +349,10 @@
col.attrs = { 'title': GetTextByKey("P_IPT_DETAIL", 'Detail') };
}
else if (col.name === "DownloadPDF") {
col.isurl = true;
col.text = "\uf019";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "download";
col.events = {
onclick: function () {
window.open("SurveyManagement.aspx?rt=f&t=1&id=" + this.Id, '_blank');
@ -376,9 +371,10 @@
col.attrs = { 'title': GetTextByKey("P_IPT_DOWNLOADPDF", 'Download PDF') };
}
else if (col.name === "Print") {
col.isurl = true;
col.text = "\uf02f";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "print";
col.events = {
onclick: function () {
if (navigator.userAgent.indexOf('Firefox') >= 0 ||
@ -423,16 +419,10 @@
}
columns.push(col);
}
grid_dt.canMultiSelect = false;
grid_dt.multiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = openSurveyDetail;
grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
}
}
grid_dt.onRowDblClicked = openSurveyDetail;
}
function CloseDialog(type) {
@ -446,7 +436,7 @@
if (index < 0) {
showAlert(GetTextByKey("P_WOS_PLEASESELECTSURVEY", "Please select survey."), GetTextByKey("P_WORKORDERSURVEYTEMPLATES", "Work Order Survey Templates")); return;
}
var survey = grid_dt.source[index].Values;
var survey = grid_dt.source[index];
if (!survey) {
surveyid = undefined;
return;
@ -463,14 +453,7 @@
.showDialogRight2();
}
var locationparam;
var advisorparam;
var location_editmultiselect;
var advisor_editmultiselect;
function GetFilterDataSource() {
$('#div_locations').empty();
$('#div_departments').empty();
$('#div_advisors').empty();
woquery('GetFilterDataSource', '', function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
@ -481,23 +464,8 @@
var loc = data.Locations[i];
loc.sublevel = loc.PId > 0 ? 1 : 0;
}
locationparam = {
items: data.Locations,
selectedvalue: locationparam ? locationparam.selectedvalue : [],
width: 120,
valuepath: "ID",
textpath: "Name"
};
location_editmultiselect = editmultiselect(locationparam);
$('#div_locations').append(location_editmultiselect);
advisorparam = {
items: JSON.parse(JSON.stringify(data.Advisors)),
selectedvalue: advisorparam ? advisorparam.selectedvalue : [],
width: 120
};
advisor_editmultiselect = editmultiselect(advisorparam);
$('#div_advisors').append(advisor_editmultiselect);
$("#div_locations").dropdownSource(data.Locations);
$("#div_advisors").dropdownSource(data.Advisors);
}, function () {
});
}
@ -533,10 +501,8 @@
$('#enddatetxt').val(p[2]);
$('#wostartdatetxt').val('');
$('#woenddatetxt').val('');
if (!locationparam) locationparam = {};
locationparam.selectedvalue = JSON.parse(p[3]);
if (!advisorparam) advisorparam = {};
advisorparam.selectedvalue = JSON.parse(p[4]);
$("#div_locations").dropdownVals(JSON.parse(p[3]));
$("#div_advisors").dropdownVals(JSON.parse(p[4]));
if (p[5] != null) {
drilldownparams = p[5];
@ -551,45 +517,21 @@
GetFilterDataSource();
GetTemplateData();
$('#startdatetxt').datetimepicker({
timepicker: false,
format: 'm/d/Y',
enterLikeTab: false,
onSelectDate: function (v, inp) {
var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00');
inp.parent().data('val', [date]);
}
$("#div_locations").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Name',
valueKey: 'ID'
});
$('#enddatetxt').datetimepicker({
timepicker: false,
format: 'm/d/Y',
enterLikeTab: false,
onSelectDate: function (v, inp) {
var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00');
inp.parent().data('val', [date]);
}
});
$('#wostartdatetxt').datetimepicker({
timepicker: false,
format: 'm/d/Y',
enterLikeTab: false,
onSelectDate: function (v, inp) {
var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00');
inp.parent().data('val', [date]);
}
});
$('#woenddatetxt').datetimepicker({
timepicker: false,
format: 'm/d/Y',
enterLikeTab: false,
onSelectDate: function (v, inp) {
var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00');
inp.parent().data('val', [date]);
}
});
$("#div_advisors").css('width', 120).dropdown([], {
search: true,
multiselect: true,
allowselectall: true,
textKey: 'Value',
valueKey: 'Key'
});
$('#dialog_sendwosurveys').dialog(function () {
showmaskbg(false);
@ -665,8 +607,9 @@
if (!wo) {
var woids = [];
var wos = [];
for (var i = 0; i < grid_dt.source.length; i++) {
var gwo = grid_dt.source[i].Values;
var tempsource = grid_dt.source;
for (var i = 0; i < tempsource.length; i++) {
var gwo = tempsource[i];
if (gwo.Selected && gwo.Status.Value == 2 && gwo.Contacts.length > 0) {
woids.push(gwo.WorkOrderId);
wos.push(gwo);
@ -735,7 +678,7 @@
var tempid = $('#dialog_wosurveytemplates').val();
if (!tempid || tempid == "") {
showAlert(GetTextByKey("P_WO_XXXXXX", 'Please select a template.'), GetTextByKey("P_WO_SENDWORKORDERSURVEYS", 'Send Work Order Surveys'));
showAlert(GetTextByKey("P_WO_PLEASESELECTATEMPLATE", 'Please select a template.'), GetTextByKey("P_WO_SENDWORKORDERSURVEYS", 'Send Work Order Surveys'));
return;
}
@ -823,13 +766,13 @@
<%if (IsAdmin)
{%>
<span class="sbutton iconcog" style="float: right; font-size: 14px; margin-right: 15px; cursor: pointer;" onclick="openSurveyAutomation();">
<label data-lgid="P_XXXXX">Survey Automation</label></span>
<label data-lgid="P_WOS_SURVEYAUTOMATION">Survey Automation</label></span>
<%}%>
<div style="clear: both;"></div>
</div>
<div style="margin-top: -15px; font-size: 12px;">
<span style="margin-left: 310px;" data-lgid="P_FR_XXX">Survey Sent Date</span>
<span style="margin-left: 730px;" data-lgid="P_FR_XXX">Work Order Completed</span>
<span style="margin-left: 345px;" data-lgid="P_WOS_SURVEYSENTDATE">Survey Sent Date</span>
<span style="margin-left: 790px;" data-lgid="P_WOS_WORKORDERCOMPLETED">Work Order Completed</span>
</div>
<div class="search_bar">
<input type="password" autocomplete="new-password" style="display: none" />
@ -837,13 +780,13 @@
<div>
<select class="selectinput" style="width: 120px; margin-left: 5px;" id="templateselectinput"></select>
</div>
<span style="margin-left: 5px;" data-lgid="P_FR_XXX">Begin Date:&nbsp;</span>
<span style="margin-left: 5px;" data-lgid="P_WOS_BEGINDATE_COLON">Begin Date:&nbsp;</span>
<div>
<input id="startdatetxt" type="text" style="width: 70px; margin-left: 5px;" value="<%=BeginDate %>" autocomplete="off" />
<input id="startdatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" value="<%=BeginDate %>" autocomplete="off" />
</div>
<span style="margin-left: 5px;" data-lgid="P_FR_XXX">End Date:&nbsp;</span>
<span style="margin-left: 5px;" data-lgid="P_WOS_ENDDATE_COLON">End Date:&nbsp;</span>
<div>
<input id="enddatetxt" type="text" style="width: 70px; margin-left: 5px;" value="<%=EndDate %>" autocomplete="off" />
<input id="enddatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" value="<%=EndDate %>" autocomplete="off" />
</div>
<span data-lgid="P_WOS_SURVEYSTATUS" style="margin-left: 5px;">Survey Status:</span>&nbsp;&nbsp;
<div>
@ -851,21 +794,21 @@
<option value="-1" data-lgid="P_WOS_ALL">All</option>
<option value="0" data-lgid="P_WOS_WAITINGCUSTOMERREPLY">Waiting Customer Reply</option>
<option value="1" data-lgid="P_WOS_REPLIED">Replied</option>
<option value="2" data-lgid="P_WOS_XXX">No Sent</option>
<option value="3" data-lgid="P_WOS_XXX">Do Not Send</option>
<option value="2" data-lgid="P_WOS_NOSENT">No Sent</option>
<option value="3" data-lgid="P_WOS_DONOTSEND">Do Not Send</option>
</select>
</div>
<span data-lgid="P_WO_LOCATION_COLON">Location:</span>
<div id="div_locations"></div>
<span data-lgid="P_WO_ADVISOR_COLON">Advisor:</span>
<div id="div_advisors"></div>
<span style="margin-left: 5px;" data-lgid="P_FR_XXX">Begin Date:&nbsp;</span>
<span style="margin-left: 5px;" data-lgid="P_WOS_BEGINDATE_COLON">Begin Date:&nbsp;</span>
<div>
<input id="wostartdatetxt" type="text" style="width: 70px; margin-left: 5px;" value="<%=BeginDate %>" autocomplete="off" />
<input id="wostartdatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" value="<%=BeginDate %>" autocomplete="off" />
</div>
<span style="margin-left: 5px;" data-lgid="P_FR_XXX">End Date:&nbsp;</span>
<span style="margin-left: 5px;" data-lgid="P_WOS_ENDDATE_COLON">End Date:&nbsp;</span>
<div>
<input id="woenddatetxt" type="text" style="width: 70px; margin-left: 5px;" value="<%=EndDate %>" autocomplete="off" />
<input id="woenddatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" value="<%=EndDate %>" autocomplete="off" />
</div>
<input id="searchinputtxt" type="text" autocomplete="off" style="width: 100px; margin-left: 5px;" />
<input class="search" type="button" onclick="OnRefresh();" value="Search" data-lgid="P_FR_SEARCH" style="margin-left: 5px;" />
@ -873,7 +816,7 @@
</div>
<div class="function_title">
<span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_UM_REFRESH">Refresh</span>
<span class="sbutton iconsendsurvey" onclick="onSendWOSurveys(null);" data-lgid="P_UM_XXX">Send Survey</span>
<span class="sbutton iconsendsurvey" onclick="onSendWOSurveys(null);" data-lgid="P_WOS_SENDSURVEY">Send Survey</span>
<%--<span class="sbutton iconexport" onclick="OnExport();" data-lgid="P_MR_EXPORTTOEXCEL">Export to Excel</span>--%>
</div>
<div class="clear"></div>