浏览代码

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

Hcsy 7 年之前
父节点
当前提交
4c72e49a3c

+ 41 - 13
PLCDataReader/Main.Designer.cs

@@ -33,7 +33,6 @@ namespace UAS_PLCDataReader
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
             this.RibbonNav = new DevExpress.XtraBars.Ribbon.RibbonControl();
             this.ButtonDeviceList = new DevExpress.XtraBars.BarButtonItem();
@@ -71,6 +70,7 @@ namespace UAS_PLCDataReader
             this.de_runstatus = new DevExpress.XtraGrid.Columns.GridColumn();
             this.de_stepcode = new DevExpress.XtraGrid.Columns.GridColumn();
             this.de_stepname = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.de_sourcecode = new DevExpress.XtraGrid.Columns.GridColumn();
             this.de_indate = new DevExpress.XtraGrid.Columns.GridColumn();
             this.de_spec = new DevExpress.XtraGrid.Columns.GridColumn();
             this.de_inman = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -99,6 +99,7 @@ namespace UAS_PLCDataReader
             this.dc_receivecoding = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_man = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_date = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.repositoryItemDateEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemDateEdit();
             this.db_name = new DevExpress.XtraGrid.Columns.GridColumn();
             this.PageDeviceNetSetting = new DevExpress.XtraTab.XtraTabPage();
             this.ButtonDeleteNetConfig = new UAS_PLCDataReader.CustomerControl.Button.ButtonDeleteRow();
@@ -164,8 +165,8 @@ namespace UAS_PLCDataReader
             this.PageWorkCenterStatus = new DevExpress.XtraTab.XtraTabPage();
             this.GridWorkCenterStatus = new UAS_PLCDataReader.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewWorkCenterStatus = new UAS_PLCDataReader.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
-            this.TimerDeviceStatus = new System.Windows.Forms.Timer(this.components);
-            this.CommonTipController = new DevExpress.Utils.ToolTipController(this.components);
+            this.TimerDeviceStatus = new System.Windows.Forms.Timer();
+            this.CommonTipController = new DevExpress.Utils.ToolTipController();
             ((System.ComponentModel.ISupportInitialize)(this.RibbonNav)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MainTabControl)).BeginInit();
             this.MainTabControl.SuspendLayout();
@@ -183,6 +184,8 @@ namespace UAS_PLCDataReader
             ((System.ComponentModel.ISupportInitialize)(this.GridViewCommandSet)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckEditCommandSet)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CommandSetRepositoryItemComboBox1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemDateEdit1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemDateEdit1.CalendarTimeProperties)).BeginInit();
             this.PageDeviceNetSetting.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceNetSetting)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceNetSetting)).BeginInit();
@@ -524,6 +527,7 @@ namespace UAS_PLCDataReader
             this.de_runstatus,
             this.de_stepcode,
             this.de_stepname,
+            this.de_sourcecode,
             this.de_indate,
             this.de_spec,
             this.de_inman,
@@ -600,7 +604,15 @@ namespace UAS_PLCDataReader
             this.de_stepname.FieldName = "DE_STEPNAME";
             this.de_stepname.Name = "de_stepname";
             this.de_stepname.Visible = true;
-            this.de_stepname.VisibleIndex = 6;
+            this.de_stepname.VisibleIndex = 7;
+            // 
+            // de_sourcecode
+            // 
+            this.de_sourcecode.Caption = "岗位资源";
+            this.de_sourcecode.FieldName = "DE_SOURCECODE";
+            this.de_sourcecode.Name = "de_sourcecode";
+            this.de_sourcecode.Visible = true;
+            this.de_sourcecode.VisibleIndex = 6;
             // 
             // de_indate
             // 
@@ -610,6 +622,7 @@ namespace UAS_PLCDataReader
             this.de_indate.FieldName = "DE_INDATE";
             this.de_indate.FilterMode = DevExpress.XtraGrid.ColumnFilterMode.DisplayText;
             this.de_indate.Name = "de_indate";
+            this.de_indate.OptionsColumn.AllowEdit = false;
             this.de_indate.Visible = true;
             this.de_indate.VisibleIndex = 4;
             // 
@@ -619,7 +632,7 @@ namespace UAS_PLCDataReader
             this.de_spec.FieldName = "DE_SPEC";
             this.de_spec.Name = "de_spec";
             this.de_spec.Visible = true;
