Files
SIPAIIS_WMS_JSSW/bin/WebRoot/jsp/quality/yieldStatistic_EveryDay.jsp

213 lines
6.7 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ 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 loadworkorders(date){
$("#workorderno").combobox({
url : ext.contextPath + '/work/workorder/getActlist4Select.do?nowdate='+date,
valueField : 'workorderno',
textField : 'workorderno',
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 workorderno = $("#workorderno").combobox('getValue');
var dt=$('#nowdate').val();
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/quality/statistics_Yield/getDayYield.do?workorderno='+workorderno+'&dt='+dt,
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: 'procedureName', 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() {
loadworkorders('${dt}');
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="nowdate" name="nowdate" class="Wdate" value="${dt }" style="width: 180px;"
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',onpicked:onchangedate})"
></td>
<td>工单</td>
<td><input id="workorderno" name="workorderno" 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>