You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
390 lines
15 KiB
390 lines
15 KiB
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMasterForDisplay.Master"
|
|
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.Package.PackageModel>" %>
|
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
|
线边库存大屏显示
|
|
</asp:Content>
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
|
<script language="javascript">
|
|
|
|
var count = 0;
|
|
$(function () {
|
|
showTime();
|
|
//刷新
|
|
//setTimeout("RefreshMainTable()", 60000);
|
|
});
|
|
|
|
function clickeMain(mc) {
|
|
divMain.style.display = 'none';
|
|
divChild.style.display = 'block';
|
|
//打开child
|
|
RefreshChildTable(mc);
|
|
}
|
|
function clickeReturn() {
|
|
divMain.style.display = 'block';
|
|
divChild.style.display = 'none';
|
|
//刷新main
|
|
RefreshMainTable();
|
|
}
|
|
//编辑页面
|
|
function clickeEdit(pid) {
|
|
openAppWindow1('编辑', 'Edit?PID=' + pid, '350', '380');
|
|
}
|
|
//刷新Main
|
|
function RefreshMainTable() {
|
|
// if (count == 120) {
|
|
// window.location.href = window.location.href;
|
|
// }
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "/PackageDisplay/GetMainDatas",
|
|
dataType: "json",
|
|
data: {},
|
|
success: function (data) {
|
|
divMain.innerHTML = data.MainDataHtml;
|
|
// if (data.FisDataPageIndex == data.FisDataPageCount) {
|
|
// //从第一开始
|
|
// $("#FisDataPageIndex").val("0");
|
|
// }
|
|
// else {
|
|
// $("#FisDataPageIndex").val(data.FisDataPageIndex);
|
|
// }
|
|
// document.getElementById("fispage").innerHTML = data.FisDataPageInfo;
|
|
},
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
//setTimeout("RefreshMainTable()", 10000);
|
|
//alert("123");
|
|
}
|
|
|
|
});
|
|
|
|
count = count + 1;
|
|
|
|
//50秒后定时提示及时消息
|
|
setTimeout("RefreshMainTable()", 60000);
|
|
}
|
|
//打开Child
|
|
function RefreshChildTable(mc) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "/PackageDisplay/GetChildDatas?materialCode=" + mc,
|
|
dataType: "json",
|
|
data: {},
|
|
success: function (data) {
|
|
//alert(data.ChildDataHtml);
|
|
divChild.innerHTML = data.ChildDataHtml;
|
|
// if (data.FisDataPageIndex == data.FisDataPageCount) {
|
|
// //从第一开始
|
|
// $("#FisDataPageIndex").val("0");
|
|
// }
|
|
// else {
|
|
// $("#FisDataPageIndex").val(data.FisDataPageIndex);
|
|
// }
|
|
// document.getElementById("fispage").innerHTML = data.FisDataPageInfo;
|
|
},
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
//setTimeout("RefreshChildTable(mc)", 10000);
|
|
//alert("456");
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
function showTime() {
|
|
time = new Date();
|
|
hours = time.getHours();
|
|
minutes = time.getMinutes();
|
|
seconds = time.getSeconds();
|
|
year = time.getFullYear();
|
|
month = time.getMonth() + 1;
|
|
date = time.getDate();
|
|
day = time.getDay();
|
|
dayArray = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
|
|
// 如果分或秒是个位数,则在十位补0
|
|
if (minutes <= 9)
|
|
minutes = "0" + minutes;
|
|
if (seconds <= 9)
|
|
seconds = "0" + seconds;
|
|
|
|
//theDate = year + "年" + month + "月" + date + "日" + " " + dayArray[day];
|
|
theDate = year + "年" + month + "月" + date + "日" + " ";
|
|
theTime = hours + ":" + minutes + ":" + seconds;
|
|
|
|
document.getElementById("systemtimelbl").innerHTML = theDate + theTime;
|
|
setTimeout("showTime()", 1000);
|
|
}
|
|
</script>
|
|
<style type="text/css">
|
|
.logo
|
|
{
|
|
width: 180px;
|
|
background-image: url(/Content/Img/logo.PNG);
|
|
background-repeat: no-repeat;
|
|
background-position: center;
|
|
}
|
|
.pagetitle
|
|
{
|
|
font-family: 微软雅黑;
|
|
font-size: 45px;
|
|
font-weight: bold;
|
|
float: left;
|
|
}
|
|
.timelabel
|
|
{
|
|
font-family: 微软雅黑;
|
|
font-size: 24px;
|
|
line-height: 70px;
|
|
vertical-align: middle;
|
|
font-weight: bold;
|
|
float: right;
|
|
margin-right: 20px;
|
|
}
|
|
.menulabel
|
|
{
|
|
margin-top: 22px;
|
|
margin-right: 20px;
|
|
float: right;
|
|
}
|
|
.datagrid-header-row, .datagrid-row
|
|
{
|
|
height: 60px;
|
|
}
|
|
.datagrid-header .datagrid-cell span
|
|
{
|
|
font-size: 32px;
|
|
font-weight: bold;
|
|
}
|
|
.datagrid-cell, .datagrid-cell-group, .datagrid-header-rownumber, .datagrid-cell-rownumber
|
|
{
|
|
height: 38px;
|
|
line-height: 38px;
|
|
font-size: 32px;
|
|
/*color: #000000;*/
|
|
font-family: 微软雅黑;
|
|
padding-left: 15px;
|
|
padding-right: 15px;
|
|
}
|
|
.datagrid-header td, .datagrid-body td, .datagrid-footer td
|
|
{
|
|
border-width: 0 2px 2px 0;
|
|
border-style: solid;
|
|
}
|
|
.datagrid-customgroup
|
|
{
|
|
height: 42px;
|
|
font-size: 30px;
|
|
background-color: #e7eff5;
|
|
color: #000;
|
|
font-weight: bolder;
|
|
}
|
|
.datagrid-customgroup .datagrid-group-expander
|
|
{
|
|
display: none;
|
|
}
|
|
.datagrid-customgroup .datagrid-group-title
|
|
{
|
|
line-height: 40px;
|
|
font-weight: bold;
|
|
font-family: 黑体;
|
|
}
|
|
</style>
|
|
<style type="text/css">
|
|
.container
|
|
{
|
|
/*overflow: hidden;*/
|
|
}
|
|
.box
|
|
{
|
|
position: relative;
|
|
}
|
|
.content
|
|
{
|
|
/*position: absolute;
|
|
display:block*/
|
|
}
|
|
</style>
|
|
<div region="north" class="easyui-layout" data-options="border:false" style="height: 80px">
|
|
<div class="logo" region="west" data-options="border:false">
|
|
</div>
|
|
<div region="center" data-options="border:false">
|
|
<span class="pagetitle">富维安道拓——线边库存</span> <span id="systemtimelbl" class="timelabel">
|
|
2018年9月7日 9:50:00</span> <span class="menulabel"><a id="mb" class="easyui-menubutton"
|
|
data-options="iconCls:'icon-large_smartart',menu:'#mm'">选项</a></span>
|
|
</div>
|
|
<div region="south" data-options="border:false" style="height: 1px; background-color: #a7a8ac">
|
|
</div>
|
|
</div>
|
|
<div region="center" class="easyui-layout" data-options="border:false">
|
|
<div region="north" data-options="border:false" style="height: 62px">
|
|
<table class="easyui-datagrid" data-options="
|
|
singleSelect: true,
|
|
fitColumns: true,
|
|
">
|
|
<thead>
|
|
<tr>
|
|
<%--<th data-options="field:'WORKCENTER_NAME'">
|
|
工作中心
|
|
</th>--%>
|
|
<th data-options="field:'WORKCELL_NAME',width:250">
|
|
工序
|
|
</th>
|
|
<th data-options="field:'MATERIAL_SHORT',width:300,fixed:true">
|
|
物料名称
|
|
</th>
|
|
<th data-options="field:'MATERIAL_CODE',width:300">
|
|
物料号
|
|
</th>
|
|
<th data-options="field:'REMAINDER',width:140,align:'right'">
|
|
剩余件数
|
|
</th>
|
|
<th data-options="field:'PACKAGECOUNT',width:140,align:'right'">
|
|
剩余箱数
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div region="center" id="container" class="container" data-options="border:false">
|
|
<div id="t1" class="content">
|
|
<table id="dg1">
|
|
</table>
|
|
</div>
|
|
<div id="t2" class="content">
|
|
<table id="dg2">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript" language="javascript">
|
|
$(function () {
|
|
var dgOption = {
|
|
rownumbers: false,
|
|
showHeader: false,
|
|
singleSelect: true,
|
|
iconCls: 'icon-save',
|
|
fitColumns: true,
|
|
columns: [[{ field: 'WORKCELL_NAME', width: 250, title: "工序" },
|
|
{ field: 'MATERIAL_SHORT', width: 300, fixed: true, title: "物料名称" },
|
|
{ field: 'MATERIAL_CODE', width: 300, title: "物料号" },
|
|
{ field: 'REMAINDER', width: 140, align: 'right', title: "剩余件数" },
|
|
{ field: 'PACKAGECOUNT', width: 140, align: 'right', title: "剩余箱数" }
|
|
]],
|
|
autoRowHeight: false,
|
|
url: 'GetMainDatas',
|
|
method: 'get',
|
|
view: groupview,
|
|
groupField: 'WORKCELL_NAME',
|
|
groupFormatter: function (value, rows) {
|
|
var row = rows[0];
|
|
return row.WORKCENTER_NAME + ' - ' + row.WORKCELL_NAME;
|
|
},
|
|
groupStyler: function (value, rows) {
|
|
//return 'height:32px;font-size:30px;background-color:#e7eff5;color:#000;font-weight:bolder;';
|
|
return { class: 'datagrid-customgroup', style: '' }
|
|
},
|
|
rowStyler: function (index, row) {
|
|
if (row.REMAINDER <= 0) {
|
|
return 'background-color:#ff0000;color:#fff;'; // return inline style
|
|
}
|
|
else if (row.REMAINDER <= row.PACKAGECAPACITY) {
|
|
return 'background-color:#ff9900;color:#fff;';
|
|
}
|
|
else {
|
|
return '';
|
|
}
|
|
},
|
|
loadFilter: function (data) {
|
|
if (!_datafilter) {
|
|
return { total: data.length, rows: data };
|
|
}
|
|
else {
|
|
var newdata = [];
|
|
for (var i = 0; i < data.length; i++) {
|
|
if (data[i].REMAINDER < data[i].PACKAGECAPACITY) {
|
|
newdata.push(data[i]);
|
|
}
|
|
}
|
|
return { total: newdata.length, rows: newdata };
|
|
}
|
|
}
|
|
};
|
|
|
|
$("#dg1").datagrid(dgOption);
|
|
$("#dg2").datagrid(dgOption);
|
|
|
|
// $(document).bind('contextmenu', function (e) {
|
|
// e.preventDefault();
|
|
// $('#mm').menu('show', {
|
|
// left: e.pageX,
|
|
// top: e.pageY
|
|
// });
|
|
// });
|
|
|
|
var _autoscroll = true;
|
|
var _datafilter = false;
|
|
|
|
|
|
var _t1 = document.getElementById("t1");
|
|
var _t2 = document.getElementById("t2");
|
|
var y = 0;
|
|
var fun = function () {
|
|
var height = $("#t1").height();
|
|
var containerheight = $("#container").height();
|
|
if (_autoscroll && height + 10 >= containerheight) {
|
|
_t1.style.position = 'absolute';
|
|
_t2.style.position = 'absolute';
|
|
_t2.style.display = 'block';
|
|
_t1.style.top = y + 'px';
|
|
_t2.style.top = (y + height) + 'px';
|
|
y--;
|
|
if ((y + height) == 0) {
|
|
y = 0;
|
|
}
|
|
}
|
|
else {
|
|
_t1.style.position = '';
|
|
_t2.style.display = 'none';
|
|
y = 0;
|
|
}
|
|
};
|
|
setInterval(fun, 5);
|
|
|
|
var reloadData = function () {
|
|
$('#dg1').datagrid('reload');
|
|
$('#dg2').datagrid('reload');
|
|
}
|
|
setInterval(reloadData, 10000);
|
|
|
|
$("#autoScroll").change(function (a, b) {
|
|
_autoscroll = $("#autoScroll").prop("checked");
|
|
if (!_autoscroll) {
|
|
// $("#container").css({ "overflow": "inherit" })
|
|
$("#t1").css({ "position": "inherit" });
|
|
$("#t2").css({ "position": "inherit" });
|
|
$("#t2").css({ "display": "none" });
|
|
}
|
|
else {
|
|
// $("#container").css({ "overflow": "hidden" })
|
|
$("#t1").css({ "position": "absolute" });
|
|
$("#t2").css({ "position": "absolute" });
|
|
$("#t2").css({ "display": "block" });
|
|
}
|
|
});
|
|
$("#datafilter").change(function (a, b) {
|
|
_datafilter = $("#datafilter").prop("checked");
|
|
});
|
|
});
|
|
</script>
|
|
<div id="mm" class="menu-content" style="width: 190px; padding: 10px;">
|
|
<div style="padding: 5px;">
|
|
<input type="checkbox" checked="checked" name="autoScroll" id="autoScroll" style="margin-top: 5px;" /><span
|
|
style="line-height: 23px; vertical-align: top;">自动滚动</span>
|
|
</div>
|
|
<div style="padding: 5px;">
|
|
<input type="checkbox" id="datafilter" style="margin-top: 5px;" /><span
|
|
style="line-height: 23px; vertical-align: top;">只显示低库存</span>
|
|
</div>
|
|
</div>
|
|
</asp:Content>
|
|
|