877 lines
32 KiB
Plaintext
877 lines
32 KiB
Plaintext
|
|
<%@page import="com.sipai.tools.CommString"%>
|
|||
|
|
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
|||
|
|
<%@page import="java.util.Date" %>
|
|||
|
|
<%@page import="java.text.SimpleDateFormat" %>
|
|||
|
|
<%@ page import="com.sipai.tools.SessionManager"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|||
|
|
<%
|
|||
|
|
SessionManager sessionManager = new SessionManager();
|
|||
|
|
%>
|
|||
|
|
<%String contextPath = request.getContextPath();%>
|
|||
|
|
<%request.setAttribute("Flag_Edit",com.sipai.entity.plan.DailyPlan.Flag_Edit);%>
|
|||
|
|
<%request.setAttribute("Flag_Check",com.sipai.entity.plan.DailyPlan.Flag_Check);%>
|
|||
|
|
<%request.setAttribute("Flag_Finish",com.sipai.entity.plan.DailyPlan.Flag_Finish);%>
|
|||
|
|
<%request.setAttribute("Flag_Issue",com.sipai.entity.plan.DailyPlan.Flag_Issue);%>
|
|||
|
|
<%request.setAttribute("Flag_ReEdit",com.sipai.entity.plan.DailyPlan.Flag_ReEdit);%>
|
|||
|
|
<%request.setAttribute("Flag_Submit",com.sipai.entity.plan.DailyPlan.Flag_Submit);%>
|
|||
|
|
<%request.setAttribute("Flag_Delete",com.sipai.entity.plan.DailyPlan.Flag_Delete);%>
|
|||
|
|
|
|||
|
|
<%request.setAttribute("Flag_Suspend",com.sipai.entity.plan.DailyPlan.Flag_Suspend);%>
|
|||
|
|
<%request.setAttribute("Flag_Active",com.sipai.entity.plan.DailyPlan.Flag_Active);%>
|
|||
|
|
|
|||
|
|
<%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 gridAll;
|
|||
|
|
var invalidategrid;
|
|||
|
|
var ddv;
|
|||
|
|
var ddvall;
|
|||
|
|
var ddvpid='${dailyplansummary.id }';
|
|||
|
|
var order_n0;
|
|||
|
|
var order_n;
|
|||
|
|
var index_n0;
|
|||
|
|
var index_n;
|
|||
|
|
var allowDndflag=0;
|
|||
|
|
var addFun = function() {
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
iframeId:'add',
|
|||
|
|
title : '新增日计划',
|
|||
|
|
url : ext.contextPath + '/plan/dailyplan/add.do?iframeId=add&date=${param.sdt}&plandate=${dailyplansummary.plandt}&pid=${dailyplansummary.id }',
|
|||
|
|
buttons : [
|
|||
|
|
{
|
|||
|
|
text : '保存',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
text : '提交',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.find('iframe').get(0).contentWindow.dosubmit(dialog, grid);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
]
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var viewFun = function(id) {
|
|||
|
|
//grid.datagrid('clearChecked');
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
width: 800,
|
|||
|
|
height:600,
|
|||
|
|
title : '查看日计划',
|
|||
|
|
url : ext.contextPath + '/plan/dailyplan/view.do?id=' + id,
|
|||
|
|
buttons : [ {
|
|||
|
|
text : '确认完成',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.find('iframe').get(0).contentWindow.dofinish(dialog, grid);
|
|||
|
|
}
|
|||
|
|
}]
|
|||
|
|
});
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
gridAll.datagrid('reload');
|
|||
|
|
};
|
|||
|
|
var doedit = function() {
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
width: 480,
|
|||
|
|
height:320,
|
|||
|
|
title : '编辑日计划信息',
|
|||
|
|
url : ext.contextPath + '/plan/dailyplansummary/edit.do?id=${dailyplansummary.id }'+'&iframeId=${param.iframeId}',
|
|||
|
|
buttons : [ {
|
|||
|
|
text : '保存',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
|||
|
|
}
|
|||
|
|
} ]
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var auditsFun = function() {
|
|||
|
|
var checkedItems = $('#grid').datagrid('getChecked');
|
|||
|
|
var datas="";
|
|||
|
|
$.each(checkedItems, function(index, item){
|
|||
|
|
if(datas!=""){
|
|||
|
|
datas+=",";
|
|||
|
|
}
|
|||
|
|
datas+=item.id;
|
|||
|
|
});
|
|||
|
|
if(datas==""){
|
|||
|
|
top.$.messager.alert('提示', '请先选择要审核的记录','info');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.confirm('提示', '您确定要审核所选记录?', function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
auditbyIds(datas);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
//分配工作量-wxp
|
|||
|
|
var distFun = function(planid,prid) {
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
width: 1200,
|
|||
|
|
height:550,
|
|||
|
|
title : '分配任务量',
|
|||
|
|
url : ext.contextPath + '/plan/dailyplansummary/showDistricWork.do?processrealid='+prid+'&planid='+planid,
|
|||
|
|
buttons : [ {
|
|||
|
|
text : '关闭',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
}
|
|||
|
|
}],
|
|||
|
|
onDestroy:function(){
|
|||
|
|
showdetailsFun();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
//驳回
|
|||
|
|
var dounauditbyid = function(id) {
|
|||
|
|
$.messager.prompt('提示', '请填写驳回原因:', function(r){
|
|||
|
|
if (r){
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplansummary/unauditbyId.do', {id:id,remark:r} , function(data) {
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
grid.datagrid('clearChecked');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var doauditbyid = function(id) {
|
|||
|
|
auditbyIds(id);
|
|||
|
|
};
|
|||
|
|
var auditbyIds = function(ids){
|
|||
|
|
$.post(ext.contextPath + "/plan/dailyplansummary/auditbyIds.do",{ids:ids}, function(data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
top.$.messager.alert('提示', "审核成功", 'info', function() {
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
top.$.messager.confirm('提示', "是否立即下发工单到生产?",function(r){
|
|||
|
|
if (r){
|
|||
|
|
doissue(data.ids);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}else if(data.res== 0){
|
|||
|
|
top.$.messager.alert('提示', "审核失败", 'info');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示', data, 'info');
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
//工单下发
|
|||
|
|
var doissue = function(id){
|
|||
|
|
$('#YWaitDialog').show();
|
|||
|
|
$.post(ext.contextPath + "/work/workorder/doissue.do",{ids:id}, function(data) {
|
|||
|
|
$('#YWaitDialog').hide();
|
|||
|
|
if (data.res == "${resp_pass}") {
|
|||
|
|
top.$.messager.alert('提示', "下发成功", 'info', function() {
|
|||
|
|
//刷新
|
|||
|
|
//parent.$('#viewp3')[0].contentWindow.location.reload();
|
|||
|
|
//refreshbutton();
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}else {
|
|||
|
|
top.$.messager.alert('提示', data.res, 'info');
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
};
|
|||
|
|
//工单结转
|
|||
|
|
var editFun = function(id) {
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
iframeId:'edit',
|
|||
|
|
width: 800,
|
|||
|
|
height:620,
|
|||
|
|
title : '编辑日计划',
|
|||
|
|
url : ext.contextPath + '/plan/dailyplan/edit.do?id=' + id+'&iframeId=edit',
|
|||
|
|
buttons : [ {
|
|||
|
|
text : '保存',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
text : '提交',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.find('iframe').get(0).contentWindow.dosubmit(dialog, grid);
|
|||
|
|
}
|
|||
|
|
} ]
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var deleteFun = function(id) {
|
|||
|
|
parent.$.messager.confirm('提示', '您确定要删除此记录?计划删除后工单将自动作废。', function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplan/delete.do', {id : id}, function(data) {
|
|||
|
|
if(data==1){
|
|||
|
|
top.$.messager.alert('提示','删除成功','info');
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示','删除失败','info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var deletesFun = function() {
|
|||
|
|
var checkedItems = $('#grid').datagrid('getChecked');
|
|||
|
|
var datas="";
|
|||
|
|
$.each(checkedItems, function(index, item){
|
|||
|
|
datas+=item.id+",";
|
|||
|
|
});
|
|||
|
|
if(datas==""){
|
|||
|
|
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.confirm('提示', '您确定要删除多条记录?计划删除后工单将自动作废。', function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplan/deletes.do', {ids:datas} , function(data) {
|
|||
|
|
if(data>0){
|
|||
|
|
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
grid.datagrid('clearChecked');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示','删除失败','info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var flag=0;
|
|||
|
|
$(function() {
|
|||
|
|
grid= $('#grid').datagrid({
|
|||
|
|
title : '',
|
|||
|
|
url:ext.contextPath + '/plan/dailyplan/getdailyplans.do',
|
|||
|
|
queryParams: {
|
|||
|
|
//search_name: $('#search_name').textbox('getValue'),
|
|||
|
|
sdt: $("#sdt").val(),
|
|||
|
|
edt: $("#edt").val(),
|
|||
|
|
search_status: $('#search_status').combobox('getValue'),
|
|||
|
|
pid:ddvpid
|
|||
|
|
},
|
|||
|
|
striped : true,
|
|||
|
|
rownumbers : true,
|
|||
|
|
pagination : true,
|
|||
|
|
singleSelect: true,
|
|||
|
|
ctrlSelect:true,
|
|||
|
|
selectOnCheck: false,
|
|||
|
|
checkOnSelect: false,
|
|||
|
|
idField : 'id',
|
|||
|
|
pageSize : 50,
|
|||
|
|
pageList : [ 20, 50, 100],
|
|||
|
|
//loadMsg:'',
|
|||
|
|
height:'auto',
|
|||
|
|
rowStyler: function(index,row){
|
|||
|
|
var rowstyler='';
|
|||
|
|
if (row.taskchangedstatus!=null){
|
|||
|
|
if(row.taskchangedstatus=='true' ||row.taskchangedstatus=='TRUE'){
|
|||
|
|
rowstyler+= 'font-weight:bold;';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(row.status=='3'|| row.status=='4'){
|
|||
|
|
rowstyler+= ' background-color:#C0C0C0;color:#fff;';
|
|||
|
|
}else if(row.status=='6'){
|
|||
|
|
rowstyler+= ' font-style:ltalic;';
|
|||
|
|
}
|
|||
|
|
return rowstyler;
|
|||
|
|
},
|
|||
|
|
columns : [ [
|
|||
|
|
{checkbox:true , field : 'ck'},
|
|||
|
|
{width : '100', title : '任务单号', field : 'taskorderno', sortable : true, halign:'center' ,formatter : function(value, row){
|
|||
|
|
if(row.taskorder!=null){
|
|||
|
|
return row.taskorder.tasklistcode;
|
|||
|
|
}else{
|
|||
|
|
return "";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} },
|
|||
|
|
{width : '180', title : '物料名称', field : 'bomname', sortable : true, halign:'center' , formatter : function(value, row){
|
|||
|
|
if(row.materialBOM!=null){
|
|||
|
|
return row.materialBOM.materialname;
|
|||
|
|
}else{
|
|||
|
|
return "";
|
|||
|
|
}
|
|||
|
|
}},
|
|||
|
|
{width : '100', title : '销售订单号', field : 'salseno', halign:'center' ,formatter : function(value, row){
|
|||
|
|
if(row.taskorder!=null){
|
|||
|
|
return row.taskorder.salesno;
|
|||
|
|
}else{
|
|||
|
|
return "";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} },
|
|||
|
|
|
|||
|
|
{width : '100', title : '工艺路线', field : 'processrealid', halign:'center' ,sortable:false},
|
|||
|
|
{width : '140', title : '计划下达时间', field : 'insdt',align:'center', formatter : function(value, row){
|
|||
|
|
if(value.substring(0,4)=="1900"){
|
|||
|
|
return "";
|
|||
|
|
}else{
|
|||
|
|
return value.substring(0,19);
|
|||
|
|
}
|
|||
|
|
},sortable:false },
|
|||
|
|
{width : '100', title : '计划状态', field : 'status', align:'center', formatter : function(value, row){
|
|||
|
|
var susp="";
|
|||
|
|
if(row.delflag=='${Flag_Active}'){
|
|||
|
|
susp= "";
|
|||
|
|
}else if(row.delflag=='${Flag_Suspend}'){
|
|||
|
|
susp= "/<font color='red'>已挂起</font>";
|
|||
|
|
}
|
|||
|
|
switch(value){
|
|||
|
|
case '${Flag_Edit}': return "待提交"+susp;
|
|||
|
|
case '${Flag_Submit}': return "待审核"+susp;
|
|||
|
|
case '${Flag_Check}': return "待下发"+susp;
|
|||
|
|
case '${Flag_Issue}': return "已下发"+susp;
|
|||
|
|
case '${Flag_Delete}': return "已作废"+susp;
|
|||
|
|
case '${Flag_ReEdit}': return "已重排"+susp;
|
|||
|
|
case '${Flag_Finish}': return "<font color='blue'>已完成</font>";
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
} ,sortable:false},
|
|||
|
|
|
|||
|
|
{width : '45', title : '优先级(数字越小优先级越高)', field : 'porder', sortable : false, halign:'center',formatter:function(value, row){
|
|||
|
|
return value;
|
|||
|
|
}},
|
|||
|
|
{title : '操作', field : 'action', width : '80', halign:'center', align:'center', formatter : function(value, row) {
|
|||
|
|
var str = '';
|
|||
|
|
//str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/> ';
|
|||
|
|
<%-- <%if (sessionManager.havePermission(session,"plan/dailyplan/edit.do")) {%> --%>
|
|||
|
|
if(row.status=='${Flag_Submit}'){
|
|||
|
|
str += '<img class="iconImg ext-icon-table_add" title="配置" onclick="distFun(\''+row.id+'\',\''+row.processrealid+'\');"/> ';
|
|||
|
|
str += '<img class="iconImg ext-icon-table_go" title="通过" onclick="doauditbyid(\''+row.id+'\');"/> ';
|
|||
|
|
str += '<img class="iconImg ext-icon-table_error" title="驳回" onclick="dounauditbyid(\''+row.id+'\');"/> ';
|
|||
|
|
}
|
|||
|
|
<%-- <%}%> --%>
|
|||
|
|
<%--<%if (sessionManager.havePermission(session,"plan/dailyplan/delete.do")) {%>
|
|||
|
|
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/> ';
|
|||
|
|
<%}%>
|
|||
|
|
<%if (sessionManager.havePermission(session,"plan/dailyplan/edit.do")) {%>
|
|||
|
|
if(row.status!='0'){
|
|||
|
|
str += '<img class="iconImg ext-icon-bin" title="计划作废" onclick="invalidateFun(\''+row.id+'\');"/> ';
|
|||
|
|
}
|
|||
|
|
str += '<img class="iconImg ext-icon-arrow_up" title="计划置顶" onclick="ToTop(\''+row.id+'\',\''+row.pid+'\',\''+row.porder+'\');"/> ';
|
|||
|
|
<%}%> --%>
|
|||
|
|
return str;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{width : '80', title : '提示', field : 'taskchangedstatus',align:'center', formatter : function(value, row){
|
|||
|
|
if(value=="true" ||value=="TRUE"){
|
|||
|
|
return '已生成工单<img class="iconImg ext-icon-new" title="任务新变动" onclick="viewFun(\''+row.id+'\');"/>';
|
|||
|
|
}else{
|
|||
|
|
return "";
|
|||
|
|
}
|
|||
|
|
} ,sortable:false}
|
|||
|
|
] ],
|
|||
|
|
toolbar : '#toolbar',
|
|||
|
|
onResize:function(){
|
|||
|
|
//$('#grid').datagrid('fixDetailRowHeight',index);
|
|||
|
|
},
|
|||
|
|
onLoadSuccess:function(){
|
|||
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
|||
|
|
if(allowDndflag==1){//连续拖拽
|
|||
|
|
$(this).datagrid('enableDnd');
|
|||
|
|
allowDndflag=0;
|
|||
|
|
}
|
|||
|
|
// setTimeout(function(){
|
|||
|
|
// $('#grid').datagrid('fixDetailRowHeight',index);
|
|||
|
|
// },0);
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
onStopDrag:function(row){
|
|||
|
|
index_n=grid.datagrid('getRowIndex',row.id);
|
|||
|
|
var temp="";
|
|||
|
|
if(index_n==index_n0){//判断移动方向
|
|||
|
|
return;
|
|||
|
|
}else if(index_n<index_n0){//向上移动
|
|||
|
|
if(index_n==0){
|
|||
|
|
temp=grid.datagrid('getRows')[1].porder;//index为0,上面无行,由下面porder, 决定porder值
|
|||
|
|
order_n=Number(temp);
|
|||
|
|
}else{
|
|||
|
|
temp=grid.datagrid('getRows')[index_n-1].porder;//由移动后上面一行porder值+1,决定porder值
|
|||
|
|
order_n=Number(temp)+1;
|
|||
|
|
}
|
|||
|
|
}else if(index_n>index_n0){//向下移动
|
|||
|
|
temp=grid.datagrid('getRows')[index_n-1].porder;//由移动后上面一行porder值,决定porder值
|
|||
|
|
order_n=Number(temp);
|
|||
|
|
}
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplan/drag.do', {order_n0:order_n0,order_n:order_n,pid:row.pid,id:row.id} , function(data) {
|
|||
|
|
if(data==0){
|
|||
|
|
return;
|
|||
|
|
}else if(data>0){
|
|||
|
|
allowDndflag=1;
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示','操作失败','info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
},
|
|||
|
|
onStartDrag:function(row){
|
|||
|
|
index_n0=grid.datagrid('getRowIndex',row.id);
|
|||
|
|
order_n0=row.porder;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
var invalidateFun = function(id) {
|
|||
|
|
parent.$.messager.confirm('提示', '您确定要此记录作废?计划作废后将无法撤销。', function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplan/invalidate.do', {id : id}, function(data) {
|
|||
|
|
if(data==1){
|
|||
|
|
top.$.messager.alert('提示','作废成功','info');
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示','作废失败','info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var invalidateday = function() {
|
|||
|
|
parent.$.messager.confirm('提示', '您确定要作废全天计划?计划作废后将无法撤销。', function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
var id='${dailyplansummary.id }';
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplansummary/invalidateday.do', {id : id}, function(data) {
|
|||
|
|
if(data==1){
|
|||
|
|
top.$.messager.alert('提示','作废成功','info');
|
|||
|
|
parent.$('#view')[0].contentWindow.location.reload();//刷新计划单列表
|
|||
|
|
parent.$("#viewp3").dialog('destroy');//关闭本窗口
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示','作废失败','info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var distributeday = function() {
|
|||
|
|
parent.$.messager.confirm('提示', '您确定要下发全天计划?', function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
var id='${dailyplansummary.id }';
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplansummary/distributeday.do', {id : id}, function(data) {
|
|||
|
|
if(data.res=='0'){
|
|||
|
|
top.$.messager.alert('提示','无可下发计划','info');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示',data.res,'info');
|
|||
|
|
$('#disttd').hide();
|
|||
|
|
parent.$('#viewp3')[0].contentWindow.location.reload();//刷新本窗口
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var submitday = function() {
|
|||
|
|
parent.$.messager.confirm('提示', '您确定要提交全天待提交计划?', function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
var id='${dailyplansummary.id }';
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplansummary/submitday.do', {id : id}, function(data) {
|
|||
|
|
if(data.res=='1'){
|
|||
|
|
top.$.messager.alert('提示','提交成功','info');
|
|||
|
|
$('#edittd').hide();
|
|||
|
|
$('#audittd').show();
|
|||
|
|
parent.$('#viewp3')[0].contentWindow.location.reload();//刷新本窗口
|
|||
|
|
}else if(data.res=='0'){
|
|||
|
|
top.$.messager.alert('提示','无可提交计划','info');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示','提交失败','info');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var planordermaterialadd= function(id) {
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
iframeId:'dpsmadd',
|
|||
|
|
width: 1024,
|
|||
|
|
height:600,
|
|||
|
|
title : '物料计划单',
|
|||
|
|
url : ext.contextPath + '/plan/dailyplansummarymaterial/add.do?id='+id+'&name=${dailyplansummary.name}&iframeId=${param.iframeId}',
|
|||
|
|
buttons : [ {
|
|||
|
|
text : '保存',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
|||
|
|
}
|
|||
|
|
} ]
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function showYesterday(){
|
|||
|
|
var yesterday=getDateStartEnd("yesterday");
|
|||
|
|
$("#sdt").val(yesterday[0]);
|
|||
|
|
$("#edt").val(yesterday[1]);
|
|||
|
|
grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
|||
|
|
}
|
|||
|
|
function showToday(){
|
|||
|
|
var today=getDateStartEnd("today");
|
|||
|
|
$("#sdt").val(today[0]);
|
|||
|
|
$("#edt").val(today[1]);
|
|||
|
|
grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
|||
|
|
}
|
|||
|
|
function showThisWeek(){
|
|||
|
|
var thisweek=getDateStartEnd("week");
|
|||
|
|
$("#sdt").val(thisweek[0]);
|
|||
|
|
$("#edt").val(thisweek[1]);
|
|||
|
|
grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
|||
|
|
}
|
|||
|
|
function reset(){
|
|||
|
|
$('#searchForm').form('clear');
|
|||
|
|
ddvpid='${dailyplansummary.id }';
|
|||
|
|
grid.datagrid('load',{pid:'${dailyplansummary.id }'});
|
|||
|
|
$('#sdt').val('${wsdt}');
|
|||
|
|
$('#edt').val('${wedt}');
|
|||
|
|
}
|
|||
|
|
function allowDnd(){
|
|||
|
|
grid.datagrid('enableDnd');
|
|||
|
|
var nad =document.getElementById("notallowDndbtn");
|
|||
|
|
var ad =document.getElementById("allowDndbtn");
|
|||
|
|
nad.style.display="";
|
|||
|
|
ad.style.display="none";
|
|||
|
|
showTips('列表拖拽已启用', 1);
|
|||
|
|
//grid.datagrid('reload');
|
|||
|
|
}
|
|||
|
|
function notallowDnd(){
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
var nad =document.getElementById("notallowDndbtn");
|
|||
|
|
var ad =document.getElementById("allowDndbtn");
|
|||
|
|
ad.style.display="";
|
|||
|
|
nad.style.display="none";
|
|||
|
|
showTips('列表拖拽已禁用', 1);
|
|||
|
|
}
|
|||
|
|
function ToTop(id,pid,porder){
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplan/drag.do', {order_n0:porder,order_n:0,pid:pid,id:id} , function(data) {
|
|||
|
|
if(data==0){
|
|||
|
|
return;
|
|||
|
|
}else if(data>0){
|
|||
|
|
//allowDndflag=1;//允许拖拽
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示','操作失败','info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function selectTaskOrder(){
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
title : '选择任务单',
|
|||
|
|
width: 800,
|
|||
|
|
height:550,
|
|||
|
|
url : ext.contextPath + '/plan/taskorder/select.do',
|
|||
|
|
buttons : [{
|
|||
|
|
text : '确定',
|
|||
|
|
iconCls:'icon-ok',
|
|||
|
|
handler : function() {
|
|||
|
|
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
|||
|
|
|
|||
|
|
if(res!=null){
|
|||
|
|
$("#taskordercode").textbox('setValue',res.tasklistcode);//easyui textbox赋值jquery不一样
|
|||
|
|
$("#taskorderid").val(res.id);
|
|||
|
|
}
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
text : '取消',
|
|||
|
|
iconCls:'icon-cancel',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
//日计划排产统计
|
|||
|
|
var planEquAnalysisFun = function(ids) {
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplansummary/getWorkTaskEqusByPlanIds.do', {ids : ids}, function(data) {
|
|||
|
|
dailyPlans=data.res;
|
|||
|
|
var columns = new Array();
|
|||
|
|
var columns1 ={width : '180', title : '物料名称', field : 'bomname', sortable : true, align:'center' , formatter : function(value, row){
|
|||
|
|
if(row.materialBOM!=null){
|
|||
|
|
return row.materialBOM.materialname;
|
|||
|
|
}else{
|
|||
|
|
return "";
|
|||
|
|
}
|
|||
|
|
}};
|
|||
|
|
columns.push(columns1);
|
|||
|
|
var columns2={width : '100', title : '销售订单号', field : 'salseno', halign:'center' ,formatter : function(value, row){
|
|||
|
|
if(row.taskorder!=null){
|
|||
|
|
return row.taskorder.salesno;
|
|||
|
|
}else{
|
|||
|
|
return "";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} };
|
|||
|
|
columns.push(columns2);
|
|||
|
|
//导入其他分值的循环
|
|||
|
|
//alert(data.summary)
|
|||
|
|
var summary= data.summary;
|
|||
|
|
for (var i = 0; i < summary.length; i++) {
|
|||
|
|
var column={
|
|||
|
|
field:summary[i].taskcode,title:summary[i]._taskName,width:120,align:'center', formatter : function(value, row){
|
|||
|
|
//console.log(row.demands)
|
|||
|
|
for(var j=0;j<row.demands.length;j++){
|
|||
|
|
if(row.demands[j].taskcode == this.field)
|
|||
|
|
var preamount =row.demands[j].preamount;
|
|||
|
|
if(preamount==null){
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
//console.log(preamount)
|
|||
|
|
var items=preamount.split("/");
|
|||
|
|
if(items.length==2){
|
|||
|
|
//console.log(items)
|
|||
|
|
if(parseFloat(items[0])<parseFloat(items[1])){
|
|||
|
|
return '<span style="color:#F00">'+preamount+'</span>'
|
|||
|
|
}else{
|
|||
|
|
return preamount;
|
|||
|
|
}
|
|||
|
|
}else{
|
|||
|
|
return preamount;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
columns.push(column);
|
|||
|
|
}
|
|||
|
|
//console.log(data.res.length)
|
|||
|
|
$('#grid_equs').datagrid({
|
|||
|
|
title: '',
|
|||
|
|
rowStyler:function(index,row) {
|
|||
|
|
if (data.res.length>0 && index > data.res.length-3){
|
|||
|
|
return 'color:blue;font-weight:bold;';
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
data: data.res,
|
|||
|
|
width: '100%',
|
|||
|
|
rownumbers: true,
|
|||
|
|
columns: [
|
|||
|
|
columns
|
|||
|
|
],
|
|||
|
|
onLoadSuccess : function(datas) {
|
|||
|
|
|
|||
|
|
var length= $('#grid_equs').datagrid('getData').rows.length;
|
|||
|
|
if(length>0){
|
|||
|
|
var rowIndex=length-1;
|
|||
|
|
|
|||
|
|
var grid_squs=$('#grid_equs').datagrid('mergeCells',{
|
|||
|
|
index: rowIndex,
|
|||
|
|
field: 'bomname',
|
|||
|
|
colspan: 2
|
|||
|
|
});
|
|||
|
|
grid_squs.datagrid('mergeCells',{
|
|||
|
|
index: rowIndex-1,
|
|||
|
|
field: 'bomname',
|
|||
|
|
colspan: 2
|
|||
|
|
});
|
|||
|
|
var lastIndex=rowIndex;
|
|||
|
|
var cols =grid_squs.datagrid('getColumnFields');
|
|||
|
|
var CurValue="";
|
|||
|
|
var CurCol="";
|
|||
|
|
var span=1;
|
|||
|
|
var demands =grid_squs.datagrid("getRows")[lastIndex].demands;
|
|||
|
|
for(var i=2;i<cols.length;i++){
|
|||
|
|
var col=cols[i];
|
|||
|
|
var desValue="";
|
|||
|
|
for(var j=0;j<demands.length;j++){
|
|||
|
|
if(demands[j].taskcode==col){
|
|||
|
|
desValue=demands[j].preamount;
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/* console.log(col);
|
|||
|
|
console.log(desValue); */
|
|||
|
|
if(CurValue==desValue){
|
|||
|
|
span++;
|
|||
|
|
if(i==cols.length-1 && CurValue!=""){
|
|||
|
|
grid_squs.datagrid('mergeCells',{
|
|||
|
|
index: lastIndex,
|
|||
|
|
field: CurCol,
|
|||
|
|
colspan: span
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}else{
|
|||
|
|
if(CurValue!=""){
|
|||
|
|
grid_squs.datagrid('mergeCells',{
|
|||
|
|
index: lastIndex,
|
|||
|
|
field: CurCol,
|
|||
|
|
colspan: span
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
CurValue=desValue;
|
|||
|
|
CurCol=col;
|
|||
|
|
span=1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
},'json');
|
|||
|
|
};
|
|||
|
|
$(function(){
|
|||
|
|
if('${editnum}'!='0'){
|
|||
|
|
$('#edittd').show();
|
|||
|
|
}else{
|
|||
|
|
$('#edittd').hide();
|
|||
|
|
}
|
|||
|
|
if('${submitnum}'!='0'){
|
|||
|
|
$('#audittd').show();
|
|||
|
|
}else{
|
|||
|
|
$('#audittd').hide();
|
|||
|
|
}
|
|||
|
|
if('${auditnum}'!='0'){
|
|||
|
|
$('#disttd').show();
|
|||
|
|
}else{
|
|||
|
|
$('#disttd').hide();
|
|||
|
|
}
|
|||
|
|
$("#taskordercode").textbox('textbox').bind("click", function () {
|
|||
|
|
selectTaskOrder();
|
|||
|
|
});
|
|||
|
|
showdetailsFun();
|
|||
|
|
});
|
|||
|
|
var showdetailsFun = function() {
|
|||
|
|
$("#taskOrderStatistics").attr("src",ext.contextPath+"/plan/taskorder/viewTaskOrderDayPlanAmount.do?displaymodel=" + "EXAM");
|
|||
|
|
$.post(ext.contextPath + '/plan/dailyplan/getdailyplans.do', {sdt: $("#sdt").val(), edt: $("#edt").val()} , function(data) {
|
|||
|
|
var dailyplans=data.rows;
|
|||
|
|
var ids="";
|
|||
|
|
for(var i=0;i<dailyplans.length;i++){
|
|||
|
|
if(ids!=""){
|
|||
|
|
ids+=","
|
|||
|
|
}
|
|||
|
|
ids+=dailyplans[i].id;
|
|||
|
|
planEquAnalysisFun(ids);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
},'json');
|
|||
|
|
};
|
|||
|
|
</script>
|
|||
|
|
</head>
|
|||
|
|
<body >
|
|||
|
|
<div id="cc" class="easyui-layout" data-options="fit:true,border:false">
|
|||
|
|
<div class="easyui-tabs" data-options="region:'north',title:'统计信息',split:false,border:false" style="height:320px;width:100%">
|
|||
|
|
<div title="任务单信息一览" data-options="fit:true">
|
|||
|
|
<iframe id="taskOrderStatistics" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
|||
|
|
frameBorder="0" scrolling="auto"></iframe>
|
|||
|
|
</div>
|
|||
|
|
<div title="当日设备统计" data-options="fit:true">
|
|||
|
|
<table id="grid_equs" data-options="fit:true,border:false"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div data-options="region:'center',title:'日计划'" style="padding:0px;">
|
|||
|
|
<div class="easyui-layout" data-options="fit:true,border:false">
|
|||
|
|
<div id="toolbar" style="display: none;">
|
|||
|
|
<table>
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<table>
|
|||
|
|
<tr>
|
|||
|
|
<!-- <td id="edittd" name="edittd" >
|
|||
|
|
<%if (sessionManager.havePermission(session,"plan/dailyplan/edit.do")) {%>
|
|||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-note_go',plain:true" onclick="submitday();">提交</a>
|
|||
|
|
<%}%>
|
|||
|
|
</td> -->
|
|||
|
|
<td id="audittd" name="audittd" >
|
|||
|
|
<%if (sessionManager.havePermission(session,"plan/dailyplan/audit.do")) {%>
|
|||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-status_away',plain:true" onclick="auditsFun();">审核</a>
|
|||
|
|
<%}%>
|
|||
|
|
</td>
|
|||
|
|
<td id="disttd" name="distttd" >
|
|||
|
|
<%if (sessionManager.havePermission(session,"plan/dailyplan/distribute.do")) {%>
|
|||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="distributeday();">下发</a>
|
|||
|
|
<%}%>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<form id="searchForm">
|
|||
|
|
<input id="pid" name="pid" type="hidden" value="${dailyplansummary.id }" />
|
|||
|
|
<table>
|
|||
|
|
<tr>
|
|||
|
|
<td>任务单号</td>
|
|||
|
|
<td><input id="taskordercode" name="taskordercode" class="easyui-textbox" style="width: 150px;" data-options="validType:'isBlank',prompt:'单击选择'" value=""/>
|
|||
|
|
<input id="taskorderid" name="taskorderid" type="hidden" value="" /></td>
|
|||
|
|
<td >计划状态</td>
|
|||
|
|
<td colspan='4'><select id="search_status" name="search_status" class="easyui-combobox" style="width:152px;">
|
|||
|
|
<option value='all' >全部</option>
|
|||
|
|
<option value='edit'>待提交</option>
|
|||
|
|
<option value='submit' selected=true>待审核</option>
|
|||
|
|
<option value='audited'>待下发</option>
|
|||
|
|
<option value='inprogress'>已下发</option>
|
|||
|
|
<option value='completed'>已完成</option>
|
|||
|
|
<option value='rearrenged'>已重排</option>
|
|||
|
|
<option value='invalid'>已作废</option>
|
|||
|
|
</select>
|
|||
|
|
</td>
|
|||
|
|
<!-- </tr> -->
|
|||
|
|
<!-- <tr> -->
|
|||
|
|
<!-- <td>计划下达日期</td> -->
|
|||
|
|
<td><input id="sdt" name="sdt" class="Wdate" type="hidden"
|
|||
|
|
value="${wsdt}"
|
|||
|
|
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'edt\')}'})"
|
|||
|
|
readonly></td>
|
|||
|
|
<!-- <td>到</td> -->
|
|||
|
|
<td><input id="edt" name="edt" class="Wdate" type="hidden"
|
|||
|
|
value="${wedt}"
|
|||
|
|
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'sdt\')}'})"
|
|||
|
|
readonly></td>
|
|||
|
|
<!-- <td><a href="#" class="easyui-linkbutton" -->
|
|||
|
|
<!-- onclick="showYesterday();">昨日</a> <a href="#" class="easyui-linkbutton" -->
|
|||
|
|
<!-- onclick="showToday();">今日</a> <a href="#" class="easyui-linkbutton" -->
|
|||
|
|
<!-- onclick="showThisWeek();">本周</a></td> -->
|
|||
|
|
<!-- <td><div class="datagrid-btn-separator"></div></td> -->
|
|||
|
|
<td><a href="javascript:void(0);" class="easyui-linkbutton"
|
|||
|
|
data-options="iconCls:'ext-icon-search',plain:true"
|
|||
|
|
onclick="$('#pid').val('${dailyplansummary.id }');grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
|||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton"
|
|||
|
|
data-options="iconCls:'icon-reload',plain:true"
|
|||
|
|
onclick="reset();">重置</a>
|
|||
|
|
<!-- <a href="javascript:void(0);" class="easyui-linkbutton" -->
|
|||
|
|
<!-- data-options="iconCls:'ext-icon-search',plain:true" -->
|
|||
|
|
<!-- onclick="$('#searchForm').form('clear');ddvpid='';grid.datagrid('load',{});">全部计划</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>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div id="YWaitDialog"
|
|||
|
|
style="background-color: #e0e0e0;
|
|||
|
|
position: absolute;
|
|||
|
|
margin: auto;
|
|||
|
|
top: 230px;
|
|||
|
|
left: 450px;
|
|||
|
|
display: none;
|
|||
|
|
height: 60px;
|
|||
|
|
width: 300px;
|
|||
|
|
border-radius:5px;">
|
|||
|
|
<p style="text-align: center;height:100%;">
|
|||
|
|
<img style=" position: absolute;left:50px" src="<%=request.getContextPath() %>/IMG/loading.gif" /> <span style=" width: 100%;height:100%; position: absolute; top: 22px;
|
|||
|
|
left: 30px;
|
|||
|
|
">请等待,工单正在下发...</span>
|
|||
|
|
</p>
|
|||
|
|
</div>
|
|||
|
|
</body>
|
|||
|
|
</html>
|
|||
|
|
|