Просмотр исходного кода

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

caosy 6 лет назад
Родитель
Сommit
7084976616

Разница между файлами не показана из-за своего большого размера
+ 309 - 195
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs


+ 20 - 9
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -1180,8 +1180,8 @@ namespace UAS_LabelMachine
         {
             if (dh.getFieldDataByCondition("prodinout", "pi_statuscode", "pi_inoutno='" + pi_inoutno.Text + "'").ToString() == "POSTED")
             {
-                MessageBox.Show("单据" + pi_inoutno.Text + "已过账,不允许删除条码");
-                return;
+                //MessageBox.Show("单据" + pi_inoutno.Text + "已过账,不允许删除条码");
+                //return;
             }
             ArrayList<string> DeleteID = new ArrayList<string>();
             for (int i = 0; i < LabelInf.RowCount; i++)
@@ -1202,7 +1202,14 @@ namespace UAS_LabelMachine
                     Input.Clear();
                     LoadPrcodeData();
                     LoadGridData(sender, e);
-                    dh.UpdateByCondition("prodinout", "pi_user_packingstatus='Packing'", "pi_inoutno='" + pi_inoutno.Text + "'");
+                    if (int.Parse(dh.getFieldDataByCondition("prodiobarcode", "count(1)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString()) == 0)
+                    {
+                        dh.UpdateByCondition("prodinout", "pi_user_packingstatus=''", "pi_inoutno='" + pi_inoutno.Text + "'");
+                    }
+                    else
+                    {
+                        dh.UpdateByCondition("prodinout", "pi_user_packingstatus='Packing'", "pi_inoutno='" + pi_inoutno.Text + "'");
+                    }
                 }
             }
             else
@@ -1214,11 +1221,14 @@ namespace UAS_LabelMachine
             if (OutBoxCombox.Text != "")
             {
                 Pack_Click(sender, e);
-                //记录整箱的重量
-                sql.Clear();
-                sql.Append("update prodiobarcode set pib_totalweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");
-                sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "'");
-                dh.ExecuteSql(sql.ToString(), "update");
+                if (Weight.Text != "" && Weight.Text != "0.000")
+                {
+                    //记录整箱的重量
+                    sql.Clear();
+                    sql.Append("update prodiobarcode set pib_totalweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");
+                    sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "'");
+                    dh.ExecuteSql(sql.ToString(), "update");
+                }
                 LoadGridData(sender, e);
                 thread = new Thread(OutBoxPrint);
                 stw = new SetLoadingWindow(thread, "正在打印外箱");
@@ -2035,6 +2045,7 @@ namespace UAS_LabelMachine
             {
                 dh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "delete");
                 dh.ExecuteSql("delete from CS$InoutPrcode where pd_inoutno='" + pi_inoutno.Text + "'", "delete");
+                dh.UpdateByCondition("prodinout", "pi_user_packingstatus=''", "pi_inoutno='" + pi_inoutno.Text + "'");
                 pi_inoutno_KeyDown(sender, new KeyEventArgs(Keys.Enter));
             }
         }
