添加项目文件。
This commit is contained in:
388
Epost.TestToolsWeb/Views/Home/Index.cshtml
Normal file
388
Epost.TestToolsWeb/Views/Home/Index.cshtml
Normal file
@ -0,0 +1,388 @@
|
||||
@{
|
||||
ViewBag.Title = "设备控制";
|
||||
|
||||
}
|
||||
<div id="mainRight" class="mainRight">
|
||||
<div class="tit">设备控制</div>
|
||||
<div class="main">
|
||||
<div class="sbControl">
|
||||
<a href="javascript:;" id="Clear" onclick="ClearALL()">
|
||||
<p id="ClearImg" class="imgWrap"><img src="~/Content/imgs/manage_p34.png" /></p>
|
||||
<p class="p_txt">初始化</p>
|
||||
</a>
|
||||
<a href="javascript:;" id="Test">
|
||||
<p id="TestStart" class="NewimgWrap"><img src="~/Content/imgs/manage_p31.png" /></p>
|
||||
<p class="p_txt">设备检测</p>
|
||||
</a>
|
||||
<a href="javascript:;" id="TestEnd">
|
||||
<p class="NewimgWrap" id="P_TestEnd"> <img src="~/Content/imgs/manage_p30.png" /></p>
|
||||
<p class="p_txt">检测结束</p>
|
||||
</a>
|
||||
<a href="javascript:;" id="startWork">
|
||||
<p class="NewimgWrap" id="StartWork"><img src="~/Content/imgs/manage_p32.png" /></p>
|
||||
<p class="p_txt">开始作业</p>
|
||||
</a>
|
||||
<a href="javascript:;" onclick="EndWork()" id="clsWork">
|
||||
<p class="imgWrap" id="CloseWork"><img src="~/Content/imgs/manage_p33.png" /></p>
|
||||
<p class="p_txt">结束作业</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="doing" style="text-align:center;width:50px; margin-top:-200px; z-index:9999"></div>
|
||||
<div class="copyRight" style="color:red; font-weight:bold; font-size:18px;"><label id="showMessage" name="showMessage" class="showMessage"></label></div>
|
||||
<input type="hidden" id="isClear" value="@ViewBag.isClear" />
|
||||
<input type="hidden" id="isWork" value="@ViewBag.isWork" />
|
||||
@*<div class="copyRight">Copyright © 2018京ICP备10011451号 版权所有:上海驿传物流科技有限公司</div>*@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="~/Scripts/angular/angular.min.js"></script>
|
||||
<script src="~/Scripts/pagination/tm.pagination.js"></script>
|
||||
<script src="~/Scripts/angular-list/Index.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).keyup(function (event) {
|
||||
if (event.keyCode == 13) {
|
||||
SubmitForm();
|
||||
}
|
||||
});
|
||||
|
||||
function SubmitForm() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '@Url.Action("StartWork", "Home")',
|
||||
dataType: "json",
|
||||
beforeSend: function (XMLHttpRequest) {
|
||||
$("#doing").html("<img src='/Content/imgs/timg.gif' width='100px';>");
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.Success) {
|
||||
// $("#showMessage").text("箱号:" + barcode + "正在拣货!");
|
||||
$("#barcode").val("");
|
||||
$("#barcode")[0].focus();
|
||||
|
||||
}
|
||||
else {
|
||||
$("#showMessage").text(data.Message);
|
||||
$("#barcode").val("");
|
||||
|
||||
$("#barcode")[0].focus();
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
// 请求完成后的回调函数 (请求成功或失败之后均调用)
|
||||
complete: function (XMLHttpRequest, textStatus) {
|
||||
|
||||
$("#doing").empty();
|
||||
},
|
||||
// 请求失败时调用此函数。
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
$("#doing").empty();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function ClearALL() {
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '@Url.Action("ClearALL", "Home")',
|
||||
dataType: "json",
|
||||
beforeSend: function (XMLHttpRequest) {
|
||||
$("#doing").html("<img src='/Content/imgs/timg.gif' width='100px';>");
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.Success) {
|
||||
$("#showMessage").text("初始化成功!");
|
||||
isClearFN();
|
||||
}
|
||||
else {
|
||||
$("#showMessage").text(data.Message);
|
||||
}
|
||||
},
|
||||
// 请求完成后的回调函数 (请求成功或失败之后均调用)
|
||||
complete: function (XMLHttpRequest, textStatus) {
|
||||
|
||||
$("#doing").empty();
|
||||
},
|
||||
// 请求失败时调用此函数。
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
$("#doing").empty();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
} function TestStart() {
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '@Url.Action("TestStart", "Home")',
|
||||
dataType: "json",
|
||||
beforeSend: function (XMLHttpRequest) {
|
||||
$("#doing").html("<img src='/Content/imgs/timg.gif' width='100px';>");
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.Success) {
|
||||
$("#showMessage").text("设备检测!");
|
||||
$("#Test").removeAttr("onclick");
|
||||
$("#startWork").removeAttr("onclick");
|
||||
var imgClass = $("#TestStart");
|
||||
imgClass.removeClass("imgWrap");
|
||||
imgClass.addClass("NewimgWrap");
|
||||
|
||||
var imgClass = $("#StartWork");
|
||||
imgClass.removeClass("imgWrap");
|
||||
imgClass.addClass("NewimgWrap");
|
||||
}
|
||||
else {
|
||||
$("#showMessage").text("失败!");
|
||||
}
|
||||
},
|
||||
// 请求完成后的回调函数 (请求成功或失败之后均调用)
|
||||
complete: function (XMLHttpRequest, textStatus) {
|
||||
|
||||
$("#doing").empty();
|
||||
},
|
||||
// 请求失败时调用此函数。
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
$("#doing").empty();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
function TestEnd() {
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '@Url.Action("TestEnd", "Home")',
|
||||
dataType: "json",
|
||||
beforeSend: function (XMLHttpRequest) {
|
||||
$("#doing").html("<img src='/Content/imgs/timg.gif' width='100px';>");
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.Success) {
|
||||
$("#showMessage").text("检测结束!");
|
||||
$("#startWork").attr("onclick", "StartWork();");
|
||||
$("#Test").attr("onclick", "TestStart();");
|
||||
var imgClass = $("#StartWork");
|
||||
imgClass.removeClass("NewimgWrap");
|
||||
imgClass.addClass("imgWrap");
|
||||
|
||||
|
||||
|
||||
var imgClass = $("#TestStart");
|
||||
imgClass.removeClass("NewimgWrap");
|
||||
imgClass.addClass("imgWrap");
|
||||
}
|
||||
else {
|
||||
$("#showMessage").text("失败!");
|
||||
}
|
||||
}
|
||||
,
|
||||
// 请求完成后的回调函数 (请求成功或失败之后均调用)
|
||||
complete: function (XMLHttpRequest, textStatus) {
|
||||
|
||||
$("#doing").empty();
|
||||
},
|
||||
// 请求失败时调用此函数。
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
$("#doing").empty();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
function StartWork() {
|
||||
$("#startWork").removeAttr("onclick");
|
||||
$("#Test").removeAttr("onclick");
|
||||
$("#TestEnd").removeAttr("onclick");
|
||||
$("#Clear").removeAttr("onclick");
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '@Url.Action("StartWork", "Home")',
|
||||
dataType: "json",
|
||||
beforeSend: function (XMLHttpRequest) {
|
||||
$("#doing").html("<img src='/Content/imgs/timg.gif' width='200px';>");
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.Success) {
|
||||
$("#showMessage").text("开始作业!");
|
||||
|
||||
isWorkFN();
|
||||
}
|
||||
else {
|
||||
$("#showMessage").text("开始作业失败!");
|
||||
}
|
||||
}
|
||||
,
|
||||
// 请求完成后的回调函数 (请求成功或失败之后均调用)
|
||||
complete: function (XMLHttpRequest, textStatus) {
|
||||
|
||||
$("#doing").empty();
|
||||
},
|
||||
// 请求失败时调用此函数。
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
$("#doing").empty();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function EndWork() {
|
||||
$("#clsWork").removeAttr("onclick");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '@Url.Action("EndWork", "Home")',
|
||||
dataType: "json",
|
||||
beforeSend: function (XMLHttpRequest) {
|
||||
$("#doing").html("<img src='/Content/imgs/timg.gif' width='200px';>");
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.Success) {
|
||||
$("#showMessage").text("结束作业!");
|
||||
|
||||
$("#Clear").attr("onclick", "ClearALL();");
|
||||
|
||||
|
||||
|
||||
|
||||
var imgClass = $("#ClearImg");
|
||||
imgClass.removeClass("NewimgWrap");
|
||||
imgClass.addClass("imgWrap");
|
||||
}
|
||||
else {
|
||||
$("#showMessage").text("失败!");
|
||||
}
|
||||
}
|
||||
,
|
||||
// 请求完成后的回调函数 (请求成功或失败之后均调用)
|
||||
complete: function (XMLHttpRequest, textStatus) {
|
||||
|
||||
$("#doing").empty();
|
||||
},
|
||||
// 请求失败时调用此函数。
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
$("#doing").empty();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
function CloseWork() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '@Url.Action("Close", "Home")',
|
||||
dataType: "json",
|
||||
beforeSend: function (XMLHttpRequest) {
|
||||
$("#doing").html("<img src='/Content/imgs/timg.gif' width='200px';>");
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.Success) {
|
||||
|
||||
CloseWebPage();
|
||||
}
|
||||
else {
|
||||
$("#showMessage").text("失败!");
|
||||
}
|
||||
}
|
||||
,
|
||||
// 请求完成后的回调函数 (请求成功或失败之后均调用)
|
||||
complete: function (XMLHttpRequest, textStatus) {
|
||||
|
||||
$("#doing").empty();
|
||||
},
|
||||
// 请求失败时调用此函数。
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
$("#doing").empty();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function CloseWebPage() {
|
||||
if (navigator.userAgent.indexOf("MSIE") > 0) {
|
||||
if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {
|
||||
window.opener = null;
|
||||
window.close();
|
||||
} else {
|
||||
window.open('', '_top');
|
||||
window.top.close();
|
||||
}
|
||||
}
|
||||
else if (navigator.userAgent.indexOf("Firefox") > 0 || navigator.userAgent.indexOf("Chrome") > 0) {
|
||||
//window.location.href = 'about:blank ';
|
||||
window.location.href = "about:blank";
|
||||
window.close();
|
||||
}
|
||||
else {
|
||||
window.opener = null;
|
||||
window.open('', '_self');
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function isClearFN() {
|
||||
var imgClass = $("#ClearImg");
|
||||
imgClass.removeClass("imgWrap");
|
||||
imgClass.addClass("NewimgWrap");
|
||||
$("#Clear").removeAttr("onclick");
|
||||
|
||||
$("#startWork").attr("onclick", "StartWork();");
|
||||
$("#Test").attr("onclick", "TestStart();");
|
||||
$("#TestEnd").attr("onclick", "TestEnd();");
|
||||
$("#clsWork").attr("onclick", "EndWork();");
|
||||
var imgClass = $("#StartWork");
|
||||
imgClass.removeClass("NewimgWrap");
|
||||
imgClass.addClass("imgWrap");
|
||||
var imgClass = $("#P_TestEnd");
|
||||
imgClass.removeClass("NewimgWrap");
|
||||
imgClass.addClass("imgWrap");
|
||||
var imgClass = $("#TestStart");
|
||||
imgClass.removeClass("NewimgWrap");
|
||||
imgClass.addClass("imgWrap");
|
||||
}
|
||||
|
||||
function isWorkFN() {
|
||||
var imgClass = $("#StartWork");
|
||||
imgClass.removeClass("imgWrap");
|
||||
imgClass.addClass("NewimgWrap");
|
||||
var imgClass = $("#P_TestEnd");
|
||||
imgClass.removeClass("imgWrap");
|
||||
imgClass.addClass("NewimgWrap");
|
||||
var imgClass = $("#TestStart");
|
||||
imgClass.removeClass("imgWrap");
|
||||
imgClass.addClass("NewimgWrap");
|
||||
var imgClass = $("#ClearImg");
|
||||
imgClass.removeClass("imgWrap");
|
||||
imgClass.addClass("NewimgWrap");
|
||||
}
|
||||
|
||||
$(function () {
|
||||
var clear= $("#isClear").val();
|
||||
var work= $("#isWork").val();
|
||||
if (clear == 1) {
|
||||
isClearFN();
|
||||
}
|
||||
if (work == 1) { isWorkFN(); }
|
||||
});
|
||||
</script>
|
||||
|
46
Epost.TestToolsWeb/Views/Web.config
Normal file
46
Epost.TestToolsWeb/Views/Web.config
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
<add namespace="System.Web.Mvc.Ajax" />
|
||||
<add namespace="System.Web.Mvc.Html" />
|
||||
<add namespace="System.Web.Optimization"/>
|
||||
<add namespace="System.Web.Routing" />
|
||||
<add namespace="Epost.TestToolsWeb" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
|
||||
|
||||
</appSettings>
|
||||
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
|
||||
<system.web>
|
||||
|
||||
<compilation>
|
||||
<assemblies>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
</system.web>
|
||||
</configuration>
|
1
Epost.TestToolsWeb/Views/_ViewStart.cshtml
Normal file
1
Epost.TestToolsWeb/Views/_ViewStart.cshtml
Normal file
@ -0,0 +1 @@
|
||||
|
Reference in New Issue
Block a user