|
@@ -73,7 +73,8 @@ namespace UAS_MES.Make
|
|
|
if (ma_code.Text != "")
|
|
if (ma_code.Text != "")
|
|
|
{
|
|
{
|
|
|
string ErrMessage = "";
|
|
string ErrMessage = "";
|
|
|
- if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrMessage)) {
|
|
|
|
|
|
|
+ if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrMessage))
|
|
|
|
|
+ {
|
|
|
sql.Clear();
|
|
sql.Clear();
|
|
|
sql.Append("select cr_code from craft left join craftdetail on cd_crid=cr_id where cr_code in (" + craftcode_condition + ") ");
|
|
sql.Append("select cr_code from craft left join craftdetail on cd_crid=cr_id where cr_code in (" + craftcode_condition + ") ");
|
|
|
sql.Append("and cr_prodcode='" + ma_prodcode.Text + "' and cr_statuscode='AUDITED' and cd_stepcode='" + User.CurrentStepCode + "'");
|
|
sql.Append("and cr_prodcode='" + ma_prodcode.Text + "' and cr_statuscode='AUDITED' and cd_stepcode='" + User.CurrentStepCode + "'");
|
|
@@ -115,7 +116,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
}
|
|
|
else OperateResult.AppendText(">>当前岗位资源工序不在工单对应的途程中\n", Color.Red);
|
|
else OperateResult.AppendText(">>当前岗位资源工序不在工单对应的途程中\n", Color.Red);
|
|
|
}
|
|
}
|
|
|
- else OperateResult.AppendText(">>"+ErrMessage+"\n", Color.Red);
|
|
|
|
|
|
|
+ else OperateResult.AppendText(">>" + ErrMessage + "\n", Color.Red);
|
|
|
}
|
|
}
|
|
|
else OperateResult.AppendText(">>工单号不能为空\n", Color.Red, pr_batchnum);
|
|
else OperateResult.AppendText(">>工单号不能为空\n", Color.Red, pr_batchnum);
|
|
|
}
|
|
}
|
|
@@ -130,7 +131,7 @@ namespace UAS_MES.Make
|
|
|
sql.Append("select nvl(mss_id,0) mss_id,sp_soncode,mss_prodcode,sp_oneuseqty,mss_barcode,nvl(mss_qty,0) mss_qty ,mss_remain,");
|
|
sql.Append("select nvl(mss_id,0) mss_id,sp_soncode,mss_prodcode,sp_oneuseqty,mss_barcode,nvl(mss_qty,0) mss_qty ,mss_remain,");
|
|
|
sql.Append("pr_detail,nvl(mss_useqty,0) mss_useqty from stepbom left join stepproduct on sp_sbid=sb_id left join product on ");
|
|
sql.Append("pr_detail,nvl(mss_useqty,0) mss_useqty from stepbom left join stepproduct on sp_sbid=sb_id left join product on ");
|
|
|
sql.Append("pr_code=sp_mothercode left join makesourcestock on mss_makecode='" + ma_code.Text + "' and mss_craftcode=sb_craftcode ");
|
|
sql.Append("pr_code=sp_mothercode left join makesourcestock on mss_makecode='" + ma_code.Text + "' and mss_craftcode=sb_craftcode ");
|
|
|
- sql.Append("and mss_stepcode=sp_stepcode where sb_prodcode='" + ma_prodcode.Text + "' and sb_craftcode='" + ma_craftcode.Text + "' ");
|
|
|
|
|
|
|
+ sql.Append("and mss_stepcode=sp_stepcode and sp_soncode=mss_prodcode where sb_prodcode='" + ma_prodcode.Text + "' and sb_craftcode='" + ma_craftcode.Text + "' ");
|
|
|
sql.Append("and sp_stepcode='" + User.CurrentStepCode + "' and sp_tracekind=2");
|
|
sql.Append("and sp_stepcode='" + User.CurrentStepCode + "' and sp_tracekind=2");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
BaseUtil.FillDgvWithDataTable(BatchProductDGV, dt);
|
|
BaseUtil.FillDgvWithDataTable(BatchProductDGV, dt);
|
|
@@ -138,8 +139,7 @@ namespace UAS_MES.Make
|
|
|
|
|
|
|
|
private void Confirm_Click(object sender, EventArgs e)
|
|
private void Confirm_Click(object sender, EventArgs e)
|
|
|
{
|
|
{
|
|
|
- KeyEventArgs e1 = new KeyEventArgs(Keys.Enter);
|
|
|
|
|
- pr_batchnum_KeyDown(sender, e1);
|
|
|
|
|
|
|
+ pr_batchnum_KeyDown(sender, new KeyEventArgs(Keys.Enter));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void Screen_Click(object sender, EventArgs e)
|
|
private void Screen_Click(object sender, EventArgs e)
|
|
@@ -167,11 +167,14 @@ namespace UAS_MES.Make
|
|
|
{
|
|
{
|
|
|
if (BatchProductDGV.Columns[e.ColumnIndex].Name == "DeleteRow")
|
|
if (BatchProductDGV.Columns[e.ColumnIndex].Name == "DeleteRow")
|
|
|
{
|
|
{
|
|
|
- string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
|
|
|
|
|
- if (id != "0")
|
|
|
|
|
|
|
+ if (e.RowIndex >= 0)
|
|
|
{
|
|
{
|
|
|
- BatchProductDGV.Rows.RemoveAt(e.RowIndex);
|
|
|
|
|
- dh.ExecuteSql("delete from makesourcestock where mss_id='" + id + "'", "delete");
|
|
|
|
|
|
|
+ string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
|
|
|
|
|
+ if (id != "0")
|
|
|
|
|
+ {
|
|
|
|
|
+ BatchProductDGV.Rows.RemoveAt(e.RowIndex);
|
|
|
|
|
+ dh.ExecuteSql("delete from makesourcestock where mss_id='" + id + "'", "delete");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -207,7 +210,7 @@ namespace UAS_MES.Make
|
|
|
private void BatchProductDGV_CellEndEdit(object sender, DataGridViewCellEventArgs e)
|
|
private void BatchProductDGV_CellEndEdit(object sender, DataGridViewCellEventArgs e)
|
|
|
{
|
|
{
|
|
|
string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
|
|
string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
|
|
|
- string qty ="0";
|
|
|
|
|
|
|
+ string qty = "0";
|
|
|
if (id != "0")
|
|
if (id != "0")
|
|
|
{
|
|
{
|
|
|
try
|
|
try
|
|
@@ -224,8 +227,10 @@ namespace UAS_MES.Make
|
|
|
}
|
|
}
|
|
|
catch (Exception)
|
|
catch (Exception)
|
|
|
{
|
|
{
|
|
|
|
|
+ OperateResult.AppendText(">>数量必须大于0\n", Color.Red);
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
- dh.UpdateByCondition("makesourcestock", "mss_qty='"+ qty + "'", "mss_id='" + id + "'");
|
|
|
|
|
|
|
+ dh.UpdateByCondition("makesourcestock", "mss_qty='" + qty + "'", "mss_id='" + id + "'");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|