@@ -2060,7 +2071,7 @@ namespace UAS_LabelMachine
 
         private void ButtonWeigh_Click(object sender, EventArgs e)
         {
-            if (Weight.Text != "")
+            if (Weight.Text != "" && Weight.Text != "0.000")
             {
                 sql.Clear();
                 sql.Append("update prodiobarcode set pib_boxweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");

+ 42 - 0
UAS-出货标签管理/UAS_出货标签管理.Designer.cs

@@ -152,6 +152,7 @@
             this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.SingleDocRefresh = new System.Windows.Forms.LinkLabel();
             this.CancelOPPOPlate = new System.Windows.Forms.Button();
             this.OPPOPlate = new System.Windows.Forms.Button();
             this.ViVoPlate = new System.Windows.Forms.Button();
@@ -160,6 +161,7 @@
             this.SingleLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.SingleLabelCombox = new System.Windows.Forms.ComboBox();
             this.MidLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.MidDocRefresh = new System.Windows.Forms.LinkLabel();
             this.MidLabelNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.label5 = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
@@ -170,6 +172,7 @@
             this.MidLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.MidLabelCombox = new System.Windows.Forms.ComboBox();
             this.OutBoxLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.OutDocRefresh = new System.Windows.Forms.LinkLabel();
             this.LogingOut = new System.Windows.Forms.LinkLabel();
             this.GetOutBoxCode = new System.Windows.Forms.Button();
             this.OutBoxNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
@@ -1408,6 +1411,7 @@
             // 
             // SingleLabel
             // 
+            this.SingleLabel.Controls.Add(this.SingleDocRefresh);
             this.SingleLabel.Controls.Add(this.CancelOPPOPlate);
             this.SingleLabel.Controls.Add(this.OPPOPlate);
             this.SingleLabel.Controls.Add(this.ViVoPlate);
@@ -1425,6 +1429,17 @@
             this.SingleLabel.TabStop = false;
             this.SingleLabel.Text = "单盘标签";
             // 
+            // SingleDocRefresh
+            // 
+            this.SingleDocRefresh.AutoSize = true;
+            this.SingleDocRefresh.Location = new System.Drawing.Point(106, 23);
+            this.SingleDocRefresh.Name = "SingleDocRefresh";
+            this.SingleDocRefresh.Size = new System.Drawing.Size(42, 21);
+            this.SingleDocRefresh.TabIndex = 90;
+            this.SingleDocRefresh.TabStop = true;
+            this.SingleDocRefresh.Text = "刷新";
+            this.SingleDocRefresh.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.SingleDocRefresh_LinkClicked);
+            // 
             // CancelOPPOPlate
             // 
             this.CancelOPPOPlate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -1513,6 +1528,7 @@
             // 
             // MidLabel
             // 
+            this.MidLabel.Controls.Add(this.MidDocRefresh);
             this.MidLabel.Controls.Add(this.MidLabelNum);
             this.MidLabel.Controls.Add(this.label5);
             this.MidLabel.Controls.Add(this.label4);
@@ -1532,6 +1548,17 @@
             this.MidLabel.TabStop = false;
             this.MidLabel.Text = "中盒标签";
             // 
+            // MidDocRefresh
+            // 
+            this.MidDocRefresh.AutoSize = true;
+            this.MidDocRefresh.Location = new System.Drawing.Point(106, 23);
+            this.MidDocRefresh.Name = "MidDocRefresh";
+            this.MidDocRefresh.Size = new System.Drawing.Size(42, 21);
+            this.MidDocRefresh.TabIndex = 91;
+            this.MidDocRefresh.TabStop = true;
+            this.MidDocRefresh.Text = "刷新";
+            this.MidDocRefresh.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.SingleDocRefresh_LinkClicked);
+            // 
             // MidLabelNum
             // 
             this.MidLabelNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -1633,6 +1660,7 @@
             // 
             // OutBoxLabel
             // 
+            this.OutBoxLabel.Controls.Add(this.OutDocRefresh);
             this.OutBoxLabel.Controls.Add(this.LogingOut);
             this.OutBoxLabel.Controls.Add(this.GetOutBoxCode);
             this.OutBoxLabel.Controls.Add(this.OutBoxNum);
@@ -1654,6 +1682,17 @@
             this.OutBoxLabel.TabStop = false;
             this.OutBoxLabel.Text = "外箱标签";
             // 
+            // OutDocRefresh
+            // 
+            this.OutDocRefresh.AutoSize = true;
+            this.OutDocRefresh.Location = new System.Drawing.Point(64, 23);
+            this.OutDocRefresh.Name = "OutDocRefresh";
+            this.OutDocRefresh.Size = new System.Drawing.Size(42, 21);
+            this.OutDocRefresh.TabIndex = 92;
+            this.OutDocRefresh.TabStop = true;
+            this.OutDocRefresh.Text = "刷新";
+            this.OutDocRefresh.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.SingleDocRefresh_LinkClicked);
+            // 
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
@@ -2011,5 +2050,8 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
+        private System.Windows.Forms.LinkLabel SingleDocRefresh;
+        private System.Windows.Forms.LinkLabel MidDocRefresh;
+        private System.Windows.Forms.LinkLabel OutDocRefresh;
     }
 }

+ 67 - 21
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -305,14 +305,15 @@ namespace UAS_LabelMachine
 
         private void LabelFormClose(object sender, EventArgs e)
         {
-            if (GetGridOnly.Checked)
-                GetInOutInfAndLabelFile();
-            else
-            {
-                GetGridOnly.Checked = true;
-                GetInOutInfAndLabelFile();
-                GetGridOnly.Checked = false;
-            }
+            GetInOutInfAndLabelFile();
+            //if (GetGridOnly.Checked)
+            //    GetInOutInfAndLabelFile();
+            //else
+            //{
+            //    //GetGridOnly.Checked = true;
+            //    GetInOutInfAndLabelFile();
+            //    //GetGridOnly.Checked = false;
+            //}
         }
 
         /// <summary>