-            this.de_spec.VisibleIndex = 7;
+            this.de_spec.VisibleIndex = 8;
             // 
             // de_inman
             // 
@@ -627,7 +640,7 @@ namespace UAS_PLCDataReader
             this.de_inman.FieldName = "DE_INMAN";
             this.de_inman.Name = "de_inman";
             this.de_inman.Visible = true;
-            this.de_inman.VisibleIndex = 8;
+            this.de_inman.VisibleIndex = 9;
             // 
             // de_vendcode
             // 
@@ -641,7 +654,7 @@ namespace UAS_PLCDataReader
             this.de_vendname.FieldName = "DE_VENDNAME";
             this.de_vendname.Name = "de_vendname";
             this.de_vendname.Visible = true;
-            this.de_vendname.VisibleIndex = 9;
+            this.de_vendname.VisibleIndex = 10;
             // 
             // de_address
             // 
@@ -649,7 +662,7 @@ namespace UAS_PLCDataReader
             this.de_address.FieldName = "DE_ADDRESS";
             this.de_address.Name = "de_address";
             this.de_address.Visible = true;
-            this.de_address.VisibleIndex = 10;
+            this.de_address.VisibleIndex = 11;
             // 
             // de_linecode
             // 
@@ -657,7 +670,7 @@ namespace UAS_PLCDataReader
             this.de_linecode.FieldName = "DE_LINECODE";
             this.de_linecode.Name = "de_linecode";
             this.de_linecode.Visible = true;
-            this.de_linecode.VisibleIndex = 11;
+            this.de_linecode.VisibleIndex = 12;
             // 
             // de_wccode
             // 
@@ -665,7 +678,7 @@ namespace UAS_PLCDataReader
             this.de_wccode.FieldName = "DE_WCCODE";
             this.de_wccode.Name = "de_wccode";
             this.de_wccode.Visible = true;
-            this.de_wccode.VisibleIndex = 12;
+            this.de_wccode.VisibleIndex = 13;
             // 
             // PageCommandSet
             // 
@@ -751,7 +764,8 @@ namespace UAS_PLCDataReader
             this.GridCommandSetting.Name = "GridCommandSetting";
             this.GridCommandSetting.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
             this.CheckEditCommandSet,
-            this.CommandSetRepositoryItemComboBox1});
+            this.CommandSetRepositoryItemComboBox1,
+            this.repositoryItemDateEdit1});
             this.GridCommandSetting.RowCount = 0;
             this.GridCommandSetting.Size = new System.Drawing.Size(1027, 546);
             this.GridCommandSetting.TabIndex = 1;
@@ -872,17 +886,27 @@ namespace UAS_PLCDataReader
             this.dc_man.OptionsColumn.AllowEdit = false;
             this.dc_man.Visible = true;
             this.dc_man.VisibleIndex = 8;
-            this.dc_man.Width = 217;
+            this.dc_man.Width = 151;
             // 
             // dc_date
             // 
             this.dc_date.Caption = "维护时间";
+            this.dc_date.ColumnEdit = this.repositoryItemDateEdit1;
             this.dc_date.FieldName = "DC_DATE";
             this.dc_date.Name = "dc_date";
             this.dc_date.OptionsColumn.AllowEdit = false;
             this.dc_date.Visible = true;
             this.dc_date.VisibleIndex = 9;
-            this.dc_date.Width = 52;
+            this.dc_date.Width = 118;
+            // 
+            // repositoryItemDateEdit1
+            // 
+            this.repositoryItemDateEdit1.AutoHeight = false;
+            this.repositoryItemDateEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.repositoryItemDateEdit1.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.repositoryItemDateEdit1.Name = "repositoryItemDateEdit1";
             // 
             // db_name
             // 
@@ -1623,6 +1647,8 @@ namespace UAS_PLCDataReader
             ((System.ComponentModel.ISupportInitialize)(this.GridViewCommandSet)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckEditCommandSet)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.CommandSetRepositoryItemComboBox1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemDateEdit1.CalendarTimeProperties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemDateEdit1)).EndInit();
             this.PageDeviceNetSetting.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceNetSetting)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceNetSetting)).EndInit();
@@ -1781,5 +1807,7 @@ namespace UAS_PLCDataReader
         private CustomerControl.Button.ButtonDeleteRow ButtonDeleteDevice;
         private CustomerControl.Button.ButtonSaveGrid ButtonSaveDevice;
         private DevExpress.XtraGrid.Columns.GridColumn DeviceListCheckedColumn;
