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";
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", "查看个人"))
{
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];
@ -213,17 +213,18 @@ public partial class Picking_list : System.Web.UI.Page
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),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);
}
Maticsoft.Model.nr_z_yhzh yhzh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
if (!DBHlper.GetPermission(yhzh.juese, "生产领料记录", "nr_z_scdck", "查看全部"))
{
@ -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 + "'";
}
else {
else
{
selectcode = "select " + colmn + " from view_nr_z_scdck where 1=1 ";
}
if (tj != "")

View File

@ -11,9 +11,9 @@ using Ajax;
public partial class Sample_browse : System.Web.UI.Page
{
//创建一个操作记录bll
Maticsoft.BLL.nr_sys_rizhi rizhibll = new Maticsoft.BLL.nr_sys_rizhi();
Maticsoft.BLL.nr_sys_rizhi rizhibll = new Maticsoft.BLL.nr_sys_rizhi();
//创建一个共同的申购单bll
Maticsoft.BLL.nr_z_ypdj ypdjbll = new Maticsoft.BLL.nr_z_ypdj();
Maticsoft.BLL.nr_z_ypdj ypdjbll = new Maticsoft.BLL.nr_z_ypdj();
//创建一个操作记录模板
Maticsoft.Model.nr_sys_rizhi rizhi = new Maticsoft.Model.nr_sys_rizhi();
//创建一个共用的编码bll层
@ -30,19 +30,19 @@ public partial class Sample_browse : System.Web.UI.Page
Response.Redirect("../index.aspx");
}
//获取角色权限
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"]);
if (Request.QueryString["uid"] != null && Request.QueryString["uid"].ToString().Length > 0)
{
string uid = Request.QueryString["uid"].ToString();
id.Value = uid;
initdata(Convert.ToInt32(uid));
pdquanxian(user.juese);
}
getqdgj();
getxmxx();
getxgfyxx();
getscyl();
getcpxmxx();
pdquanxian(user.juese);
}
getqdgj();
getxmxx();
getxgfyxx();
getscyl();
getcpxmxx();
}
}
@ -85,15 +85,15 @@ public partial class Sample_browse : System.Web.UI.Page
{
Response.Redirect("../Common/nopower.htm");
}
if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "编辑全部"))
{
bt_bj.Visible = true;
}
}
if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "删除全部"))
{
shanchu.Visible = true;
shanchu.Visible = true;
}
if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "前段签字"))
@ -114,9 +114,10 @@ public partial class Sample_browse : System.Web.UI.Page
{
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;
}
if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "打印"))
{
@ -127,142 +128,142 @@ public partial class Sample_browse : System.Web.UI.Page
bt_shtg.Visible = true;
bt_shbg.Visible = true;
}
if(zhuangtai.Text=="通过")
if (zhuangtai.Text == "通过")
{
bt_shtg.Enabled = false;
bt_shtg.BackColor = System.Drawing.Color.Gray;
bt_shtg.BackColor = System.Drawing.Color.Gray;
bt_bj.Enabled = false;
bt_bj.BackColor = System.Drawing.Color.Gray;
bt_bj.BackColor = System.Drawing.Color.Gray;
shanchu.Enabled = false;
shanchu.BackColor = System.Drawing.Color.Gray;
}
}
if (zhuangtai.Text == "不过")
{
bt_shbg.Enabled = false;
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;
}
}
#endregion
#region
private void getqdgj()
{
//加载前段工价
string qdgjstring = "<table id='qdgjtb' class='bule'>";
string getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='前段工价'";
DataSet ds=DBHlper.Execute(getgjsql);
//判断拼接列值,根据值更改前台样式
string qdgjstring = "<table id='qdgjtb' class='bule'>";
string getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='前段工价'";
DataSet ds = DBHlper.Execute(getgjsql);
//判断拼接列值,根据值更改前台样式
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)
{
if (lies == 0)
{
qdgjstring += "<tr>";
}
qdgjstring += "<td ><span>" + r["gjmc"].ToString() + "</span> <span>" + Convert.ToDouble(r["gjjg"]).ToString() + " </span></td>";
lies = lies + 1;
if (lies == 7)
{
lies = 0;
qdgjstring += "</tr>";
}
}
if (7 - lies > 0 && lies > 0)
{
for (int x = 0; x < 7 - lies;x++ )
{
qdgjstring += "<td ></td> ";
}
qdgjstring +="</tr>";
}
foreach (DataRow r in ds.Tables[0].Rows)
{
if (lies == 0)
{
qdgjstring += "<tr>";
}
qdgjstring += "<td ><span>" + r["gjmc"].ToString() + "</span> <span>" + Convert.ToDouble(r["gjjg"]).ToString() + " </span></td>";
lies = lies + 1;
if (lies == 7)
{
lies = 0;
qdgjstring += "</tr>";
}
}
if (7 - lies > 0 && lies > 0)
{
for (int x = 0; x < 7 - lies; x++)
{
qdgjstring += "<td ></td> ";
}
qdgjstring += "</tr>";
}
}
qdgjxx.InnerHtml = qdgjstring+"</table>";
}
qdgjxx.InnerHtml = qdgjstring + "</table>";
//中段工价
//中段工价
qdgjstring = "<table id='zdgjtb' class='bule'>";
getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='中段工价'";
ds = DBHlper.Execute(getgjsql);
//判断拼接列值,根据值更改前台样式
lies = 0;
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
//判断拼接列值,根据值更改前台样式
lies = 0;
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
foreach (DataRow r in ds.Tables[0].Rows)
{
if (lies == 0)
{
qdgjstring += "<tr>";
}
qdgjstring += "<td ><span>" + r["gjmc"].ToString() + "</span> <span>" + Convert.ToDouble(r["gjjg"]).ToString() + "</span></td>";
lies = lies + 1;
if (lies == 7)
{
lies = 0;
qdgjstring += "</tr>";
}
}
if (7 - lies > 0 && lies > 0)
{
for (int x = 0; x < 7 - lies; x++)
{
qdgjstring += "<td ></td> ";
}
qdgjstring += "</tr>";
}
foreach (DataRow r in ds.Tables[0].Rows)
{
if (lies == 0)
{
qdgjstring += "<tr>";
}
qdgjstring += "<td ><span>" + r["gjmc"].ToString() + "</span> <span>" + Convert.ToDouble(r["gjjg"]).ToString() + "</span></td>";
lies = lies + 1;
if (lies == 7)
{
lies = 0;
qdgjstring += "</tr>";
}
}
if (7 - lies > 0 && lies > 0)
{
for (int x = 0; x < 7 - lies; x++)
{
qdgjstring += "<td ></td> ";
}
qdgjstring += "</tr>";
}
}
zdgjxx.InnerHtml = qdgjstring + "</table>";
}
zdgjxx.InnerHtml = qdgjstring + "</table>";
//后段工价
qdgjstring = "<table id='hdgjtb' class='bule'>";
getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='后段工价'";
ds = DBHlper.Execute(getgjsql);
//判断拼接列值,根据值更改前台样式
lies = 0;
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
//后段工价
qdgjstring = "<table id='hdgjtb' class='bule'>";
getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='后段工价'";
ds = DBHlper.Execute(getgjsql);
//判断拼接列值,根据值更改前台样式
lies = 0;
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
foreach (DataRow r in ds.Tables[0].Rows)
{
if (lies == 0)
{
qdgjstring += "<tr>";
}
qdgjstring += "<td ><span>" + r["gjmc"].ToString() + "</span> <span>" + Convert.ToDouble(r["gjjg"]).ToString() + "</span></td>";
lies = lies + 1;
if (lies == 7)
{
lies = 0;
qdgjstring += "</tr>";
}
}
if (7 - lies > 0 && lies > 0)
{
for (int x = 0; x < 7 - lies; x++)
{
qdgjstring += "<td ></td> ";
}
qdgjstring += "</tr>";
}
foreach (DataRow r in ds.Tables[0].Rows)
{
if (lies == 0)
{
qdgjstring += "<tr>";
}
qdgjstring += "<td ><span>" + r["gjmc"].ToString() + "</span> <span>" + Convert.ToDouble(r["gjjg"]).ToString() + "</span></td>";
lies = lies + 1;
if (lies == 7)
{
lies = 0;
qdgjstring += "</tr>";
}
}
if (7 - lies > 0 && lies > 0)
{
for (int x = 0; x < 7 - lies; x++)
{
qdgjstring += "<td ></td> ";
}
qdgjstring += "</tr>";
}
}
hdgjxx.InnerHtml = qdgjstring + "</table>";
}
hdgjxx.InnerHtml = qdgjstring + "</table>";
}
#endregion
@ -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>";
lies = lies + 1;
if (lies ==3)
if (lies == 3)
{
lies = 0;
qdgjstring += "</tr>";
@ -329,7 +330,7 @@ public partial class Sample_browse : System.Web.UI.Page
}
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>";
}
@ -380,7 +381,7 @@ public partial class Sample_browse : System.Web.UI.Page
{
//加载前段工价
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);
//判断拼接列值,根据值更改前台样式
int lies = 0;
@ -408,11 +409,11 @@ public partial class Sample_browse : System.Web.UI.Page
qdgjstring += "<td ></td> ";
}
qdgjstring += "</tr>";
}
}
}
xgfydiv.InnerHtml = qdgjstring + "</table>";
}
#endregion
#endregion
#region
private void getscyl()
{
@ -425,7 +426,7 @@ public partial class Sample_browse : System.Web.UI.Page
{
int sjint = 0;
int hcount = 1;
foreach(DataRow r in ds.Tables[0].Rows)
foreach (DataRow r in ds.Tables[0].Rows)
{
if (sjint == 0)
{
@ -438,20 +439,20 @@ public partial class Sample_browse : System.Web.UI.Page
cltable += "</tr>";
}
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 += "</tr>";
}
}
cltable += "</table>";
scylxxdiv.InnerHtml = cltable;
}
#endregion
#region model对象
@ -520,10 +521,10 @@ public partial class Sample_browse : System.Web.UI.Page
public int savegx(string[] gx, string djid, string xmjd)
{
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)
{
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;
}
@ -565,7 +566,7 @@ public partial class Sample_browse : System.Web.UI.Page
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_xgfy where ypdid='" + id.Value + "'");
DBHlper.excutecmd(" delete nr_z_ypdj_xmxx where ypdid='" + id.Value + "'");
@ -582,14 +583,14 @@ public partial class Sample_browse : System.Web.UI.Page
{
getmd();
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);
if(fzhi>0)
if (fzhi > 0)
{
rizhi.jilu = zh.zhanghao + "进行了前段签字,开发号为:" + kfh.Text.Trim();
rizhi.yonghuming = zh.zhanghao;
rizhibll.Add(rizhi);
Response.Redirect("Sample_browse.aspx?uid=" + id.Value);
rizhi.jilu = zh.zhanghao + "进行了前段签字,开发号为:" + kfh.Text.Trim();
rizhi.yonghuming = zh.zhanghao;
rizhibll.Add(rizhi);
Response.Redirect("Sample_browse.aspx?uid=" + id.Value);
}
}
protected void bt_zdsh_Click(object sender, EventArgs e)
@ -647,33 +648,33 @@ public partial class Sample_browse : System.Web.UI.Page
rizhibll.Add(rizhi);
Response.Redirect("Sample_browse.aspx?uid=" + id.Value);
}
}
}
protected void bt_sccpda_Click(object sender, EventArgs e)
{
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
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)";
int getcpz=DBHlper.ExecuteReid(ypdcpjsql);
if (getcpz > 0)
{
string getxmsql = "select * from nr_z_ypdj_cpxgxm ";
DataSet ds= DBHlper.Execute(getxmsql);
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
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 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 + "'");
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)";
int getcpz = DBHlper.ExecuteReid(ypdcpjsql);
if (getcpz > 0)
{
string getxmsql = "select * from nr_z_ypdj_cpxgxm ";
DataSet ds = DBHlper.Execute(getxmsql);
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
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 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>
<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="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>
<asp:HiddenField ID="scdjhd" runat="server" Value="" />
<asp:HiddenField ID="qxhjzhd" runat="server" Value="" />