@@ -1141,7 +1142,7 @@ namespace UAS_LabelMachine
             if (e.KeyCode == Keys.Enter)
             {
                 sql.Clear();
-                sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "'");
+                sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "' and pi_invostatus='已审核'");
                 DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 if (dt.Rows.Count > 0)
                 {
@@ -1190,7 +1191,7 @@ namespace UAS_LabelMachine
                     LogManager.DoLog("输入单号【" + pi_inoutno.Text + "】");
                 }
                 else
-                    MessageBox.Show("当前出入库单号不存在!");
+                    MessageBox.Show("当前出入库单号不存在或者未审核!");
             }
         }
 
@@ -1969,6 +1970,12 @@ namespace UAS_LabelMachine
         {
             if (OutBoxCombox.Text != "")
             {
+                if (OutBoxDoc != null)
+                    OutBoxDoc.Close();
+                if (OutBoxCombox.Text != "" && OutBoxCombox.SelectedValue != null && !GetGridOnly.Checked)
+                {
+                    OutBoxDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + OutBoxCombox.Text);
+                }
                 thread = new Thread(OutBoxPrint);
                 stw = new SetLoadingWindow(thread, "正在打印外箱");
                 BaseUtil.SetFormCenter(stw);
@@ -2238,20 +2245,23 @@ namespace UAS_LabelMachine
         {
             if (e.RowIndex >= 0)
             {
-                if (LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode")
+                if (!(DataHelper.DBConnectionString.Contains("richwell") || DataHelper.DBConnectionString.Contains("192.168.0.88")))
                 {
-                    string datecode = LabelInf.Rows[e.RowIndex].Cells["pib_datecode"].Value.ToString();
-                    try
+                    if (LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode")
                     {
-                        System.DateTime dt = System.DateTime.ParseExact(datecode, "yyyyMMdd", CultureInfo.CurrentCulture);
-                        GregorianCalendar gc = new GregorianCalendar();
-                        int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
-                        if (weekOfYear < 10)
-                            LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + "0" + weekOfYear;
-                        else
-                            LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + weekOfYear;
+                        string datecode = LabelInf.Rows[e.RowIndex].Cells["pib_datecode"].Value.ToString();
+                        try
+                        {
+                            System.DateTime dt = System.DateTime.ParseExact(datecode, "yyyyMMdd", CultureInfo.CurrentCulture);
+                            GregorianCalendar gc = new GregorianCalendar();
+                            int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
+                            if (weekOfYear < 10)
+                                LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + "0" + weekOfYear;
+                            else
+                                LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + weekOfYear;
+                        }
+                        catch (Exception) { }
                     }
-                    catch (Exception) { }
                 }
             }
         }
@@ -2749,5 +2759,41 @@ namespace UAS_LabelMachine
             }
             Properties.Settings.Default.Save();
         }
+
+        private void SingleDocRefresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+        {
+            switch ((sender as Control).Name)
+            {
+                case "SingleDocRefresh":
+                    if (SingleDoc != null)
+                        SingleDoc.Close();
+                    if (SingleLabelCombox.Text != "" && SingleLabelCombox.SelectedValue != null && !GetGridOnly.Checked)
+                    {
+                        System.DateTime time = Convert.ToDateTime(SingleLabelCombox.SelectedValue.ToString().Split('#')[2]);
+                        SingleDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(SingleLabelCombox.SelectedValue.ToString().Split('#')[1], SingleLabelCombox.Text, time));
+                    }
+                    break;
+                case "MidDocRefresh":
+                    if (MidDoc != null)
+                        MidDoc.Close();
+                    if (MidLabelCombox.Text != "" && MidLabelCombox.SelectedValue != null && !GetGridOnly.Checked)
+                    {
+                        System.DateTime time = Convert.ToDateTime(MidLabelCombox.SelectedValue.ToString().Split('#')[2]);
+                        MidDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(MidLabelCombox.SelectedValue.ToString().Split('#')[1], MidLabelCombox.Text, time));
+                    }
+                    break;
+                case "OutDocRefresh":
+                    if (OutBoxDoc != null)
+                        OutBoxDoc.Close();
+                    if (OutBoxCombox.Text != "" && OutBoxCombox.SelectedValue != null && !GetGridOnly.Checked)
+                    {
+                        System.DateTime time = Convert.ToDateTime(OutBoxCombox.SelectedValue.ToString().Split('#')[2]);
+                        OutBoxDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(OutBoxCombox.SelectedValue.ToString().Split('#')[1], OutBoxCombox.Text, time));
+                    }
+                    break;
+                default:
+                    break;
+            }
+        }
     }
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов