Fix 生产进度双击报错
This commit is contained in:
parent
dff441d0a0
commit
ed8787f231
|
@ -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];
|
||||
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"]);
|
||||
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_cpck set zt='待确认' where id=" + id.Value);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
Response.Write("<script>alert('出库冲红失败')</script>");
|
||||
}
|
||||
|
||||
|
@ -178,16 +179,17 @@ public partial class Productout_browse : System.Web.UI.Page
|
|||
//将session转换对象取值
|
||||
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();
|
||||
rizhibll.Add(rizhi);
|
||||
Response.Redirect("Productout_browse.aspx?uid=" + id.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
Response.Write("<script>alert('库存不足')</script>");
|
||||
|
|
|
@ -61,7 +61,7 @@ public partial class Schedule_list : CommonPage
|
|||
wherecode += "id";
|
||||
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];
|
||||
|
@ -72,7 +72,7 @@ public partial class Schedule_list : CommonPage
|
|||
|
||||
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>";
|
||||
for (int j = 0; j < dt_paixu.Columns.Count - 1; j++)
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ public partial class Schedule_list : CommonPage
|
|||
int dxfzsl = Convert.ToInt32(djzsl) - Convert.ToInt32(yxfzsl);
|
||||
//滞留总数量
|
||||
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>";
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public partial class Schedule_list : CommonPage
|
|||
{
|
||||
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>";
|
||||
|
||||
|
@ -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>";
|
||||
|
||||
}
|
||||
/*-----正常工序时候获取登记信息------*/
|
||||
/*-----正常工序时候获取登记信息------*/
|
||||
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);
|
||||
//滞留总数量
|
||||
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>";
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ public partial class Schedule_list : CommonPage
|
|||
}
|
||||
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>";
|
||||
}
|
||||
|
@ -281,19 +281,20 @@ public partial class Schedule_list : CommonPage
|
|||
|
||||
#region 日期查询
|
||||
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
|
||||
public string nowdaycount(string zt,int selmonth)
|
||||
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");
|
||||
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 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);
|
||||
}
|
||||
|
||||
|
@ -388,7 +389,8 @@ public partial class Schedule_list : CommonPage
|
|||
{
|
||||
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 ";
|
||||
}
|
||||
|
||||
|
@ -400,8 +402,8 @@ public partial class Schedule_list : CommonPage
|
|||
{
|
||||
selectcode += " and id in(" + selectid.TrimEnd(',') + ")";
|
||||
}
|
||||
DataTable dt = DBHlper.Execute(selectcode+" order by id desc").Tables[0];
|
||||
DBHlper.ExportByWeb(dt, "生产单"+DateTime.Now, sList);
|
||||
DataTable dt = DBHlper.Execute(selectcode + " order by id desc").Tables[0];
|
||||
DBHlper.ExportByWeb(dt, "生产单" + DateTime.Now, sList);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
Loading…
Reference in New Issue