CeramicProject/newyt/Module_data/Suite_browse.aspx

249 lines
12 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Suite_browse.aspx.cs" Inherits="Suite_browse" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script type="text/javascript"></script>
<link href="../Css/index.css" rel="stylesheet" type="text/css" />
<link href="../Css/edit.css" rel="stylesheet" type="text/css" />
<script src="../Js/Calendar3.js" type="text/javascript"></script>
<script src="../Jquery-ui/js/jquery-1.10.2.js" type="text/javascript"></script>
<script src="../Jquery-ui/js/jquery-ui-1.10.4.custom.js" type="text/javascript"></script>
<link href="../Jquery-ui/css/pepper-grinder/jquery-ui-1.10.4.custom.css" rel="stylesheet" type="text/css" />
<script src="../Js/commonality.js" type="text/javascript"></script>
<link rel="stylesheet" href="../Css/gh-buttons.css" type="text/css"/>
<link rel="stylesheet" href="../Css/prettify.css"/>
<script src="../Js/prettify.js" type="text/javascript"></script>
<script type="text/javascript">
//调用添加方法
function setbcbd() {
$("#<%=severbc.ClientID%>").click();
}
function pd() {
if ($("#cpmc").val().replace(/(^\s*)|(\s*$)/g, "") == "") {
$("#z_error").text("BOM名称不能为空!");
return false;
}
if ($("#gg").val().replace(/(^\s*)|(\s*$)/g, "") == "") {
$("#z_error").text("规格不能为空!");
return false;
}
if ($("#danwei").val().replace(/(^\s*)|(\s*$)/g, "") == "") {
$("#z_error").text("单位不能为空!");
return false;
} if ($("#zhongliang").val().replace(/(^\s*)|(\s*$)/g, "") == "") {
$("#z_error").text("重量不能为空!");
return false;
}
if ($("#zl").val().replace(/(^\s*)|(\s*$)/g, "") == "") {
$("#z_error").text("种类不能为空!");
return false;
}
var jsonStr2 = "";
//获取数据行的行数
var hang = $("#bomxmtb tr").length - 1;
//当数据行大于0时
if (hang > 0) {
//开始给变量赋值
jsonStr2 += "[";
//循环获取行id,拼接
for (var x = 1; x <= hang; x++) {
var trid = $("#bomxmtb").find("tr").eq(x).attr("id");
var name = $("#bomxmtb").find("tr").eq(x).attr("name");
var cpbhid = "cpbh" + trid;
var cpbh = document.getElementById(cpbhid).value;
var mtslid = "mtsl" + trid;
var mtsl = document.getElementById(mtslid).value;
var xiaojiid = "xiaoji" + trid;
var xiaoji = document.getElementById(xiaojiid).value;
var beizhuid = "beizhu" + trid;
var beizhu = document.getElementById(beizhuid).value;
var mxlxid = "mxlx" + trid;
var mxlx = document.getElementById(mxlxid).value;
jsonStr2 += "{";
jsonStr2 += "\"id\":\"" + name + "\",";
jsonStr2 += "\"cpbh\":\"" + cpbh + "\",";
jsonStr2 += "\"mtsl\":\"" + mtsl + "\",";
jsonStr2 += "\"xiaoji\":\"" + xiaoji + "\",";
jsonStr2 += "\"cplx\":\"" + mxlx + "\",";
jsonStr2 += "\"beizhu\":\"" + beizhu + "\"";
jsonStr2 += "},";
}
//截取最后的,
jsonStr2 = jsonStr2.substring(0, jsonStr2.length - 1);
jsonStr2 += "]";
document.getElementById("bommxhd").value = jsonStr2;
}
}
function jsslzhxj(hcountx) {
var mtsl= $("#mtsl" + hcountx).val();
var cpdj = $("#cpdj" + hcountx).val();
var xiaoji = parseFloat(mtsl * cpdj).toFixed(4);
$("#xiaoji" + hcountx).val(xiaoji);
}
function add_cpmx() {
//给每行的id 赋值上一行的id 加1 不会重复的id;
var hcount = parseFloat($("#bomxmtb tbody").children().eq($("#bomxmtb tbody").children().length - 1).attr("id")) + 1;
$("#bomxmtb").append("<tr id='" + hcount + "' name='0'><td width='25px'> <img src='../Images_Folder/Button/tjljh.png' onclick='jianhang(this)' width='25px' height='25px' /></td>"
+ "<td><select Class='inpittxt_xl' id='mxlx" + hcount + "' ><option value='产品' >产品</option><option value='母件' >母件</option></select></td>"
+ " <td><input type='text' id='cpbh" + hcount + "' onclick='selectcp(" + hcount + ")' Class='inpittxt' /></td><td Class='tbtxt_hx'><input type='text' id='cpmc" + hcount + "' readonly Class='inpittxt_hx' /></td>"
+ "<td Class='tbtxt_hx'><input type='text' id='cpdj" + hcount + "' readonly Class='inpittxt_hx' /></td>"
+ "<td Class='tbtxt_hx'><input type='text' id='cpdw" + hcount + "' readonly Class='inpittxt_hx' /></td><td ><input type='text' id='mtsl" + hcount + "' onkeyup='jsslzhxj(" + hcount + ")' Class='inpittxt' /></td>"
+ "<td ><input type='text' id='xiaoji" + hcount + "' Class='inpittxt' /></td><td><input type='text' id='beizhu" + hcount + "' Class='inpittxt' /></td></tr>");
}
function selectcp(hg) {
$("#dialogcp").attr("tag", hg);
$("#dialogcp").dialog({
resizable: false,
height: 510,
width: 1230,
modal: true,
close: function () {
$(".ui-widget-overlay").css("display", "none");
}
});
if ($("#mxlx" + hg).val() == "产品") {
$("#selectcp").attr("src", "../ddselect/Product_list.aspx");
} else {
$("#selectcp").attr("src", "../ddselect/Suite_list.aspx");
}
//用来弹出层条件框获取焦点
dialogfocus('selectcp');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="rtbjdiv" >
<div class="add-top" >
<div class="add-top-dh" id="div_listdaohang"><h4>产品BOM表单页 &nbsp&nbsp</h4> <a href="Suite_list.aspx" id="bt_fhlb" runat="server" style=" width:65px" class="button icon pin">回到列表</a></div>
<div class="add-top-cz" >
<a href="#button" id="bt_tj" onclick="setbcbd()" class="button icon log">保存</a>
<a href="#button" id="chongzhi" onclick="form.reset();" style=" width:60px; " class=" button icon reload">重置表单</a>
<a href="#button" id="fanhui" onclick="history.back();" style=" width:60px; " class="button icon arrowleft">返回上级</a>
<asp:label id="z_error" CssClass="error" runat="server"></asp:label>
</div>
</div>
<div class="alert-tip">
<b>温馨提示:</b>
<p>• 信息表单中加*号红色标题框为必填项,为了可以顺利保存信息,请您注意填写红色栏目中的信息</p>
<p>• 左侧为BOM明细结构展示右侧表单可编辑BOM信息结构</p>
</div>
<div id="dd_kong" style="overflow: auto;">
<table width="100%">
<tr >
<td style=" width:300px;" valign="top">
<span class="sxjgbtfont">产品BOM结构图</span>
<asp:TreeView ID="TreeView1" runat="server" cssclass="shuxingjieg" NoExpandImageUrl="../Images_Folder/1.png"
CollapseImageToolTip="Collapse Node" ExpandImageUrl="../Images_Folder/根节点.png" ExpandImageToolTip="Expand Node"
RootNodeStyle-ImageUrl="../Images_Folder/1.png" ParentNodeStyle-ImageUrl="../Images_Folder/节点展开.png" LeafNodeStyle-ImageUrl="../Images_Folder/节点展开.png"
ImageSet="Custom">
</asp:TreeView>
</td>
<td valign="top">
<table class="bule"> <tr class="tdlietou"><td><h4>产品BOM信息</h4></td></tr></table>
<table class="tablewk">
<tr><td style=" height:10px" colspan="13"></td></tr>
<tr>
<td class="wktblm">
<span> BOM编号</span>
</td>
<td>
<input type="text" id="cpbh" runat="server" readonly value="自动生成" class="tbinput_hx" />
</td>
<td class="wktblm">
<span><font>*BOM名称</font></span>
</td>
<td>
<input type="text" id="cpmc" runat="server" class="tbinput_bt" />
</td>
<td class="wktblm">
<span> 建档日期</span>
</td>
<td >
<input name='control_date' type='text' id='riqi' size='10' maxlength='10' onclick='new Calendar().show(this);'
readonly='readonly' runat="server" class="tbinput_rl" />
</td>
<td class="wktblm">
<span> <font>*规格</font></span>
</td>
<td>
<input type="text" id="gg" runat="server" class="tbinput_bt" />
</td>
<td class="wktblm">
<span><font>*单位</font></span>
</td>
<td >
<asp:DropDownList ID="danwei" runat="server" CssClass="tbinput_xl">
</asp:DropDownList>
</td>
<td>&nbsp </td>
</tr>
<tr>
<td class="wktblm">
<span> <font>*单价</font></span>
</td>
<td>
<input type="text" id="bmdj" runat="server" onkeyup="doubleshuru(this)" class="tbinput_bt" />
</td>
<td class="wktblm">
<span> <font>*种类</font></span>
</td>
<td >
<asp:DropDownList ID="zl" runat="server" CssClass="tbinput_xl">
</asp:DropDownList>
</td>
<td class="wktblm">
<span> 建档人</span>
</td>
<td >
<input type="text" id="ywy" runat="server" readonly class="tbinput_hx" />
</td>
<td class="wktblm">
备注
</td>
<td colspan="5">
<input type="text" id="beizhu" runat="server" class="tbinput" />
</td>
<td>&nbsp </td>
</tr>
<tr><td style=" height:10px" colspan="13"></td></tr>
</table>
<table class="bule"> <tr class="tdlietou"><td><h4>产品BOM明细</h4></td></tr></table>
<div class="nrdiv" runat="server" id="bommx" style="display: block; " > </div>
</td>
</tr>
</table>
</div>
</div>
<div id="dialogcp" title="选择产品" style="overflow:hidden; display:none;" >
<iframe src="../ddselect/Product_list.aspx" id='selectcp' frameborder="no" border="0" style="height:500px;width:100%;overflow:hidden" scrolling="no" ></iframe>
</div>
<span style=" display:none"> <asp:button id="severbc" runat="server" CssClass="button bluez small" Text="保存"
OnClientClick="return pd()" onclick="bt_tj_Click" ></asp:button> </span>
<input id="btn_cpclose" style="display:none" type=button onclick="$('#dialogcp').dialog('close');"/>
<asp:HiddenField ID="id" runat="server" Value="" />
<asp:HiddenField ID="bommxhd" runat="server" Value="" />
<asp:HiddenField ID="pagename" runat="server" Value="cpbom" />
<script src="../Js/messageshow.js" type="text/javascript"></script>
</form>
</body>
</html>