<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
<!DOCTYPE html>
|
<html>
|
<head>
|
<title>生产实绩</title>
|
<jsp:include page="../../../initlib/initAll.jsp"></jsp:include>
|
<script type="text/javascript" src="../../pub/combobox/comboboxUtil.js" charset="utf-8"></script>
|
<script type="text/javascript">
|
var inputGrid = null;
|
var outputGrid = null;
|
var curOutId = null;
|
|
$(function () {
|
//根据工单类型选择要填充的设备
|
$("#eqpType").combobox({
|
onChange: function (n) {
|
if (n == 1) {
|
$.loadComboboxData($("#eqp"), "ALLROLLERS", true);
|
} else if (n == 2) {
|
$.loadComboboxData($("#eqp"), "ALLPACKERS", true);
|
} else if (n == 3) {
|
$.loadComboboxData($("#eqp"), "ALLBOXERS", true);
|
} else if (n == 4) {
|
$.loadComboboxData($("#eqp"), "ALLFILTERS", true);
|
}
|
}
|
})
|
var d = new Date();
|
//d.setTime(d.getTime()-24*60*60*1000);
|
var sts = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
|
var end = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
|
$("#date").datebox("setValue", sts); //
|
$("#date2").datebox("setValue", end);
|
$.loadComboboxData($("#shift"), "SHIFT", true);
|
$.loadComboboxData($("#team"), "TEAM", true);
|
//$.loadComboboxData($("#eqp"),"EQUIPMENT",true);
|
$.loadComboboxData($("#eqp"), "ALLEQPS", true);
|
outputGrid = $('#outputGrid').datagrid({
|
fit: true,
|
fitColumns: false,
|
border: false,
|
remoteSort: false,
|
pagination: true,
|
//idField : 'id',
|
striped: true,
|
pageSize: 10,
|
pageList: [10, 20, 30, 40, 50],
|
singleSelect: true,
|
checkOnSelect: false,
|
selectOnCheck: false,
|
rownumbers: true,
|
nowrap: true,
|
showPageList: false,
|
columns: [[{
|
field: 'id',
|
title: '编号',
|
checkbox: true
|
}, {
|
field: 'date',
|
title: '日期',
|
width: 70,
|
align: 'center',
|
sortable: true
|
}, {
|
field: 'shift',
|
title: '班次',
|
width: 40,
|
align: 'center',
|
sortable: true
|
}, {
|
field: 'team',
|
title: '班组',
|
align: 'center',
|
width: 40,
|
sortable: true
|
}, {
|
field: 'equipment',
|
title: '机台',
|
align: 'center',
|
width: 120
|
}, {
|
field: 'workorderCode',
|
title: '工单号',
|
align: 'center',
|
width: 100
|
/* }, {
|
field: 'workorder',
|
title: '工单ID',
|
width: 100*/
|
}, {
|
field: 'matProd',
|
title: '牌号',
|
align: 'center',
|
width: 120
|
}, {
|
field: 'qty',
|
title: '产量',
|
align: 'right',
|
width: 60,
|
sortable: true
|
}, {
|
field: 'dacQty',
|
title: 'DAC产量',
|
align: 'right',
|
width: 60,
|
sortable: true
|
|
}, {
|
field: 'badQty',
|
title: '剔除',
|
align: 'right',
|
width: 60,
|
sortable: true
|
}, {
|
field: 'unit',
|
title: '单位',
|
align: 'center',
|
width: 40
|
}, {
|
field: 'stim',
|
title: '实际开始时间',
|
align: 'center',
|
width: 130,
|
sortable: true
|
}, {
|
field: 'etim',
|
title: '实际结束时间',
|
align: 'center',
|
width: 130,
|
sortable: true
|
}, {
|
field: 'runTime',
|
title: '运行时间',
|
align: 'right',
|
width: 60,
|
sortable: true,
|
formatter: function (value, row, index) {
|
return (value / 60).toFixed(2);
|
}
|
}, {
|
field: 'stopTime',
|
title: '停机时间',
|
align: 'right',
|
width: 60,
|
sortable: true,
|
formatter: function (value, row, index) {
|
return (value / 60).toFixed(2);
|
}
|
}, {
|
field: 'timeunit',
|
title: '单位',
|
align: 'center',
|
width: 40,
|
formatter: function (value, row, index) {
|
return "小时";
|
}
|
}, {
|
field: 'stopTimes',
|
title: '停机数',
|
align: 'right',
|
width: 40,
|
sortable: true
|
}, {
|
field: 'lastRecvTime',
|
title: '最后数据接收时间',
|
align: 'center',
|
width: 130,
|
sortable: true
|
}, {
|
field: 'lastUpdateTime',
|
title: '最后数据修改时间',
|
align: 'center',
|
width: 130,
|
sortable: true
|
}, {
|
field: 'isFeedback',
|
title: '反馈状态 ',
|
align: 'center',
|
width: 60,
|
formatter: function (value, row, index) {
|
return value == 0 ? '<span style="color:red">未反馈<span>' : value == 1 ? '<span style="color:green">已反馈MES<span>' : '<span style="color:green">已反馈统计员<span>';
|
}
|
}, {
|
field: 'feedbackTime',
|
title: '反馈时间',
|
align: 'center',
|
width: 120,
|
sortable: true
|
}, {
|
field: 'feedbackUser',
|
title: '操作用户 ',
|
align: 'center',
|
width: 60
|
}, {
|
field: 'createUserName',
|
title: '创建人姓名',
|
align: 'center',
|
width: 70,
|
sortable: true,
|
hidden: 'true'
|
}, {
|
field: 'createUserTime',
|
title: '创建时间',
|
align: 'center',
|
width: 150,
|
sortable: true,
|
hidden: 'true'
|
}, {
|
field: 'updateUserName',
|
title: '修改人姓名',
|
align: 'center',
|
width: 70,
|
sortable: true
|
}, {
|
field: 'updateUserTime',
|
title: '最后修改时间',
|
align: 'center',
|
width: 130,
|
sortable: true
|
}]],
|
toolbar: '#outputToolbar',
|
url: "${pageContext.request.contextPath}/pms/stat/getAllOutputs.do",
|
queryParams: $("#outputForm").form("getData"),
|
onLoadError: function (data) {
|
$.messager.show('提示', "查询异常", 'error');
|
},
|
onLoadSuccess: function () {
|
$(this).datagrid('tooltip');
|
},
|
onRowContextMenu: function (e, rowIndex, rowData) {
|
e.preventDefault();
|
$(this).datagrid('unselectAll').datagrid('uncheckAll');
|
$(this).datagrid('selectRow', rowIndex);
|
if (("${sessionInfo.resourcesMap['/pms/wcp/orderResultToCounter.do/stjb']}" != null &&
|
"${sessionInfo.resourcesMap['/pms/wcp/orderResultToCounter.do/stjb']}" != "" &&
|
rowData.isFeedback < 1) || rowData.isFeedback == 2 && "${sessionInfo.resourcesMap['/pms/wcp/orderResult.do/stjb']}" != null &&
|
"${sessionInfo.resourcesMap['/pms/wcp/orderResult.do/stjb']}" != "") {
|
$('#outputMenu').menu('show', {
|
left: e.pageX - 10,
|
top: e.pageY - 5
|
});
|
}
|
|
},
|
onClickRow: function (rowIndex, rowData) {
|
curOutId = rowData.id;
|
getAllInputsByOutput(rowData.id);
|
}
|
});
|
inputGrid = $('#inputGrid').datagrid({
|
fit: true,
|
fitColumns: false,
|
border: false,
|
remoteSort: false,
|
//pagination : true,
|
idField: 'id',
|
striped: true,
|
pageSize: 20,
|
pageList: [10, 20, 30, 40, 50],
|
singleSelect: true,
|
checkOnSelect: false,
|
selectOnCheck: false,
|
nowrap: false,
|
showPageList: false,
|
rownumbers: true,
|
columns: [[{
|
field: 'id',
|
title: '编号',
|
checkbox: true
|
}, {
|
field: 'mat',
|
title: '物料名称',
|
width: 200,
|
align: 'center'
|
}, {
|
field: 'qty',
|
title: '消耗量',
|
align: 'right',
|
width: 80,
|
sortable: true,
|
formatter: function (value, row, index) {
|
if (row.unit == "万支")
|
return row.dacQty == 0 || value * 10000 / row.dacQty < row.lval || value * 10000 / row.dacQty > row.uval ? '<span style="color:red">' + value + '</span>' : '<span">' + value + '</span>';
|
return row.dacQty == 0 || value / row.dacQty < row.lval || value / row.dacQty > row.uval ? '<span style="color:red">' + value + '</span>' : '<span">' + value + '</span>';
|
}
|
}
|
, {
|
field: 'unit',
|
title: '单位',
|
align: 'left',
|
width: 50
|
}, {
|
field: 'orignalData',
|
title: '原始计数',
|
align: 'right',
|
width: 150,
|
sortable: true,
|
formatter: function (value, row, index) {
|
try {
|
if(row.mat.indexOf("卷烟纸") != -1){
|
return Math.floor(value);
|
}
|
}catch (e) {
|
}
|
return value;
|
}
|
}, {
|
field: 'inputQty',
|
title: '高架出库',
|
align: 'center',
|
width: 150,
|
|
|
}, {
|
field: 'createUserName',
|
title: '创建人姓名',
|
align: 'center',
|
width: 70,
|
sortable: true,
|
hidden: 'true'
|
}, {
|
field: 'createUserTime',
|
title: '创建时间',
|
align: 'center',
|
width: 150,
|
sortable: true,
|
hidden: 'true'
|
}, {
|
field: 'updateUserName',
|
title: '修改人姓名',
|
align: 'center',
|
width: 70,
|
sortable: true
|
}, {
|
field: 'updateUserTime',
|
title: '最后修改时间',
|
align: 'center',
|
width: 130,
|
sortable: true
|
}]],
|
//toolbar : '#inputToolbar',
|
onLoadSuccess: function () {
|
$(this).datagrid('tooltip');
|
},
|
onRowContextMenu: function (e, rowIndex, rowData) {
|
e.preventDefault();
|
$(this).datagrid('unselectAll').datagrid('uncheckAll');
|
$(this).datagrid('selectRow', rowIndex);
|
$('#inputMenu').menu('show', {
|
left: e.pageX - 10,
|
top: e.pageY - 5
|
});
|
}
|
});
|
});
|
|
/**
|
* 查询
|
*/
|
function getAllOutputs() {
|
outputGrid.datagrid({
|
url: "${pageContext.request.contextPath}/pms/stat/getAllOutputs.do",
|
queryParams: $("#outputForm").form("getData"),
|
onLoadError: function (data) {
|
$.messager.show('提示', "查询异常", 'error');
|
}
|
});
|
inputGrid.datagrid("loadData", []);
|
}
|
|
function clearOutputForm() {
|
$("#outputForm input").val(null);
|
}
|
|
function deleteOutput() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var row = outputGrid.datagrid('getSelected');
|
if (row.isFeedback == 1 || row.isFeedback == 2){
|
$.messager.show('提示', "请将已反馈的数据撤回后再删除!", 'error');
|
return false;
|
}
|
parent.$.messager.confirm('操作提示', '您是否要删除当前生产数据?', function (b) {
|
if (b) {
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post('${pageContext.request.contextPath}/pms/stat/deleteOutput.do', {
|
id: row.id
|
}, function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
getAllOutputs();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, 'JSON');
|
}
|
}
|
});
|
}
|
|
function beatchDeleteOutput() {
|
var booleandel = true;
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var rows = outputGrid.datagrid('getChecked');
|
var ids = [];
|
var mats = [];
|
if (rows.length > 0) {
|
parent.$.messager.confirm('确认', '请确认批量删除产量数据?', function (r) {
|
if (r) {
|
for (var i = 0; i < rows.length; i++) {
|
if (rows[i].isFeedback == 1 || rows[i].isFeedback == 2) {
|
booleandel = false;
|
} else {
|
ids.push(rows[i].id);
|
}
|
|
}
|
if(!booleandel){
|
$.messager.show('提示', "请将已反馈的数据撤回后再删除!", 'error');
|
return false;
|
}
|
parent.$.messager.progress({
|
title: '提示',
|
text: '数据处理中,请稍后....'
|
});
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post('${pageContext.request.contextPath}/pms/stat/batchDeleteOutput.do',
|
{
|
ids: ids.join(','),
|
|
}, function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
parent.$.messager.progress('close');
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
getAllOutputs();
|
} else {
|
$.messager.show('提示', json.msg, 'info');
|
}
|
}, "JSON");
|
}
|
}
|
});
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '请勾选要需要操作的产量数据!'
|
});
|
}
|
}
|
|
function goToOutputAddJsp() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var dialog = parent.$.modalDialog({
|
title: '生产数据添加',
|
width: 640,
|
height: 580,
|
href: '${pageContext.request.contextPath}/pms/stat/goToOutputAddJsp.do?workshop=1',
|
buttons: [{
|
text: '保存',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var f = dialog.find("#form");
|
if (f.form("validate") && f.find("#workorder").attr("value")) {
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post("${pageContext.request.contextPath}/pms/stat/addOutput.do", f.form("getData"), function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
getAllOutputs();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
} else {
|
f.find("input[name='workorderCode']").focus();
|
}
|
},
|
onLoad: function () {
|
var f = dialog.find('#form'), ret = $.fn.dialog.defaults.onLoad();
|
f.find("input[name='workorderCode']").focus();
|
return ret;
|
}
|
}]
|
});
|
}
|
|
function goToOutputEditJsp() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var dialog = parent.$.modalDialog({
|
title: '生产数据编辑',
|
width: 660,
|
height: 665,
|
href: '${pageContext.request.contextPath}/pms/stat/goToOutputEditJsp.do?id=' + outputGrid.datagrid('getSelected').id,
|
buttons: [{
|
text: '保存',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var f = dialog.find("#form");
|
if (f.form("validate") && f.find("#workorder").attr("value")) {
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post("${pageContext.request.contextPath}/pms/stat/editOutput.do", f.form("getData"), function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
getAllOutputs();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
} else {
|
f.find("input[name='workorderCode']").focus();
|
}
|
}
|
}],
|
onLoad: function () {
|
var f = dialog.find('#form'), ret = $.fn.dialog.defaults.onLoad();
|
f.find("input[name='workorderCode']").focus();
|
return ret;
|
}
|
});
|
}
|
|
function getAllInputsByOutput(id) {
|
inputGrid.datagrid({
|
url: "${pageContext.request.contextPath}/pms/stat/getAllInputsByOutput.do?id=" + id
|
});
|
}
|
|
function deleteInput() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var row = inputGrid.datagrid('getSelected');
|
parent.$.messager.confirm('操作提示', '您是否要删除当前消耗数据?', function (b) {
|
if (b) {
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post('${pageContext.request.contextPath}/pms/stat/deleteInput.do', {
|
id: row.id
|
}, function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
var index = inputGrid.datagrid("getRowIndex", row);
|
inputGrid.datagrid("deleteRow", index);
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, 'JSON');
|
}
|
}
|
});
|
}
|
|
function beatchDeleteIntput() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var rows = inputGrid.datagrid('getChecked');
|
var ids = [];
|
if (rows.length > 0) {
|
parent.$.messager.confirm('确认', '请确认批量删除消耗数据?', function (r) {
|
if (r) {
|
for (var i = 0; i < rows.length; i++) {
|
ids.push(rows[i].id);
|
}
|
parent.$.messager.progress({
|
title: '提示',
|
text: '数据处理中,请稍后....'
|
});
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post('${pageContext.request.contextPath}/pms/stat/batchDeleteInput.do',
|
{
|
ids: ids.join(',')
|
}, function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
parent.$.messager.progress('close');
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
getAllInputsByOutput(curOutId);
|
|
} else {
|
$.messager.show('提示', json.msg, 'info');
|
}
|
}, "JSON");
|
}
|
}
|
});
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '请勾选要需要操作的消耗数据!'
|
});
|
}
|
}
|
|
//跳转到类型添加页面
|
function goToInputAddJsp() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var row = outputGrid.datagrid('getSelected');
|
if (row) {
|
var dialog = parent.$.modalDialog({
|
title: '消耗数据添加',
|
width: 640,
|
height: 290,
|
href: '${pageContext.request.contextPath}/pms/stat/goToInputAddJsp.do?id=' + row.id + "&workorder=" + row.workorder,
|
buttons: [{
|
text: '保存',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var f = dialog.find("#form");
|
if (f.form("validate")) {
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post("${pageContext.request.contextPath}/pms/stat/addInput.do", f.form("getData"), function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
getAllInputsByOutput(row.id);
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
}
|
}
|
}]
|
});
|
} else {
|
$.messager.show('提示', "请选择一条产出数据!", 'info');
|
}
|
}
|
|
//跳转到类型编辑页面
|
function goToInputEditJsp() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var row = outputGrid.datagrid('getSelected');
|
var dialog = parent.$.modalDialog({
|
title: '消耗数据编辑',
|
width: 620,
|
height: 320,
|
href: "${pageContext.request.contextPath}/pms/stat/goToInputEditJsp.do?iid=" + inputGrid.datagrid('getSelected').id + "&id=" + row.id + "&workorder=" + row.workorder,
|
buttons: [{
|
text: '保存',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var f = dialog.find("#form");
|
if (f.form("validate")) {
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post("${pageContext.request.contextPath}/pms/stat/editInput.do", f.form("getData"), function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
getAllInputsByOutput(row.id);
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
}
|
}
|
}]
|
});
|
}
|
|
function sendDataToMES(flag) {//1单个反馈2按页反馈
|
var idOrIds;
|
if (flag == 1) {
|
idOrIds = outputGrid.datagrid('getSelected').id;
|
}
|
if (flag == 2) {
|
var rows = outputGrid.datagrid('getRows');
|
|
if (rows.length == 0) {
|
$.messager.show('提示', '本页无数据!', 'error');
|
return;
|
}
|
|
var ids = [];
|
|
for (var i = 0; i < rows.length; i++) {
|
ids.push(rows[i].id);
|
}
|
|
idOrIds = ids.join(",");
|
}
|
$.messager.progress({
|
title: '工单反馈',
|
msg: '反馈给mes系统,请等待...',
|
interval: '1000'
|
});
|
$.post("${pageContext.request.contextPath}/pms/stat/sendDataToMES.do?type=2", {
|
"idOrIds": idOrIds,
|
"feedbackUser": "${sessionInfo.user.name}"
|
}, function (json) {
|
$.messager.progress('close');
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
getAllOutputs();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
|
}
|
|
//导出execl
|
function exportExcel() {
|
var recordUrl = "${pageContext.request.contextPath}/pms/stat/exportQtyInfo.do?date=" + $("#outputForm").form("getData").date + "&date2=" + $("#outputForm").form("getData").date2 + "&team=" + $("#outputForm").form("getData").team + "&shift=" + $("#outputForm").form("getData").shift + "&equipment=" + $("#outputForm").form("getData").equipment + "&eqpType=" + $("#outputForm").form("getData").eqpType;
|
var scWidth = parent.window.screen.width / 2; //屏幕分辨率的宽:
|
var scHight = parent.window.screen.height / 2; //屏幕分辨率的高:
|
parent.window.open(recordUrl, "ExcelWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes, resizable=no,copyhistory=no,width=" + scWidth + ",height=" + scHight + ",left=400,top=200");
|
}
|
|
/* 反馈MES ->工单实际反馈 */
|
function sendMes() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var boolean2 = true;
|
var rows = outputGrid.datagrid('getChecked');
|
//var rows = outputGrid.datagrid('getRows');
|
var ids = [];
|
if (rows.length > 0) {
|
parent.$.messager.confirm('确认', '确定将选中数据反馈MES吗?', function (r) {
|
if (r) {
|
for (var i = 0; i < rows.length; i++) {
|
if (rows[i].isFeedback != 2) {
|
boolean2 = false;
|
} else {
|
ids.push(rows[i].id);
|
}
|
}
|
if (boolean2) {
|
parent.$.messager.progress({
|
title: '提示',
|
text: '数据处理中,请稍后....'
|
});
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post('${pageContext.request.contextPath}/pms/wcp/orderResult.do?type=2',
|
{
|
ids: ids.join(',')
|
}, function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
parent.$.messager.progress('close');
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
getAllOutputs();
|
} else {
|
$.messager.show('提示', json.msg, 'info');
|
}
|
}, "JSON");
|
}
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '请选择正确的数据!!'
|
});
|
}
|
}
|
});
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '请选择数据!!'
|
});
|
}
|
|
}
|
|
/**
|
* 撤销反馈统计员
|
*/
|
|
function revokeCounter(){
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
// 数据是否可反馈标志(已反馈数据不可再反馈)
|
var boolean1 = true;
|
var rows = outputGrid.datagrid('getChecked');
|
//var rows = outputGrid.datagrid('getRows');
|
var ids = [];
|
if (rows.length > 0) {
|
parent.$.messager.confirm('确认', '确定将选中数据撤销反馈统计员吗?', function (r) {
|
if (r) {
|
for (var i = 0; i < rows.length; i++) {
|
if ( rows[i].isFeedback == 2) {
|
|
ids.push(rows[i].id);
|
} else {
|
boolean1 = false;
|
}
|
}
|
if (boolean1) {
|
parent.$.messager.progress({
|
title: '提示',
|
text: '数据处理中,请稍后....'
|
});
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post('${pageContext.request.contextPath}/pms/wcp/revokeCounter.do?type=2',
|
{
|
ids: ids.join(',')
|
}, function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
parent.$.messager.progress('close');
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
getAllOutputs();
|
} else {
|
$.messager.show('提示', json.msg, 'info');
|
}
|
}, "JSON");
|
}
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '已选择的数据包含未反馈的数据!!'
|
});
|
}
|
}
|
});
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '请选择数据!!'
|
});
|
}
|
}
|
|
/**
|
* 反馈统计员
|
*/
|
function sendCounter() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
// 数据是否可反馈标志(已反馈数据不可再反馈)
|
var boolean1 = true;
|
var rows = outputGrid.datagrid('getChecked');
|
//var rows = outputGrid.datagrid('getRows');
|
var ids = [];
|
if (rows.length > 0) {
|
parent.$.messager.confirm('确认', '确定将选中数据反馈统计员吗?', function (r) {
|
if (r) {
|
for (var i = 0; i < rows.length; i++) {
|
if (rows[i].isFeedback == 1 || rows[i].isFeedback == 2) {
|
boolean1 = false;
|
} else {
|
ids.push(rows[i].id);
|
}
|
}
|
if (boolean1) {
|
parent.$.messager.progress({
|
title: '提示',
|
text: '数据处理中,请稍后....'
|
});
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post('${pageContext.request.contextPath}/pms/wcp/orderResultToCounter.do?type=2',
|
{
|
ids: ids.join(',')
|
}, function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
parent.$.messager.progress('close');
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
getAllOutputs();
|
} else {
|
$.messager.show('提示', json.msg, 'info');
|
}
|
}, "JSON");
|
}
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '请选择未反馈的数据!!'
|
});
|
}
|
}
|
});
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '请选择数据!!'
|
});
|
}
|
}
|
</script>
|
</head>
|
<body class="easyui-layout" data-options="fit : true,border : false">
|
<div data-options="region:'north',border:false,split:true,title:'产出数据'" style="height:400px;">
|
<div id="outputToolbar" style="display: none;width:100%;">
|
<form id="outputForm" style="margin:4px 0px 0px 0px">
|
<div class="topTool">
|
<fieldset>
|
<div>
|
<input type="hidden" name="workShop" value="1"/><!-- 车间code -->
|
<span class="label">班次:</span>
|
<select id="shift" name="shift" class="easyui-combobox"
|
data-options="panelHeight:'auto',width:120,editable:false"></select>
|
</div>
|
<div>
|
<span class="label">班组:</span>
|
<select id="team" name="team" class="easyui-combobox"
|
data-options="panelHeight:'auto',width:120,editable:false"></select>
|
</div>
|
<div>
|
<span class="label">设备类型:</span>
|
<select id="eqpType" name="eqpType" class="easyui-combobox"
|
data-options="panelHeight:'100',width:120,editable:false">
|
<option value="">全部</option>
|
<option value="1">卷烟机</option>
|
<option value="2">包装机</option>
|
<option value="3">封箱机</option>
|
</select>
|
</div>
|
<div>
|
<span class="label">机台:</span>
|
<select id="eqp" name="equipment" class="easyui-combobox"
|
data-options="panelHeight:'100',width:120,editable:false"></select>
|
</div>
|
|
<div>
|
<span class="label">反馈状态:</span>
|
<select name="isFeedback"
|
class="easyui-combobox"
|
data-options="panelHeight:'auto',editable:false,width:120">
|
<!-- 1,已反馈0,未反馈-->
|
<option value="">全部</option>
|
<option value="2">已反馈统计员</option>
|
<option value="0">未反馈</option>
|
</select>
|
</div>
|
<div>
|
<span class="label">生产日期:</span>
|
<input id="date" name="date" type="text" class="easyui-datebox" datefmt="yyyy-MM-dd"
|
style="width:120px"/>
|
</div>
|
<div>
|
<span class="label">到:</span>
|
<input id="date2" name="date2" type="text" class="easyui-datebox" datefmt="yyyy-MM-dd"
|
style="width:120px"/>
|
</div>
|
</fieldset>
|
</div>
|
</form>
|
<div class="easyui-toolbar">
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/stat/getAllOutputs.do/stjb']}">
|
<a onclick="getAllOutputs()" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-zoom'">查询</a>
|
<a onclick="clearOutputForm();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-table-refresh'">重置</a>
|
</c:if>
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/stat/goToOutputAddJsp.do/stjb']}">
|
<a onclick="goToOutputAddJsp();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-plugin-add'">添加</a>
|
</c:if>
|
<!-- <a onclick="sendDataToMES(2);" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-standard-package-go'" title="反馈本页本页数据到MES系统">反馈本页</a>
|
-->
|
<%-- <c:if test="${not empty sessionInfo.resourcesMap['/pms/wcp/orderResult.do/stjb']}">
|
<a onclick="sendMes();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-plugin'">反馈MES</a>
|
</c:if>--%>
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/wcp/orderResultToCounter.do/stjb']}">
|
<a onclick="sendCounter();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-plugin'">反馈统计员</a>
|
</c:if>
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/wcp/orderResultToCounter.do/stjb']}">
|
<a onclick="revokeCounter();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-plugin'">撤销反馈</a>
|
</c:if>
|
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/stat/batchDeleteOutput.do/stjb']}">
|
<a onclick="beatchDeleteOutput();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="iconCls:'icon-standard-cancel',plain:true">批量删除</a>
|
</c:if>
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/stat/out.do/stjb']}">
|
<a onclick="exportExcel();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-table-refresh'">导出</a>
|
</c:if>
|
</div>
|
</div>
|
<table id="outputGrid"></table>
|
</div>
|
|
<div data-options="region:'center',border:false,split:true,title:'消耗数据'">
|
<div class="easyui-toolbar">
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/stat/goToInputAddJsp.do/stjb']}">
|
<a onclick="goToInputAddJsp()" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-plugin-add'">新增</a>
|
</c:if>
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/stat/batchDeleteInput.do/stjb']}">
|
<a onclick="beatchDeleteIntput()" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="iconCls:'icon-standard-cancel',plain:true">批量删除</a>
|
</c:if>
|
</div>
|
<table id="inputGrid"></table>
|
</div>
|
|
<div id="outputMenu" class="easyui-menu" style="width: 80px; display: none;">
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/stat/goToOutputEditJsp.do/stjb']}">
|
<div onclick="goToOutputEditJsp()" data-options="iconCls:'icon-standard-plugin-add'">编辑</div>
|
</c:if>
|
<!-- <div onclick="sendDataToMES(1);" data-options="iconCls:'icon-standard-package-go'">反馈MES</div> -->
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/stat/deleteOutput.do/stjb']}">
|
<div onclick="deleteOutput();" data-options="iconCls:'icon-standard-plugin-delete'">删除</div>
|
</c:if>
|
</div>
|
|
<div id="inputMenu" class="easyui-menu" style="width: 80px; display: none;">
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/stat/goToInputEditJsp.do/stjb']}">
|
<div onclick="goToInputEditJsp()" data-options="iconCls:'icon-standard-plugin-add'">编辑</div>
|
</c:if>
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/stat/deleteInput.do/stjb']}">
|
<div onclick="deleteInput();" data-options="iconCls:'icon-standard-plugin-delete'">删除</div>
|
</c:if>
|
</div>
|
</body>
|
</html>
|