天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

410 lines
17 KiB

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.ProductPetrospect.ProductArchivesModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
产品档案
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.QPList() %>
<table id="showTable">
<tr>
<td>
<table id="condiTable">
<tr>
<th align="right">
<%=Html.QV(p=>p.ERMISCODE) %>
</th>
<td align="left">
<%=Html.QC(p => p.ERMISCODE)%>
</td>
</tr>
</table>
</td>
</tr>
<tr align="left">
<td align="left">
<div id="tabsid" class="easyui-tabs" style="width: auto; height: auto;">
<div id='t1' title="产品档案" style="padding: 20px; display: none; background: ">
</div>
<div id="t2" title="产品加工追溯" data-options="closable:false" style="overflow: auto;
padding: 20px; display: none;">
</div>
<div id="t3" title="产品批次追溯" data-options="closable:false" style="padding: 20px; display: none;">
</div>
</div>
</td>
</tr>
</table>
<table id="QDateGrid">
</table>
<%=Html.QPEnd() %>
<%=Html.HiddenFor(p=>p.ListProductArchivesJson)%>
<style>
.buttons
{
display: block;
border-spacing: 0px;
float: left;
margin: 0 0 0 0;
border: 1px solid #dedede;
border-top: 1px solid #eee;
border-color: #b6d0f3;
font-family: "Lucida Grande" , Tahoma, Arial, Verdana, sans-serif;
font-size: 12px;
line-height: 130%;
text-decoration: none;
font-weight: bold;
color: #565656;
cursor: pointer;
padding: 5px 10px 6px 7px; /* Links */
width: 70px;
}
</style>
<script language="javascript" type="text/javascript">
$(function () {
$('#tabsid').tabs({
border: false,
onSelect: function (title) {
var ermiscode = $('#ERMISCODE').val();
var maincode = $('#MAINCODE').val();
if (ermiscode == "" && maincode == "") {
MSI("提示", "请输入产品条码或是总成条码!")
return false;
}
if (title == "产品档案") {
//alert(title);
GetExportParameterInfo(ermiscode, maincode);
}
else if (title == "产品加工追溯") {
//alert(title);
GetExportParameterInfo1(ermiscode, maincode);
}
else if (title == "产品批次追溯") {
//alert(title);
GetExportParameterInfo2(ermiscode, maincode);
}
}
});
});
//查询加工参数信息
function GetExportParameter() {
//debugger;
var ermiscode = $('#ERMISCODE').val();
var maincode = $('#MAINCODE').val();
if (ermiscode == "" && maincode == "") {
MSI("提示", "请输入产品条码或是总成条码!")
return false;
}
//$('#QDateGrid').empty();
var pp = $('#tabsid').tabs('getSelected');
var tab = pp.panel('options').tab;
var title = tab[0].innerText;
if (title == "产品档案") {
GetExportParameterInfo(ermiscode, maincode);
}
else if (title == "产品加工追溯") {
GetExportParameterInfo1(ermiscode, maincode);
}
else if (title == "产品批次追溯") {
GetExportParameterInfo2(ermiscode, maincode);
}
}
//查询加工参数信息方法,并绑定到页面上
function GetExportParameterInfo(ermiscode, maincode) {
//清空列表中原数据,防止重复添加
//$('#QDateGrid').datagrid("loadData", new Array());
$('#QDateGrid').datagrid({
title: '',
width: 1158,
height: 386,
fitColumns: false,
idField: 'PARAMETER',
columns: [
[
{ field: 'MACHINECODDE', title: '设备编号', width: 200, align: 'left' },
{ field: 'PARAMETERNAME', title: '加工参数名称', width: 200, align: 'left' },
{ field: 'PARAMETERVALUE', title: '加工参数值', width: 200, align: 'left' }
]
]
});
$('#QDateGrid').datagrid("loadData", new Array());
//获取列表对象
var dataInfo = $('#QDateGrid').datagrid('getData');
//获取加工参数信息
$.ajax({
url: "/ProductArchives/GetExportParameter",
data: {
'ERMISCODE': ermiscode,
'MAINCODE': maincode
},
type: "POST",
cache: false,
dataType: "json",
async: false,
success: function (data) {
if (data == null || data == '') {
//alert("!");
MSI("提示", "未查到数据!")
} else {
for (var i = 0; i < data.length; i++) {
var insertInfo = {
MACHINECODDE: data[i].MACHINECODDE,
PARAMETERNAME: data[i].PARADESCRIBE,
PARAMETERVALUE: data[i].MEMO
};
dataInfo.rows.push(insertInfo);
//dataInfo.rows[0].style.backgroundColor = "red";
}
$('#QDateGrid').datagrid('loadData', dataInfo);
}
}
});
}
//产品加工追溯
function GetExportParameterInfo1(ermiscode, maincode) {
//清空列表中原数据,防止重复添加
//$('#QDateGrid').datagrid("loadData", new Array());
$('#QDateGrid').datagrid({
title: '',
width: 1158,
height: 386,
fitColumns: true,
idField: 'PARAMETER',
columns: [
[
{ field: 'PRODUCTCODE', title: '产品条码', width: 160, align: 'left' },
{ field: 'MAINCODE', title: '总成条码', width: 160, align: 'left' },
{ field: 'MACHINECODDE', title: '设备编码', width: 160, align: 'left' },
{ field: 'MACHINENAME', title: '设备名称', width: 150, align: 'left' },
{ field: 'OPERATEDDATE', title: '加工完成时间', width: 150, align: 'left' }
]
]
});
$('#QDateGrid').datagrid("loadData", new Array());
//获取列表对象
var dataInfo = $('#QDateGrid').datagrid('getData');
//获取加工参数信息
$.ajax({
url: "/MainOperationReview/GetMainOperationReviews",
data: {
'ERMISCODE': ermiscode,
'MAINCODE': maincode
},
type: "POST",
cache: false,
dataType: "json",
async: false,
success: function (data) {
if (data == null || data == '') {
//alert("没查到数据!");
MSI("提示", "未查到数据!")
} else {
for (var i = 0; i < data.length; i++) {
var insertInfo = {
PRODUCTCODE: data[i].PRODUCTCODE,
MAINCODE: data[i].MAINCODE,
MACHINECODDE: data[i].MACHINECODDE,
MACHINENAME: data[i].MACHINENAME,
STATUS: data[i].STATUS,
OPERATESTATE: data[i].OPERATESTATE,
OPERATEDDATE: data[i].CREATEDATESTR
};
dataInfo.rows.push(insertInfo);
}
$('#QDateGrid').datagrid('loadData', dataInfo);
}
}
});
}
//产品批次追溯
function GetExportParameterInfo2(ermiscode, maincode) {
//debugger;
//清空列表中原数据,防止重复添加
//$('#QDateGrid').datagrid("loadData", new Array());
$('#QDateGrid').datagrid({
title: '',
width: 1158,
height: 386,
fitColumns: true,
idField: 'PARAMETER',
columns: [
[
{ field: 'PRODUCTCODE', title: '产品条码', width: 160, align: 'left' },
{ field: 'MAINCODE', title: '总成条码', width: 160, align: 'left' },
{ field: 'MACHINENAME', title: '设备名称', width: 150, align: 'left' },
{ field: 'MATERIALTYPE', title: '零件类别', width: 160, align: 'left' },
{ field: 'MATERIALCODE', title: '物料号', width: 150, align: 'left' },
{ field: 'MATERIALBATCH', title: '批次号', width: 150, align: 'left' },
{ field: 'CREATEUSERNAME', title: '操作用户', width: 150, align: 'left' },
{ field: 'CREATEDATE', title: '投料时间', width: 150, align: 'left' }
]
]
});
$('#QDateGrid').datagrid("loadData", new Array());
//获取列表对象
var dataInfo = $('#QDateGrid').datagrid('getData');
//获取加工参数信息
$.ajax({
url: "/ProductInjection/GetExportParameter",
data: {
'ERMISCODE': ermiscode,
'MAINCODE': maincode
},
type: "POST",
cache: false,
dataType: "json",
async: false,
success: function (data) {
//alert(data);
if (data == null || data == '') {
//alert("没查到数据!");
MSI("提示", "未查到数据!")
} else {
for (var i = 0; i < data.length; i++) {
var insertInfo = {
PRODUCTCODE: data[i].PRODUCTCODE,
MAINCODE: data[i].MAINCODE,
MACHINENAME: data[i].MACHINENAME,
MATERIALTYPE: data[i].MATERIALTYPE,
MATERIALCODE: data[i].MATERIALCODE,
MATERIALBATCH: data[i].MATERIALBATCH,
CREATEUSERNAME: data[i].CREATEUSERNAME,
CREATEDATE: data[i].CREATEDATESTR
};
dataInfo.rows.push(insertInfo);
}
$('#QDateGrid').datagrid('loadData', dataInfo);
}
}
});
}
//导出
function Export() {
//零件条码
var ermiscode = $('#ERMISCODE').val();
var maincode = $('#MAINCODE').val();
//工序类别
// var processtype = $('#PROCESSTYPE').val();
//校验必输项
if (ermiscode == "" && maincode == "") {
MSI("提示", "请输入产品条码或是总成条码!")
return false;
}
var pp = $('#tabsid').tabs('getSelected');
var tab = pp.panel('options').tab;
var title = tab[0].innerText;
if (title == "产品档案") {
var date = getDate();
var savePath = "产品档案信息" + date;
submitByButton("ExportExcelNew?savePath=" + savePath + "&ermiscode=" + ermiscode + "&maincode=" + maincode);
}
else if (title == "产品加工追溯") {
submitByButton("/MainOperationReview/ExportExcelNew?ermiscode=" + ermiscode + "&maincode=" + maincode);
}
else if (title == "产品批次追溯") {
submitByButton("/ProductInjection/ExportExcelNew?ermiscode=" + ermiscode + "&maincode=" + maincode);
}
}
//重置
function Reset() {
//清空零件条码
$('#ERMISCODE').val("");
$('#MAINCODE').val("");
//清空列表
$('#QDateGrid').empty();
$('#QDateGrid').datagrid("loadData", new Array());
ClearTabColor();
//默认选择骨架注塑
//var defultbutton = $("input[type='button']")[0];
//defultbutton.style.background = "#feffff";
//默认工序类别是骨架注塑
//$('#PROCESSTYPE').val(defultbutton.id);
}
//恢复默认工序类别按钮显示颜色
function ClearTabColor() {
var buttonList = $("input[type='button']");
for (var i = 0; i < buttonList.length; i++) {
buttonList[i].style.background = "#ecf3ff";
}
}
//弹出文件另存为对话框并选择下载路径
function ShowSaveAs() {
var fd = new ActiveXObject("MSComDlg.CommonDialog");
fd.Filter = "All Files (*.*)";
fd.FilterIndex = 2;
// 必须设置MaxFileSize. 否则出错
fd.MaxFileSize = 128;
//获取当前日期
var date = getDate();
fd.FileName = "产品档案信息" + date;
//如果点击取消按钮,触发错误事件
fd.Cancelerror = true;
// 显示对话框
fd.ShowSave();
return fd;
}
//获取当前日期
function getDate() {
var myDate = new Date();
var year = myDate.getFullYear(); //年
var month = myDate.getMonth() + 1; //月
var day = myDate.getDate(); //日
var date = year + "";
if (month < 10)
date += "0";
date += month + "";
if (day < 10)
date += "0";
date += day;
return date;
}
//
function clickButton(t) {
var button = t;
//先将所有按钮的颜色显示为未点击的状态
ClearTabColor();
//更改点击的按钮的显示颜色
button.style.background = "#feffff";
var ermiscode = $('#ERMISCODE').val();
var maincode = $('#MAINCODE').val();
if (ermiscode == "" && maincode == "") {
MSI("提示", "请输入产品条码或是总成条码!")
return false;
}
$('#QDateGrid').empty();
if (button.id == "14") {
GetExportParameterInfo1(ermiscode, maincode);
}
else if (button.id == "15") {
GetExportParameterInfo2(ermiscode, maincode);
}
else {
GetExportParameterInfo(ermiscode, maincode);
}
}
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
<table cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<%=Html.QTButtonSearch("ProductArchives", "GetExportParameter", "GetExportParameter()")%>
<%=Html.QTButton("export", "ExportExcelNew", QMFrameWork.WebUI.IconCls.redo, "Export()", (s, f) => { return true; })%>
<%=Html.QTButton("reset", "", QMFrameWork.WebUI.IconCls.reset, "Reset()", (s, f) => { return true; })%>
</td>
</tr>
</table>
</asp:Content>