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.
934 lines
38 KiB
934 lines
38 KiB
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Product.aspx.cs" Inherits="MESWebSite.Manage.Product" %>
|
|
|
|
|
|
<!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;
|
|
}
|
|
|
|
.search_first {
|
|
margin-left: 13.5%
|
|
}
|
|
|
|
/* 中等屏幕 桌面显示器 992至1400 */
|
|
@media screen and (min-width:992px) and (max-width:1400px) {
|
|
.search_first {
|
|
margin-left: 17%
|
|
}
|
|
}
|
|
</style>
|
|
<title>产品</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: 80px;">产品</span>
|
|
</td>
|
|
<td style="width: 50px;"></td>
|
|
<td style="width: 250px;">存货代码:
|
|
<input type="text" id="StockNo_s" style="width: 120px;" /></td>
|
|
<td style="width: 280px;">类型名称:
|
|
<select id="fl_id_s" class="easyui-combobox" style="width: 160px; height: 30px;"
|
|
data-options="valueField: 'ProductTypeID',textField: 'ProductTypeName'">
|
|
</select></td>
|
|
<td style="width: 250px;">产品名称:
|
|
<input type="text" id="ProductName_s" style="width: 140px;" /></td>
|
|
<td style="width: 220px;">零件号:
|
|
<input type="text" id="PartNo_s" style="width: 120px;" /></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="exportbtn">导出</a>
|
|
</td>
|
|
<td style="width: 80px">
|
|
<a class="topexcelBtn" id="openexcel">导入</a>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
<table id="tb" title="产品" style="width: 99%;">
|
|
</table>
|
|
<!-- 编辑窗口 -->
|
|
<div id="w" style="padding: 10px; visibility: hidden" title="编辑">
|
|
<table cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td class="title">
|
|
<p>
|
|
存货代码:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="StockNo" type="text" class="text" style="width: 230px; height: 30px;" /><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">
|
|
<select id="fl_id" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'ProductTypeID',textField: 'ProductTypeName'">
|
|
</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">
|
|
<select id="cartype_id" class="easyui-combobox" style="width: 234px; height: 36px;"
|
|
data-options="valueField: 'ID',textField: 'CarTypeName'">
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
是否进口:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="checkbox" name="isImport" id="isImport" value="1" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
产品名称:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="ProductName" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
颜色名称:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="ColorName" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
零件号:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="PartNo" 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="fl_id" class="easyui-combobox" style="width: 234px; height: 36px;"">
|
|
<option value="0">装配</option>
|
|
<option value="0">冲孔</option>
|
|
<option value="0">冲孔装配</option>
|
|
</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 id="Rows" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
列数:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="Cols" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>层数: </p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="Layers" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>描述: </p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="Des" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>Q等级: </p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="QLevel" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title">
|
|
<p>
|
|
对应缺陷图:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<a class="pdfBtn" id="cpicture">选择图片</a> <span id="pdf_file"></span>
|
|
<br />
|
|
<img id="PicturePath" src="" height="200" width="230" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
打印单个标签:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="checkbox" name="IsPrintOneTag" id="IsPrintOneTag" value="0" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
直供件:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="checkbox" name="IsSupply" id="IsSupply" value="0" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
打印装箱单:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="checkbox" name="IsPrintPackList" id="IsPrintPackList" value="0" />
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
高配:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="checkbox" name="IsHigh" id="IsHigh" value="0" value="0" />
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
一模多具:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="checkbox" name="IsOneMore" id="IsOneMore" value="0" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
是否相同:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="checkbox" name="IsSame" id="IsSame" value="0" disabled />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
喷涂:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="checkbox" name="IsPlating" id="IsPlating" value="0" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
标准包装量:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="PackCount" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
包装范围(例:24,36,48):
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="PackCountSize" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
可回喷次数:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="BackPlatingNum" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
开机报废数:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="OpenFailNum" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
客户编号:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="CustomerNo" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
车型编号:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="CarModelCode" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="title" style="width: 110px;">
|
|
<p>
|
|
颜色编号:
|
|
</p>
|
|
</td>
|
|
<td colspan="2">
|
|
<input id="ColorCodeB" type="text" class="text" style="width: 230px; height: 30px;" />
|
|
</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 cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td>
|
|
<a class="topexcelBtn" id="cexcel">选择模板</a>
|
|
<span id="input_file"></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding-top: 20px;">
|
|
<a href="../Excel/产品导入模板.xls" class="topexcelBtn" style="text-decoration: none;">导出模板</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<!-- Excel编辑窗口 - footer -->
|
|
<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:Button ID="ImportPDF" runat="server" Text="" OnClick="ImportPDF_Click" />
|
|
<input type="file" id="input02" runat="server" class="file" onchange="pdfChange()" />
|
|
<input id="lb_ID" type="text" hidden="hidden" runat="server" />
|
|
<asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
|
|
<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缓存
|
|
});
|
|
|
|
//下拉框加载
|
|
reloadfl_ids();
|
|
|
|
//新增按钮点击
|
|
$('.topaddBtn').first().click(function () {
|
|
isEdit = false;
|
|
$('#PicturePath').hide();
|
|
$('#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);
|
|
});
|
|
|
|
|
|
$('#cpicture').bind('click', function () {
|
|
$('#input02').click();
|
|
});
|
|
|
|
$('#IsOneMore').change(function() {
|
|
if (checkboxValue($('#IsOneMore'))) {
|
|
toggleDisabled('#IsSame', 0);
|
|
} else {
|
|
toggleChecked('#IsSame', 0);
|
|
toggleDisabled('#IsSame', 1);
|
|
}
|
|
});
|
|
|
|
$('#fl_id').combobox({
|
|
onSelect: function (row) {
|
|
if (row.ProductTypeName.contains('6000')) {
|
|
toggleDisabled('#IsZP', 0);
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
//编辑窗口加载
|
|
$('#w').window({
|
|
modal: true,
|
|
closed: true,
|
|
minimizable: false,
|
|
maximizable: false,
|
|
collapsible: false,
|
|
width: 460,
|
|
height: 750,
|
|
footer: '#ft',
|
|
top: 20,
|
|
onBeforeClose: function () { clearw(); },
|
|
onBeforeOpen: function () {
|
|
$('#w').css('visibility', 'visible'); $('#ft').css('visibility', 'visible');
|
|
reloadfl_id();
|
|
reload_cartype_ids();
|
|
}
|
|
|
|
});
|
|
|
|
dg = $('#tb').datagrid({
|
|
fitColumns: true,
|
|
nowrap: false,
|
|
striped: true,
|
|
collapsible: false,
|
|
url: "/HttpHandlers/ProductHandler.ashx?method=QueryList",
|
|
//sortName: 'sortNumber',
|
|
//sortOrder: 'asc',
|
|
remoteSort: false,
|
|
columns: [[
|
|
{ field: 'ProductID', title: 'ID', hidden: true },
|
|
{ field: 'PicturePath', title: '缺陷图', hidden: true },
|
|
{ field: 'ProductTypeName', title: '类别名称', sortable: 'true', width: 10 },
|
|
{ field: 'StockNo', title: '存货代码', sortable: 'true', width: 10 },
|
|
{ field: 'CarTypeName', title: '车型', sortable: 'true', width: 10 },
|
|
{ field: 'ProductName', title: '产品名称', sortable: 'true', width: 10 },
|
|
{ field: 'ColorName', title: '颜色名称', sortable: 'true', width: 10 },
|
|
{ field: 'PartNo', title: '零件号', sortable: 'true', width: 10 },
|
|
{ field: 'Rows', title: '行数', sortable: 'true', width: 10 },
|
|
{ field: 'Cols', title: '列数', sortable: 'true', width: 10 },
|
|
{ field: 'Layers', title: '层数', sortable: 'true', width: 10 },
|
|
{ field: 'Des', title: '描述', sortable: 'true', width: 10 },
|
|
{ field: 'PackCount', title: '标准包装量', sortable: 'true', width: 10 },
|
|
{ field: 'PackCountSize', title: '包装范围', sortable: 'true', width: 10 },
|
|
{ field: 'OpenFailNum', title: '开机报废数', sortable: 'true', width: 10 },
|
|
{ field: 'QLevel', title: 'Q等级', sortable: 'true', width: 10 },
|
|
{ field: 'BackPlatingNum', title: '可喷涂次数', sortable: 'true', width: 10 },
|
|
{ field: 'CustomerNo', title: '客户编号', sortable: 'true', width: 10 },
|
|
{ field: 'CarModelCode', title: '车型编号', sortable: 'true', width: 10 },
|
|
{ field: 'ColorCodeB', title: '颜色编号', 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} 条记录',
|
|
});
|
|
|
|
|
|
$("#exportbtn").bind('click', function () {
|
|
|
|
var ProductTypeID = $('#fl_id_s').combo('getValue');
|
|
var StockNo = $('#StockNo_s').val();
|
|
var ProductName = $('#ProductName_s').val();
|
|
var PartNo = $('#PartNo_s').val();
|
|
|
|
var queryParams = {
|
|
ProductTypeID: ProductTypeID,
|
|
StockNo: StockNo,
|
|
ProductName: ProductName,
|
|
PartNo: PartNo
|
|
};
|
|
|
|
post('<%=ResolveUrl("~/HttpHandlers/ProductHandler.ashx?method=QueryExcel") %>', queryParams);
|
|
});
|
|
|
|
|
|
//导入EXCEL
|
|
$('#openexcel').first().click(function () {
|
|
$('#wexcel').window('open');
|
|
});
|
|
$('#saveBtnexcel').bind('click', function () {
|
|
$('#ImportExcel').click();
|
|
});
|
|
$('#cexcel').bind('click', function () {
|
|
$('#input01').click();
|
|
});
|
|
$('#wexcel').window({
|
|
modal: true,
|
|
closed: true,
|
|
minimizable: false,
|
|
maximizable: false,
|
|
collapsible: false,
|
|
width: 200,
|
|
height: 200,
|
|
footer: '#ftexcel',
|
|
top: 20,
|
|
onBeforeClose: function () { clearw(); },
|
|
onBeforeOpen: function () { $('#wexcel').css('visibility', 'visible'); $('#ftexcel').css('visibility', 'visible'); }
|
|
});
|
|
});
|
|
|
|
function checkboxValue(ctl) {
|
|
return ctl.is(':checked') ? 1 : 0;
|
|
}
|
|
|
|
/**************** 主要业务程序 ***************/
|
|
//新增 / 编辑
|
|
function SaveInfo(isEdit) {
|
|
|
|
var ProductID = isEdit == true ? PrimaryID : 0;
|
|
var ProductTypeID = $('#fl_id').combo('getValue');
|
|
var StockNo = $('#StockNo').val();
|
|
var ProductName = $('#ProductName').val();
|
|
var isImport = checkboxValue($('#isImport'));
|
|
var IsSupply = checkboxValue($('#IsSupply'));
|
|
var IsOneMore = checkboxValue($('#IsOneMore'));
|
|
var IsPlating = checkboxValue($('#IsPlating'));
|
|
var IsPrintOneTag = checkboxValue($('#IsPrintOneTag'));
|
|
var IsPrintPackList = checkboxValue($('#IsPrintPackList'));
|
|
var IsSame = checkboxValue($('#IsSame'));
|
|
var IsHigh = checkboxValue($('#IsHigh'));
|
|
var CarTypeID = $('#cartype_id').combo('getValue');
|
|
var PartName = '';
|
|
var ColorName = $('#ColorName').val();
|
|
var PartNo = $('#PartNo').val();
|
|
var IsZP=checkboxValue($('#IsZP'));
|
|
var Rows = $('#Rows').val();
|
|
var Cols = $('#Cols').val();
|
|
var Layers = $('#Layers').val();
|
|
var Des = $('#Des').val();
|
|
var QLevel = $('#QLevel').val();
|
|
var PicturePath = $('#PicturePath').val();
|
|
var BackPlatingNum = $('#BackPlatingNum').val();
|
|
var OpenFailNum = $('#OpenFailNum').val();
|
|
var PackCount = $('#PackCount').val();
|
|
var PackCountSize = $('#PackCountSize').val();
|
|
var CustomerNo = $('#CustomerNo').val();
|
|
var CarModelCode = $('#CarModelCode').val();
|
|
var ColorCodeB = $('#ColorCodeB').val();
|
|
|
|
|
|
|
|
//if (StockNo == "") {
|
|
// $.messager.alert('提示', '存货代码不能为空,请重新输入', 'warning');
|
|
// return;
|
|
//}
|
|
//if (ProductTypeID == "") {
|
|
// $.messager.alert('提示', '产品类型不能为空,请重新输入', 'warning');
|
|
// return;
|
|
//}
|
|
if (ProductName == "") {
|
|
$.messager.alert('提示', '产品名称不能为空,请重新输入', 'warning');
|
|
return;
|
|
}
|
|
if (PartNo == "") {
|
|
$.messager.alert('提示', '零件号不能为空,请重新输入', 'warning');
|
|
return;
|
|
}
|
|
|
|
if (checkComboBoxValue('fl_id', ProductTypeID) == false) {
|
|
$.messager.alert('提示', '产品类有误,请重新输入', 'warning');
|
|
return;
|
|
}
|
|
|
|
if (checkComboBoxValue('cartype_id', CarTypeID) == false) {
|
|
$.messager.alert('提示', '车型有误,请重新输入', 'warning');
|
|
return;
|
|
}
|
|
|
|
var model = {
|
|
ProductID: ProductID,
|
|
ProductTypeID: ProductTypeID,
|
|
StockNo: StockNo,
|
|
PartName: PartName,
|
|
ProductName: ProductName,
|
|
ColorName: ColorName,
|
|
PartNo: PartNo,
|
|
IsZP:IsZP,
|
|
Rows: Rows,
|
|
Cols: Cols,
|
|
Layers: Layers,
|
|
PicturePath: PicturePath,
|
|
Des: Des,
|
|
isImport: isImport,
|
|
CarTypeID,
|
|
CustomerNo,
|
|
CarModelCode,
|
|
ColorCodeB,
|
|
OpenFailNum,
|
|
QLevel,
|
|
IsPrintOneTag,
|
|
IsPrintPackList,
|
|
IsSupply,
|
|
IsOneMore,
|
|
PackCount,
|
|
PackCountSize,
|
|
BackPlatingNum,
|
|
IsPlating,
|
|
IsSame,
|
|
IsHigh,
|
|
method: 'SaveInfo'
|
|
};
|
|
SaveModel(model);
|
|
}
|
|
function SaveModel(model) {
|
|
$.ajax({
|
|
type: "POST",
|
|
async: false,
|
|
url: "/HttpHandlers/ProductHandler.ashx",
|
|
data: model,
|
|
success: function (data) {
|
|
if (data != 'false' && data.length > 0) {
|
|
$('#lb_ID').val(data);
|
|
$.messager.alert('提示', '已保存', 'info');
|
|
$('#ImportPDF').click();
|
|
$('#w').window('close');
|
|
dg.datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '保存失败,请查看存货代码是否重复', 'warning');
|
|
}
|
|
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
//查询方法
|
|
function SearchInfo() {
|
|
var ProductTypeID = $('#fl_id_s').combo('getValue');
|
|
var StockNo = $('#StockNo_s').val();
|
|
var ProductName = $('#ProductName_s').val();
|
|
var PartNo = $('#PartNo_s').val();
|
|
var queryParams = {
|
|
ProductTypeID: ProductTypeID,
|
|
StockNo: StockNo,
|
|
ProductName: ProductName,
|
|
PartNo: PartNo
|
|
};
|
|
dg.datagrid({
|
|
queryParams: queryParams
|
|
});
|
|
}
|
|
|
|
function checkComboBoxValue(id,value){
|
|
var valueField = $("#"+id).combobox("options").valueField;
|
|
|
|
var allData = $("#"+id).combobox("getData");
|
|
var result = false;
|
|
for (var i = 0; i < allData.length; i++) {
|
|
if (value == allData[i][valueField]) {
|
|
result = true;
|
|
break;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
//编辑时加载窗体数据
|
|
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.ProductID;
|
|
$('#fl_id').combobox('select', row.ProductTypeID);
|
|
$('#cartype_id').combobox('select', row.CarTypeID);
|
|
$('#StockNo').val(row.StockNo);
|
|
$('#ProductName').val(row.ProductName);
|
|
$('#ColorName').val(row.ColorName);
|
|
$('#PartNo').val(row.PartNo);
|
|
$('#Rows').val(row.Rows);
|
|
$('#Cols').val(row.Cols);
|
|
$('#Layers').val(row.Layers);
|
|
$('#QLevel').val(row.QLevel);
|
|
$('#PicturePath').val(row.PicturePath);
|
|
$('#PackCount').val(row.PackCount);
|
|
$('#PackCountSize').val(row.PackCountSize);
|
|
$('#BackPlatingNum').val(row.BackPlatingNum);
|
|
$('#OpenFailNum').val(row.OpenFailNum);
|
|
$('#CustomerNo').val(row.CustomerNo);
|
|
$('#CarModelCode').val(row.CarModelCode);
|
|
$('#ColorCodeB').val(row.ColorCodeB);
|
|
if (row.PicturePath != null) {
|
|
$('#PicturePath').show();
|
|
$('#PicturePath').attr("src", "../PDF/" + row.PicturePath);
|
|
} else {
|
|
$('#PicturePath').hide();
|
|
}
|
|
$('#Des').val(row.Des);
|
|
toggleChecked("#IsZP", row.IsZP);
|
|
toggleChecked("#isImport", row.isImport);
|
|
toggleChecked("#IsSupply", row.IsSupply);
|
|
toggleChecked("#IsOneMore", row.IsOneMore);
|
|
toggleChecked("#IsPlating", row.IsPlating);
|
|
toggleChecked("#IsPrintOneTag", row.IsPrintOneTag);
|
|
toggleChecked("#IsPrintPackList", row.IsPrintPackList);
|
|
toggleChecked("#IsSame", row.IsSame);
|
|
toggleDisabled("#IsSame", row.IsOneMore);
|
|
toggleChecked("#IsHigh", row.IsHigh);
|
|
$('#w').window('open');
|
|
}
|
|
|
|
|
|
function toggleChecked(id, checked) {
|
|
+checked ? $(id).prop("checked", "checked") : $(id).removeAttr("checked");
|
|
}
|
|
|
|
function toggleDisabled(id, disabled) {
|
|
+disabled ? $(id).prop("disabled", "disabled") : $(id).removeAttr("disabled");
|
|
}
|
|
|
|
//删除方法
|
|
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 = {
|
|
ProductID: row.ProductID,
|
|
method: 'DelInfo'
|
|
};
|
|
|
|
$.ajax({
|
|
url: "/HttpHandlers/ProductHandler.ashx",
|
|
data: model,
|
|
async: false,
|
|
success: function (data) {
|
|
if (data == 'true') {
|
|
$.messager.alert('提示', '已删除', 'info');
|
|
dg.datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '由于有关联数据,删除失败', 'warning');
|
|
}
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function pdfChange() {
|
|
$('#pdf_file').html($('#input02').val());
|
|
|
|
}
|
|
|
|
|
|
/**************** 辅助业务程序 ***************/
|
|
/**********************************************/
|
|
/***************** 窗体程序 *******************/
|
|
/**********************************************/
|
|
//编辑窗口关闭清空数据
|
|
function clearw() {
|
|
|
|
$('#fl_id').combo('clear');
|
|
$('#cartype_id').combo('clear');
|
|
$('#ProductTypeNo').val('');
|
|
$('#ProductTypeName').val('');
|
|
$('#Des').val('');
|
|
|
|
$('#StockNo').val('');
|
|
$('#ProductName').val('');
|
|
$('#ColorName').val('');
|
|
$('#PartNo').val('');
|
|
$('#Rows').val('');
|
|
$('#Cols').val('');
|
|
$('#Layers').val('');
|
|
$('#QLevel').val('');
|
|
$('#PicturePath').val('');
|
|
$('#PackCount').val('');
|
|
$('#BackPlatingNum').val('');
|
|
$('#OpenFailNum').val('');
|
|
$('#CustomerNo').val('');
|
|
$('#CarModelCode').val('');
|
|
$('#ColorCodeB').val('');
|
|
toggleChecked("#isImport", 0);
|
|
toggleChecked("#IsSupply", 0);
|
|
toggleChecked("#IsOneMore", 0);
|
|
toggleChecked("#IsPlating", 0);
|
|
toggleChecked("#IsPrintOneTag", 0);
|
|
toggleChecked("#IsPrintPackList", 0);
|
|
toggleChecked("#IsSame", 0);
|
|
toggleChecked("#IsHigh", 0);
|
|
}
|
|
|
|
function reloadfl_id() {
|
|
$('#fl_id').combobox('reload', '/HttpHandlers/ProductTypeHandler.ashx?method=QueryForCombobox');
|
|
}
|
|
|
|
function reloadfl_ids() {
|
|
$('#fl_id_s').combobox('reload', '/HttpHandlers/ProductTypeHandler.ashx?method=QueryForCombobox');
|
|
}
|
|
|
|
function reload_cartype_ids() {
|
|
$('#cartype_id').combobox('reload', '/HttpHandlers/CarTypeHandler.ashx?method=CarTypeCombo');
|
|
}
|
|
|
|
function post(url, PARAMS) {
|
|
var temp_form = document.createElement("form");
|
|
temp_form.action = url;
|
|
temp_form.target = "_blank";
|
|
temp_form.method = "post";
|
|
temp_form.style.display = "none"; for (var x in PARAMS) {
|
|
var opt = document.createElement("textarea");
|
|
opt.name = x;
|
|
opt.value = PARAMS[x];
|
|
temp_form.appendChild(opt);
|
|
}
|
|
document.body.appendChild(temp_form);
|
|
temp_form.submit();
|
|
}
|
|
|
|
|
|
</script>
|
|
</form>
|
|
</body>
|
|
</html>
|
|
|