289 lines
9.3 KiB
Plaintext
289 lines
9.3 KiB
Plaintext
<%@page import="com.sipai.tools.CommString"%>
|
|
<%@page import="com.sipai.entity.plan.DailyPlanTaskDemand"%>
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ page import="com.sipai.tools.SessionManager"%>
|
|
<%
|
|
SessionManager sessionManager = new SessionManager();
|
|
%>
|
|
|
|
|
|
<%request.setAttribute("Flag_Start",DailyPlanTaskDemand.Flag_Start);%>
|
|
<%request.setAttribute("Flag_Report",DailyPlanTaskDemand.Flag_Report);%>
|
|
<%request.setAttribute("Flag_CarryOver",DailyPlanTaskDemand.Flag_CarryOver);%>
|
|
|
|
<%request.setAttribute("resp_pass",CommString.Resp_Success);%>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title></title>
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
|
<script type="text/javascript">
|
|
var grid;
|
|
|
|
var deleteFun = function(id) {
|
|
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
|
if (r) {
|
|
$.post(ext.contextPath + '/work/workorder/delete.do', {id : id}, function(data) {
|
|
if(data==1){
|
|
parent.$.messager.alert('提示','删除成功','info',function(){
|
|
grid.datagrid('reload');
|
|
});
|
|
}else{
|
|
parent.$.messager.alert('提示','删除失败','info');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
|
|
|
|
|
|
var districtwork = function(planid,workorderid,processid){
|
|
//alert(planid+workorderid+processid)
|
|
var dialog = parent.ext.modalDialog({
|
|
title : '任务调度',
|
|
url : ext.contextPath + '/work/workorder/districtwork.do?planid='+planid+'&workorderid='+workorderid+'&processid='+processid,
|
|
width:1000,
|
|
height:500,
|
|
onClose:function(){
|
|
var res=dialog.find('iframe').get(0).contentWindow.returnVal;
|
|
if(res=="refresh"){
|
|
$('#grid').datagrid("reload");
|
|
}
|
|
}
|
|
});
|
|
};
|
|
|
|
var searchgrid = function() {
|
|
grid.datagrid('load',ext.contextPath + '/work/workorder/getClientTasks.do?'+$('#searchForm').serialize());
|
|
};
|
|
|
|
function onchangedate(){
|
|
var date=$("#nowdate").val();
|
|
loadworkorders(date);
|
|
}
|
|
function loadProcedures(){
|
|
$("#procedureno").combobox({
|
|
url : ext.contextPath + '/process/taskprocedure/getAllProcedurelist4Select.do',
|
|
valueField : 'procedurecode',
|
|
textField : 'procedurename',
|
|
method:'get',
|
|
panelHeight:'auto',
|
|
onLoadSuccess: function(record){
|
|
if($("#procedureno").combobox('getData').length>0){
|
|
var procedure=getCookie("wo_procedure");
|
|
$("#procedureno").combobox('select',procedure);
|
|
}
|
|
},
|
|
onSelect: function () {
|
|
delCookie("wo_procedure");
|
|
setCookie("wo_procedure",$("#procedureno").combobox('getValue'));
|
|
searchgrid();
|
|
}
|
|
});
|
|
}
|
|
//开工
|
|
var dostart = function(id) {
|
|
$.post(ext.contextPath + '/work/workorder/doupdate_taskdemand.do', {id : id,status:'${Flag_Start}'}, function(data) {
|
|
if(data==1){
|
|
parent.$.messager.alert('提示','开工成功','info',function(){
|
|
grid.datagrid('reload');
|
|
});
|
|
}else{
|
|
parent.$.messager.alert('提示','开工失败','info');
|
|
}
|
|
});
|
|
};
|
|
//报工
|
|
var doreport=function(workorderno,taskcode){
|
|
var dialog = parent.ext.modalDialog({
|
|
title : '工单报工',
|
|
width: 400,
|
|
height:500,
|
|
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskcode='+taskcode+'&workorderno='+workorderno+'&status=${Flag_Report}',
|
|
buttons : [{
|
|
text : '确定',
|
|
iconCls:'icon-ok',
|
|
handler : function() {
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
|
//dialog.dialog('destroy');
|
|
|
|
}
|
|
},
|
|
{
|
|
text : '取消',
|
|
iconCls:'icon-cancel',
|
|
handler : function() {
|
|
dialog.dialog('destroy');
|
|
|
|
}
|
|
}
|
|
]
|
|
});
|
|
};
|
|
//工单结转
|
|
var docarryover=function(workorderno,taskcode){
|
|
var dialog = parent.ext.modalDialog({
|
|
title : '工单结转',
|
|
width: 400,
|
|
height:500,
|
|
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskcode='+taskcode+'&workorderno='+workorderno+'&status=${Flag_CarryOver}',
|
|
buttons : [{
|
|
text : '确定',
|
|
iconCls:'icon-ok',
|
|
handler : function() {
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
|
//dialog.dialog('destroy');
|
|
|
|
}
|
|
},
|
|
{
|
|
text : '取消',
|
|
iconCls:'icon-cancel',
|
|
handler : function() {
|
|
dialog.dialog('destroy');
|
|
|
|
}
|
|
}
|
|
]
|
|
});
|
|
};
|
|
//查看工单
|
|
var doview=function(workorderno,taskcode){
|
|
var dialog = parent.ext.modalDialog({
|
|
title : '查看工单',
|
|
width: 400,
|
|
height:500,
|
|
url : ext.contextPath + '/work/workorder/showworkorder_view.do?taskcode='+taskcode+'&workorderno='+workorderno,
|
|
|
|
});
|
|
};
|
|
$(function() {
|
|
loadProcedures();
|
|
grid = $('#grid').datagrid({
|
|
title : '',
|
|
url : ext.contextPath + '/work/workorder/getClientTasks.do?'+$('#searchForm').serialize(),
|
|
striped : true,
|
|
rownumbers : true,
|
|
pagination : true,
|
|
singleSelect: true,
|
|
ctrlSelect:true,
|
|
selectOnCheck: false,
|
|
checkOnSelect: false,
|
|
idField : 'id',
|
|
pageSize : 50,
|
|
pageList : [ 20, 50, 100],
|
|
columns : [ [
|
|
{width : '180', title : '工单编号', field : '_taskName', halign:'center', formatter : function(value, row){
|
|
return row.workOrder.workorderno;
|
|
}
|
|
},
|
|
{width : '80', title : '计划良率', field : 'preyield', halign:'center'},
|
|
{width : '80', title : '实际良率', field : 'actyield', halign:'center'},
|
|
{width : '80', title : '计划产量', field : 'preamount', halign:'center'},
|
|
{width : '80', title : '实际产量', field : 'actamount', halign:'center'},
|
|
{width : '180', title : '良率未达标原因', field : 'yieldreason', halign:'center', align:'center'},
|
|
{width : '180', title : '产量未达标原因', field : 'amountreason', halign:'center', align:'center'},
|
|
{width : '100', title : '工单状态', field : 'status', align:'center', formatter : function(value, row){
|
|
switch(value){
|
|
case '${Flag_Start}': return "已开工";
|
|
case '${Flag_Report}': return "已报工";
|
|
case '${Flag_CarryOver}': return "已结转";
|
|
default:return "待开工";
|
|
|
|
}
|
|
} ,sortable:false},
|
|
{width : '130', title : '操作', field : 'action', align:'center', formatter : function(value, row) {
|
|
var str = '';
|
|
str += '<img class="iconImg ext-icon-table" title="查看" onclick="doview(\''+row.workOrder.workorderno+'\',\''+row.taskcode+'\');"/> ';
|
|
if(row.status=='${Flag_Start}'){
|
|
str += '<img class="iconImg ext-icon-table_row_insert" title="报工" onclick="doreport(\''+row.workOrder.workorderno+'\',\''+row.taskcode+'\');"/> ';
|
|
}else if(row.status=='${Flag_Report}'){
|
|
str += '<img class="iconImg ext-icon-table_relationship" title="结转" onclick="docarryover(\''+row.workOrder.workorderno+'\',\''+row.taskcode+'\');"/> ';
|
|
}else if(row.status!='${Flag_CarryOver}'){
|
|
str += '<img class="iconImg ext-icon-table_go" title="开工" onclick="dostart(\''+row.id+'\');"/> ';
|
|
}
|
|
return str;
|
|
}}
|
|
] ],
|
|
toolbar : '#toolbar',
|
|
onLoadSuccess : function(data) {
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
|
|
|
}
|
|
});
|
|
});
|
|
//写cookies
|
|
function setCookie(name,value) {
|
|
var Days = 365;
|
|
var exp = new Date();
|
|
exp.setTime(exp.getTime() + Days*24*60*60*1000);
|
|
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
|
|
}
|
|
|
|
//读取cookies
|
|
function getCookie(name) {
|
|
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
|
|
if(arr=document.cookie.match(reg)) return unescape(arr[2]);
|
|
else return null;
|
|
}
|
|
|
|
//删除cookies
|
|
function delCookie(name) {
|
|
var exp = new Date();
|
|
exp.setTime(exp.getTime() - 1*24*60*60*1000);
|
|
var cval=getCookie(name);
|
|
if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
|
|
}
|
|
</script>
|
|
</head>
|
|
<body class="easyui-layout" data-options="fit:true,border:false">
|
|
<div id="toolbar" style="display: none;">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<table>
|
|
<tr>
|
|
<%-- <%if (sessionManager.havePermission(session,"work/workorder/add.do")) {%>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
|
onclick="addFun();">添加</a>
|
|
</td>
|
|
<%}%>
|
|
<%if (sessionManager.havePermission(session,"work/workorder/delete.do")) {%>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
|
onclick="deletesFun();">删除</a>
|
|
</td>
|
|
<%}%> --%>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<form id="searchForm">
|
|
<table class="tooltable">
|
|
<tr>
|
|
<td><input id="dt" name="dt" type="hidden" value="${dt }" ></td>
|
|
<td>工序</td>
|
|
<td><input id="procedureno" name="procedureno" class="easyui-combobox" style="width: 180px;" panelMaxHeight="400px" data-options="panelHeight:'auto'" value=""/></td>
|
|
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
|
onclick="searchgrid();">搜索</a>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
|
onclick="$('#searchForm').form('clear');searchgrid();">重置</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div data-options="region:'center',fit:true,border:false">
|
|
<table id="grid" data-options="fit:true,border:false"></table>
|
|
</div>
|
|
</body>
|
|
</html> |