+        private DevExpress.XtraGrid.Columns.GridColumn de_sourcecode;
+        private DevExpress.XtraEditors.Repository.RepositoryItemDateEdit repositoryItemDateEdit1;
     }
 }

+ 20 - 11
PLCDataReader/Main.cs

@@ -79,10 +79,10 @@ namespace UAS_PLCDataReader
         private void Main_Load(object sender, EventArgs e)
         {
             //设备列表
-            GridDeviceList.GetDataSQL = "SELECT 0 CHECKEDCOLUMN,DE_ID,DE_CODE,DE_NAME,DE_SPEC,DE_INDATE,DE_RUNSTATUS,DE_ADDRESS,DE_INMAN,DE_LINECODE,DE_WCCODE,DE_VENDCODE,DE_VENDNAME,DE_STEPCODE,DE_STEPNAME FROM DEVICE ORDER BY DE_CODE".ToUpper();
+            GridDeviceList.GetDataSQL = "SELECT 0 CHECKEDCOLUMN,DE_ID,DE_CODE,DE_NAME,DE_SPEC,DE_INDATE,DE_RUNSTATUS,DE_ADDRESS,DE_INMAN,DE_LINECODE,DE_WCCODE,DE_VENDCODE,DE_VENDNAME,DE_STEPCODE,DE_STEPNAME,DE_SOURCECODE FROM DEVICE ORDER BY DE_CODE".ToUpper();
             GridDeviceList.TableName = "device";
             GridDeviceList.ID = "de_id";
-            GridDeviceList.InsertSQL = "INSERT INTO DEVICE(DE_ID,DE_CODE,DE_NAME,DE_SPEC,DE_INDATE,DE_RUNSTATUS,DE_ADDRESS,DE_INMAN,DE_LINECODE,DE_WCCODE,DE_VENDCODE,DE_VENDNAME,DE_STEPCODE,DE_STEPNAME) VALUES(DEVICE_SEQ.NEXTVAL,:DE_CODE,:DE_NAME,:DE_SPEC,:DE_INDATE,:DE_RUNSTATUS,:DE_ADDRESS,:DE_INMAN,:DE_LINECODE,:DE_WCCODE,:DE_VENDCODE,:DE_VENDNAME,:DE_STEPCODE,:DE_STEPNAME)";
+            GridDeviceList.InsertSQL = "INSERT INTO DEVICE(DE_ID,DE_CODE,DE_NAME,DE_SPEC,DE_INDATE,DE_RUNSTATUS,DE_ADDRESS,DE_INMAN,DE_LINECODE,DE_WCCODE,DE_VENDCODE,DE_VENDNAME,DE_STEPCODE,DE_STEPNAME,DE_SOURCECODE) VALUES(DEVICE_SEQ.NEXTVAL,:DE_CODE,:DE_NAME,:DE_SPEC,:DE_INDATE,:DE_RUNSTATUS,:DE_ADDRESS,:DE_INMAN,:DE_LINECODE,:DE_WCCODE,:DE_VENDCODE,:DE_VENDNAME,:DE_STEPCODE,:DE_STEPNAME,:DE_SOURCECODE)";
             ButtonAddDevice.Grid = GridDeviceList;
             ButtonSaveDevice.Grid = GridDeviceList;
             ButtonDeleteDevice.Grid = GridDeviceList;
@@ -105,7 +105,7 @@ namespace UAS_PLCDataReader
             ButtonDeleteCommandSet.Grid = GridPollingSetting;
 
             //指令设置界面
-            GridCommandSetting.GetDataSQL = "select 0 CHECKEDCOLUMN,dc_id,dc_code,dc_name,dc_type,dc_value,dc_sendcoding,dc_receivecoding,db_name,dc_man,to_char(dc_date,'YYYY-MM-DD HH:mi:ss')dc_date from devicecommand left join devicebrand on db_code=dc_debrand".ToUpper();
+            GridCommandSetting.GetDataSQL = "select 0 CHECKEDCOLUMN,dc_id,dc_code,dc_name,dc_type,dc_value,dc_sendcoding,dc_receivecoding,db_name,dc_man,dc_date from devicecommand left join devicebrand on db_code=dc_debrand".ToUpper();
             GridCommandSetting.TableName = "devicecommand";
             GridCommandSetting.ID = "dc_id";
             GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_value,dc_debrand,dc_sendcoding,dc_receivecoding,dc_man,dc_date) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_value,'" + BaseUtil.GetComboxEditValue(Brand) + "',:dc_sendcoding,:dc_receivecoding,'" + User.UserName + "',sysdate)";
