Эх сурвалжийг харах

修改超工单数量问题,修改部分变量为局部变量

章政 8 жил өмнө
parent
commit
b35a9e5eed

+ 4 - 4
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -179,7 +179,7 @@ namespace UAS_MES.Make
                     {
                         //获取工单的其他信息
                         sql.Clear();
-                        sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
+                        sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,nvl(ma_unlimitin,0)ma_unlimitin,ma_prodcode as pr_code ,pr_detail,");
                         sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
                         sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + (oMakeCode == "null" ? ma_code.Text : oMakeCode) + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -211,7 +211,7 @@ namespace UAS_MES.Make
                         }
                         string ErrorMessage = "";
                         string result = "";
-                        if (int.Parse(mcd_remainqty.Text) <= 0)
+                        if (int.Parse(mcd_remainqty.Text) <= 0 &&dt.Rows[0]["ma_unlimitin"].ToString()!="0")
                         {
                             macode = ma_code.Text;
                             ErrorMessage = "工单" + macode + "打印结束\n>请输入SN";
@@ -298,7 +298,7 @@ namespace UAS_MES.Make
         //根据产品编号获取打印模板
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' and PL_LABELTYPE='彩盒标' order by PL_ISDEFAULT DESC", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' and PL_LABELTYPE='彩盒标' order by PL_ISDEFAULT DESC", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_name";
             PrintLabel.ValueMember = "pl_labelcode";
@@ -335,7 +335,7 @@ namespace UAS_MES.Make
                 sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
                 sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
                 sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
-                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 if (dt.Rows.Count > 0)
                 {
                     BaseUtil.SetFormValue(this.Controls, dt);