This commit is contained in:
Ling 2024-05-23 14:54:07 +08:00
parent ed8787f231
commit 19b2931db4
3 changed files with 167 additions and 164 deletions

View File

@ -52,12 +52,12 @@ public partial class Picking_list : System.Web.UI.Page
wherecode += "id"; wherecode += "id";
if (DBHlper.GetPermission(zhanghao.juese, "生产领料记录", "nr_z_scdck", "查看全部")) if (DBHlper.GetPermission(zhanghao.juese, "生产领料记录", "nr_z_scdck", "查看全部"))
{ {
wherecode += string.Format(" from view_nr_z_scdck where " + tiaojian + " id not in(select top ({0}*{1}) id from view_nr_z_scdck "+" where "+tiaojian+" 1=1 " + paixu + ")" + paixu, pg, pageitem); wherecode += string.Format(" from view_nr_z_scdck where " + tiaojian + " id not in(select top ({0}*{1}) id from view_nr_z_scdck " + " where " + tiaojian + " 1=1 " + paixu + ")" + paixu, pg, pageitem);
} }
else if (DBHlper.GetPermission(zhanghao.juese, "生产领料记录", "nr_z_scdck", "查看个人")) else if (DBHlper.GetPermission(zhanghao.juese, "生产领料记录", "nr_z_scdck", "查看个人"))
{ {
wherecode += string.Format(" from view_nr_z_scdck where jsr='" + zhanghao.zhanghao + "' and " + tiaojian + " id not in(select top ({0}*{1}) id from view_nr_z_scdck "+" where "+tiaojian+" 1=1 " + paixu + ")" + paixu, pg, pageitem); wherecode += string.Format(" from view_nr_z_scdck where jsr='" + zhanghao.zhanghao + "' and " + tiaojian + " id not in(select top ({0}*{1}) id from view_nr_z_scdck " + " where " + tiaojian + " 1=1 " + paixu + ")" + paixu, pg, pageitem);
} }
DataTable dt_paixu = DBHlper.Execute(wherecode).Tables[0]; DataTable dt_paixu = DBHlper.Execute(wherecode).Tables[0];
@ -213,14 +213,15 @@ public partial class Picking_list : System.Web.UI.Page
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),ckrq,111) as 'riqi' from view_nr_z_scdck where ckrq>='{0}' and ckrq<='{1}' ", yuechu, yuemo); cmd = string.Format("select CONVERT(varchar(12),ckrq,111) as 'riqi' from view_nr_z_scdck where ckrq>='{0}' and ckrq<='{1}' ", yuechu, yuemo);
} }
else { else
{
cmd = string.Format("select CONVERT(varchar(12),ckrq,111) as 'riqi' from view_nr_z_scdck where ckrq>='{0}' and ckrq<='{1}' and ckzt='{2}'", yuechu, yuemo, zt); cmd = string.Format("select CONVERT(varchar(12),ckrq,111) as 'riqi' from view_nr_z_scdck where ckrq>='{0}' and ckrq<='{1}' and ckzt='{2}'", yuechu, yuemo, zt);
} }
@ -332,7 +333,8 @@ public partial class Picking_list : System.Web.UI.Page
{ {
selectcode = "select " + colmn + " from view_nr_z_scdck where 1=1 and ckzt='" + drp_zt.Value + "'"; selectcode = "select " + colmn + " from view_nr_z_scdck where 1=1 and ckzt='" + drp_zt.Value + "'";
} }
else { else
{
selectcode = "select " + colmn + " from view_nr_z_scdck where 1=1 "; selectcode = "select " + colmn + " from view_nr_z_scdck where 1=1 ";
} }
if (tj != "") if (tj != "")

View File