@@ -162,8 +162,11 @@ namespace UAS_PLCDataReader
             ButtonSaveDevice.DoSaveAfterHandler();
             sql.Clear();
             sql.Append("update device set de_inman='" + User.UserName + "' where de_id=:de_id");
-            dh.BatchInsert(sql.ToString(), new string[] { "de_id" }, ButtonSaveDevice.LastSaveID);
-            GridDeviceList.RefreshData();
+            if (ButtonSaveDevice.LastSaveID != null && ButtonSaveDevice.LastSaveID.Length > 0)
+            {
+                dh.BatchInsert(sql.ToString(), new string[] { "de_id" }, ButtonSaveDevice.LastSaveID);
+                GridDeviceList.RefreshData();
+            }
         }
 
         private void ComboxDeviceListWC_SelectedIndexChanged(object sender, EventArgs e)
@@ -171,7 +174,7 @@ namespace UAS_PLCDataReader
             DeviceListQuerySQL.Clear();
             string WC = BaseUtil.GetComboxEditValue(ComboxDeviceListWC);
             DeviceListQuerySQL.Append("select  0 CHECKEDCOLUMN,de_id,de_code,de_name,de_spec,de_indate,de_runstatus,de_address,de_wccode,de_inman,de_linecode");
-            DeviceListQuerySQL.Append("de_vendcode,de_vendname,de_stepcode,de_stepname from device where de_wccode='" + WC + "' order by de_code");
+            DeviceListQuerySQL.Append("de_vendcode,de_vendname,de_stepcode,de_stepname,DE_SOURCECODE from device where de_wccode='" + WC + "' order by de_code");
             sql.Clear();
             if (WC == "全部")
                 sql.Append("select li_code,li_name from line");
@@ -188,7 +191,7 @@ namespace UAS_PLCDataReader
             string WC = BaseUtil.GetComboxEditValue(ComboxDeviceListWC);
             string LC = BaseUtil.GetComboxEditValue(ComboxDeviceListLC);
             DeviceListQuerySQL.Append("select 0 CHECKEDCOLUMN,de_id,de_code,de_name,de_spec,de_indate,de_runstatus,de_address,de_wccode, ");
-            DeviceListQuerySQL.Append("de_vendcode,de_vendname,de_inman,de_linecode,de_stepcode,de_stepname from device ");
+            DeviceListQuerySQL.Append("de_vendcode,de_vendname,de_inman,de_linecode,de_stepcode,de_stepname,DE_SOURCECODE from device ");
             if (WC != "全部" && LC != "全部")
                 DeviceListQuerySQL.Append(" where de_wccode='" + WC + "' and de_linecode='" + LC + "' ");
             if (WC == "全部" && LC != "全部")
@@ -285,8 +288,11 @@ namespace UAS_PLCDataReader
             ButtonSaveCommand.DoSaveAfterHandler();
             sql.Clear();
             sql.Append("update devicecommand set dc_man='" + User.UserName + "',dc_date=sysdate where dc_id=:dc_id");
-            dh.BatchInsert(sql.ToString(), new string[] { "dc_id" }, ButtonSaveCommand.LastSaveID);
-            GridCommandSetting.RefreshData();
+            if (ButtonSaveCommand.LastSaveID != null && ButtonSaveCommand.LastSaveID.Length > 0)
+            {
+                dh.BatchInsert(sql.ToString(), new string[] { "dc_id" }, ButtonSaveCommand.LastSaveID);
+                GridCommandSetting.RefreshData();
+            }
         }
 
         /// <summary>
@@ -519,8 +525,11 @@ namespace UAS_PLCDataReader
             ButtonSaveCommandSet.DoSaveAfterHandler();
             sql.Clear();
             sql.Append("update DEVICEPOLLINGCONFIG set dpc_man='" + User.UserCode + "' where dpc_id=:dpc_id");
