Files
SIPAIIS_WMS_JSSW/bin/WebRoot/jsp/plan/dailyPlanAddOldOrderPlan.jsp
2026-01-16 14:13:44 +08:00

162 lines
5.8 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ 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>