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

218 lines
7.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ 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>
<style type="text/css">
.subtotal { font-weight: bold; }/*合计单元格样式*/
</style>
<script type="text/javascript">
var grid;
var viewFun = function(id) {
grid.datagrid('clearChecked');
var dialog = parent.ext.modalDialog({
title : '查看检验单信息',
width:950,
url : ext.contextPath + '/quality/statistics_CI/viewCISub.do?id=' + id,
buttons : [ {
text : '关闭',
handler : function() {
dialog.dialog('destroy');
}
} ]
});
};
var editFun = function(id) {
var dialog = parent.ext.modalDialog({
title : '编辑',
width:950,
url : ext.contextPath + '/quality/statistics_CI/editCISub.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 + '/quality/statistics_CI/deleteCISub.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 + '/quality/statistics_CI/deletesCISub.do', {ids:datas} , function(data) {
if(data>0){
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
grid.datagrid('reload');
grid.datagrid('clearChecked');
}else{
top.$.messager.alert('提示','删除失败','info');
}
});
}
});
}
};
// 日期在原有日期基础上增加days天数默认增加1天
function addDate(date, hours) {
if (hours == undefined || hours == '') {
hours = 2;
}
var date = new Date(date);
date.setHours(date.getHours() + hours);
var month = date.getMonth() + 1;
var day = date.getDate();
var h = date.getHours();
var mm = date.getMinutes();
return date.getFullYear() + '-' + getFormatDate(month) + '-' + getFormatDate(day)+' '+getFormatDate(h)+':'+getFormatDate(mm);
}
// 日期月份/天的显示如果是1位数则在前面加上'0'
function getFormatDate(arg) {
if (arg == undefined || arg == '') {
return '00';
}
var re = arg + '';
if (re.length < 2) {
re = '0' + re;
}
return re;
}
/* function onchangedate(){
var date=$("#nowdate").val();
loadworkorders(date);
} */
function loadprocedures(){
$("#procedureno").combobox({
url : ext.contextPath + '/process/taskprocedure/getAllProcedurelist4Select.do',
valueField : 'procedurecode',
textField : 'procedurename',
method:'get',
panelHeight:'auto',
onSelect: function () {
/* var workorderno = $("#workorderno").combobox('getValue');
$("#procedureno").combobox({
url : ext.contextPath + '/work/workorder/getProcedurelist4Select.do?workorderno='+workorderno,
valueField : 'id',
textField : 'name',
method:'get',
panelHeight:'auto',
onLoadSuccess: function(record){
if($("#procedureno").combobox('getData').length>0){
$("#procedureno").combobox('select','${sessionScope.procedure}');
}
},
onSelect: function () {
}
}); */
}
});
}
function loadgridItems(){
var sdt = $("#sdt").val();
var edt = $("#edt").val();
var procedureno = $("#procedureno").combobox('getValue');
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/quality/statistics_Yield/getProcedureYield.do?procedureno='+procedureno+'&sdt='+sdt+'&edt='+edt,
striped : true,
rownumbers : true,
pagination : true,
ctrlSelect:true,
singleSelect: false,
selectOnCheck: false,
checkOnSelect: false,
idField : 'id',
pageSize : 50,
pageList : [ 20, 50, 100],
columns : [ [
{width : '80', title : '工单编号', field: 'workorderno', halign:'center' , align:'center'},
{width : '80', title : '工单产品数', field: 'outputNum', halign:'center' , align:'center'},
{width : '100', title : '生产投入数', field : 'inputNum', halign:'center' , align:'center'},
{width : '80', title : '直通率', field: 'rolledYield', halign:'center' , align:'center'},
{width : '80', title : '一次返工率', field: 'repair1Yield', halign:'center', align:'center'},
{width : '80', title : '二次返工率', field: 'repair2Yield', halign:'center',align:'center' },
{width : '80', title : '综合良率', field: 'comprehensiveYield', halign:'center', align:'center'},
] ],
toolbar : '#toolbar',
onLoadSuccess : function(data) {
$('.iconImg').attr('src', ext.pixel_0);
}
});
}
$(function() {
loadprocedures();
loadgridItems();
});
</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 id="sdt" name=sdt class="Wdate" value="${dt }" style="width: 180px;"
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
></td>
<td>结束日期</td>
<td><input id="edt" name="edt" class="Wdate" value="${dt }" style="width: 180px;"
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
></td>
<td>工序</td>
<td><input id="procedureno" name="procedureno" class="easyui-combobox" style="width: 180px;" value=""/></td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="loadgridItems('','');">搜索</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',border:false">
<table id="grid" data-options="fit:true,border:false"></table>
</div>
</body>
</html>