-            dh.BatchInsert(sql.ToString(), new string[] { "dpc_id" }, ButtonSaveCommandSet.LastSaveID);
-            GridPollingSetting.RefreshData();
+            if (ButtonSaveCommandSet.LastSaveID != null && ButtonSaveCommandSet.LastSaveID.Length > 0)
+            {
+                dh.BatchInsert(sql.ToString(), new string[] { "dpc_id" }, ButtonSaveCommandSet.LastSaveID);
+                GridPollingSetting.RefreshData();
+            }
         }
         /// <summary>
         /// 设置GridView多选放大镜

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

@@ -683,7 +683,7 @@
             this.pi_title.AutoSize = true;
             this.pi_title.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.pi_title.Location = new System.Drawing.Point(83, 41);
-            this.pi_title.MaximumSize = new System.Drawing.Size(120, 0);
+            this.pi_title.MaximumSize = new System.Drawing.Size(155, 0);
             this.pi_title.Name = "pi_title";
             this.pi_title.Size = new System.Drawing.Size(0, 20);
             this.pi_title.TabIndex = 105;
@@ -859,7 +859,7 @@
             // 
             this.label18.AutoSize = true;
             this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label18.Location = new System.Drawing.Point(63, 122);
+            this.label18.Location = new System.Drawing.Point(61, 120);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(13, 17);
             this.label18.TabIndex = 90;
@@ -893,7 +893,7 @@
             // 
             this.label16.AutoSize = true;
             this.label16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label16.Location = new System.Drawing.Point(62, 59);
+            this.label16.Location = new System.Drawing.Point(60, 57);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(13, 17);
             this.label16.TabIndex = 87;
@@ -927,7 +927,7 @@
             // 
             this.label12.AutoSize = true;
             this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label12.Location = new System.Drawing.Point(5, 96);
+            this.label12.Location = new System.Drawing.Point(3, 94);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(56, 17);
             this.label12.TabIndex = 77;
@@ -937,7 +937,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(5, 34);
+            this.label7.Location = new System.Drawing.Point(3, 32);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(56, 17);
             this.label7.TabIndex = 76;
@@ -1207,7 +1207,7 @@
             // 
             this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(97, 177);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(85, 178);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(68, 26);
@@ -1222,7 +1222,7 @@
             this.SingleLabelAutoPrint.Checked = true;
             this.SingleLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(7, 96);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(10, 97);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1280,7 +1280,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(8, 120);
+            this.label2.Location = new System.Drawing.Point(6, 118);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(32, 17);
             this.label2.TabIndex = 92;
@@ -1303,7 +1303,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(8, 153);
+            this.label5.Location = new System.Drawing.Point(6, 151);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(32, 17);
             this.label5.TabIndex = 50;
@@ -1321,7 +1321,7 @@
             // MidLabelPrint
             // 
             this.MidLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelPrint.Location = new System.Drawing.Point(96, 178);
+            this.MidLabelPrint.Location = new System.Drawing.Point(83, 178);
             this.MidLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabelPrint.Name = "MidLabelPrint";
             this.MidLabelPrint.Size = new System.Drawing.Size(68, 26);
@@ -1336,7 +1336,7 @@
             this.MidLabelAutoPrint.Checked = true;
             this.MidLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelAutoPrint.Location = new System.Drawing.Point(7, 96);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(9, 94);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1379,7 +1379,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(93, -6);
+            this.LogingOut.Location = new System.Drawing.Point(106, 7);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(42, 21);
             this.LogingOut.TabIndex = 77;
@@ -1405,7 +1405,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(12, 146);
+            this.label10.Location = new System.Drawing.Point(10, 144);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1415,7 +1415,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(12, 112);
+            this.label6.Location = new System.Drawing.Point(10, 110);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1521,18 +1521,18 @@
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).EndInit();
-            this.SingleLabel.ResumeLayout(false);
+            this.SingleLabel.ResumeLayout(true);
             this.SingleLabel.PerformLayout();
-            this.MidLabel.ResumeLayout(false);
+            this.MidLabel.ResumeLayout(true);
             this.MidLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.MidboxCapacity)).EndInit();
-            this.OutBoxLabel.ResumeLayout(false);
+            this.OutBoxLabel.ResumeLayout(true);
             this.OutBoxLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

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

