first commit
This commit is contained in:
452
bin/WebRoot/jsp/plan/dailyPlanAdd.jsp
Normal file
452
bin/WebRoot/jsp/plan/dailyPlanAdd.jsp
Normal file
@ -0,0 +1,452 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var selectedProducts='';
|
||||
var manualnum=0;
|
||||
function dosave(dialog,grid) {
|
||||
if($("#status").val()==""){
|
||||
$("#status").val('0');
|
||||
}
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/dailyplan/save.do", $(".form").serialize(), function(data) {
|
||||
if (data == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
// 刷新列表
|
||||
//parent.$('#viewp1')[0].contentWindow.$('#edittd').show();
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
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){
|
||||
choseTaskOrder(res)
|
||||
//$("#div_product").panel('close');
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function choseTaskOrder(res){
|
||||
$("#tasklistcode").textbox('setValue',res.tasklistcode);//easyui textbox赋值jquery不一样
|
||||
$("#taskorderid").val(res.id);
|
||||
autoSelectProcess(res.productno);
|
||||
$("#productno").html(res.productno);
|
||||
$("#prodamount").html(res.prodamount);
|
||||
$("#salesno").html(res.salesno);
|
||||
$("#pstdate").html(res.pstdate.substring(0,10));
|
||||
$("#pendate").html(res.pendate.substring(0,10));
|
||||
$("#billstatus").html(res.billstatus);
|
||||
$("#billruntime").html(res.billruntime.substring(0,10));
|
||||
manualnum=0;
|
||||
displayNum();
|
||||
}
|
||||
function autoSelectProcess(processcode){
|
||||
$.post(ext.contextPath + "/activiti/workflow/getProcessDefinitionListForSelect.do",{search_code:processcode}, function(data) {
|
||||
//alert(data.rows)
|
||||
if (data.rows != "") {
|
||||
//var pd=JSON.parse(data.rows)
|
||||
//console.info(pd)
|
||||
$("#processrealid").textbox('setValue',data.rows[0].processDefinition.id);
|
||||
}
|
||||
},
|
||||
'json');
|
||||
|
||||
$.post(ext.contextPath + "/material/materialbom/getMaterialBOMs.do?querytype=select",{search_code:processcode}, function(data) {
|
||||
//alert(data.rows)
|
||||
if (data.rows != "") {
|
||||
//var pd=JSON.parse(data.rows)
|
||||
//console.info(pd)
|
||||
$("#bomid").val(data.rows[0].id);
|
||||
$("#bomname").textbox('setText',data.rows[0].materialname);
|
||||
}
|
||||
},
|
||||
'json');
|
||||
|
||||
}
|
||||
function selectProcess(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择工艺路线',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/activiti/workflow/getProcessForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#processrealid").textbox('setValue',res.id);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function selectBom(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择Bom',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/material/materialbom/selectBOMs.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
console.info(res)
|
||||
$("#bomid").val(res.bomid);
|
||||
$("#bomname").textbox('setText',res.bomcode);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function selectDailyPlanSummary(pid,dailyplansummary){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择日计划归属日期',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/plan/dailyplansummary/select.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#"+dailyplansummary).textbox('setValue',res.plandt.substring(0,10));//easyui textbox赋值jquery不一样
|
||||
$("#"+pid).val(res.id);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function dodistribute(dialog, grid){
|
||||
parent.$.messager.confirm('提示', '您确定要下发计划?下发计划被安排任务后,将无法修改,只能作废。', function(r) {
|
||||
if(r){
|
||||
$("#status").val('1');
|
||||
//dosave
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/dailyplan/save.do", $(".form").serialize()+"&selectedProducts="+selectedProducts, function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//distribute
|
||||
/* $.post(ext.contextPath + '/work/workorder/addbyplan.do', {ids:ids} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','下发计划成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','下发计划失败','info');
|
||||
}
|
||||
}); */
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}else{
|
||||
return ;
|
||||
}
|
||||
});
|
||||
}
|
||||
function dosubmit(dialog,grid){
|
||||
parent.$.messager.confirm('提示', '您确定要提交计划?提交计划等待审核,将无法修改。', function(r) {
|
||||
if(r){
|
||||
$("#status").val('1');
|
||||
//dosave
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/dailyplan/save.do", $(".form").serialize()+"&selectedProducts="+selectedProducts, function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', '提交成功', 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "提交失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
function selectOrderProductDetail(){
|
||||
var taskorderid=$("#taskorderid").val();
|
||||
if(taskorderid==null||taskorderid==""){
|
||||
top.$.messager.alert('提示', "请先选择任务单", 'info');
|
||||
return;
|
||||
}
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '产品列表(本计划生产总数:<span style=\"color:red\">'+totalnum+'</span>)',
|
||||
width: 950,
|
||||
height:550,
|
||||
url : ext.contextPath + '/material/orderproductdetail/showlistForSelect.do?salesorderid='+taskorderid+'&totalnum='+totalnum+'&iframeId=${param.iframeId}&plandate=${param.plandate}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
parent.$.messager.confirm('提示', '已排计划的产品重新排计划将更改原计划状态为重排,作废原工单。已完成产品重排计划无效。', function(r) {
|
||||
if (r) {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){//获得已排计划产品信息,待保存时再作废计划和任务
|
||||
selectedProducts=res;
|
||||
dialog.dialog('destroy');
|
||||
//$("#div_product").panel('open');
|
||||
//document.getElementById("producttable").style.display="";
|
||||
var selectedarr=(selectedProducts+",").split('}');//去掉了右括号
|
||||
manualnum=selectedarr.length-1;//显示个数及修改传值
|
||||
displayNum();
|
||||
/* var tb= document.getElementById('producttable');//删除旧的table
|
||||
var rowNum=tb.rows.length;
|
||||
for(var j=1;j<rowNum;j++){
|
||||
tb.deleteRow(j);
|
||||
rowNum=rowNum-1;
|
||||
j=j-1;
|
||||
}
|
||||
for(var i=1;i<selectedarr.length;i++){
|
||||
var dataset;
|
||||
if(i==1){
|
||||
dataset = $.parseJSON(selectedarr[i-1]+"}");//加上右括号
|
||||
}else{
|
||||
dataset = $.parseJSON(selectedarr[i-1].substring(1,selectedarr[i-1].length)+"}");//驱动左逗号加上右括号
|
||||
}
|
||||
var htmlstr="<tr><td style='text-align:center'>"+i+"</td><td>"+dataset.productuid+"</td><td>"+dataset.productionorderno+"</td></tr>";
|
||||
$("#producttable").append(htmlstr);
|
||||
} */
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function displayNum(){
|
||||
$("#sys").html(manualnum);
|
||||
$("#sysarrangenum").val(manualnum);
|
||||
$("#man").html(manualnum);
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
if(${param.taskorderid!=''}){
|
||||
$.post(ext.contextPath + "/plan/taskorder/getTaskOrderList4Combo.do", {id:'${param.taskorderid}'}, function(data) {
|
||||
choseTaskOrder(data[0]);
|
||||
},'json');
|
||||
|
||||
}
|
||||
|
||||
$("#tasklistcode").textbox('textbox').bind("click", function () {
|
||||
selectTaskOrder();
|
||||
});
|
||||
|
||||
$("#processrealid").textbox('textbox').bind("click", function () {
|
||||
selectProcess();;
|
||||
});
|
||||
$("#bomname").textbox('textbox').bind("click", function () {
|
||||
selectBom();;
|
||||
});
|
||||
$("#dailyplansummary").textbox('textbox').bind("click", function () {
|
||||
selectDailyPlanSummary("pid","dailyplansummary");
|
||||
});
|
||||
/* $("#lineid").combobox({
|
||||
url : ext.contextPath + '/work/line/getLineListForSelect.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
}); */
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" id="pdtotalnum" name="pdtotalnum" value=""/>
|
||||
<input type="hidden" id="pdplanednum" name="pdplanednum" value=""/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>任务单编号</th>
|
||||
<td><input id="tasklistcode" name="tasklistcode" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="" readonly/>
|
||||
<input id="taskorderid" name="taskorderid" type="hidden" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>产品编码</th>
|
||||
<td><span id="productno"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品数量</th>
|
||||
<td><span id="prodamount"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>销售单号</th>
|
||||
<td><span id="salesno"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>开始日期</th>
|
||||
<td><span id="pstdate"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>结束日期</th>
|
||||
<td><span id="pendate"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据状态</th>
|
||||
<td><span id="billstatus"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据下达日期</th>
|
||||
<td><span id="billruntime"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>计划日期</th>
|
||||
<td><input id="dailyplansummary" name="dailyplansummary" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="${fn:substring(param.plandate,0,10)}" readonly/>
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工艺路线ID</th>
|
||||
<td>
|
||||
<input id="processrealid" name="processrealid" class="easyui-textbox" data-options="required:true,validType:'isBlank'"/></td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<th>产线</th>
|
||||
<td><input id="lineid" name="lineid" class="easyui-combobox" data-options="required:true,validType:'isBlank'"/></td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<th>产品BOM</th>
|
||||
<td><input type="hidden" id="bomid" name="bomid" value=""/>
|
||||
<input id="bomname" name="bomname" class="easyui-textbox" data-options="required:true,validType:'isBlank'"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划下达日期</th>
|
||||
<td>
|
||||
<input id="stdt" name="stdt" class="Wdate" value="${nowDate}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划完成日期</th>
|
||||
<td>
|
||||
<input id="eddt" name="eddt" class="Wdate" value="${tomDate}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td><input name="remark" class="easyui-textbox" style="width:100%;height:100px"
|
||||
value=""data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr> -->
|
||||
<!-- <th>计划状态</th> -->
|
||||
<!-- <td><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'"> -->
|
||||
<!-- <option value="0" selected>计划编制</option> -->
|
||||
<!-- <option value="1">计划下发</option> -->
|
||||
<!-- </select> -->
|
||||
<!-- </td> -->
|
||||
<!-- </tr> -->
|
||||
<input id="status" name="status" type="hidden" value=""/>
|
||||
</table>
|
||||
<!-- <br/>
|
||||
<div id="div_product" class="easyui-panel" title="手动选择的已排计划产品" data-options="collapsible:true,closed:true" >
|
||||
<table id="producttable" title="产品明细" class="table" data-options="border:false,region:'center'" >
|
||||
<tr><td style="width:20%; text-align:center">序号</td>
|
||||
<td style="width:40%; ">产品序列号</td>
|
||||
<td style="width:40%; ">原生产订单号</td></tr>
|
||||
</table>
|
||||
</div> -->
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
70
bin/WebRoot/jsp/plan/dailyPlanAddMoreByTaskOrderId.jsp
Normal file
70
bin/WebRoot/jsp/plan/dailyPlanAddMoreByTaskOrderId.jsp
Normal file
@ -0,0 +1,70 @@
|
||||
<%@ 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();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
function dosave(dialog,grid) {
|
||||
$.post(ext.contextPath + "/plan/dailyplan/saveMoreByTaskOrderid.do", $(".form").serialize(), function(data) {
|
||||
if(data.res=='1'){
|
||||
top.$.messager.alert("提示", "操作成功!", "info");
|
||||
dialog.dialog('destroy');
|
||||
grid.datagrid("reload");
|
||||
}else{
|
||||
top.$.messager.alert("提示", data.res, "error");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
},'json');
|
||||
|
||||
}
|
||||
$(function() {
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<form method="post" class="form">
|
||||
<input id="taskOrderId" name="taskOrderId" type="hidden" value="${taskOrder.id }" />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >当前未安排数量</th>
|
||||
<td ></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >当前实际产量</th>
|
||||
<td ></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >分配任务单产量</th>
|
||||
<td ><input id="destAmount" name="destAmount" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${taskOrder.prodamount}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >计划开始日期</th>
|
||||
<td ><input id="stdt" name="stdt" class="Wdate" value="${fn:substring(taskOrder.pstdate,0,10)}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >计划结束日期</th>
|
||||
<td ><input id="eddt" name="eddt" class="Wdate" value="${fn:substring(taskOrder.pendate,0,10)}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
161
bin/WebRoot/jsp/plan/dailyPlanAddOldOrderPlan.jsp
Normal file
161
bin/WebRoot/jsp/plan/dailyPlanAddOldOrderPlan.jsp
Normal file
@ -0,0 +1,161 @@
|
||||
<%@ 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();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
function dosave(dialog,grid) {
|
||||
var rowsdata=$('#grid').datagrid('getChecked');
|
||||
if (rowsdata.length>0) {
|
||||
var dailyplansummaryid='${param.pid}';
|
||||
var dpids="";
|
||||
var productquantity="";
|
||||
var productionorderno="";
|
||||
var remark="";//暂时没做输入,后续完善
|
||||
$.each(rowsdata, function(index, item){
|
||||
// var editorR = $('#grid').datagrid('getEditor', {index:index,field:"remark"});
|
||||
// if(editorR!=null&&editorR!=undefined){
|
||||
// var editRemark = editorR.target.val();
|
||||
// remark+=editRemark+",";
|
||||
// }else{
|
||||
// remark+=" ,";
|
||||
// }
|
||||
var editor = $('#grid').datagrid('getEditor', {index:index,field:"productquantity"});
|
||||
if(editor!=null&&editor!=undefined){
|
||||
var editAmount = editor.target.val();
|
||||
productquantity+=editAmount+",";
|
||||
}else{
|
||||
productquantity+=item.productquantity+",";
|
||||
}
|
||||
dpids+=item.id+",";
|
||||
productionorderno+=item.productionorderno+",";
|
||||
});
|
||||
$.post(ext.contextPath + "/plan/dailyplan/oldordersave.do", {dailyplansummaryid:dailyplansummaryid,dpids:dpids,productionorderno:productionorderno,productquantity:productquantity,remark:remark}, function(data) {
|
||||
top.$.messager.alert("提示", data.res, "info", function() {
|
||||
parent.$('#viewp1')[0].contentWindow.$('#edittd').show();
|
||||
dialog.dialog('destroy');
|
||||
grid.datagrid("reload");
|
||||
});
|
||||
|
||||
},'json');
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplan/getoldorderplan.do',
|
||||
queryParams: {
|
||||
insertpid:'${insertpid}'
|
||||
},
|
||||
rownumbers : true,
|
||||
striped : true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '销售订单号', field : 'salesorderproduct', sortable : true, halign:'center' ,formatter : function(value, row){
|
||||
return value.salesorderno;
|
||||
} },
|
||||
{width : '100', title : '产品名称', field : 'product', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
return value.materialname;
|
||||
}},
|
||||
{width : '100', title : '生产订单号', field : 'productionorderno', halign:'center' ,sortable:true},
|
||||
{width : '80', title : '计划生产数', field : 'productquantity', halign:'center' ,sortable:false,editor:{type:'numberbox',options:{precision:1}}},
|
||||
{width : '180', title : '工艺路线', field : 'processrealname', halign:'center' ,sortable:false},
|
||||
{width : '120', title : '计划下达日期', field : 'stdt',align:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},sortable:false },
|
||||
{width : '120', title : '计划完成日期', field : 'eddt', align:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
} ,sortable:false},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
},
|
||||
onClickCell: function (rowIndex, field, value) {
|
||||
beginEditing(rowIndex, field, value);
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
var editIndex = undefined;
|
||||
var beginEditing = function (rowIndex, field, value) {
|
||||
if (field!= "productquantity" ){
|
||||
if(editIndex!=undefined)
|
||||
{
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (rowIndex != editIndex) {
|
||||
if (endEditing()) {
|
||||
$('#grid').datagrid('beginEdit', rowIndex);
|
||||
editIndex = rowIndex;
|
||||
|
||||
var ed = $('#grid').datagrid('getEditor', { index: rowIndex, field: 'productquantity' });
|
||||
$(ed.target).focus().bind('blur', function () {
|
||||
endEditing();
|
||||
});
|
||||
} else {
|
||||
$('#grid').datagrid('selectRow', editIndex);
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
}
|
||||
};
|
||||
var endEditing = function () {
|
||||
if (editIndex == undefined){
|
||||
return true;
|
||||
}
|
||||
if ($('#grid').datagrid('validateRow', editIndex)) {
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'productquantity' });
|
||||
var number = $(ed.target).numberbox('getValue');
|
||||
$('#grid').datagrid('getRows')[editIndex]['productquantity'] = number;
|
||||
if(number==0){
|
||||
top.$.messager.alert('提示', "计划数量不可为0", 'info');
|
||||
$('#grid').datagrid('uncheckRow', editIndex);
|
||||
}
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
264
bin/WebRoot/jsp/plan/dailyPlanCalendar.jsp
Normal file
264
bin/WebRoot/jsp/plan/dailyPlanCalendar.jsp
Normal file
@ -0,0 +1,264 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<% request.setAttribute("Resp_Success", CommString.Resp_Success);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/233/bkf2ntm7/jquery.fullcalendar.js?v=0.7"></script>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<style scoped="scoped">
|
||||
.md{
|
||||
background-position:2px center;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
font-size:20px;
|
||||
padding:0 2px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var grid;
|
||||
var addreturn=0;
|
||||
var addFun = function(date,sdt,edt) {
|
||||
var thisdate=new Date(date);
|
||||
var dt=thisdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
addreturn=0;
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '新增日计划单信息',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/add.do?date='+dt+'&sdt='+sdt+'&edt='+edt,
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
addreturn=1;
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
onDestroy:function(){
|
||||
if(addreturn==1){
|
||||
refreshcalerdar();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//按日期复制之前某一天的日计划
|
||||
var copyFun = function(date) {
|
||||
var thisdate=new Date(date);
|
||||
var dt=thisdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
addreturn=0;
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '新增日计划单信息',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/add.do?date='+dt,
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
addreturn=1;
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
onDestroy:function(){
|
||||
if(addreturn==1){
|
||||
refreshcalerdar();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var doLook = function(date,sdt,edt) {
|
||||
var nowdate = new Date();
|
||||
var thisdate=new Date(date);
|
||||
var dt=thisdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlist.do?dt='+dt,
|
||||
onDestroy:function(){
|
||||
refreshcalerdar();
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var groupManageid="";
|
||||
var groupManagename="";
|
||||
var dosheduling = function(d,dname){
|
||||
groupManageid=d;
|
||||
groupManagename=dname;
|
||||
};
|
||||
function getNextFormatDate() {
|
||||
var nowdate = new Date();
|
||||
var seperator1 = "-";
|
||||
var seperator2 = ":";
|
||||
nowdate=nowdate.valueOf()+1000*60*60*24;
|
||||
var date = new Date(nowdate);
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var nextdate = year + seperator1 + month + seperator1 + strDate;
|
||||
return nextdate;
|
||||
}
|
||||
var refreshcalerdar=function(){
|
||||
var month=$('#cc').calendar('options')['month'];
|
||||
var year=$('#cc').calendar('options')['year'];
|
||||
var btext="";
|
||||
$.post(ext.contextPath + '/plan/dailyplansummary/getDPSforCalerdar.do',{year:year,month:month}, function(data) {
|
||||
var obj = JSON.parse(data);
|
||||
var obj_dps=obj.jsondps;
|
||||
$('#cc').calendar({
|
||||
formatter: function(date){
|
||||
btext="";
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth()+1;
|
||||
var y = date.getFullYear();
|
||||
var tempm="";
|
||||
var tempd="";
|
||||
if (m >= 1 && m <= 9) {
|
||||
tempm = "0";
|
||||
}
|
||||
if (d >= 0 && d <= 9) {
|
||||
tempd = "0";
|
||||
}
|
||||
var destDate=y+"-"+tempm+m+"-"+tempd+d;
|
||||
var sdt = destDate+" 00:00:00";
|
||||
var edt = destDate+" 23:59:59";
|
||||
//var dt=date.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
var nowdate = new Date();
|
||||
|
||||
var i=0;
|
||||
for(i=0;i<obj_dps.length;i++){
|
||||
var plandt=obj_dps[i].plandt;
|
||||
//alert(workstdt);
|
||||
var dpsmonth=String(parseInt(plandt.substring(5,7)));//去除数据库查询日期中的"0'
|
||||
var dpsday=String(parseInt(plandt.substring(8,10)));
|
||||
if(m==dpsmonth && d==dpsday ){
|
||||
//btext+='<a class="easyui-linkbutton" style="color:black;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="addFun(\''+dt+'\')">添加</a>';
|
||||
btext+='<a class="easyui-linkbutton" style="font-weight:bold;color:blue;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="doLook(\''+date+'\',\''+sdt+'\',\''+edt+'\')">查看</a>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
var bt;
|
||||
if(date>nowdate ||(date.getMonth()==nowdate.getMonth()&&date.getDate()==nowdate.getDate())){//算上今天,及以后才能新增
|
||||
// if(i<obj_dps.length){
|
||||
// btext+='    ';
|
||||
// }
|
||||
if(i==obj_dps.length){
|
||||
btext+='<a class="easyui-linkbutton" style="color:black;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="addFun(\''+date+'\',\''+sdt+'\',\''+edt+'\')">添加</a>';
|
||||
}
|
||||
|
||||
//btext+='  '+'<a class="easyui-linkbutton" style="color:black;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="copyFun(\''+date+'\')">复制</a>';
|
||||
}
|
||||
bt='<div class="md" draggable="true" style="font-size:26px;" ondrop="drop(event)" ondragover="allowDrop(event)" ondragstart="drag(event)" myDate='+destDate+'>'+d+'</div>';
|
||||
bt=bt+btext;
|
||||
return bt;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
function allowDrop(ev)
|
||||
{
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
function drop(ev){
|
||||
ev.preventDefault();
|
||||
var sourceDate=ev.dataTransfer.getData("Text");
|
||||
var destDate=ev.target.getAttribute('myDate');
|
||||
if(sourceDate>=destDate){
|
||||
top.$.messager.alert('提示','目标日期不能小于或等于源日期!','error');
|
||||
return;
|
||||
}
|
||||
var date = new Date();
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth()+1;
|
||||
var y = date.getFullYear();
|
||||
var tempm="";
|
||||
var tempd="";
|
||||
if (m >= 1 && m <= 9) {
|
||||
tempm = "0";
|
||||
}
|
||||
if (d >= 0 && d <= 9) {
|
||||
tempd = "0";
|
||||
}
|
||||
var nowDate=y+"-"+tempm+m+"-"+tempd+d;
|
||||
//alert(nowDate)
|
||||
if(destDate<nowDate){
|
||||
top.$.messager.alert('提示','过期日期不能排日计划!','error');
|
||||
return;
|
||||
}
|
||||
//console.log(data);
|
||||
parent.$.messager.confirm('提示', '是否将('+sourceDate+')计划复制到('+destDate+')中?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/dailyplansummary/copyDailyPlans.do',{sourceDate:sourceDate,destDate:destDate}, function(data) {
|
||||
if(data.res=='${Resp_Success}'){
|
||||
top.$.messager.alert('提示','复制成功','info');
|
||||
refreshcalerdar();
|
||||
}else{
|
||||
top.$.messager.alert('提示',data.res,'error');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function drag(ev){
|
||||
ev.dataTransfer.setData("Text",ev.target.getAttribute('myDate'));
|
||||
//console.log(ev.target.getAttribute('myDate'));
|
||||
/* for(var i in ev.target){
|
||||
console.log("key:",i);
|
||||
console.log("val:",ev.target[i]);
|
||||
} */
|
||||
|
||||
}
|
||||
|
||||
var lastcolor;
|
||||
var changeback1=function(obj){
|
||||
lastcolor=obj.style.color.toLowerCase();
|
||||
obj.style.color=obj.style.color.toLowerCase()=='red'?lastcolor:'red';
|
||||
};
|
||||
var changeback2=function(obj){
|
||||
obj.style.color=obj.style.color.toLowerCase()=='red'?lastcolor:'red';
|
||||
};
|
||||
$(function() {
|
||||
refreshcalerdar();
|
||||
|
||||
$('#cc div.calendar-nav').click(function () {
|
||||
//setTimeout产生异步效果
|
||||
setTimeout("refreshcalerdar()",0);
|
||||
});
|
||||
$('#cc div.calendar-menu-month-inner').click(function () {
|
||||
setTimeout("refreshcalerdar()",0);
|
||||
});
|
||||
|
||||
$(".calendar-title .calendar-text").css("fontSize","18px");
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" style="font-family:微软雅黑">
|
||||
<div class="easyui-panel" data-options="fit:true" style="padding:2px;">
|
||||
<div id="cc" class="easyui-calendar" data-options="fit:true" ></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
176
bin/WebRoot/jsp/plan/dailyPlanCalendarBackup.jsp
Normal file
176
bin/WebRoot/jsp/plan/dailyPlanCalendarBackup.jsp
Normal file
@ -0,0 +1,176 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/233/bkf2ntm7/jquery.fullcalendar.js?v=0.7"></script>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<style scoped="scoped">
|
||||
.md{
|
||||
background-position:2px center;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
font-size:20px;
|
||||
padding:0 2px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var grid;
|
||||
var addreturn=0;
|
||||
var addFun = function(date,sdt,edt) {
|
||||
var thisdate=new Date(date);
|
||||
var dt=thisdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
addreturn=0;
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '新增日计划单信息',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/add.do?date='+dt,
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
addreturn=1;
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
onDestroy:function(){
|
||||
if(addreturn==1){
|
||||
refreshcalerdar();
|
||||
doLook(date,sdt,edt);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var doLook = function(date,sdt,edt) {
|
||||
var nowdate = new Date();
|
||||
var thisdate=new Date(date);
|
||||
var olddayflag=0;
|
||||
if(thisdate<nowdate &&thisdate.getDate()!=nowdate.getDate()){
|
||||
olddayflag=1;
|
||||
}
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlist.do?&sdt='+sdt+'&edt='+edt+'&iframeId=view&olddayflag='+olddayflag,
|
||||
onDestroy:function(){
|
||||
refreshcalerdar();
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var groupManageid="";
|
||||
var groupManagename="";
|
||||
var dosheduling = function(d,dname){
|
||||
groupManageid=d;
|
||||
groupManagename=dname;
|
||||
};
|
||||
function getNextFormatDate() {
|
||||
var nowdate = new Date();
|
||||
var seperator1 = "-";
|
||||
var seperator2 = ":";
|
||||
nowdate=nowdate.valueOf()+1000*60*60*24;
|
||||
var date = new Date(nowdate);
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var nextdate = year + seperator1 + month + seperator1 + strDate;
|
||||
return nextdate;
|
||||
}
|
||||
var refreshcalerdar=function(){
|
||||
var month=$('#cc').calendar('options')['month'];
|
||||
var year=$('#cc').calendar('options')['year'];
|
||||
var btext="";
|
||||
$.post(ext.contextPath + '/plan/dailyplansummary/getDPSforCalerdar.do',{year:year,month:month}, function(data) {
|
||||
var obj = JSON.parse(data);
|
||||
var obj_dps=obj.jsondps;
|
||||
$('#cc').calendar({
|
||||
formatter: function(date){
|
||||
btext="";
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth()+1;
|
||||
var y = date.getFullYear();
|
||||
var tempm="";
|
||||
var tempd="";
|
||||
if (m >= 1 && m <= 9) {
|
||||
tempm = "0";
|
||||
}
|
||||
if (d >= 0 && d <= 9) {
|
||||
tempd = "0";
|
||||
}
|
||||
var sdt = y+"-"+tempm+m+"-"+tempd+d+" 00:00:00";
|
||||
var edt = y+"-"+tempm+m+"-"+tempd+d+" 23:59:59";
|
||||
//var dt=date.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
var nowdate = new Date();
|
||||
|
||||
var i=0;
|
||||
for(i=0;i<obj_dps.length;i++){
|
||||
var plandt=obj_dps[i].plandt;
|
||||
//alert(workstdt);
|
||||
var dpsmonth=String(parseInt(plandt.substring(5,7)));//去除数据库查询日期中的"0'
|
||||
var dpsday=String(parseInt(plandt.substring(8,10)));
|
||||
if(m==dpsmonth && d==dpsday ){
|
||||
//btext+='<a class="easyui-linkbutton" style="color:black;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="addFun(\''+dt+'\')">添加</a>';
|
||||
btext+='<a class="easyui-linkbutton" style="font-weight:bold;color:blue;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="doLook(\''+date+'\',\''+sdt+'\',\''+edt+'\')">查看</a>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(date>nowdate ||(date.getMonth()==nowdate.getMonth()&&date.getDate()==nowdate.getDate())){//算上今天
|
||||
if(i==obj_dps.length){
|
||||
btext+='<a class="easyui-linkbutton" style="color:black;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="addFun(\''+date+'\',\''+sdt+'\',\''+edt+'\')">添加</a>';
|
||||
//btext+='  '+'<a class="easyui-linkbutton" style="color:black;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="doLook(\''+sdt+'\',\''+edt+'\')">查看</a>';
|
||||
|
||||
}
|
||||
}
|
||||
var bt='<div class="md" style="font-size:26px;" >'+d+'</div>';
|
||||
bt=bt+btext;
|
||||
return bt;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
var lastcolor;
|
||||
var changeback1=function(obj){
|
||||
lastcolor=obj.style.color.toLowerCase();
|
||||
obj.style.color=obj.style.color.toLowerCase()=='red'?lastcolor:'red';
|
||||
};
|
||||
var changeback2=function(obj){
|
||||
obj.style.color=obj.style.color.toLowerCase()=='red'?lastcolor:'red';
|
||||
};
|
||||
$(function() {
|
||||
refreshcalerdar();
|
||||
|
||||
$('#cc div.calendar-nav').click(function () {
|
||||
//setTimeout产生异步效果
|
||||
setTimeout("refreshcalerdar()",0);
|
||||
});
|
||||
$('#cc div.calendar-menu-month-inner').click(function () {
|
||||
setTimeout("refreshcalerdar()",0);
|
||||
});
|
||||
|
||||
$(".calendar-title .calendar-text").css("fontSize","18px");
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" style="font-family:微软雅黑">
|
||||
<div class="easyui-panel" data-options="fit:true" style="padding:2px;">
|
||||
<div id="cc" class="easyui-calendar" data-options="fit:true" ></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
172
bin/WebRoot/jsp/plan/dailyPlanCalendarOperate.jsp
Normal file
172
bin/WebRoot/jsp/plan/dailyPlanCalendarOperate.jsp
Normal file
@ -0,0 +1,172 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/233/bkf2ntm7/jquery.fullcalendar.js?v=0.7"></script>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<style scoped="scoped">
|
||||
.md{
|
||||
background-position:2px center;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
font-size:20px;
|
||||
padding:0 2px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var grid;
|
||||
var addreturn=0;
|
||||
var addFun = function(date,sdt,edt) {
|
||||
var thisdate=new Date(date);
|
||||
var dt=thisdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
addreturn=0;
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '新增日计划单信息',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/add.do?date='+dt,
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
addreturn=1;
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
onDestroy:function(){
|
||||
if(addreturn==1){
|
||||
refreshcalerdar();
|
||||
doLook(date,sdt,edt);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var doLook = function(date,sdt,edt) {
|
||||
var nowdate = new Date();
|
||||
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlistoperate.do?&dt='+dt,
|
||||
onDestroy:function(){
|
||||
refreshcalerdar();
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var groupManageid="";
|
||||
var groupManagename="";
|
||||
var dosheduling = function(d,dname){
|
||||
groupManageid=d;
|
||||
groupManagename=dname;
|
||||
};
|
||||
function getNextFormatDate() {
|
||||
var nowdate = new Date();
|
||||
var seperator1 = "-";
|
||||
var seperator2 = ":";
|
||||
nowdate=nowdate.valueOf()+1000*60*60*24;
|
||||
var date = new Date(nowdate);
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var nextdate = year + seperator1 + month + seperator1 + strDate;
|
||||
return nextdate;
|
||||
}
|
||||
var refreshcalerdar=function(){
|
||||
var month=$('#cc').calendar('options')['month'];
|
||||
var year=$('#cc').calendar('options')['year'];
|
||||
var btext="";
|
||||
$.post(ext.contextPath + '/plan/dailyplansummary/getDPSforCalerdar.do',{year:year,month:month}, function(data) {
|
||||
var obj = JSON.parse(data);
|
||||
var obj_dps=obj.jsondps;
|
||||
$('#cc').calendar({
|
||||
formatter: function(date){
|
||||
btext="";
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth()+1;
|
||||
var y = date.getFullYear();
|
||||
var tempm="";
|
||||
var tempd="";
|
||||
if (m >= 1 && m <= 9) {
|
||||
tempm = "0";
|
||||
}
|
||||
if (d >= 0 && d <= 9) {
|
||||
tempd = "0";
|
||||
}
|
||||
var sdt = y+"-"+tempm+m+"-"+tempd+d+" 00:00:00";
|
||||
var edt = y+"-"+tempm+m+"-"+tempd+d+" 23:59:59";
|
||||
//var dt=date.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
var nowdate = new Date();
|
||||
|
||||
var i=0;
|
||||
for(i=0;i<obj_dps.length;i++){
|
||||
var plandt=obj_dps[i].plandt;
|
||||
//alert(workstdt);
|
||||
var dpsmonth=String(parseInt(plandt.substring(5,7)));//去除数据库查询日期中的"0'
|
||||
var dpsday=String(parseInt(plandt.substring(8,10)));
|
||||
if(m==dpsmonth && d==dpsday ){
|
||||
//btext+='<a class="easyui-linkbutton" style="color:black;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="addFun(\''+dt+'\')">添加</a>';
|
||||
btext+='<a class="easyui-linkbutton" style="font-weight:bold;color:blue;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="doLook(\''+date+'\',\''+sdt+'\',\''+edt+'\')">查看</a>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* if(date>nowdate ||(date.getMonth()==nowdate.getMonth()&&date.getDate()==nowdate.getDate())){//算上今天
|
||||
if(i==obj_dps.length){
|
||||
//btext+='<a class="easyui-linkbutton" style="color:black;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="addFun(\''+date+'\',\''+sdt+'\',\''+edt+'\')">添加</a>';
|
||||
|
||||
}
|
||||
} */
|
||||
var bt='<div class="md" style="font-size:26px;" >'+d+'</div>';
|
||||
bt=bt+btext;
|
||||
return bt;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
var lastcolor;
|
||||
var changeback1=function(obj){
|
||||
lastcolor=obj.style.color.toLowerCase();
|
||||
obj.style.color=obj.style.color.toLowerCase()=='red'?lastcolor:'red';
|
||||
};
|
||||
var changeback2=function(obj){
|
||||
obj.style.color=obj.style.color.toLowerCase()=='red'?lastcolor:'red';
|
||||
};
|
||||
$(function() {
|
||||
refreshcalerdar();
|
||||
|
||||
$('#cc div.calendar-nav').click(function () {
|
||||
//setTimeout产生异步效果
|
||||
setTimeout("refreshcalerdar()",0);
|
||||
});
|
||||
$('#cc div.calendar-menu-month-inner').click(function () {
|
||||
setTimeout("refreshcalerdar()",0);
|
||||
});
|
||||
|
||||
$(".calendar-title .calendar-text").css("fontSize","18px");
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" style="font-family:微软雅黑">
|
||||
<div class="easyui-panel" data-options="fit:true" style="padding:2px;">
|
||||
<div id="cc" class="easyui-calendar" data-options="fit:true" ></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
418
bin/WebRoot/jsp/plan/dailyPlanEdit.jsp
Normal file
418
bin/WebRoot/jsp/plan/dailyPlanEdit.jsp
Normal file
@ -0,0 +1,418 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var selectedProducts='';
|
||||
var manualnum=0;
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/dailyplan/update.do", $(".form").serialize(), function(data) {
|
||||
if (data == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
// 刷新列表
|
||||
//parent.$('#viewp1')[0].contentWindow.$('#edittd').show();
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
function selectSalesOrderProduct(taskorderid,tasklistcode){
|
||||
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();
|
||||
console.log(res);
|
||||
if(res!=null){
|
||||
$("#"+tasklistcode).textbox('setValue',res.tasklistcode);//easyui textbox赋值jquery不一样
|
||||
$("#"+taskorderid).val(res.id);
|
||||
$("#productno").html(res.productno);
|
||||
$("#prodamount").html(res.prodamount);
|
||||
$("#salesno").html(res.salesno);
|
||||
$("#pstdate").html(res.pstdate.substring(0,10));
|
||||
$("#pendate").html(res.pendate.substring(0,10));
|
||||
$("#billstatus").html(res.billstatus);
|
||||
$("#billruntime").html(res.billruntime.substring(0,10));
|
||||
manualnum=0;
|
||||
displayNum();
|
||||
|
||||
//$("#div_product").panel('close');
|
||||
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function selectProcess(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择工艺路线',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/activiti/workflow/getProcessForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#processrealid").textbox('setValue',res.id);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function selectBom(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择Bom',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/material/materialbom/selectBOMs.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#bomid").val(res.bomid);
|
||||
$("#bomname").textbox('setText',res.bomcode);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function selectDailyPlanSummary(pid,dailyplansummary){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择日计划归属日期',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/plan/dailyplansummary/select.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#"+dailyplansummary).textbox('setValue',res.plandt.substring(0,10));//easyui textbox赋值jquery不一样
|
||||
$("#"+pid).val(res.id);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function dodistribute(dialog, grid){
|
||||
parent.$.messager.confirm('提示', '您确定要下发计划?下发计划被安排任务后,将无法修改,只能作废。', function(r) {
|
||||
if(r){
|
||||
$("#status").val('1');
|
||||
//dosave
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/dailyplan/save.do", $(".form").serialize()+"&selectedProducts="+selectedProducts, function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//distribute
|
||||
/* $.post(ext.contextPath + '/work/workorder/addbyplan.do', {ids:ids} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','下发计划成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','下发计划失败','info');
|
||||
}
|
||||
}); */
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}else{
|
||||
return ;
|
||||
}
|
||||
});
|
||||
}
|
||||
function dosubmit(dialog,grid){
|
||||
parent.$.messager.confirm('提示', '您确定要提交计划?提交计划等待审核,将无法修改。', function(r) {
|
||||
if(r){
|
||||
$("#status").val('1');
|
||||
//dosave
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/dailyplan/save.do", $(".form").serialize()+"&selectedProducts="+selectedProducts, function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', '提交成功', 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "提交失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
function selectOrderProductDetail(){
|
||||
var taskorderid=$("#taskorderid").val();
|
||||
if(taskorderid==null||taskorderid==""){
|
||||
top.$.messager.alert('提示', "请先选择任务单", 'info');
|
||||
return;
|
||||
}
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '产品列表(本计划生产总数:<span style=\"color:red\">'+totalnum+'</span>)',
|
||||
width: 950,
|
||||
height:550,
|
||||
url : ext.contextPath + '/material/orderproductdetail/showlistForSelect.do?salesorderid='+taskorderid+'&totalnum='+totalnum+'&iframeId=${param.iframeId}&plandate=${param.plandate}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
parent.$.messager.confirm('提示', '已排计划的产品重新排计划将更改原计划状态为重排,作废原工单。已完成产品重排计划无效。', function(r) {
|
||||
if (r) {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){//获得已排计划产品信息,待保存时再作废计划和任务
|
||||
selectedProducts=res;
|
||||
dialog.dialog('destroy');
|
||||
//$("#div_product").panel('open');
|
||||
//document.getElementById("producttable").style.display="";
|
||||
var selectedarr=(selectedProducts+",").split('}');//去掉了右括号
|
||||
manualnum=selectedarr.length-1;//显示个数及修改传值
|
||||
displayNum();
|
||||
/* var tb= document.getElementById('producttable');//删除旧的table
|
||||
var rowNum=tb.rows.length;
|
||||
for(var j=1;j<rowNum;j++){
|
||||
tb.deleteRow(j);
|
||||
rowNum=rowNum-1;
|
||||
j=j-1;
|
||||
}
|
||||
for(var i=1;i<selectedarr.length;i++){
|
||||
var dataset;
|
||||
if(i==1){
|
||||
dataset = $.parseJSON(selectedarr[i-1]+"}");//加上右括号
|
||||
}else{
|
||||
dataset = $.parseJSON(selectedarr[i-1].substring(1,selectedarr[i-1].length)+"}");//驱动左逗号加上右括号
|
||||
}
|
||||
var htmlstr="<tr><td style='text-align:center'>"+i+"</td><td>"+dataset.productuid+"</td><td>"+dataset.productionorderno+"</td></tr>";
|
||||
$("#producttable").append(htmlstr);
|
||||
} */
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function displayNum(){
|
||||
$("#sys").html(manualnum);
|
||||
$("#sysarrangenum").val(manualnum);
|
||||
$("#man").html(manualnum);
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#salesordernum").textbox('textbox').bind("click", function () {
|
||||
selectSalesOrderProduct("taskorderid","salesordernum");
|
||||
});
|
||||
|
||||
$("#processrealid").textbox('textbox').bind("click", function () {
|
||||
selectProcess();;
|
||||
});
|
||||
$("#bomname").textbox('textbox').bind("click", function () {
|
||||
selectBom();;
|
||||
});
|
||||
$("#dailyplansummary").textbox('textbox').bind("click", function () {
|
||||
selectDailyPlanSummary("pid","dailyplansummary");
|
||||
});
|
||||
/* $("#lineid").combobox({
|
||||
url : ext.contextPath + '/work/line/getLineListForSelect.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess:function(){
|
||||
$("#lineid").combobox('setValue','${dailyplan.lineid}');
|
||||
}
|
||||
}); */
|
||||
$("#bomid").textbox('setText','${dailyplan.materialBOM.materialcode}');
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" id="id" name="id" value="${dailyplan.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>任务单编号</th>
|
||||
<td><input id="salesordernum" name="salesordernum" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="${dailyplan.taskorder.tasklistcode}" readonly/>
|
||||
<input id="taskorderid" name="taskorderid" type="hidden" value="${dailyplan.taskorder.id}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品编码</th>
|
||||
<td ><span id="productno">${dailyplan.taskorder.productno}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品数量</th>
|
||||
<td><span id="prodamount">${dailyplan.taskorder.prodamount}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>销售单号</th>
|
||||
<td><span id="salesno">${dailyplan.taskorder.salesno}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>开始日期</th>
|
||||
<td><span id="pstdate">${fn:substring(dailyplan.taskorder.pstdate,0,10)}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>结束日期</th>
|
||||
<td><span id="pendate">${fn:substring(dailyplan.taskorder.pendate,0,10)}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据状态</th>
|
||||
<td><span id="billstatus">${dailyplan.taskorder.billstatus}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据下达日期</th>
|
||||
<td><span id="billruntime">${fn:substring(dailyplan.taskorder.billruntime,0,10)}</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>计划日期</th>
|
||||
<td><input id="dailyplansummary" name="dailyplansummary" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="${fn:substring(dailyplan.stdt,0,10)}" readonly/>
|
||||
<input id="pid" name="pid" type="hidden" value="${dailyplan.pid}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工艺路线ID</th>
|
||||
<td>
|
||||
<input id="processrealid" name="processrealid" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${dailyplan.processrealid }"/></td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<th>产线</th>
|
||||
<td><input id="lineid" name="lineid" class="easyui-combobox" data-options="required:true,validType:'isBlank'"/></td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<th>产品BOM</th>
|
||||
<td><input type="hidden" id="bomid" name="bomid" value="${dailyplan.materialBOM.id}"/>
|
||||
<input id="bomname" name="bomname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${dailyplan.materialBOM.materialname}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划下达日期</th>
|
||||
<td>
|
||||
<input id="stdt" name="stdt" class="Wdate" value="${dailyplan.stdt}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划完成日期</th>
|
||||
<td>
|
||||
<input id="eddt" name="eddt" class="Wdate" value="${dailyplan.eddt}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td><input name="remark" class="easyui-textbox" style="width:100%;height:100px"
|
||||
value=""data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr> -->
|
||||
<!-- <th>计划状态</th> -->
|
||||
<!-- <td><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'"> -->
|
||||
<!-- <option value="0" selected>计划编制</option> -->
|
||||
<!-- <option value="1">计划下发</option> -->
|
||||
<!-- </select> -->
|
||||
<!-- </td> -->
|
||||
<!-- </tr> -->
|
||||
</table>
|
||||
<!-- <br/>
|
||||
<div id="div_product" class="easyui-panel" title="手动选择的已排计划产品" data-options="collapsible:true,closed:true" >
|
||||
<table id="producttable" title="产品明细" class="table" data-options="border:false,region:'center'" >
|
||||
<tr><td style="width:20%; text-align:center">序号</td>
|
||||
<td style="width:40%; ">产品序列号</td>
|
||||
<td style="width:40%; ">原生产订单号</td></tr>
|
||||
</table>
|
||||
</div> -->
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
48
bin/WebRoot/jsp/plan/dailyPlanGantt.jsp
Normal file
48
bin/WebRoot/jsp/plan/dailyPlanGantt.jsp
Normal file
@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1">
|
||||
|
||||
<link rel="stylesheet" href="<%=contextPath%>/JS/jquery-gantt/css/style.css" />
|
||||
|
||||
<script src="<%=contextPath%>/JS/jquery-gantt/js/jquery.min.js"></script>
|
||||
<script src="<%=contextPath%>/JS/jquery-gantt/js/jquery.fn.gantt.js"></script>
|
||||
<script src="<%=contextPath%>/JS/jquery-gantt/js/jquery.cookie.js"></script>
|
||||
|
||||
</head>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
gantt();
|
||||
});
|
||||
|
||||
function gantt(){
|
||||
$(".gantt").gantt({
|
||||
source:${result},
|
||||
months: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份显示的语言
|
||||
dow: ["日", "一", "二", "三", "四", "五", "六"], //星期显示的语言
|
||||
scale: "days", //默认显示的粒度
|
||||
maxScale: "weeks", //最大显示的粒度
|
||||
minScale: "days", //最小显示的粒度
|
||||
itemsPerPage: 20, //每页显示的数目
|
||||
onRender:resize
|
||||
});
|
||||
}
|
||||
|
||||
function resize(){
|
||||
var main = $(window.parent.document).find("#iframe1");
|
||||
var thisheight = $(document).height()+30;
|
||||
main.height(thisheight);
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
<div class="gantt"></div>
|
||||
</body>
|
||||
</html>
|
||||
388
bin/WebRoot/jsp/plan/dailyPlanList.jsp
Normal file
388
bin/WebRoot/jsp/plan/dailyPlanList.jsp
Normal file
@ -0,0 +1,388 @@
|
||||
<%@ 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"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var ddv;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'add',
|
||||
title : '新增日计划',
|
||||
url : ext.contextPath + '/plan/dailyplan/add.do?iframeId=add',
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '下发',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dodistribute(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.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
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.dodistribute(dialog, grid);
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '作废',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.invalidate(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({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplan/getlist.do?flag=listpage',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '250', title : '销售订单号', field : 'salesorderno', sortable : true, halign:'center'},
|
||||
{width : '290', title : '产品名称', field : 'product', sortable : true, halign:'center',formatter : function(value,row){
|
||||
if(value!=null){
|
||||
return value.materialname;
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
}},
|
||||
{width : '250', title : '订单产品数量', field : 'productnum', sortable : true, align:'center'},
|
||||
{width : '250', title : '未排计划产品数', field : 'orderproductdetail', sortable : true, align:'center',formatter : function(value,row){
|
||||
if(value.length!=0){
|
||||
var unplanednum=0;
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].productionorderno==null || value[i].productionorderno==""){
|
||||
unplanednum++;
|
||||
}
|
||||
}
|
||||
return unplanednum;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(flag==0){
|
||||
flag=1;
|
||||
grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
}else{
|
||||
//展开所有的行
|
||||
for(var i=0;i<data.rows.length;i++){
|
||||
$('#grid').datagrid('expandRow',i);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
onExpandRow: function(index,row){
|
||||
ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddv.datagrid({
|
||||
url:ext.contextPath + '/plan/dailyplan/getlist_detail.do?salesOrderID='+row.id+'&search_name='+$('#search_name').textbox('getValue')+'&sdt='+$("#sdt").val()+'&edt='+$("#edt").val()+'&search_status='+$('#search_status').combobox('getValue'),
|
||||
fitColumns:true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
rownumbers:true,
|
||||
//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'){
|
||||
rowstyler+= ' background-color:#C0C0C0;color:#fff;';
|
||||
}else if(row.status=='6'){
|
||||
rowstyler+= ' font-style:ltalic;';
|
||||
}
|
||||
return rowstyler;
|
||||
},
|
||||
columns : [ [
|
||||
|
||||
{width : '100', title : '生产订单号', field : 'productionorderno', sortable : true, halign:'center' },
|
||||
// {width : '100', title : '料号', field : 'bomid', sortable : true, halign:'center' },
|
||||
{width : '80', title : '计划生产数', field : 'productquantity', sortable : true, halign:'center' },
|
||||
{width : '60', title : '完成数', field : 'finishedquantity', sortable : true, halign:'center' },
|
||||
{width : '180', title : '工艺路线ID', field : 'processrealid', sortable : true, halign:'center' },
|
||||
{width : '120', title : '计划下达日期', field : 'stdt', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
} },
|
||||
{width : '120', title : '计划完成日期', field : 'eddt', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
} },
|
||||
{width : '100', title : '计划状态', field : 'status', sortable : true, align:'center', formatter : function(value, row){
|
||||
switch(value){
|
||||
case "0": return "计划编制";
|
||||
case "1": return "计划下发";
|
||||
case "2": return "计划执行";
|
||||
case "3": return "已作废";
|
||||
case "4": return "已重排";
|
||||
case "6": return "已完成";
|
||||
}
|
||||
} },
|
||||
{title : '操作', field : 'action', width : '120', 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=='0'){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+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")) {%>
|
||||
str += '<img class="iconImg ext-icon-bin" title="计划作废" onclick="invalidateFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{width : '80', title : '提示', field : 'taskchangedstatus', sortable : true, 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 "";
|
||||
}
|
||||
} }
|
||||
] ],
|
||||
onResize:function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},0);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
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')));//搜索
|
||||
}
|
||||
</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,"plan/dailyplan/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,"plan/dailyplan/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<!-- <td><div class="datagrid-btn-separator"></div></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</a></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td>生产订单号</td>
|
||||
<td><input name="search_name" id="search_name" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td >计划状态</td>
|
||||
<td colspan='4'><select id="search_status" name="search_status" class="easyui-combobox" style="width:152px;">
|
||||
<option value='all' select>全部</option>
|
||||
<option value='edit'>编制中</option>
|
||||
<option value='inprogress'>进行中</option>
|
||||
<option value='completed'>已完成</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>计划下达日期</td>
|
||||
<td><input id="sdt" name="sdt" class="Wdate"
|
||||
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"
|
||||
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="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton"
|
||||
data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
188
bin/WebRoot/jsp/plan/dailyPlanList_task.jsp
Normal file
188
bin/WebRoot/jsp/plan/dailyPlanList_task.jsp
Normal file
@ -0,0 +1,188 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '新增日计划',
|
||||
url : ext.contextPath + '/plan/dailyplan/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看日计划',
|
||||
url : ext.contextPath + '/plan/dailyplan/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑日计划',
|
||||
url : ext.contextPath + '/plan/dailyplan/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var dosave = function(id) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas += '{"itemid":"'+item.id +'","productionorderno":"'+item.productionorderno +'"},';
|
||||
});
|
||||
return $.parseJSON('{"result":['+datas.replace(/,$/g,"")+']}');
|
||||
};
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplan/getdailyplans_task.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '销售订单号', field: 'salesorderproduct', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
if(value !=null){
|
||||
return value.salesorderno;
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
} },
|
||||
{width : '100', title : '生产订单号', field : 'productionorderno', sortable : true, halign:'center' },
|
||||
// {width : '100', title : '料号', field : 'bomid', sortable : true, halign:'center' },
|
||||
{width : '150', title : '产品信息', field : 'product', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.materialname;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '80', title : '计划生产数', field : 'productquantity', sortable : true, halign:'center' },
|
||||
{width : '60', title : '完成数', field : 'finishedquantity', sortable : true, halign:'center' },
|
||||
{width : '120', title : '任务下达日期', field : 'stdt', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
} },
|
||||
{width : '120', title : '任务完成日期', field : 'eddt', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
} },
|
||||
{width : '100', title : '计划状态', field : 'status', sortable : true, align:'center', formatter : function(value, row){
|
||||
switch(value){
|
||||
case "0": return "计划编制";
|
||||
case "1": return "计划下发";
|
||||
case "2": return "计划执行";
|
||||
case "3": return "计划作废";
|
||||
}
|
||||
} }
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td>生产订单号</td>
|
||||
<td><input name="search_name" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
67
bin/WebRoot/jsp/plan/dailyPlanSummaryAdd.jsp
Normal file
67
bin/WebRoot/jsp/plan/dailyPlanSummaryAdd.jsp
Normal file
@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/dailyplansummary/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
doLook('${param.date}','${param.sdt}','${param.edt}',data.id);
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var doLook = function(date,sdt,edt,id){
|
||||
var nowdate = new Date();
|
||||
var thisdate=new Date(date);
|
||||
var dt=thisdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog1',
|
||||
iframeId:'view',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlist.do?dt='+dt
|
||||
|
||||
});
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >日计划单号</th>
|
||||
<td ><input id="name" name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${autoname }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >日计划日期</th>
|
||||
<td ><input id="plandt" name="plandt" class="Wdate" value="${date }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox" style="overflow:auto;width:100%;height:80px;"
|
||||
value="" data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
74
bin/WebRoot/jsp/plan/dailyPlanSummaryAudit.jsp
Normal file
74
bin/WebRoot/jsp/plan/dailyPlanSummaryAudit.jsp
Normal file
@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog) {
|
||||
if($("#auditor").val()!=null && $("#auditor").val()!=""){
|
||||
$("#status").val("3");
|
||||
}
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/dailyplansummary/auditsave.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "审核成功", 'info', function() {
|
||||
//刷新
|
||||
parent.$('#viewp3')[0].contentWindow.location.reload();
|
||||
refreshbutton();
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
function refreshbutton(){
|
||||
parent.$('#viewp3')[0].contentWindow.$('#audittd').hide();
|
||||
parent.$('#viewp3')[0].contentWindow.$('#disttd').show();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${dailyplansummary.id }"/>
|
||||
<input id="status" name="status" type="hidden" value="${dailyplansummary.status }"/>
|
||||
<input id="insertpid" name="insertpid" type="hidden" value="${dailyplansummary.insertpid }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >审核人</th>
|
||||
<td ><input id="auditorname" name="auditorname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${cuname }" readonly/>
|
||||
<input id="auditor" name="auditor" type="hidden" value="${cuid}"/>
|
||||
</td>
|
||||
<script type="text/javascript">
|
||||
// $(function() {
|
||||
// $("#auditorname").textbox('textbox').bind("click", function () {
|
||||
// selectSingleUser("auditorname","auditor","${param.iframeId}");
|
||||
// });
|
||||
// });
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >审核日期</th>
|
||||
<td ><input id="auditdate" name="auditdate" class="Wdate" value="<c:if test='${dailyplansummary.auditdate!=null }'>${fn:substring(dailyplansummary.auditdate,0,19)}</c:if><c:if test='${dailyplansummary.auditdate==null }'>${nowdate }</c:if>"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"
|
||||
readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox" data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value="${dailyplansummary.remark}" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
54
bin/WebRoot/jsp/plan/dailyPlanSummaryEdit.jsp
Normal file
54
bin/WebRoot/jsp/plan/dailyPlanSummaryEdit.jsp
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/dailyplansummary/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新
|
||||
//parent.$('#'+'${param.iframeId}')[0].contentWindow.location.reload();
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${dailyplansummary.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >日计划单号</th>
|
||||
<td ><input id="name" name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${dailyplansummary.name }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >日计划日期</th>
|
||||
<td ><input id="plandt" name="plandt" value="${fn:substring(dailyplansummary.plandt,0,10)}" readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox" data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value="${dailyplansummary.remark}" validtype="length[0,250]" invalidMessage="有效长度0-250"/></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
93
bin/WebRoot/jsp/plan/dailyPlanSummaryForSelect.jsp
Normal file
93
bin/WebRoot/jsp/plan/dailyPlanSummaryForSelect.jsp
Normal file
@ -0,0 +1,93 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/getlistForSelect.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '名称', field: 'name', sortable : true, halign:'center' },
|
||||
{width : '180', title : '计划日期', field : 'plandt', sortable : true, halign:'center' , formatter : function(value, row) {
|
||||
if(value!=null){
|
||||
return value.substring(0,10);
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
function selectOK() {
|
||||
var jsonstr = "";
|
||||
var row = $('#grid').datagrid('getSelected');
|
||||
if (row){
|
||||
//以json格式返回数据
|
||||
jsonstr = '{"id":"'+row.id
|
||||
+'","name":"'+row.name
|
||||
+'","plandt":"'+row.plandt
|
||||
+'"}';
|
||||
var dataset = $.parseJSON(jsonstr);
|
||||
return dataset;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td>名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
1143
bin/WebRoot/jsp/plan/dailyPlanSummaryList.jsp
Normal file
1143
bin/WebRoot/jsp/plan/dailyPlanSummaryList.jsp
Normal file
File diff suppressed because it is too large
Load Diff
791
bin/WebRoot/jsp/plan/dailyPlanSummaryListBackup.jsp
Normal file
791
bin/WebRoot/jsp/plan/dailyPlanSummaryListBackup.jsp
Normal file
@ -0,0 +1,791 @@
|
||||
<%@ 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();
|
||||
%>
|
||||
<!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 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.dodistribute(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 doaudit = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'audit',
|
||||
width: 480,
|
||||
height:320,
|
||||
title : '审核日计划汇总信息',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/audit.do?id=${dailyplansummary.id }'+'&iframeId=${param.iframeId}'+'&iframeId=audit',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
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.dodistribute(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({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplan/getlist.do',
|
||||
queryParams: {
|
||||
pid: '${dailyplansummary.id }'
|
||||
},
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '250', title : '销售订单号', field : 'salesorderno', sortable : true, halign:'center',sortable:true},
|
||||
{width : '290', title : '产品名称', field : 'product', sortable : true, halign:'center',formatter : function(value,row){
|
||||
if(value!=null){
|
||||
return value.materialname;
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
},sortable:false},
|
||||
{width : '250', title : '订单产品数量', field : 'productnum', sortable : true, align:'center',sortable:false},
|
||||
{width : '250', title : '未排计划产品数', field : 'orderproductdetail', sortable : true, align:'center',formatter : function(value,row){
|
||||
if(value.length!=0){
|
||||
var unplanednum=0;
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].productionorderno==null || value[i].productionorderno==""){
|
||||
unplanednum++;
|
||||
}
|
||||
}
|
||||
return unplanednum;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
},sortable:false}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
//if(flag==0){
|
||||
//flag=1;
|
||||
//grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
//}else{
|
||||
//展开所有的行
|
||||
for(var i=0;i<data.rows.length;i++){
|
||||
$('#grid').datagrid('expandRow',i);
|
||||
}
|
||||
//}
|
||||
|
||||
},
|
||||
onExpandRow: function(index,row){
|
||||
var ddvt = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddvt.datagrid({
|
||||
url:ext.contextPath + '/plan/dailyplan/getlist_detail.do',
|
||||
queryParams: {
|
||||
salesOrderID: row.id,
|
||||
search_name: $('#search_name').textbox('getValue'),
|
||||
sdt: $("#sdt").val(),
|
||||
edt: $("#edt").val(),
|
||||
search_status: $('#search_status').combobox('getValue'),
|
||||
pid:ddvpid
|
||||
},
|
||||
fitColumns:true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
rownumbers:true,
|
||||
//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'){
|
||||
rowstyler+= ' background-color:#C0C0C0;color:#fff;';
|
||||
}else if(row.status=='6'){
|
||||
rowstyler+= ' font-style:ltalic;';
|
||||
}
|
||||
return rowstyler;
|
||||
},
|
||||
columns : [ [
|
||||
|
||||
{width : '100', title : '生产订单号', field : 'productionorderno', sortable : true, halign:'center' ,sortable:true},
|
||||
// {width : '100', title : '料号', field : 'bomid', sortable : true, halign:'center' },
|
||||
{width : '80', title : '计划生产数', field : 'productquantity', sortable : true, halign:'center' ,sortable:false},
|
||||
{width : '60', title : '完成数', field : 'finishedquantity', sortable : true, halign:'center' ,sortable:false},
|
||||
{width : '180', title : '工艺路线', field : 'processrealname', sortable : true, halign:'center' ,sortable:false},
|
||||
{width : '120', title : '计划下达日期', field : 'stdt', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},sortable:false },
|
||||
{width : '120', title : '计划完成日期', field : 'eddt', sortable : true, 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', sortable : true, align:'center', formatter : function(value, row){
|
||||
switch(value){
|
||||
case "0": return "计划编制";
|
||||
case "1": return "计划下发";
|
||||
case "2": return "计划执行";
|
||||
case "3": return "已作废";
|
||||
case "4": return "已重排";
|
||||
case "6": return "已完成";
|
||||
}
|
||||
} ,sortable:false},
|
||||
{title : '操作', field : 'action', width : '120', 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=='0'){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+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+'\');"/> ';
|
||||
}
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{width : '80', title : '提示', field : 'taskchangedstatus', sortable : true, 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}
|
||||
] ],
|
||||
onResize:function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},0);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#tt').tabs({
|
||||
onSelect: function(title){//点到tab才加载
|
||||
if(title=='作废计划'){
|
||||
invalidategrid = $('#invalidategrid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/getinvalidDPS.do?sdt=${wsdt}&edt=${wedt}',
|
||||
rownumbers : true,
|
||||
striped : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '150', title : '名称', field : 'name', align:'center'},
|
||||
{width : '100', title : '计划日期', field : 'plandt', halign:'center',align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '备注', field : 'remark', halign:'center',align:'left'},
|
||||
{width : '100', title : '作废人', field : '_modifiername', halign:'center',align:'center'},
|
||||
{width : '150', title : '作废日期', field : 'modifydt', halign:'center',align:'center'}
|
||||
] ]
|
||||
});
|
||||
}else if(title=='全部计划'){
|
||||
gridAll = $('#gridAll').datagrid({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplan/getlist.do',
|
||||
queryParams: {
|
||||
search_name:$('#search_nameAll').textbox('getValue'),
|
||||
sdt: $("#sdtAll").val(),
|
||||
edt: $("#edtAll").val(),
|
||||
search_status:$('#search_statusAll').combobox('getValue')
|
||||
},
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '250', title : '销售订单号', field : 'salesorderno', sortable : true, halign:'center',sortable:true},
|
||||
{width : '290', title : '产品名称', field : 'product', sortable : true, halign:'center',formatter : function(value,row){
|
||||
if(value!=null){
|
||||
return value.materialname;
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
},sortable:false},
|
||||
{width : '250', title : '订单产品数量', field : 'productnum', sortable : true, align:'center',sortable:false},
|
||||
{width : '250', title : '未排计划产品数', field : 'orderproductdetail', sortable : true, align:'center',formatter : function(value,row){
|
||||
if(value.length!=0){
|
||||
var unplanednum=0;
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].productionorderno==null || value[i].productionorderno==""){
|
||||
unplanednum++;
|
||||
}
|
||||
}
|
||||
return unplanednum;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
},sortable:false}
|
||||
] ],
|
||||
toolbar : '#toolbarAll',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
//if(flag==0){
|
||||
//flag=1;
|
||||
//grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
//}else{
|
||||
//展开所有的行
|
||||
for(var i=0;i<data.rows.length;i++){
|
||||
$('#gridAll').datagrid('expandRow',i);
|
||||
}
|
||||
//}
|
||||
|
||||
},
|
||||
onExpandRow: function(index,row){
|
||||
var ddvallT = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddvallT.datagrid({
|
||||
url:ext.contextPath + '/plan/dailyplan/getlist_detail.do',
|
||||
queryParams: {
|
||||
salesOrderID: row.id,
|
||||
search_name: $('#search_nameAll').textbox('getValue'),
|
||||
sdt: $("#sdtAll").val(),
|
||||
edt: $("#edtAll").val(),
|
||||
search_status: $('#search_statusAll').combobox('getValue')
|
||||
},
|
||||
fitColumns:true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
rownumbers:true,
|
||||
//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'){
|
||||
rowstyler+= ' background-color:#C0C0C0;color:#fff;';
|
||||
}else if(row.status=='6'){
|
||||
rowstyler+= ' font-style:ltalic;';
|
||||
}
|
||||
return rowstyler;
|
||||
},
|
||||
columns : [ [
|
||||
|
||||
{width : '100', title : '生产订单号', field : 'productionorderno', sortable : true, halign:'center' ,sortable:true},
|
||||
// {width : '100', title : '料号', field : 'bomid', sortable : true, halign:'center' },
|
||||
{width : '80', title : '计划生产数', field : 'productquantity', sortable : true, halign:'center' ,sortable:false},
|
||||
{width : '60', title : '完成数', field : 'finishedquantity', sortable : true, halign:'center' ,sortable:false},
|
||||
{width : '180', title : '工艺路线', field : 'processrealname', sortable : true, halign:'center' ,sortable:false},
|
||||
{width : '120', title : '计划下达日期', field : 'stdt', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
} ,sortable:false},
|
||||
{width : '120', title : '计划完成日期', field : 'eddt', sortable : true, 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', sortable : true, align:'center', formatter : function(value, row){
|
||||
switch(value){
|
||||
case "0": return "计划编制";
|
||||
case "1": return "计划下发";
|
||||
case "2": return "计划执行";
|
||||
case "3": return "已作废";
|
||||
case "4": return "已重排";
|
||||
case "6": return "已完成";
|
||||
}
|
||||
} ,sortable:false},
|
||||
{title : '操作', field : 'action', width : '120', 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=='0'){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+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+'\');"/> ';
|
||||
}
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{width : '80', title : '提示', field : 'taskchangedstatus', sortable : true, 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}
|
||||
] ],
|
||||
onResize:function(){
|
||||
$('#gridAll').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#gridAll').datagrid('fixDetailRowHeight',index);
|
||||
},0);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else if(title=='当前计划'){
|
||||
grid.datagrid('reload');//全部计划里面刷新grid会显示出错,这里再刷新一遍
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
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.$("#viewDialog").dialog('destroy');
|
||||
}else{
|
||||
top.$.messager.alert('提示','作废失败','info');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
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}');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body >
|
||||
<div id="tt" class="easyui-tabs" data-options="fit:true,border:false">
|
||||
<div title="当前计划" style="padding:0px;">
|
||||
<div id="cc" class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="tbar">
|
||||
<a href="javascript:void(0);" class="ext-icon-pencil_add" title="编辑" onclick="doedit();"></a>
|
||||
<a href="javascript:void(0);" class="ext-icon-status_away" title="审核" onclick="doaudit();"></a>
|
||||
<a href="javascript:void(0);" class="ext-icon-bin" title="作废" onclick="invalidateday();"></a>
|
||||
</div>
|
||||
<div data-options="region:'north',title:'日计划汇总信息',split:false,tools:'#tbar'" style="height:100px;">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>日计划汇总</th>
|
||||
<td>${dailyplansummary.name }</td>
|
||||
<th>状态</th>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${dailyplansummary.status == 0}">未审核</c:when>
|
||||
<c:when test="${dailyplansummary.status == 1}">已完成</c:when>
|
||||
<c:when test="${dailyplansummary.status == 3}">已审核</c:when>
|
||||
<c:otherwise></c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
<th>日计划汇总日期</th>
|
||||
<td>${fn:substring(dailyplansummary.plandt,0,10)}</td>
|
||||
<th>该天计划产品总数</th>
|
||||
<td>${totalnum}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>审核人</th>
|
||||
<td>${auditorname}</td>
|
||||
<th>审核日期</th>
|
||||
<td>${fn:substring(dailyplansummary.auditdate,0,19)}</td>
|
||||
<th>备注</th>
|
||||
<td>${dailyplansummary.remark}</td>
|
||||
<th ></th>
|
||||
<td></td>
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</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>
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/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,"plan/dailyplan/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<!-- <td><div class="datagrid-btn-separator"></div></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</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 name="search_name" id="search_name" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td >计划状态</td>
|
||||
<td colspan='4'><select id="search_status" name="search_status" class="easyui-combobox" style="width:152px;">
|
||||
<option value='all' select>全部</option>
|
||||
<option value='edit'>编制中</option>
|
||||
<option value='inprogress'>执行中</option>
|
||||
<option value='completed'>已完成</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>
|
||||
<div title="作废计划" data-options="iconCls:''" style="padding:0px;">
|
||||
<div class="easyui-panel" title="作废的日计划汇总" data-options="fit:true,border:false">
|
||||
<table id="invalidategrid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div title="全部计划" data-options="iconCls:''" style="padding:0px;">
|
||||
<div class="easyui-panel" title="全部日计划" data-options="fit:true,border:false">
|
||||
<div class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbarAll" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/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,"plan/dailyplan/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<!-- <td><div class="datagrid-btn-separator"></div></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</a></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchFormAll">
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td>生产订单号</td>
|
||||
<td><input name="search_nameAll" id="search_nameAll" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td >计划状态</td>
|
||||
<td colspan='4'><select id="search_statusAll" name="search_statusAll" class="easyui-combobox" style="width:152px;">
|
||||
<option value='all' select>全部</option>
|
||||
<option value='edit'>编制中</option>
|
||||
<option value='inprogress'>执行中</option>
|
||||
<option value='completed'>已完成</option>
|
||||
</select>
|
||||
</td>
|
||||
<!-- </tr> -->
|
||||
<!-- <tr> -->
|
||||
<td>计划下达日期</td>
|
||||
<td><input id="sdtAll" name="sdtAll" class="Wdate"
|
||||
value=""
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'edtAll\')}'})"
|
||||
readonly></td>
|
||||
<td>到</td>
|
||||
<td><input id="edtAll" name="edtAll" class="Wdate"
|
||||
value=""
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'sdtAll\')}'})"
|
||||
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="gridAll.datagrid('load',ext.serializeObject($('#searchFormAll')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton"
|
||||
data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchFormAll').form('clear');gridAll.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="gridAll" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
876
bin/WebRoot/jsp/plan/dailyPlanSummaryListOperate.jsp
Normal file
876
bin/WebRoot/jsp/plan/dailyPlanSummaryListOperate.jsp
Normal file
@ -0,0 +1,876 @@
|
||||
<%@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>
|
||||
|
||||
172
bin/WebRoot/jsp/plan/dailyPlanSummaryMaterialAdd.jsp
Normal file
172
bin/WebRoot/jsp/plan/dailyPlanSummaryMaterialAdd.jsp
Normal file
@ -0,0 +1,172 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
var rowsdata=$('#grid').datagrid('getRows');
|
||||
if (rowsdata.length>0) {
|
||||
var dailyplansummaryid='${param.id}';
|
||||
var materialid="";
|
||||
var workstationid="";
|
||||
var amount="";
|
||||
var remark="";//暂时没做输入,后续完善
|
||||
$.each(rowsdata, function(index, item){
|
||||
if(item.materialid==null || item.materialid==""){
|
||||
materialid+="0,";
|
||||
}else{
|
||||
materialid+=item.materialid+",";
|
||||
}
|
||||
if(item.workstationid==null || item.workstationid==""){
|
||||
workstationid+="0,";
|
||||
}else{
|
||||
workstationid+=item.workstationid+",";
|
||||
}
|
||||
|
||||
var editorR = $('#grid').datagrid('getEditor', {index:index,field:"remark"});
|
||||
if(editorR!=null&&editorR!=undefined){
|
||||
var editRemark = editorR.target.val();
|
||||
remark+=editRemark+",";
|
||||
}else{
|
||||
remark+=" ,";
|
||||
}
|
||||
|
||||
if(item.amount==null || item.amount==""){
|
||||
amount+="0,";
|
||||
}else{
|
||||
var editor = $('#grid').datagrid('getEditor', {index:index,field:"amount"});
|
||||
if(editor!=null&&editor!=undefined){
|
||||
var editAmount = editor.target.val();
|
||||
amount+=editAmount+",";
|
||||
}else{
|
||||
amount+=item.amount+",";
|
||||
}
|
||||
}
|
||||
});
|
||||
$.post(ext.contextPath + "/plan/dailyplansummarymaterial/save.do", {dailyplansummaryid:dailyplansummaryid,materialid:materialid,workstationid:workstationid,amount:amount,remark:remark}, function(data) {
|
||||
top.$.messager.alert("提示", data.res, "info", function() {
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
|
||||
},'json');
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
$(function(){
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/materialplan/getmaterialplan.do',
|
||||
queryParams: {
|
||||
planid:'${param.id}'
|
||||
},
|
||||
rownumbers : true,
|
||||
striped : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '100', title : '工位编号', field: 'workstationserial', sortable : true, align:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '150', title : '工位名称', field: 'workstationname', sortable : true, align:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '150', title : '物料编码', field : 'materialcode', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '260', title : '物料名称', field : 'materialname', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '90', title : '总计划量', field : 'amount', halign:'center' ,editor:{type:'numberbox',options:{precision:1 }}},
|
||||
{width : '90', title : '单位', field: 'unit', sortable : true, align:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}}
|
||||
] ],
|
||||
onClickCell: function (rowIndex, field, value) {
|
||||
beginEditing(rowIndex, field, value);
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
var editIndex = undefined;
|
||||
var beginEditing = function (rowIndex, field, value) {
|
||||
if (field!= "amount" ){
|
||||
if(editIndex!=undefined)
|
||||
{
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (rowIndex != editIndex) {
|
||||
if (endEditing()) {
|
||||
$('#grid').datagrid('beginEdit', rowIndex);
|
||||
editIndex = rowIndex;
|
||||
|
||||
var ed = $('#grid').datagrid('getEditor', { index: rowIndex, field: 'amount' });
|
||||
$(ed.target).focus().bind('blur', function () {
|
||||
endEditing();
|
||||
});
|
||||
} else {
|
||||
$('#grid').datagrid('selectRow', editIndex);
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
}
|
||||
};
|
||||
var endEditing = function () {
|
||||
if (editIndex == undefined){
|
||||
return true;
|
||||
}
|
||||
if ($('#grid').datagrid('validateRow', editIndex)) {
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'amount' });
|
||||
var number = $(ed.target).numberbox('getValue');
|
||||
$('#grid').datagrid('getRows')[editIndex]['amount'] = number;
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="cc" class="easyui-layout" style="width:800px;height:600px;" data-options="fit:true,border:false">
|
||||
<div data-options="region:'center',title:'MRP自动计算结果【日计划单: ${param.name }】'" style="padding:0px;">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<div data-options="region:'east',iconCls:'icon-reload',title:'呆滞物料',split:true" style="width:30%" >呆滞物料</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
882
bin/WebRoot/jsp/plan/dailyPlanSummaryOrderList.jsp
Normal file
882
bin/WebRoot/jsp/plan/dailyPlanSummaryOrderList.jsp
Normal file
@ -0,0 +1,882 @@
|
||||
<%@page import="com.sun.rowset.internal.Row"%>
|
||||
<%@page import="com.sipai.entity.plan.DailyPlanSummary"%>
|
||||
<%@ 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",DailyPlanSummary.Flag_Edit);%>
|
||||
<%request.setAttribute("Flag_Submit",DailyPlanSummary.Flag_Submit);%>
|
||||
<%request.setAttribute("Flag_Check",DailyPlanSummary.Flag_Check);%>
|
||||
<%request.setAttribute("Flag_Issue",DailyPlanSummary.Flag_Issue);%>
|
||||
<%request.setAttribute("Flag_Finish",DailyPlanSummary.Flag_Finish);%>
|
||||
|
||||
|
||||
|
||||
<%request.setAttribute("Flag_Edit_D",com.sipai.entity.plan.DailyPlan.Flag_Edit);%>
|
||||
<%request.setAttribute("Flag_Check_D",com.sipai.entity.plan.DailyPlan.Flag_Check);%>
|
||||
<%request.setAttribute("Flag_Finish_D",com.sipai.entity.plan.DailyPlan.Flag_Finish);%>
|
||||
<%request.setAttribute("Flag_Issue_D",com.sipai.entity.plan.DailyPlan.Flag_Issue);%>
|
||||
<%request.setAttribute("Flag_ReEdit_D",com.sipai.entity.plan.DailyPlan.Flag_ReEdit);%>
|
||||
<%request.setAttribute("Flag_Submit_D",com.sipai.entity.plan.DailyPlan.Flag_Submit);%>
|
||||
<%request.setAttribute("Flag_Delete_D",com.sipai.entity.plan.DailyPlan.Flag_Delete);%>
|
||||
|
||||
<%request.setAttribute("Flag_Suspend_D",com.sipai.entity.plan.DailyPlan.Flag_Suspend);%>
|
||||
<%request.setAttribute("Flag_Active_D",com.sipai.entity.plan.DailyPlan.Flag_Active);%>
|
||||
<!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(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
width: 480,
|
||||
height:320,
|
||||
title : '编辑日计划信息',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/edit.do?id='+id+'&iframeId=${param.iframeId}',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var doinsert = function(id) {
|
||||
$.post(ext.contextPath + '/plan/dailyplansummary/insertadd.do', {id : id}, function(data) {
|
||||
if(data.res=='1'){
|
||||
grid.datagrid('reload');
|
||||
doLook('${param.date}','${wsdt}','${wsdt}',data.id);
|
||||
top.$.messager.confirm('提示', '您需要将旧计划单未完成(已下发)计划插入到本计划单里吗?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/dailyplan/autoaddoldplan.do', {id : id,newid:data.id}, function(data) {
|
||||
if(data.res==1){
|
||||
top.$.messager.alert('提示','插单成功,计划插入成功','info');
|
||||
parent.$('#viewp1')[0].contentWindow.$('#grid').datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','插单成功,计划插入失败','info');
|
||||
}
|
||||
},'json');
|
||||
}else{
|
||||
top.$.messager.alert('提示','插单成功','info');
|
||||
}
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','插单失败','info');
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
var doaudit = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'audit',
|
||||
width: 480,
|
||||
height:320,
|
||||
title : '审核日计划信息',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/audit.do?id=${dailyplansummary.id }'+'&iframeId=${param.iframeId}'+'&iframeId=audit',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
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 deleteorder = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此计划单?计划单删除后计划、工单将自动作废。', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/dailyplansummary/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
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/dailyplansummary/getlist.do',
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
striped : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '180', title : '日计划单号', field : 'name', halign:'center',align:'left'},
|
||||
{width : '180', title : '日计划日期', field : 'plandt', halign:'center',align:'left',formatter : function(value, row){
|
||||
return value.substring(0,10);
|
||||
}},
|
||||
{width : '180', title : '状态', field : 'status', halign:'center',align:'left',formatter : function(value, row){
|
||||
switch(value){
|
||||
case '${Flag_Edit}': return "待提交";
|
||||
case '${Flag_Submit}': return "待审核";
|
||||
case '${Flag_Check}': return "待下发";
|
||||
case '${Flag_Issue}': return "已下发";
|
||||
case '${Flag_Finish}': return "<font color='blue'>已完成</font>";
|
||||
default: return '';
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '备注', field : 'remark', halign:'center',align:'left'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewPlanFun(\''+row.plandt+'\',\''+row.plandt+'\',\''+row.plandt.substring(0,10)+" 23:59:59"+'\',\''+row.id+'\');"/> ';
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="doedit(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/delete.do") ) {%>
|
||||
if(row.status=="${Flag_Edit}"){
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteorder(\''+row.id+'\');"/> ';
|
||||
}
|
||||
<%}%>
|
||||
if(row.status=="4"){
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/add.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-arrow_left" title="插单" onclick="doinsert(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onDblClickRow:function(index,row){
|
||||
var eddt =row.plandt.substring(0,10)+" 23:59:59";
|
||||
viewPlanFun(row.plandt,row.plandt,eddt,row.id);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
$('#tt').tabs({
|
||||
onSelect: function(title){//点到tab才加载
|
||||
if(title=='已作废计划单'){
|
||||
invalidategrid = $('#invalidategrid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/getinvalidDPS.do?sdt=${wsdt}&edt=${wedt}',
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
striped : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '150', title : '单号', field : 'name', align:'center'},
|
||||
{width : '100', title : '计划日期', field : 'plandt', halign:'center',align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '备注', field : 'remark', halign:'center',align:'left'},
|
||||
{width : '100', title : '作废人', field : '_modifiername', halign:'center',align:'center'},
|
||||
{width : '150', title : '作废日期', field : 'modifydt', halign:'center',align:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbarinvalid'
|
||||
});
|
||||
}else if(title=='全部计划'){
|
||||
gridAll = $('#gridAll').datagrid({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplan/getdailyplans.do',
|
||||
queryParams: {
|
||||
search_name:$('#search_nameAll').textbox('getValue'),
|
||||
sdt: $("#sdtAll").val(),
|
||||
edt: $("#edtAll").val(),
|
||||
search_status:$('#search_statusAll').combobox('getValue')
|
||||
},
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '250', title : '销售订单号', field : 'salesorderno', sortable : true, halign:'center'},
|
||||
{width : '290', title : '产品名称', field : 'product', halign:'center',formatter : function(value,row){
|
||||
if(value!=null){
|
||||
return value.materialname;
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
},sortable:false},
|
||||
{width : '250', title : '订单产品数量', field : 'productnum',align:'center',sortable:false},
|
||||
{width : '250', title : '未排计划产品数', field : 'orderproductdetail',align:'center',formatter : function(value,row){
|
||||
if(value.length!=0){
|
||||
var unplanednum=0;
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].productionorderno==null || value[i].productionorderno==""){
|
||||
unplanednum++;
|
||||
}
|
||||
}
|
||||
return unplanednum;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
},sortable:false}
|
||||
] ],
|
||||
toolbar : '#toolbarAll',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
//if(flag==0){
|
||||
//flag=1;
|
||||
//grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
//}else{
|
||||
//展开所有的行
|
||||
for(var i=0;i<data.rows.length;i++){
|
||||
$('#gridAll').datagrid('expandRow',i);
|
||||
}
|
||||
//}
|
||||
|
||||
},
|
||||
onExpandRow: function(index,row){
|
||||
var ddvallT = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddvallT.datagrid({
|
||||
url:ext.contextPath + '/plan/dailyplan/getlist_detail.do',
|
||||
queryParams: {
|
||||
salesOrderID: row.id,
|
||||
search_name: $('#search_nameAll').textbox('getValue'),
|
||||
sdt: $("#sdtAll").val(),
|
||||
edt: $("#edtAll").val(),
|
||||
search_status: $('#search_statusAll').combobox('getValue')
|
||||
},
|
||||
fitColumns:true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
rownumbers:true,
|
||||
//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 : [ [
|
||||
|
||||
{width : '100', title : '生产订单号', field : 'productionorderno', halign:'center' ,sortable:true},
|
||||
// {width : '100', title : '料号', field : 'bomid', sortable : true, halign:'center' },
|
||||
{width : '80', title : '计划生产数', field : 'productquantity', halign:'center' ,sortable:false},
|
||||
{width : '60', title : '完成数', field : 'finishedquantity', halign:'center' ,sortable:false},
|
||||
{width : '180', title : '工艺路线', field : 'processrealname',halign:'center' ,sortable:false},
|
||||
{width : '120', title : '计划下达日期', field : 'stdt', align:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
} ,sortable:false},
|
||||
{width : '120', title : '计划完成日期', field : 'eddt',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){
|
||||
switch(value){
|
||||
case "0": return "待提交";
|
||||
case "1": return "待审核";
|
||||
case "5": return "待下发";
|
||||
case "2": return "已下发";
|
||||
case "3": return "已作废";
|
||||
case "4": return "已重排";
|
||||
case "6": return "<font color='blue'>已完成</font>";
|
||||
}
|
||||
} ,sortable:false},
|
||||
{title : '操作', field : 'action', width : '120', 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=='0'){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+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+'\');"/> ';
|
||||
}
|
||||
<%}%>
|
||||
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}
|
||||
] ],
|
||||
onResize:function(){
|
||||
$('#gridAll').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#gridAll').datagrid('fixDetailRowHeight',index);
|
||||
},0);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else if(title=='当前计划'){
|
||||
grid.datagrid('reload');//全部计划里面刷新grid会显示出错,这里再刷新一遍
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
var viewPlanFun=function(date,sdt,edt,id){
|
||||
var nowdate = new Date();
|
||||
var thisdate=new Date(date);
|
||||
var olddayflag=0;
|
||||
if(thisdate<nowdate &&thisdate.getDate()!=nowdate.getDate()){
|
||||
olddayflag=1;
|
||||
}
|
||||
switch('${param.pageflag}'){//页面选择
|
||||
case 'operate':var dialog = parent.ext.modalDialog({
|
||||
id:'viewplan3',
|
||||
iframeId:'viewp3',
|
||||
title : '查看计划',
|
||||
height:"85%",
|
||||
width:"85%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlist.do?&sdt='+sdt+'&edt='+edt+'&iframeId=viewp3&olddayflag='+olddayflag+'&id='+id
|
||||
|
||||
});break;
|
||||
case 'materialplan':var dialog = parent.ext.modalDialog({
|
||||
id:'viewplan2',
|
||||
iframeId:'viewp2',
|
||||
title : '查看物料计划',
|
||||
height:"85%",
|
||||
width:"85%",
|
||||
url : ext.contextPath + '/plan/materialplan/showplan.do?&planid='+id
|
||||
|
||||
});break;
|
||||
default:var dialog = parent.ext.modalDialog({
|
||||
id:'viewplan1',
|
||||
iframeId:'viewp1',
|
||||
title : '查看计划',
|
||||
height:"85%",
|
||||
width:"85%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlist.do?&sdt='+sdt+'&edt='+edt+'&iframeId=viewp1&olddayflag='+olddayflag+'&id='+id
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
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.$("#viewDialog").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=='1'){
|
||||
top.$.messager.alert('提示','下发成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else if(data.res=='0'){
|
||||
top.$.messager.alert('提示','无可下发计划','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示',data.res,'info');
|
||||
}
|
||||
},'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');
|
||||
grid.datagrid('reload');
|
||||
}else if(data.res=='0'){
|
||||
top.$.messager.alert('提示','无可提交计划','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示','提交失败','info');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
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');
|
||||
grid.datagrid('load',{sdt:'${wsdt}',edt:'${wedt}'});
|
||||
$('#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(){//物料计划进入,隐藏全部计划
|
||||
if('${param.pageflag}'=='materialplan'){
|
||||
$('#tt').tabs('close', 2);
|
||||
}
|
||||
});
|
||||
var dpsaddFun = function(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '新增日计划单信息',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/add.do',
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
});
|
||||
};
|
||||
var doLook = function(date,sdt,edt,id){
|
||||
var nowdate = new Date();
|
||||
var thisdate=new Date(date);
|
||||
var olddayflag=0;
|
||||
if(thisdate<nowdate &&thisdate.getDate()!=nowdate.getDate()){
|
||||
olddayflag=1;
|
||||
}
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewplan11',
|
||||
iframeId:'viewp1',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlist.do?sdt='+sdt+'&edt='+edt+'&iframeId=view&olddayflag='+olddayflag+'&id='+id
|
||||
|
||||
});
|
||||
};
|
||||
$(function(){
|
||||
$('#tt').tabs({tabPosition:"bottom"});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body >
|
||||
<div id="tt" class="easyui-tabs" data-options="fit:true,border:false">
|
||||
<div title="计划单" style="padding:0px;">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<c:if test="${param.olddayflag!=1 }">
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/add.do")) {%>
|
||||
<td>
|
||||
<!-- <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="dpsaddFun();">添加</a> -->
|
||||
<span>(注:每天只允许一个日计划单)</span>
|
||||
</td>
|
||||
<%}%>
|
||||
</c:if>
|
||||
<!-- <%if (sessionManager.havePermission(session,"plan/dailyplan/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">
|
||||
<input id="pid" name="pid" type="hidden" value="${dailyplansummary.id }" />
|
||||
<table>
|
||||
<tr>
|
||||
<td>日计划单号</td>
|
||||
<td><input name="search_name" id="search_name" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td >状态</td>
|
||||
<td colspan='4'><select id="search_status" name="search_status" class="easyui-combobox" style="width:152px;">
|
||||
<option value='all' select>全部</option>
|
||||
<option value='Flag_Edit'>待提交</option>
|
||||
<option value='Flag_Submit'>待审核</option>
|
||||
<option value='Flag_Check'>已审核</option>
|
||||
<option value='Flag_Issue'>已下发</option>
|
||||
<option value='Flag_ReEdit'>重排</option>
|
||||
<option value='Flag_Delete'>已删除</option>
|
||||
<option value='Flag_Finish'>已完成</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="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 id="cc" class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div title="已作废计划单" data-options="iconCls:''" style="padding:0px;">
|
||||
<div id="toolbarinvalid" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchFormiv">
|
||||
<table>
|
||||
<tr>
|
||||
<td>日计划单号</td>
|
||||
<td><input name="search_nameiv" id="search_nameiv" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton"
|
||||
data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="invalidategrid.datagrid('load',ext.serializeObject($('#searchFormiv')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton"
|
||||
data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchFormiv').form('clear');invalidategrid.datagrid('load',{sdt:'${wsdt}',edt:'${wedt}'});">重置</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="easyui-panel" title="" data-options="fit:true,border:false">
|
||||
<table id="invalidategrid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div title="全部计划" data-options="iconCls:''" style="padding:0px;">
|
||||
<div class="easyui-panel" title="" data-options="fit:true,border:false">
|
||||
<div class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbarAll" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/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,"plan/dailyplan/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<!-- <td><div class="datagrid-btn-separator"></div></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</a></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchFormAll">
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td>生产订单号</td>
|
||||
<td><input name="search_nameAll" id="search_nameAll" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td >计划状态</td>
|
||||
<td colspan='4'><select id="search_statusAll" name="search_statusAll" class="easyui-combobox" style="width:152px;">
|
||||
<option value='all' select>全部</option>
|
||||
<option value='edit'>待提交</option>
|
||||
<option value='submit'>待审核</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="sdtAll" name="sdtAll" class="Wdate"
|
||||
value=""
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'edtAll\')}'})"
|
||||
readonly></td>
|
||||
<td>到</td>
|
||||
<td><input id="edtAll" name="edtAll" class="Wdate"
|
||||
value=""
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'sdtAll\')}'})"
|
||||
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="gridAll.datagrid('load',ext.serializeObject($('#searchFormAll')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton"
|
||||
data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchFormAll').form('clear');gridAll.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="gridAll" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
170
bin/WebRoot/jsp/plan/dailyPlanView.jsp
Normal file
170
bin/WebRoot/jsp/plan/dailyPlanView.jsp
Normal file
@ -0,0 +1,170 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/workflow/getAllPDNode.do?processDefinitionId=${dailyplan.processrealid}&order=desc' ,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '100', title : '工序名称', field : 'name', halign:'center'},
|
||||
{width : '100', title : '工序Id', field : 'id', halign:'center'},
|
||||
{width : '100', title : '工艺名称', field : 'pd_name', halign:'center'},
|
||||
{width : '60', title : '计划良率', field : 'yield', align:'center'},
|
||||
{width : '60', title : '计划数', field : 'status', align:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
|
||||
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(grid.datagrid('getSelected')==null){
|
||||
grid.datagrid('selectRow',0);
|
||||
}
|
||||
showProcedureDistrictStatus();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
var showProcedureDistrictStatus= function(){
|
||||
//alert()
|
||||
|
||||
$.post(ext.contextPath + '/plan/dailyplansummary/getTaskDemands.do', {planid:'${dailyplan.id}'} , function(data) {
|
||||
//console.info(data)
|
||||
//if(data.length>0){
|
||||
//alert("222");
|
||||
var griddata=$("#grid").datagrid("getData").rows;
|
||||
|
||||
for(var i=0;i<griddata.length;i++){
|
||||
//console.info(griddata);
|
||||
var taskcode=griddata[i].id;
|
||||
//alert(taskcode)
|
||||
$("#grid").datagrid("getRows")[i]['status']="";
|
||||
$('#grid').datagrid('refreshRow', i);
|
||||
for(var j=0;j<data.length;j++){
|
||||
if(taskcode==data[j].taskcode){
|
||||
|
||||
$("#grid").datagrid("getRows")[i]['status']=data[j].preamount;
|
||||
$('#grid').datagrid('refreshRow', i);
|
||||
var rowIndex=$('#grid').datagrid('getRowIndex',$('#grid').datagrid('getSelected'));
|
||||
$('#grid').datagrid("selectRow",rowIndex)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//}
|
||||
},'json');
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" id="id" name="id" value="${dailyplan.id}"/>
|
||||
<input type="hidden" id="status" name="status" value="${dailyplan.status}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>任务单编号</th>
|
||||
<td>${dailyplan.taskorder.tasklistcode}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品编码</th>
|
||||
<td>${dailyplan.taskorder.productno}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品数量</th>
|
||||
<td>${dailyplan.taskorder.prodamount}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>销售单号</th>
|
||||
<td>${dailyplan.taskorder.salesno}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>开始日期</th>
|
||||
<td>${fn:substring(dailyplan.taskorder.pstdate,0,10)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>结束日期</th>
|
||||
<td>${fn:substring(dailyplan.taskorder.pendate,0,10)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据状态</th>
|
||||
<td>${dailyplan.taskorder.billstatus}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据下达日期</th>
|
||||
<td>${fn:substring(dailyplan.taskorder.billruntime,0,10)}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<br />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>计划日期</th>
|
||||
<td>${fn:substring(dailyplan.stdt,0,10)}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品工艺路线</th>
|
||||
<td>${dailyplan.processrealid }</td>
|
||||
</tr>
|
||||
<%-- <tr>
|
||||
<th>产线</th>
|
||||
<td>${dailyplan.lineid}</td>
|
||||
</tr> --%>
|
||||
<tr>
|
||||
<th>产品BOM</th>
|
||||
<td>${dailyplan.materialBOM.materialname}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划下达日期</th>
|
||||
<td>${dailyplan.stdt}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划完成日期</th>
|
||||
<td>${dailyplan.eddt}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>${dailyplan.remark}</td>
|
||||
</tr>
|
||||
<!-- <tr> -->
|
||||
<!-- <th>计划状态</th> -->
|
||||
<!-- <td><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'"> -->
|
||||
<!-- <option value="0" selected>计划编制</option> -->
|
||||
<!-- <option value="1">计划下发</option> -->
|
||||
<!-- </select> -->
|
||||
<!-- </td> -->
|
||||
<!-- </tr> -->
|
||||
|
||||
</table>
|
||||
</br>
|
||||
<div id="tool" title ="任务量" class="easyui-panel" style="height:100%;width:98%;" data-options="border:true" >
|
||||
<table id="grid" data-options="border:false,fit:true" ></table>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
103
bin/WebRoot/jsp/plan/deliverDetail.jsp
Normal file
103
bin/WebRoot/jsp/plan/deliverDetail.jsp
Normal file
@ -0,0 +1,103 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
var id = $("#id").val();
|
||||
var deliveramount = Number($("#deliveramount").val());
|
||||
var boxnumber = Number($("#boxnumber").val());
|
||||
var boxname = $("#boxname").val();
|
||||
var planamount = '${deliverDetail.planamount}';
|
||||
if(planamount>=deliveramount){
|
||||
$.post(ext.contextPath + "/plan/deliverdetail/deliverupdate.do", {id:id,deliveramount:deliveramount,boxnumber:boxnumber,boxname:boxname}, function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}else{
|
||||
top.$.messager.alert('提示', "配送量需已超过计划量,请核实数据!",'info');
|
||||
$('#deliveramount').next('span').find('input').focus();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function selectMaterialBox(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择料盒',
|
||||
width : 600,
|
||||
height : 400,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/material/materialbox/selectMaterialBox.do?querytype=select',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#boxnumber").textbox('setValue',(res.boxnumber == 'undefined')?'':res.boxnumber);
|
||||
$("#boxname").html((res.boxname == 'undefined')?'':res.boxname);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#boxnumber").textbox("textbox").bind("click",function(){
|
||||
selectMaterialBox();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${deliverDetail.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<td>${deliverDetail.materialInfo.materialname }</td>
|
||||
<th>物料编码</th>
|
||||
<td>${deliverDetail.materialInfo.materialcode }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划配送量</th>
|
||||
<td>${deliverDetail.planamount}${deliverDetail.materialInfo.unit }</td>
|
||||
<th>配送量</th>
|
||||
<td>
|
||||
<input id="deliveramount" name="deliveramount" class="easyui-textbox" value="${deliverDetail.deliveramount}" autofocus/>
|
||||
${deliverDetail.materialInfo.unit }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>料盒编号</th>
|
||||
<td><input id="boxnumber" name="boxnumber" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="${deliverDetail.boxnumber }" /></td>
|
||||
<th>料盒名称</th>
|
||||
<td><span id="boxname">${deliverDetail.boxname }</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td colspan="3">
|
||||
<input id="remark" name="remark" class="easyui-textbox" value="${deliverDetail.remark }"
|
||||
data-options="multiline:true" style="width:100%;height:100px"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
124
bin/WebRoot/jsp/plan/deliverDetailAdd.jsp
Normal file
124
bin/WebRoot/jsp/plan/deliverDetailAdd.jsp
Normal file
@ -0,0 +1,124 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
var undeliveramount = Number($("#undeliveramount").val());
|
||||
var planamount = Number($("#planamount").val());
|
||||
if(planamount>undeliveramount){
|
||||
top.$.messager.alert('提示', "计划配送量已超过当日可未分配量,请修改数据!",'info');
|
||||
$('#planamount').focus();
|
||||
}else if(planamount<=0){
|
||||
top.$.messager.alert('提示', "计划配送量需大于0!",'info');
|
||||
$('#planamount').next('span').find('input').focus();
|
||||
}else{
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/deliverdetail/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function selectMaterial(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择材料',
|
||||
width : 600,
|
||||
height : 400,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/materialplan/materialPlanForSelect.do?pid=${pid}&planid=${planid}&workstationid=${workstationid}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#materialid").val((res.materialid == 'undefined')?'':res.materialid);
|
||||
$("#materialcode").textbox('setValue',(res.materialcode == 'undefined')?'':res.materialcode);
|
||||
$("#materialname").html((res.materialname == 'undefined')?'':res.materialname);
|
||||
$("#materialunit").html((res.materialunit == 'undefined')?'':res.materialunit);
|
||||
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url: ext.contextPath + '/plan/deliverdetail/getPlanedAmount.do?planid=${planid}&materialid='+$("#materialid").val()+'&random='+Math.random(),
|
||||
data:'',
|
||||
success: function (data) {
|
||||
if(data!=null){
|
||||
var obj = $.parseJSON(data);
|
||||
var planamount = obj.deliverDetail[0].planamount;
|
||||
var undeliveramount = (res.materialamount == 'undefined')?(0-planamount):(res.materialamount-planamount);
|
||||
$("#undeliveramount").val(undeliveramount);
|
||||
$("#undeliverInfo").html("尚未分配物料数量:"+undeliveramount+$("#materialunit").val());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#materialcode").textbox("textbox").bind("click",function(){
|
||||
selectMaterial();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="pid" name="pid" type="hidden" value="${pid }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>物料编码</th>
|
||||
<td>
|
||||
<input id="materialid" name="materialid" type="hidden" value=""/>
|
||||
<input id="materialcode" name="materialcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<td><span id="materialname"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划配送量</th>
|
||||
<td>
|
||||
<input id="planamount" name="planamount" class="easyui-numberbox"
|
||||
min="0.01" max="10000" precision="2" required="true" missingMessage="必须填写数字"
|
||||
data-options="required:true,validType:'isBlank'" value="" autofocus/>
|
||||
<input id="undeliveramount" name="undeliveramount" type="hidden" value="" />
|
||||
<span id="materialunit"></span>
|
||||
<span id="undeliverInfo" style="float:none"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td >
|
||||
<input name="remark" class="easyui-textbox" style="width:100%;height:100px"
|
||||
value=""data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
125
bin/WebRoot/jsp/plan/deliverDetailEdit.jsp
Normal file
125
bin/WebRoot/jsp/plan/deliverDetailEdit.jsp
Normal file
@ -0,0 +1,125 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
var undeliveramount = Number($("#undeliveramount").val());
|
||||
var planamount = Number($("#planamount").val());
|
||||
if(planamount>undeliveramount){
|
||||
top.$.messager.alert('提示', "计划配送量已超过当日可分配量,请修改数据!",'info');
|
||||
$('#planamount').next('span').find('input').focus();
|
||||
}else if(planamount<=0){
|
||||
top.$.messager.alert('提示', "计划配送量需大于0!",'info');
|
||||
$('#planamount').next('span').find('input').focus();
|
||||
}else{
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/deliverdetail/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function selectMaterial(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择材料',
|
||||
width : 600,
|
||||
height : 400,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/materialplan/materialPlanForSelect.do?pid=${pid}&planid=${planid}&workstationid=${workstationid}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#materialid").val((res.materialid == 'undefined')?'':res.materialid);
|
||||
$("#materialcode").textbox('setValue',(res.materialcode == 'undefined')?'':res.materialcode);
|
||||
$("#materialname").html((res.materialname == 'undefined')?'':res.materialname);
|
||||
$("#materialunit").html((res.materialunit == 'undefined')?'':res.materialunit);
|
||||
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url: ext.contextPath + '/plan/deliverdetail/getPlanedAmount.do?planid=${planid}&materialid='+$("#materialid").val()+'&random='+Math.random(),
|
||||
data:'',
|
||||
success: function (data) {
|
||||
if(data!=null){
|
||||
var obj = $.parseJSON(data);
|
||||
var planamount = obj.deliverDetail[0].planamount;
|
||||
|
||||
var undeliveramount = (res.materialamount == 'undefined')?(0-planamount):(res.materialamount-planamount);
|
||||
$("#undeliveramount").val(undeliveramount);
|
||||
$("#undeliverInfo").html("尚未分配物料数量:"+undeliveramount+$("#materialunit").val());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#materialcode").textbox("textbox").bind("click",function(){
|
||||
selectMaterial();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${deliverDetail.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>物料编码</th>
|
||||
<td>
|
||||
<input id="materialid" name="materialid" type="hidden" value="${deliverDetail.materialInfo.id }"/>
|
||||
<input id="materialcode" name="materialcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="${deliverDetail.materialInfo.materialcode }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<td><span id="materialname">${deliverDetail.materialInfo.materialname }</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划配送量</th>
|
||||
<td>
|
||||
<input id="planamount" name="planamount" class="easyui-numberbox"
|
||||
min="0.01" max="10000" precision="2" required="true" missingMessage="必须填写0.01~10000之间的数字"
|
||||
value="${deliverDetail.planamount}" autofocus/>
|
||||
<input id="undeliveramount" name="undeliveramount" type="hidden" value="${undeliveramount+deliverDetail.planamount }" />
|
||||
<span id="materialunit">${deliverDetail.materialInfo.unit }</span>
|
||||
<span id="undeliverInfo" style="float:none">${undeliverInfo }</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td >
|
||||
<input id="remark" name="remark" class="easyui-textbox" value="${deliverDetail.remark }" validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
data-options="multiline:true" style="width:100%;height:100px"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
194
bin/WebRoot/jsp/plan/deliverDetailList.jsp
Normal file
194
bin/WebRoot/jsp/plan/deliverDetailList.jsp
Normal file
@ -0,0 +1,194 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '添加配料详情',
|
||||
width:800,
|
||||
height:400,
|
||||
url : ext.contextPath + '/plan/deliverdetail/add.do?pid=${pid}&planid=${planid}&workstationid=${workstationid}',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '编辑配料详情',
|
||||
width:800,
|
||||
height:400,
|
||||
url : ext.contextPath + '/plan/deliverdetail/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/deliverdetail/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.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{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/deliverdetail/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/deliverdetail/getDeliverDetails.do?pid='+'${pid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '物料名称', field : 'materialname', align:'center', formatter : function(value, row){
|
||||
if(row.materialInfo!=null){
|
||||
return row.materialInfo.materialname;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '物料编码', field : 'materialcode', align:'center', formatter : function(value, row){
|
||||
if(row.materialInfo!=null){
|
||||
return row.materialInfo.materialcode;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '计划配送量', field : 'planamount', align:'center', formatter : function(value, row){
|
||||
if(value>0){
|
||||
return value+row.materialInfo.unit;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"plan/materialdeliver/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/materialdeliver/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
</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,"plan/materialdeliver/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,"plan/materialdeliver/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<td style='padding-left:20px;'>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable" >
|
||||
<tr>
|
||||
<td>物料名称</td>
|
||||
<td><input name="search_materialname" class="easyui-textbox" /></td>
|
||||
<td>物料编码</td>
|
||||
<td><input name="search_materialcode" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input name="idStr" type="hidden" />
|
||||
</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>
|
||||
100
bin/WebRoot/jsp/plan/deliverDetailViewList.jsp
Normal file
100
bin/WebRoot/jsp/plan/deliverDetailViewList.jsp
Normal file
@ -0,0 +1,100 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/deliverdetail/getDeliverDetails.do?pid='+'${pid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '350', title : '物料名称', field : 'materialname', halign:'center', formatter : function(value, row){
|
||||
if(row.materialInfo!=null){
|
||||
return row.materialInfo.materialname;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '200', title : '物料编码', field : 'materialcode', halign:'center', formatter : function(value, row){
|
||||
if(row.materialInfo!=null){
|
||||
return row.materialInfo.materialcode;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '160', title : '计划配送量', field : 'planamount', halign:'center', formatter : function(value, row){
|
||||
if(value>0){
|
||||
return value+row.materialInfo.unit;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable" >
|
||||
<tr>
|
||||
<td>物料名称</td>
|
||||
<td><input name="search_materialname" class="easyui-textbox" /></td>
|
||||
<td>物料编码</td>
|
||||
<td><input name="search_materialcode" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input name="idStr" type="hidden" />
|
||||
</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>
|
||||
130
bin/WebRoot/jsp/plan/deliverList.jsp
Normal file
130
bin/WebRoot/jsp/plan/deliverList.jsp
Normal file
@ -0,0 +1,130 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var deliverFun = function(id) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '编辑配料详情',
|
||||
width:800,
|
||||
height:400,
|
||||
url : ext.contextPath + '/plan/deliverdetail/deliver.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/deliverdetail/getDeliverDetails.do?pid='+'${pid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '280', title : '物料名称', field : 'materialname', halign:'center', formatter : function(value, row){
|
||||
if(row.materialInfo!=null){
|
||||
return row.materialInfo.materialname;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '物料编码', field : 'materialcode', halign:'center', formatter : function(value, row){
|
||||
if(row.materialInfo!=null){
|
||||
return row.materialInfo.materialcode;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '80', title : '计划配送量', field : 'planamount', halign:'center', formatter : function(value, row){
|
||||
if(value>0){
|
||||
return value+row.materialInfo.unit;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '80', title : '已配送量', field : 'deliveramount', halign:'center', formatter : function(value, row){
|
||||
if(value>0){
|
||||
return value+row.materialInfo.unit;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '70', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-cart_go" title="配送" onclick="deliverFun(\''+row.id+'\');"/>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable" >
|
||||
<tr>
|
||||
<td>物料名称</td>
|
||||
<td><input name="search_materialname" class="easyui-textbox" /></td>
|
||||
<td>物料编码</td>
|
||||
<td><input name="search_materialcode" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input name="idStr" type="hidden" />
|
||||
</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>
|
||||
171
bin/WebRoot/jsp/plan/deliverProcessorAdd.jsp
Normal file
171
bin/WebRoot/jsp/plan/deliverProcessorAdd.jsp
Normal file
@ -0,0 +1,171 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
|
||||
function doSearch(orgids,type){
|
||||
document.getElementById("prompt").style.visibility="hidden";
|
||||
$.getJSON(ext.contextPath +"/user/queryUsers.do?orgid="+orgids+"&type="+type+"",callback);
|
||||
}
|
||||
|
||||
function callback(data){
|
||||
$("#a_Users").empty();
|
||||
if(data.rows.length > 0)
|
||||
{
|
||||
for(var i = 0;i<data.rows.length;i++){
|
||||
var userid = data.rows[i].id;
|
||||
var username = data.rows[i].caption;
|
||||
|
||||
$("#a_Users").append("<option value='"+userid+"'>"+username+"</option>");
|
||||
}
|
||||
}else{
|
||||
document.getElementById("prompt").style.visibility="visible";//显示
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function addToSelect(){
|
||||
var selectid=$("#a_Users option:selected").val();
|
||||
var selecttext=$("#a_Users option:selected").text()
|
||||
for (var i = 0; i < $("#a_selectUsers option").length; i++) {
|
||||
if($("#a_selectUsers").get(0).options[i].value==selectid){
|
||||
return;
|
||||
}
|
||||
}
|
||||
$("#a_selectUsers").append("<option value='"+selectid+"'>"+selecttext+"</option>");
|
||||
}
|
||||
|
||||
function removeFromSelect(){
|
||||
var selOpt = $("#a_selectUsers option:selected");
|
||||
selOpt.remove();
|
||||
}
|
||||
|
||||
function removeFromSelectAll(){
|
||||
top.$.messager.confirm("提示","是否清除全部已选人员?",function(res){
|
||||
if(res){
|
||||
$("#a_selectUsers").empty();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addToSelectAll(){
|
||||
for(var i=0;i<$("#a_Users option").length;i++){
|
||||
var flag=0;
|
||||
var selectid=$("#a_Users").get(0).options[i].value;
|
||||
var selecttext=$("#a_Users").get(0).options[i].text;
|
||||
for (var j = 0; j < $("#a_selectUsers option").length; j++) {
|
||||
if($("#a_selectUsers").get(0).options[j].value==selectid){
|
||||
flag=1;
|
||||
}
|
||||
}
|
||||
if(flag==0) {
|
||||
$("#a_selectUsers").append("<option value='"+selectid+"'>"+selecttext+"</option>");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function addToSelectMulti(){
|
||||
for(var i=0;i<$("#a_Users option").length;i++){
|
||||
if($("#a_Users").get(0).options[i].selected){
|
||||
var flag=0;
|
||||
var selectid=$("#a_Users").get(0).options[i].value;
|
||||
var selecttext=$("#a_Users").get(0).options[i].text;
|
||||
for (var j = 0; j < $("#a_selectUsers option").length; j++) {
|
||||
if($("#a_selectUsers").get(0).options[j].value==selectid){
|
||||
flag=1;
|
||||
}
|
||||
}
|
||||
if(flag==0) {
|
||||
$("#a_selectUsers").append("<option value='"+selectid+"'>"+selecttext+"</option>");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getUser(){
|
||||
document.getElementById("prompt").style.visibility="hidden";
|
||||
var username = $('#queryusername').val();
|
||||
$.getJSON(ext.contextPath +"/user/queryUsers.do?queryusername="+encodeURI(encodeURI(username)), callback );
|
||||
}
|
||||
|
||||
function selectOK(dialog, grid) {
|
||||
var userids="";
|
||||
for(var i=0;i<$("#a_selectUsers option").length;i++){
|
||||
userids+=$("#a_selectUsers").get(0).options[i].value+",";
|
||||
}
|
||||
if(userids.length>1){
|
||||
userids = userids.substring(0, userids.length-1);
|
||||
}
|
||||
$.post(ext.contextPath + "/plan/deliverprocessor/save.do",{pid:'${pid}',processorids:userids}, function(data) {
|
||||
if (data.res != "") {
|
||||
top.$.messager.alert('提示', data.res, 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示', "操作无效", 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('#unitTree').tree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
onClick : function(node) {
|
||||
if(node.pid != ''){
|
||||
doSearch(node.id,node.attributes.type);
|
||||
}
|
||||
}
|
||||
});
|
||||
var recvid='${processorids}';
|
||||
$.getJSON(ext.contextPath +"/user/getRecvusersJson.do?recvid="+recvid, function(data){
|
||||
$("#a_selectUsers").empty();
|
||||
for(var i = 0;i<data.rows.length;i++){
|
||||
var userid = data.rows[i].id;
|
||||
var username = data.rows[i].caption;
|
||||
$("#a_selectUsers").append("<option value='"+userid+"'>"+username+"</option>");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body style="margin:0px">
|
||||
<input id="processorids" name="processorids" type="hidden" />
|
||||
<div style="background-color:#f4f4f4;padding-top:2px;padding-bottom:2px;border-bottom:1px solid #e4e4e4;font-size:12px;">
|
||||
<span style="padding:2px 5px 2px 5px">姓名</span>
|
||||
<input id="queryusername" name="queryusername" class="easyui-searchbox" style="width: 180px;"
|
||||
data-options="prompt:'请输入关键字',searcher:getUser" />
|
||||
<span id="prompt" name="prompt" style="color:red;visibility:hidden;padding:2px 5px 2px 5px">无用户</span>
|
||||
</div>
|
||||
<table cellspacing="2" cellpadding="0" style="font-size:12px;">
|
||||
<tr>
|
||||
<td valign="top" style="border:1px solid #e4e4e4">
|
||||
<div style="width: 250px;height: 370px;overflow:auto">
|
||||
<ul id="unitTree" class="easyui-tree" data-options="method:'get',animate:true"></ul>
|
||||
</div>
|
||||
</td>
|
||||
<td valign="top" style="border:1px solid #e4e4e4">
|
||||
<div style="background-color:#f4f4f4;padding:2px 5px 2px 5px;border-bottom:1px solid #e4e4e4">
|
||||
人员 (双击选择)
|
||||
</div>
|
||||
<select name="a_Users" id="a_Users" ondblclick="addToSelect()"
|
||||
style="width:160px; height:350px;border:0px;padding:2px;" multiple="multiple"></select>
|
||||
</td>
|
||||
<td valign="top" style="border:1px solid #e4e4e4">
|
||||
<div style="background-color:#f4f4f4;padding:2px 5px 2px 5px;border-bottom:1px solid #e4e4e4">
|
||||
已选 (双击移除)
|
||||
</div>
|
||||
<select name="a_selectUsers" id="a_selectUsers" ondblclick="removeFromSelect();"
|
||||
style="width:160px; height:350px;border:0px;padding:2px;" multiple="multiple"></select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
188
bin/WebRoot/jsp/plan/deliverProcessorList.jsp
Normal file
188
bin/WebRoot/jsp/plan/deliverProcessorList.jsp
Normal file
@ -0,0 +1,188 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
/* var addFun = function() {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '添加配送员',
|
||||
width:600,
|
||||
height:500,
|
||||
url : ext.contextPath + '/plan/deliverprocessor/add.do?pid='+'${pid}',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}; */
|
||||
function addFun(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择人员',
|
||||
width: 600,
|
||||
height:480,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/deliverprocessor/add.do?pid='+'${pid}',
|
||||
buttons : [
|
||||
{
|
||||
text : '选中',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.addToSelectMulti();
|
||||
}
|
||||
},{
|
||||
text : '全选',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.addToSelectAll();
|
||||
}
|
||||
},{
|
||||
text : '清除',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.removeFromSelectAll();
|
||||
}
|
||||
},{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.selectOK(dialog, grid);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/deliverprocessor/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.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{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/deliverprocessor/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/deliverprocessor/getDeliverProcessors.do?pid='+'${pid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '姓名', field : 'name', align:'center', formatter : function(value, row){
|
||||
if(row.processor!=null){
|
||||
return row.processor.name;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '工号', field : 'serial', align:'center', formatter : function(value, row){
|
||||
if(row.processor!=null){
|
||||
return row.processor.serial;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"plan/materialdeliver/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
</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,"plan/materialdeliver/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,"plan/materialdeliver/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">
|
||||
<input name="idStr" type="hidden" />
|
||||
</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>
|
||||
56
bin/WebRoot/jsp/plan/deliverProcessorViewList.jsp
Normal file
56
bin/WebRoot/jsp/plan/deliverProcessorViewList.jsp
Normal file
@ -0,0 +1,56 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/deliverprocessor/getDeliverProcessors.do?pid='+'${pid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '260', title : '姓名', field : 'name', align:'center', formatter : function(value, row){
|
||||
if(row.processor!=null){
|
||||
return row.processor.name;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '260', title : '工号', field : 'serial', align:'center', formatter : function(value, row){
|
||||
if(row.processor!=null){
|
||||
return row.processor.serial;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
683
bin/WebRoot/jsp/plan/districtDailyPlanByTaskOrder.jsp
Normal file
683
bin/WebRoot/jsp/plan/districtDailyPlanByTaskOrder.jsp
Normal file
@ -0,0 +1,683 @@
|
||||
<%@ 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);%>
|
||||
|
||||
<!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 order_n0;
|
||||
var order_n;
|
||||
var index_n0;
|
||||
var index_n;
|
||||
var allowDndflag=0;
|
||||
var addFun = function(taskorderid) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'add',
|
||||
height:250,
|
||||
width:500,
|
||||
title : '自动分配日计划',
|
||||
url : ext.contextPath + '/plan/dailyplan/addMoreByTaskOrderid.do?taskOrderId=${taskOrder.id}',
|
||||
buttons : [
|
||||
{
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var addOldFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'addold',
|
||||
title : '新增旧单日计划',
|
||||
url : ext.contextPath + '/plan/dailyplan/addoldorderplan.do?iframeId=addold&date=${param.sdt}&plandate=${dailyplansummary.plandt}&pid=${dailyplansummary.id }&insertpid=${dailyplansummary.insertpid }',
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(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.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
};
|
||||
//分配工作量-wxp
|
||||
var distFun = function(planid,prid) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
width: 950,
|
||||
height:550,
|
||||
title : '分配任务量',
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showDistricWork.do?processrealid='+prid+'&planid='+planid,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
/* 提交日计划 至审核*/
|
||||
function dosubmit(id){
|
||||
parent.$.messager.confirm('提示', '您确定要提交计划?提交计划等待审核,将无法修改。', function(r) {
|
||||
if(r){
|
||||
$.post(ext.contextPath + "/plan/dailyplan/updatebyid.do", {id : id}, function(data) {
|
||||
if (data == 1) {
|
||||
top.$.messager.alert('提示', "提交成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
|
||||
});
|
||||
}else if(data == 0){
|
||||
top.$.messager.alert('提示', "提交失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data, 'info');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}else{
|
||||
return ;
|
||||
}
|
||||
}) ;
|
||||
}
|
||||
/* 提交多条日计划 至审核*/
|
||||
function dosubmits(){
|
||||
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{
|
||||
parent.$.messager.confirm('提示', '您确定要提交计划?提交计划等待审核,将无法修改。', function(r) {
|
||||
if(r){
|
||||
$.post(ext.contextPath + "/plan/dailyplan/updatebyid.do", {id : datas}, function(data) {
|
||||
if (data == 1) {
|
||||
top.$.messager.alert('提示', "提交成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
|
||||
});
|
||||
}else if(data == 0){
|
||||
top.$.messager.alert('提示', "提交失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data, 'info');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}else{
|
||||
return ;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'edit',
|
||||
width: 800,
|
||||
height:590,
|
||||
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);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
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){
|
||||
if(item.status=='${Flag_Edit}'){//下发后的计划不能删除
|
||||
datas+=item.id+",";
|
||||
}else{
|
||||
top.$.messager.alert('提示', '下发后的计划('+item.insdt.substring(0,19)+')不能删除','info');
|
||||
}
|
||||
|
||||
});
|
||||
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 suspendFun = function(id,status) {
|
||||
var tip="";
|
||||
var status_="";
|
||||
if(status=="${Flag_Suspend}"){
|
||||
tip="激活";
|
||||
status_="${Flag_Active}";
|
||||
}else {
|
||||
tip="挂起";
|
||||
status_="${Flag_Suspend}";
|
||||
}
|
||||
parent.$.messager.confirm('提示', '您确定要'+tip+'此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/dailyplan/suspend.do', {id : id,suspended:status_}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示',tip+'成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示',tip+'失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var flag=0;
|
||||
$(function() {
|
||||
grid= $('#grid').datagrid({
|
||||
title : '',
|
||||
url:ext.contextPath + '/plan/dailyplan/getdailyplans.do',
|
||||
queryParams: {
|
||||
sdt: $("#sdt").val(),
|
||||
edt: $("#edt").val(),
|
||||
search_status: $('#search_status').combobox('getValue'),
|
||||
notdisplayinvalid:$('#notdisplayinvalid').val(),
|
||||
taskorderid:'${taskOrder.id}',
|
||||
sort:'stdt'
|
||||
},
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
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=='${Flag_Delete}'|| row.status=='${Flag_ReEdit}'){
|
||||
rowstyler+= ' background-color:#C0C0C0;color:#fff;';
|
||||
}else if(row.status=='${Flag_Finish}'){
|
||||
rowstyler+= ' font-style:ltalic;';
|
||||
}
|
||||
return rowstyler;
|
||||
},
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '150', 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 : 'stdt',align:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,10);
|
||||
}
|
||||
},sortable:false },
|
||||
{width : '100', title : '计划状态', field : 'status', align:'center', formatter : function(value, row){
|
||||
var susp="";
|
||||
if(row.suspended=='${Flag_Active}'){
|
||||
susp= "";
|
||||
}else if(row.suspended=='${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 : '140', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/> ';
|
||||
if(row.status!="${Flag_Submit}" && row.status!='${Flag_Finish}'&& row.status!='${Flag_Delete}'){
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/edit.do")) {%>
|
||||
if(row.status=='${Flag_Edit}'){
|
||||
str += '<img class="iconImg ext-icon-table_add" title="配置" onclick="distFun(\''+row.id+'\',\''+row.processrealid+'\');"/> ';
|
||||
}
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/edit.do")) {%>
|
||||
if(row.status=='${Flag_Edit}'){
|
||||
str += '<img class="iconImg ext-icon-table_go" title="提交" onclick="dosubmit(\''+row.id+'\');"/> ';
|
||||
}
|
||||
<%}%>
|
||||
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/edit.do")) {%>
|
||||
if(row.status=='${Flag_Edit}'){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/> ';
|
||||
}
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/delete.do")) {%>
|
||||
if(row.status=='${Flag_Edit}'){
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/> ';
|
||||
}else if(row.suspended=='${Flag_Suspend}'){
|
||||
str += '<img class="iconImg ext-icon-table_lightning" title="激活" onclick="suspendFun(\''+row.id+'\',\''+row.suspended+'\');"/> ';
|
||||
}else if(row.suspended=='${Flag_Active}'){
|
||||
str += '<img class="iconImg ext-icon-table_link" title="挂起" onclick="suspendFun(\''+row.id+'\',\''+row.suspended+'\');"/> ';
|
||||
}
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/edit.do")) {%>
|
||||
if(row.status!='${Flag_Edit}'){
|
||||
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(){
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(allowDndflag==1){//连续拖拽
|
||||
$(this).datagrid('enableDnd');
|
||||
allowDndflag=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.$("#viewDialog").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=='1'){
|
||||
top.$.messager.alert('提示','下发成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else if(data.res=='0'){
|
||||
top.$.messager.alert('提示','无可下发计划','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示',data.res,'info');
|
||||
}
|
||||
},'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!='0'){
|
||||
top.$.messager.alert('提示','成功提交'+data.res+'条记录','info');
|
||||
$('#addtd').hide();
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','无可提交计划','info');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function reset(){
|
||||
$('#searchForm').form('clear');
|
||||
grid.datagrid('load',{pid:'${dailyplansummary.id }'});
|
||||
$('#sdt').val('${wsdt}');
|
||||
$('#edt').val('${wedt}');
|
||||
notallowDnd();
|
||||
}
|
||||
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(){
|
||||
$('#mm').switchbutton({
|
||||
onChange: function(checked){
|
||||
if(checked==true){
|
||||
$('#notdisplayinvalid').val("1");
|
||||
}else{
|
||||
$('#notdisplayinvalid').val("");
|
||||
}
|
||||
//alert(checked);
|
||||
grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
}
|
||||
});
|
||||
/* if('${addpermit}'=='1'||'${dailyplansummary.insertpid}'!=null||'${dailyplansummary.insertpid}'!=''){
|
||||
$('#addtd').show();
|
||||
}else{
|
||||
$('#addtd').hide();
|
||||
}
|
||||
if('${dailyplansummary.insertpid}'!=null||'${dailyplansummary.insertpid}'!=''){
|
||||
$('#addoldtd').show();
|
||||
}else{
|
||||
$('#addoldtd').hide();
|
||||
} */
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body >
|
||||
<div id="cc" class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div data-options="region:'north',title:'任务单信息',split:false" style="height:100px;">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>任务单编号</th>
|
||||
<td>${taskOrder.tasklistcode }</td>
|
||||
<th>状态</th>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${dailyplansummary.status == 0}">未审核</c:when>
|
||||
<c:when test="${dailyplansummary.status == 1}">已完成</c:when>
|
||||
<c:when test="${dailyplansummary.status == 3}">已审核</c:when>
|
||||
<c:otherwise></c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
<th >开始时间</th>
|
||||
<td>${fn:substring(taskOrder.pstdate,0,10)}</td>
|
||||
<th>结束时间</th>
|
||||
<td>${fn:substring(taskOrder.pendate,0,10)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品编号</th>
|
||||
<td>${taskOrder.productno}</td>
|
||||
<th>产品数量</th>
|
||||
<td>${taskOrder.prodamount}</td>
|
||||
<th>备注</th>
|
||||
<td></td>
|
||||
<th ></th>
|
||||
<td></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</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>
|
||||
<c:if test="${param.olddayflag!=1}">
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/add.do")) {%>
|
||||
<td id="addtd" name="addtd">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun('');">添加</a>
|
||||
</td>
|
||||
<!-- <td id="addoldtd" name="addoldtd">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addOldFun();">添加旧单计划</a>
|
||||
</td> -->
|
||||
<%}%>
|
||||
</c:if>
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/delete.do")) {%>
|
||||
<!-- <td id="importcsv" name="importcsv">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true"
|
||||
onclick="importcsv();">导入csv</a>
|
||||
</td> -->
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/dailyplan/edit.do")) {%>
|
||||
<td id="edittd" name="edittd" >
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-note_go',plain:true" onclick="dosubmits();">提交</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input id="taskorderid" name="taskorderid" type="hidden" value="${taskOrder.id }" />
|
||||
<input name="sort" type="hidden" value="stdt" />
|
||||
<table>
|
||||
<tr>
|
||||
<td >计划状态</td>
|
||||
<td colspan='4'><select id="search_status" name="search_status" class="easyui-combobox" style="width:152px;">
|
||||
<option value='all' select>全部</option>
|
||||
<option value='edit'>待提交</option>
|
||||
<option value='submit'>待审核</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>隐藏作废 <input id="mm"
|
||||
class="easyui-switchbutton" style="height:22px;width:50px;"
|
||||
data-options="onText:'是',offText:'否'" unchecked></td>
|
||||
<input id="notdisplayinvalid" name="notdisplayinvalid" type="hidden"
|
||||
value="" />
|
||||
<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')));notallowDnd();">搜索</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>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
191
bin/WebRoot/jsp/plan/districtworkbyplan.jsp
Normal file
191
bin/WebRoot/jsp/plan/districtworkbyplan.jsp
Normal file
@ -0,0 +1,191 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var returnVal = "";//用于传递是否需要刷新页面refresh
|
||||
|
||||
var autoDistrict = function() {
|
||||
parent.$.messager.prompt('提示', '请填写计划生产的产品总量', function(r){
|
||||
if (parseInt(r)==r){
|
||||
$.post(ext.contextPath + '/plan/dailyplansummary/autoDistricWorkDetail.do', {amount:r,planId:'${planid}'} , function(data) {
|
||||
if(data=='1'){
|
||||
top.$.messager.alert('提示','自动配置完成','info',function(){
|
||||
showProcedureDistrictStatus();
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','自动配置失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/workflow/getAllPDNode.do?processDefinitionId=${prid}&order=desc' ,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '工序名称', field : 'name', halign:'center'},
|
||||
{width : '100', title : '工序Id', field : 'id', halign:'center'},
|
||||
{width : '100', title : '工艺名称', field : 'pd_name', halign:'center'},
|
||||
{width : '60', title : '计划良率', field : 'yield', align:'center'},
|
||||
{width : '80', title : '计划产出数', field : 'status', align:'center'},
|
||||
{width : '80', title : '计划需求数', field : 'status_in', align:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
|
||||
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(grid.datagrid('getSelected')==null){
|
||||
grid.datagrid('selectRow',0);
|
||||
}
|
||||
|
||||
$("#name_search").combobox("select",data.lineid);
|
||||
showProcedureDistrictStatus();
|
||||
},
|
||||
onSelect:function(index,row){
|
||||
showdetailsFun('${planid}',row.id,row.pd_id);
|
||||
}
|
||||
});
|
||||
|
||||
/* $("#name_search").combobox({
|
||||
url : ext.contextPath + '/process/real/getLineListByRealid.do?realid=${workorder.processrealid}&random=' + Math.random(),
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto'
|
||||
}); */
|
||||
});
|
||||
var showProcedureDistrictStatus= function(){
|
||||
//alert()
|
||||
|
||||
$.post(ext.contextPath + '/plan/dailyplansummary/getTaskDemands.do', {planid:'${planid}'} , function(data) {
|
||||
//console.info(data)
|
||||
//if(data.length>0){
|
||||
//alert("222");
|
||||
var griddata=$("#grid").datagrid("getData").rows;
|
||||
|
||||
for(var i=0;i<griddata.length;i++){
|
||||
//console.info(griddata);
|
||||
var taskcode=griddata[i].id;
|
||||
//alert(taskcode)
|
||||
$("#grid").datagrid("getRows")[i]['status']="";
|
||||
$("#grid").datagrid("getRows")[i]['status_in']="";
|
||||
$('#grid').datagrid('refreshRow', i);
|
||||
for(var j=0;j<data.length;j++){
|
||||
if(taskcode==data[j].taskcode){
|
||||
var yield =$("#grid").datagrid("getRows")[i]['yield'];
|
||||
if(yield!=null &&yield !=""){
|
||||
var preamount=(data[j].preamount==""?0:data[j].preamount)
|
||||
var input = preamount/yield;
|
||||
$("#grid").datagrid("getRows")[i]['status_in']=Math.ceil(input);
|
||||
}
|
||||
$("#grid").datagrid("getRows")[i]['status']=data[j].preamount;
|
||||
$('#grid').datagrid('refreshRow', i);
|
||||
var rowIndex=$('#grid').datagrid('getRowIndex',$('#grid').datagrid('getSelected'));
|
||||
$('#grid').datagrid("selectRow",rowIndex)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//}
|
||||
},'json');
|
||||
};
|
||||
var showdetailsFun = function(planId,taskId,processId) {
|
||||
$("#rightFrameMaterial").attr("src",ext.contextPath+"/plan/dailyplansummary/showDistricWorkDetail.do?processRealId="+processId+"&taskId="+taskId+"&planId="+planId);
|
||||
$("#rightFrameEquipment").attr("src",ext.contextPath+"/work/workorder/showdistrictwork_equ.do?planId="+planId+"&processid="+processId+"&taskid="+taskId);
|
||||
$("#rightFrameScheduling").attr("src",ext.contextPath+"/work/workorder/showdistrictwork_group.do?planId="+planId+"&processid="+processId+"&taskid="+taskId);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="maindiv" class="easyui-layout" data-options="fit:true">
|
||||
<div id="leftdiv" data-options="region:'west',split:true" title="分配 任务量" style="width:600px;padding:0;">
|
||||
<table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
<!-- <td>工序</td>
|
||||
<td><input id="name_search" name="name_search" class="easyui-combobox"/></td> -->
|
||||
<td>
|
||||
<!-- <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a> -->
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="autoDistrict();">自动分配</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<div id="rightdiv" data-options="region:'center'">
|
||||
<!-- <table>
|
||||
<tr>
|
||||
<th>任务量情况</th>
|
||||
<td>112</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备分配情况</th>
|
||||
<td>112</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>人员分配情况</th>
|
||||
<td>112</td>
|
||||
</tr>
|
||||
</table> -->
|
||||
<div id="tt" class="easyui-tabs" data-options="fit:true">
|
||||
<!-- <div title="排班管理">
|
||||
<iframe id="rightFrameScheduling" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div> -->
|
||||
<div title="任务量">
|
||||
<iframe id="rightFrameMaterial" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<div title="相关设备">
|
||||
<iframe id="rightFrameEquipment" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<div title="排班管理">
|
||||
<iframe id="rightFrameScheduling" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
201
bin/WebRoot/jsp/plan/districtworkdetail.jsp
Normal file
201
bin/WebRoot/jsp/plan/districtworkdetail.jsp
Normal file
@ -0,0 +1,201 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
var preamount =$('#preamount').textbox('getValue');
|
||||
if(preamount==""){
|
||||
parent.$.messager.alert("提示","日计划产量不能为空","info",function(){
|
||||
$("#preamount").focus();
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/dailyplansummary/districWorkDetail.do", $("#baseForm").serialize(), function(data) {
|
||||
if (data == '1') {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
var sd=$("#taskgrid").combogrid('getValue');
|
||||
$("#taskgrid").combogrid('grid').datagrid('selectRecord',sd);
|
||||
parent.showProcedureDistrictStatus();
|
||||
});
|
||||
}else if(data == '0'){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var clearFun = function(id) {
|
||||
//alert(id)
|
||||
parent.$.messager.confirm('提示', '您确定要清除此配置?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/dailyplansummary/clearWorkDetail.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','清除成功','info', function() {
|
||||
parent.showProcedureDistrictStatus();
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','清除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function(){
|
||||
$('#taskgrid').combogrid({
|
||||
panelWidth: 400,
|
||||
idField: 'id',
|
||||
textField: 'taskcode',
|
||||
url: ext.contextPath +'/plan/taskorder/getSchedulingTask.do?pid=${taskorderid}',
|
||||
columns: [[
|
||||
{field:'taskcode',title:'任务编号',width:50},
|
||||
{field:'workshop',title:'生产车间',width:50},
|
||||
{field:'planamount',title:'计划产量',width:50},
|
||||
{field:'materialname',title:'物料名称',width:60},
|
||||
{field:'pendate',title:'截止日期',width:60, formatter : function(value, row) {
|
||||
return row.pendate.substring(0,10);
|
||||
}}
|
||||
]],
|
||||
fitColumns: true,
|
||||
onLoadSuccess:function(){
|
||||
$("#taskgrid").combogrid('grid').datagrid('selectRecord','${dailyPlanTaskDemand.prodtaskid}');
|
||||
} ,
|
||||
onSelect: function (rowIndex, rowData){
|
||||
var selectdatestr=rowData.pendate;
|
||||
var nowdate = new Date(); //结束时间
|
||||
var datesum = new Date(selectdatestr).getTime()-nowdate.getTime(); //时间差的毫秒数
|
||||
//计算出相差天数
|
||||
var days=Math.floor(datesum/(24*3600*1000)) ;
|
||||
$("#days").html(days);
|
||||
$("#preSumAmount").html(rowData.planamount);
|
||||
$.post(ext.contextPath + "/plan/dailyplansummary/searchAmountByProdTaskId.do",{prodTaskId:rowData.id,taskcode:'${dailyPlanTaskDemand.taskcode}',planid:'${dailyPlanTaskDemand.planid}'}, function(data) {
|
||||
//console.info(data)
|
||||
$("#remainamount").html(data.remainamount);
|
||||
if(data.remainamount<0){
|
||||
$("#remainamount").css("color",'red');
|
||||
}else{
|
||||
$("#remainamount").css("color",'black');
|
||||
}
|
||||
$("#actProcedureSumAmount").html(data.actProcedureSumAmount);
|
||||
/* var preyield =$("#preyield").textbox('getValue');
|
||||
if(preyield==""){
|
||||
$("#preyield").textbox('setValue',data.preyield);
|
||||
} */
|
||||
|
||||
$("#actSumYeild").html(data.actSumYeild);
|
||||
},'json');
|
||||
$("#workshop").html(rowData.workshop);
|
||||
$("#prodtaskid").val(rowData.id);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="maindiv" class="easyui-layout" data-options="fit:true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="baseForm">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="dosave();">保存</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="clearFun('${dailyPlanTaskDemand.id}');">清除</a>
|
||||
<input id ="id" name="id" type="hidden" value="${dailyPlanTaskDemand.id}"/>
|
||||
<input id ="planid" name="planid" type="hidden" value="${dailyPlanTaskDemand.planid}"/>
|
||||
<input id ="processid" name="processid" type="hidden" value="${dailyPlanTaskDemand.processid}"/>
|
||||
<input id ="taskcode" name="taskcode" type="hidden" value="${dailyPlanTaskDemand.taskcode}"/>
|
||||
<input id ="prodtaskid" name="prodtaskid" type="hidden" value="${dailyPlanTaskDemand.prodtaskid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>任务编号</th>
|
||||
<td>
|
||||
<select id="taskgrid" name="taskgrid" class="easyui-combogrid" data-options="fit:true">
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>生产车间</th>
|
||||
<td>
|
||||
<span id="workshop" ></span>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>剩余天数</th>
|
||||
<td>
|
||||
<span id="days" ></span>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划总数量</th>
|
||||
<td>
|
||||
<span id="preSumAmount" ></span>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>未排产数量</th>
|
||||
<td>
|
||||
<span id="remainamount" ></span>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>当前工序实际产量</th>
|
||||
<td>
|
||||
<span id="actProcedureSumAmount" ></span>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>当前工序良率</th>
|
||||
<td>
|
||||
<span id="actSumYeild" ></span>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>日计划产量</th>
|
||||
<td>
|
||||
<input id ="preamount" name="preamount" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',fit:true" value="${dailyPlanTaskDemand.preamount}"/>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<%-- <tr>
|
||||
<th>计划良率</th>
|
||||
<td>
|
||||
<input id="preyield" name="preyield" class="easyui-textbox"
|
||||
value="${dailyPlanTaskDemand.preyield}" data-options="fit:true"/>
|
||||
</td>
|
||||
</tr> --%>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
140
bin/WebRoot/jsp/plan/erpProdtaskForSelect.jsp
Normal file
140
bin/WebRoot/jsp/plan/erpProdtaskForSelect.jsp
Normal file
@ -0,0 +1,140 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%request.setAttribute("Flag_ERPConfirm",com.sipai.entity.plan.Prodtask.Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("Flag_Issued",com.sipai.entity.plan.Prodtask.Flag_Issued);%>
|
||||
<%request.setAttribute("Flag_Working",com.sipai.entity.plan.Prodtask.Flag_Working);%>
|
||||
<%request.setAttribute("Flag_Finish",com.sipai.entity.plan.Prodtask.Flag_Finish);%>
|
||||
<%request.setAttribute("Flag_Closed",com.sipai.entity.plan.Prodtask.Flag_Closed);%>
|
||||
<%request.setAttribute("Flag_Cancel",com.sipai.entity.plan.Prodtask.Flag_Cancel);%>
|
||||
<%request.setAttribute("Flag_NoPlan",com.sipai.entity.plan.Prodtask.Flag_NoPlan);%>
|
||||
<%request.setAttribute("Flag_ERPIssued",com.sipai.entity.plan.Prodtask.Flag_ERPIssued);%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/saveERPProdtask.do?id=${id}&griddata="+selectOK(),function(data1){
|
||||
if(JSON.parse(data1).res>-1 )
|
||||
{
|
||||
top.$.messager.alert('提示', "任务添加成功", 'info', function() {
|
||||
dialog.dialog('destroy');
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}
|
||||
else if(JSON.parse(data1).res == -1){
|
||||
top.$.messager.alert('提示', '任务'+JSON.parse(data1).tcres+'导入失败请重新导入', 'info');
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
else{
|
||||
top.$.messager.alert('提示', data1.res, 'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function selectOK(dialog, grid) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
console.log("checkedItems",checkedItems);
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas += item.taskcode+',';
|
||||
});
|
||||
datas = datas.replace(/,$/gi,"");
|
||||
return datas;
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/taskorder/getERPProdatsk.do?salesno=${salesno}&productno=${productno}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '任务编号', field : 'taskcode', sortable : true, halign:'center'},
|
||||
{width : '60', title : '执行状态', field : 'runstatus', halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${Flag_Issued}':
|
||||
return '下发';
|
||||
case '${Flag_Working}':
|
||||
return '开工';
|
||||
case '${Flag_Finish}':
|
||||
return '完成';
|
||||
case '${Flag_Closed}':
|
||||
return '结案';
|
||||
case '${Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '70', title : '计划生产数', field : 'planamount', sortable : true, halign:'center'},
|
||||
{width : '90', title : '生产车间', field : 'workshopname', sortable : true, halign:'center'},
|
||||
{width : '85', title : '物料名称', field : 'materialname', sortable : true, halign:'center'},
|
||||
{width : '140', title : '物料代码', field : 'materialcode', sortable : true, halign:'center'},
|
||||
{width : '80', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '120', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '120', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess:function(data){
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr >
|
||||
<td>任务单</td>
|
||||
<td><input name="search_tasklistcode" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td>
|
||||
<td>产品编码</td>
|
||||
<td><input name="search_productno" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
<td><div class="datagrid-btn-separator"></div></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>
|
||||
|
||||
62
bin/WebRoot/jsp/plan/excuteMission.jsp
Normal file
62
bin/WebRoot/jsp/plan/excuteMission.jsp
Normal file
@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
showdetailsFun('${materialDeliver.id }');
|
||||
});
|
||||
var showdetailsFun = function(pid) {
|
||||
$("#rightFrameMaterial").attr("src",ext.contextPath+"/plan/deliverdetail/showdeliverlist.do?pid="+pid);
|
||||
$("#rightFrameProcessor").attr("src",ext.contextPath+"/plan/deliverprocessor/showviewlist.do?pid="+pid);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="easyui-panel" title="配送任务" style="padding:10px;">
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${materialDeliver.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>计划信息</th>
|
||||
<td>${materialDeliver.dailyPlanSummary.name }</td>
|
||||
<th>计划日期</th>
|
||||
<td>${fn:substring(materialDeliver.dailyPlanSummary.plandt,0,10) }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>所属工位</th>
|
||||
<td>${materialDeliver.workstation.name }</td>
|
||||
<th>工位编号</th>
|
||||
<td>${materialDeliver.workstation.serial }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >配送开始时间</th>
|
||||
<td >${fn:substring(materialDeliver.starttime,0,16) }</td>
|
||||
<th >配送截至时间</th>
|
||||
<td >${fn:substring(materialDeliver.endtime,0,16) }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td colspan="3"><input id="remark" name="remark" class="easyui-textbox" value="${materialDeliver.remark }"
|
||||
data-options="multiline:true,editable:false" style="width:100%;height:100px"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<br/>
|
||||
<div id="tooltab" class="easyui-tabs" style="height:300px;">
|
||||
<div title="配料详情">
|
||||
<iframe id="rightFrameMaterial" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<div title="配料人员">
|
||||
<iframe id="rightFrameProcessor" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
78
bin/WebRoot/jsp/plan/importCSV.jsp
Normal file
78
bin/WebRoot/jsp/plan/importCSV.jsp
Normal file
@ -0,0 +1,78 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>导入人员</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script>
|
||||
var uploader,state;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$list = $('#thelist'),
|
||||
state = 'pending';
|
||||
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'/plan/dailyplan/testcsv.do',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: {
|
||||
id: '#picker',
|
||||
multiple: false
|
||||
},
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false,
|
||||
accept: {
|
||||
title: 'CSV',
|
||||
extensions: 'csv',
|
||||
mimeTypes: '.csv'
|
||||
}
|
||||
});
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
});
|
||||
|
||||
var doimport = function(dialog, grid){
|
||||
//执行上传功能
|
||||
if ( state === 'uploading' ) {
|
||||
alert("文件正在上传中,请稍等");
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadSuccess', function( file,response ) {
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
if(response.feedback!=null&&response.feedback!=""){
|
||||
alert(response.feedback);
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
alert("导入未完成!");
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<div class="btns">
|
||||
<div id="picker">选择文件</div>
|
||||
</div>
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
78
bin/WebRoot/jsp/plan/importProdtask.jsp
Normal file
78
bin/WebRoot/jsp/plan/importProdtask.jsp
Normal file
@ -0,0 +1,78 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>导入人员</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script>
|
||||
var uploader,state;
|
||||
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$list = $('#thelist'),
|
||||
state = 'pending';
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'/plan/taskorder/importTask.do',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: {
|
||||
id: '#picker',
|
||||
multiple: false
|
||||
},
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false,
|
||||
accept: {
|
||||
title: 'Excel',
|
||||
extensions: 'xls,xlsx',
|
||||
mimeTypes: 'excel/*'
|
||||
}
|
||||
});
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
});
|
||||
|
||||
var doimport = function(dialog, grid){
|
||||
//执行上传功能
|
||||
if ( state === 'uploading' ) {
|
||||
alert("文件正在上传中,请稍等");
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadSuccess', function( file,response ) {
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
if(response.feedback!=null&&response.feedback!=""){
|
||||
alert(response.feedback);
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
alert("导入未完成!");
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<div class="btns">
|
||||
<div id="picker">选择文件</div>
|
||||
</div>
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
399
bin/WebRoot/jsp/plan/importRelatedTaskorderList.jsp
Normal file
399
bin/WebRoot/jsp/plan/importRelatedTaskorderList.jsp
Normal file
@ -0,0 +1,399 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%request.setAttribute("TO_Flag_ERPConfirm",com.sipai.entity.plan.Taskorder.TO_Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("TO_Flag_Issued",com.sipai.entity.plan.Taskorder.TO_Flag_Issued);%>
|
||||
<%request.setAttribute("TO_Flag_Working",com.sipai.entity.plan.Taskorder.TO_Flag_Working);%>
|
||||
<%request.setAttribute("TO_Flag_Closed",com.sipai.entity.plan.Taskorder.TO_Flag_Closed);%>
|
||||
<%request.setAttribute("TO_Flag_Cancel",com.sipai.entity.plan.Taskorder.TO_Flag_Cancel);%>
|
||||
<%request.setAttribute("TO_Flag_NoPlan",com.sipai.entity.plan.Taskorder.TO_Flag_NoPlan);%>
|
||||
<%request.setAttribute("TO_Flag_ERPIssued",com.sipai.entity.plan.Taskorder.TO_Flag_ERPIssued);%>
|
||||
|
||||
<%request.setAttribute("Flag_ERPConfirm",com.sipai.entity.plan.Prodtask.Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("Flag_Issued",com.sipai.entity.plan.Prodtask.Flag_Issued);%>
|
||||
<%request.setAttribute("Flag_Working",com.sipai.entity.plan.Prodtask.Flag_Working);%>
|
||||
<%request.setAttribute("Flag_Finish",com.sipai.entity.plan.Prodtask.Flag_Finish);%>
|
||||
<%request.setAttribute("Flag_Closed",com.sipai.entity.plan.Prodtask.Flag_Closed);%>
|
||||
<%request.setAttribute("Flag_Cancel",com.sipai.entity.plan.Prodtask.Flag_Cancel);%>
|
||||
<%request.setAttribute("Flag_NoPlan",com.sipai.entity.plan.Prodtask.Flag_NoPlan);%>
|
||||
<%request.setAttribute("Flag_ERPIssued",com.sipai.entity.plan.Prodtask.Flag_ERPIssued);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var griderp;
|
||||
var gridsavedto;
|
||||
function dosave(secdialog,griderp) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/saveERPGridData.do",{griddata:getGriddata()},function(data1){
|
||||
if(JSON.parse(data1).res>-1)
|
||||
{
|
||||
top.$.messager.alert('提示', "导入成功", 'info', function() {
|
||||
secdialog.dialog('destroy');
|
||||
});
|
||||
}
|
||||
else if(JSON.parse(data1).bomres == -1){
|
||||
top.$.messager.alert('提示', 'BOM导入失败请重新导入', 'info');
|
||||
if(JSON.parse(data1).res == -1)
|
||||
{
|
||||
top.$.messager.alert('提示', '导入失败'+JSON.parse(data).jerrorlist+'未导入', 'info');
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}else{
|
||||
top.$.messager.alert('提示', data1.res, 'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var erpmc = JSON.parse(localStorage.getItem("erpmc"));
|
||||
var savetoid = JSON.parse(localStorage.getItem("savetoid"));
|
||||
var flag=0;
|
||||
$(function() {
|
||||
$('#dd').tooltip({
|
||||
position: 'top',
|
||||
content: '<table id="dg" class="easyui-datagrid" style="width:255px;height:200px"></table>',
|
||||
onShow: function(){
|
||||
$(this).tooltip('tip').css({
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#666'
|
||||
});
|
||||
$('#dg').datagrid({
|
||||
url:ext.contextPath + '/plan/taskorder/getLackedERPSemimanufactures.do?erpmc='+erpmc,
|
||||
columns:[[
|
||||
{field:'materialcode',title:'缺少的物料代码',width:130},
|
||||
{field:'materialname',title:'缺少的物料名称',width:120},
|
||||
]]
|
||||
});
|
||||
}
|
||||
});
|
||||
//console.log("erpmc",erpmc);
|
||||
griderp = $('#griderp').datagrid({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/taskorder/importRelatedERPTaskorder.do?erpmc=' + erpmc,
|
||||
striped : true,
|
||||
//pagination : true,
|
||||
rownumbers : true,
|
||||
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
frozenColumns:[[
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '任务单编号', field : 'tasklistcode', sortable : true, halign:'center'},
|
||||
{width : '80', title : '任务单状态', field : 'billstatus', sortable : true, align:'center',halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${TO_Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${TO_Flag_Issued}':
|
||||
return '下发';
|
||||
case '${TO_Flag_Working}':
|
||||
return '开工';
|
||||
case '${TO_Flag_Closed}':
|
||||
return '结案';
|
||||
case '${TO_Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${TO_Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${TO_Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
]],
|
||||
columns : [ [
|
||||
{width : '150', title : '产品编码', field : 'productno', sortable : true, align:'center',halign:'center'},
|
||||
{width : '100', title : '产品数量', field : 'prodamount', sortable : true,align:'center', halign:'center'},
|
||||
{width : '130', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '140', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '140', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
|
||||
{width : '140', title : '任务单下达时间', field : 'billruntime', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(flag==0){
|
||||
flag=1;
|
||||
griderp.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
}
|
||||
else{
|
||||
}
|
||||
},
|
||||
onExpandRow: function(index,row){
|
||||
ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddv.datagrid({
|
||||
url:ext.contextPath + '/plan/taskorder/getERPTask.do?salesno='+row.salesno+'&productno='+row.productno+'&workshop='+row.workshop+'&tempfornosaleno='+row.tempfornosaleno,
|
||||
fitColumns:true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
striped: true,
|
||||
idField : 'id',
|
||||
rownumbers:true,
|
||||
//loadMsg:'',
|
||||
height:'auto',
|
||||
columns : [ [
|
||||
{width : '140', title : '任务编号', field : 'taskcode', sortable : true, halign:'center'},
|
||||
{width : '65', title : '执行状态', field : 'runstatus', sortable : true, halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${Flag_Issued}':
|
||||
return '下发';
|
||||
case '${Flag_Working}':
|
||||
return '开工';
|
||||
case '${Flag_Finish}':
|
||||
return '完成';
|
||||
case '${Flag_Closed}':
|
||||
return '结案';
|
||||
case '${Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '85', title : '计划生产数', field : 'planamount', sortable : true, halign:'center'},
|
||||
{width : '90', title : '生产车间', field : 'workshop', sortable : true, halign:'center'},
|
||||
{width : '85', title : '物料名称', field : 'materialname', sortable : true, halign:'center'},
|
||||
{width : '140', title : '物料代码', field : 'materialcode', sortable : true, halign:'center'},
|
||||
{width : '120', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '120', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '120', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
onResize:function(){
|
||||
$('#griderp').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#griderp').datagrid('fixDetailRowHeight',index);
|
||||
},0);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
gridsavedto = $('#gridsavedto').datagrid({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/taskorder/getSavedTaskorder.do?savetoid=' + savetoid,
|
||||
striped : true,
|
||||
pagination : true,
|
||||
rownumbers : true,
|
||||
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
frozenColumns:[[
|
||||
{width : '180', title : '任务单编号', field : 'tasklistcode', sortable : true, halign:'center'},
|
||||
{width : '80', title : '任务单状态', field : 'billstatus', sortable : true, align:'center',halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${TO_Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${TO_Flag_Issued}':
|
||||
return '下发';
|
||||
case '${TO_Flag_Working}':
|
||||
return '开工';
|
||||
case '${TO_Flag_Closed}':
|
||||
return '结案';
|
||||
case '${TO_Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${TO_Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${TO_Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
]],
|
||||
columns : [ [
|
||||
{width : '150', title : '产品编码', field : 'productno', sortable : true, align:'center',halign:'center'},
|
||||
{width : '100', title : '产品数量', field : 'prodamount', sortable : true,align:'center', halign:'center'},
|
||||
{width : '130', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '140', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '140', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
|
||||
{width : '140', title : '任务单下达时间', field : 'billruntime', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
|
||||
] ],
|
||||
toolbar : '#toolbarsto',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(flag==0){
|
||||
flag=1;
|
||||
griderp.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
}
|
||||
else{
|
||||
}
|
||||
},
|
||||
onExpandRow: function(index,row){
|
||||
ddvmes = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddvmes.datagrid({
|
||||
url:ext.contextPath + '/plan/taskorder/getTask.do?pid='+row.id,
|
||||
fitColumns:true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
striped: true,
|
||||
idField : 'id',
|
||||
rownumbers:true,
|
||||
//loadMsg:'',
|
||||
height:'auto',
|
||||
columns : [ [
|
||||
|
||||
{width : '140', title : '任务编号', field : 'taskcode', sortable : true, halign:'center'},
|
||||
{width : '65', title : '执行状态', field : 'runstatus', sortable : true, halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${Flag_Issued}':
|
||||
return '下发';
|
||||
case '${Flag_Working}':
|
||||
return '开工';
|
||||
case '${Flag_Finish}':
|
||||
return '完成';
|
||||
case '${Flag_Closed}':
|
||||
return '结案';
|
||||
case '${Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '85', title : '计划生产数', field : 'planamount', sortable : true, halign:'center'},
|
||||
{width : '90', title : '生产车间', field : 'workshop', sortable : true, halign:'center'},
|
||||
{width : '85', title : '物料名称', field : 'materialname', sortable : true, halign:'center'},
|
||||
{width : '140', title : '物料代码', field : 'materialcode', sortable : true, halign:'center'},
|
||||
{width : '120', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '120', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '120', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
onResize:function(){
|
||||
$('#gridsavedto').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#gridsavedto').datagrid('fixDetailRowHeight',index);
|
||||
},0);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function getGriddata(){
|
||||
var gridrows= $('#griderp').datagrid('getChecked');
|
||||
//console.log("gridrows",gridrows);
|
||||
var griddata= '[';
|
||||
$.each(gridrows, function(index, item){
|
||||
//console.log("item",item);
|
||||
if(index == 0){
|
||||
griddata+='{"id":"'+item.id+'","tasklistcode":"'+item.tasklistcode+'","billstatus":"'
|
||||
+item.billstatus+'","productno":"'+item.productno+'","prodamount":"'
|
||||
+item.prodamount+'","salesno":"'+item.salesno+'","pstdate":"'
|
||||
+item.pstdate+'","pendate":"'+item.pendate+'","billruntime":"'
|
||||
+item.billruntime+'","workshop":"'+item.workshop+'","tempfornosaleno":"'+item.tempfornosaleno+'"}';
|
||||
}
|
||||
else{
|
||||
griddata+=',{"id":"'+item.id+'","tasklistcode":"'+item.tasklistcode+'","billstatus":"'
|
||||
+item.billstatus+'","productno":"'+item.productno+'","prodamount":"'
|
||||
+item.prodamount+'","salesno":"'+item.salesno+'","pstdate":"'
|
||||
+item.pstdate+'","pendate":"'+item.pendate+'","billruntime":"'
|
||||
+item.billruntime+'","workshop":"'+item.workshop+'","tempfornosaleno":"'+item.tempfornosaleno+'"}';
|
||||
}
|
||||
});
|
||||
griddata+= ']';
|
||||
//console.log("griddata",griddata);
|
||||
return griddata;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<span>已导任务单中缺少前道工序 <a id="dd" href="javascript:void(0)">物料代码</a> 可能对应的ERP中未导入的任务单</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="toolbarsto" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<span>已导入任务单</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="mes" style="height:250px" >
|
||||
<table id="gridsavedto" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<div id="erp" style="height:250px" >
|
||||
<table id="griderp" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
330
bin/WebRoot/jsp/plan/importTaskorderList.jsp
Normal file
330
bin/WebRoot/jsp/plan/importTaskorderList.jsp
Normal file
@ -0,0 +1,330 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%request.setAttribute("TO_Flag_ERPConfirm",com.sipai.entity.plan.Taskorder.TO_Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("TO_Flag_Issued",com.sipai.entity.plan.Taskorder.TO_Flag_Issued);%>
|
||||
<%request.setAttribute("TO_Flag_Working",com.sipai.entity.plan.Taskorder.TO_Flag_Working);%>
|
||||
<%request.setAttribute("TO_Flag_Closed",com.sipai.entity.plan.Taskorder.TO_Flag_Closed);%>
|
||||
<%request.setAttribute("TO_Flag_Cancel",com.sipai.entity.plan.Taskorder.TO_Flag_Cancel);%>
|
||||
<%request.setAttribute("TO_Flag_NoPlan",com.sipai.entity.plan.Taskorder.TO_Flag_NoPlan);%>
|
||||
<%request.setAttribute("TO_Flag_ERPIssued",com.sipai.entity.plan.Taskorder.TO_Flag_ERPIssued);%>
|
||||
|
||||
<%request.setAttribute("Flag_ERPConfirm",com.sipai.entity.plan.Prodtask.Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("Flag_Issued",com.sipai.entity.plan.Prodtask.Flag_Issued);%>
|
||||
<%request.setAttribute("Flag_Working",com.sipai.entity.plan.Prodtask.Flag_Working);%>
|
||||
<%request.setAttribute("Flag_Finish",com.sipai.entity.plan.Prodtask.Flag_Finish);%>
|
||||
<%request.setAttribute("Flag_Closed",com.sipai.entity.plan.Prodtask.Flag_Closed);%>
|
||||
<%request.setAttribute("Flag_Cancel",com.sipai.entity.plan.Prodtask.Flag_Cancel);%>
|
||||
<%request.setAttribute("Flag_NoPlan",com.sipai.entity.plan.Prodtask.Flag_NoPlan);%>
|
||||
<%request.setAttribute("Flag_ERPIssued",com.sipai.entity.plan.Prodtask.Flag_ERPIssued);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
function dosave(dialog,grid) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/saveERPGridData.do",{griddata:getGriddata()},function(data1){
|
||||
if(JSON.parse(data1).bomres!=-1){//先判断BOM导入是否成功,失败则任务单和工艺都不导入
|
||||
console.log("process",JSON.parse(data1).jeprocesslist);
|
||||
if(JSON.parse(data1).jeprocesslist == null){//判断工艺是否成功导入,失败成功不影响任务单导入
|
||||
if(JSON.parse(data1).res!=-1){//判断任务单是否成功导入
|
||||
console.log("yes");
|
||||
top.$.messager.alert('提示', "任务单导入成功", 'info', function() {
|
||||
//console.log("JSON.parse(data1).bom",JSON.parse(data1).bom);
|
||||
if(JSON.parse(data1).bom != ""){//判断任务单导入是否缺少前道工序
|
||||
localStorage.setItem("erpmc", JSON.stringify(JSON.parse(data1).bom));
|
||||
localStorage.setItem("savetoid", JSON.stringify(JSON.parse(data1).savetoid));
|
||||
//console.log("er",JSON.parse(data1).bom);
|
||||
var secdialog = parent.ext.modalDialog({
|
||||
title : '选择任务',
|
||||
width: 900,
|
||||
height:550,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/taskorder/doimprelatederp.do',
|
||||
buttons : [ {
|
||||
text : '导入数据',
|
||||
handler : function() {
|
||||
secdialog.find('iframe').get(0).contentWindow.dosave(secdialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}
|
||||
else if(JSON.parse(data1).res == -1)
|
||||
{
|
||||
top.$.messager.alert('提示', '任务单导入失败'+JSON.parse(data1).jerrorlist+'未导入', 'info');
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
top.$.messager.alert('提示',JSON.parse(data1).jeprocesslist+ '工艺导入失败请手动导入工艺', 'info', function() {
|
||||
if(JSON.parse(data1).res!=-1){//判断任务单是否成功导入
|
||||
top.$.messager.alert('提示', "任务单导入成功", 'info', function() {
|
||||
//console.log("JSON.parse(data1).bom",JSON.parse(data1).bom);
|
||||
if(JSON.parse(data1).bom != ""){//判断任务单导入是否缺少前道工序
|
||||
localStorage.setItem("erpmc", JSON.stringify(JSON.parse(data1).bom));
|
||||
localStorage.setItem("savetoid", JSON.stringify(JSON.parse(data1).savetoid));
|
||||
//console.log("er",JSON.parse(data1).bom);
|
||||
var secdialog = parent.ext.modalDialog({
|
||||
title : '选择任务',
|
||||
width: 900,
|
||||
height:550,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/taskorder/doimprelatederp.do',
|
||||
buttons : [ {
|
||||
text : '导入数据',
|
||||
handler : function() {
|
||||
secdialog.find('iframe').get(0).contentWindow.dosave(secdialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}
|
||||
else if(JSON.parse(data1).res == -1)
|
||||
{
|
||||
top.$.messager.alert('提示', '任务单导入失败'+JSON.parse(data1).jerrorlist+'未导入', 'info');
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else{
|
||||
top.$.messager.alert('提示', '失败!产品编码为'+JSON.parse(data1).jebomlist+'的BOM导入失败请重新导入', 'info');
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
var flag=0;
|
||||
$(function() {
|
||||
$('#displayAllbtn').switchbutton({
|
||||
onChange: function(checked){
|
||||
if(checked==true){
|
||||
$('#notdisplayinvalid').val("1");
|
||||
}else{
|
||||
$('#notdisplayinvalid').val("0");
|
||||
}
|
||||
//alert($('#mm').switchbutton('options').checked);
|
||||
grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
}
|
||||
});
|
||||
|
||||
grid = $('#grid').datagrid({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/taskorder/importERPTask.do',
|
||||
striped : true,
|
||||
//pagination : true,
|
||||
rownumbers : true,
|
||||
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
frozenColumns:[[
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '任务单编号', field : 'tasklistcode', sortable : true, halign:'center'},
|
||||
{width : '80', title : '任务单状态', field : 'billstatus', sortable : true, align:'center',halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${TO_Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${TO_Flag_Issued}':
|
||||
return '下发';
|
||||
case '${TO_Flag_Working}':
|
||||
return '开工';
|
||||
case '${TO_Flag_Closed}':
|
||||
return '结案';
|
||||
case '${TO_Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${TO_Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${TO_Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
]],
|
||||
columns : [ [
|
||||
{width : '150', title : '产品编码', field : 'productno', sortable : true, align:'center',halign:'center'},
|
||||
{width : '130', title : '产品名称', field : 'productname', sortable : true, align:'center',halign:'center'},
|
||||
{width : '100', title : '产品数量', field : 'prodamount', sortable : true,align:'center', halign:'center'},
|
||||
{width : '130', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '140', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '140', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
|
||||
{width : '140', title : '任务单下达时间', field : 'billruntime', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(flag==0){
|
||||
flag=1;
|
||||
grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
}
|
||||
else{
|
||||
if($('#notdisplayinvalid').val() == "1"){
|
||||
//展开所有的行
|
||||
for(var i=0;i<data.rows.length;i++){
|
||||
$('#grid').datagrid('expandRow',i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
onExpandRow: function(index,row){
|
||||
ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddv.datagrid({
|
||||
url:ext.contextPath + '/plan/taskorder/getERPTask.do?salesno='+row.salesno+'&productno='+row.productno+'&workshop='+row.workshop+'&tempfornosaleno='+row.tempfornosaleno,
|
||||
fitColumns:true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
striped: true,
|
||||
idField : 'id',
|
||||
rownumbers:true,
|
||||
//loadMsg:'',
|
||||
height:'auto',
|
||||
columns : [ [
|
||||
|
||||
{width : '140', title : '任务编号', field : 'taskcode', sortable : true, halign:'center'},
|
||||
{width : '65', title : '执行状态', field : 'runstatus', sortable : true, halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${Flag_Issued}':
|
||||
return '下发';
|
||||
case '${Flag_Working}':
|
||||
return '开工';
|
||||
case '${Flag_Finish}':
|
||||
return '完成';
|
||||
case '${Flag_Closed}':
|
||||
return '结案';
|
||||
case '${Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '85', title : '计划生产数', field : 'planamount', sortable : true, halign:'center'},
|
||||
{width : '90', title : '生产车间', field : 'workshopname', sortable : true, halign:'center'},
|
||||
{width : '85', title : '物料名称', field : 'materialname', sortable : true, halign:'center'},
|
||||
{width : '140', title : '物料代码', field : 'materialcode', sortable : true, halign:'center'},
|
||||
{width : '120', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '120', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '120', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
onResize:function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},0);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function getGriddata(){
|
||||
var gridrows= $('#grid').datagrid('getChecked');
|
||||
//console.log("gridrows",gridrows);
|
||||
var griddata= '[';
|
||||
$.each(gridrows, function(index, item){
|
||||
//console.log("item",item);
|
||||
if(index == 0){
|
||||
griddata+='{"id":"'+item.id+'","tasklistcode":"'+item.tasklistcode+'","billstatus":"'
|
||||
+item.billstatus+'","productno":"'+item.productno+'","productname":"'+item.productname+'","prodamount":"'
|
||||
+item.prodamount+'","salesno":"'+item.salesno+'","pstdate":"'
|
||||
+item.pstdate+'","pendate":"'+item.pendate+'","billruntime":"'
|
||||
+item.billruntime+'","workshop":"'+item.workshop+'","tempfornosaleno":"'+item.tempfornosaleno+'"}';
|
||||
}
|
||||
else{
|
||||
griddata+=',{"id":"'+item.id+'","tasklistcode":"'+item.tasklistcode+'","billstatus":"'
|
||||
+item.billstatus+'","productno":"'+item.productno+'","productname":"'+item.productname+'","prodamount":"'
|
||||
+item.prodamount+'","salesno":"'+item.salesno+'","pstdate":"'
|
||||
+item.pstdate+'","pendate":"'+item.pendate+'","billruntime":"'
|
||||
+item.billruntime+'","workshop":"'+item.workshop+'","tempfornosaleno":"'+item.tempfornosaleno+'"}';
|
||||
}
|
||||
});
|
||||
griddata+= ']';
|
||||
//console.log("griddata",griddata);
|
||||
return griddata;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input name="idStr" type="hidden" />
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>产品编码</td>
|
||||
<td><input name="search_matercode" class="easyui-textbox" /></td>
|
||||
<td>销售单编号</td>
|
||||
<td><input name="search_salesno" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
<td><div class="datagrid-btn-separator"></div></td>
|
||||
<!-- <td>展开所有任务</td>
|
||||
<td><input id="displayAllbtn" class="easyui-switchbutton" style="height:22px;width:50px;"
|
||||
data-options="onText:'是',offText:'否'" unchecked></td>
|
||||
<td><input id="notdisplayinvalid" name="notdisplayinvalid" type="hidden" value="" /></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>
|
||||
173
bin/WebRoot/jsp/plan/importTaskorderbomList.jsp
Normal file
173
bin/WebRoot/jsp/plan/importTaskorderbomList.jsp
Normal file
@ -0,0 +1,173 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%request.setAttribute("TO_Flag_ERPConfirm",com.sipai.entity.plan.Taskorder.TO_Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("TO_Flag_Issued",com.sipai.entity.plan.Taskorder.TO_Flag_Issued);%>
|
||||
<%request.setAttribute("TO_Flag_Working",com.sipai.entity.plan.Taskorder.TO_Flag_Working);%>
|
||||
<%request.setAttribute("TO_Flag_Closed",com.sipai.entity.plan.Taskorder.TO_Flag_Closed);%>
|
||||
<%request.setAttribute("TO_Flag_Cancel",com.sipai.entity.plan.Taskorder.TO_Flag_Cancel);%>
|
||||
<%request.setAttribute("TO_Flag_NoPlan",com.sipai.entity.plan.Taskorder.TO_Flag_NoPlan);%>
|
||||
<%request.setAttribute("TO_Flag_ERPIssued",com.sipai.entity.plan.Taskorder.TO_Flag_ERPIssued);%>
|
||||
|
||||
<%request.setAttribute("Flag_ERPConfirm",com.sipai.entity.plan.Prodtask.Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("Flag_Issued",com.sipai.entity.plan.Prodtask.Flag_Issued);%>
|
||||
<%request.setAttribute("Flag_Working",com.sipai.entity.plan.Prodtask.Flag_Working);%>
|
||||
<%request.setAttribute("Flag_Finish",com.sipai.entity.plan.Prodtask.Flag_Finish);%>
|
||||
<%request.setAttribute("Flag_Closed",com.sipai.entity.plan.Prodtask.Flag_Closed);%>
|
||||
<%request.setAttribute("Flag_Cancel",com.sipai.entity.plan.Prodtask.Flag_Cancel);%>
|
||||
<%request.setAttribute("Flag_NoPlan",com.sipai.entity.plan.Prodtask.Flag_NoPlan);%>
|
||||
<%request.setAttribute("Flag_ERPIssued",com.sipai.entity.plan.Prodtask.Flag_ERPIssued);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
function dosave(dialog,gridad) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/saveERPbom.do",{griddata:getGriddata()},function(data){
|
||||
if(JSON.parse(data).tot==1){
|
||||
parent.$.messager.alert('提示','bom同步成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','未同步成功的'+JSON.parse(data).suc+'请手动同步','info');
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
var flag=0;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
/* view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
}, */
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/taskorder/importERPTaskbom.do',
|
||||
striped : true,
|
||||
pagination : true,
|
||||
rownumbers : true,
|
||||
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
frozenColumns:[[
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '任务单编号', field : 'tasklistcode', sortable : true, halign:'center'},
|
||||
{width : '80', title : '任务单状态', field : 'billstatus', sortable : true, align:'center',halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${TO_Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${TO_Flag_Issued}':
|
||||
return '下发';
|
||||
case '${TO_Flag_Working}':
|
||||
return '开工';
|
||||
case '${TO_Flag_Closed}':
|
||||
return '结案';
|
||||
case '${TO_Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${TO_Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${TO_Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
]],
|
||||
columns : [ [
|
||||
{width : '150', title : '产品编码', field : 'productno', sortable : true, align:'center',halign:'center'},
|
||||
{width : '100', title : '产品数量', field : 'prodamount', sortable : true,align:'center', halign:'center'},
|
||||
/* {width : '130', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '140', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '140', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},*/
|
||||
|
||||
{width : '140', title : '任务单下达时间', field : 'billruntime', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0)
|
||||
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
function getGriddata(){
|
||||
var gridrows= $('#grid').datagrid('getChecked');
|
||||
//console.log("gridrows",gridrows);
|
||||
var griddata= '[';
|
||||
$.each(gridrows, function(index, item){
|
||||
//console.log("item",item);
|
||||
if(index == 0){
|
||||
griddata+='{"id":"'+item.id+'","tasklistcode":"'+item.tasklistcode+'","billstatus":"'
|
||||
+item.billstatus+'","productno":"'+item.productno+'","prodamount":"'
|
||||
+item.prodamount+'","salesno":"'+item.salesno+'","pstdate":"'
|
||||
+item.pstdate+'","pendate":"'+item.pendate+'","billruntime":"'
|
||||
+item.billruntime+'","workshop":"'+item.workshop+'","tempfornosaleno":"'+item.tempfornosaleno+'"}';
|
||||
}
|
||||
else{
|
||||
griddata+=',{"id":"'+item.id+'","tasklistcode":"'+item.tasklistcode+'","billstatus":"'
|
||||
+item.billstatus+'","productno":"'+item.productno+'","prodamount":"'
|
||||
+item.prodamount+'","salesno":"'+item.salesno+'","pstdate":"'
|
||||
+item.pstdate+'","pendate":"'+item.pendate+'","billruntime":"'
|
||||
+item.billruntime+'","workshop":"'+item.workshop+'","tempfornosaleno":"'+item.tempfornosaleno+'"}';
|
||||
}
|
||||
});
|
||||
griddata+= ']';
|
||||
//console.log("griddata",griddata);
|
||||
return griddata;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input name="idStr" type="hidden" />
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<!-- <td>任务单编号</td>
|
||||
<td><input name="search_tocode" class="easyui-textbox" /></td> -->
|
||||
<td>产品编码</td>
|
||||
<td><input name="search_productno" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
<!-- <td><div class="datagrid-btn-separator"></div></td>
|
||||
<td>展开所有任务</td>
|
||||
<td><input id="displayAllbtn" class="easyui-switchbutton" style="height:22px;width:50px;"
|
||||
data-options="onText:'是',offText:'否'" unchecked></td>
|
||||
<td><input id="notdisplayinvalid" name="notdisplayinvalid" type="hidden" value="" /></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>
|
||||
135
bin/WebRoot/jsp/plan/materialDeliverAdd.jsp
Normal file
135
bin/WebRoot/jsp/plan/materialDeliverAdd.jsp
Normal file
@ -0,0 +1,135 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/materialdeliver/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
parent.$("#mainFrame").attr("src",ext.contextPath+"/plan/materialdeliver/distribute.do?id="+data.id);
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function selectDailyplan(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择日计划',
|
||||
width : 800,
|
||||
height : 480,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/dailyplansummary/select.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#dailyplanid").val((res.id == 'undefined')?'':res.id);
|
||||
$("#dailyplan").textbox('setValue',(res.name == 'undefined')?'':res.name);
|
||||
$("#dailyplandt").html((res.plandt == 'undefined')?'':res.plandt.substring(0,10));
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function selectWorkstation(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择工位',
|
||||
width : 800,
|
||||
height : 480,
|
||||
resizable:true,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/work/workstation/showlistForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#workstationid").val((res.id== 'undefined')?'':res.id);
|
||||
$("#workstationname").textbox('setValue',(res.name == 'undefined')?'':res.name);
|
||||
$("#workstationserial").html((res.serial == 'undefined')?'':res.serial);
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#dailyplan").textbox("textbox").bind("click",function(){
|
||||
selectDailyplan();
|
||||
});
|
||||
$("#workstationname").textbox("textbox").bind("click",function(){
|
||||
selectWorkstation();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tt">
|
||||
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
|
||||
</div>
|
||||
<div class="easyui-panel" title="新增配送任务" style="padding:10px;"
|
||||
data-options="tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input id="status" name="status" type="hidden" value="0"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>计划信息</th>
|
||||
<td>
|
||||
<input id="dailyplanid" name="dailyplanid" type="hidden" value=""/>
|
||||
<input id="dailyplan" name="dailyplan" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="" /></td>
|
||||
<th>计划日期</th>
|
||||
<td><span id="dailyplandt"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>所属工位</th>
|
||||
<td>
|
||||
<input id="workstationid" name="workstationid" type="hidden" value=""/>
|
||||
<input id="workstationname" name="workstationname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="" />
|
||||
</td>
|
||||
<th>工位编号</th>
|
||||
<td><span id="workstationserial"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >配送开始时间</th>
|
||||
<td ><input id="starttime" name="starttime" class="Wdate" value="${fn:substring(nowdate,0,16) }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'%y-%M-%d'})"
|
||||
readonly></td>
|
||||
<th >配送截至时间</th>
|
||||
<td ><input id="endtime" name="endtime" class="Wdate" value="${fn:substring(nowdate,0,16) }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'#F{$dp.$D(\'starttime\')}'})"
|
||||
readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td colspan="3">
|
||||
<input id="remark" name="remark" class="easyui-textbox" value=""
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
data-options="multiline:true" style="width:100%;height:100px"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
63
bin/WebRoot/jsp/plan/materialDeliverDistribute.jsp
Normal file
63
bin/WebRoot/jsp/plan/materialDeliverDistribute.jsp
Normal file
@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
showdetailsFun('${materialDeliver.id }');
|
||||
});
|
||||
var showdetailsFun = function(pid) {
|
||||
$("#rightFrameProcessor").attr("src",ext.contextPath+"/plan/deliverprocessor/showlist.do?pid="+pid);
|
||||
$("#rightFrameMaterial").attr("src",ext.contextPath+"/plan/deliverdetail/showlist.do?pid="+pid);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="easyui-panel" title="配送任务" style="padding:10px;"
|
||||
data-options="tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${materialDeliver.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>计划信息</th>
|
||||
<td>${materialDeliver.dailyPlanSummary.name }</td>
|
||||
<th>计划日期</th>
|
||||
<td>${fn:substring(materialDeliver.dailyPlanSummary.plandt,0,10) }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>所属工位</th>
|
||||
<td>${materialDeliver.workstation.name }</td>
|
||||
<th>工位编号</th>
|
||||
<td>${materialDeliver.workstation.serial }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >配送开始时间</th>
|
||||
<td >${fn:substring(materialDeliver.starttime,0,16) }</td>
|
||||
<th >配送截至时间</th>
|
||||
<td >${fn:substring(materialDeliver.endtime,0,16) }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td colspan="3"><input id="remark" name="remark" class="easyui-textbox" value="${materialDeliver.remark }"
|
||||
data-options="multiline:true,editable:false" style="width:100%;height:100px"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<br/>
|
||||
<div id="tooltab" class="easyui-tabs" style="height:300px;">
|
||||
<div title="配料详情">
|
||||
<iframe id="rightFrameMaterial" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<div title="配料人员">
|
||||
<iframe id="rightFrameProcessor" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
129
bin/WebRoot/jsp/plan/materialDeliverEdit.jsp
Normal file
129
bin/WebRoot/jsp/plan/materialDeliverEdit.jsp
Normal file
@ -0,0 +1,129 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/materialdeliver/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function selectDailyplan(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择日计划',
|
||||
width : 700,
|
||||
height : 480,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/dailyplansummary/select.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#dailyplanid").val((res.id == 'undefined')?'':res.id);
|
||||
$("#dailyplan").textbox('setValue',(res.name == 'undefined')?'':res.name);
|
||||
$("#dailyplandt").html((res.plandt == 'undefined')?'':res.plandt.substring(0,10));
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function selectWorkstation(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择工位',
|
||||
width : 700,
|
||||
height : 480,
|
||||
resizable:true,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/work/workstation/showlistForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#workstationid").val((res.id== 'undefined')?'':res.id);
|
||||
$("#workstationname").textbox('setValue',(res.name == 'undefined')?'':res.name);
|
||||
$("#workstationserial").html((res.serial == 'undefined')?'':res.serial);
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#dailyplan").textbox("textbox").bind("click",function(){
|
||||
selectDailyplan();
|
||||
});
|
||||
$("#workstationname").textbox("textbox").bind("click",function(){
|
||||
selectWorkstation();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${materialDeliver.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>计划信息</th>
|
||||
<td>
|
||||
<input id="dailyplanid" name="dailyplanid" type="hidden" value="${materialDeliver.dailyPlanSummary.id }"/>
|
||||
<input id="dailyplan" name="dailyplan" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="${materialDeliver.dailyPlanSummary.name }" /></td>
|
||||
<th>计划日期</th>
|
||||
<td><span id="dailyplandt">${fn:substring(materialDeliver.dailyPlanSummary.plandt,0,10) }</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>所属工位</th>
|
||||
<td>
|
||||
<input id="workstationid" name="workstationid" type="hidden" value="${materialDeliver.workstation.id }"/>
|
||||
<input id="workstationname" name="workstationname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="${materialDeliver.workstation.name }" />
|
||||
</td>
|
||||
<th>工位编号</th>
|
||||
<td><span id="workstationserial">${materialDeliver.workstation.serial }</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >配送开始时间</th>
|
||||
<td ><input id="starttime" name="starttime" class="Wdate" value="${fn:substring(materialDeliver.starttime,0,16) }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'%y-%M-%d'})"
|
||||
readonly></td>
|
||||
<th >配送截至时间</th>
|
||||
<td ><input id="endtime" name="endtime" class="Wdate" value="${fn:substring(materialDeliver.endtime,0,16) }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'#F{$dp.$D(\'starttime\')}'})"
|
||||
readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td colspan="3">
|
||||
<input id="remark" name="remark" class="easyui-textbox" value="${materialDeliver.remark }" validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
data-options="multiline:true" style="width:100%;height:100px"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
270
bin/WebRoot/jsp/plan/materialDeliverList.jsp
Normal file
270
bin/WebRoot/jsp/plan/materialDeliverList.jsp
Normal file
@ -0,0 +1,270 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '物料配送任务',
|
||||
url : ext.contextPath + '/plan/materialdeliver/addMaterialMission.do',
|
||||
onClose : function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看物料配送任务',
|
||||
url : ext.contextPath + '/plan/materialdeliver/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑物料配送任务',
|
||||
url : ext.contextPath + '/plan/materialdeliver/edit.do?id=' + id,
|
||||
onClose : function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var distributeFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '分配物料配送任务',
|
||||
url : ext.contextPath + '/plan/materialdeliver/distribute.do?id=' + id,
|
||||
onClose : function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var deliverFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要下发此任务?下发后将不可修改任务信息', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/materialdeliver/deliver.do', {id : id}, function(data) {
|
||||
if(data.result==1){
|
||||
parent.$.messager.alert('提示','下发成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.messager.alert('提示',data.feedback,'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
};
|
||||
var revokeFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要撤回此任务?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/materialdeliver/revoke.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','撤回成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','撤回失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/materialdeliver/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.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{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/materialdeliver/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/materialdeliver/getMaterialDelivers.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '计划名称', field : 'planname', halign:'center', formatter : function(value, row){
|
||||
if(row.dailyPlanSummary!=null){
|
||||
return row.dailyPlanSummary.name;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '100', title : '计划日期', field : 'plandt', align:'center', formatter : function(value, row){
|
||||
if(row.dailyPlanSummary!=null){
|
||||
return row.dailyPlanSummary.plandt.length>10?row.dailyPlanSummary.plandt.substring(0,10):"";
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '归属工位', field : 'workstationname', halign:'center', formatter : function(value, row){
|
||||
if(row.workstation!=null){
|
||||
return row.workstation.name;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '工位编号', field : 'workstationserial', halign:'center', formatter : function(value, row){
|
||||
if(row.workstation!=null){
|
||||
return row.workstation.serial;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '开始时间', field : 'starttime', align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.length>10?value.substring(0,16):"";
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '结束时间', field : 'endtime', align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.length>10?value.substring(0,16):"";
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '状态', field : 'status', sortable : true, align:'center', formatter : function(value, row){
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '制定中';
|
||||
case '1':
|
||||
return '已下发';
|
||||
case '2':
|
||||
return '配送中';
|
||||
case '3':
|
||||
return '已完成';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/>';
|
||||
if(row.status=='0'){
|
||||
<%if (sessionManager.havePermission(session,"plan/materialdeliver/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/materialdeliver/distribute.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_link" title="分配" onclick="distributeFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/materialdeliver/deliver.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_go" title="下发" onclick="deliverFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/materialdeliver/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
}
|
||||
if(row.status=='1'||row.status=='2'){
|
||||
<%if (sessionManager.havePermission(session,"plan/materialdeliver/revoke.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-arrow_rotate_clockwise" title="撤回" onclick="revokeFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
</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,"plan/materialrecover/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,"plan/materialrecover/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">
|
||||
<input name="idStr" type="hidden" />
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位名称</td>
|
||||
<td><input name="search_workstationname" class="easyui-textbox" /></td>
|
||||
<td>工位编号</td>
|
||||
<td><input name="search_workstationserial" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');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>
|
||||
</body>
|
||||
</html>
|
||||
62
bin/WebRoot/jsp/plan/materialDeliverView.jsp
Normal file
62
bin/WebRoot/jsp/plan/materialDeliverView.jsp
Normal file
@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
showdetailsFun('${materialDeliver.id }');
|
||||
});
|
||||
var showdetailsFun = function(pid) {
|
||||
$("#rightFrameMaterial").attr("src",ext.contextPath+"/plan/deliverdetail/showviewlist.do?pid="+pid);
|
||||
$("#rightFrameProcessor").attr("src",ext.contextPath+"/plan/deliverprocessor/showviewlist.do?pid="+pid);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="easyui-panel" title="配送任务" style="padding:10px;">
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${materialDeliver.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>计划信息</th>
|
||||
<td>${materialDeliver.dailyPlanSummary.name }</td>
|
||||
<th>计划日期</th>
|
||||
<td>${fn:substring(materialDeliver.dailyPlanSummary.plandt,0,10) }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>所属工位</th>
|
||||
<td>${materialDeliver.workstation.name }</td>
|
||||
<th>工位编号</th>
|
||||
<td>${materialDeliver.workstation.serial }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >配送开始时间</th>
|
||||
<td >${fn:substring(materialDeliver.starttime,0,16) }</td>
|
||||
<th >配送截至时间</th>
|
||||
<td >${fn:substring(materialDeliver.endtime,0,16) }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td colspan="3"><input id="remark" name="remark" class="easyui-textbox" value="${materialDeliver.remark }"
|
||||
data-options="multiline:true,editable:false" style="width:100%;height:100px"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<br/>
|
||||
<div id="tooltab" class="easyui-tabs" style="height:300px;">
|
||||
<div title="配料详情">
|
||||
<iframe id="rightFrameMaterial" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<div title="配料人员">
|
||||
<iframe id="rightFrameProcessor" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
19
bin/WebRoot/jsp/plan/materialMission.jsp
Normal file
19
bin/WebRoot/jsp/plan/materialMission.jsp
Normal file
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#mainFrame").attr("src",ext.contextPath+"/plan/materialdeliver/add.do");
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="easyui-layout" data-options="fit:true">
|
||||
<iframe id="mainFrame" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;" frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
133
bin/WebRoot/jsp/plan/materialPlanCalendar.jsp
Normal file
133
bin/WebRoot/jsp/plan/materialPlanCalendar.jsp
Normal file
@ -0,0 +1,133 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/233/bkf2ntm7/jquery.fullcalendar.js?v=0.7"></script>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<style scoped="scoped">
|
||||
.md{
|
||||
background-position:2px center;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
font-size:20px;
|
||||
padding:0 2px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var grid;
|
||||
var configDeliver = function(planid) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '配料计划管理',
|
||||
url : ext.contextPath + '/plan/materialdeliver/showlist.do?planid='+planid
|
||||
});
|
||||
};
|
||||
var showPlan = function(sdt,edt) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看物料计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
//url : ext.contextPath + '/plan/materialplan/showplan.do?&planid='+planid
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showorderlist.do?&sdt='+sdt+'&edt='+edt+'&pageflag=materialplan',
|
||||
});
|
||||
};
|
||||
function getNextFormatDate() {
|
||||
var nowdate = new Date();
|
||||
var seperator1 = "-";
|
||||
var seperator2 = ":";
|
||||
nowdate=nowdate.valueOf()+1000*60*60*24;
|
||||
var date = new Date(nowdate);
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var nextdate = year + seperator1 + month + seperator1 + strDate;
|
||||
return nextdate;
|
||||
}
|
||||
var refreshcalerdar=function(){
|
||||
var month=$('#cc').calendar('options')['month'];
|
||||
var year=$('#cc').calendar('options')['year'];
|
||||
var btext="";
|
||||
$.post(ext.contextPath + '/plan/materialplan/getCalendarData.do',{year:year,month:month}, function(data) {
|
||||
var obj = JSON.parse(data);
|
||||
var materialPlan=obj.materialPlan;
|
||||
$('#cc').calendar({
|
||||
formatter: function(date){
|
||||
btext="";
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth()+1;
|
||||
var y = date.getFullYear();
|
||||
var tempm="";
|
||||
var tempd="";
|
||||
if (m >= 1 && m <= 9) {
|
||||
tempm = "0";
|
||||
}
|
||||
if (d >= 0 && d <= 9) {
|
||||
tempd = "0";
|
||||
}
|
||||
var sdt = y+"-"+tempm+m+"-"+tempd+d+" 00:00:00";
|
||||
var edt = y+"-"+tempm+m+"-"+tempd+d+" 23:59:59";
|
||||
var flag = true;
|
||||
for(var j=0;j<materialPlan.length;j++)
|
||||
{
|
||||
var plandt=materialPlan[j].plandt;
|
||||
var wsmonth=String(parseInt(plandt.substring(5,7)));
|
||||
var wsday=String(parseInt(plandt.substring(8,10)));
|
||||
if(m==wsmonth && d==wsday){
|
||||
//btext+='<a class="easyui-linkbutton" style="font-weight:bold;color:blue;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="configDeliver(\''+materialPlan[j].id+'\')">配置</a>';
|
||||
btext+='  '+'<a class="easyui-linkbutton" style="font-weight:bold;color:blue;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="showPlan(\''+sdt+'\',\''+edt+'\')">查看</a>';
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(flag){
|
||||
/* btext+='<a class="easyui-linkbutton" style="color:gray;font-size:16px;" onclick="alert(\'无对应日计划\')">配置</a>'; */
|
||||
btext+='  '+'<a class="easyui-linkbutton" style="color:gray;font-size:16px;" onclick="alert(\'无对应日计划\')">查看</a>';
|
||||
}
|
||||
|
||||
var bt='<div class="md" style="font-size:26px;" >'+d+'</div>';
|
||||
bt=bt+btext;
|
||||
return bt;
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
var lastcolor;
|
||||
var changeback1=function(obj){
|
||||
lastcolor=obj.style.color.toLowerCase();
|
||||
obj.style.color=obj.style.color.toLowerCase()=='red'?lastcolor:'red';
|
||||
};
|
||||
var changeback2=function(obj){
|
||||
obj.style.color=obj.style.color.toLowerCase()=='red'?lastcolor:'red';
|
||||
};
|
||||
$(function() {
|
||||
refreshcalerdar();
|
||||
|
||||
$('#cc div.calendar-nav').click(function () {
|
||||
//setTimeout产生异步效果
|
||||
setTimeout("refreshcalerdar()",0);
|
||||
});
|
||||
$('#cc div.calendar-menu-month-inner').click(function () {
|
||||
setTimeout("refreshcalerdar()",0);
|
||||
});
|
||||
|
||||
$(".calendar-title .calendar-text").css("fontSize","18px");
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" style="font-family:微软雅黑">
|
||||
<div class="easyui-panel" data-options="fit:true" style="padding:2px;">
|
||||
<div id="cc" class="easyui-calendar" data-options="fit:true" ></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
115
bin/WebRoot/jsp/plan/materialPlanForSelect.jsp
Normal file
115
bin/WebRoot/jsp/plan/materialPlanForSelect.jsp
Normal file
@ -0,0 +1,115 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/materialplan/getmaterialplan.do?pid=${pid}&planid=${planid}&workstationid=${workstationid}&random=Math.random()',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'materialid',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
idField : 'materialid',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '物料编码', field : 'materialcode', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '250', title : '物料名称', field : 'materialname', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '90', title : '总计划量', field : 'amount', halign:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
if(value>0){
|
||||
return value+" "+row.unit;
|
||||
}
|
||||
return "";
|
||||
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item.materialcode==""||item.materialcode==undefined){
|
||||
//移除不合理数据
|
||||
$('#grid').datagrid('deleteRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
function selectOK() {
|
||||
//以json格式返回数据
|
||||
var jsonstr = "";
|
||||
var row = $('#grid').datagrid('getSelected');
|
||||
if (row){
|
||||
jsonstr = '{"materialid":"'+row.materialid
|
||||
+'","materialcode":"'+row.materialcode
|
||||
+'","materialname":"'+row.materialname
|
||||
+'","materialamount":"'+row.amount
|
||||
+'","materialunit":"'+row.unit
|
||||
+'"}';
|
||||
var dataset = $.parseJSON(jsonstr);
|
||||
return dataset;
|
||||
}else{
|
||||
top.$.messager.alert('提示', "请选择要使用的数据!", 'info');
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>物料编码</td>
|
||||
<td><input name="search_materialcode" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');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>
|
||||
</body>
|
||||
</html>
|
||||
108
bin/WebRoot/jsp/plan/materialPlanView.jsp
Normal file
108
bin/WebRoot/jsp/plan/materialPlanView.jsp
Normal file
@ -0,0 +1,108 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplansummarymaterial/getDailyPlanSummaryMaterials.do?planid=${dailyPlanSummary.id}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{width : '100', title : '工位编号', field: 'workstation', sortable : true, align:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.serial;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '150', title : '工位名称', field: 'workstationname', sortable : true, align:'center' , formatter : function(value, row){
|
||||
if(row.workstation!=null){
|
||||
return row.workstation.name;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '150', title : '物料编码', field : 'materialinfo', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.materialcode;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '260', title : '物料名称', field : 'materialname', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
if(row.materialinfo!=null){
|
||||
return row.materialinfo.materialname;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '90', title : '总计划量', field : 'amount', halign:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
if(value>0){
|
||||
if(row.materialinfo.unit!=null){
|
||||
return value+" "+row.materialinfo.unit;
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
return "";
|
||||
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位编号</td>
|
||||
<td><input name="search_workstationserial" class="easyui-textbox" /></td>
|
||||
<td>物料编码</td>
|
||||
<td><input name="search_materialcode" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');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>
|
||||
</body>
|
||||
</html>
|
||||
171
bin/WebRoot/jsp/plan/materialRecoverAdd.jsp
Normal file
171
bin/WebRoot/jsp/plan/materialRecoverAdd.jsp
Normal file
@ -0,0 +1,171 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/materialrecover/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function selectDailyplan(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择日计划',
|
||||
width : 800,
|
||||
height : 480,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/dailyplansummary/select.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#dailyplanid").val((res.id == 'undefined')?'':res.id);
|
||||
$("#dailyplan").textbox('setValue',(res.name == 'undefined')?'':res.name);
|
||||
$("#dailyplandt").html((res.plandt == 'undefined')?'':res.plandt.substring(0,10));
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function selectMaterial(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择材料',
|
||||
width : 800,
|
||||
height : 400,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/material/materialinfo/selectMaterial.do?typename=1',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#materialid").val((res.materialid == 'undefined')?'':res.materialid);
|
||||
$("#materialcode").textbox('setValue',(res.materialcode == 'undefined')?'':res.materialcode);
|
||||
$("#materialname").html((res.materialname == 'undefined')?'':res.materialname);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function selectWorkstation(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择工位',
|
||||
width : 800,
|
||||
height : 480,
|
||||
resizable:true,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/work/workstation/showlistForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#workstationid").val((res.id== 'undefined')?'':res.id);
|
||||
$("#workstationname").textbox('setValue',(res.name == 'undefined')?'':res.name);
|
||||
$("#workstationserial").html((res.serial == 'undefined')?'':res.serial);
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#dailyplan").textbox("textbox").bind("click",function(){
|
||||
selectDailyplan();
|
||||
});
|
||||
$("#materialcode").textbox("textbox").bind("click",function(){
|
||||
selectMaterial();
|
||||
});
|
||||
$("#workstationname").textbox("textbox").bind("click",function(){
|
||||
selectWorkstation();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>计划信息</th>
|
||||
<td>
|
||||
<input id="dailyplanid" name="dailyplanid" type="hidden" value=""/>
|
||||
<input id="dailyplan" name="dailyplan" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划日期</th>
|
||||
<td><span id="dailyplandt"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料编码</th>
|
||||
<td>
|
||||
<input id="materialid" name="materialid" type="hidden" value=""/>
|
||||
<input id="materialcode" name="materialcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<td><span id="materialname"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>所属工位</th>
|
||||
<td>
|
||||
<input id="workstationid" name="workstationid" type="hidden" value=""/>
|
||||
<input id="workstationname" name="workstationname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工位编号</th>
|
||||
<td><span id="workstationserial"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>回收量</th>
|
||||
<td>
|
||||
<input id="recovernum" name="recovernum" class="easyui-numberbox"
|
||||
min="1" max="10000" precision="0" required="true" missingMessage="请填写数字"
|
||||
data-options="required:true,validType:'isBlank'" value="" autofocus/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td >
|
||||
<input id="memo" name="memo"class="easyui-textbox" style="width:100%;height:100px"
|
||||
value=""data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
170
bin/WebRoot/jsp/plan/materialRecoverEdit.jsp
Normal file
170
bin/WebRoot/jsp/plan/materialRecoverEdit.jsp
Normal file
@ -0,0 +1,170 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/materialrecover/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function selectDailyplan(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择日计划',
|
||||
width : 800,
|
||||
height : 480,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/dailyplansummary/select.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#dailyplanid").val((res.id == 'undefined')?'':res.id);
|
||||
$("#dailyplan").textbox('setValue',(res.name == 'undefined')?'':res.name);
|
||||
$("#dailyplandt").html((res.plandt == 'undefined')?'':res.plandt.substring(0,10));
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function selectMaterial(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择材料',
|
||||
width : 800,
|
||||
height : 400,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/material/materialinfo/selectMaterial.do?typename=1',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#materialid").val((res.materialid == 'undefined')?'':res.materialid);
|
||||
$("#materialcode").textbox('setValue',(res.materialcode == 'undefined')?'':res.materialcode);
|
||||
$("#materialname").html((res.materialname == 'undefined')?'':res.materialname);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function selectWorkstation(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择工位',
|
||||
width : 800,
|
||||
height : 480,
|
||||
resizable:true,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/work/workstation/showlistForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#workstationid").val((res.id== 'undefined')?'':res.id);
|
||||
$("#workstationname").textbox('setValue',(res.name == 'undefined')?'':res.name);
|
||||
$("#workstationserial").html((res.serial == 'undefined')?'':res.serial);
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#dailyplan").textbox("textbox").bind("click",function(){
|
||||
selectDailyplan();
|
||||
});
|
||||
$("#materialcode").textbox("textbox").bind("click",function(){
|
||||
selectMaterial();
|
||||
});
|
||||
$("#workstationname").textbox("textbox").bind("click",function(){
|
||||
selectWorkstation();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${materialRecover.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>计划信息</th>
|
||||
<td>
|
||||
<input id="dailyplanid" name="dailyplanid" type="hidden" value="${materialRecover.dailyPlanSummary.id }"/>
|
||||
<input id="dailyplan" name="dailyplan" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="${materialRecover.dailyPlanSummary.name }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划日期</th>
|
||||
<td><span id="dailyplandt">${fn:substring(materialRecover.dailyPlanSummary.plandt,0,10) }</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料编码</th>
|
||||
<td>
|
||||
<input id="materialid" name="materialid" type="hidden" value="${materialRecover.materialInfo.id }"/>
|
||||
<input id="materialcode" name="materialcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="${materialRecover.materialInfo.materialcode }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<td><span id="materialname">${materialRecover.materialInfo.materialname }</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>所属工位</th>
|
||||
<td>
|
||||
<input id="workstationid" name="workstationid" type="hidden" value="${materialRecover.workstation.id }"/>
|
||||
<input id="workstationname" name="workstationname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',editable:false" value="${materialRecover.workstation.name }" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工位编码</th>
|
||||
<td><span id="workstationserial">${materialRecover.workstation.serial }</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>回收量</th>
|
||||
<td>
|
||||
<input id="recovernum" name="recovernum" class="easyui-textbox" value="${materialRecover.recovernum}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td >
|
||||
<input id="memo" name="memo" class="easyui-textbox" value="${materialRecover.memo }" validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
data-options="multiline:true" style="width:100%;height:100px"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
237
bin/WebRoot/jsp/plan/materialRecoverList.jsp
Normal file
237
bin/WebRoot/jsp/plan/materialRecoverList.jsp
Normal file
@ -0,0 +1,237 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加物料回收情况',
|
||||
url : ext.contextPath + '/plan/materialrecover/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看物料回收情况',
|
||||
url : ext.contextPath + '/plan/materialrecover/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑物料回收情况',
|
||||
url : ext.contextPath + '/plan/materialrecover/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/materialrecover/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.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{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/materialrecover/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/materialrecover/getMaterialRecovers.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '120', title : '计划名称', field : 'planname', halign:'center', formatter : function(value, row){
|
||||
if(row.dailyPlanSummary!=null){
|
||||
return row.dailyPlanSummary.name;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '80', title : '计划日期', field : 'plandt', align:'center', formatter : function(value, row){
|
||||
if(row.dailyPlanSummary!=null){
|
||||
return row.dailyPlanSummary.plandt.length>10?row.dailyPlanSummary.plandt.substring(0,10):"";
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '物料编码', field : 'materialcode', align:'center', formatter : function(value, row){
|
||||
if(row.materialInfo!=null){
|
||||
return row.materialInfo.materialcode;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '物料名称', field : 'materialname', align:'center', formatter : function(value, row){
|
||||
if(row.materialInfo!=null){
|
||||
return row.materialInfo.materialname;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '归属工位', field : 'workstationname', align:'center', formatter : function(value, row){
|
||||
if(row.workstation!=null){
|
||||
return row.workstation.name;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '工位编号', field : 'workstationserial', align:'center', formatter : function(value, row){
|
||||
if(row.workstation!=null){
|
||||
return row.workstation.serial;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '回收量', field : 'recovernum', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
var unit="";
|
||||
if(row.materialInfo!=null){
|
||||
unit = row.materialInfo.unit;
|
||||
}
|
||||
return value+" "+unit;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '80', title : '回收人', field : 'recover', align:'center', formatter : function(value, row){
|
||||
if(row.recover!=null){
|
||||
return row.recover.name;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '100', title : '回收时间', field : 'recovertime', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.length>16?value.substring(0,16):value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
|
||||
{title : '操作', field : 'action', width : '120', 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/materialrecover/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/materialrecover/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
</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,"plan/materialrecover/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,"plan/materialrecover/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">
|
||||
<input name="idStr" type="hidden" />
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位编号</td>
|
||||
<td><input name="search_workstationserial" class="easyui-textbox" /></td>
|
||||
<td>物料编码</td>
|
||||
<td><input name="search_materialcode" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');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>
|
||||
</body>
|
||||
</html>
|
||||
49
bin/WebRoot/jsp/plan/materialRecoverView.jsp
Normal file
49
bin/WebRoot/jsp/plan/materialRecoverView.jsp
Normal file
@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<style>
|
||||
body{ text-align:center}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>日计划名称</th>
|
||||
<td>${materialRecover.dailyPlanSummary==null?"":materialRecover.dailyPlanSummary.name }</td>
|
||||
<th>计划日期</th>
|
||||
<td>${materialRecover.dailyPlanSummary==null?"":fn:substring(materialRecover.dailyPlanSummary.plandt,0,10)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<td>${materialRecover.materialInfo==null?"":materialRecover.materialInfo.materialname }</td>
|
||||
<th>物料编码</th>
|
||||
<td>${materialRecover.materialInfo==null?"":materialRecover.materialInfo.materialcode }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>所属工位</th>
|
||||
<td>${materialRecover.workstation==null?"":materialRecover.workstation.name }</td>
|
||||
<th>工位编码</th>
|
||||
<td>${materialRecover.workstation==null?"":materialRecover.workstation.serial }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>回收人</th>
|
||||
<td>${materialRecover.recover==null?"":materialRecover.recover.name }</td>
|
||||
<th>回收时间</th>
|
||||
<td>${materialRecover.recovertime==null?"":fn:substring(materialRecover.recovertime,0,16)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>回收量</th>
|
||||
<td>${materialRecover.recovernum} ${materialRecover.materialInfo==null?"":materialRecover.materialInfo.unit }</td>
|
||||
<th>备注</th>
|
||||
<td>${materialRecover.memo }</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
398
bin/WebRoot/jsp/plan/planDayList.jsp
Normal file
398
bin/WebRoot/jsp/plan/planDayList.jsp
Normal file
@ -0,0 +1,398 @@
|
||||
<%@ 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"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var ddv;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '新增日计划',
|
||||
url : ext.contextPath + '/plan/dailyplan/add.do',
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '下发',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dodistribute(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);
|
||||
}
|
||||
}]
|
||||
});
|
||||
ddv.datagrid('reload');
|
||||
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
width: 800,
|
||||
height:620,
|
||||
title : '编辑日计划',
|
||||
url : ext.contextPath + '/plan/dailyplan/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '下发',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dodistribute(dialog, grid);
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '作废',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.invalidate(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({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/dailyplan/getlist.do?flag=listpage',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '250', title : '销售订单号', field : 'salesorderno', sortable : true, halign:'center'},
|
||||
{width : '290', title : '产品名称', field : 'product', sortable : true, halign:'center',formatter : function(value,row){
|
||||
if(value!=null){
|
||||
return value.materialname;
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
}},
|
||||
{width : '250', title : '订单产品数量', field : 'productnum', sortable : true, halign:'center'},
|
||||
{width : '250', title : '未排计划产品数', field : 'orderproductdetail', sortable : true, halign:'center',formatter : function(value,row){
|
||||
if(value.length!=0){
|
||||
var unplanednum=0;
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].productionorderno==null || value[i].productionorderno==""){
|
||||
unplanednum++;
|
||||
}
|
||||
}
|
||||
return unplanednum;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(flag==0){
|
||||
flag=1;
|
||||
showToday();
|
||||
}
|
||||
|
||||
//展开所有的行
|
||||
for(var i=0;i<data.rows.length;i++){
|
||||
$('#grid').datagrid('expandRow',i);
|
||||
}
|
||||
},
|
||||
onExpandRow: function(index,row){
|
||||
ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddv.datagrid({
|
||||
url:ext.contextPath + '/plan/dailyplan/getlist_detail.do?salesOrderID='+row.id+'&search_name='+$('#search_name').textbox('getValue')+'&sdt='+$("#sdt").val()+'&edt='+$("#edt").val()+'&search_status='+$('#search_status').combobox('getValue'),
|
||||
fitColumns:true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
rownumbers:true,
|
||||
//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'){
|
||||
rowstyler+= ' background-color:#C0C0C0;color:#fff;';
|
||||
}else if(row.status=='6'){
|
||||
rowstyler+= ' font-style:ltalic;';
|
||||
}
|
||||
return rowstyler;
|
||||
},
|
||||
columns : [ [
|
||||
|
||||
{width : '100', title : '销售订单号', field: 'salesorderproduct', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
if(value !=null){
|
||||
return value.salesorderno;
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
} },
|
||||
{width : '100', title : '生产订单号', field : 'productionorderno', sortable : true, halign:'center' },
|
||||
// {width : '100', title : '料号', field : 'bomid', sortable : true, halign:'center' },
|
||||
{width : '150', title : '产品信息', field : 'product', sortable : true, halign:'center' , formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.materialname;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '80', title : '计划生产数', field : 'productquantity', sortable : true, halign:'center' },
|
||||
{width : '60', title : '完成数', field : 'finishedquantity', sortable : true, halign:'center' },
|
||||
{width : '130', title : '计划下达日期', field : 'stdt', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
} },
|
||||
{width : '130', title : '计划完成日期', field : 'eddt', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(value.substring(0,4)=="1900"){
|
||||
return "";
|
||||
}else{
|
||||
return value.substring(0,19);
|
||||
}
|
||||
} },
|
||||
{width : '100', title : '计划状态', field : 'status', sortable : true, align:'center', formatter : function(value, row){
|
||||
switch(value){
|
||||
case "0": return "计划编制";
|
||||
case "1": return "计划下发";
|
||||
case "2": return "计划执行";
|
||||
case "3": return "已作废";
|
||||
case "4": return "已重排";
|
||||
case "6": return "已完成";
|
||||
}
|
||||
} },
|
||||
{title : '操作', field : 'action', width : '120', 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=='0'){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+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")) {%>
|
||||
str += '<img class="iconImg ext-icon-bin" title="计划作废" onclick="invalidateFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{width : '80', title : '提示', field : 'taskchangedstatus', sortable : true, 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 "";
|
||||
}
|
||||
} }
|
||||
] ],
|
||||
onResize:function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},0);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
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')));//搜索
|
||||
}
|
||||
</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,"plan/dailyplan/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,"plan/dailyplan/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<!-- <td><div class="datagrid-btn-separator"></div></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</a></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td>生产订单号</td>
|
||||
<td><input name="search_name" id="search_name" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td >计划状态</td>
|
||||
<td colspan='4'><select id="search_status" name="search_status" class="easyui-combobox" style="width:152px;">
|
||||
<option value='all' select>全部</option>
|
||||
<option value='edit'>编制中</option>
|
||||
<option value='inprogress'>进行中</option>
|
||||
<option value='completed'>已完成</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>计划下达日期</td>
|
||||
<td><input id="sdt" name="sdt" class="Wdate"
|
||||
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"
|
||||
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="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton"
|
||||
data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
147
bin/WebRoot/jsp/plan/processorList.jsp
Normal file
147
bin/WebRoot/jsp/plan/processorList.jsp
Normal file
@ -0,0 +1,147 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看物料配送任务',
|
||||
url : ext.contextPath + '/plan/materialdeliver/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var excuteFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '配送执行',
|
||||
url : ext.contextPath + '/plan/materialdeliver/excutemission.do?id=' + id,
|
||||
onClose : function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/materialdeliver/getProcessorDeliver.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '计划名称', field : 'planname', halign:'center', formatter : function(value, row){
|
||||
if(row.dailyPlanSummary!=null){
|
||||
return row.dailyPlanSummary.name;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '100', title : '计划日期', field : 'plandt', align:'center', formatter : function(value, row){
|
||||
if(row.dailyPlanSummary!=null){
|
||||
return row.dailyPlanSummary.plandt.length>10?row.dailyPlanSummary.plandt.substring(0,10):"";
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '归属工位', field : 'workstationname', halign:'center', formatter : function(value, row){
|
||||
if(row.workstation!=null){
|
||||
return row.workstation.name;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '工位编号', field : 'workstationserial', halign:'center', formatter : function(value, row){
|
||||
if(row.workstation!=null){
|
||||
return row.workstation.serial;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '开始时间', field : 'starttime', align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.length>10?value.substring(0,16):"";
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '结束时间', field : 'endtime', align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.length>10?value.substring(0,16):"";
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '状态', field : 'status', sortable : true, align:'center', formatter : function(value, row){
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '制定中';
|
||||
case '1':
|
||||
return '已下发';
|
||||
case '2':
|
||||
return '配送中';
|
||||
case '3':
|
||||
return '已完成';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/>';
|
||||
str += '<img class="iconImg ext-icon-table_go" title="执行" onclick="excuteFun(\''+row.id+'\');"/>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input name="idStr" type="hidden" />
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位名称</td>
|
||||
<td><input name="search_workstationname" class="easyui-textbox" /></td>
|
||||
<td>工位编号</td>
|
||||
<td><input name="search_workstationserial" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');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>
|
||||
</body>
|
||||
</html>
|
||||
198
bin/WebRoot/jsp/plan/prodtaskAdd.jsp
Normal file
198
bin/WebRoot/jsp/plan/prodtaskAdd.jsp
Normal file
@ -0,0 +1,198 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%request.setAttribute("Flag_ERPConfirm",com.sipai.entity.plan.Prodtask.Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("Flag_Issued",com.sipai.entity.plan.Prodtask.Flag_Issued);%>
|
||||
<%request.setAttribute("Flag_Working",com.sipai.entity.plan.Prodtask.Flag_Working);%>
|
||||
<%request.setAttribute("Flag_Finish",com.sipai.entity.plan.Prodtask.Flag_Finish);%>
|
||||
<%request.setAttribute("Flag_Closed",com.sipai.entity.plan.Prodtask.Flag_Closed);%>
|
||||
<%request.setAttribute("Flag_Cancel",com.sipai.entity.plan.Prodtask.Flag_Cancel);%>
|
||||
<%request.setAttribute("Flag_NoPlan",com.sipai.entity.plan.Prodtask.Flag_NoPlan);%>
|
||||
<%request.setAttribute("Flag_ERPIssued",com.sipai.entity.plan.Prodtask.Flag_ERPIssued);%>
|
||||
<%request.setAttribute("Type_RegularOrder",com.sipai.entity.plan.Prodtask.Type_RegularOrder);%>
|
||||
<%request.setAttribute("Type_Rework",com.sipai.entity.plan.Prodtask.Type_Rework);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="pid" name="pid" type="hidden" value="${pid}" />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>任务编号</th>
|
||||
<td>
|
||||
<input id="taskcode" name="taskcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行状态</th>
|
||||
<td >
|
||||
<select id="runstatus" name="runstatus" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="${Flag_ERPConfirm}" selected>ERP确认</option>
|
||||
<option value="${Flag_Issued}">下达</option>
|
||||
<option value="${Flag_Working}">开工</option>
|
||||
<option value="${Flag_Finish}">完成</option>
|
||||
<option value="${Flag_Closed}">结案</option>
|
||||
<option value="${Flag_Cancel}">作废</option>
|
||||
<option value="${Flag_ERPIssued}">ERP下达</option>
|
||||
<option value="${Flag_NoPlan}">未排计划</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>生产车间</th>
|
||||
<td>
|
||||
<input id="workshop" name="workshop" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料长代码</th>
|
||||
<td>
|
||||
<input id="materialcode" name="materialcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<td>
|
||||
<input id="materialname" name="materialname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>规格型号</th>
|
||||
<td>
|
||||
<input id="model" name="model" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>批号</th>
|
||||
<td>
|
||||
<input id="batch" name="batch" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单位</th>
|
||||
<td>
|
||||
<input id="unit" name="unit" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划生产数</th>
|
||||
<td >
|
||||
<input id="planamount" name="planamount" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划开工日期</th>
|
||||
<td >
|
||||
<input id="pstdate" name="pstdate" class="Wdate" value="${nowDate}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划完工日期</th>
|
||||
<td >
|
||||
<input id="pendate" name="pendate" class="Wdate" value="${nowDate}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>生产类型</th>
|
||||
<td >
|
||||
<select id="type" name="type" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="${Type_RegularOrder}" selected>普通订单</option>
|
||||
<option value="${Type_Rework}">返工</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>BOM编号</th>
|
||||
<td >
|
||||
<input id="bomno" name="bomno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>成本对象</th>
|
||||
<td >
|
||||
<input id="costobject" name="costobject" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划订单号</th>
|
||||
<td >
|
||||
<input id="planno" name="planno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>销售订单号</th>
|
||||
<td >
|
||||
<input id="salesno" name="salesno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>委托加工单位</th>
|
||||
<td >
|
||||
<input id="procompany" name="procompany" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>常用单位</th>
|
||||
<td >
|
||||
<input id="commonunit" name="commonunit" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据状态</th>
|
||||
<td>
|
||||
<select id="billstatus" name="billstatus" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="${Flag_ERPConfirm}" selected>ERP确认</option>
|
||||
<option value="${Flag_Issued}">下达</option>
|
||||
<option value="${Flag_Working}">开工</option>
|
||||
<option value="${Flag_Finish}">完成</option>
|
||||
<option value="${Flag_Closed}">结案</option>
|
||||
<option value="${Flag_Cancel}">作废</option>
|
||||
<option value="${Flag_ERPIssued}">ERP下达</option>
|
||||
<option value="${Flag_NoPlan}">未排计划</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划类别</th>
|
||||
<td >
|
||||
<input id="plantype" name="plantype" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>BOM类别</th>
|
||||
<td >
|
||||
<input id="bomtype" name="bomtype" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
312
bin/WebRoot/jsp/plan/prodtaskAmountView.jsp
Normal file
312
bin/WebRoot/jsp/plan/prodtaskAmountView.jsp
Normal file
@ -0,0 +1,312 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var gridDetail;
|
||||
var id = '${id}';
|
||||
var displaydata;
|
||||
function SearchData(){
|
||||
$.getJSON(ext.contextPath +"/plan/taskorder/getProdtaskAmount.do?random="+new Date()+"&id="+id,cb);
|
||||
}
|
||||
function cb(data){
|
||||
sessionStorage.setItem("urldetaildata",JSON.stringify(data));
|
||||
//console.log("JSON.stringify(data)",JSON.stringify(data));
|
||||
//console.log("data",data);
|
||||
initTaskOrderData(pcarrL);
|
||||
fLoadTable(pcarrL, PAarr);
|
||||
}
|
||||
|
||||
|
||||
var arr = eval('${result}');//获取后台表头数据
|
||||
var configColumns = function() {
|
||||
var columns = [];
|
||||
// 配置固定列表头
|
||||
columns.push([{
|
||||
"title": "日计划",
|
||||
"field": "stdt",
|
||||
halign:'center',
|
||||
rowspan: 3,
|
||||
formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"title": "工艺号",
|
||||
"field": "processrealid",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
},
|
||||
//{
|
||||
// "title": "计划开工日期",
|
||||
// "field": "pstdate",
|
||||
// halign:'center',
|
||||
// rowspan: 3
|
||||
// }, {
|
||||
// "title": "计划完工日期",
|
||||
// "field": "pendate",
|
||||
// halign:'center',
|
||||
// rowspan: 3
|
||||
// },
|
||||
{
|
||||
"title": "产量",
|
||||
colspan: arr.length * 2
|
||||
}
|
||||
]);
|
||||
// 配置表头
|
||||
columns.push(configDaysAmount());
|
||||
columns.push(configAPAmount());
|
||||
return columns;
|
||||
}
|
||||
|
||||
var configDaysAmount = function() {
|
||||
var daysAmount = [];
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
daysAmount.push({
|
||||
title:arr[i].procedurename,
|
||||
field:arr[i].procedurecode,
|
||||
colspan: 2,
|
||||
width:100,
|
||||
halign:'center',
|
||||
});
|
||||
}
|
||||
return daysAmount;
|
||||
}
|
||||
// 配置(包含实际和计划)表头的方法
|
||||
var planvalue;//记录计划的值 用于比对
|
||||
var configAPAmount = function() {
|
||||
var APAmount = [];
|
||||
var currentArr=[];
|
||||
for (var j = 0; j < 2*arr.length;j++) {
|
||||
// console.log("sed:",search_days);
|
||||
var amountobj = {
|
||||
field: "u"+j,
|
||||
rowspan: 1,
|
||||
align: 'center',
|
||||
title: '计划',
|
||||
width: '50'
|
||||
};
|
||||
if(j%2 == 0){
|
||||
amountobj.title = "计划";
|
||||
amountobj.formatter=function(value,row,index){
|
||||
if (value != ''){
|
||||
planvalue = value;
|
||||
return value;
|
||||
}else{
|
||||
planvalue = 0;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
} else {
|
||||
amountobj.title = "实际";
|
||||
amountobj.formatter=function(value,row,index){
|
||||
if (value == ''){
|
||||
return 0;
|
||||
}
|
||||
else{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
amountobj.styler= function(value,row,index){
|
||||
//console.log("planvalue",planvalue);
|
||||
//console.log("value",value);
|
||||
if (value-planvalue<0){
|
||||
return 'color:red;';
|
||||
}
|
||||
else if (value-planvalue>0){
|
||||
return 'color:green;';
|
||||
}
|
||||
};
|
||||
}
|
||||
currentArr.push(amountobj);
|
||||
}
|
||||
APAmount = currentArr;
|
||||
// 循环日期
|
||||
return APAmount;
|
||||
}
|
||||
|
||||
//对象的克隆函数
|
||||
var cloneObj = function(obj) {
|
||||
var str, newobj = obj.constructor === Array ? [] : {};
|
||||
if (typeof obj !== 'object') {
|
||||
return;
|
||||
} else if (window.JSON) {
|
||||
str = JSON.stringify(obj), //系列化对象
|
||||
newobj = JSON.parse(str); //还原
|
||||
} else {
|
||||
for (var i in obj) {
|
||||
newobj[i] = typeof obj[i] === 'object' ?
|
||||
cloneObj(obj[i]) : obj[i];
|
||||
}
|
||||
}
|
||||
return newobj;
|
||||
};
|
||||
|
||||
var makeData = function(dailyplantaskdemand,temArr){
|
||||
dailyplantaskdemand.map( function(ele, index){
|
||||
if(ele.taskcode != "sss"){
|
||||
var jj;
|
||||
for(var i=0;i<arr.length;i++)
|
||||
{
|
||||
//console.log("ele.taskcode",ele.taskcode);
|
||||
//console.log("arr[i]",arr[i].procedurecode);
|
||||
if(ele.taskcode == arr[i].procedurecode)
|
||||
{
|
||||
jj=i;
|
||||
}
|
||||
}
|
||||
if (jj>=0){
|
||||
temArr[2*jj] = {"amount":ele.preamount,"taskcode":ele.taskcode};
|
||||
temArr[2*jj+1] = {"amount":ele.actamount,"taskcode":ele.taskcode};
|
||||
}
|
||||
}
|
||||
})
|
||||
for (var i = 0; i < temArr.length; i++) {
|
||||
if (temArr[i] == undefined) {
|
||||
temArr[i] = PlainAmount("sss");
|
||||
}
|
||||
}
|
||||
//console.log("temArr",temArr);
|
||||
return temArr;
|
||||
}
|
||||
|
||||
var PlainAmount = function(taskcode) {
|
||||
return {
|
||||
amount: '',
|
||||
taskcode: taskcode,
|
||||
}
|
||||
}
|
||||
|
||||
function initDetail(pcarrL, PAarr){
|
||||
//console.log("search_days", search_days);
|
||||
SearchData( );
|
||||
|
||||
}
|
||||
|
||||
// 处理后台数据,处理没有任务量的那些日期
|
||||
var initTaskOrderData = function(pcarrL) {
|
||||
var taskOrderData1 = cloneObj(JSON.parse(sessionStorage.getItem("urldetaildata")));
|
||||
sessionStorage.clear();
|
||||
for(var i = 0;i < taskOrderData1.rows.length; i++){
|
||||
var temArr = new Array(2*pcarrL);
|
||||
var tas = makeData(taskOrderData1.rows[i].dailyplantaskdemand,temArr);
|
||||
//console.log("tas",tas);
|
||||
for(var j=0;j<tas.length;j++){
|
||||
var fieldid="u"+j;
|
||||
taskOrderData1.rows[i][fieldid] = tas[j].amount;
|
||||
}
|
||||
}
|
||||
//console.log("tod",taskOrderData1);
|
||||
displaydata = taskOrderData1;
|
||||
}
|
||||
|
||||
var pcarrL, PAarr;
|
||||
$(function() {
|
||||
console.log("id",id);
|
||||
pcarrL = arr.length;//procedurecode array length
|
||||
PAarr = new Array(2 * pcarrL);//Plan & Act amount array
|
||||
initDetail(pcarrL,PAarr);
|
||||
});
|
||||
|
||||
var searchFun = function() {
|
||||
pcarrL = arr.length;//procedurecode array length
|
||||
PAarr = new Array(2 * pcarrL);//Plan & Act amount array
|
||||
if( $('#dpDate').val() != "")
|
||||
{
|
||||
$.getJSON(ext.contextPath +"/plan/taskorder/getProdtaskAmount.do?dpDate="+$('#dpDate').val()+"&id="+id,cab);
|
||||
function cab(data){
|
||||
sessionStorage.setItem("urldetaildata",JSON.stringify(data));
|
||||
//console.log("JSON.stringify(data)",JSON.stringify(data));
|
||||
//console.log("data",data);
|
||||
initTaskOrderData(pcarrL);
|
||||
fLoadTable(pcarrL, PAarr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
initDetail(pcarrL,PAarr);
|
||||
}
|
||||
}
|
||||
|
||||
var fLoadTable = function(pcarrL, PAarr) {
|
||||
gridDetail = $("#gridDetail").datagrid({
|
||||
data: displaydata.rows,
|
||||
title : '',
|
||||
//url : ext.contextPath + '/plan/taskorder/getTaskOrderDetailDayPlan.do?id=${id}'+'&stdt=${stdt}',
|
||||
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 : 'stdt', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '180', title : '任务单编号', field : 'tasklistcode', sortable : true, halign:'center'},
|
||||
{width : '180', title : '工序', field : 'taskcode', sortable : true, halign:'center'},
|
||||
{width : '90', title : '计划生产值', field : 'preamount', sortable : true, align:'center', halign:'center'},
|
||||
{width : '90', title : '实际生产值', field : 'actamount', sortable : true, align:'center', halign:'center'},
|
||||
|
||||
] ],*/
|
||||
columns: configColumns(),
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
sessionStorage.clear();
|
||||
//console.log("displaydata",displaydata);
|
||||
//console.log("urldetaildata",sessionStorage.getItem("urldetaildata"));
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="cc" class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="tbar">
|
||||
</div>
|
||||
|
||||
<div data-options="region:'center',title:'${taskno}'" style="padding:0px;">
|
||||
<div class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
<td>日计划</td>
|
||||
<td><input id="dpDate" name="dpDate" class="Wdate" bind-value=" justep.Date.toString(new Date(),'yyyy-MM-dd')"
|
||||
onfocus="WdatePicker({startDate:'%y',dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-{%d}'})" data-options="required:true,validType:'isBlank'" readonly/></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="searchFun()">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');gridDetail.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="gridDetail" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
198
bin/WebRoot/jsp/plan/prodtaskEdit.jsp
Normal file
198
bin/WebRoot/jsp/plan/prodtaskEdit.jsp
Normal file
@ -0,0 +1,198 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%request.setAttribute("Flag_ERPConfirm",com.sipai.entity.plan.Prodtask.Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("Flag_Issued",com.sipai.entity.plan.Prodtask.Flag_Issued);%>
|
||||
<%request.setAttribute("Flag_Working",com.sipai.entity.plan.Prodtask.Flag_Working);%>
|
||||
<%request.setAttribute("Flag_Finish",com.sipai.entity.plan.Prodtask.Flag_Finish);%>
|
||||
<%request.setAttribute("Flag_Closed",com.sipai.entity.plan.Prodtask.Flag_Closed);%>
|
||||
<%request.setAttribute("Flag_Cancel",com.sipai.entity.plan.Prodtask.Flag_Cancel);%>
|
||||
<%request.setAttribute("Flag_NoPlan",com.sipai.entity.plan.Prodtask.Flag_NoPlan);%>
|
||||
<%request.setAttribute("Flag_ERPIssued",com.sipai.entity.plan.Prodtask.Flag_ERPIssued);%>
|
||||
<%request.setAttribute("Type_RegularOrder",com.sipai.entity.plan.Prodtask.Type_RegularOrder);%>
|
||||
<%request.setAttribute("Type_Rework",com.sipai.entity.plan.Prodtask.Type_Rework);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/updateProdtask.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
console.log("data","${taskorder.runstatus}");
|
||||
})
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${prodtask.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>任务编号</th>
|
||||
<td>
|
||||
<input id="taskcode" name="taskcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.taskcode}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行状态</th>
|
||||
<td >
|
||||
<select id="runstatus" name="runstatus" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="${Flag_Issued}" <c:if test="${prodtask.runstatus==Flag_Issued}">selected</c:if>>下达</option>
|
||||
<option value="${Flag_Working}" <c:if test="${prodtask.runstatus==Flag_Working}">selected</c:if>>开工</option>
|
||||
<option value="${Flag_Finish}" <c:if test="${prodtask.runstatus==Flag_Finish}">selected</c:if>>完成</option>
|
||||
<option value="${Flag_Closed}" <c:if test="${prodtask.runstatus==Flag_Closed}">selected</c:if>>结案</option>
|
||||
<option value="${Flag_Cancel}" <c:if test="${prodtask.runstatus==Flag_Cancel}">selected</c:if>>作废</option>
|
||||
<option value="${Flag_NoPlan}" <c:if test="${prodtask.runstatus==Flag_NoPlan}">selected</c:if>>未排计划</option>
|
||||
<option value="${Flag_ERPConfirm}" <c:if test="${prodtask.runstatus==Flag_ERPConfirm}">selected</c:if>>ERP确认</option>
|
||||
<option value="${Flag_ERPIssued}" <c:if test="${prodtask.runstatus==Flag_ERPIssued}">selected</c:if>>ERP下达</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>生产车间</th>
|
||||
<td>
|
||||
<input id="workshop" name="workshop" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.workshop }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料长代码</th>
|
||||
<td>
|
||||
<input id="materialcode" name="materialcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.materialcode}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<td>
|
||||
<input id="materialname" name="materialname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.materialname }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>规格型号</th>
|
||||
<td>
|
||||
<input id="model" name="model" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.model }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>批号</th>
|
||||
<td>
|
||||
<input id="batch" name="batch" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.batch }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单位</th>
|
||||
<td>
|
||||
<input id="unit" name="unit" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.unit }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划生产数</th>
|
||||
<td >
|
||||
<input id="planamount" name="planamount" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.planamount }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划开工日期</th>
|
||||
<td >
|
||||
<input id="pstdate" name="pstdate" class="Wdate" value="${prodtask.pstdate}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划完工日期</th>
|
||||
<td >
|
||||
<input id="pendate" name="pendate" class="Wdate" value="${prodtask.pendate}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>生产类型</th>
|
||||
<td >
|
||||
<select id="type" name="type" class="easyui-combobox" data-options="panelHeight:'auto'" value="${prodtask.type }">
|
||||
<option value="${Type_Rework}" <c:if test="${prodtask.type==Type_Rework}">selected</c:if>>返工</option>
|
||||
<option value="${Type_RegularOrder}" <c:if test="${prodtask.type==Type_RegularOrder}">selected</c:if>>普通订单</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>BOM编号</th>
|
||||
<td >
|
||||
<input id="bomno" name="bomno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.bomno }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>成本对象</th>
|
||||
<td >
|
||||
<input id="costobject" name="costobject" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.costobject }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划订单号</th>
|
||||
<td >
|
||||
<input id="planno" name="planno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.planno }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>销售订单号</th>
|
||||
<td >
|
||||
<input id="salesno" name="salesno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.salesno}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>委托加工单位</th>
|
||||
<td >
|
||||
<input id="procompany" name="procompany" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.procompany }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>常用单位</th>
|
||||
<td >
|
||||
<input id="commonunit" name="commonunit" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.commonunit }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据状态</th>
|
||||
<td>
|
||||
<select id="billstatus" name="billstatus" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="${Flag_Issued}" <c:if test="${prodtask.billstatus==Flag_Issued}">selected</c:if>>下达</option>
|
||||
<option value="${Flag_Working}" <c:if test="${prodtask.billstatus==Flag_Working}">selected</c:if>>开工</option>
|
||||
<option value="${Flag_Finish}" <c:if test="${prodtask.billstatus==Flag_Finish}">selected</c:if>>完成</option>
|
||||
<option value="${Flag_Closed}" <c:if test="${prodtask.billstatus==Flag_Closed}">selected</c:if>>结案</option>
|
||||
<option value="${Flag_Cancel}" <c:if test="${prodtask.billstatus==Flag_Cancel}">selected</c:if>>作废</option>
|
||||
<option value="${Flag_NoPlan}" <c:if test="${prodtask.billstatus==Flag_NoPlan}">selected</c:if>>未排计划</option>
|
||||
<option value="${Flag_ERPConfirm}" <c:if test="${prodtask.billstatus==Flag_ERPConfirm}">selected</c:if>>ERP确认</option>
|
||||
<option value="${Flag_ERPIssued}" <c:if test="${prodtask.billstatus==Flag_ERPIssued}">selected</c:if>>ERP下达</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划类别</th>
|
||||
<td >
|
||||
<input id="plantype" name="plantype" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.plantype }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>BOM类别</th>
|
||||
<td >
|
||||
<input id="bomtype" name="bomtype" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${prodtask.bomtype }" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
146
bin/WebRoot/jsp/plan/prodtaskForSelect.jsp
Normal file
146
bin/WebRoot/jsp/plan/prodtaskForSelect.jsp
Normal file
@ -0,0 +1,146 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%request.setAttribute("Flag_ERPConfirm",com.sipai.entity.plan.Prodtask.Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("Flag_Issued",com.sipai.entity.plan.Prodtask.Flag_Issued);%>
|
||||
<%request.setAttribute("Flag_Working",com.sipai.entity.plan.Prodtask.Flag_Working);%>
|
||||
<%request.setAttribute("Flag_Finish",com.sipai.entity.plan.Prodtask.Flag_Finish);%>
|
||||
<%request.setAttribute("Flag_Closed",com.sipai.entity.plan.Prodtask.Flag_Closed);%>
|
||||
<%request.setAttribute("Flag_Cancel",com.sipai.entity.plan.Prodtask.Flag_Cancel);%>
|
||||
<%request.setAttribute("Flag_NoPlan",com.sipai.entity.plan.Prodtask.Flag_NoPlan);%>
|
||||
<%request.setAttribute("Flag_ERPIssued",com.sipai.entity.plan.Prodtask.Flag_ERPIssued);%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/taskorder/getProdtaskRelation.do?flag=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
rowStyler: function(index,row){
|
||||
var rowstyler='';
|
||||
if(row.status=='1'){
|
||||
rowstyler+= ' background-color:#C0C0C0;color:#fff;';
|
||||
}
|
||||
return rowstyler;
|
||||
},
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '任务编号', field : 'taskcode', sortable : true, halign:'center'},
|
||||
{width : '50', title : '执行状态', field : 'runstatus', sortable : true, halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${Flag_Issued}':
|
||||
return '下发';
|
||||
case '${Flag_Working}':
|
||||
return '开工';
|
||||
case '${Flag_Finish}':
|
||||
return '完成';
|
||||
case '${Flag_Closed}':
|
||||
return '结案';
|
||||
case '${Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '170', title : '任务单编号', field : 'tasklistcode', sortable : true, halign:'center'},
|
||||
{width : '130', title : '产品编号', field : 'productno', sortable : true, halign:'center'},
|
||||
{width : '70', title : '计划生产数', field : 'planamount', sortable : true, halign:'center'},
|
||||
{width : '90', title : '生产车间', field : 'workshop', sortable : true, halign:'center'},
|
||||
{width : '85', title : '物料名称', field : 'materialname', sortable : true, halign:'center'},
|
||||
{width : '140', title : '物料代码', field : 'materialcode', sortable : true, halign:'center'},
|
||||
{width : '120', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '120', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '120', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess:function(data){
|
||||
var wids = localStorage.getItem("prodtaskid").split(",");
|
||||
localStorage.clear();
|
||||
$.each(wids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
function selectOK() {
|
||||
var jsonstr = "";
|
||||
var row = $('#grid').datagrid('getSelected');
|
||||
if (row){
|
||||
//以json格式返回数据
|
||||
jsonstr = '{"id":"'+row.id
|
||||
+'","taskcode":"'+row.taskcode
|
||||
+'"}';
|
||||
var dataset = $.parseJSON(jsonstr);
|
||||
return dataset;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
localStorage.clear();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr >
|
||||
<td>任务单</td>
|
||||
<td><input name="search_tasklistcode" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td>
|
||||
<td>产品编码</td>
|
||||
<td><input name="search_productno" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
<td><div class="datagrid-btn-separator"></div></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>
|
||||
|
||||
633
bin/WebRoot/jsp/plan/prodtaskList.jsp
Normal file
633
bin/WebRoot/jsp/plan/prodtaskList.jsp
Normal file
@ -0,0 +1,633 @@
|
||||
<%@ 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_ERPConfirm",com.sipai.entity.plan.Prodtask.Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("Flag_Issued",com.sipai.entity.plan.Prodtask.Flag_Issued);%>
|
||||
<%request.setAttribute("Flag_Working",com.sipai.entity.plan.Prodtask.Flag_Working);%>
|
||||
<%request.setAttribute("Flag_Finish",com.sipai.entity.plan.Prodtask.Flag_Finish);%>
|
||||
<%request.setAttribute("Flag_Closed",com.sipai.entity.plan.Prodtask.Flag_Closed);%>
|
||||
<%request.setAttribute("Flag_Cancel",com.sipai.entity.plan.Prodtask.Flag_Cancel);%>
|
||||
<%request.setAttribute("Flag_NoPlan",com.sipai.entity.plan.Prodtask.Flag_NoPlan);%>
|
||||
<%request.setAttribute("Flag_ERPIssued",com.sipai.entity.plan.Prodtask.Flag_ERPIssued);%>
|
||||
|
||||
<%request.setAttribute("Relation_Related",com.sipai.entity.plan.Prodtask.Relation_Related);%>
|
||||
<%request.setAttribute("Relation_Link",com.sipai.entity.plan.Prodtask.Relation_Link);%>
|
||||
|
||||
<%request.setAttribute("TO_Flag_ERPConfirm",com.sipai.entity.plan.Taskorder.TO_Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("TO_Flag_Issued",com.sipai.entity.plan.Taskorder.TO_Flag_Issued);%>
|
||||
<%request.setAttribute("TO_Flag_Working",com.sipai.entity.plan.Taskorder.TO_Flag_Working);%>
|
||||
<%request.setAttribute("TO_Flag_Closed",com.sipai.entity.plan.Taskorder.TO_Flag_Closed);%>
|
||||
<%request.setAttribute("TO_Flag_Cancel",com.sipai.entity.plan.Taskorder.TO_Flag_Cancel);%>
|
||||
<%request.setAttribute("TO_Flag_NoPlan",com.sipai.entity.plan.Taskorder.TO_Flag_NoPlan);%>
|
||||
<%request.setAttribute("TO_Flag_ERPIssued",com.sipai.entity.plan.Taskorder.TO_Flag_ERPIssued);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<style>
|
||||
.ui-progressbar{
|
||||
background : green;
|
||||
padding:1px;
|
||||
}
|
||||
</style>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addProdtaskFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加任务信息',
|
||||
url : ext.contextPath + '/plan/taskorder/addProdtask.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
var addERPProdtaskFun = function(productno,id,salesno) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加任务信息',
|
||||
url : ext.contextPath + '/plan/taskorder/addERPProdtask.do?id=' + id+'&productno=' + productno +'&salesno=' + salesno,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
function changeNewStatusFun(rowid) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/changeNewStatus.do",{id:rowid},function(data1){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var addTaskorderFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加任务单信息',
|
||||
url : ext.contextPath + '/plan/taskorder/addTaskorder.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
var viewTaskOrderDayPlanAmountFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '生产任务单一览(单击日期查看生产任务单详细)',
|
||||
width:1300,
|
||||
height:600,
|
||||
url : ext.contextPath + '/plan/taskorder/viewTaskOrderDayPlanAmount.do?displaymodel=' + "TO"
|
||||
});
|
||||
};
|
||||
|
||||
var viewProdtaskFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看任务信息',
|
||||
url : ext.contextPath + '/plan/taskorder/viewProdtask.do?id=' + id
|
||||
});
|
||||
};
|
||||
|
||||
var editTaskOrderFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '配置任务单信息',
|
||||
url : ext.contextPath + '/plan/taskorder/editTaskorder.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
} ],
|
||||
onClose : function(){
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var editProdtaskFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '配置任务信息',
|
||||
url : ext.contextPath + '/plan/taskorder/editProdtask.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
} ],
|
||||
onClose : function(){
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var viewAmountFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '配置任务信息',
|
||||
width:1300,
|
||||
height:600,
|
||||
url : ext.contextPath + '/plan/taskorder/viewAmount.do?id=' + id,
|
||||
onClose : function(){
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var editTORePDFun = function(prodtaskrelationid) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '修改关联任务信息',
|
||||
width: 600,
|
||||
height:250,
|
||||
url : ext.contextPath + '/plan/taskorder/editTORePD.do?prodtaskrelationid=' + prodtaskrelationid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
} ],
|
||||
onClose : function(){
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/taskorder/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deleteTORePDFun = function(prodtaskrelationid,prodtaskid) {
|
||||
//console.log("prodtaskid",prodtaskid);
|
||||
//console.log("prodtaskrelationid",prodtaskrelationid);
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/taskorder/deleteTORePD.do', {prodtaskrelationid : prodtaskrelationid,prodtaskid : prodtaskid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deleteTOFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/taskorder/deleteTaskOrder.do', {id : id}, function(data) {
|
||||
if(JSON.parse(data).res> 0){
|
||||
parent.$.messager.alert('提示','成功删除'+JSON.parse(data).dno+'条任务记录'+',删除'+JSON.parse(data).res+'条任务单记录','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deleteATOFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/plan/taskorder/deleteAllTaskOrder.do', {ids:datas} , function(data) {
|
||||
if(JSON.parse(data).res>0){
|
||||
parent.$.messager.alert('提示','成功删除'+JSON.parse(data).dno+'条任务记录'+',删除'+JSON.parse(data).res+'条任务单记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var importFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择文件',
|
||||
width: 600,
|
||||
height:300,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/taskorder/doimport.do',
|
||||
buttons : [ {
|
||||
text : '导入数据',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
||||
|
||||
}
|
||||
} ]
|
||||
});
|
||||
grid.datagrid('reload');
|
||||
};
|
||||
|
||||
|
||||
var importERPFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择任务',
|
||||
width: 1100,
|
||||
height:600,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/taskorder/doimporterp.do',
|
||||
buttons : [ {
|
||||
text : '导入数据',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
|
||||
}
|
||||
} ]
|
||||
});
|
||||
grid.datagrid('reload');
|
||||
};
|
||||
|
||||
var selectRelationFun = function(toid) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择关联任务',
|
||||
width: 600,
|
||||
height:250,
|
||||
url : ext.contextPath + '/plan/taskorder/selectProdtaskRelation.do?toid=' + toid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
} ],
|
||||
onClose : function(){
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var districtDailyPlan = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '快速排日计划',
|
||||
width: 1100,
|
||||
height:500,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/plan/taskorder/districtDailyPlan.do?taskOrderId='+id,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog("destroy");
|
||||
|
||||
}
|
||||
} ]
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
var flag=0;
|
||||
$(function() {
|
||||
$('#displayAllbtn').switchbutton({
|
||||
onChange: function(checked){
|
||||
if(checked==true){
|
||||
$('#notdisplayinvalid').val("1");
|
||||
}else{
|
||||
$('#notdisplayinvalid').val("0");
|
||||
}
|
||||
//alert($('#mm').switchbutton('options').checked);
|
||||
grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
}
|
||||
});
|
||||
|
||||
grid = $('#grid').datagrid({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/taskorder/getTaskorder.do?flag=listpage',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
frozenColumns:[[
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '185', title : '任务单编号', field : 'tasklistcode', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str = "";
|
||||
if(row.checknewstatus != 1)
|
||||
{
|
||||
str += '<img class="iconImg ext-icon-new"/> ';
|
||||
}
|
||||
str += value;
|
||||
return str;
|
||||
}},
|
||||
{width : '80', title : '任务单状态', field : 'billstatus', sortable : true, align:'center',halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${TO_Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${TO_Flag_Issued}':
|
||||
return '下发';
|
||||
case '${TO_Flag_Working}':
|
||||
return '开工';
|
||||
case '${TO_Flag_Closed}':
|
||||
return '结案';
|
||||
case '${TO_Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${TO_Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${TO_Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
]],
|
||||
columns : [ [
|
||||
{width : '150', title : '产品编码', field : 'productno', sortable : true, align:'center',halign:'center'},
|
||||
{width : '100', title : '产品数量', field : 'prodamount', sortable : true,align:'center', halign:'center'},
|
||||
{width : '90', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '140', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '140', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '140', title : '任务单下达时间', field : 'billruntime', sortable : true, halign:'center'},
|
||||
{ width: 110, title: '进度', field: 'progress', align: 'center',
|
||||
formatter: function (value, row) {
|
||||
//value = parseInt(Math.random()*100+1);
|
||||
var color;
|
||||
if(value<=30){
|
||||
color="#DF4134";
|
||||
}else if (value<=70){
|
||||
color="#EABA0A";
|
||||
}else if (value>70){
|
||||
color="#53CA22";
|
||||
}
|
||||
var htmlstr = '<div class="easyui-progressbar progressbar" style="width: 100px; height: 17px;" value="'+value +'" text="'+60+'%">'+
|
||||
'<div class="progressbar-text" style="width: 100px; height: 20px; line-height: 17px;">'+value+'%</div>'+
|
||||
'<div class="progressbar-value" style="width: '+value+'%; height: 20px; line-height: 17px;">'+
|
||||
'<div class="progressbar-text" style="width: 100px; height: 20px; line-height: 17px;background :'+color+'; ">'+value+'%</div>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
return htmlstr;
|
||||
}
|
||||
},
|
||||
{title : '操作', field : 'action', width : '140', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/districtDailyPlan.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_multiple" title="排日计划" onclick="districtDailyPlan(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/editTaskorder.do")) {%>
|
||||
//str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editTaskOrderFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/selectProdtaskRelation.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_go" title="关联任务" onclick="selectRelationFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/deleteTaskOrder.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteTOFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/addProdtask.do")) {%>
|
||||
/*str += '<img class="iconImg ext-icon-table_add" title="添加任务" onclick="addProdtaskFun(\''+row.id+'\');"/> ';*/
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/addProdtask.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_add" title="添加任务" onclick="addERPProdtaskFun(\''+row.productno+'\',\''+row.id+'\',\''+row.salesno+'\');"/> ';
|
||||
<%}%>
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onClickRow: function(index, row){
|
||||
if($('#grid').datagrid('getRows')[index].checknewstatus != '1')
|
||||
{
|
||||
changeNewStatusFun($('#grid').datagrid('getRows')[index].id);
|
||||
//console.log("row[index].changenewstatus",$('#grid').datagrid('getRows')[index].checknewstatus);
|
||||
}
|
||||
},
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(flag==0){
|
||||
flag=1;
|
||||
grid.datagrid('load',ext.serializeObject($('#searchForm')));//搜索
|
||||
}
|
||||
else{
|
||||
if($('#notdisplayinvalid').val() == "1"){
|
||||
//展开所有的行
|
||||
for(var i=0;i<data.rows.length;i++){
|
||||
$('#grid').datagrid('expandRow',i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
onExpandRow: function(index,prow){
|
||||
ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddv.datagrid({
|
||||
url:ext.contextPath + '/plan/taskorder/getTask.do?pid='+prow.id,
|
||||
fitColumns:true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
striped: true,
|
||||
idField : 'id',
|
||||
rownumbers:true,
|
||||
//loadMsg:'',
|
||||
height:'auto',
|
||||
rowStyler: function(index,row){
|
||||
var rowstyler='';
|
||||
if (row.relation!=null){
|
||||
if(row.relation=='${Relation_Link}'){
|
||||
rowstyler = 'background-color:yellow;';
|
||||
}
|
||||
else if(row.relation=='${Relation_Related}'){
|
||||
rowstyler = 'background-color:blue;color:white';
|
||||
}
|
||||
}
|
||||
return rowstyler;
|
||||
},
|
||||
onDblClickRow: function(index, row){
|
||||
viewAmountFun(row.id);
|
||||
},
|
||||
columns : [ [
|
||||
|
||||
{width : '140', title : '任务编号', field : 'taskcode', sortable : true, halign:'center'},
|
||||
{width : '65', title : '执行状态', field : 'runstatus', sortable : true, halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${Flag_Issued}':
|
||||
return '下发';
|
||||
case '${Flag_Working}':
|
||||
return '开工';
|
||||
case '${Flag_Closed}':
|
||||
return '结案';
|
||||
case '${Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '125', title : '已完成/已安排/计划生产数', field : 'planamount',halign:'center',align:'center',formatter:function(value,row){
|
||||
var str = row.alactamount + " / " + row.alpreamount + " / " + value;
|
||||
return str;
|
||||
}},
|
||||
{width : '90', title : '生产车间', field : 'workshop', sortable : true, halign:'center'},
|
||||
{width : '85', title : '物料名称', field : 'materialname', sortable : true, halign:'center'},
|
||||
{width : '140', title : '物料代码', field : 'materialcode', sortable : true, halign:'center'},
|
||||
{width : '120', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '120', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '120', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '140', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
if(row.relation == '${Relation_Link}')
|
||||
{
|
||||
str += '<img class="iconImg ext-icon-plugin" title="查看" onclick="viewProdtaskFun(\''+row.id+'\');"/> ';
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/editProdtask.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-plugin_link" title="编辑" onclick="editTORePDFun(\''+row.prodtaskrelationid+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-plugin_delete" title="删除" onclick="deleteTORePDFun(\''+row.prodtaskrelationid+'\',\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
}else
|
||||
{
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewProdtaskFun(\''+row.id+'\');"/> ';
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/editProdtask.do")) {%>
|
||||
//str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editProdtaskFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
|
||||
] ],
|
||||
onResize:function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},0);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</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,"plan/taskorder/addTaskorder.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addTaskorderFun();">添加</a>
|
||||
</td>
|
||||
<%}%> -->
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/deleteTaskOrder.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deleteATOFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<td><div class="datagrid-btn-separator"></div></td>
|
||||
<!--<%if (sessionManager.havePermission(session,"plan/taskorder/doimport.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'iconImg ext-icon-table_save',plain:true"
|
||||
onclick="importFun();">导入</a>
|
||||
<%}%>
|
||||
</td> -->
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'iconImg ext-icon-table_save',plain:true"
|
||||
onclick="importERPFun();">ERP导入</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'iconImg ext-icon-table',plain:true"
|
||||
onclick="viewTaskOrderDayPlanAmountFun();">任务单一览查看</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input name="idStr" type="hidden" />
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>任务单编号</td>
|
||||
<td><input name="search_tocode" class="easyui-textbox" /></td>
|
||||
<td>销售单编号</td>
|
||||
<td><input name="search_salesno" class="easyui-textbox" /></td>
|
||||
<td>产品编码</td>
|
||||
<td><input name="search_matercode" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
<td><div class="datagrid-btn-separator"></div></td>
|
||||
<td>展开所有任务</td>
|
||||
<td><input id="displayAllbtn" class="easyui-switchbutton" style="height:22px;width:50px;"
|
||||
data-options="onText:'是',offText:'否'" unchecked></td>
|
||||
<td><input id="notdisplayinvalid" name="notdisplayinvalid" type="hidden" value="" /></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>
|
||||
159
bin/WebRoot/jsp/plan/prodtaskView.jsp
Normal file
159
bin/WebRoot/jsp/plan/prodtaskView.jsp
Normal file
@ -0,0 +1,159 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%request.setAttribute("Flag_ERPConfirm",com.sipai.entity.plan.Prodtask.Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("Flag_Issued",com.sipai.entity.plan.Prodtask.Flag_Issued);%>
|
||||
<%request.setAttribute("Flag_Working",com.sipai.entity.plan.Prodtask.Flag_Working);%>
|
||||
<%request.setAttribute("Flag_Finish",com.sipai.entity.plan.Prodtask.Flag_Finish);%>
|
||||
<%request.setAttribute("Flag_Closed",com.sipai.entity.plan.Prodtask.Flag_Closed);%>
|
||||
<%request.setAttribute("Flag_Cancel",com.sipai.entity.plan.Prodtask.Flag_Cancel);%>
|
||||
<%request.setAttribute("Flag_NoPlan",com.sipai.entity.plan.Prodtask.Flag_NoPlan);%>
|
||||
<%request.setAttribute("Flag_ERPIssued",com.sipai.entity.plan.Prodtask.Flag_ERPIssued);%>
|
||||
<%request.setAttribute("Type_RegularOrder",com.sipai.entity.plan.Prodtask.Type_RegularOrder);%>
|
||||
<%request.setAttribute("Type_Rework",com.sipai.entity.plan.Prodtask.Type_Rework);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
|
||||
<style>
|
||||
body{ text-align:center}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${prodtask.id }"/>
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th>任务编号</th>
|
||||
<td>
|
||||
${prodtask.taskcode}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行状态</th>
|
||||
<td >
|
||||
<c:if test="${prodtask.runstatus==Flag_Issued}">下发</c:if>
|
||||
<c:if test="${prodtask.runstatus==Flag_Working}">开工</c:if>
|
||||
<c:if test="${prodtask.runstatus==Flag_Finish}">完成</c:if>
|
||||
<c:if test="${prodtask.runstatus==Flag_Closed}">结案</c:if>
|
||||
<c:if test="${prodtask.runstatus==Flag_Cancel}">作废</c:if>
|
||||
<c:if test="${prodtask.runstatus==Flag_NoPlan}">未排计划</c:if>
|
||||
<c:if test="${prodtask.runstatus==Flag_ERPConfirm}">ERP确认</c:if>
|
||||
<c:if test="${prodtask.runstatus==Flag_ERPIssued}">ERP下达</c:if></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>生产车间</th>
|
||||
<td>
|
||||
${prodtask.workshop }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料长代码</th>
|
||||
<td>
|
||||
${prodtask.materialcode}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<td>
|
||||
${prodtask.materialname }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>规格型号</th>
|
||||
<td>
|
||||
${prodtask.model }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>批号</th>
|
||||
<td>
|
||||
${prodtask.batch }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单位</th>
|
||||
<td>
|
||||
${prodtask.unit }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划生产数</th>
|
||||
<td >
|
||||
${prodtask.planamount }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划开工日期</th>
|
||||
<td >
|
||||
${prodtask.pstdate.substring(0,10)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划完工日期</th>
|
||||
<td >
|
||||
${prodtask.pendate.substring(0,10)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>生产类型</th>
|
||||
<td >
|
||||
<c:if test="${prodtask.type==Type_Rework}">返工</c:if>
|
||||
<c:if test="${prodtask.type==Type_RegularOrder}">普通订单</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>BOM编号</th>
|
||||
<td >
|
||||
${prodtask.bomno }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>成本对象</th>
|
||||
<td >
|
||||
${prodtask.costobject }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据来源</th>
|
||||
<td >
|
||||
${prodtask.source }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划订单号</th>
|
||||
<td >
|
||||
${prodtask.planno }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>销售订单号</th>
|
||||
<td >
|
||||
${prodtask.salesno}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>委托加工单位</th>
|
||||
<td >
|
||||
${prodtask.procompany }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>常用单位</th>
|
||||
<td >
|
||||
${prodtask.commonunit }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据状态</th>
|
||||
<td>
|
||||
<c:if test="${prodtask.billstatus==Flag_Issued}">下发</c:if>
|
||||
<c:if test="${prodtask.billstatus==Flag_Working}">开工</c:if>
|
||||
<c:if test="${prodtask.billstatus==Flag_Finish}">完成</c:if>
|
||||
<c:if test="${prodtask.billstatus==Flag_Closed}">结案</c:if>
|
||||
<c:if test="${prodtask.billstatus==Flag_Cancel}">作废</c:if>
|
||||
<c:if test="${prodtask.billstatus==Flag_NoPlan}">未排计划</c:if>
|
||||
<c:if test="${prodtask.billstatus==Flag_ERPConfirm}">ERP确认</c:if>
|
||||
<c:if test="${prodtask.billstatus==Flag_ERPIssued}">ERP下达</c:if></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划类别</th>
|
||||
<td >
|
||||
${prodtask.plantype }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>BOM类别</th>
|
||||
<td >
|
||||
${prodtask.bomtype }</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
84
bin/WebRoot/jsp/plan/selectProdtaskRelation.jsp
Normal file
84
bin/WebRoot/jsp/plan/selectProdtaskRelation.jsp
Normal file
@ -0,0 +1,84 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/saveRelation.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function selectRelation(){
|
||||
localStorage.setItem("prodtaskid",$("#prodtaskid").val().split(","));
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择关联任务',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/plan/taskorder/selectRelation.do?',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#prodtask").textbox('setValue',res.taskcode);//easyui textbox赋值jquery不一样
|
||||
$("#prodtaskid").val(res.id);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#prodtask").textbox('textbox').bind("click", function () {
|
||||
selectRelation();
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="taskorderid" name="taskorderid" type="hidden" value="${toid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>关联任务</th>
|
||||
<td><input id="prodtask" name="prodtask" class="easyui-textbox"
|
||||
class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="" readonly"/>
|
||||
<input id="prodtaskid" name="prodtaskid" type="hidden" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>数量</th>
|
||||
<td><input name="amount" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
87
bin/WebRoot/jsp/plan/selectProdtaskRelationEdit.jsp
Normal file
87
bin/WebRoot/jsp/plan/selectProdtaskRelationEdit.jsp
Normal file
@ -0,0 +1,87 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/updateTORePD.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function selectRelation(){
|
||||
localStorage.setItem("prodtaskid",$("#prodtaskid").val().split(","));
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择关联任务',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/plan/taskorder/selectRelation.do?',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#oldptid").val($("#prodtaskid").val());
|
||||
$("#taskcode").textbox('setValue',res.taskcode);//easyui textbox赋值jquery不一样
|
||||
$("#prodtaskid").val(res.id);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#taskcode").textbox('textbox').bind("click", function () {
|
||||
selectRelation();
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="taskorderid" name="taskorderid" type="hidden" value="${taskorderReProdtask.taskorderid}"/>
|
||||
<input id="id" name="id" type="hidden" value="${taskorderReProdtask.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>关联任务</th>
|
||||
<td><input id="taskcode" name="taskcode" class="easyui-textbox"
|
||||
class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="${taskorderReProdtask.taskcode}" readonly"/>
|
||||
<input id="prodtaskid" name="prodtaskid" type="hidden" value="${taskorderReProdtask.prodtaskid}"/>
|
||||
<input id="oldptid" type="hidden" name="oldptid" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>数量</th>
|
||||
<td><input name="amount" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" type="text" value="${taskorderReProdtask.amount}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
558
bin/WebRoot/jsp/plan/taskOrderDayPlanAmountView.jsp
Normal file
558
bin/WebRoot/jsp/plan/taskOrderDayPlanAmountView.jsp
Normal file
@ -0,0 +1,558 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
<%request.setAttribute("TO_Flag_ERPConfirm",com.sipai.entity.plan.Taskorder.TO_Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("TO_Flag_Issued",com.sipai.entity.plan.Taskorder.TO_Flag_Issued);%>
|
||||
<%request.setAttribute("TO_Flag_Working",com.sipai.entity.plan.Taskorder.TO_Flag_Working);%>
|
||||
<%request.setAttribute("TO_Flag_Closed",com.sipai.entity.plan.Taskorder.TO_Flag_Closed);%>
|
||||
<%request.setAttribute("TO_Flag_Cancel",com.sipai.entity.plan.Taskorder.TO_Flag_Cancel);%>
|
||||
<%request.setAttribute("TO_Flag_NoPlan",com.sipai.entity.plan.Taskorder.TO_Flag_NoPlan);%>
|
||||
<%request.setAttribute("TO_Flag_ERPIssued",com.sipai.entity.plan.Taskorder.TO_Flag_ERPIssued);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var idays = 15;
|
||||
var dm = '${displaymodel}';
|
||||
var distFun = function(tasklistcode,dt,prid) {
|
||||
console.log("dm",dm)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
width: 1200,
|
||||
height:550,
|
||||
title : '分配任务量',
|
||||
url : ext.contextPath + '/plan/taskorder/showDistricWork.do?displaymodel='+dm+'&tasklistcode='+tasklistcode+'&stdt='+dt+'&prid='+prid,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}],
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var viewDetailFun = function(stdt) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看详细信息',
|
||||
width:1250,
|
||||
height:580,
|
||||
url : ext.contextPath + '/plan/taskorder/viewTaskOrderDetailDayPlan.do?stdt=' + stdt
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
//当前日期前7天
|
||||
var startdateFun = function(n){
|
||||
var now = new Date;
|
||||
now.setDate(now.getDate() - n);
|
||||
return now;
|
||||
};
|
||||
|
||||
var startdateOrder = function(){
|
||||
var syear = startdateFun(7).getFullYear();
|
||||
var smonth = startdateFun(7).getMonth()+1;
|
||||
if(smonth<10)
|
||||
{
|
||||
smonth="0"+smonth;
|
||||
}
|
||||
var sdate = startdateFun(7).getDate();
|
||||
if(sdate<10)
|
||||
{
|
||||
sdate="0"+sdate;
|
||||
}
|
||||
stD = dateToString(new Date(syear+"-"+smonth+"-"+sdate));
|
||||
return stD;
|
||||
};
|
||||
|
||||
//当前日期后7天
|
||||
var enddateFun = function(n){
|
||||
var now = new Date;
|
||||
now.setDate(now.getDate() + n);
|
||||
return now;
|
||||
};
|
||||
|
||||
var enddateOrder = function(){
|
||||
var syear = enddateFun(7).getFullYear();
|
||||
var smonth = enddateFun(7).getMonth()+1;
|
||||
if(smonth<10)
|
||||
{
|
||||
smonth="0"+smonth;
|
||||
}
|
||||
var sdate = enddateFun(7).getDate();
|
||||
if(sdate<10)
|
||||
{
|
||||
sdate="0"+sdate;
|
||||
}
|
||||
stD = dateToString(new Date(syear+"-"+smonth+"-"+sdate));
|
||||
return stD;
|
||||
};
|
||||
|
||||
var clearFun= function(){
|
||||
startDate1 = startdateOrder();
|
||||
document.getElementById('startDate').value=startDate1;
|
||||
|
||||
endDate1 = enddateOrder();
|
||||
document.getElementById('endDate').value= enddateOrder();
|
||||
|
||||
$('#search_proced').combobox('clear');
|
||||
|
||||
var search_days1 = DateDiff(new Date(endDate1), new Date(startDate1))+1;
|
||||
//console.log("sd2",search_days1);
|
||||
var daysArr = new Array(2 * search_days1);
|
||||
|
||||
window.MES = {
|
||||
startDate: startDate1,
|
||||
endDate: endDate1,
|
||||
search_days: 15,
|
||||
daysArr: new Array(30)
|
||||
}
|
||||
init(MES.search_days,MES.daysArr,MES.startDate,MES.endDate);
|
||||
}
|
||||
|
||||
|
||||
$(function() {
|
||||
$('#search_proced').combobox({
|
||||
url : ext.contextPath + '/process/taskprocedure/getprocedlist.do?random=' + Math.random(),
|
||||
valueField:'procedurecode',
|
||||
textField:'procedurename',
|
||||
method:'get'
|
||||
});
|
||||
|
||||
// 查询开始日期
|
||||
var startDate1 = $('#startDate').val();
|
||||
// 查询结束日期
|
||||
var endDate1 = $('#endDate').val();
|
||||
// 查询了多少天
|
||||
if (startDate1 == "") {
|
||||
startDate1 = startdateOrder();
|
||||
document.getElementById('startDate').value=startDate1;
|
||||
//console.log("sd",startDate1);
|
||||
}
|
||||
|
||||
if (endDate1 == "") {
|
||||
endDate1 = enddateOrder();
|
||||
document.getElementById('endDate').value= enddateOrder();
|
||||
//console.log("ed",endDate1);
|
||||
}
|
||||
|
||||
var search_days1 = DateDiff(new Date(endDate1), new Date(startDate1))+1;
|
||||
//console.log("sd2",search_days1);
|
||||
var daysArr = new Array(2 * search_days1);
|
||||
|
||||
window.MES = {
|
||||
startDate: startDate1,
|
||||
endDate: endDate1,
|
||||
search_days: 15,
|
||||
daysArr: new Array(30)
|
||||
}
|
||||
init(MES.search_days,MES.daysArr,MES.startDate,MES.endDate);
|
||||
});
|
||||
|
||||
var searchFun = function() {
|
||||
$(function(){
|
||||
var startDate1 = $('#startDate').val();
|
||||
// 查询结束日期
|
||||
var endDate1 = $('#endDate').val();
|
||||
// 查询了多少天
|
||||
if (startDate1 == "") {
|
||||
startDate1 = dateToString(new Date(startdateFun));
|
||||
|
||||
}
|
||||
|
||||
if (endDate1 == "") {
|
||||
endDate1 = dateFromToday(new Date(startDate1), 15);
|
||||
|
||||
}
|
||||
|
||||
var search_days1 = DateDiff(new Date(endDate1), new Date(startDate1))+1;
|
||||
|
||||
var daysArr = new Array(2 * search_days1);
|
||||
window.MES = {
|
||||
startDate: startDate1,
|
||||
endDate: endDate1,
|
||||
search_days: search_days1,
|
||||
daysArr: daysArr
|
||||
}
|
||||
});
|
||||
|
||||
init(MES.search_days,MES.daysArr,MES.startDate,MES.endDate);
|
||||
|
||||
}
|
||||
|
||||
function init(search_days, daysArr,startDate,endDate){
|
||||
//console.log("search_days", search_days);
|
||||
$.getJSON(ext.contextPath +"/activiti/workflow/getLASTPDAmount.do?displaymodel="+dm+"&startDate=" + startDate +"&endDate=" + endDate + "&search_proced="+$('#search_proced').textbox('getValue'),callback);
|
||||
function callback(data){
|
||||
localStorage.setItem("urldata",JSON.stringify(data));
|
||||
initTaskOrderData(search_days);
|
||||
//组装后的数据
|
||||
//console.log("dailyTA1:", initTaskOrderData(search_days));
|
||||
fLoadTable(search_days, daysArr);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理后台数据,处理没有任务量的那些日期
|
||||
var initTaskOrderData = function(search_day) {
|
||||
//console.log("weichuli",localStorage.getItem("urldata"));
|
||||
var taskOrderData1 = cloneObj(JSON.parse(localStorage.getItem("urldata")));
|
||||
//console.log("chulihou",taskOrderData1);
|
||||
//localStorage.removeItem("urldata");
|
||||
for(var i = 0;i < taskOrderData1.rows.length; i++){
|
||||
var temArr = new Array(2*MES.search_days);
|
||||
var tas = makeData(taskOrderData1.rows[i].dailytotalamount,temArr);
|
||||
//console.log("tas",tas);
|
||||
for(var j=0;j<tas.length;j++){
|
||||
var fieldid="u"+j;
|
||||
taskOrderData1.rows[i][fieldid] = tas[j].amount;
|
||||
}
|
||||
}
|
||||
//console.log("tod",taskOrderData1);
|
||||
return taskOrderData1;
|
||||
}
|
||||
|
||||
var fLoadTable = function(search_days, daysArr) {
|
||||
$("#grid").datagrid({
|
||||
data: initTaskOrderData(search_days).rows,
|
||||
title: '',
|
||||
striped: true,
|
||||
rownumbers: true,
|
||||
//pagination: true,
|
||||
singleSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: false,
|
||||
idField: 'id',
|
||||
pageSize: 50,
|
||||
pageList: [20, 50, 100],
|
||||
columns: configColumns(search_days, daysArr),
|
||||
toolbar : '#toolbar',
|
||||
onHeaderContextMenu : function(e, field){
|
||||
if(field.length>8&&field!="tasklistcode"&&field!="salesno"&&field!="processrealid"){
|
||||
viewDetailFun(field);
|
||||
}
|
||||
},
|
||||
onBeforeSortColumn:function(sort, order){
|
||||
if(sort.length>8&&sort!="tasklistcode"&&sort!="salesno"&&sort!="processrealid"){
|
||||
viewDetailFun(sort);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
onDblClickCell: function(index,field,value){
|
||||
if(dm!="TO")
|
||||
{
|
||||
<%if (sessionManager.havePermission(session,"plan/taskorder/editTaskorder.do")) {%>
|
||||
if(value != ""){
|
||||
var tasklistcode =$('#grid').datagrid('getRows')[index].id;//获取点击单元格任务单
|
||||
//console.log("tasklistcode",tasklistcode);
|
||||
var d = new Date(MES.startDate);
|
||||
d.setDate(d.getDate()+parseInt(field.substring(1,field.length)/2));
|
||||
var dt = d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
|
||||
if(d.getDate()<10)
|
||||
{
|
||||
dt = d.getFullYear()+"-"+(d.getMonth()+1)+"-0"+d.getDate();
|
||||
}
|
||||
var prid = $('#grid').datagrid('getRows')[index].processrealid;//获取点击单元格工艺号
|
||||
distFun(tasklistcode,dt,prid);
|
||||
}
|
||||
<%}%>
|
||||
}
|
||||
},
|
||||
onLoadSuccess: function(data){
|
||||
var mark=1; //这里涉及到简单的运算,mark是计算每次需要合并的格子数
|
||||
for (var i=1; i <data.rows.length; i++) { //这里循环表格当前的数据
|
||||
if (data.rows[i]['tasklistcode'] == data.rows[i-1]['tasklistcode']) { //后一行的值与前一行的值做比较,相同就需要合并
|
||||
mark += 1;
|
||||
$(this).datagrid('mergeCells',{
|
||||
index: i+1-mark, //datagrid的index,表示从第几行开始合并;紫色的内容需是最精髓的,就是记住最开始需要合并的位置
|
||||
field: 'tasklistcode', //合并单元格的区域,就是clomun中的filed对应的列
|
||||
rowspan:mark //纵向合并的格数,如果想要横向合并,就使用colspan:mark
|
||||
});
|
||||
$(this).datagrid('mergeCells',{
|
||||
index: i+1-mark, //datagrid的index,表示从第几行开始合并;紫色的内容需是最精髓的,就是记住最开始需要合并的位置
|
||||
field: 'salesno', //合并单元格的区域,就是clomun中的filed对应的列
|
||||
rowspan:mark //纵向合并的格数,如果想要横向合并,就使用colspan:mark
|
||||
});
|
||||
$(this).datagrid('mergeCells',{
|
||||
index: i+1-mark, //datagrid的index,表示从第几行开始合并;紫色的内容需是最精髓的,就是记住最开始需要合并的位置
|
||||
field: 'prodamount', //合并单元格的区域,就是clomun中的filed对应的列
|
||||
rowspan:mark //纵向合并的格数,如果想要横向合并,就使用colspan:mark
|
||||
});
|
||||
}else{
|
||||
mark=1; //一旦前后两行的值不一样了,那么需要合并的格子数mark就需要重新计算
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// 组装表头的方法
|
||||
var configColumns = function(search_days, daysArr) {
|
||||
var columns = [];
|
||||
// 配置固定列表头
|
||||
columns.push([{
|
||||
"title": "销售订单号",
|
||||
"field": "salesno",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
}, {
|
||||
"title": "任务单编号",
|
||||
"field": "tasklistcode",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
},
|
||||
{
|
||||
"title": "工艺编号",
|
||||
"field": "processrealid",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
},
|
||||
{
|
||||
"title": "运行状态",
|
||||
"field": "billstatus",
|
||||
halign:'center',
|
||||
rowspan: 1,
|
||||
rowspan: 3,
|
||||
formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${TO_Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${TO_Flag_Issued}':
|
||||
return '下发';
|
||||
case '${TO_Flag_Working}':
|
||||
return '开工';
|
||||
case '${TO_Flag_Closed}':
|
||||
return '结案';
|
||||
case '${TO_Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${TO_Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${TO_Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
// {
|
||||
// "title": "产品编号",
|
||||
// "field": "productno",
|
||||
// rowspan: 3
|
||||
// },
|
||||
{
|
||||
"title": "计划产量",
|
||||
"field": "prodamount",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
},
|
||||
{
|
||||
"title": "实际产量(周期内)",
|
||||
"field": "totalactamount",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
},
|
||||
//{
|
||||
// "title": "计划开工日期",
|
||||
// "field": "pstdate",
|
||||
// rowspan: 3
|
||||
// }, {
|
||||
// "title": "计划完工日期",
|
||||
// "field": "pendate",
|
||||
// rowspan: 3
|
||||
// },
|
||||
{
|
||||
"title": "产量(" + dateToString(MES.startDate) + " 至 " + dateFromToday(new Date(MES.startDate), search_days-1) + ")",
|
||||
colspan: search_days * 2
|
||||
}
|
||||
]);
|
||||
// 配置日期表头
|
||||
columns.push(configDaysAmount(search_days));
|
||||
columns.push(configAPAmount(search_days, daysArr));
|
||||
return columns;
|
||||
}
|
||||
// 配置日期表头的方法
|
||||
var configDaysAmount = function(search_days) {
|
||||
var daysAmount = [];
|
||||
for (var i = 0; i < search_days; i++) {
|
||||
var year = new Date(dateFromToday(new Date(MES.startDate), i)).getFullYear();
|
||||
var month = new Date(dateFromToday(new Date(MES.startDate), i)).getMonth()+1;
|
||||
if(month<10)
|
||||
{
|
||||
month="0"+month;
|
||||
}
|
||||
var date = new Date(dateFromToday(new Date(MES.startDate), i)).getDate();
|
||||
if(date<10)
|
||||
{
|
||||
date="0"+date;
|
||||
}
|
||||
daysAmount.push({
|
||||
title:month+"-"+date,
|
||||
field: year+"-"+month+"-"+date,
|
||||
colspan: 2,
|
||||
halign:'center',
|
||||
sortable:true
|
||||
});
|
||||
}
|
||||
return daysAmount;
|
||||
}
|
||||
// 配置每日计划(包含实际和计划)表头的方法
|
||||
var configAPAmount = function(search_days, daysArr) {
|
||||
var APAmount = [];
|
||||
|
||||
var thisGGG = initTaskOrderData(search_days);
|
||||
thisGGG.rows.map(function(ele){
|
||||
var currentArr=[];
|
||||
for (var j = 0; j < 2*search_days; j++) {
|
||||
// console.log("sed:",search_days);
|
||||
var amountobj = {
|
||||
field: "u"+j,
|
||||
rowspan: 1,
|
||||
align: 'center',
|
||||
title: '计划'
|
||||
};
|
||||
if(j%2 == 0){
|
||||
amountobj.title = "计划";
|
||||
amountobj.formatter=function(value,row,index){
|
||||
if (value != undefined){
|
||||
planvalue = value;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
amountobj.title = "实际";
|
||||
amountobj.styler= function(value,row,index){
|
||||
//console.log("planvalue",planvalue);
|
||||
if (value-planvalue<0){
|
||||
return 'color:red;';
|
||||
}
|
||||
else if (value-planvalue>0){
|
||||
return 'color:green;';
|
||||
}
|
||||
};
|
||||
}
|
||||
currentArr.push(amountobj);
|
||||
}
|
||||
APAmount = currentArr;
|
||||
});
|
||||
// 循环日期
|
||||
return APAmount;
|
||||
}
|
||||
//对象的克隆函数
|
||||
var cloneObj = function(obj) {
|
||||
var str, newobj = obj.constructor === Array ? [] : {};
|
||||
if (typeof obj !== 'object') {
|
||||
return;
|
||||
} else if (window.JSON) {
|
||||
str = JSON.stringify(obj), //系列化对象
|
||||
newobj = JSON.parse(str); //还原
|
||||
} else {
|
||||
for (var i in obj) {
|
||||
newobj[i] = typeof obj[i] === 'object' ?
|
||||
cloneObj(obj[i]) : obj[i];
|
||||
}
|
||||
}
|
||||
return newobj;
|
||||
};
|
||||
var DateDiff = function(endDate, startDate) { //endDate和endDate是yyyy-MM-dd格式
|
||||
var iDays = parseInt(Math.abs(endDate - startDate) / 1000 / 60 / 60 / 24); //把相差的毫秒数转换为天数
|
||||
return Math.abs(iDays); //返回相差天数
|
||||
}
|
||||
//将日期转换为“YYYY-MM-DD”格式的日期
|
||||
var dateToString = function(date) {
|
||||
var today = new Date(date);
|
||||
var year = today.getFullYear();
|
||||
var month = today.getMonth() + 1;
|
||||
var day = today.getDate();
|
||||
return year + "-" + paddingZero(month) + "-" + paddingZero(day);
|
||||
}
|
||||
//空位补零
|
||||
var paddingZero = function(n) {
|
||||
//return n<10 ? "0" + n : "" + n;
|
||||
return (Array(2).join('0') + n).slice(-2);
|
||||
}
|
||||
//距离某天多少天(n:正整数为多少天之后,负整数为多少天之前),返回“YYYY-MM-DD”格式的日期
|
||||
var dateFromToday = function(date, n) {
|
||||
return dateToString(new Date(date.getTime() + n * 24 * 60 * 60 * 1000));
|
||||
}
|
||||
|
||||
|
||||
var makeData = function(dailytotalamount,temArr){
|
||||
// 查询开始日期
|
||||
// var startDate = $('#startDate').val();
|
||||
// if (startDate == "") {
|
||||
// startDate = dateToString(new Date("2017-08-16"));
|
||||
// }
|
||||
|
||||
// var endDate = $('#endDate').val();
|
||||
|
||||
// if (endDate == "") {
|
||||
// endDate = dateToString(new Date(startDate),14);
|
||||
// }
|
||||
// var endDate = MES.endDate;
|
||||
// console.log("endDate:",endDate);
|
||||
// console.log("MES.endDate:",MES.endDate);
|
||||
dailytotalamount.map( function(ele, index){
|
||||
if(ele.stdt != "sss"){
|
||||
var jj = (new Date(ele.stdt).getTime() - new Date(MES.startDate).getTime()) / 24 / 60 / 60 / 1000;
|
||||
if (jj>=0){
|
||||
temArr[2*jj] = {"amount":ele.preamount,"stdt":ele.stdt};
|
||||
temArr[2*jj+1] = {"amount":ele.actamount,"stdt":ele.stdt};
|
||||
}
|
||||
}
|
||||
})
|
||||
for (var i = 0; i < temArr.length; i++) {
|
||||
if (temArr[i] == undefined) {
|
||||
temArr[i] = PlainAmount("sss");
|
||||
}
|
||||
}
|
||||
return temArr;
|
||||
}
|
||||
|
||||
var PlainAmount = function(stdt) {
|
||||
return {
|
||||
amount: '',
|
||||
stdt: stdt,
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="cc" class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>开始时间</td>
|
||||
<td><input id="startDate" name="startDate" class="Wdate" bind-value=" justep.Date.toString(new Date(),'yyyy-MM-dd')"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-options="required:true,validType:'isBlank'" readonly/></td>
|
||||
<td>结束时间</td>
|
||||
<td><input id="endDate" name="endDate" class="Wdate"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-options="required:true,validType:'isBlank'" readonly/></td>
|
||||
<td><table class="tooltable">
|
||||
<tr>
|
||||
<td>工序</td>
|
||||
<td><input id="search_proced" name="search_proced" class="easyui-combobox" /></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td><button id = "btns" onclick="searchFun()" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true" >搜索</button></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="clearFun();">重置</a>
|
||||
</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>
|
||||
</body>
|
||||
</html>
|
||||
304
bin/WebRoot/jsp/plan/taskOrderDayPlanDetailView.jsp
Normal file
304
bin/WebRoot/jsp/plan/taskOrderDayPlanDetailView.jsp
Normal file
@ -0,0 +1,304 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var gridDetail;
|
||||
var stdt = '${stdt}';
|
||||
var displaydata;
|
||||
function SearchData(){
|
||||
$.getJSON(ext.contextPath +"/plan/taskorder/getTaskOrderDetailDayPlan.do?random="+new Date()+"&stdt="+stdt+"&search_code="+$('#search_code').textbox('getValue'),cb);
|
||||
}
|
||||
function cb(data){
|
||||
sessionStorage.setItem("urldetaildata",JSON.stringify(data));
|
||||
//console.log("JSON.stringify(data)",JSON.stringify(data));
|
||||
//console.log("data",data);
|
||||
initTaskOrderData(pcarrL);
|
||||
fLoadTable(pcarrL, PAarr);
|
||||
}
|
||||
|
||||
|
||||
var arr = eval('${result}');//获取后台表头数据
|
||||
var configColumns = function() {
|
||||
var columns = [];
|
||||
// 配置固定列表头
|
||||
columns.push([{
|
||||
"title": "任务单编号",
|
||||
"field": "tasklistcode",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
},
|
||||
{
|
||||
"title": "工艺号",
|
||||
"field": "processrealid",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
},
|
||||
{
|
||||
"title": "工单号",
|
||||
"field": "workorderno",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
},
|
||||
{
|
||||
"title": "产品编号",
|
||||
"field": "productno",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
}, {
|
||||
"title": "计划产量",
|
||||
"field": "prodamount",
|
||||
halign:'center',
|
||||
rowspan: 3
|
||||
},
|
||||
//{
|
||||
// "title": "计划开工日期",
|
||||
// "field": "pstdate",
|
||||
// halign:'center',
|
||||
// rowspan: 3
|
||||
// }, {
|
||||
// "title": "计划完工日期",
|
||||
// "field": "pendate",
|
||||
// halign:'center',
|
||||
// rowspan: 3
|
||||
// },
|
||||
{
|
||||
"title": "产量",
|
||||
colspan: arr.length * 2
|
||||
}
|
||||
]);
|
||||
// 配置表头
|
||||
columns.push(configDaysAmount());
|
||||
columns.push(configAPAmount());
|
||||
return columns;
|
||||
}
|
||||
|
||||
var configDaysAmount = function() {
|
||||
var daysAmount = [];
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
daysAmount.push({
|
||||
title:arr[i].procedurename,
|
||||
field:arr[i].procedurecode,
|
||||
colspan: 2,
|
||||
width:100,
|
||||
halign:'center',
|
||||
});
|
||||
}
|
||||
return daysAmount;
|
||||
}
|
||||
// 配置(包含实际和计划)表头的方法
|
||||
var planvalue;//记录计划的值 用于比对
|
||||
var configAPAmount = function() {
|
||||
var APAmount = [];
|
||||
var currentArr=[];
|
||||
for (var j = 0; j < 2*arr.length;j++) {
|
||||
// console.log("sed:",search_days);
|
||||
var amountobj = {
|
||||
field: "u"+j,
|
||||
rowspan: 1,
|
||||
align: 'center',
|
||||
title: '计划',
|
||||
width: '50'
|
||||
};
|
||||
if(j%2 == 0){
|
||||
amountobj.title = "计划";
|
||||
amountobj.formatter=function(value,row,index){
|
||||
if (value != ''){
|
||||
planvalue = value;
|
||||
return value;
|
||||
}else{
|
||||
planvalue = 0;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
} else {
|
||||
amountobj.title = "实际";
|
||||
amountobj.formatter=function(value,row,index){
|
||||
if (value == ''){
|
||||
return 0;
|
||||
}
|
||||
else{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
amountobj.styler= function(value,row,index){
|
||||
//console.log("planvalue",planvalue);
|
||||
//console.log("value",value);
|
||||
if (value-planvalue<0){
|
||||
return 'color:red;';
|
||||
}
|
||||
else if (value-planvalue>0){
|
||||
return 'color:green;';
|
||||
}
|
||||
};
|
||||
}
|
||||
currentArr.push(amountobj);
|
||||
}
|
||||
APAmount = currentArr;
|
||||
// 循环日期
|
||||
return APAmount;
|
||||
}
|
||||
|
||||
//对象的克隆函数
|
||||
var cloneObj = function(obj) {
|
||||
var str, newobj = obj.constructor === Array ? [] : {};
|
||||
if (typeof obj !== 'object') {
|
||||
return;
|
||||
} else if (window.JSON) {
|
||||
str = JSON.stringify(obj), //系列化对象
|
||||
newobj = JSON.parse(str); //还原
|
||||
} else {
|
||||
for (var i in obj) {
|
||||
newobj[i] = typeof obj[i] === 'object' ?
|
||||
cloneObj(obj[i]) : obj[i];
|
||||
}
|
||||
}
|
||||
return newobj;
|
||||
};
|
||||
|
||||
var makeData = function(taskprocedure,temArr){
|
||||
taskprocedure.map( function(ele, index){
|
||||
if(ele.taskcode != "sss"){
|
||||
var jj;
|
||||
for(var i=0;i<arr.length;i++)
|
||||
{
|
||||
//console.log("ele.taskcode",ele.taskcode);
|
||||
//console.log("arr[i]",arr[i].procedurecode);
|
||||
if(ele.taskcode == arr[i].procedurecode)
|
||||
{
|
||||
jj=i;
|
||||
}
|
||||
}
|
||||
if (jj>=0){
|
||||
temArr[2*jj] = {"amount":ele.preamount,"taskcode":ele.taskcode};
|
||||
temArr[2*jj+1] = {"amount":ele.actamount,"taskcode":ele.taskcode};
|
||||
}
|
||||
}
|
||||
})
|
||||
for (var i = 0; i < temArr.length; i++) {
|
||||
if (temArr[i] == undefined) {
|
||||
temArr[i] = PlainAmount("sss");
|
||||
}
|
||||
}
|
||||
console.log("temArr",temArr);
|
||||
return temArr;
|
||||
}
|
||||
|
||||
var PlainAmount = function(taskcode) {
|
||||
return {
|
||||
amount: '',
|
||||
taskcode: taskcode,
|
||||
}
|
||||
}
|
||||
|
||||
function initDetail(pcarrL, PAarr){
|
||||
//console.log("search_days", search_days);
|
||||
SearchData( );
|
||||
|
||||
}
|
||||
|
||||
// 处理后台数据,处理没有任务量的那些日期
|
||||
var initTaskOrderData = function(pcarrL) {
|
||||
var taskOrderData1 = cloneObj(JSON.parse(sessionStorage.getItem("urldetaildata")));
|
||||
sessionStorage.clear();
|
||||
for(var i = 0;i < taskOrderData1.rows.length; i++){
|
||||
var temArr = new Array(2*pcarrL);
|
||||
var tas = makeData(taskOrderData1.rows[i].taskprocedure,temArr);
|
||||
//console.log("tas",tas);
|
||||
for(var j=0;j<tas.length;j++){
|
||||
var fieldid="u"+j;
|
||||
taskOrderData1.rows[i][fieldid] = tas[j].amount;
|
||||
}
|
||||
}
|
||||
//console.log("tod",taskOrderData1);
|
||||
displaydata = taskOrderData1;
|
||||
}
|
||||
|
||||
var pcarrL, PAarr;
|
||||
$(function() {
|
||||
pcarrL = arr.length;//procedurecode array length
|
||||
PAarr = new Array(2 * pcarrL);//Plan & Act amount array
|
||||
initDetail(pcarrL,PAarr);
|
||||
});
|
||||
|
||||
|
||||
var fLoadTable = function(pcarrL, PAarr) {
|
||||
gridDetail = $("#gridDetail").datagrid({
|
||||
data: displaydata.rows,
|
||||
title : '',
|
||||
//url : ext.contextPath + '/plan/taskorder/getTaskOrderDetailDayPlan.do?id=${id}'+'&stdt=${stdt}',
|
||||
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 : 'stdt', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str = value.substring(0,10);
|
||||
return str;
|
||||
}},
|
||||
{width : '180', title : '任务单编号', field : 'tasklistcode', sortable : true, halign:'center'},
|
||||
{width : '180', title : '工序', field : 'taskcode', sortable : true, halign:'center'},
|
||||
{width : '90', title : '计划生产值', field : 'preamount', sortable : true, align:'center', halign:'center'},
|
||||
{width : '90', title : '实际生产值', field : 'actamount', sortable : true, align:'center', halign:'center'},
|
||||
|
||||
] ],*/
|
||||
columns: configColumns(),
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
sessionStorage.clear();
|
||||
//console.log("displaydata",displaydata);
|
||||
//console.log("urldetaildata",sessionStorage.getItem("urldetaildata"));
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="cc" class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="tbar">
|
||||
</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>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
<td>任务单编号</td>
|
||||
<td><input name="search_code" id="search_code" class="easyui-textbox" style="width: 150px;" value=""/></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="SearchData();">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');gridDetail.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="gridDetail" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
113
bin/WebRoot/jsp/plan/taskorderAdd.jsp
Normal file
113
bin/WebRoot/jsp/plan/taskorderAdd.jsp
Normal file
@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%request.setAttribute("TO_Flag_ERPConfirm",com.sipai.entity.plan.Taskorder.TO_Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("TO_Flag_Issued",com.sipai.entity.plan.Taskorder.TO_Flag_Issued);%>
|
||||
<%request.setAttribute("TO_Flag_Working",com.sipai.entity.plan.Taskorder.TO_Flag_Working);%>
|
||||
<%request.setAttribute("TO_Flag_Closed",com.sipai.entity.plan.Taskorder.TO_Flag_Closed);%>
|
||||
<%request.setAttribute("TO_Flag_Cancel",com.sipai.entity.plan.Taskorder.TO_Flag_Cancel);%>
|
||||
<%request.setAttribute("TO_Flag_NoPlan",com.sipai.entity.plan.Taskorder.TO_Flag_NoPlan);%>
|
||||
<%request.setAttribute("TO_Flag_ERPIssued",com.sipai.entity.plan.Taskorder.TO_Flag_ERPIssued);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/saveTaskorder.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>任务单编号</th>
|
||||
<td>
|
||||
<input id="tasklistcode" name="tasklistcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>销售单号</th>
|
||||
<td>
|
||||
<input id="salesno" name="salesno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>任务单状态</th>
|
||||
<td>
|
||||
<select id="billstatus" name="billstatus" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="${TO_Flag_ERPConfirm}" selected>ERP确认</option>
|
||||
<option value="${TO_Flag_Issued}">下发</option>
|
||||
<option value="${TO_Flag_Working}">开工</option>
|
||||
<option value="${TO_Flag_Closed}">结案</option>
|
||||
<option value="${TO_Flag_Cancel}">作废</option>
|
||||
<option value="${TO_Flag_ERPIssued}">ERP下达</option>
|
||||
<option value="${TO_Flag_NoPlan}">未排计划</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品代码</th>
|
||||
<td>
|
||||
<input id="productno" name="productno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品名称</th>
|
||||
<td>
|
||||
<input id="productname" name="productname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
<td>(销售单是0时是任务物料代码,销售单不是0时为成品名称)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料数量</th>
|
||||
<td>
|
||||
<input id="prodamount" name="prodamount" class="easyui-textbox"
|
||||
data-options="validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划开工日期</th>
|
||||
<td>
|
||||
<input id="pstdate" name="pstdate" class="Wdate" value="${nowDate}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划完工日期</th>
|
||||
<td >
|
||||
|
||||
<input id="pendate" name="pendate" class="Wdate" value="${nowDate}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据下达时间</th>
|
||||
<td >
|
||||
<input id="billruntime" name="billruntime" class="Wdate" value="${nowDate}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
109
bin/WebRoot/jsp/plan/taskorderEdit.jsp
Normal file
109
bin/WebRoot/jsp/plan/taskorderEdit.jsp
Normal file
@ -0,0 +1,109 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%request.setAttribute("TO_Flag_ERPConfirm",com.sipai.entity.plan.Taskorder.TO_Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("TO_Flag_Issued",com.sipai.entity.plan.Taskorder.TO_Flag_Issued);%>
|
||||
<%request.setAttribute("TO_Flag_Working",com.sipai.entity.plan.Taskorder.TO_Flag_Working);%>
|
||||
<%request.setAttribute("TO_Flag_Closed",com.sipai.entity.plan.Taskorder.TO_Flag_Closed);%>
|
||||
<%request.setAttribute("TO_Flag_Cancel",com.sipai.entity.plan.Taskorder.TO_Flag_Cancel);%>
|
||||
<%request.setAttribute("TO_Flag_NoPlan",com.sipai.entity.plan.Taskorder.TO_Flag_NoPlan);%>
|
||||
<%request.setAttribute("TO_Flag_ERPIssued",com.sipai.entity.plan.Taskorder.TO_Flag_ERPIssued);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/plan/taskorder/updateTaskorder.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${taskorder.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>任务单编号</th>
|
||||
<td>
|
||||
<input id="tasklistcode" name="tasklistcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${taskorder.tasklistcode}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>销售单号</th>
|
||||
<td>
|
||||
<input id="salesno" name="salesno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${taskorder.salesno}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>任务单状态</th>
|
||||
<td>
|
||||
<select id="billstatus" name="billstatus" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="${TO_Flag_Issued}"" <c:if test="${taskorder.billstatus==TO_Flag_Issued}">selected</c:if>>下发</option>
|
||||
<option value="${TO_Flag_Working}" <c:if test="${taskorder.billstatus==TO_Flag_Working}">selected</c:if>>开工</option>
|
||||
<option value="${TO_Flag_Cancel}" <c:if test="${taskorder.billstatus==TO_Flag_Cancel}">selected</c:if>>作废</option>
|
||||
<option value="${TO_Flag_NoPlan}" <c:if test="${taskorder.billstatus==TO_Flag_NoPlan}">selected</c:if>>未排计划</option>
|
||||
<option value="${TO_Flag_ERPConfirm}" <c:if test="${taskorder.billstatus==TO_Flag_ERPConfirm}">selected</c:if>>ERP确认</option>
|
||||
<option value="${TO_Flag_ERPIssued}" <c:if test="${taskorder.billstatus==TO_Flag_ERPIssued}">selected</c:if>>ERP下达</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品代码</th>
|
||||
<td>
|
||||
<input id="productno" name="productno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${taskorder.productno}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品名称</th>
|
||||
<td>
|
||||
<input id="productname" name="productname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${taskorder.productname}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料数量</th>
|
||||
<td>
|
||||
<input id="prodamount" name="prodamount" class="easyui-textbox"
|
||||
data-options="validType:'isBlank'" value="${taskorder.prodamount}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划开工日期</th>
|
||||
<td >
|
||||
<input id="pstdate" name="pstdate" class="Wdate" value="${taskorder.pstdate}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划完工日期</th>
|
||||
<td >
|
||||
|
||||
<input id="pendate" name="pendate" class="Wdate" value="${taskorder.pendate}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单据下达时间</th>
|
||||
<td >
|
||||
<input id="billruntime" name="billruntime" class="Wdate" value="${taskorder.billruntime}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
137
bin/WebRoot/jsp/plan/taskorderForSelect.jsp
Normal file
137
bin/WebRoot/jsp/plan/taskorderForSelect.jsp
Normal file
@ -0,0 +1,137 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%request.setAttribute("TO_Flag_ERPConfirm",com.sipai.entity.plan.Taskorder.TO_Flag_ERPConfirm);%>
|
||||
<%request.setAttribute("TO_Flag_Issued",com.sipai.entity.plan.Taskorder.TO_Flag_Issued);%>
|
||||
<%request.setAttribute("TO_Flag_Working",com.sipai.entity.plan.Taskorder.TO_Flag_Working);%>
|
||||
<%request.setAttribute("TO_Flag_Closed",com.sipai.entity.plan.Taskorder.TO_Flag_Closed);%>
|
||||
<%request.setAttribute("TO_Flag_Cancel",com.sipai.entity.plan.Taskorder.TO_Flag_Cancel);%>
|
||||
<%request.setAttribute("TO_Flag_NoPlan",com.sipai.entity.plan.Taskorder.TO_Flag_NoPlan);%>
|
||||
<%request.setAttribute("TO_Flag_ERPIssued",com.sipai.entity.plan.Taskorder.TO_Flag_ERPIssued);%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/plan/taskorder/getTaskOrderForSelect.do?flag=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
rowStyler: function(index,row){
|
||||
var rowstyler='';
|
||||
if(row.status=='1'){
|
||||
rowstyler+= ' background-color:#C0C0C0;color:#fff;';
|
||||
}
|
||||
return rowstyler;
|
||||
},
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '150', title : '任务单编号', field : 'tasklistcode', sortable : true, halign:'center'},
|
||||
{width : '150', title : '产品编码', field : 'productno', sortable : true, halign:'center'},
|
||||
{width : '150', title : '产品数量', field : 'prodamount', sortable : true, halign:'center'},
|
||||
{width : '150', title : '销售单号', field : 'salesno', sortable : true, align:'center', halign:'center'},
|
||||
{width : '80', title : '开始日期', field : 'pstdate', sortable : true, align:'center', halign:'center'},
|
||||
{width : '80', title : '结束日期', field : 'pendate', sortable : true, align:'center', halign:'center'},
|
||||
{width : '80', title : '单据状态', field : 'billstatus', sortable : true, align:'center', halign:'center',formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${TO_Flag_ERPConfirm}':
|
||||
return '确认';
|
||||
case '${TO_Flag_Issued}':
|
||||
return '下发';
|
||||
case '${TO_Flag_Working}':
|
||||
return '开工';
|
||||
case '${TO_Flag_Finish}':
|
||||
return '完成';
|
||||
case '${TO_Flag_Closed}':
|
||||
return '结案';
|
||||
case '${TO_Flag_Cancel}':
|
||||
return '作废';
|
||||
case '${TO_Flag_NoPlan}':
|
||||
return '未排计划';
|
||||
case '${TO_Flag_ERPIssued}':
|
||||
return 'ERP下达';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
{width : '80', title : '单据下达时间', field : 'billruntime', sortable : true, align:'center', halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
function selectOK() {
|
||||
var tasklistcode = 0;
|
||||
var jsonstr = "";
|
||||
var row = $('#grid').datagrid('getSelected');
|
||||
if (row){
|
||||
//以json格式返回数据
|
||||
jsonstr = '{"id":"'+row.id
|
||||
+'","tasklistcode":"'+row.tasklistcode
|
||||
+'","productno":"'+row.productno
|
||||
+'","prodamount":"'+row.prodamount
|
||||
+'","salesno":"'+row.salesno
|
||||
+'","pstdate":"'+row.pstdate
|
||||
+'","pendate":"'+row.pendate
|
||||
+'","billstatus":"'+row.billstatus
|
||||
+'","billruntime":"'+row.billruntime
|
||||
+'"}';
|
||||
var dataset = $.parseJSON(jsonstr);
|
||||
return dataset;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr >
|
||||
<td>销售订单</td>
|
||||
<td><input name="search_salesno" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td>
|
||||
<td>产品编码</td>
|
||||
<td><input name="search_name" class="easyui-textbox" data-options="prompt:'请输入关键字'" style="width: 150px;" value=""/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
<td><div class="datagrid-btn-separator"></div></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>
|
||||
|
||||
Reference in New Issue
Block a user