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.
801 lines
35 KiB
801 lines
35 KiB
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PunchBom.aspx.cs" Inherits="MESWebSite.Manage.PunchBom" %>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head runat="server">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
<link href="/CSS/Basics.css" rel="stylesheet" />
|
|
<link href="/Scripts/jquery-easyui-1.4.3/themes/metro/easyui.css" rel="stylesheet" type="text/css" />
|
|
<link href="/Scripts/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" type="text/css" />
|
|
<link href="/Scripts/jquery-easyui-1.4.3/themes/color.css" rel="stylesheet" type="text/css" />
|
|
<script src="/Scripts/jquery-easyui-1.4.3/jquery.min.js" type="text/javascript"></script>
|
|
<script src="/Scripts/jquery-easyui-1.4.3/jquery.easyui.min.js" type="text/javascript"></script>
|
|
<script src="/Scripts/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
|
|
<script src="/Scripts/MyJs.js" type="text/javascript"></script>
|
|
<style>
|
|
#w td {
|
|
padding: 5px 5px;
|
|
text-align: left;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
#w .title {
|
|
vertical-align: middle;
|
|
text-align: right;
|
|
width: 80px;
|
|
height: 40px;
|
|
}
|
|
|
|
p {
|
|
padding: 5px;
|
|
font-size: small;
|
|
font-family: 微软雅黑;
|
|
}
|
|
|
|
.datagrid {
|
|
text-align: center;
|
|
}
|
|
</style>
|
|
|
|
<title>总成BOM</title>
|
|
</head>
|
|
<body>
|
|
<form id="form1" runat="server">
|
|
<div class="top">
|
|
<table style="width: 100%">
|
|
<tr style="display: flex;flex-direction: row; flex-wrap: wrap;">
|
|
<td><span class="title" style="width: 150px">总成BOM信息</span>
|
|
</td>
|
|
<td style="width: 260px;"></td>
|
|
<td style="width: 260px;"></td>
|
|
<td style="width: 360px;">总成零件号:
|
|
<input type="text" id="PartNo1_s" style="width: 140px;" /></td>
|
|
<td style="width: 80px;"><a class="topsearchBtn">查询</a></td>
|
|
|
|
<td style="width: 80px">
|
|
<a class="topaddBtn">新增</a>
|
|
</td>
|
|
<td style="width: 80px">
|
|
<a class="toppenBtn">编辑</a>
|
|
</td>
|
|
<td style="width: 80px">
|
|
<a class="topdelBtn">删除</a>
|
|
</td>
|
|
<td style="width: 80px">
|
|
<a class="topexcelBtn" id="openexcel">导入</a>
|
|
</td>
|
|
<td style="width: 80px">
|
|
<a class="topexcelBtn" id="exportbtn">导出</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<table id="tb" title="总成BOM信息" style="width: 99%;">
|
|
</table>
|
|
|
|
<!-- 编辑窗口 -->
|
|
<div id="w" style="padding: 10px; visibility: hidden" title="编辑">
|
|
<table cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
工位:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_3" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'StationID',textField: 'StationNo'">
|
|
</select><span style="color: red; font-size: 18px; vertical-align: middle;">*</span>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
总成(零件号):
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_1" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select><span style="color: red; font-size: 18px; vertical-align: middle;">*</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
半成品(零件号):
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_2" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select><span style="color: red; font-size: 18px; vertical-align: middle;">*</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
是否校验:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="checkbox" name="IsCheck" id="IsCheck" value="1" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
亮灯地址:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="AddressNo" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
串口号:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="PortName" class="easyui-combobox" style="width: 234px; height: 36px;" data-options="editable:false">
|
|
<option value="0">COM1</option>
|
|
<option value="1">COM2</option>
|
|
<option value="2">COM3</option>
|
|
<option value="3">COM4</option>
|
|
<option value="4">COM5</option>
|
|
<option value="5">COM6</option>
|
|
<option value="6">COM7</option>
|
|
<option value="7">COM8</option>
|
|
<option value="8">COM9</option>
|
|
<option value="9">COM10</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<!--关键零件 -->
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
<%--关键零件1:--%>
|
|
校验零件1:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_4" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
校验零件2:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_5" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
校验零件3:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_6" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
<%--关键零件1:--%>
|
|
校验零件4:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_10" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
校验零件5:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_11" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
校验零件6:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_12" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<!--显示零件 -->
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
<%--关键零件1:--%>
|
|
显示零件1:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_7" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
显示零件2:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_8" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
显示零件3:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_9" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
<%--关键零件1:--%>
|
|
显示零件4:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_13" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
显示零件5:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_14" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 130px;">
|
|
<p>
|
|
显示零件6:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<select id="fl_id_15" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'PartNo',textField: 'PartName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<!-- 编辑窗口 - footer -->
|
|
<div id="ft" style="padding: 10px; text-align: center; background-color: #f9f9f9; visibility: hidden">
|
|
<a class="saveBtn" id="saveBtn">保存</a>
|
|
</div>
|
|
|
|
<!-- Excel导入导出窗口 -->
|
|
<div id="wexcel" style="padding: 10px; visibility: hidden" title="Excel模板">
|
|
<table >
|
|
<tr>
|
|
<td>
|
|
<a class="topexcelBtn" id="cexcel">选择文件</a>
|
|
<span id="input_file"></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding-top: 20px;">
|
|
<a href="../Excel/装配总成bom模板.xls" class="topexcelBtn" style="text-decoration: none;">导出模板</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="ftexcel" style="padding: 10px; text-align: center; background-color: #f9f9f9; visibility: hidden">
|
|
<a class="saveBtn" id="saveBtnexcel">导入</a>
|
|
</div>
|
|
|
|
<div hidden="hidden">
|
|
<asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
|
|
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
|
|
<%--<asp:Button ID="ImportExcel" runat="server" Text="导入Excel" OnClick="ImportExcel_Click" />--%>
|
|
<input type="file" id="input01" runat="server" class="file" onchange="inutChange()" />
|
|
</div>
|
|
<input id="UserID" type="text" hidden="hidden" runat="server" />
|
|
|
|
<script>
|
|
|
|
/**************** 全局变量 ***************/
|
|
var PrimaryID; //要编辑的id
|
|
var dg = $('#tb'); //表格
|
|
var isEdit = false; //是否为编辑状态
|
|
|
|
/**************** DOM加载 ***************/
|
|
$(function () {
|
|
$.ajaxSetup({
|
|
cache: false //关闭AJAX缓存
|
|
});
|
|
|
|
|
|
//新增按钮点击
|
|
$('.topaddBtn').first().click(function () {
|
|
isEdit = false;
|
|
$('#w').window('open');
|
|
});
|
|
|
|
//编辑按钮点击
|
|
$('.toppenBtn').first().click(function () {
|
|
isEdit = true;
|
|
initEidtWidget();
|
|
});
|
|
|
|
//删除按钮
|
|
$('.topdelBtn').first().click(function () {
|
|
$.messager.confirm('提示框', '你确定要删除吗?', function (r) {
|
|
if (r) {
|
|
deleteInfos();
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
//搜索按钮
|
|
$('.topsearchBtn').first().click(function () {
|
|
SearchInfo();
|
|
});
|
|
|
|
//保存按钮
|
|
$('#saveBtn').bind('click', function () {
|
|
SaveInfo(isEdit);
|
|
});
|
|
|
|
//导入excel按钮点击
|
|
$('#openexcel').first().click(function () {
|
|
$('#wexcel').window('open');
|
|
});
|
|
$('#cexcel').bind('click', function () {
|
|
$('#input01').click();
|
|
});
|
|
//保存excel按钮点击
|
|
$('#saveBtnexcel').bind('click', function () {
|
|
//$('#ImportExcel').click();
|
|
$('#Button1').click();
|
|
});
|
|
|
|
//编辑窗口加载
|
|
$('#w').window({
|
|
modal: true,
|
|
closed: true,
|
|
minimizable: false,
|
|
maximizable: false,
|
|
collapsible: false,
|
|
width: 460,
|
|
height: 900,
|
|
footer: '#ft',
|
|
top: 20,
|
|
onBeforeClose: function () { clearw(); },
|
|
onBeforeOpen: function () {
|
|
$('#w').css('visibility', 'visible'); $('#ft').css('visibility', 'visible');
|
|
reloadfl_id();
|
|
}
|
|
|
|
});
|
|
$('#wexcel').window({
|
|
modal: true,
|
|
closed: true,
|
|
minimizable: false,
|
|
maximizable: false,
|
|
collapsible: false,
|
|
width: 450,
|
|
height: 200,
|
|
footer: '#ftexcel',
|
|
top: 20,
|
|
onBeforeClose: function () { clearw(); },
|
|
onBeforeOpen: function () { $('#wexcel').css('visibility', 'visible'); $('#ftexcel').css('visibility', 'visible'); }
|
|
});
|
|
|
|
dg = $('#tb').datagrid({
|
|
fitColumns: true,
|
|
nowrap: false,
|
|
striped: true,
|
|
collapsible: false,
|
|
url: "/HttpHandlers/PunchBomHandler.ashx?method=QueryList",
|
|
//sortName: 'sortNumber',
|
|
//sortOrder: 'asc',
|
|
remoteSort: false,
|
|
columns: [[
|
|
{ field: 'ID', title: 'ID', hidden: true },
|
|
{ field: 'StationNo', title: '工位编号', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo1', title: '总成(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName1', title: '总成名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo2', title: '半成品(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName2', title: '半成品名称', sortable: 'true', width: 10 },
|
|
{
|
|
field: 'IsCheck', title: '是否校验', sortable: 'true', width: 10,
|
|
formatter: function (value) {
|
|
if (value == 0) {
|
|
return '否';
|
|
} else {
|
|
return '是';
|
|
}
|
|
}
|
|
},
|
|
{ field: 'AddressNo', title: '亮灯地址', sortable: 'true', width: 10 },
|
|
{ field: 'PortName', title: '端口号', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo3', title: '校验零件1(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName3', title: '校验零件1名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo4', title: '校验零件2(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName4', title: '校验零件2名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo5', title: '校验零件3(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName5', title: '校验零件3名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo9', title: '校验零件4(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName9', title: '校验零件4名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo10', title: '校验零件5(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName10', title: '校验零件5名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo11', title: '校验零件6(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName11', title: '校验零件6名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo6', title: '显示零件1(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName6', title: '显示零件1名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo7', title: '显示零件2(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName7', title: '显示零件2名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo8', title: '显示零件3(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName8', title: '显示零件3名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo12', title: '显示零件4(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName12', title: '显示零件4名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo13', title: '显示零件5(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName13', title: '显示零件5名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo14', title: '显示零件6(零件号)', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName14', title: '显示零件6名称', sortable: 'true', width: 10 }
|
|
]],
|
|
|
|
pagination: true,//表示在datagrid设置分页
|
|
rownumbers: true,
|
|
singleSelect: true
|
|
});
|
|
|
|
dg.datagrid('getPager').pagination({
|
|
pageSize: 10,
|
|
pageNumber: 1,
|
|
pageList: [10, 20, 30, 40, 50],
|
|
beforePageText: '第',//页数文本框前显示的汉字
|
|
afterPageText: '页 共 {pages} 页',
|
|
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
|
|
});
|
|
});
|
|
|
|
/**************** 主要业务程序 ***************/
|
|
//新增 / 编辑
|
|
function SaveInfo(isEdit) {
|
|
|
|
var BomID = isEdit == true ? PrimaryID : 0;
|
|
var PartNo1 = $('#fl_id_1').combo('getValue');
|
|
var PartNo2 = $('#fl_id_2').combo('getValue');
|
|
var StationNo = $('#fl_id_3').combo('getValue');
|
|
var PartNo3 = $('#fl_id_4').combo('getValue');
|
|
var PartNo4 = $('#fl_id_5').combo('getValue');
|
|
var PartNo5 = $('#fl_id_6').combo('getValue');
|
|
|
|
var PartNo6 = $('#fl_id_7').combo('getValue');
|
|
var PartNo7 = $('#fl_id_8').combo('getValue');
|
|
var PartNo8 = $('#fl_id_9').combo('getValue');
|
|
|
|
var partNo9 = $('#fl_id_10').combo('getValue');
|
|
var partNo10 = $('#fl_id_11').combo('getValue');
|
|
var partNo11 = $('#fl_id_12').combo('getValue');
|
|
|
|
var partNo12 = $('#fl_id_13').combo('getValue');
|
|
var partNo13 = $('#fl_id_14').combo('getValue');
|
|
var partNo14 = $('#fl_id_15').combo('getValue');
|
|
|
|
var IsCheck = $('#IsCheck').is(':checked') ? 1 : 0;
|
|
var AddressNo = "";
|
|
AddressNo=$('#AddressNo').val();
|
|
//var PortName = $('#PortName').combo('getValue');
|
|
var PortName = $('#PortName').combo('getText');
|
|
var reg = /^\+?[1-9][0-9]*$/;
|
|
|
|
if (PartNo1 == "") {
|
|
$.messager.alert('提示', '总成不能为空,请重新输入', 'warning');
|
|
return;
|
|
}
|
|
if (PartNo2 == "") {
|
|
$.messager.alert('提示', '半成品不能为空,请重新输入', 'warning');
|
|
return;
|
|
}
|
|
|
|
if (StationNo == "") {
|
|
$.messager.alert('提示', '工位不能为空,请重新输入', 'warning');
|
|
return;
|
|
}
|
|
|
|
var arrayObj = new Array();
|
|
arrayObj.pop(PartNo2);
|
|
if (PartNo3 != "") {
|
|
arrayObj.pop(PartNo3);
|
|
}
|
|
if (PartNo4 != "") {
|
|
arrayObj.pop(PartNo4);
|
|
}
|
|
if (PartNo5 != "") {
|
|
arrayObj.pop(PartNo5);
|
|
}
|
|
if (PartNo6 != "") {
|
|
arrayObj.pop(PartNo6);
|
|
}
|
|
if (PartNo7 != "") {
|
|
arrayObj.pop(PartNo7);
|
|
}
|
|
if (PartNo8 != "") {
|
|
arrayObj.pop(PartNo8);
|
|
}
|
|
if (partNo9 != "") {
|
|
arrayObj.pop(partNo9);
|
|
}
|
|
if (partNo10 != "") {
|
|
arrayObj.pop(partNo10);
|
|
}
|
|
if (partNo11 != "") {
|
|
arrayObj.pop(partNo11);
|
|
}
|
|
if (partNo12 != "") {
|
|
arrayObj.pop(partNo12);
|
|
}
|
|
if (partNo13 != "") {
|
|
arrayObj.pop(partNo13);
|
|
}
|
|
if (partNo14 != "") {
|
|
arrayObj.pop(partNo14);
|
|
}
|
|
|
|
if (Array.from(new Set(arrayObj)).length < arrayObj.length) {
|
|
$.messager.alert('提示', '存在相同零件号,请重新选择', 'warning');
|
|
return;
|
|
}
|
|
|
|
|
|
if (!AddressNo && !reg.test(AddressNo)) {
|
|
$.messager.alert('提示', '亮灯地址必须为整数,请重新输入', 'warning');
|
|
return;
|
|
}
|
|
|
|
var model = {
|
|
BomID: BomID,
|
|
PartNo1: PartNo1,
|
|
PartNo2: PartNo2,
|
|
PartNo3: PartNo3,
|
|
PartNo4: PartNo4,
|
|
PartNo5: PartNo5,
|
|
PartNo6: PartNo6,
|
|
PartNo7: PartNo7,
|
|
PartNo8: PartNo8,
|
|
partNo9: partNo9,
|
|
partNo10: partNo10,
|
|
partNo11: partNo11,
|
|
partNo12: partNo12,
|
|
partNo13: partNo13,
|
|
partNo14: partNo14,
|
|
StationNo: StationNo,
|
|
IsCheck: IsCheck,
|
|
AddressNo: AddressNo,
|
|
PortName:PortName,
|
|
method: 'SaveInfo'
|
|
};
|
|
SaveModel(model);
|
|
}
|
|
function SaveModel(model) {
|
|
$.ajax({
|
|
type: "POST",
|
|
async: false,
|
|
url: "/HttpHandlers/PunchBomHandler.ashx",
|
|
data: model,
|
|
success: function (data) {
|
|
if (data == 'true') {
|
|
$.messager.alert('提示', '已保存', 'info');
|
|
dg.datagrid('reload');
|
|
$('#w').window('close');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '保存失败,请查看是否重复', 'warning');
|
|
}
|
|
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
//查询方法
|
|
function SearchInfo() {
|
|
|
|
var PartNo1 = $('#PartNo1_s').val();
|
|
|
|
var queryParams = {
|
|
PartNo1: PartNo1
|
|
};
|
|
dg.datagrid({
|
|
queryParams: queryParams
|
|
});
|
|
|
|
dg.datagrid('reload');
|
|
}
|
|
//编辑时加载窗体数据
|
|
function initEidtWidget() {
|
|
var selRows = dg.datagrid('getSelections');
|
|
if (selRows.length > 1) {
|
|
$.messager.alert('提示', '每次只能编辑一条记录,请重新选取', 'warning');
|
|
return;
|
|
} else if (selRows.length == 0) {
|
|
$.messager.alert('提示', '请选择一条记录进行编辑', 'warning');
|
|
return;
|
|
}
|
|
|
|
//窗体数据初始化
|
|
var row = selRows[0];
|
|
PrimaryID = row.ID;
|
|
$('#fl_id_1').combobox('select', row.PartNo1);
|
|
$('#fl_id_2').combobox('select', row.PartNo2);
|
|
$('#fl_id_3').combobox('select', row.StationNo);
|
|
$('#fl_id_4').combobox('select', row.PartNo3);
|
|
$('#fl_id_5').combobox('select', row.PartNo4);
|
|
$('#fl_id_6').combobox('select', row.PartNo5);
|
|
$('#fl_id_7').combobox('select', row.PartNo6);
|
|
$('#fl_id_8').combobox('select', row.PartNo7);
|
|
$('#fl_id_9').combobox('select', row.PartNo8);
|
|
|
|
$('#fl_id_10').combobox('select', row.PartNo9);
|
|
$('#fl_id_11').combobox('select', row.PartNo10);
|
|
$('#fl_id_12').combobox('select', row.PartNo11);
|
|
$('#fl_id_13').combobox('select', row.PartNo12);
|
|
$('#fl_id_14').combobox('select', row.PartNo13);
|
|
$('#fl_id_15').combobox('select', row.PartNo14);
|
|
|
|
toggleChecked("#IsCheck", row.IsCheck);
|
|
$('#AddressNo').val(row.AddressNo);
|
|
$('#PortName').combobox('select', row.PortName);
|
|
$('#w').window('open');
|
|
|
|
}
|
|
//删除方法
|
|
function deleteInfos() {
|
|
var selRows = dg.datagrid('getSelections');
|
|
if (selRows.length > 1) {
|
|
$.messager.alert('提示', '每次只能删除一条记录,请重新选取', 'warning');
|
|
return;
|
|
} else if (selRows.length == 0) {
|
|
$.messager.alert('提示', '请选择一条记录进行删除', 'warning');
|
|
return;
|
|
}
|
|
var row = selRows[0];
|
|
|
|
var model = {
|
|
BomID: row.ID,
|
|
method: 'DelInfo'
|
|
};
|
|
|
|
$.ajax({
|
|
url: "/HttpHandlers/PunchBomHandler.ashx",
|
|
data: model,
|
|
async: false,
|
|
success: function (data) {
|
|
if (data == 'true') {
|
|
$.messager.alert('提示', '已删除', 'info');
|
|
dg.datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '由于有关联数据,删除失败', 'warning');
|
|
}
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
|
|
function toggleChecked(id, checked) {
|
|
checked == 0 ?
|
|
$(id).removeAttr("checked") :
|
|
$(id).prop("checked", "checked");
|
|
}
|
|
|
|
function inutChange() {
|
|
$('#input_file').html($('#input01').val());
|
|
}
|
|
|
|
/**************** 辅助业务程序 ***************/
|
|
/**********************************************/
|
|
/***************** 窗体程序 *******************/
|
|
/**********************************************/
|
|
//编辑窗口关闭清空数据
|
|
function clearw() {
|
|
|
|
$('#fl_id_1').combo('clear');
|
|
$('#fl_id_2').combo('clear');
|
|
$('#fl_id_3').combo('clear');
|
|
$('#fl_id_4').combo('clear');
|
|
$('#fl_id_5').combo('clear');
|
|
$('#fl_id_6').combo('clear');
|
|
$('#fl_id_7').combo('clear');
|
|
$('#fl_id_8').combo('clear');
|
|
$('#fl_id_9').combo('clear');
|
|
|
|
$('#fl_id_10').combo('clear');
|
|
$('#fl_id_11').combo('clear');
|
|
$('#fl_id_12').combo('clear');
|
|
$('#fl_id_13').combo('clear');
|
|
$('#fl_id_14').combo('clear');
|
|
$('#fl_id_15').combo('clear');
|
|
toggleChecked("#IsCheck", 1);
|
|
$('#AddressNo').val('');
|
|
$('#PortName').combo('clear');
|
|
}
|
|
|
|
function reloadfl_id() {
|
|
$('#fl_id_1').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=6000&ProductTypeNo1=5000');
|
|
$('#fl_id_2').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=3000&ProductTypeNo1=2000');
|
|
$('#fl_id_3').combobox('reload', '/HttpHandlers/StationHandler.ashx?method=QueryForCombobox&StationNo=ZP');
|
|
$('#fl_id_4').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
$('#fl_id_5').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
$('#fl_id_6').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
$('#fl_id_7').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
$('#fl_id_8').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
$('#fl_id_9').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
|
|
$('#fl_id_10').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
$('#fl_id_11').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
$('#fl_id_12').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
$('#fl_id_13').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
$('#fl_id_14').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
$('#fl_id_15').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000&ProductTypeNo1=3000');
|
|
}
|
|
|
|
|
|
</script>
|
|
</form>
|
|
</body>
|
|
</html>
|
|
|