From e6e805f9c46f41b50f4a556732f618ffdb7b4e69 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 18 三月 2025 15:35:31 +0800
Subject: [PATCH] 生产领料单
---
PlanM/计划管理/Gy_RoutingBill.cs | 233 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 219 insertions(+), 14 deletions(-)
diff --git "a/PlanM/\350\256\241\345\210\222\347\256\241\347\220\206/Gy_RoutingBill.cs" "b/PlanM/\350\256\241\345\210\222\347\256\241\347\220\206/Gy_RoutingBill.cs"
index 14e6889..167d8b9 100644
--- "a/PlanM/\350\256\241\345\210\222\347\256\241\347\220\206/Gy_RoutingBill.cs"
+++ "b/PlanM/\350\256\241\345\210\222\347\256\241\347\220\206/Gy_RoutingBill.cs"
@@ -82,20 +82,28 @@
public const Int16 HSumPassRateCol = 52;
public const Int16 HRemarkCol = 53;
- public const Int16 HSourceInterIDCol = 53;
- public const Int16 HSourceEntryIDCol = 54;
- public const Int16 HSourceBillNoCol = 55;
- public const Int16 HSourceBillTypeCol = 56;
- public const Int16 HRelationQtyCol = 57;
- public const Int16 HRelationMoneyCol = 58;
- public const Int16 HTechnologyParameterCol = 59;
- public const Int16 HPicNumCol = 60;
- public const Int16 HProcCheckNoteCol = 61;
- public const Int16 HProcWorkNumCol = 62;
+ public const Int16 HSourceInterIDCol = 54;
+ public const Int16 HSourceEntryIDCol = 55;
+ public const Int16 HSourceBillNoCol = 56;
+ public const Int16 HSourceBillTypeCol = 57;
+ public const Int16 HRelationQtyCol = 58;
+ public const Int16 HRelationMoneyCol = 59;
+ public const Int16 HTechnologyParameterCol = 60;
+ public const Int16 HPicNumCol = 61;
+ public const Int16 HProcCheckNoteCol = 62;
+ public const Int16 HProcWorkNumCol = 63;
+ public const Int16 HWorkTimes_SCol = 64;
+ public const Int16 HSNCtrlCol = 65;
//
public string ModName = "3301";
public string ModCaption = "宸ヨ壓璺嚎";
+ public const string ModRightName = "Gy_RoutingBill";
+ public const string ModRightNameEdit = ModRightName + "_Edit"; //缂栬緫
+ public const string ModRightNameCheck = ModRightName + "_Check"; //瀹℃牳
+ public const string ModRightNameClose = ModRightName + "_Close"; //鍏抽棴
+ public const string ModRightNameDelete = ModRightName + "_Delete"; //浣滃簾
+ public const string ModRightNameDrop = ModRightName + "_Drop"; //鍒犻櫎
public bool BillChange; //
public DBUtility.ClsPub.Enum_BillStatus BillStatus;
@@ -104,15 +112,30 @@
public DAL.ClsGy_RoutingBill BillNew =new DAL.ClsGy_RoutingBill();
public DAL.ClsGy_RoutingBill BillOld = new DAL.ClsGy_RoutingBill();
ClsGridViewSum oSumGrid = new ClsGridViewSum();
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ public string CampanyName = ""; //绯荤粺鍙傛暟 瀹㈡埛
+ public Int64 HOrgID = -1; //缁勭粐鍐呯爜
//-------------------------------------------------------------------------
#region 鍥哄畾浠g爜
-
+
//娓呯┖鐣岄潰
public void Sub_ClearBill()
{
DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp);
- //
+
+ //鑾峰彇绯荤粺鍙傛暟 瀹㈡埛
+ ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter();
+ CampanyName = oClsXt_SystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ //鑾峰彇缁勭粐淇℃伅
+ DataSet Ds1 = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS with(nolock) where HItemID=" + ClsPub.HOrgID, "Xt_ORGANIZATIONS", ref DBUtility.ClsPub.sExeReturnInfo);
+ if (Ds1.Tables[0].Rows.Count != 0)
+ {
+ cmbHOrgID.Text = DBUtility.ClsPub.isStrNull(Ds1.Tables[0].Rows[0]["HName"]);
+ cmbHOrgID.Enabled = false;
+ }
+
txtHMaker.Text = ClsPub.CurUserName;
txtHMakeDate.Text = "";
txtHChecker.Text = "";
@@ -148,6 +171,12 @@
//鍒犻櫎鍗曟嵁
private void Sub_DeleteBill()
{
+ //鍒ゆ柇鏉冮檺
+ if (!ClsPub.Security_Log(ModRightNameDrop, 1, true, DBUtility.ClsPub.CurUserName))
+ {
+ return;
+ }
+
string s = "";
if (BillOld.ShowBill(BillOld.omodel.HInterID, ref s) == false)
{
@@ -251,6 +280,9 @@
g.DrawLine(p, new Point(txtHChecker.Left, txtHChecker.Top + txtHChecker.Height), new Point(txtHChecker.Left + txtHChecker.Width, txtHChecker.Top + txtHChecker.Height));
g.DrawLine(p, new Point(txtHCheckDate.Left, txtHCheckDate.Top + txtHCheckDate.Height), new Point(txtHCheckDate.Left + txtHCheckDate.Width, txtHCheckDate.Top + txtHCheckDate.Height));
//
+ g.DrawLine(p, new Point(txtHUseMan.Left, txtHUseMan.Top + txtHUseMan.Height), new Point(txtHUseMan.Left + txtHUseMan.Width, txtHUseMan.Top + txtHUseMan.Height));
+ g.DrawLine(p, new Point(txtHUseDate.Left, txtHUseDate.Top + txtHUseDate.Height), new Point(txtHUseDate.Left + txtHUseDate.Width, txtHUseDate.Top + txtHUseDate.Height));
+ //
g.DrawLine(p, new Point(txtHCloseMan.Left, txtHCloseMan.Top + txtHCloseMan.Height), new Point(txtHCloseMan.Left + txtHCloseMan.Width, txtHCloseMan.Top + txtHCloseMan.Height));
g.DrawLine(p, new Point(txtHCloseDate.Left, txtHCloseDate.Top + txtHCloseDate.Height), new Point(txtHCloseDate.Left + txtHCloseDate.Width, txtHCloseDate.Top + txtHCloseDate.Height));
//
@@ -280,7 +312,28 @@
oSumGrid.oGridsum = grdSum;
this.Text = ModCaption;
this.lblCaption.Text = ModCaption;
+ //鍔犺浇缁勭粐淇℃伅
+ Sub_AddOrdList();
}
+
+ //鍔犺浇缁勭粐淇℃伅
+ private void Sub_AddOrdList()
+ {
+ DataSet ds;
+ DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View();
+ ds = oClsGy_ORGANIZATIONS_View.GetList();
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ MessageBox.Show("鑾峰彇缁勭粐澶辫触");
+ return;
+ }
+ cmbHOrgID.Items.Clear();
+ for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
+ {
+ cmbHOrgID.Items.Add(DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HName"]));
+ }
+ }
+
//棣栧紶
private void Sub_First()
{
@@ -326,8 +379,22 @@
//瀹℃牳鍗曟嵁
private void Sub_CheckBill()
{
+ //鍒ゆ柇鏉冮檺
+ if (!ClsPub.Security_Log(ModRightNameCheck, 1, true, DBUtility.ClsPub.CurUserName))
+ {
+ return;
+ }
+
+ if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew)
+ {
+ MessageBox.Show("鏂板鐘舵�佷笉鍏佽瀹℃牳鍗曟嵁锛岃鍏堜繚瀛樺崟鎹紒", "鎻愮ず");
+ }
+
if (BillOld.CheckBill(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true)
{
+
+
+
BillChange = true;
txtHChecker.Text = ClsPub.CurUserName;
txtHCheckDate.Text = BillOld.omodel.HCheckDate;
@@ -341,6 +408,17 @@
//鍙嶅鍗曟嵁
private void Sub_AbandonCheck()
{
+ //鍒ゆ柇鏉冮檺
+ if (!ClsPub.Security_Log(ModRightNameCheck, 1, true, DBUtility.ClsPub.CurUserName))
+ {
+ return;
+ }
+
+ if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew)
+ {
+ MessageBox.Show("鏂板鐘舵�佷笉鍏佽鍙嶅鏍稿崟鎹紝璇峰厛淇濆瓨鍗曟嵁锛�", "鎻愮ず");
+ }
+
if (BillOld.AbandonCheck(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true)
{
BillChange = true;
@@ -356,6 +434,17 @@
//鍏抽棴鍗曟嵁
private void Sub_CloseBill()
{
+ //鍒ゆ柇鏉冮檺
+ if (!ClsPub.Security_Log(ModRightNameClose, 1, true, DBUtility.ClsPub.CurUserName))
+ {
+ return;
+ }
+
+ if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew)
+ {
+ MessageBox.Show("鏂板鐘舵�佷笉鍏佽鍏抽棴鍗曟嵁锛岃鍏堜繚瀛樺崟鎹紒", "鎻愮ず");
+ }
+
if (BillOld.CloseBill(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true)
{
BillChange = true;
@@ -371,6 +460,17 @@
//鍙嶅叧闂崟鎹�
private void Sub_Cancel()
{
+ //鍒ゆ柇鏉冮檺
+ if (!ClsPub.Security_Log(ModRightNameClose, 1, true, DBUtility.ClsPub.CurUserName))
+ {
+ return;
+ }
+
+ if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew)
+ {
+ MessageBox.Show("鏂板鐘舵�佷笉鍏佽鍙嶅叧闂崟鎹紝璇峰厛淇濆瓨鍗曟嵁锛�", "鎻愮ず");
+ }
+
if (BillOld.CancelClose(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true)
{
BillChange = true;
@@ -386,6 +486,17 @@
//浣滃簾鍗曟嵁
private void Sub_Cancelltion()
{
+ //鍒ゆ柇鏉冮檺
+ if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName))
+ {
+ return;
+ }
+
+ if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew)
+ {
+ MessageBox.Show("鏂板鐘舵�佷笉鍏佽浣滃簾鍗曟嵁锛岃鍏堜繚瀛樺崟鎹紒", "鎻愮ず");
+ }
+
if (BillOld.Cancelltion(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true)
{
BillChange = true;
@@ -401,6 +512,17 @@
//鍙嶄綔搴�
private void Sub_AbandonCancelltion()
{
+ //鍒ゆ柇鏉冮檺
+ if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName))
+ {
+ return;
+ }
+
+ if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew)
+ {
+ MessageBox.Show("鏂板鐘舵�佷笉鍏佽鍙嶄綔搴熷崟鎹紝璇峰厛淇濆瓨鍗曟嵁锛�", "鎻愮ず");
+ }
+
if (BillOld.AbandonCancelltion(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true)
{
BillChange = true;
@@ -636,6 +758,18 @@
pic1.Image = System.Drawing.Image.FromFile(ClsPub.AppPath + @"/Pic/Closed.jpg");
//
}
+ if (txtHCloseMan.Text.Trim() != "")
+ {
+ sh.Enabled = false;
+ qsh.Enabled = false;
+ //gb.Enabled = false;
+ //hf.Enabled = true;
+ xg.Enabled = false;
+ sc.Enabled = false;
+ //
+ pic1.Visible = true;
+ pic1.Image = System.Drawing.Image.FromFile(ClsPub.AppPath + @"/Pic/Closed.jpg");
+ }
if (txtHDeleteMan.Text.Trim() == "")
{
//zf.Enabled = true;
@@ -850,6 +984,13 @@
this.textHProductNum.Text = BillOld.omodel.HProductNum.ToString();
this.textHVerNum.Text = BillOld.omodel.HVerNum.ToString();
+ //鑾峰彇缁勭粐淇℃伅
+ DataSet Ds1 = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS with(nolock) where HItemID=" + BillOld.omodel.HORGID.ToString(), "Xt_ORGANIZATIONS", ref DBUtility.ClsPub.sExeReturnInfo);
+ if (Ds1.Tables[0].Rows.Count != 0)
+ {
+ cmbHOrgID.Text = DBUtility.ClsPub.isStrNull(Ds1.Tables[0].Rows[0]["HName"]);
+ }
+
//鍔犺浇琛ㄤ綋
int i = 0;
foreach (Model.ClsGy_RoutingBillSub oSub in BillOld.DetailColl)
@@ -972,6 +1113,8 @@
grdMain.Rows[i].Cells[HPassRateCol].Value = oSub.HPassRate.ToString();
grdMain.Rows[i].Cells[HSumPassRateCol].Value = oSub.HSumPassRate.ToString();
grdMain.Rows[i].Cells[HOverRateCol].Value = oSub.HOverRate.ToString();
+ grdMain.Rows[i].Cells[HWorkTimes_SCol].Value = oSub.HWorkTimes_S.ToString();
+ grdMain.Rows[i].Cells[HSNCtrlCol].Value = DBUtility.ClsPub.isBool(oSub.HSNCtrl);
//涓嬮亾娴佽浆宸ュ簭
grdMain.Rows[i].Cells[HNextProcFlagCol].Value = DBUtility.ClsPub.isBool(oSub.HNextProcFlag);
grdMain.Rows[i].Cells[HFlowProcCol].Value = DBUtility.ClsPub.isBool(oSub.HFlowProc);
@@ -997,6 +1140,35 @@
MessageBox.Show("鍗曚綅娌℃湁閫夋嫨锛�", "鎻愮ず");
return false;
}
+ if (CampanyName == "鍑礉濂堢壒") //绯荤粺鍙傛暟 瀹㈡埛
+ {
+ if (DBUtility.ClsPub.isStrNull(textHPicNumVer.Text) == "")
+ {
+ MessageBox.Show("鍥惧彿鐗堟湰娌℃湁褰曞叆锛�", "鎻愮ず");
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(textHPicNumAssemble.Text) == "")
+ {
+ MessageBox.Show("鎬昏鍥惧彿娌℃湁褰曞叆锛�", "鎻愮ず");
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(textHMaterTexture.Text) == "")
+ {
+ MessageBox.Show("鏉愯川娌℃湁褰曞叆锛�", "鎻愮ず");
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(textHProductNum.Text) == "")
+ {
+ MessageBox.Show("鎴愬搧缂栧彿娌℃湁褰曞叆锛�", "鎻愮ず");
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(textHVerNum.Text) == "")
+ {
+ MessageBox.Show("鐗堟湰娌℃湁褰曞叆锛�", "鎻愮ず");
+ return false;
+ }
+ }
+
//鍗曟嵁鍙锋槸鍚﹂噸澶�
if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, txtHBillNo.Text.Trim(), BillStatus, BillOld.omodel.HInterID))
{
@@ -1038,6 +1210,19 @@
lblCaption.Focus();
if (!Sub_AllowSave())//鍗曟嵁瀹屾暣鎬у垽鏂�
return false;
+
+ // 鑾峰彇缁勭粐鍐呯爜
+ DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View();
+ if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text))
+ {
+ HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID;
+ }
+ if (HOrgID == -1)
+ {
+ MessageBox.Show("閫夋嫨缁勭粐鏈夐敊璇紒");
+ return false;
+ }
+
//璧嬪�糏D
if (BillStatus ==DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify)
BillNew.omodel.HInterID = BillOld.omodel.HInterID;
@@ -1072,6 +1257,7 @@
BillNew.omodel.HMaterTexture = ClsPub.isStrNull(this.textHMaterTexture.Text);
BillNew.omodel.HProductNum = ClsPub.isStrNull(this.textHProductNum.Text);
BillNew.omodel.HVerNum = ClsPub.isStrNull(this.textHVerNum.Text);
+ BillNew.omodel.HORGID = HOrgID;
//鏄庣粏绫昏祴鍊�
BillNew.DetailColl=new List<Model.ClsGy_RoutingBillSub>();
@@ -1169,6 +1355,8 @@
oSub.HStdFlag = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HStdFlagCol].Value);
oSub.HAutoTrunFlag = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HAutoTrunFlagCol].Value);
oSub.HProcType = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcTypeCol].Value);
+ oSub.HWorkTimes_S = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HWorkTimes_SCol].Value);
+ oSub.HSNCtrl = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HSNCtrlCol].Value);
oSub.HProcWorkNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcWorkNumCol].Value);
if (DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HPassRateCol].Value) > 0)
@@ -1243,7 +1431,7 @@
private void initGrid()
{
//
- grdMain.ColumnCount = 63; //鎬诲垪鏁�
+ grdMain.ColumnCount = 66; //鎬诲垪鏁�
DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
//
grdMain.RowsDefaultCellStyle.WrapMode = DataGridViewTriState.True;
@@ -1307,6 +1495,8 @@
grdMain.Columns[HNextProcFlagCol].HeaderText = "涓嬮亾娴佽浆宸ュ簭";
grdMain.Columns[HFlowProcCol].HeaderText = "娴佽浆宸ュ簭";
grdMain.Columns[HOverRateCol].HeaderText = "瓒呴姣斾緥";
+ grdMain.Columns[HWorkTimes_SCol].HeaderText = "浜у搧鍗曚欢宸ユ椂";
+ grdMain.Columns[HSNCtrlCol].HeaderText = "SN鐮佽繃绔�";
////鍥哄畾璧嬪��=====================================================
grdMain.Columns[HSnoCol].HeaderText = "搴忓彿";
grdMain.Columns[HRemarkCol].HeaderText = "澶囨敞";
@@ -1373,7 +1563,9 @@
"," + HRemarkCol.ToString() +
"," + HTechnologyParameterCol.ToString() +
"," + HPicNumCol.ToString() +
- "," + HProcCheckNoteCol.ToString()+
+ "," + HProcCheckNoteCol.ToString() +
+ "," + HWorkTimes_SCol.ToString() +
+ "," + HSNCtrlCol.ToString() +
"," + HOverRateCol.ToString();
//璁剧疆鍚堣鍒�
string sTotalCol = HTimeUnitCol.ToString();
@@ -1409,6 +1601,12 @@
oCell5.Value = 0;
oCell5.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
grdMain.Rows[i].Cells[HFlowProcCol] = oCell5;
+ //SN鐮佽繃绔�
+ DataGridViewCheckBoxCell oCell6 = new DataGridViewCheckBoxCell();
+ oCell6.ThreeState = false;
+ oCell6.Value = 0;
+ oCell6.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
+ grdMain.Rows[i].Cells[HSNCtrlCol] = oCell6;
//
DataGridViewComboBoxCell column = new DataGridViewComboBoxCell();
column.Items.Add(" ");
@@ -1418,6 +1616,7 @@
}
//
DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol,oSumGrid);
+ DBUtility.Xt_BaseBillFun.GetGrid(grdMain, this.Name);
//==================
DBUtility.ClsPub.HideGridView(grdMain, Name, ClsPub.AppPath);//璁剧疆闅愯棌鍒�
}
@@ -2011,6 +2210,12 @@
MessageBox.Show("浣跨敤澶辫触!褰撳墠宸ヨ壓璺嚎涓嶆槸娴忚鐘舵��!");
return;
}
+ //鍒ゆ柇鏉冮檺
+ if (!ClsPub.Security_Log(ModRightNameCheck, 1, true, DBUtility.ClsPub.CurUserName))
+ {
+ return;
+ }
+
if (BillOld.Sub_RoutingCheckAndUsed(BillOld.omodel.HInterID))
{
MessageBox.Show("浣跨敤鎴愬姛锛�");
--
Gitblit v1.9.1