@@ -245,8 +245,6 @@ namespace UAS_LabelMachine
             if (!CheckDateCode(Data["DATECODE"]))
             {
                 MessageBox.Show("物料" + Data["PRCODE"] + "【DateCode】超出校验日期");
-                Input.SelectAll();
-                return;
             }
             if (Data["PRCODE"] != CurrentPrCode)
             {
@@ -310,6 +308,11 @@ namespace UAS_LabelMachine
             {
                 pib_outboxcode2 = OutBoxNum.Text;
             }
+            if (OutBoxNum.Text == "全部")
+            {
+                MessageBox.Show("请选择指定箱号或者新增");
+                return;
+            }
             //计算当前采集数量
             string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
             double CollectQty = (collectqty == "" ? 0 : double.Parse(collectqty));
@@ -387,7 +390,23 @@ namespace UAS_LabelMachine
                 }
             }
             Input.Clear();
-            OutBoxNum_Click(new object(), new EventArgs());
+            if (OutBoxNum.Text == "新增")
+            {
+                OutBoxNum.Items.Clear();
+                DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
+                ItemObject io = new ItemObject("新增", "新增");
+                OutBoxNum.Items.Add(io);
+                io = new ItemObject("全部", "全部");
+                OutBoxNum.Items.Add(io);
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    string piboutboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
+                    io = new ItemObject(piboutboxcode2, piboutboxcode2);
+                    OutBoxNum.Items.Add(io);
+                }
+                if (OutBoxNum.Items.Count > 2)
+                    OutBoxNum.SelectedIndex = 2;
+            }
         }
 
         private void AutoPrintSingleLabel()
@@ -531,8 +550,8 @@ namespace UAS_LabelMachine
                     pi_date.Text = dt.Rows[0]["pi_date"].ToString();
                     PI_ID = dt.Rows[0]["pi_id"].ToString();
                     OutBoxNum_Click(new object(), new EventArgs());
-                    LoadPrcodeData();
                     LoadGridData(sender, e);
+                    LoadPrcodeData();
                     //获取条码规则
                     GetBarCodeRule(out Prefix, out Suffix, out MaxNum, out NumLength, out Radix);
                     SingleID.Clear();
@@ -853,7 +872,7 @@ namespace UAS_LabelMachine
         {
             List<string> Outboxcode = new List<string>();
             //如果未勾选箱号则对勾选的数据的箱号进行整合
-            if (OutBoxNum.Text == "" || OutBoxNum.Text == "新增")
+            if (OutBoxNum.Text == "" || OutBoxNum.Text == "全部")
             {
                 for (int i = 0; i < LabelInf.RowCount; i++)
                 {
@@ -1053,7 +1072,7 @@ namespace UAS_LabelMachine
             sql.Append("left join sale on sa_code=pib_ordercode left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pib_piid='" + PI_ID + "' ");
             sql.Append(" order by to_number(pib_outboxcode2),pib_id,pd_prodcode");
             LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            if (OutBoxNum.Text != "新增")
+            if (OutBoxNum.Text != "全部")
             {
                 BaseUtil.FillDgvWithDataTable(LabelInf, BaseUtil.filterDataTable(LabelInfDataTable, "  pib_outboxcode2='" + OutBoxNum.Text + "'"));
             }
@@ -1339,9 +1358,11 @@ namespace UAS_LabelMachine
         {
             string OutBox = OutBoxNum.Text;
             OutBoxNum.Items.Clear();
-            DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2)", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
             ItemObject io = new ItemObject("新增", "新增");
             OutBoxNum.Items.Add(io);
+            io = new ItemObject("全部", "全部");
+            OutBoxNum.Items.Add(io);
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 string pib_outboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
@@ -1349,7 +1370,12 @@ namespace UAS_LabelMachine
                 OutBoxNum.Items.Add(io);
             }
             if (OutBoxNum.Text == "新增" || OutBoxNum.Text == "")
-                OutBoxNum.SelectedIndex = OutBoxNum.Items.Count - 1;
+            {
+                if (dt.Rows.Count > 0)
+                    OutBoxNum.SelectedIndex = 2;
+                else
+                    OutBoxNum.SelectedIndex = 0;
+            }
             if (OutBox != "新增" && OutBox != "")
                 OutBoxNum.Text = OutBox;
         }
@@ -1593,11 +1619,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void OutBoxNum_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            LoadGridData(sender, e);
-        }
-
         private void Pack_Click(object sender, EventArgs e)
         {
             if (LabelInf.Rows.Count > 0)
@@ -1721,5 +1742,10 @@ namespace UAS_LabelMachine
                 SelectRowIndex = e.RowIndex;
             }
         }
+
+        private void OutBoxNum_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            LoadGridData(sender, e);
+        }
     }
 }