parent
19b2931db4
commit
5510353811
|
|
@ -84,7 +84,7 @@
|
||||||
<li runat=server id="rileget"><a href="#button" class="button icon clock" onclick="gjzk('rili')">月历</a></li>
|
<li runat=server id="rileget"><a href="#button" class="button icon clock" onclick="gjzk('rili')">月历</a></li>
|
||||||
<li runat=server id="li1"><a href="#button" class="button icon favorite" onclick="setshoucang()" >收藏</a></li>
|
<li runat=server id="li1"><a href="#button" class="button icon favorite" onclick="setshoucang()" >收藏</a></li>
|
||||||
<li><asp:DropDownList ID="drp_zt" CssClass="drpdownstyle" runat="server" ToolTip="采购状态"> <asp:ListItem Text="" value=''>全部</asp:ListItem><asp:ListItem Text='待采购'>待采购</asp:ListItem> <asp:ListItem Text='已采购'>已采购</asp:ListItem></asp:DropDownList> </li>
|
<li><asp:DropDownList ID="drp_zt" CssClass="drpdownstyle" runat="server" ToolTip="采购状态"> <asp:ListItem Text="" value=''>全部</asp:ListItem><asp:ListItem Text='待采购'>待采购</asp:ListItem> <asp:ListItem Text='已采购'>已采购</asp:ListItem></asp:DropDownList> </li>
|
||||||
<li><a href="#button" id="btn_shengcheng" runat="server" style=" width:70px; display:none" class="button icon arrowright">添加到采购</a></li>
|
<li><a href="#button" id="btn_shengcheng" runat="server" style=" width:70px;" class="button icon arrowright">添加到采购</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
|
|
@ -296,11 +296,11 @@ public partial class ProductLibrary_list : System.Web.UI.Page
|
||||||
public string isquanxian(int uid)
|
public string isquanxian(int uid)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (DBHlper.GetPermission(uid, "产品库存", "view_nr_z_cpkfcl", "查看全部"))
|
if (DBHlper.GetPermission(uid, "产品库存", "view_nr_z_cpkc", "查看全部"))
|
||||||
{
|
{
|
||||||
return "1";
|
return "1";
|
||||||
}
|
}
|
||||||
else if (DBHlper.GetPermission(uid, "产品库存", "view_nr_z_cpkfcl", "查看个人"))
|
else if (DBHlper.GetPermission(uid, "产品库存", "view_nr_z_cpkc", "查看个人"))
|
||||||
{
|
{
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,171 @@
|
||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Productin_Form.aspx.cs" Inherits="Productout_Form" %>
|
||||||
|
|
||||||
|
<!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 runat="server">
|
||||||
|
<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();
|
||||||
|
}
|
||||||
|
var beforval = "";
|
||||||
|
function pd() {
|
||||||
|
if ($("#riqi").val() == "") {
|
||||||
|
$("#z_error").html("请选择出库日期");
|
||||||
|
return false;
|
||||||
|
} else if ($("#scdh").val() == "") {
|
||||||
|
$("#z_error").html("请选择单据编号");
|
||||||
|
return false;
|
||||||
|
} else if ($("#cpbh").val() == "") {
|
||||||
|
$("#z_error").html("请选择产品信息");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if ($("#khming").val() == "") {
|
||||||
|
$("#z_error").html("请选择客户信息");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#z_error").html("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectscd() {
|
||||||
|
$("#dialogscd").dialog({
|
||||||
|
resizable: false,
|
||||||
|
height: 510,
|
||||||
|
width: 1230,
|
||||||
|
modal: true,
|
||||||
|
close: function () {
|
||||||
|
$(".ui-widget-overlay").css("display", "none");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//用来弹出层条件框获取焦点
|
||||||
|
dialogfocus('ifa_scd');
|
||||||
|
}
|
||||||
|
function selectkh() {
|
||||||
|
$("#dialogkh").dialog({
|
||||||
|
resizable: false,
|
||||||
|
height: 510,
|
||||||
|
width: 1230,
|
||||||
|
modal: true,
|
||||||
|
close: function () {
|
||||||
|
$(".ui-widget-overlay").css("display", "none");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//用来弹出层条件框获取焦点
|
||||||
|
dialogfocus('ifa_kh');
|
||||||
|
}
|
||||||
|
function selectcp() {
|
||||||
|
$("#dialogcp").dialog({
|
||||||
|
resizable: false,
|
||||||
|
height: 510,
|
||||||
|
width: 1230,
|
||||||
|
modal: true,
|
||||||
|
close: function () {
|
||||||
|
$(".ui-widget-overlay").css("display", "none");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
$("#selectcp").attr("src", "../ddselect/Product_list.aspx");
|
||||||
|
//用来弹出层条件框获取焦点
|
||||||
|
dialogfocus('ifa_cp');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form" runat="server">
|
||||||
|
<div class="rtbjdiv" >
|
||||||
|
<div class="add-top" >
|
||||||
|
<div class="add-top-dh" id="div_listdaohang"><h4>成品出库表单页   </h4> <a href="Productout_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>
|
||||||
|
</div>
|
||||||
|
<div id="dd_kong" style=" overflow:auto;">
|
||||||
|
<table class="bule"> <tr class="tdlietou"><td><h4>出库基本信息</h4></td></tr></table>
|
||||||
|
<table class="tablewk">
|
||||||
|
<tr><td style=" height:20px" colspan="13"></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td class="wktblm"><span>出库编号</span></td><td><asp:TextBox id="ckdh" runat="server" CssClass="tbinput_hx" ReadOnly Text="自动生成" ForeColor="Gray" Enabled=false AutoCompleteType=none BorderStyle=None ></asp:TextBox></td>
|
||||||
|
<td class="wktblm"><span><font>出库日期</font></span></td><td><input name='txt_control_date' type='text' id='riqi' size='10' maxlength='10' onclick='new Calendar().show(this);' readonly='readonly' runat=server class="tbinput_bt" /></td>
|
||||||
|
<td class="wktblm"><span><font>单据编号</font></span></td><td ><input type=text id="scdh" readonly runat="server" class="tbinput_bt" onclick="selectscd()"></td>
|
||||||
|
<td class="wktblm"><span><font>客户名称</font></span></td><td ><input type=text id="khming" readonly runat="server" class="tbinput_bt" onclick="selectkh()" /></td>
|
||||||
|
<td class="wktblm"><span><font>产品编号</font></span></td><td><input type='text' id='cpbh' size='10' readonly='readonly' runat=server class="tbinput_bt" onclick="selectcp()" /></td>
|
||||||
|
<td class="wktblm"><span>产品名称</span></td><td ><input type=text id="cpmc" runat="server" readonly class="tbinput_hx"/></td>
|
||||||
|
<td class="tdjj5">  </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="wktblm"><span><font>产品单价</font></span></td><td><input type=text id="danjia" onkeyup="doubleshuru(this)" value="0" runat="server" class="tbinput_bt"/> </td>
|
||||||
|
<td class="wktblm"><span><font>产品包装规格</font></span></td><td><input type=text id="guige" value="0" onkeyup="doubleshuru(this)" runat="server" class="tbinput_bt" /></td>
|
||||||
|
<td class="wktblm"><span><font>整装数量</font></span></td><td><input type=text id="zzshuliang" value="1" runat="server" onkeyup="doubleshuru(this)" class="tbinput_bt" /></td>
|
||||||
|
<td class="wktblm"><span>零头</span></td><td><input type=text id="lingtou" value="0" runat="server" onkeyup="doubleshuru(this)" class="tbinput" /></td>
|
||||||
|
<td class="wktblm"><span>数量</span></td><td><input type=text id="shuliang" value="0" readonly runat="server" class="tbinput_hx" /></td>
|
||||||
|
<td class="wktblm"><span>总金额</span></td><td><input type=text id="zongjine" readonly runat="server" value="0" class="tbinput_hx" /></td>
|
||||||
|
<td class="tdjj5">  </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="wktblm"><span>单位</span></td><td><input type=text id="danwei" readonly runat="server" class="tbinput_hx" /></td>
|
||||||
|
<td class="wktblm"><span>联系人</span></td><td><input type=text id="lxr" runat="server" class="tbinput" /></td>
|
||||||
|
<td class="wktblm"><span>联系电话</span></td><td><input type=text id="lxdh" runat="server" class="tbinput" /></td>
|
||||||
|
<td class="wktblm"><span>经手人</span></td><td><input type=text id="jingshouren" readonly runat="server" class="tbinput_hx" /></td>
|
||||||
|
<td class="wktblm"><span>送货人</span></td><td><input type=text id="shr" runat="server" class="tbinput" /></td>
|
||||||
|
<td class="wktblm"><span>状态</span></td><td ><input type=text id="zhuangtai" runat="server" class="tbinput_hx" value='待确认' /></td>
|
||||||
|
<td class="tdjj5">  </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="wktblm"><span>送货地址</span></td><td colspan="11"><input type=text id="dizhi" runat="server" class="tbinput" /></td>
|
||||||
|
<td class="tdjj5">  </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="wktblm"><span>备注</span></td><td colspan="11"><asp:TextBox id="txt_beizhu" runat="server" CssClass="tbinput"></asp:TextBox></td>
|
||||||
|
<td class="tdjj5">  </td>
|
||||||
|
</tr>
|
||||||
|
<tr><td style=" height:20px" colspan="13"></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="dialogscd" title="选择生产单" style="overflow:hidden; display:none;" >
|
||||||
|
<iframe src="../ddselect/shengchandan.aspx" frameborder="no" border="0" style="height:500px;width:100%;overflow:hidden" scrolling="no" id="ifa_scd" ></iframe>
|
||||||
|
</div>
|
||||||
|
<div id="dialogkh" title="选择客户" style="overflow:hidden; display:none;" >
|
||||||
|
<iframe src="../ddselect/kehu_list.aspx" frameborder="no" border="0" style="height:500px;width:100%;overflow:hidden" scrolling="no" id="ifa_kh" ></iframe>
|
||||||
|
</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" id="ifa_cp" ></iframe>
|
||||||
|
</div>
|
||||||
|
<asp:HiddenField ID="id" runat="server" Value="" />
|
||||||
|
<asp:HiddenField ID="sg_hidden" runat="server" Value="" />
|
||||||
|
<asp:HiddenField ID="pagename" runat="server" Value="cpck" />
|
||||||
|
<asp:HiddenField ID="wlidhidden" runat="server" Value="" />
|
||||||
|
<asp:HiddenField ID="scdidhidden" runat="server" Value="" />
|
||||||
|
<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_sgdclose" style="display:none" type=button onclick="$('#dialogscd').dialog('close');"/>
|
||||||
|
<input id="btn_khclose" style="display:none" type=button onclick="$('#dialogkh').dialog('close');"/>
|
||||||
|
<input id="btn_cpclose" style="display:none" type=button onclick="$('#dialogcp').dialog('close');"/>
|
||||||
|
<script src="../Js/messageshow.js" type="text/javascript"></script>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,187 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public partial class Productout_Form : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
//创建一个操作记录bll
|
||||||
|
Maticsoft.BLL.nr_sys_rizhi rizhibll = new Maticsoft.BLL.nr_sys_rizhi();
|
||||||
|
//创建一个共用的申购单模板
|
||||||
|
Maticsoft.Model.nr_z_cpck cpckmodel = new Maticsoft.Model.nr_z_cpck();
|
||||||
|
//创建一个共同的申购单bll
|
||||||
|
Maticsoft.BLL.nr_z_cpck cpckbll = new Maticsoft.BLL.nr_z_cpck();
|
||||||
|
//创建一个操作记录模板
|
||||||
|
Maticsoft.Model.nr_sys_rizhi rizhi = new Maticsoft.Model.nr_sys_rizhi();
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
if (Session["user"] == null)
|
||||||
|
{
|
||||||
|
Response.Redirect("../index.aspx");
|
||||||
|
}
|
||||||
|
//获取角色权限
|
||||||
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
||||||
|
|
||||||
|
if (Request.QueryString["uid"] != null && Request.QueryString["uid"].ToString().Length > 0)
|
||||||
|
{
|
||||||
|
string uid = Request.QueryString["uid"].ToString();
|
||||||
|
id.Value = uid;
|
||||||
|
initdata(Convert.ToInt32(uid));
|
||||||
|
pdquanxianbj(user.juese);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
pdquanxian(user.juese);
|
||||||
|
riqi.Value = DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day;
|
||||||
|
jingshouren.Value = user.zhanghao;
|
||||||
|
shr.Value = user.zhanghao;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#region 修改时获取真正数据值
|
||||||
|
private void initdata(int did)
|
||||||
|
{
|
||||||
|
cpckmodel = cpckbll.GetModel(did);
|
||||||
|
ckdh.Text = cpckmodel.ckbh;
|
||||||
|
riqi.Value = cpckmodel.riqi.ToString("yyyy-MM-dd");
|
||||||
|
scdh.Value = cpckmodel.scdh;
|
||||||
|
khming.Value = cpckmodel.khmc;
|
||||||
|
cpbh.Value = cpckmodel.cpbh;
|
||||||
|
cpmc.Value = cpckmodel.cpmc;
|
||||||
|
danjia.Value = cpckmodel.cpdj.ToString();
|
||||||
|
guige.Value = cpckmodel.guige.ToString();
|
||||||
|
zzshuliang.Value = cpckmodel.zzsl.ToString();
|
||||||
|
lingtou.Value = cpckmodel.lt.ToString();
|
||||||
|
shuliang.Value = cpckmodel.sl.ToString();
|
||||||
|
danwei.Value = cpckmodel.danwei;
|
||||||
|
lxr.Value = cpckmodel.lxr;
|
||||||
|
zongjine.Value = cpckmodel.zje.ToString();
|
||||||
|
lxdh.Value = cpckmodel.lxdh;
|
||||||
|
jingshouren.Value = cpckmodel.jsr;
|
||||||
|
shr.Value = cpckmodel.shr;
|
||||||
|
dizhi.Value = cpckmodel.shdizhi;
|
||||||
|
txt_beizhu.Text = cpckmodel.beizhu;
|
||||||
|
zhuangtai.Value = cpckmodel.zt;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 获取页面参数赋值model对象
|
||||||
|
private void getmd()
|
||||||
|
{
|
||||||
|
cpckmodel.ckbh = ckdh.Text;
|
||||||
|
cpckmodel.riqi = Convert.ToDateTime(riqi.Value);
|
||||||
|
cpckmodel.scdh = scdh.Value;
|
||||||
|
cpckmodel.khmc = khming.Value;
|
||||||
|
cpckmodel.cpbh = cpbh.Value;
|
||||||
|
cpckmodel.cpmc = cpmc.Value;
|
||||||
|
cpckmodel.cpdj = Convert.ToDecimal(danjia.Value);
|
||||||
|
cpckmodel.guige = Convert.ToDecimal(guige.Value);
|
||||||
|
cpckmodel.zzsl = Convert.ToInt32(zzshuliang.Value);
|
||||||
|
cpckmodel.lt = Convert.ToDecimal(lingtou.Value);
|
||||||
|
cpckmodel.sl = Convert.ToDecimal(shuliang.Value);
|
||||||
|
cpckmodel.danwei = danwei.Value;
|
||||||
|
cpckmodel.lxr = lxr.Value;
|
||||||
|
cpckmodel.zje = Convert.ToDecimal(zongjine.Value);
|
||||||
|
cpckmodel.lxdh = lxdh.Value;
|
||||||
|
cpckmodel.jsr = jingshouren.Value;
|
||||||
|
cpckmodel.shr = shr.Value;
|
||||||
|
cpckmodel.shdizhi = dizhi.Value;
|
||||||
|
cpckmodel.beizhu = txt_beizhu.Text;
|
||||||
|
cpckmodel.zt = zhuangtai.Value;
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 敏感权限查看
|
||||||
|
void pdquanxian(int juese)
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
||||||
|
if (DBHlper.getzt(user.id) != 1)
|
||||||
|
{
|
||||||
|
Response.Redirect("../index.aspx");
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "添加") == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("../Common/nopower.htm");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 编辑权限查看
|
||||||
|
void pdquanxianbj(int juese)
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
||||||
|
if (DBHlper.getzt(user.id) != 1)
|
||||||
|
{
|
||||||
|
Response.Redirect("../index.aspx");
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "编辑个人") == false
|
||||||
|
&& DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "编辑全部") == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("../Common/nopower.htm");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
protected void bt_tj_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string caozuo = "添加";
|
||||||
|
getmd();
|
||||||
|
//接收成功参数值
|
||||||
|
int rtx = 0;
|
||||||
|
//判断uid是否存在值,有值为修改,无值为添加
|
||||||
|
if (id.Value != null && id.Value != "")
|
||||||
|
{
|
||||||
|
cpckmodel.id = Convert.ToInt32(id.Value);
|
||||||
|
if (cpckbll.Update(cpckmodel))
|
||||||
|
{
|
||||||
|
rtx = Convert.ToInt32(id.Value);
|
||||||
|
caozuo = "修改";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cpckmodel.ckbh = DBHlper.getbh("CPCK-", "nr_z_cpck", "ckbh", 4);
|
||||||
|
// bh.Text = sgdmodel.sgdbianhao;
|
||||||
|
rtx = cpckbll.Add(cpckmodel);
|
||||||
|
}
|
||||||
|
if (rtx > 0)
|
||||||
|
{
|
||||||
|
//将session转换对象取值
|
||||||
|
Maticsoft.Model.nr_z_yhzh zh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
rizhi.yonghuming = zh.zhanghao;
|
||||||
|
//拼接字符串插入日志
|
||||||
|
rizhi.jilu = zh.zhanghao + caozuo + "了成品出库,出库单号为:" + ckdh.Text.Trim();
|
||||||
|
rizhi.leixing = "成品出库";
|
||||||
|
rizhi.riqi = DateTime.Now;
|
||||||
|
rizhibll.Add(rizhi);
|
||||||
|
Response.Redirect("Productout_browse.aspx?uid=" + rtx, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Response.Redirect("../Common/error.aspx");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
Response.Redirect("../Common/error.aspx");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Productin_browse.aspx.cs" Inherits="Productout_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 runat="server">
|
||||||
|
<title></title>
|
||||||
|
<script type="text/javascript"></script>
|
||||||
|
<script src="../Js/jquery-1.4.1.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="../Css/index.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="../Css/detail.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="../Jquery-ui/css/pepper-grinder/jquery-ui-1.10.4.custom.css" rel="stylesheet" type="text/css" />
|
||||||
|
<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 printdj() {
|
||||||
|
var url = "../Common/cpck_dy.aspx?uid=" + $("#id").val();
|
||||||
|
window.open(url, '成品出库打印', 'height=650,width=1100,top=0,left=100,toolbar=yes,menubar=no,scrollbars=yes, resizable=no,location=no, status=no')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form" runat="server">
|
||||||
|
<div class="rtbjdiv" >
|
||||||
|
<div class="add-top" >
|
||||||
|
<div class="add-top-dh" id="div_listdaohang"><h4>成品出库详细页   </h4> <a href="Productout_list.aspx" id="bt_fhlb" runat="server" style=" width:65px" class="button icon pin">回到列表</a></div>
|
||||||
|
<div class="add-top-cz" >
|
||||||
|
<a href="Productout_Form.aspx" id="bt_add" runat="server" Visible=false class="button icon add">添加</a>
|
||||||
|
<input type=button id="dayin" style=" width:80px;" class="button" value="打印单据" visible=false runat=server onclick="printdj()" />
|
||||||
|
<asp:button id="ckqr" Width="80" runat="server" CssClass="button" Text="出库确认" OnClientClick="return confirm('确定要出库吗')" onclick="btn_chuku_Click" Visible=false ></asp:button>  
|
||||||
|
<asp:button id="ckch" runat="server" Width="80" CssClass="button" Text="出库冲红" OnClientClick="return confirm('确定要出库冲红吗')" onclick="btnchonghong_Click" Visible=false></asp:button>
|
||||||
|
<asp:button id="bt_tj" runat="server" CssClass="button" Text="编辑" Visible=false onclick="bt_tj_Click" ></asp:button>  
|
||||||
|
<asp:button id="shanchu" runat="server" CssClass="button" Text="删除" OnClientClick="return confirm('确定要删除吗')" Visible=false onclick="Button1_Click" ></asp:button>  
|
||||||
|
<asp:label id="z_error" CssClass="error" runat="server"></asp:label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="dd_kong" style=" overflow:auto;">
|
||||||
|
<table class="bule"> <tr class="tdlietou"><td><h4>出库基本信息</h4></td></tr></table>
|
||||||
|
<table class="bule">
|
||||||
|
<tr>
|
||||||
|
<td><span>出库编号:</span><asp:Label id="ckdh" runat="server"></asp:Label></td>
|
||||||
|
<td><span>出库日期:</span><asp:Label id="riqi" runat="server"></asp:Label></td>
|
||||||
|
<td><span>单据编号:</span><asp:Label id="scdh" runat="server"></asp:Label></td>
|
||||||
|
<td><span>客户名称:</span><asp:Label id="khming" runat="server"></asp:Label></td>
|
||||||
|
<td><span>产品编号:</span><asp:Label id="cpbh" runat="server" ></asp:Label></td>
|
||||||
|
<td><span>产品名称:</span><asp:Label id="cpmc" runat="server"></asp:Label></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span>产品单价:</span><asp:Label id="danjia" runat="server" ></asp:Label></td>
|
||||||
|
<td><span>产品包装规格:</span><asp:Label id="guige" runat="server"></asp:Label></td>
|
||||||
|
<td><span>整装数量:</span><asp:Label id="zzshuliang" runat="server" ></asp:Label></td>
|
||||||
|
<td><span>零头:</span><asp:Label id="lingtou" runat="server"></asp:Label></td>
|
||||||
|
<td><span>数量:</span><asp:Label id="shuliang" runat="server"></asp:Label></td>
|
||||||
|
<td><span>总金额:</span><asp:Label id="zongjine" runat="server"></asp:Label></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span>单位:</span><asp:Label id="danwei" runat="server"></asp:Label></td>
|
||||||
|
<td><span>联系人:</span><asp:Label id="lxr" runat="server" ></asp:Label></td>
|
||||||
|
<td><span>联系电话:</span><asp:Label id="lxdh" runat="server"></asp:Label></td>
|
||||||
|
<td><span>经手人:</span><asp:Label id="jingshouren" runat="server"></asp:Label></td>
|
||||||
|
<td><span>送货人:</span><asp:Label id="shr" runat="server"></asp:Label></td>
|
||||||
|
<td><span>状态:</span><asp:Label id="zhuangtai" runat="server"></asp:Label></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6"><span>送货地址:</span><asp:Label id="dizhi" runat="server" ></asp:Label></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6"><span>备注:</span><asp:Label id="txt_beizhu" runat="server"></asp:Label></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<asp:HiddenField ID="id" runat="server" Value="" />
|
||||||
|
<script src="../Js/messageshow.js" type="text/javascript"></script>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,228 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public partial class Productout_browse : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_cprk cpckmodel = new Maticsoft.Model.nr_z_cprk();
|
||||||
|
Maticsoft.BLL.nr_z_cprk cpckbll = new Maticsoft.BLL.nr_z_cprk();
|
||||||
|
//创建一个操作记录模板
|
||||||
|
Maticsoft.Model.nr_sys_rizhi rizhi = new Maticsoft.Model.nr_sys_rizhi();
|
||||||
|
//创建一个操作记录bll
|
||||||
|
Maticsoft.BLL.nr_sys_rizhi rizhibll = new Maticsoft.BLL.nr_sys_rizhi();
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
if (Session["user"] == null)
|
||||||
|
{
|
||||||
|
Response.Redirect("../index.aspx");
|
||||||
|
}
|
||||||
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
||||||
|
if (Request.QueryString["uid"] != null && Request.QueryString["uid"] != "")
|
||||||
|
{
|
||||||
|
id.Value = Request.QueryString["uid"].ToString();
|
||||||
|
}
|
||||||
|
initdata(Convert.ToInt32(id.Value));
|
||||||
|
pdquanxian(user.juese);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#region 获取真正数据值
|
||||||
|
private void initdata(int did)
|
||||||
|
{
|
||||||
|
cpckmodel = cpckbll.GetModel(did);
|
||||||
|
ckdh.Text = cpckmodel.rkbh;
|
||||||
|
riqi.Text = cpckmodel.riqi.ToString("yyyy-MM-dd");
|
||||||
|
scdh.Text = cpckmodel.scdh;
|
||||||
|
//khming.Text = cpckmodel.;
|
||||||
|
//cpbh.Text = cpckmodel.cpmc;
|
||||||
|
cpmc.Text = cpckmodel.cpmc;
|
||||||
|
//danjia.Text = cpckmodel..ToString();
|
||||||
|
//guige.Text = cpckmodel.guige.ToString();
|
||||||
|
zzshuliang.Text = cpckmodel.zzsl.ToString();
|
||||||
|
lingtou.Text = cpckmodel.lt.ToString();
|
||||||
|
shuliang.Text = cpckmodel.sl.ToString();
|
||||||
|
//danwei.Text = cpckmodel.danwei;
|
||||||
|
//lxr.Text = cpckmodel.lxr;
|
||||||
|
//zongjine.Text = cpckmodel.zje.ToString();
|
||||||
|
//lxdh.Text = cpckmodel.lxdh;
|
||||||
|
jingshouren.Text = cpckmodel.jsr;
|
||||||
|
//shr.Text = cpckmodel.shr;
|
||||||
|
//dizhi.Text = cpckmodel.shdizhi;
|
||||||
|
//txt_beizhu.Text = cpckmodel.beizhu;
|
||||||
|
zhuangtai.Text = cpckmodel.zt;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 敏感权限查看
|
||||||
|
void pdquanxian(int juese)
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
||||||
|
if (DBHlper.getzt(user.id) != 1)
|
||||||
|
{
|
||||||
|
Response.Redirect("../index.aspx");
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "查看全部") == false && DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "查看个人") == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("../Common/nopower.htm");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "编辑个人") && jingshouren.Text == user.zhanghao)
|
||||||
|
{
|
||||||
|
bt_tj.Visible = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "编辑全部"))
|
||||||
|
{
|
||||||
|
bt_tj.Visible = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "删除个人") && jingshouren.Text == user.zhanghao)
|
||||||
|
{
|
||||||
|
shanchu.Visible = true;
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "删除全部"))
|
||||||
|
{
|
||||||
|
shanchu.Visible = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "入库确认"))
|
||||||
|
{
|
||||||
|
ckqr.Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "入库冲红"))
|
||||||
|
{
|
||||||
|
ckch.Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "添加"))
|
||||||
|
{
|
||||||
|
bt_add.Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zhuangtai.Text == "已入库")
|
||||||
|
{
|
||||||
|
ckqr.Enabled = false;
|
||||||
|
ckqr.BackColor = System.Drawing.Color.Gray;
|
||||||
|
shanchu.Enabled = false;
|
||||||
|
shanchu.BackColor = System.Drawing.Color.Gray;
|
||||||
|
bt_tj.Enabled = false;
|
||||||
|
bt_tj.BackColor = System.Drawing.Color.Gray;
|
||||||
|
}
|
||||||
|
if (zhuangtai.Text == "待确认")
|
||||||
|
{
|
||||||
|
ckch.Enabled = false;
|
||||||
|
ckch.BackColor = System.Drawing.Color.Gray;
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "打印"))
|
||||||
|
{
|
||||||
|
dayin.Visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
protected void bt_tj_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Response.Redirect("Productout_Form.aspx?uid=" + id.Value);
|
||||||
|
}
|
||||||
|
protected void Button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
if (cpckbll.Delete(Convert.ToInt32(id.Value)))
|
||||||
|
{
|
||||||
|
//给日志模板赋值
|
||||||
|
rizhi.riqi = DateTime.Now;
|
||||||
|
rizhi.leixing = "成品入库";
|
||||||
|
//将session转换对象取值
|
||||||
|
Maticsoft.Model.nr_z_yhzh zh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
//拼接字符串插入日志
|
||||||
|
rizhi.jilu = zh.zhanghao + "删除了成品入库,入库单号为:" + cpbh.Text.Trim();
|
||||||
|
rizhi.yonghuming = zh.zhanghao.ToString();
|
||||||
|
rizhibll.Add(rizhi);
|
||||||
|
Response.Redirect("Productout_list.aspx", false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Response.Write("<script>alert('删除失败')</script>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnchonghong_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
DataTable dt = DBHlper.Execute(string.Format("select * from nr_z_cpkc where scdh='{0}' and xmmc='{1}' and khmc='{2}'", scdh.Text, cpbh.Text, khming.Text)).Tables[0];
|
||||||
|
double sl = Convert.ToDouble(dt.Rows[0]["sl"]);
|
||||||
|
double nowsl = Convert.ToDouble(shuliang.Text);
|
||||||
|
int gxcount = DBHlper.excutecmd("update nr_z_cpkc set sl=" + (sl + nowsl) + " where id=" + dt.Rows[0]["id"]);
|
||||||
|
if (gxcount > 0)
|
||||||
|
{
|
||||||
|
DBHlper.excutecmd("update nr_z_cprk set zt='待确认' where id=" + id.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Response.Write("<script>alert('入库冲红失败')</script>");
|
||||||
|
}
|
||||||
|
|
||||||
|
//给日志模板赋值
|
||||||
|
rizhi.riqi = DateTime.Now;
|
||||||
|
rizhi.leixing = "成品入库";
|
||||||
|
//将session转换对象取值
|
||||||
|
Maticsoft.Model.nr_z_yhzh zh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
//拼接字符串插入日志
|
||||||
|
rizhi.jilu = zh.zhanghao + "执行了入库冲红,入库单号为:" + ckdh.Text.Trim();
|
||||||
|
rizhi.yonghuming = zh.zhanghao.ToString();
|
||||||
|
rizhibll.Add(rizhi);
|
||||||
|
Response.Redirect("Productout_browse.aspx?uid=" + id.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void btn_chuku_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//var sql = string.Format("select * from view_nr_z_cpkc where scdh='{0}' and xmmc='{1}' and khmc='{2}'", scdh.Text, cpbh.Text, khming.Text);
|
||||||
|
var sql = string.Format("select * from view_nr_z_cpkc where cpbh='{0}'", cpbh.Text);
|
||||||
|
var result = DBHlper.Execute(sql);
|
||||||
|
DataTable dt = result.Tables[0];
|
||||||
|
if (dt.Rows.Count == 0)
|
||||||
|
{
|
||||||
|
Response.Write("<script>alert('库存不足')</script>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
double sl = Convert.ToDouble(dt.Rows[0]["sl"]);
|
||||||
|
double nowsl = Convert.ToDouble(shuliang.Text);
|
||||||
|
if (sl < nowsl)
|
||||||
|
{
|
||||||
|
Response.Write("<script>alert('库存不足')</script>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DBHlper.excutecmd("update nr_z_cpkc set sl=" + (sl - nowsl) + " where id=" + dt.Rows[0]["id"]);
|
||||||
|
DBHlper.excutecmd("update nr_z_cprk set zt='已入库' where id=" + id.Value);
|
||||||
|
rizhi.riqi = DateTime.Now;
|
||||||
|
rizhi.leixing = "成品入库";
|
||||||
|
//将session转换对象取值
|
||||||
|
Maticsoft.Model.nr_z_yhzh zh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
//拼接字符串插入日志
|
||||||
|
rizhi.jilu = zh.zhanghao + "执行了成品入库,成品入库号为:" + ckdh.Text.Trim();
|
||||||
|
rizhi.yonghuming = zh.zhanghao.ToString();
|
||||||
|
rizhibll.Add(rizhi);
|
||||||
|
Response.Redirect("Productout_browse.aspx?uid=" + id.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,180 @@
|
||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Productin_list.aspx.cs" Inherits="Productout_list" %>
|
||||||
|
|
||||||
|
<!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 runat="server">
|
||||||
|
<title></title>
|
||||||
|
<link href="../Css/index.css" rel="stylesheet" type="text/css" />
|
||||||
|
<script src="../Jquery-ui/js/jquery-1.10.2.js" type="text/javascript"></script>
|
||||||
|
<link href="../Css/right.css" rel="stylesheet" type="text/css" />
|
||||||
|
<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/Calendar3.js" type="text/javascript"></script>
|
||||||
|
<script src="../Js/ToolTip.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">
|
||||||
|
$(document).ready(function () {
|
||||||
|
spasefuzhi(Productout_list);
|
||||||
|
$("#ycdaochu").click(function () {
|
||||||
|
var selectid = "";
|
||||||
|
$(".xz").each(function () {
|
||||||
|
if ($(this).is(":checked")) {
|
||||||
|
selectid += $(this).parent().parent().attr("tag") + ',';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$("#selectid").val(selectid);
|
||||||
|
})
|
||||||
|
$("#drp_zt").change(function () {
|
||||||
|
yltj = "";
|
||||||
|
var daylength = "";
|
||||||
|
daylength = Productout_list.nowdaycount($("#drp_zt").val(),nowmonth).value;
|
||||||
|
if ($("#drop_ziduan").length == 0) {
|
||||||
|
$("#gjxnr").html(daylength);
|
||||||
|
}
|
||||||
|
|
||||||
|
var nowp = Productout_list.sumitem(" where " + pxtiaojian() + " 1=1 ").value
|
||||||
|
$("#span_sumitem").text(nowp);
|
||||||
|
pagecount = $("#span_sumpage").text() - 1;
|
||||||
|
$("#drp_pageitem").change();
|
||||||
|
bind();
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
//调用导出方法
|
||||||
|
function wddcfont() {
|
||||||
|
$("#<%=ycdaochu.ClientID%>").click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script src="../Js/common.js" type="text/javascript"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form" runat="server">
|
||||||
|
<div class="rtbjdiv" >
|
||||||
|
<div class="right-top">
|
||||||
|
<table width="100%" height="100%">
|
||||||
|
<tr>
|
||||||
|
<td >
|
||||||
|
<div class="right-top-dh" id="div_listdaohang"><h4>成品出库主页</h4>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td >
|
||||||
|
<div class="right-top-an">
|
||||||
|
<ul id="ul_gongju" class="ulgongju" >
|
||||||
|
<li runat=server id="li_add" visible=false><a href="Productout_Form.aspx" class="button icon add">添加</a></li>
|
||||||
|
<li runat="server" id="sousuo"><a href="#button" class="button icon search" onclick="gjzk('search')" >查询</a> </li>
|
||||||
|
<li runat=server id="xiazai" visible=false><a href="#button" id="btn_daochu" onclick="wddcfont()" class="button icon arrowdown">导出</a> </li>
|
||||||
|
<li runat=server id="leiset" visible=false><a href="#button" id="li_liepeizhi" class="button icon settings">配置</a></li>
|
||||||
|
<li runat=server id="rileget"><a href="#button" class="button icon clock" onclick="gjzk('rili')">月历</a></li>
|
||||||
|
<li runat=server id="li1"><a href="#button" class="button icon favorite" onclick="setshoucang()" >收藏</a></li>
|
||||||
|
<li><asp:DropDownList ID="drp_zt" CssClass="drpdownstyle" runat="server" ToolTip="出库状态"><asp:ListItem Value="" Text="全部"></asp:ListItem><asp:ListItem Value="已出库" Text="已出库"></asp:ListItem><asp:ListItem Value="待确认" Text="待确认"></asp:ListItem></asp:DropDownList> </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td >
|
||||||
|
<div id="div_page" >
|
||||||
|
<table id="tbl_pagebottom" height="20" border="0" cellpadding="0" cellspacing="0" >
|
||||||
|
<tr>
|
||||||
|
<td>共<span id="span_sumitem"></span>条数据</td>
|
||||||
|
<td class="pagestyle" id="td_first" title="首页">
|
||||||
|
<img src="../Images_Folder/pagination_icons_01.png" width="16" height="16" alt="">
|
||||||
|
</td>
|
||||||
|
<td class="pagestyle" id="td_up" title="上一页">
|
||||||
|
<img src="../Images_Folder/pagination_icons_02.png" width="16" height="16" alt="">
|
||||||
|
</td>
|
||||||
|
<td><span>第</span></td>
|
||||||
|
<td>
|
||||||
|
<span><input id="txt_nowpage" type="text" class="ui-pg-input" value="1"/></span>
|
||||||
|
</td>
|
||||||
|
<td><span>页/共</span></td>
|
||||||
|
|
||||||
|
<td><span id="span_sumpage" ></span>页</td>
|
||||||
|
<td class="pagestyle" id="td_next" title="下一页">
|
||||||
|
<img src="../Images_Folder/pagination_icons_03.png" width="16" height="16" alt="">
|
||||||
|
</td>
|
||||||
|
<td class="pagestyle" id="td_endpage" title="尾页">
|
||||||
|
<img src="../Images_Folder/pagination_icons_04.png" width="16" height="16" alt="">
|
||||||
|
</td>
|
||||||
|
<td class="pagestyle" id="td_go" title="跳页"><img src="../Images_Folder/ty.png" style="margin-top:5px" width="16" height="16" alt=""></td>
|
||||||
|
<td title="显示条数">
|
||||||
|
<span>
|
||||||
|
<select id="drp_pageitem">
|
||||||
|
<option value="20">20</option>
|
||||||
|
<option value="30">30</option>
|
||||||
|
<option value="40">40</option>
|
||||||
|
<option value="50">50</option>
|
||||||
|
</select>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<%-- 工具箱--%>
|
||||||
|
<div id="Gjx" class="Gjxzhu">
|
||||||
|
<table width="100%" height="100%">
|
||||||
|
<tr height="80px">
|
||||||
|
<td >
|
||||||
|
<div id="gjxnr" class="right-gjxnr">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="ycsjgddiv">
|
||||||
|
<%-- 数据表头--%>
|
||||||
|
<div class="shujutou" id="div_title">
|
||||||
|
<table border="0" class="tbl_titie" id="biaotou">
|
||||||
|
<tr class="tr_titile" id="tr_biaotou">
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<%-- 数据列表--%>
|
||||||
|
<div class="shuju" id="t_r_content" onscroll="scrolltow()" >
|
||||||
|
<table class="hovertable" id="tbl_list">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<%--数据汇总--%>
|
||||||
|
<div id="div_huizong" onscroll="listscroll()">
|
||||||
|
<table border="0" id="huizong" >
|
||||||
|
<tr class="tr_bottom"> </tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%--列配置--%>
|
||||||
|
<div id="dialog-modal" title="列配置" style="overflow:hidden; display:none;" >
|
||||||
|
<table style="width:90%">
|
||||||
|
<tr style=" font-weight:bold;"> <td style="width:30%">顺序</td> <td style="width:30%">列名</td> <td style="width:35%">显示</td> </tr>
|
||||||
|
</table>
|
||||||
|
<div style="width:90%;float:left;overflow-x: hidden;overflow-y: scroll;height:125px">
|
||||||
|
<table style="width:100%" id="tbl_peizhi">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="lpzdiv" >
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<img src="../Images_Folder/Button/upbt.png" id="btn_up" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<img src="../Images_Folder/Button/down.png" id="btn_down"/>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span style=" display:none"> <asp:Button ID="ycdaochu" runat="server" onclick="DownLoad" /></span>
|
||||||
|
<asp:HiddenField ID="hiddenid" runat=server />
|
||||||
|
<asp:HiddenField ID="Hiddenname" runat=server />
|
||||||
|
<input type=hidden id="pagename" value="cpck" />
|
||||||
|
<asp:HiddenField ID="selectid" runat=server />
|
||||||
|
<asp:HiddenField ID="strwhere" runat=server />
|
||||||
|
<asp:HiddenField ID="hiddenhuizong" runat=server value="产品单价,整装数量,零头,数量,总金额"/>
|
||||||
|
<script src="../Js/messageshow.js" type="text/javascript"></script>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,414 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using Ajax;
|
||||||
|
using System.Data;
|
||||||
|
using System.IO;
|
||||||
|
using System.Data.OleDb;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Text;
|
||||||
|
public partial class Productout_list : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
//创建一个客户模板
|
||||||
|
Maticsoft.Model.nr_z_ddwxd kehumd = new Maticsoft.Model.nr_z_ddwxd();
|
||||||
|
//创建一个共用的客户bll
|
||||||
|
Maticsoft.BLL.nr_z_ddwxd kehubll = new Maticsoft.BLL.nr_z_ddwxd();
|
||||||
|
//创建一个操作记录模板
|
||||||
|
Maticsoft.Model.nr_sys_rizhi rizhi = new Maticsoft.Model.nr_sys_rizhi();
|
||||||
|
//创建一个操作记录bll
|
||||||
|
Maticsoft.BLL.nr_sys_rizhi rizhibll = new Maticsoft.BLL.nr_sys_rizhi();
|
||||||
|
int jsid = 0;
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
if (Session["user"] == null)
|
||||||
|
{
|
||||||
|
Response.Redirect("../index.aspx");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Utility.RegisterTypeForAjax(typeof(Productout_list));
|
||||||
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
||||||
|
hiddenid.Value = user.juese.ToString();
|
||||||
|
Hiddenname.Value = user.zhanghao;
|
||||||
|
jsid = user.juese;
|
||||||
|
pdquanxian(jsid);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 数据加载输出
|
||||||
|
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
||||||
|
public string page_change(int pg, int pageitem, string paixu, string tiaojian)
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_yhzh zhanghao = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
string htmlcode = "";
|
||||||
|
string isexits = string.Format("select count(*) from nr_lt_paixu where userid='{0}' and tblname='{1}'", zhanghao.id, "nr_z_cpck");
|
||||||
|
int exitscount = DBHlper.getcount(isexits);
|
||||||
|
|
||||||
|
if (exitscount > 0)
|
||||||
|
{
|
||||||
|
string paixuselct = string.Format("select * from nr_lt_paixu where userid='{0}' and tblname='{1}' and isxianshi={2} order by shuixu ", zhanghao.id, "nr_z_cpck", 1);
|
||||||
|
DataTable dtselect = DBHlper.Execute(paixuselct).Tables[0];
|
||||||
|
string wherecode = string.Format("select top {0} ", pageitem);
|
||||||
|
foreach (DataRow dtr in dtselect.Rows)
|
||||||
|
{
|
||||||
|
wherecode += dtr["lieming"] + ",";
|
||||||
|
}
|
||||||
|
wherecode += "id";
|
||||||
|
if (DBHlper.GetPermission(zhanghao.juese, "成品出库", "nr_z_cpck", "查看全部"))
|
||||||
|
{
|
||||||
|
wherecode += string.Format(" from nr_z_cpck where " + tiaojian + " id not in(select top ({0}*{1}) id from nr_z_cpck)" + paixu, pg, pageitem);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (DBHlper.GetPermission(zhanghao.juese, "成品出库", "nr_z_cpck", "查看个人"))
|
||||||
|
{
|
||||||
|
wherecode += string.Format(" from nr_z_cpck where jsr='" + zhanghao.zhanghao + "' and " + tiaojian + " id not in(select top ({0}*{1}) id from nr_z_cpck)" + paixu, pg, pageitem);
|
||||||
|
|
||||||
|
}
|
||||||
|
DataTable dt_paixu = DBHlper.Execute(wherecode).Tables[0];
|
||||||
|
if (dt_paixu.Rows.Count == 0)
|
||||||
|
{
|
||||||
|
return "<tr><td>   没有数据</td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < dt_paixu.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
htmlcode += "<tr tag='" + dt_paixu.Rows[i]["id"] + "' >";
|
||||||
|
htmlcode += " <td style='width:20px'><input type='checkbox' class='xz'/></td>";
|
||||||
|
for (int j = 0; j < dt_paixu.Columns.Count - 1; j++)
|
||||||
|
{
|
||||||
|
htmlcode += "<td><span>" + dt_paixu.Rows[i][j] + "</span></td>";
|
||||||
|
}
|
||||||
|
htmlcode += "</tr>";
|
||||||
|
}
|
||||||
|
return htmlcode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string lieselect = string.Format("select * from nr_sys_lieming where tblname='{0}' ORDER BY xh", "nr_z_cpck");
|
||||||
|
DataTable liedt = DBHlper.Execute(lieselect).Tables[0];
|
||||||
|
int lieshuixu = 0;
|
||||||
|
foreach (DataRow liedr in liedt.Rows)
|
||||||
|
{
|
||||||
|
lieshuixu++;
|
||||||
|
string cmdinsert = string.Format("insert into nr_lt_paixu values('{0}','{1}','{2}','{3}',{4},{5})", zhanghao.id, "nr_z_cpck", liedr["ywlieming"], liedr["zwlieming"], lieshuixu, 1);
|
||||||
|
DBHlper.excutecmd(cmdinsert);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 传入条数返回页数以便前台调用
|
||||||
|
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
||||||
|
public int maxpage(int count, string tj)
|
||||||
|
{
|
||||||
|
int fanhuizhi = 0;
|
||||||
|
string cmd = string.Format("select count(*) from nr_z_cpck " + tj);
|
||||||
|
Maticsoft.Model.nr_z_yhzh yhzh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
if (!DBHlper.GetPermission(yhzh.juese, "成品出库", "nr_z_cpck", "查看全部"))
|
||||||
|
{
|
||||||
|
if (tj == "")
|
||||||
|
{
|
||||||
|
cmd += " where jsr='" + yhzh.zhanghao + "'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmd += " and jsr='" + yhzh.zhanghao + "'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int sumcount = DBHlper.getcount(cmd);
|
||||||
|
if (sumcount > count)
|
||||||
|
{
|
||||||
|
fanhuizhi = sumcount / count;
|
||||||
|
}
|
||||||
|
return fanhuizhi;
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 数据排序
|
||||||
|
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
||||||
|
public void itempaixu(string code)
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_yhzh yhzh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
string[] pxzu = code.Split(';');
|
||||||
|
string[] codezu = new string[4];
|
||||||
|
foreach (string px in pxzu)
|
||||||
|
{
|
||||||
|
codezu = px.Split('/');
|
||||||
|
string cmdexits = string.Format("select id from nr_lt_paixu where userid='{0}' and tblname='{1}' and lieming='{2}'", yhzh.id, "nr_z_cpck", codezu[2]);
|
||||||
|
DataTable paixutable = DBHlper.Execute(cmdexits).Tables[0];
|
||||||
|
if (paixutable.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
int idfanhui = Convert.ToInt32(paixutable.Rows[0][0]);
|
||||||
|
string updatepaixu = string.Format("update nr_lt_paixu set shuixu={0},isxianshi={1} where id={2}", codezu[0], codezu[3], idfanhui);
|
||||||
|
DBHlper.excutecmd(updatepaixu);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string paixuinsert = string.Format("insert into nr_paixu (userid,tblname,lieming,zhongwen,shuixu,isxianshi) values('{0}','{1}','{2}','{3}',{4},{5})", yhzh.id, "nr_z_cpck", codezu[2], codezu[1], codezu[0], codezu[3]);
|
||||||
|
DBHlper.excutecmd(paixuinsert);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 列头排序
|
||||||
|
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
||||||
|
public string paixu()
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_yhzh zhanghao = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
string paixuselct = string.Format("select * from nr_lt_paixu where userid='{0}' and tblname='{1}' and isxianshi={2} order by shuixu ", zhanghao.id, "nr_z_cpck", 1);
|
||||||
|
DataTable dtselect = DBHlper.Execute(paixuselct).Tables[0];
|
||||||
|
string htmlcode = "<td style='width:20px'><input onclick='selectall()' title='全选' type='checkbox' style='width:20px' id='cbo_selectall'/></td>";
|
||||||
|
foreach (DataRow dr in dtselect.Rows)
|
||||||
|
{
|
||||||
|
htmlcode += string.Format("<td tag='{0}'>{1}</td>", dr["lieming"], dr["zhongwen"]);
|
||||||
|
}
|
||||||
|
return htmlcode;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 获取隐藏的列
|
||||||
|
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
||||||
|
public string yincanglie(int endid)
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_yhzh zhanghao = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
endid = endid - 1;
|
||||||
|
string displaycmd = "select * from nr_lt_paixu where isxianshi=0 and tblname='nr_z_cpck' and userid='" + zhanghao.id + "'";
|
||||||
|
DataTable distable = DBHlper.Execute(displaycmd).Tables[0];
|
||||||
|
string htmlcode = "";
|
||||||
|
foreach (DataRow dr in distable.Rows)
|
||||||
|
{
|
||||||
|
endid++;
|
||||||
|
htmlcode += "<tr class='tr_item' id='tr_" + endid + "'><td style='width:30%'>" + endid + "</td><td style='width:30%' tag=" + dr["lieming"] + ">" + dr["zhongwen"] + "</td><td style='width:30%'><input type='checkbox'/></td> </tr>";
|
||||||
|
}
|
||||||
|
return htmlcode;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 查询数据总数
|
||||||
|
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
||||||
|
public int sumitem(string wheretj)
|
||||||
|
{
|
||||||
|
string selectcmd = "select count(*) from nr_z_cpck " + wheretj;
|
||||||
|
Maticsoft.Model.nr_z_yhzh yhzh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
if (!DBHlper.GetPermission(yhzh.juese, "成品出库", "nr_z_cpck", "查看全部"))
|
||||||
|
{
|
||||||
|
if (wheretj == "")
|
||||||
|
{
|
||||||
|
selectcmd += " where jsr='" + yhzh.zhanghao + "'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
selectcmd += " and jsr='" + yhzh.zhanghao + "'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int sumcount = DBHlper.getcount(selectcmd);
|
||||||
|
return sumcount;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region 日期查询
|
||||||
|
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
||||||
|
public string nowdaycount(string zt, int selmonth)
|
||||||
|
{
|
||||||
|
DateTime nowdt = DateTime.Now;
|
||||||
|
int days = DateTime.DaysInMonth(nowdt.Year, selmonth);
|
||||||
|
string yuechu = nowdt.Year + "-" + selmonth + "-" + "1";
|
||||||
|
string yuemo = Convert.ToDateTime(nowdt.Year + "-" + selmonth + "-" +days).AddDays(1).ToString("yyyy-MM-dd");
|
||||||
|
DateTime yc = Convert.ToDateTime(yuechu);
|
||||||
|
string cmd = "";
|
||||||
|
if (zt == "")
|
||||||
|
{
|
||||||
|
cmd = string.Format("select CONVERT(varchar(12),riqi,111) as riqi from nr_z_cpck where riqi>='{0}' and riqi<='{1}' ", yuechu, yuemo);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cmd = string.Format("select CONVERT(varchar(12),riqi,111) as riqi from nr_z_cpck where riqi>='{0}' and riqi<='{1}' and zt='"+zt+"' ", yuechu, yuemo);
|
||||||
|
}
|
||||||
|
|
||||||
|
Maticsoft.Model.nr_z_yhzh yhzh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
if (!DBHlper.GetPermission(yhzh.juese, "成品出库", "nr_z_cpck", "查看全部"))
|
||||||
|
{
|
||||||
|
cmd += " and jsr='" + yhzh.zhanghao + "'";
|
||||||
|
}
|
||||||
|
DataTable dt = DBHlper.Execute(cmd).Tables[0];
|
||||||
|
var biao = "<table class='lbrilitb' id='tbl_yueli'>"
|
||||||
|
+ "<tr class='lbrilitbtou'><td width='50px' ><span>日期</span><div><span class='cursor' onclick='yl_up()' title='上月'><</span> <span id='yl_nowmonth' title='" + selmonth + "月'>" + selmonth + "</span> <span class='cursor' onclick='yl_next()' title='下月'>></span></div></td>";
|
||||||
|
for (var x = 1; x <= days; x++)
|
||||||
|
{
|
||||||
|
biao += "<td width='50px'>" + x + "</td>";
|
||||||
|
}
|
||||||
|
biao += "</tr><tr style='width:100%;height:37px;cursor:pointer'><td width='50px' id='td_sum' onclick='selectallday()' title='全部'>数量</td>";
|
||||||
|
for (var x = 1; x <= days; x++)
|
||||||
|
{
|
||||||
|
string str = yc.ToShortDateString();
|
||||||
|
int lenth = dt.Select("riqi='" + yc.ToShortDateString() + "'").Length;
|
||||||
|
string everday = yc.Year.ToString();
|
||||||
|
if (yc.Month < 10)
|
||||||
|
{
|
||||||
|
everday += "/0" + yc.Month;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
everday += "/" + yc.Month;
|
||||||
|
}
|
||||||
|
if (yc.Day < 10)
|
||||||
|
{
|
||||||
|
everday += "/0" + yc.Day;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
everday += "/" + yc.Day;
|
||||||
|
}
|
||||||
|
|
||||||
|
biao += "<td width='50px' onclick='selectnowday(this)' tag='" + everday + "'>" + dt.Select("riqi='" + everday + "'").Length + "</td>";
|
||||||
|
yc = yc.AddDays(1);
|
||||||
|
}
|
||||||
|
biao += "</tr></table>";
|
||||||
|
return biao;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 敏感权限查看
|
||||||
|
void pdquanxian(int juese)
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
||||||
|
if (DBHlper.getzt(user.id) != 1)
|
||||||
|
{
|
||||||
|
Response.Redirect("../index.aspx");
|
||||||
|
}
|
||||||
|
if (!DBHlper.GetPermission(juese, "成品出库", "nr_z_cpck", "查看全部") && !DBHlper.GetPermission(juese, "成品出库", "nr_z_cpck", "查看个人"))
|
||||||
|
{
|
||||||
|
Response.Redirect("../Common/nopower.htm");
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(juese, "成品出库", "nr_z_cpck", "添加"))
|
||||||
|
{
|
||||||
|
li_add.Visible = true;
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(juese, "成品出库", "nr_z_cpck", "导出"))
|
||||||
|
{
|
||||||
|
xiazai.Visible = true;
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(juese, "成品出库", "nr_z_cpck", "配置"))
|
||||||
|
{
|
||||||
|
leiset.Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#region 判断查看权限
|
||||||
|
[Ajax.AjaxMethod]
|
||||||
|
public string isquanxian(int uid)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (DBHlper.GetPermission(uid, "成品出库", "nr_z_cpck", "查看全部"))
|
||||||
|
{
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
else if (DBHlper.GetPermission(uid, "成品出库", "nr_z_cpck", "查看个人"))
|
||||||
|
{
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region 下载方法
|
||||||
|
public void DownLoad(object o, EventArgs e)
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_yhzh zhanghao = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
string selectid = this.selectid.Value;
|
||||||
|
string colmn = "";
|
||||||
|
ArrayList sList = new ArrayList();
|
||||||
|
DataTable dtcolmnname = DBHlper.Execute("select lieming,zhongwen from nr_lt_paixu where tblname='nr_z_cpck' and isxianshi=1 and userid='" + ((Maticsoft.Model.nr_z_yhzh)Session["user"]).id + "' order by shuixu").Tables[0];
|
||||||
|
string tj = strwhere.Value;
|
||||||
|
foreach (DataRow r in dtcolmnname.Rows)
|
||||||
|
{
|
||||||
|
colmn += r["lieming"].ToString() + ',';
|
||||||
|
sList.Add(r["zhongwen"].ToString());
|
||||||
|
}
|
||||||
|
colmn = colmn.TrimEnd(',');
|
||||||
|
string selectcode = "";
|
||||||
|
if (drp_zt.SelectedItem.Value != "")
|
||||||
|
{
|
||||||
|
selectcode = "select " + colmn + " from nr_z_cpck where zt='" + drp_zt.Text + "'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
selectcode = "select " + colmn + " from nr_z_cpck where 1=1 ";
|
||||||
|
}
|
||||||
|
if (tj != "")
|
||||||
|
{
|
||||||
|
selectcode += tj.Replace("where", "and");
|
||||||
|
}
|
||||||
|
if (selectid != "")
|
||||||
|
{
|
||||||
|
selectcode += " and id in(" + selectid.TrimEnd(',') + ")";
|
||||||
|
}
|
||||||
|
if (DBHlper.GetPermission(zhanghao.juese, "成品出库", "nr_z_cpck", "查看全部"))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (DBHlper.GetPermission(zhanghao.juese, "成品出库", "nr_z_cpck", "查看个人"))
|
||||||
|
{
|
||||||
|
selectcode += " and jsr='" + zhanghao.zhanghao + "'";
|
||||||
|
}
|
||||||
|
DataTable dt = DBHlper.Execute(selectcode + " order by id desc").Tables[0];
|
||||||
|
DBHlper.ExportByWeb(dt, "成品出库"+DateTime.Now, sList);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region 汇总
|
||||||
|
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
||||||
|
public string gethuizong(string tiaojian, string[] hzlie)
|
||||||
|
{
|
||||||
|
Maticsoft.Model.nr_z_yhzh zhanghao = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
|
string code = "<td></td>";
|
||||||
|
string paixuselct = string.Format("select * from nr_lt_paixu where userid='{0}' and tblname='{1}' and isxianshi={2} order by shuixu ", zhanghao.id, "nr_z_cpck", 1);
|
||||||
|
DataTable dtselect = DBHlper.Execute(paixuselct).Tables[0];
|
||||||
|
string datacolmn = "";
|
||||||
|
string wherecode = "";
|
||||||
|
int exits = 0;
|
||||||
|
foreach (DataRow dr in dtselect.Rows)
|
||||||
|
{
|
||||||
|
exits = 0;
|
||||||
|
foreach (string lie in hzlie)
|
||||||
|
{
|
||||||
|
if (dr["zhongwen"].ToString() == lie)
|
||||||
|
{
|
||||||
|
exits++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (exits == 0)
|
||||||
|
{
|
||||||
|
code += "<td></td>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
datacolmn = dr["lieming"].ToString();
|
||||||
|
wherecode = "select sum(" + datacolmn + ") ";
|
||||||
|
if (DBHlper.GetPermission(zhanghao.juese, "成品出库", "nr_z_cpck", "查看全部"))
|
||||||
|
{
|
||||||
|
wherecode += " from nr_z_cpck where " + tiaojian;
|
||||||
|
}
|
||||||
|
else if (DBHlper.GetPermission(zhanghao.juese, "成品出库", "nr_z_cpck", "查看个人"))
|
||||||
|
{
|
||||||
|
wherecode += " from nr_z_cpck where jsr='" + zhanghao.zhanghao + "' and " + tiaojian;
|
||||||
|
}
|
||||||
|
wherecode += " 1=1 ";
|
||||||
|
code += "<td class='blue'>" + DBHlper.getfirstcolmn(wherecode) + "</td>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return code;
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -33,7 +33,7 @@ public partial class Productout_Form : System.Web.UI.Page
|
||||||
string uid = Request.QueryString["uid"].ToString();
|
string uid = Request.QueryString["uid"].ToString();
|
||||||
id.Value = uid;
|
id.Value = uid;
|
||||||
initdata(Convert.ToInt32(uid));
|
initdata(Convert.ToInt32(uid));
|
||||||
pdquanxianbj(user.juese);
|
pdquanxianbj(user.juese);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -41,7 +41,7 @@ public partial class Productout_Form : System.Web.UI.Page
|
||||||
pdquanxian(user.juese);
|
pdquanxian(user.juese);
|
||||||
riqi.Value = DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day;
|
riqi.Value = DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day;
|
||||||
jingshouren.Value = user.zhanghao;
|
jingshouren.Value = user.zhanghao;
|
||||||
shr.Value = user.zhanghao;
|
shr.Value = user.zhanghao;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,27 +50,27 @@ public partial class Productout_Form : System.Web.UI.Page
|
||||||
#region 修改时获取真正数据值
|
#region 修改时获取真正数据值
|
||||||
private void initdata(int did)
|
private void initdata(int did)
|
||||||
{
|
{
|
||||||
cpckmodel=cpckbll.GetModel(did);
|
cpckmodel = cpckbll.GetModel(did);
|
||||||
ckdh.Text = cpckmodel.ckbh;
|
ckdh.Text = cpckmodel.ckbh;
|
||||||
riqi.Value = cpckmodel.riqi.ToString("yyyy-MM-dd");
|
riqi.Value = cpckmodel.riqi.ToString("yyyy-MM-dd");
|
||||||
scdh.Value = cpckmodel.scdh;
|
scdh.Value = cpckmodel.scdh;
|
||||||
khming.Value = cpckmodel.khmc;
|
khming.Value = cpckmodel.khmc;
|
||||||
cpbh.Value = cpckmodel.cpbh;
|
cpbh.Value = cpckmodel.cpbh;
|
||||||
cpmc.Value= cpckmodel.cpmc;
|
cpmc.Value = cpckmodel.cpmc;
|
||||||
danjia.Value= cpckmodel.cpdj.ToString();
|
danjia.Value = cpckmodel.cpdj.ToString();
|
||||||
guige.Value= cpckmodel.guige.ToString();
|
guige.Value = cpckmodel.guige.ToString();
|
||||||
zzshuliang.Value= cpckmodel.zzsl.ToString();
|
zzshuliang.Value = cpckmodel.zzsl.ToString();
|
||||||
lingtou.Value= cpckmodel.lt.ToString();
|
lingtou.Value = cpckmodel.lt.ToString();
|
||||||
shuliang.Value= cpckmodel.sl.ToString();
|
shuliang.Value = cpckmodel.sl.ToString();
|
||||||
danwei.Value= cpckmodel.danwei ;
|
danwei.Value = cpckmodel.danwei;
|
||||||
lxr.Value= cpckmodel.lxr;
|
lxr.Value = cpckmodel.lxr;
|
||||||
zongjine.Value= cpckmodel.zje.ToString();
|
zongjine.Value = cpckmodel.zje.ToString();
|
||||||
lxdh.Value= cpckmodel.lxdh;
|
lxdh.Value = cpckmodel.lxdh;
|
||||||
jingshouren.Value= cpckmodel.jsr;
|
jingshouren.Value = cpckmodel.jsr;
|
||||||
shr.Value= cpckmodel.shr;
|
shr.Value = cpckmodel.shr;
|
||||||
dizhi.Value= cpckmodel.shdizhi;
|
dizhi.Value = cpckmodel.shdizhi;
|
||||||
txt_beizhu.Text= cpckmodel.beizhu;
|
txt_beizhu.Text = cpckmodel.beizhu;
|
||||||
zhuangtai.Value = cpckmodel.zt;
|
zhuangtai.Value = cpckmodel.zt;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ public partial class Productout_Form : System.Web.UI.Page
|
||||||
private void getmd()
|
private void getmd()
|
||||||
{
|
{
|
||||||
cpckmodel.ckbh = ckdh.Text;
|
cpckmodel.ckbh = ckdh.Text;
|
||||||
cpckmodel.riqi =Convert.ToDateTime(riqi.Value);
|
cpckmodel.riqi = Convert.ToDateTime(riqi.Value);
|
||||||
cpckmodel.scdh = scdh.Value;
|
cpckmodel.scdh = scdh.Value;
|
||||||
cpckmodel.khmc = khming.Value;
|
cpckmodel.khmc = khming.Value;
|
||||||
cpckmodel.cpbh = cpbh.Value;
|
cpckmodel.cpbh = cpbh.Value;
|
||||||
|
|
@ -126,7 +126,8 @@ public partial class Productout_Form : System.Web.UI.Page
|
||||||
{
|
{
|
||||||
Response.Redirect("../index.aspx");
|
Response.Redirect("../index.aspx");
|
||||||
}
|
}
|
||||||
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "编辑个人") == false && DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "编辑全部") == false)
|
if (DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "编辑个人") == false
|
||||||
|
&& DBHlper.GetPermission(juese, "成品入库", "nr_z_cprk", "编辑全部") == false)
|
||||||
{
|
{
|
||||||
Response.Redirect("../Common/nopower.htm");
|
Response.Redirect("../Common/nopower.htm");
|
||||||
}
|
}
|
||||||
|
|
@ -155,7 +156,7 @@ public partial class Productout_Form : System.Web.UI.Page
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cpckmodel.ckbh = DBHlper.getbh("CPCK-", "nr_z_cpck", "ckbh", 4);
|
cpckmodel.ckbh = DBHlper.getbh("CPCK-", "nr_z_cpck", "ckbh", 4);
|
||||||
// bh.Text = sgdmodel.sgdbianhao;
|
// bh.Text = sgdmodel.sgdbianhao;
|
||||||
rtx = cpckbll.Add(cpckmodel);
|
rtx = cpckbll.Add(cpckmodel);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,9 @@ public partial class Productout_browse : System.Web.UI.Page
|
||||||
|
|
||||||
protected void btn_chuku_Click(object sender, EventArgs e)
|
protected void btn_chuku_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var result = DBHlper.Execute(string.Format("select * from view_nr_z_cpkc where scdh='{0}' and xmmc='{1}' and khmc='{2}'", scdh.Text, cpbh.Text, khming.Text));
|
//var sql = string.Format("select * from view_nr_z_cpkc where scdh='{0}' and xmmc='{1}' and khmc='{2}'", scdh.Text, cpbh.Text, khming.Text);
|
||||||
|
var sql = string.Format("select * from view_nr_z_cpkc where cpbh='{0}'", cpbh.Text);
|
||||||
|
var result = DBHlper.Execute(sql);
|
||||||
DataTable dt = result.Tables[0];
|
DataTable dt = result.Tables[0];
|
||||||
if (dt.Rows.Count == 0)
|
if (dt.Rows.Count == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ public partial class Product_list : System.Web.UI.Page
|
||||||
{
|
{
|
||||||
Response.Redirect("../index.aspx");
|
Response.Redirect("../index.aspx");
|
||||||
}
|
}
|
||||||
if (!DBHlper.GetPermission(juese, "产品档案", "nr_z_cpkc", "查看全部") && !DBHlper.GetPermission(juese, "产品档案", "nr_z_cpkc", "查看个人"))
|
if (!DBHlper.GetPermission(juese, "产品档案", "view_nr_z_cpkc", "查看全部") && !DBHlper.GetPermission(juese, "产品档案", "nr_z_cpkc", "查看个人"))
|
||||||
{
|
{
|
||||||
Response.Redirect("../Common/nopower.htm");
|
Response.Redirect("../Common/nopower.htm");
|
||||||
}
|
}
|
||||||
|
|
@ -236,11 +236,11 @@ public partial class Product_list : System.Web.UI.Page
|
||||||
public string isquanxian(int uid)
|
public string isquanxian(int uid)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (DBHlper.GetPermission(uid, "产品档案", "nr_z_cpkc", "查看全部"))
|
if (DBHlper.GetPermission(uid, "产品档案", "view_nr_z_cpkc", "查看全部"))
|
||||||
{
|
{
|
||||||
return "1";
|
return "1";
|
||||||
}
|
}
|
||||||
else if (DBHlper.GetPermission(uid, "产品档案", "nr_z_cpkc", "查看个人"))
|
else if (DBHlper.GetPermission(uid, "产品档案", "view_nr_z_cpkc", "查看个人"))
|
||||||
{
|
{
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue