You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

426 lines
14 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>我的工单操作</title>
<link href="/WF/Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="/WF/Scripts/bootstrap/css/font-awesome.css" rel="stylesheet">
<link href="/WF/Style/skin/css/style.css" rel="stylesheet" type="text/css" />
<link href="/WF/Style/skin/css/animate.css" rel="stylesheet" type="text/css" />
<link href="/WF/Style/skin/font/iconfont.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="/WF/Comm/JScript.js" type="text/javascript"></script>
<script type="text/javascript" src="/WF/Scripts/bootstrap/js/jquery.min.js"></script>
<script type="text/javascript" src="/WF/Scripts/bootstrap/js/bootstrap.min.js"></script>
<script src="/WF/Scripts/bootstrap/bootstrap-paginator/js/bootstrap-paginator.js" type="text/javascript"></script>
<script src="/WF/Scripts/QueryString.js" type="text/javascript"></script>
<script src="/WF/Scripts/config.js" type="text/javascript"></script>
<script src="/WF/Comm/Gener.js" type="text/javascript"></script>
<script src="../WF/Scripts/layui/layui/lay/modules/layer.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
var ens;
var workid;
var webUser = new WebUser();
var html = "";
//页面启动函数.
$(function () {
workid = GetQueryString("WorkID");
if (workid == null)
workid = 1110;
ens = new Entities("BP.MES.ND101Dtl1s");
ens.Retrieve("RefPK", workid);
//生成统计页面.
var todotlist = 0;
var myworks = 0;
var etcworks = 0;
var reWork = 0;
for (var i = 0; i < ens.length; i++) {
var en = ens[i];
if (en.WorkSta == 0) todotlist++;
if (en.WorkSta == 3 && en.Worker == webUser.No) myworks++;
if (en.WorkSta == 2 && en.Worker == webUser.No) reWork++; //需要整改的工作.
if (en.WorkSta == 1 && en.Worker != webUser.No) etcworks++;
}
var title = "";
// title += "待办的工作: " + todotlist + " 个";
title += "<br>我完成的工作: " + myworks + " 个";
title += "<br>需要整改的工作: " + reWork + " 个";
title += "<br>其他人做的工作: " + etcworks + " 个";
title += "<br>合计: " + ens.length + " 个";
$("#title").html(title);
//输出代办页面.
Todolist();
ReWork();
MyWork();
//EtcWork();
});
function ReWork() {
var html = "";
//首先输未 WorkSta=2 Worker == webUser.No的任务.
for (var i = 0; i < ens.length; i++) {
var en = ens[i];
if (en.WorkSta == 2 && en.Worker == webUser.No) {
} else {
continue;
}
html += "<table >";
html += "<caption > 序号 {" + i + "} </capiton>";
html += "<tr>";
html += "<tr>";
html += "<td>不合格理由</td>";
html += "<td>" + en.BeiZhu + "</td>";
html += "</tr>";
html += "<td>大类</td>";
html += "<td>" + en.DaLei + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>小类</td>";
html += "<td>" + en.XiaoLei + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>代号</td>";
html += "<td>" + en.DaiHao + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>名称</td>";
html += "<td>" + en.MingCheng + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>数量</td>";
html += "<td>" + en.ShuLiang + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>材料</td>";
html += "<td>" + en.CaiLiao + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>单重</td>";
html += "<td>" + en.DanZhong + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>厂家</td>";
html += "<td>" + en.ChangJia + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>所属装配</td>";
html += "<td>" + en.SuoShuZhuangPei + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>非物料标识</td>";
html += "<td>" + en.FeiWuLiaoBiaoShi + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>填写日期</td>";
html += "<td><input type=text id='TB_Data_" + en.OID + "' value='2021-11-12' /></td>";
html += "</tr>";
html += "<tr>";
html += "<td>开始</td>";
html += "<td><input type=text id='TB_DTFrom_" + en.OID + "' value='10:13' /></td>";
html += "</tr>";
html += "<tr>";
html += "<td>结束</td>";
html += "<td><input type=text id='TB_DTTo_" + en.OID + "' value='10:10' /></td>";
html += "</tr>";
html += "<tr>";
html += "<td><input type=button id='Btn_" + en.OID + "' onclick=\"DoReWork('" + en.OID + "')\" value='已经重做完毕' /></td>";
html += "</tr>";
html += "</table>";
}
$("#rework").html(html);
}
function DoReWork(workid) {
var en = new Entity("BP.MES.ND101Dtl1", workid);
var webUser = new WebUser();
en.WorkDate = $("#TB_Data_" + workid).val();
en.DTBegin = $("#TB_DTFrom_" + workid).val();
en.DTTo = $("#TB_DTTo_" + workid).val();
en.Worker = webUser.No;
en.WorkerName = webUser.Name;
en.WorkSta = 1;
en.Update();
Reload();
}
function Todolist() {
var html = "";
//首先输未 WorkSta=0 的任务.
for (var i = 0; i < ens.length; i++) {
var en = ens[i];
if (en.WorkSta != 0) continue;
html += "<table >";
html += "<caption > 序号 {" + i + "} </capiton>";
html += "<tr>";
html += "<td>大类</td>";
html += "<td>" + en.DaLei + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>小类</td>";
html += "<td>" + en.XiaoLei + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>代号</td>";
html += "<td>" + en.DaiHao + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>名称</td>";
html += "<td>" + en.MingCheng + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>数量</td>";
html += "<td>" + en.ShuLiang + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>材料</td>";
html += "<td>" + en.CaiLiao + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>单重</td>";
html += "<td>" + en.DanZhong + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>厂家</td>";
html += "<td>" + en.ChangJia + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>所属装配</td>";
html += "<td>" + en.SuoShuZhuangPei + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>非物料标识</td>";
html += "<td>" + en.FeiWuLiaoBiaoShi + "</td>";
html += "</tr>";
html += "<tr>";
html += "<td>填写日期</td>";
html += "<td><input type=text id='TB_Data_" + en.OID + "' value='2021-11-12' /></td>";
html += "</tr>";
html += "<tr>";
html += "<td>开始</td>";
html += "<td><input type=text id='TB_DTFrom_" + en.OID + "' value='10:13' /></td>";
html += "</tr>";
html += "<tr>";
html += "<td>结束</td>";
html += "<td><input type=text id='TB_DTTo_" + en.OID + "' value='10:10' /></td>";
html += "</tr>";
html += "<tr>";
html += "<td><input type=button id='Btn_" + en.OID + "' onclick=\"SaveIt('" + en.OID + "')\" value='提交' /></td>";
html += "</tr>";
html += "</table>";
}
$("#todolist").html(html);
}
//function MyWork() {
// var html = "";
// //输出我参与的任务. Worker= webUser.No;
// for (var i = 0; i < ens.length; i++) {
// var en = ens[i];
// if (en.WorkSta == 1 && en.Worker == webUser.No) {
// html += "<table>";
// html += "<tr>";
// html += "<td>序号</td>";
// html += "<td>" + i + "</td>";
// html += "</tr>";
// html += "<tr>";
// html += "<td>大类</td>";
// html += "<td>" + en.DaLei + "</td>";
// html += "</tr>";
// html += "<tr>";
// html += "<td>小类</td>";
// html += "<td>" + en.XiaoLei + "</td>";
// html += "</tr>";
// html += "<tr>";
// html += "<td>代号</td>";
// html += "<td>" + en.DaiHao + "</td>";
// html += "</tr>";
// html += "<tr>";
// html += "<td>名称</td>";
// html += "<td>" + en.MingCheng + "</td>";
// html += "</tr>";
// html += "<tr>";
// html += "<td>数量</td>";
// html += "<td>" + en.ShuLiang + "</td>";
// html += "</tr>";
// //html += "<tr>";
// //html += "<td>材料</td>";
// //html += "<td>" + en.CaiLiao + "</td>";
// //html += "</tr>";
// //html += "<tr>";
// //html += "<td>单重</td>";
// //html += "<td>" + en.DanZhong + "</td>";
// //html += "</tr>";
// //html += "<tr>";
// //html += "<td>厂家</td>";
// //html += "<td>" + en.ChangJia + "</td>";
// //html += "</tr>";
// //html += "<tr>";
// //html += "<td>所属装配</td>";
// //html += "<td>" + en.SuoShuZhuangPei+ "</td>";
// //html += "</tr>";
// // html += "<tr>";
// //html += "<td>非物料标识</td>";
// //html += "<td>" + en.FeiWuLiaoBiaoShi + "</td>";
// //html += "</tr>";
// html += "<tr>";
// html += "<td>填写日期</td>";
// html += "<td>" + en.WorkDate + "</td>";
// html += "</tr>";
// html += "<tr>";
// html += "<td><input type=button id='Btn_re" + en.OID + "' onclick=\"RebackIt('" + en.OID + "')\" value='撤销提交' /></td>";
// html += "</tr>";
// // html += "<tr>";
// //html += "<td>开始</td>";
// //html += "<td>" + en.DTBegin + "</td>";
// // html += "</tr>";
// //html += "<tr>";
// //html += "<td>结束</td>";
// //html += "<td>" + en.DTTo + "</td>";
// //html += "</tr>";
// html += "</table>";
// }
// }
// $("#mywork").html(html);
//}
function SaveIt(workid) {
var en = new Entity("BP.MES.ND101Dtl1", workid);
var webUser = new WebUser();
en.WorkDate = $("#TB_Data_" + workid).val();
en.DTBegin = $("#TB_DTFrom_" + workid).val();
en.DTTo = $("#TB_DTTo_" + workid).val();
en.Worker = webUser.No;
en.WorkerName = webUser.Name;
en.WorkSta = 1;
en.Update();
Reload();
}
function RebackIt(workid) {
if (window.confirm('确认要撤销吗?') == false)
return;
var en = new Entity("BP.MES.ND101Dtl1", workid);
var webUser = new WebUser();
en.WorkDate = "";// $("#TB_Data_" + workid).val();
en.DTBegin = "";// $("#TB_DTFrom_" + workid).val();
en.DTTo = "";// $("#TB_DTTo_" + workid).val();
en.Worker = "";
en.WorkerName = "";
en.WorkSta = 0;
en.Update();
Reload();
}
</script>
<style type="text/css">
.xx {
}
</style>
</head>
<body class="gray-bg">
<div id="title"></div>
<h3> 待办任务 </h3>
<div id="todolist"></div>
<h3> 需重做的工作 </h3>
<div id="rework"></div>
<!--<h3> 我的工作 </h3>
<div id="mywork"></div>-->
<!--<h3> 其他同事的工作 </h3>
<div id="etcwork"></div>-->
</body>
</html>