Files
SIPAIIS_WMS_JSSW/bin/WebRoot/jsp/material/materialDateScheduleList.jsp

280 lines
10 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ 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>
<style>
.textchoose {
position: relative;
border: 1px solid #95B8E7;
background-color: #46A3FF;
color:#FFFFFF;
text-align:center;
width:100% ;
height:100%;
line-height:90px;
vertical-align: middle;
display: inline-block;
overflow: hidden;
white-space: nowrap;
margin: 0;
padding: 0;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
</style>
<script type="text/javascript">
var grid;
var editIndex = undefined;//当前编辑行索引
var flag=false;//当flag为true grid可编辑 为假时不可编辑
var addFun = function() {
var dialog = parent.ext.modalDialog({
iframeId:'iframeadd',
title : '添加班组',
url : ext.contextPath + '/work/group/add.do?iframeId=iframeadd',
buttons : [ {
text : '保存',
handler : function() {
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
}
} ]
});
};
var editFlag= function(){
flag=true;
}
//编辑行
var editFun = function (index, field){
if(!endEditing()){
return false;
}
if(flag){
editIndex = index;
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
var ed = $('#grid').datagrid('getEditor', {index:editIndex,field:field});
($(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target)).focus();
}
};
function endEditing(){//清除editor
if (editIndex == undefined){return true;}
if ($('#grid').datagrid('validateRow', editIndex)){
$('#grid').datagrid('endEdit', editIndex);
editIndex = undefined;
return true;
} else {
return false;
}
}
var saveFun = function() {
if($('#grid').datagrid('getSelected')==null){
top.$.messager.alert('提示','请先选择要保存的记录','info');
}else{
flag=false;
var id = $('#grid').datagrid('getSelected').id;
var url;
editIndex = $('#grid').datagrid('getRowIndex',id);
url = ext.contextPath + '/material/materialdateschedule/update.do';
//判断必输项
if(!$('#grid').datagrid('validateRow', editIndex)){
top.$.messager.alert('提示','请输入必输项','info');
return false;
}
var unit_ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'inventoryfrontline'});
var inventoryfrontline = $(unit_ed.target).textbox('getValue');
var unit_pd = $('#grid').datagrid('getEditor', {index:editIndex,field:'pickingday'});
var pickingday = $(unit_pd.target).textbox('getValue');
var unit_icp = $('#grid').datagrid('getEditor', {index:editIndex,field:'inventorycountpostpartum'});
var inventorycountpostpartum = $(unit_icp.target).textbox('getValue');
var unit_r = $('#grid').datagrid('getEditor', {index:editIndex,field:'remark'});
var remark = $(unit_r.target).textbox('getValue');
$.post(url,{id:id,inventoryfrontline:inventoryfrontline,pickingday:pickingday,
inventorycountpostpartum:inventorycountpostpartum,
remark:remark},function(data){
if(data.res == '1'){
top.$.messager.alert('提示','保存成功','info',function (){
$('#grid').datagrid('reload');
$('#gridad').datagrid('reload');
});
}else{
top.$.messager.alert('提示','保存失败','info');
}
},'json');
}
};
var getwo=function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/material/materialdateschedule/getMaterialDateSchedules.do?woid=' + $('#search_wo').combobox('getValue')+'&search_day='+$('#search_day').val(),
striped : true,
rownumbers : true,
pagination : true,
singleSelect: false,
ctrlSelect:true,
nowrap:false,
selectOnCheck: false,
checkOnSelect: false,
onClickCell: editFun,
idField : 'id',
pageSize : 50,
pageList : [ 20, 50, 100],
columns : [ [
{checkbox:true , field : 'ck'},
{width : '150', title : 'BOM物料项目', field : 'bomprojects', sortable : true, halign:'center'},
{width : '150', title : '产前线边库存盘点', field : 'inventoryfrontline', sortable : true,editor:'textbox', halign:'center'},
{width : '100', title : '当日领料', field : 'pickingday', sortable : true, editor:'textbox',halign:'center'},
{width : '100', title : '当日计划消耗量', field : 'plannedconsumption', sortable : true, halign:'center'},
{width : '150', title : '当日产后线边库存盘点', field : 'inventorycountpostpartum', sortable : true, editor:'textbox',halign:'center'},
{width : '100', title : '当日实际消耗量', field : 'actualconsumptionday', sortable : true, halign:'center'},
{width : '100', title : '差额', field : 'thedifferent', sortable : true, halign:'center'},
{width : '150', title : '差额超出预计百分比', field : 'exceedsplannedpercentage', sortable : true, halign:'center'},
{width : '100', title : '说明', field : 'remark', sortable : true,editor:'textbox', halign:'center'},
] ],
toolbar : '#toolbarqe',
onLoadSuccess : function(data) {
$('.iconImg').attr('src', ext.pixel_0);
$('#prepare').text(data.prepare);
}
});
gridad = $('#gridad').datagrid({
title : '',
url : ext.contextPath + '/material/materialdateschedule/getTaskList.do?woid=' + $('#search_wo').combobox('getValue'),
striped : true,
rownumbers : true,
pagination : true,
singleSelect: false,
ctrlSelect:true,
nowrap:false,
selectOnCheck: false,
checkOnSelect: false,
idField : 'id',
pageSize : 50,
pageList : [ 20, 50, 100],
columns : [ [
{checkbox:true , field : 'ck'},
{width : '100', title : 'BOM物料项目', field : 'bomprojects', sortable : true, halign:'center'},
{width : '120', title : '当前进度计划消耗量', field : 'currentplanconsumption', sortable : true, halign:'center'},
{width : '150', title : '当前进度实际累计消耗量', field : 'curactualconsumptionday', sortable : true, halign:'center'},
{width : '130', title : '任务单计划消耗总量', field : 'totaltasksplanned', sortable : true, halign:'center'},
{width : '100', title : '线边库存量', field : 'linemargin', sortable : true, halign:'center'},
{width : '100', title : '库存总量', field : 'totalinventory', sortable : true, halign:'center'},
{width : '130', title : '此任务单可支配量', field : 'tasklistused', sortable : true, halign:'center'},
{width : '80', title : '缺口量', field : 'amountofgap', sortable : true, halign:'center'},
] ],
toolbar : '#toolbarad',
onLoadSuccess : function(data) {
$('.iconImg').attr('src', ext.pixel_0);
$('#prodamount').text(data.prodamount);
$('#act').text(data.act);
}
});
};
function getmo(){
$('#search_wo').combobox({
url : ext.contextPath + '/plan/taskorder/getTaskorder1.do?sdate='+$('#search_date').val(),
valueField:'id',
textField:'tasklistcode',
method:'get'
});
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<table class="tooltable">
<tr>
<td>任务单下达日期</td>
<td><input id="search_date" name="search_date" class="Wdate" value=""
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-{%d}'})" onchange="getmo()" readonly/></td>
<td>任务单号</td>
<td>
<input id="search_wo" name="search_wo" class="easyui-combobox" style="width:200px"/></td>
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="getwo();">搜索</a>
</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>
<div class="easyui-tabs" style="width:1100px;height:500px;" >
<div title="日计划" style="padding:0px;">
<div id="toolbarqe" style="display: none;">
<Form id="searchForm">
<table>
<tr>
<td>日计划日期</td>
<td><input id="search_day" name="search_day" class="Wdate" value=""
onfocus="WdatePicker({onpicked:getwo(),startDate:'%y',dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-{%d}'})" readonly /></td>
<td>本日日计划产品数:</td>
<td id='prepare'></td>
<td>
<a style="position:absolute; left:850px;top:8px;" href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true"
onclick="editFlag();">编辑</a>
</td>
<td>
<a style="position:absolute; left:900px;top:8px;" href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
onclick="saveFun();">保存</a>
</td>
</tr>
</table>
</Form>
</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="任务单" closable="true" data-options="closable:false">
<div id="toolbarad" style="display: none;">
<table>
<tr>
<td>本任务单产品数:</td>
<td id='prodamount'></td>
<td>本任务单当前成品数:</td>
<td id='act'></td>
</tr>
</table>
</div>
<div id="adcc" class="easyui-layout" data-options="fit:true,border:false">
<div data-options="region:'center',fit:true,border:false">
<table id="gridad" data-options="fit:true,border:false"></table>
</div>
</div>
</div>
</div>
<br />
</body>
</html>