Fix 生产进度双击报错
This commit is contained in:
parent
dff441d0a0
commit
ed8787f231
|
@ -29,7 +29,7 @@ public partial class Productout_browse : System.Web.UI.Page
|
||||||
id.Value = Request.QueryString["uid"].ToString();
|
id.Value = Request.QueryString["uid"].ToString();
|
||||||
}
|
}
|
||||||
initdata(Convert.ToInt32(id.Value));
|
initdata(Convert.ToInt32(id.Value));
|
||||||
pdquanxian(user.juese);
|
pdquanxian(user.juese);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,12 +163,13 @@ public partial class Productout_browse : System.Web.UI.Page
|
||||||
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];
|
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 sl = Convert.ToDouble(dt.Rows[0]["sl"]);
|
||||||
double nowsl = Convert.ToDouble(shuliang.Text);
|
double nowsl = Convert.ToDouble(shuliang.Text);
|
||||||
int gxcount= DBHlper.excutecmd("update nr_z_cpkc set sl=" + (sl + nowsl) + " where id=" + dt.Rows[0]["id"]);
|
int gxcount = DBHlper.excutecmd("update nr_z_cpkc set sl=" + (sl + nowsl) + " where id=" + dt.Rows[0]["id"]);
|
||||||
if (gxcount > 0)
|
if (gxcount > 0)
|
||||||
{
|
{
|
||||||
DBHlper.excutecmd("update nr_z_cpck set zt='待确认' where id=" + id.Value);
|
DBHlper.excutecmd("update nr_z_cpck set zt='待确认' where id=" + id.Value);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Response.Write("<script>alert('出库冲红失败')</script>");
|
Response.Write("<script>alert('出库冲红失败')</script>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,16 +179,17 @@ public partial class Productout_browse : System.Web.UI.Page
|
||||||
//将session转换对象取值
|
//将session转换对象取值
|
||||||
Maticsoft.Model.nr_z_yhzh zh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
Maticsoft.Model.nr_z_yhzh zh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
//拼接字符串插入日志
|
//拼接字符串插入日志
|
||||||
rizhi.jilu = zh.zhanghao + "执行了出库冲红,出库单号为:" +ckdh.Text.Trim();
|
rizhi.jilu = zh.zhanghao + "执行了出库冲红,出库单号为:" + ckdh.Text.Trim();
|
||||||
rizhi.yonghuming = zh.zhanghao.ToString();
|
rizhi.yonghuming = zh.zhanghao.ToString();
|
||||||
rizhibll.Add(rizhi);
|
rizhibll.Add(rizhi);
|
||||||
Response.Redirect("Productout_browse.aspx?uid=" + id.Value);
|
Response.Redirect("Productout_browse.aspx?uid=" + id.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void btn_chuku_Click(object sender, EventArgs e)
|
protected void btn_chuku_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DataTable dt = 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)).Tables[0];
|
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));
|
||||||
|
DataTable dt = result.Tables[0];
|
||||||
if (dt.Rows.Count == 0)
|
if (dt.Rows.Count == 0)
|
||||||
{
|
{
|
||||||
Response.Write("<script>alert('库存不足')</script>");
|
Response.Write("<script>alert('库存不足')</script>");
|
||||||
|
@ -219,6 +221,6 @@ public partial class Productout_browse : System.Web.UI.Page
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public partial class Schedule_list : CommonPage
|
||||||
{
|
{
|
||||||
Response.Redirect("../index.aspx");
|
Response.Redirect("../index.aspx");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Request.QueryString["sczt"] != null && Request.QueryString["sczt"] != "")
|
if (Request.QueryString["sczt"] != null && Request.QueryString["sczt"] != "")
|
||||||
{
|
{
|
||||||
drp_zt.Text = Request.QueryString["sczt"].ToString();
|
drp_zt.Text = Request.QueryString["sczt"].ToString();
|
||||||
|
@ -61,7 +61,7 @@ public partial class Schedule_list : CommonPage
|
||||||
wherecode += "id";
|
wherecode += "id";
|
||||||
if (DBHlper.GetPermission(zhanghao.juese, "生产进度", "view_nr_z_scjd", "查看全部"))
|
if (DBHlper.GetPermission(zhanghao.juese, "生产进度", "view_nr_z_scjd", "查看全部"))
|
||||||
{
|
{
|
||||||
wherecode += string.Format(" from view_nr_z_scjd where " + tiaojian + " id not in(select top ({0}*{1}) id from view_nr_z_scjd "+" where "+tiaojian+" 1=1 " + paixu + ")" + paixu, pg, pageitem);
|
wherecode += string.Format(" from view_nr_z_scjd where " + tiaojian + " id not in(select top ({0}*{1}) id from view_nr_z_scjd " + " where " + tiaojian + " 1=1 " + paixu + ")" + paixu, pg, pageitem);
|
||||||
|
|
||||||
}
|
}
|
||||||
DataTable dt_paixu = DBHlper.Execute(wherecode).Tables[0];
|
DataTable dt_paixu = DBHlper.Execute(wherecode).Tables[0];
|
||||||
|
@ -72,7 +72,7 @@ public partial class Schedule_list : CommonPage
|
||||||
|
|
||||||
for (int i = 0; i < dt_paixu.Rows.Count; i++)
|
for (int i = 0; i < dt_paixu.Rows.Count; i++)
|
||||||
{
|
{
|
||||||
htmlcode += "<tr tag='" + dt_paixu.Rows[i]["id"] + "' >";
|
htmlcode += "<tr tagData='" + dt_paixu.Rows[i]["id"] + "' >";
|
||||||
htmlcode += " <td style='width:20px'><input type='checkbox' class='xz'/></td>";
|
htmlcode += " <td style='width:20px'><input type='checkbox' class='xz'/></td>";
|
||||||
for (int j = 0; j < dt_paixu.Columns.Count - 1; j++)
|
for (int j = 0; j < dt_paixu.Columns.Count - 1; j++)
|
||||||
{
|
{
|
||||||
|
@ -97,15 +97,15 @@ public partial class Schedule_list : CommonPage
|
||||||
int dxfzsl = Convert.ToInt32(djzsl) - Convert.ToInt32(yxfzsl);
|
int dxfzsl = Convert.ToInt32(djzsl) - Convert.ToInt32(yxfzsl);
|
||||||
//滞留总数量
|
//滞留总数量
|
||||||
int zlzsl = ddjzsl + dxfzsl;
|
int zlzsl = ddjzsl + dxfzsl;
|
||||||
if ( Convert.ToInt32(ybfzsl)>10)
|
if (Convert.ToInt32(ybfzsl) > 10)
|
||||||
{
|
{
|
||||||
htmlcode += "<td class='progress-bar ret'><span><ul style='margin-top:3px; margin-bottom:3px; color:#ffffff'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
htmlcode += "<td class='progress-bar ret'><span><ul style='margin-top:3px; margin-bottom:3px; color:#ffffff'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
||||||
}
|
}
|
||||||
else if (zlzsl > 0)
|
else if (zlzsl > 0)
|
||||||
{
|
{
|
||||||
htmlcode += "<td class='progress-bar blue'><span><ul style='margin-top:3px; margin-bottom:3px; color:#ffffff'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
htmlcode += "<td class='progress-bar blue'><span><ul style='margin-top:3px; margin-bottom:3px; color:#ffffff'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
||||||
}
|
}
|
||||||
else if (Convert.ToInt32(xcsl)> 0 && zlzsl<=0)
|
else if (Convert.ToInt32(xcsl) > 0 && zlzsl <= 0)
|
||||||
{
|
{
|
||||||
htmlcode += "<td class='progress-bar green'><span><ul style='margin-top:3px; margin-bottom:3px; color:#ffffff'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
htmlcode += "<td class='progress-bar green'><span><ul style='margin-top:3px; margin-bottom:3px; color:#ffffff'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public partial class Schedule_list : CommonPage
|
||||||
htmlcode += "<td class='progress-bar gray'><span><ul style='margin-top:3px; margin-bottom:3px;'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
htmlcode += "<td class='progress-bar gray'><span><ul style='margin-top:3px; margin-bottom:3px;'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
||||||
|
|
||||||
}
|
}
|
||||||
/*-----正常工序时候获取登记信息------*/
|
/*-----正常工序时候获取登记信息------*/
|
||||||
foreach (DataRow dr in gjds.Tables[0].Rows)
|
foreach (DataRow dr in gjds.Tables[0].Rows)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ public partial class Schedule_list : CommonPage
|
||||||
dxfzsl = Convert.ToInt32(djzsl) - Convert.ToInt32(yxfzsl);
|
dxfzsl = Convert.ToInt32(djzsl) - Convert.ToInt32(yxfzsl);
|
||||||
//滞留总数量
|
//滞留总数量
|
||||||
zlzsl = ddjzsl + dxfzsl;
|
zlzsl = ddjzsl + dxfzsl;
|
||||||
if (Convert.ToInt32(ybfzsl) > 10)
|
if (Convert.ToInt32(ybfzsl) > 10)
|
||||||
{
|
{
|
||||||
htmlcode += "<td class='progress-bar ret'><span><ul style='margin-top:3px; margin-bottom:3px; color:#ffffff'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
htmlcode += "<td class='progress-bar ret'><span><ul style='margin-top:3px; margin-bottom:3px; color:#ffffff'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
||||||
}
|
}
|
||||||
|
@ -149,9 +149,9 @@ public partial class Schedule_list : CommonPage
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//htmlcode += "<td><span><ul style='margin-top:3px; margin-bottom:3px;'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
//htmlcode += "<td><span><ul style='margin-top:3px; margin-bottom:3px;'><li>需产:" + xcsl + ";</li><li>滞留:" + zlzsl + ";</li><li>下发:" + yxfzsl + ";</li><li>报废:" + ybfzsl + ";</li><ul></span></td>";
|
||||||
|
|
||||||
htmlcode += "<td><span style='color:#e0e0e0;'>等待交接...</span></td>";
|
htmlcode += "<td><span style='color:#e0e0e0;'>等待交接...</span></td>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,22 +281,23 @@ public partial class Schedule_list : CommonPage
|
||||||
|
|
||||||
#region 日期查询
|
#region 日期查询
|
||||||
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
||||||
public string nowdaycount(string zt,int selmonth)
|
public string nowdaycount(string zt, int selmonth)
|
||||||
{
|
{
|
||||||
DateTime nowdt = DateTime.Now;
|
DateTime nowdt = DateTime.Now;
|
||||||
int days = DateTime.DaysInMonth(nowdt.Year, selmonth);
|
int days = DateTime.DaysInMonth(nowdt.Year, selmonth);
|
||||||
string yuechu = nowdt.Year + "-" + selmonth + "-" + "1";
|
string yuechu = nowdt.Year + "-" + selmonth + "-" + "1";
|
||||||
string yuemo = Convert.ToDateTime(nowdt.Year + "-" + selmonth + "-" +days).AddDays(1).ToString("yyyy-MM-dd");
|
string yuemo = Convert.ToDateTime(nowdt.Year + "-" + selmonth + "-" + days).AddDays(1).ToString("yyyy-MM-dd");
|
||||||
DateTime yc = Convert.ToDateTime(yuechu);
|
DateTime yc = Convert.ToDateTime(yuechu);
|
||||||
string cmd = "";
|
string cmd = "";
|
||||||
if (zt == "")
|
if (zt == "")
|
||||||
{
|
{
|
||||||
cmd = string.Format("select CONVERT(varchar(12),riqi,111) as 'riqi' from view_nr_z_scjd where riqi>='{0}' and riqi<='{1}' ", yuechu, yuemo);
|
cmd = string.Format("select CONVERT(varchar(12),riqi,111) as 'riqi' from view_nr_z_scjd where riqi>='{0}' and riqi<='{1}' ", yuechu, yuemo);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
cmd = string.Format("select CONVERT(varchar(12),riqi,111) as 'riqi' from view_nr_z_scjd where riqi>='{0}' and riqi<='{1}' and zt='{2}' ", yuechu, yuemo, zt);
|
cmd = string.Format("select CONVERT(varchar(12),riqi,111) as 'riqi' from view_nr_z_scjd where riqi>='{0}' and riqi<='{1}' and zt='{2}' ", yuechu, yuemo, zt);
|
||||||
}
|
}
|
||||||
|
|
||||||
Maticsoft.Model.nr_z_yhzh yhzh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
Maticsoft.Model.nr_z_yhzh yhzh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
|
||||||
DataTable dt = DBHlper.Execute(cmd).Tables[0];
|
DataTable dt = DBHlper.Execute(cmd).Tables[0];
|
||||||
var biao = "<table class='lbrilitb' id='tbl_yueli'>"
|
var biao = "<table class='lbrilitb' id='tbl_yueli'>"
|
||||||
|
@ -346,7 +347,7 @@ public partial class Schedule_list : CommonPage
|
||||||
if (!DBHlper.GetPermission(juese, "生产进度", "view_nr_z_scjd", "查看全部") && !DBHlper.GetPermission(juese, "生产进度", "view_nr_z_scjd", "查看个人"))
|
if (!DBHlper.GetPermission(juese, "生产进度", "view_nr_z_scjd", "查看全部") && !DBHlper.GetPermission(juese, "生产进度", "view_nr_z_scjd", "查看个人"))
|
||||||
{
|
{
|
||||||
Response.Redirect("../Common/nopower.htm");
|
Response.Redirect("../Common/nopower.htm");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,10 +389,11 @@ public partial class Schedule_list : CommonPage
|
||||||
{
|
{
|
||||||
selectcode = "select " + colmn + " from view_nr_z_scjd where zt='" + drp_zt.Text + "'";
|
selectcode = "select " + colmn + " from view_nr_z_scjd where zt='" + drp_zt.Text + "'";
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
selectcode = "select " + colmn + " from view_nr_z_scjd where 1=1 ";
|
selectcode = "select " + colmn + " from view_nr_z_scjd where 1=1 ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tj != "")
|
if (tj != "")
|
||||||
{
|
{
|
||||||
selectcode += tj.Replace("where", "and");
|
selectcode += tj.Replace("where", "and");
|
||||||
|
@ -400,8 +402,8 @@ public partial class Schedule_list : CommonPage
|
||||||
{
|
{
|
||||||
selectcode += " and id in(" + selectid.TrimEnd(',') + ")";
|
selectcode += " and id in(" + selectid.TrimEnd(',') + ")";
|
||||||
}
|
}
|
||||||
DataTable dt = DBHlper.Execute(selectcode+" order by id desc").Tables[0];
|
DataTable dt = DBHlper.Execute(selectcode + " order by id desc").Tables[0];
|
||||||
DBHlper.ExportByWeb(dt, "生产单"+DateTime.Now, sList);
|
DBHlper.ExportByWeb(dt, "生产单" + DateTime.Now, sList);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue