308 lines
11 KiB
Plaintext
308 lines
11 KiB
Plaintext
|
|
<%@page import="com.sun.rowset.internal.Row"%>
|
||
|
|
<%@ 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 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:'num'});
|
||
|
|
var num = $(unit_ed.target).textbox('getValue');
|
||
|
|
var unit_r = $('#grid').datagrid('getEditor', {index:editIndex,field:'remark'});
|
||
|
|
var remark = $(unit_r.target).textbox('getValue');
|
||
|
|
$.post(url,{id:id,num:num,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 pickingFun = function(id) {
|
||
|
|
var dialog = parent.ext.modalDialog({
|
||
|
|
title : '领料',
|
||
|
|
url : ext.contextPath + '/material/auxiliarymaterialpicking/picking.do?id=' + id,
|
||
|
|
buttons : [ {
|
||
|
|
text : '保存',
|
||
|
|
handler : function() {
|
||
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||
|
|
}
|
||
|
|
} ]
|
||
|
|
});
|
||
|
|
};
|
||
|
|
var rejectFun = function(id) {
|
||
|
|
var dialog = parent.ext.modalDialog({
|
||
|
|
title : '退料',
|
||
|
|
url : ext.contextPath + '/material/auxiliarymaterialpicking/reject.do?id=' + id,
|
||
|
|
buttons : [ {
|
||
|
|
text : '保存',
|
||
|
|
handler : function() {
|
||
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||
|
|
}
|
||
|
|
} ]
|
||
|
|
});
|
||
|
|
};
|
||
|
|
var num=0;
|
||
|
|
$(function() {
|
||
|
|
|
||
|
|
$('#tasklist').combobox({
|
||
|
|
url : ext.contextPath + '/plan/taskorder/getTaskorder1.do',
|
||
|
|
valueField:'id',
|
||
|
|
textField:'tasklistcode',
|
||
|
|
method:'get',
|
||
|
|
onLoadSuccess: function (data) {
|
||
|
|
if (data ==null) {
|
||
|
|
$.messager.alert("系统提示", "数据库异常,请联系管理员!", "warning");
|
||
|
|
} else {
|
||
|
|
var data1 = $('#tasklist').combobox('getData'); //赋默认值
|
||
|
|
if (data1.length > 0) {
|
||
|
|
$("#tasklist ").combobox('select', data1[0].id);
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onSelect: function () {
|
||
|
|
$('#workno').combobox({
|
||
|
|
url : ext.contextPath + '/work/workorder/getlistbyplanid.do?taskorderid=' + $('#tasklist').combobox('getValue'),
|
||
|
|
valueField:'id',
|
||
|
|
textField:'workorderno',
|
||
|
|
method:'get',
|
||
|
|
onLoadSuccess: function (data) {
|
||
|
|
if (data ==null) {
|
||
|
|
$.messager.alert("系统提示", "数据库异常,请联系管理员!", "warning");
|
||
|
|
} else {
|
||
|
|
var data1 = $('#workno').combobox('getData'); //赋默认值
|
||
|
|
if (data1.length > 0) {
|
||
|
|
$("#workno ").combobox('select', data1[0].id);
|
||
|
|
grid = $('#grid').datagrid({
|
||
|
|
view: detailview,
|
||
|
|
detailFormatter:function(index,row){
|
||
|
|
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||
|
|
},
|
||
|
|
title : '',
|
||
|
|
url : ext.contextPath + '/material/auxiliarymaterialpicking/getAuxiliaryMaterialPickings.do',
|
||
|
|
queryParams: {
|
||
|
|
|
||
|
|
workno:$('#workno').combobox('getValue'),
|
||
|
|
},
|
||
|
|
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 : 'num', sortable : true,editor:'textbox', halign:'center'},
|
||
|
|
{width : '100', title : '单位', field : 'unit', sortable : true,halign:'center'},
|
||
|
|
{width : '100', title : '最后一次领料人', field : 'pickingpeople', sortable : true, halign:'center'},
|
||
|
|
{width : '150', title : '最后一次领料日期', field : 'pickingdate', sortable : true,halign:'center',formatter : function(value, row) {
|
||
|
|
if(value!=null){
|
||
|
|
return value.substring(0,16);
|
||
|
|
}
|
||
|
|
}},
|
||
|
|
{width : '150', title : '领(退)料', field : 'keyword', sortable : true,halign:'center'},
|
||
|
|
{width : '100', title : '备注', field : 'remark', sortable : true,editor:'textbox', halign:'center'},
|
||
|
|
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||
|
|
|
||
|
|
var str = '';
|
||
|
|
if (row.statusworkorder=="0" ||row.statusworkorder=="1"||row.statusworkorder=="2") {
|
||
|
|
str += '<img class="iconImg ext-icon-table_add" title="领料" onclick="pickingFun(\''+row.id+'\');"/>';
|
||
|
|
|
||
|
|
str += '<img class="iconImg ext-icon-table_delete" title="退料" onclick="rejectFun(\''+row.id+'\');"/>';
|
||
|
|
}
|
||
|
|
return str;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
] ],
|
||
|
|
toolbar : '#toolbar',
|
||
|
|
onLoadSuccess : function(data) {
|
||
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
||
|
|
//下面的代码可以让字表默认展开
|
||
|
|
/* if(num==0){
|
||
|
|
num=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 + '/material/auxiliarymaterialpicking/getAuxiliaryMaterialPickingpids.do?pid='+row.id,
|
||
|
|
fitColumns:true,
|
||
|
|
ctrlSelect:true,
|
||
|
|
singleSelect: false,
|
||
|
|
selectOnCheck: false,
|
||
|
|
checkOnSelect: false,
|
||
|
|
striped: true,
|
||
|
|
idField : 'id',
|
||
|
|
rownumbers:true,
|
||
|
|
//loadMsg:'',
|
||
|
|
height:'auto',
|
||
|
|
columns : [ [
|
||
|
|
{checkbox:true , field : 'ck'},
|
||
|
|
{width : '150', title : 'BOM物料项目', field : 'bomprojects', sortable : true, halign:'center'},
|
||
|
|
{width : '150', title : '数量', field : 'num', sortable : true,editor:'textbox', halign:'center'},
|
||
|
|
{width : '100', title : '单位', field : 'unit', sortable : true,halign:'center'},
|
||
|
|
{width : '100', title : '最后一次领料人', field : 'pickingpeople', sortable : true, halign:'center'},
|
||
|
|
{width : '150', title : '最后一次领料日期', field : 'pickingdate', sortable : true,halign:'center',formatter : function(value, row) {
|
||
|
|
if(value!=null){
|
||
|
|
return value.substring(0,16);
|
||
|
|
}
|
||
|
|
}},
|
||
|
|
{width : '150', title : '领(退)料', field : 'keyword', sortable : true,halign:'center'},
|
||
|
|
{width : '100', title : '备注', field : 'remark', sortable : true,editor:'textbox', halign:'center'},
|
||
|
|
] ],
|
||
|
|
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>
|
||
|
|
<form id="searchForm">
|
||
|
|
<table >
|
||
|
|
<tr>
|
||
|
|
<tr>
|
||
|
|
<td>任务单号</td>
|
||
|
|
<td>
|
||
|
|
<input id="tasklist" name="tasklist" class="easyui-combobox" style="width:200px"/></td>
|
||
|
|
<td>工单号</td>
|
||
|
|
<td>
|
||
|
|
<input id="workno" name="workno" class="easyui-combobox" style="width:200px"/></td>
|
||
|
|
<td>领退料日期</td>
|
||
|
|
<td><input id="search_date" name="search_date" class="Wdate" value=""
|
||
|
|
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" readonly/></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>
|