@ -114,7 +114,8 @@ public partial class Sample_browse : System.Web.UI.Page
{ {
bt_hdsh.Visible = true; bt_hdsh.Visible = true;
} if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "生成产品")) }
if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "生成产品"))
{ {
bt_sccpda.Visible = true; bt_sccpda.Visible = true;
} }
@ -127,7 +128,7 @@ public partial class Sample_browse : System.Web.UI.Page
bt_shtg.Visible = true; bt_shtg.Visible = true;
bt_shbg.Visible = true; bt_shbg.Visible = true;
} }
if(zhuangtai.Text=="通过") if (zhuangtai.Text == "通过")
{ {
bt_shtg.Enabled = false; bt_shtg.Enabled = false;
bt_shtg.BackColor = System.Drawing.Color.Gray; bt_shtg.BackColor = System.Drawing.Color.Gray;
@ -142,7 +143,7 @@ public partial class Sample_browse : System.Web.UI.Page
bt_shbg.BackColor = System.Drawing.Color.Gray; bt_shbg.BackColor = System.Drawing.Color.Gray;
} }
if(zhuangtai.Text!="通过") if (zhuangtai.Text != "通过")
{ {
bt_sccpda.Enabled = false; bt_sccpda.Enabled = false;
bt_sccpda.BackColor = System.Drawing.Color.Gray; bt_sccpda.BackColor = System.Drawing.Color.Gray;
@ -159,13 +160,13 @@ public partial class Sample_browse : System.Web.UI.Page
//加载前段工价 //加载前段工价
string qdgjstring = "<table id='qdgjtb' class='bule'>"; string qdgjstring = "<table id='qdgjtb' class='bule'>";
string getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='前段工价'"; string getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='前段工价'";
DataSet ds=DBHlper.Execute(getgjsql); DataSet ds = DBHlper.Execute(getgjsql);
//判断拼接列值,根据值更改前台样式 //判断拼接列值,根据值更改前台样式
int lies = 0; int lies = 0;
if (ds != null && ds.Tables[0].Rows.Count > 0) if (ds != null && ds.Tables[0].Rows.Count > 0)
{ {
foreach(DataRow r in ds.Tables[0].Rows) foreach (DataRow r in ds.Tables[0].Rows)
{ {
if (lies == 0) if (lies == 0)
{ {
@ -181,15 +182,15 @@ public partial class Sample_browse : System.Web.UI.Page
} }
if (7 - lies > 0 && lies > 0) if (7 - lies > 0 && lies > 0)
{ {
for (int x = 0; x < 7 - lies;x++ ) for (int x = 0; x < 7 - lies; x++)
{ {
qdgjstring += "<td ></td> "; qdgjstring += "<td ></td> ";
} }
qdgjstring +="</tr>"; qdgjstring += "</tr>";
} }
} }
qdgjxx.InnerHtml = qdgjstring+"</table>"; qdgjxx.InnerHtml = qdgjstring + "</table>";
@ -286,7 +287,7 @@ public partial class Sample_browse : System.Web.UI.Page
} }
qdgjstring += "<td><span>" + r["xmmc"].ToString() + "</span></td> <td><span>" + r["wlmc"].ToString() + "</span></td><td><span>" + Convert.ToDouble(r["wlyl"]).ToString() + "</span></td>"; qdgjstring += "<td><span>" + r["xmmc"].ToString() + "</span></td> <td><span>" + r["wlmc"].ToString() + "</span></td><td><span>" + Convert.ToDouble(r["wlyl"]).ToString() + "</span></td>";
lies = lies + 1; lies = lies + 1;
if (lies ==3) if (lies == 3)
{ {
lies = 0; lies = 0;
qdgjstring += "</tr>"; qdgjstring += "</tr>";
@ -329,7 +330,7 @@ public partial class Sample_browse : System.Web.UI.Page
} }
if (3 - lies > 0 && lies > 0) if (3 - lies > 0 && lies > 0)
{ {
for (int x = 0; x <3- lies; x++) for (int x = 0; x < 3 - lies; x++)
{ {
qdgjstring += "<td class='head3'></td><td class='content'></td><td class='content'></td>"; qdgjstring += "<td class='head3'></td><td class='content'></td><td class='content'></td>";
} }
@ -380,7 +381,7 @@ public partial class Sample_browse : System.Web.UI.Page
{ {
//加载前段工价 //加载前段工价
string qdgjstring = "<table id='ypxgfytd' class='bule'>"; string qdgjstring = "<table id='ypxgfytd' class='bule'>";
string getgjsql = "select * from nr_z_ypdj_xgfy where ypdid='"+id.Value+"'"; string getgjsql = "select * from nr_z_ypdj_xgfy where ypdid='" + id.Value + "'";
DataSet ds = DBHlper.Execute(getgjsql); DataSet ds = DBHlper.Execute(getgjsql);
//判断拼接列值,根据值更改前台样式 //判断拼接列值,根据值更改前台样式
int lies = 0; int lies = 0;
@ -425,7 +426,7 @@ public partial class Sample_browse : System.Web.UI.Page
{ {
int sjint = 0; int sjint = 0;
int hcount = 1; int hcount = 1;
foreach(DataRow r in ds.Tables[0].Rows) foreach (DataRow r in ds.Tables[0].Rows)
{ {
if (sjint == 0) if (sjint == 0)
{ {
@ -439,9 +440,9 @@ public partial class Sample_browse : System.Web.UI.Page
} }
hcount = hcount + 1; hcount = hcount + 1;
} }
if(3-sjint>0) if (3 - sjint > 0)
{ {
for (int hz = 0; hz < 3 - sjint;hz++) for (int hz = 0; hz < 3 - sjint; hz++)
{ {
cltable += " <td > </td><td > </td><td > </td>"; cltable += " <td > </td><td > </td><td > </td>";
} }
@ -520,10 +521,10 @@ public partial class Sample_browse : System.Web.UI.Page
public int savegx(string[] gx, string djid, string xmjd) public int savegx(string[] gx, string djid, string xmjd)
{ {
int fhz = 0; int fhz = 0;
DBHlper.excutecmd("delete from nr_z_ypdj_cpxgxm where xmjd='" + xmjd+"'"); DBHlper.excutecmd("delete from nr_z_ypdj_cpxgxm where xmjd='" + xmjd + "'");
foreach (string i in gx) foreach (string i in gx)
{ {
fhz=DBHlper.excutecmd("insert into nr_z_ypdj_cpxgxm(kfid,xmmc,xmjd) values(" + djid + ",'" + i + "','" + xmjd + "')"); fhz = DBHlper.excutecmd("insert into nr_z_ypdj_cpxgxm(kfid,xmmc,xmjd) values(" + djid + ",'" + i + "','" + xmjd + "')");
} }
return fhz; return fhz;
} }
@ -565,7 +566,7 @@ public partial class Sample_browse : System.Web.UI.Page
if (ypdjbll.Delete(Convert.ToInt32(id.Value))) if (ypdjbll.Delete(Convert.ToInt32(id.Value)))
{ {
DBHlper.excutecmd(" delete nr_z_ypdj_gj where ypdid='"+id.Value+"'"); DBHlper.excutecmd(" delete nr_z_ypdj_gj where ypdid='" + id.Value + "'");
DBHlper.excutecmd(" delete nr_z_ypdj_scyl where ypdid='" + id.Value + "'"); DBHlper.excutecmd(" delete nr_z_ypdj_scyl where ypdid='" + id.Value + "'");
DBHlper.excutecmd(" delete nr_z_ypdj_xgfy where ypdid='" + id.Value + "'"); DBHlper.excutecmd(" delete nr_z_ypdj_xgfy where ypdid='" + id.Value + "'");
DBHlper.excutecmd(" delete nr_z_ypdj_xmxx where ypdid='" + id.Value + "'"); DBHlper.excutecmd(" delete nr_z_ypdj_xmxx where ypdid='" + id.Value + "'");
@ -582,9 +583,9 @@ public partial class Sample_browse : System.Web.UI.Page
{ {
getmd(); getmd();
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"];
string sqldj = "update nr_z_ypdj set qdqz='"+zh.zhanghao+"' where id='"+id.Value+"'"; string sqldj = "update nr_z_ypdj set qdqz='" + zh.zhanghao + "' where id='" + id.Value + "'";
int fzhi = DBHlper.excutecmd(sqldj); int fzhi = DBHlper.excutecmd(sqldj);
if(fzhi>0) if (fzhi > 0)
{ {
rizhi.jilu = zh.zhanghao + "进行了前段签字,开发号为:" + kfh.Text.Trim(); rizhi.jilu = zh.zhanghao + "进行了前段签字,开发号为:" + kfh.Text.Trim();
rizhi.yonghuming = zh.zhanghao; rizhi.yonghuming = zh.zhanghao;
@ -652,26 +653,26 @@ public partial class Sample_browse : System.Web.UI.Page
{ {
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]); Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
string cpbh = DBHlper.getbh("CP-", "nr_z_cpkc", "cpbh", 4); string cpbh = DBHlper.getbh("CP-", "nr_z_cpkc", "cpbh", 4);
string ypdcpjsql = "insert into nr_z_cpkc(cpbh,cpmc,riqi,gg,zhongliang,tiji,dj,jsr,tp)select '"+cpbh+"',cpmc,'" + DateTime.Now.ToString("yyyy-MM-dd") + "',ypcc,zhongl,rongl,'0','" + user.zhanghao + "',tupian from nr_z_ypdj where id='" + id.Value + "';SELECT id from nr_z_cpkc WHERE (id = @@IDENTITY)"; string ypdcpjsql = "insert into nr_z_cpkc(cpbh,cpmc,riqi,gg,zhongliang,tiji,dj,jsr,tp)select '" + cpbh + "',cpmc,'" + DateTime.Now.ToString("yyyy-MM-dd") + "',ypcc,zhongl,rongl,'0','" + user.zhanghao + "',tupian from nr_z_ypdj where id='" + id.Value + "';SELECT id from nr_z_cpkc WHERE (id = @@IDENTITY)";
int getcpz=DBHlper.ExecuteReid(ypdcpjsql); int getcpz = DBHlper.ExecuteReid(ypdcpjsql);
if (getcpz > 0) if (getcpz > 0)
{ {
string getxmsql = "select * from nr_z_ypdj_cpxgxm "; string getxmsql = "select * from nr_z_ypdj_cpxgxm ";
DataSet ds= DBHlper.Execute(getxmsql); DataSet ds = DBHlper.Execute(getxmsql);
if (ds != null && ds.Tables[0].Rows.Count > 0) if (ds != null && ds.Tables[0].Rows.Count > 0)
{ {
foreach( DataRow r in ds.Tables[0].Rows) foreach (DataRow r in ds.Tables[0].Rows)
{ {
int xmz = DBHlper.excutecmd("insert into nr_z_cpkc_wlxq(cpid,xmmc,wlbh,xqyl) select '" + getcpz + "',xmmc,wlbh,wlyl from nr_z_ypdj_xmxx where xmmc='" + r["xmmc"] + "' and ypdid='" + id.Value + "'"); int xmz = DBHlper.excutecmd("insert into nr_z_cpkc_wlxq(cpid,xmmc,wlbh,xqyl) select '" + getcpz + "',xmmc,wlbh,wlyl from nr_z_ypdj_xmxx where xmmc='" + r["xmmc"] + "' and ypdid='" + id.Value + "'");
} }
} }
int scfhz= DBHlper.excutecmd("insert into nr_z_cpkc_scyl(cpid,scwlbh,scyl,beizhu) select '"+getcpz+"',scwlbh,scyl,beizhu from nr_z_ypdj_scyl where ypdid='" + id.Value + "'"); int scfhz = DBHlper.excutecmd("insert into nr_z_cpkc_scyl(cpid,scwlbh,scyl,beizhu) select '" + getcpz + "',scwlbh,scyl,beizhu from nr_z_ypdj_scyl where ypdid='" + id.Value + "'");
int scmjz = DBHlper.excutecmd("insert into nr_z_mjda (mjdm,mjmc,riqi,beizhu) select '" + DBHlper.getbh("MJ-", "nr_z_mjda", "mjdm", 4) + "',cpmc,'"+DateTime.Now.ToString("yyyy-MM-dd")+"','' from nr_z_ypdj where id='" + id.Value + "'"); int scmjz = DBHlper.excutecmd("insert into nr_z_mjda (mjdm,mjmc,riqi,beizhu) select '" + DBHlper.getbh("MJ-", "nr_z_mjda", "mjdm", 4) + "',cpmc,'" + DateTime.Now.ToString("yyyy-MM-dd") + "','' from nr_z_ypdj where id='" + id.Value + "'");
int ypgjz = DBHlper.excutecmd("insert into dbo.nr_z_cpkc_gj(cpid,gjmc,gjjg) select '" + getcpz+ "',gjmc,gjjg from nr_z_ypdj_gj where ypdid='" + id.Value + "'"); int ypgjz = DBHlper.excutecmd("insert into dbo.nr_z_cpkc_gj(cpid,gjmc,gjjg) select '" + getcpz + "',gjmc,gjjg from nr_z_ypdj_gj where ypdid='" + id.Value + "'");
Response.Redirect("Product_browse.aspx?uid=" + getcpz); Response.Redirect("Product_browse.aspx?uid=" + getcpz);
} }

View File

@ -254,7 +254,7 @@
</div> </div>
<input id="btn_khclose" style="display:none" type=button onclick="$('#dialog-djjv').dialog('close');"/> <input id="btn_khclose" style="display:none" type=button onclick="$('#dialog-djjv').dialog('close');"/>
<span style=" display:none"><asp:button id="sctqkc" runat="server" CssClass="button bluez small" Visible=false OnClientClick="return qrtqcz()" onclick="sctqkc_Click" ></asp:button></span> <span style=" display:none"><asp:button id="sctqkc" runat="server" CssClass="button bluez small" Visible=false OnClientClick="return qrtqcz()" onclick="sctqkc_Click" ></asp:button></span>
<span style=" display:none"> <asp:button id="scdjbt" runat="server" CssClass="button" Width="100" Visible=false OnClientClick="return qrdjft()" onclick="scdjbt_Click" ></asp:button> </span> <span > <asp:button id="scdjbt" runat="server" CssClass="button" Width="100" Visible=true OnClientClick="return qrdjft()" onclick="scdjbt_Click" ></asp:button> </span>
<span style=" display:none"><asp:button id="scxfbt" runat="server" CssClass="button bluez small" Visible=false OnClientClick="return qrxfbt()" onclick="scxfbt_Click" ></asp:button></span> <span style=" display:none"><asp:button id="scxfbt" runat="server" CssClass="button bluez small" Visible=false OnClientClick="return qrxfbt()" onclick="scxfbt_Click" ></asp:button></span>
<asp:HiddenField ID="scdjhd" runat="server" Value="" /> <asp:HiddenField ID="scdjhd" runat="server" Value="" />
<asp:HiddenField ID="qxhjzhd" runat="server" Value="" /> <asp:HiddenField ID="qxhjzhd" runat="server" Value="" />