Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 years ago
parent
commit
033a286ea6

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_GetReMakeSN.cs

@@ -88,7 +88,7 @@ namespace UAS_MES.Make
 
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_labeltype='SN标签' order by pl_isdefault desc ", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_laname";
             PrintLabel.DisplayMember = "pl_laname";
             PrintLabel.ValueMember = "pl_labelcode";
             PrintLabel.ValueMember = "pl_labelcode";

+ 11 - 3
UAS-MES/FunctionCode/Make/Make_PositionStock.cs

@@ -145,6 +145,7 @@ namespace UAS_MES.Make
             sql.Append("sysdate,'" + User.UserCode + "','" + Barremain + "','" + Barremain + "','" + sp_oneuseqty + "','" + sp_soncode + "','" + ma_id + "','" + User.UserSourceCode + "')");
             sql.Append("sysdate,'" + User.UserCode + "','" + Barremain + "','" + Barremain + "','" + sp_oneuseqty + "','" + sp_soncode + "','" + ma_id + "','" + User.UserSourceCode + "')");
             dh.ExecuteSql(sql.GetString(), "insert");
             dh.ExecuteSql(sql.GetString(), "insert");
             dh.UpdateByCondition("barcode", "bar_place='" + ma_code.Text + "'", "bar_code='" + pr_batchnum.Text + "'");
             dh.UpdateByCondition("barcode", "bar_place='" + ma_code.Text + "'", "bar_code='" + pr_batchnum.Text + "'");
+            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "岗位备料", "上料物料" + pr_batchnum.Text, "", "");
             //数据插入成功后加载Grid的数据
             //数据插入成功后加载Grid的数据
             FillDataGridView();
             FillDataGridView();
             OperateResult.AppendText(">>物料批号" + pr_batchnum.Text + "备料成功\n", Color.Green, pr_batchnum);
             OperateResult.AppendText(">>物料批号" + pr_batchnum.Text + "备料成功\n", Color.Green, pr_batchnum);
@@ -196,11 +197,18 @@ namespace UAS_MES.Make
                 if (e.RowIndex >= 0)
                 if (e.RowIndex >= 0)
                 {
                 {
                     string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
                     string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
+                    string useqty = BatchProductDGV.Rows[e.RowIndex].Cells["mss_useqty"].Value.ToString();
+                    string soncode = BatchProductDGV.Rows[e.RowIndex].Cells["sp_soncode"].Value.ToString();
                     if (id != "0")
                     if (id != "0")
                     {
                     {
-                        BatchProductDGV.Rows.RemoveAt(e.RowIndex);
-                        dh.ExecuteSql("delete from makesourcestock where mss_id='" + id + "'", "delete");
-                        OperateResult.AppendText(">>删除成功\n");
+                        if (useqty == "0")
+                        {
+                            BatchProductDGV.Rows.RemoveAt(e.RowIndex);
+                            dh.ExecuteSql("delete from makesourcestock where mss_id='" + id + "'", "delete");
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "岗位备料", "删除物料" + soncode, "", "");
+                            OperateResult.AppendText(">>料号" + soncode + "删除成功\n");
+                        }
+                        else OperateResult.AppendText(">>料号" + soncode + "已被使用,不允许删除\n", Color.Red);
                     }
                     }
                 }
                 }
             }
             }