645 lines
		
	
	
		
			24 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			645 lines
		
	
	
		
			24 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | using System.Collections.Generic; | |||
|  | using System.ComponentModel; | |||
|  | using System.Data; | |||
|  | using System.Drawing; | |||
|  | using System.Text; | |||
|  | using System.Linq; | |||
|  | using System.Windows.Forms; | |||
|  | using DevExpress.XtraBars; | |||
|  | using DevExpress.XtraGrid.Views.Base; | |||
|  | //using DeiNiu.wms.Logical; | |||
|  | using DeiNiu.wms.Data; | |||
|  | using DevExpress.XtraGrid.Columns; | |||
|  |   | |||
|  | using System.Threading; | |||
|  | using DevExpress.XtraGrid.Views.Grid; | |||
|  | using DevExpress.XtraEditors.DXErrorProvider; | |||
|  | using DeiNiu.wms.Data.Model; | |||
|  | using DevExpress.XtraEditors; | |||
|  | using DevExpress.XtraEditors.Controls; | |||
|  | using DeiNiu.Utils; | |||
|  | using DevExpress.XtraEditors.Repository; | |||
|  |  // using DeiNiu.wms.win.ServiceReferenceOutRequest; //远程 | |||
|  |   using DeiNiu.wms.win.ServiceReferenceStockOutRequest; | |||
|  | using DeiNiu.wms.win.ServiceReferenceStockOutPickRequest; | |||
|  | using Deiniu.win.elelab; | |||
|  | using DNLightSvr; | |||
|  | using System.ServiceModel; | |||
|  | using System.ServiceModel.Description;  //开发环境 | |||
|  | using DeiNiu.wms.win.utils.print; | |||
|  | //  using DeiNiu.wms.win.ServiceReferenceOutRequestLocal;//本地 | |||
|  | 
 | |||
|  | namespace DeiNiu.wms.win | |||
|  | { | |||
|  |     public partial class GoodsOutPickOrderPrint : BasicRibbonForm | |||
|  |     { | |||
|  |         | |||
|  |           | |||
|  |     | |||
|  |         public GoodsOutPickOrderPrint() | |||
|  |         {  | |||
|  |            | |||
|  |             InitializeComponent(); | |||
|  |             initialControls(); | |||
|  |       | |||
|  |             isLoading = false; | |||
|  |              | |||
|  |           | |||
|  |         } | |||
|  |         #region initialControls | |||
|  |         bool isLoading = true; | |||
|  |         private void initialControls() | |||
|  |         { | |||
|  |             dateEditFrom.EditValue = DateTime.Now; | |||
|  |             try | |||
|  |             { | |||
|  |                 initialComboBoxes(); | |||
|  |             } | |||
|  |             catch | |||
|  |             { | |||
|  | 
 | |||
|  |             } | |||
|  |             | |||
|  |            // initialPagerControls(); | |||
|  |             initialDataGrid(); | |||
|  |             initialQueryInput();  | |||
|  |             setValidationRule(); | |||
|  |            | |||
|  |             | |||
|  |         } | |||
|  |         private void initialComboBoxes() | |||
|  |         { | |||
|  | 
 | |||
|  |          | |||
|  |   | |||
|  |             Node[] nds = { }; | |||
|  | 
 | |||
|  |             DataRow[] drs = Park.getDictionary(true).Select("flag >0"); | |||
|  |             foreach (DataRow dr in drs) | |||
|  |             { | |||
|  |                 int flag = Convert.ToInt32(dr["flag"].ToString()); | |||
|  |                 int parentId = Convert.ToInt32(dr["id"].ToString()); | |||
|  |                 DataRow[] drss = Park.getDictionary(false).Select("parentId =" + parentId); | |||
|  |                 switch (flag) | |||
|  |                 { | |||
|  |                     case 2005: | |||
|  |                         initialComboBoxs(this.comPartQuery, drss);//分区 | |||
|  |                         break; | |||
|  | 
 | |||
|  |                     case 3001: | |||
|  |                         initialComboBoxsByValue(this.comLine, drss ,3);//线路 | |||
|  |                         break; | |||
|  |                     case 2001: | |||
|  |                         | |||
|  |                         initialComboBoxs(this.comWarehouseQuery, drss);//库房 | |||
|  |                         break; | |||
|  | 
 | |||
|  |                 } | |||
|  | 
 | |||
|  |             } | |||
|  | 
 | |||
|  |         } | |||
|  | 
 | |||
|  | 
 | |||
|  |         protected void initialComboBoxsByValue(ComboBoxEdit combo, DataRow[] drss, int itemCnt, bool isForQuery = true,string title = "请选择") | |||
|  |         { | |||
|  |             combo.Properties.TextEditStyle = TextEditStyles.DisableTextEditor; | |||
|  |             combo.Properties.Items.Clear(); | |||
|  |             List<Node> nds = new List<Node>(); | |||
|  | 
 | |||
|  |             foreach (DataRow dr in drss) | |||
|  |             { | |||
|  |                 nds.Add(new Node(dr)); | |||
|  |             } | |||
|  | 
 | |||
|  |             ComboBoxItemCollection coll = combo.Properties.Items; | |||
|  |             coll.BeginUpdate(); | |||
|  |             int i = 0; | |||
|  |             if (isForQuery) | |||
|  |             { | |||
|  |                 coll.Add(title); | |||
|  |                 i++; | |||
|  |             } | |||
|  |             try | |||
|  |             { | |||
|  |                 | |||
|  | 
 | |||
|  |                 foreach (Node nd in nds) | |||
|  |                 { | |||
|  |                     | |||
|  |                     coll.Add(nd); | |||
|  |                     if(i > itemCnt) | |||
|  |                     { | |||
|  |                         break; | |||
|  |                     }  | |||
|  |                     i++; | |||
|  |                 } | |||
|  |             } | |||
|  |             finally | |||
|  |             { | |||
|  |                 coll.EndUpdate(); | |||
|  |             } | |||
|  |             combo.SelectedIndex = 0; | |||
|  | 
 | |||
|  |         } | |||
|  | 
 | |||
|  |         | |||
|  | 
 | |||
|  |           | |||
|  |         | |||
|  |            | |||
|  |       | |||
|  |        | |||
|  |         private void setValidationRule() | |||
|  |         { | |||
|  |           //  dxValidationProvider.SetValidationRule(comWarehouse, ValidationRules.notEmptyValidationRule); | |||
|  |             //txtGoodType.Properties.MaxLength = 40; | |||
|  |             //txtGoodDesc.Properties.MaxLength = 250; | |||
|  |             //textEdit1.Properties.MaxLength = txtGoodType.Properties.MaxLength; | |||
|  |         } | |||
|  | 
 | |||
|  |         private void initialQueryInput() | |||
|  |         { | |||
|  | 
 | |||
|  |         } | |||
|  | 
 | |||
|  |         private void initialGridView2Columns(GridView gridview) | |||
|  |         { | |||
|  |             setupGridView(gridview, false, true, false); | |||
|  |             gridview.FocusRectStyle = DrawFocusRectStyle.None; | |||
|  |             //   gridviewGoodsType.PopulateColumns(); | |||
|  |             gridview.Columns.Clear(); | |||
|  |             // gridviewGoodsType.Columns.Remove(gridviewGoodsType.Columns["DealerPrice"]);  | |||
|  |             GridColumn myCol0 = new GridColumn() { Caption = "ID", Visible = true, FieldName = "id" }; | |||
|  |             myCol0.Visible = false; | |||
|  |             gridview.Columns.Add(myCol0);  | |||
|  |             GridColumn myCol1 = new GridColumn() { Caption = "商品名称", Visible = true, FieldName = WmsGoods.exfields.goodsName.ToString() }; | |||
|  |             GridColumn myCol2 = new GridColumn() { Caption = "货位", Visible = true, FieldName = WmsOutPickLable.fields.locationId.ToString() }; | |||
|  |             GridColumn myCol3 = new GridColumn() { Caption = "状态", Visible = true, FieldName = "state" }; | |||
|  |             | |||
|  |             GridColumn myCol5 = new GridColumn() { Caption = "拣货件数", Visible = true, FieldName = "pcs" }; | |||
|  |             GridColumn myCol6 = new GridColumn() { Caption = "单位", Visible = true, FieldName = WmsGoods.exfields.unit.ToString() }; | |||
|  |      | |||
|  |             GridColumn myCol8 = new GridColumn() { Caption = "分拣单", Visible = true, FieldName = "pickOrderNo" }; | |||
|  |             GridColumn myCol9 = new GridColumn() { Caption = "集货区", Visible = true, FieldName = "tranAreaName" }; | |||
|  |   | |||
|  |             GridColumn myCol14 = new GridColumn() { Caption = "货位分区", Visible = true, FieldName = "partName2" }; | |||
|  |             GridColumn myCol15 = new GridColumn() { Caption = "波次号", Visible = true, FieldName = "waveOrder" }; | |||
|  |             GridColumn myCol16 = new GridColumn() { Caption = "任务编号", Visible = true, FieldName = "jobNo" }; | |||
|  |             GridColumn myCol21 = new GridColumn() { Caption = "客户", Visible = true, FieldName = "customerName" }; | |||
|  |             GridColumn myCol22 = new GridColumn() { Caption = "线路", Visible = true, FieldName = "lineName" }; | |||
|  |             GridColumn myCol23 = new GridColumn() { Caption = "sku", Visible = true, FieldName = "skus" }; | |||
|  | 
 | |||
|  |             GridColumn myCol24 = new GridColumn() { Caption = "分拣任务", Visible = true, FieldName = "jobNo" }; | |||
|  | 
 | |||
|  | 
 | |||
|  |             //  gridview.Columns.Add(myCol24); | |||
|  |             // gridview.Columns.Add(myCol1); | |||
|  |             // gridview.Columns.Add(myCol2); | |||
|  |             //   gridview.Columns.Add(myCol3); | |||
|  |             //gridview.Columns.Add(myCol3); | |||
|  |            | |||
|  |             gridview.Columns.Add(myCol21); | |||
|  |             gridview.Columns.Add(myCol5); | |||
|  |          | |||
|  |             //gridview.Columns.Add(myCol6); | |||
|  |             gridview.Columns.Add(myCol23);  | |||
|  |               gridview.Columns.Add(myCol24); | |||
|  |             gridview.Columns.Add(myCol8); | |||
|  |             gridview.Columns.Add(myCol9); | |||
|  |             gridview.Columns.Add(myCol14);   | |||
|  |              | |||
|  |             gridview.Columns.Add(myCol22); | |||
|  |              | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  |             //to show bottom scroll bar | |||
|  |             gridview.OptionsView.ColumnAutoWidth = false; | |||
|  |             gridview.BestFitColumns(); | |||
|  |             //  gridView2.Focus(); | |||
|  |         } | |||
|  | 
 | |||
|  |         private void initialGridView3Columns(GridView gridview) | |||
|  |         {  | |||
|  |             { | |||
|  |                 setupGridView(gridview, true, true, false); | |||
|  |             } | |||
|  |             gridview.FocusRectStyle = DrawFocusRectStyle.None; | |||
|  |             //   gridviewGoodsType.PopulateColumns(); | |||
|  |             gridview.Columns.Clear(); | |||
|  |             // gridviewGoodsType.Columns.Remove(gridviewGoodsType.Columns["DealerPrice"]);  | |||
|  |             GridColumn myCol0 = new GridColumn() { Caption = "ID", Visible = true, FieldName = "id" }; | |||
|  |             myCol0.Visible = false; | |||
|  |             gridview.Columns.Add(myCol0); | |||
|  |             GridColumn myCol011 = new GridColumn() { Caption = "分区", Visible = true, FieldName = "partName" }; | |||
|  |             gridview.Columns.Add(myCol011); | |||
|  |              | |||
|  | 
 | |||
|  |             GridColumn myCol1 = new GridColumn() { Caption = "商品编码", Visible = true, FieldName = WmsGoods.fields.goodsId.ToString() }; | |||
|  |             GridColumn myCol2 = new GridColumn() { Caption = "商品名称", Visible = true, FieldName = WmsGoods.exfields.goodsName.ToString() }; | |||
|  |             GridColumn myCol3 = new GridColumn() { Caption = "厂家", Visible = true, FieldName = WmsGoods.exfields.manufacturer.ToString() }; | |||
|  |             GridColumn myCol4 = new GridColumn() { Caption = "规格", Visible = true, FieldName = WmsGoods.exfields.spec.ToString() }; | |||
|  |             GridColumn myCol5 = new GridColumn() { Caption = "单位", Visible = true, FieldName = "minOperateUnit" }; | |||
|  |            // GridColumn myCol6 = new GridColumn() { Caption = "大包装数量", Visible = true, FieldName = WmsGoods.exfields.bigCount.ToString() }; | |||
|  |             GridColumn myCol7 = new GridColumn() { Caption = "剂型", Visible = true, FieldName = WmsGoods.exfields.type.ToString() }; | |||
|  |             GridColumn myCol8 = new GridColumn() { Caption = "商品类型", Visible = true, FieldName = WmsGoods.exfields.goodsTypeName.ToString() }; | |||
|  |             //  GridColumn myCol9 = new GridColumn() { Caption = "大零", Visible = true, FieldName = WmsGoods.fields.bulkMax.ToString() }; | |||
|  |             //    GridColumn myCol10 = new GridColumn() { Caption = "小整", Visible = true, FieldName = WmsGoods.fields.batchMax1.ToString() }; | |||
|  |             //    GridColumn myCol11 = new GridColumn() { Caption = "大整", Visible = true, FieldName = WmsGoods.fields.batchMax2.ToString() }; | |||
|  |             GridColumn myCol12 = new GridColumn() { Caption = "国药准字", Visible = true, FieldName = WmsGoods.exfields.regeditCode.ToString() }; | |||
|  | 
 | |||
|  |             GridColumn myCol100 = new GridColumn() { Caption = "数量", Visible = true, FieldName = WmsOutDetail.fields.count.ToString() }; | |||
|  |             GridColumn myCol101 = new GridColumn() { Caption = "件数", Visible = true, FieldName = WmsOutDetail.fields.count.ToString() }; | |||
|  |            // GridColumn myCol102 = new GridColumn() { Caption = "整货", Visible = true, FieldName = WmsOutDetail.fields.batch1Count.ToString() }; | |||
|  |            // GridColumn myCol103 = new GridColumn() { Caption = "大整", Visible = true, FieldName = WmsOutDetail.fields.batch2Count.ToString() }; | |||
|  |           //  GridColumn myCol104 = new GridColumn() { Caption = "箱", Visible = true, FieldName = WmsOutDetail.fields.boxcnt.ToString() }; | |||
|  |             GridColumn myCol14 = new GridColumn() { Caption = "批号", Visible = true, FieldName = WmsOutDetail.fields.batch.ToString() }; | |||
|  |             GridColumn myCol15 = new GridColumn() { Caption = "生产日期", Visible = true, FieldName = WmsOutDetail.fields.productDate.ToString() }; | |||
|  |             GridColumn myCol16 = new GridColumn() { Caption = "有效期", Visible = true, FieldName = WmsOutDetail.fields.validDate.ToString() }; | |||
|  | 
 | |||
|  |             GridColumn myCol17 = new GridColumn() { Caption = "状态", Visible = true, FieldName = WmsOutDetail.fields.state.ToString() }; | |||
|  |             GridColumn myCol18 = new GridColumn() { Caption = "说明", Visible = true, FieldName = WmsOutDetail.fields.description.ToString() }; | |||
|  | 
 | |||
|  | 
 | |||
|  |             GridColumn myCol20 = new GridColumn() { Caption = "波次", Visible = true, FieldName = WmsOutPickLable.fields.dpsOrder.ToString() }; | |||
|  |             GridColumn myCol21 = new GridColumn() { Caption = "颜色", Visible = true, FieldName = "colorName" }; | |||
|  |             GridColumn myCol22 = new GridColumn() { Caption = "货位", Visible = true, FieldName = WmsOutPickLable.fields.locationId.ToString() }; | |||
|  |             GridColumn myCol23 = new GridColumn() { Caption = "标签", Visible = true, FieldName = WmsOutPickLable.fields.elabId.ToString() }; | |||
|  |             GridColumn myCol24 = new GridColumn() { Caption = "客户", Visible = true, FieldName = WmsOutPickRequest.fields.customerName.ToString() }; | |||
|  |             GridColumn myCol25 = new GridColumn() { Caption = "出库单", Visible = true, FieldName = WmsOutPickRequest.fields.pickOrderNo.ToString() }; | |||
|  |             GridColumn myCol26 = new GridColumn() { Caption = "复核异常", Visible = true, FieldName = "exception" }; | |||
|  |             GridColumn myCol27 = new GridColumn() { Caption = "复核数量", Visible = true, FieldName = WmsOutPickDetail.fields.confirmedCount.ToString() }; | |||
|  |             GridColumn myCol28 = new GridColumn() { Caption = "说明", Visible = true, FieldName = WmsOutPickDetail.fields.validRemark.ToString() }; | |||
|  |             GridColumn myCol281 = new GridColumn() { Caption = "复核台", Visible = true, FieldName = "desk" }; | |||
|  | 
 | |||
|  |             GridColumn myCol29 = new GridColumn() { Caption = "标签点亮", Visible = true, FieldName = "isLightUp" }; | |||
|  |             GridColumn myCol30 = new GridColumn() { Caption = "拣货状态", Visible = true, FieldName = "isPicked" }; | |||
|  | 
 | |||
|  |             GridColumn myCol31 = new GridColumn() { Caption = "输送口", Visible = true, FieldName = "desk" }; | |||
|  |             //GridColumn myCol32 = new GridColumn() { Caption = "库区", Visible = true, FieldName = "partName" }; | |||
|  | 
 | |||
|  | 
 | |||
|  |             RepositoryItemImageComboBox repositoryImageComboBox2 = new RepositoryItemImageComboBox();//新建一个RepositoryItemImageComboBox   | |||
|  |             repositoryImageComboBox2.GlyphAlignment = DevExpress.Utils.HorzAlignment.Center; | |||
|  |             repositoryImageComboBox2.SmallImages = imageList1; //指定一组图片   | |||
|  |             string[] s = new String[] {"1","0"}; | |||
|  |             for (int i = 0; i < s.Length; i++) | |||
|  |                 repositoryImageComboBox2.Items.Add(new ImageComboBoxItem(s[i], i + 1, i));//对应值绑定对应的图片   | |||
|  |             RepositoryItem ri = repositoryImageComboBox2 as RepositoryItem; | |||
|  |               | |||
|  |             myCol29.ColumnEdit = ri;      //绑定到GridColumn   | |||
|  | 
 | |||
|  |             myCol30.ColumnEdit = ri; | |||
|  | 
 | |||
|  |               | |||
|  |             gridview.Columns.Add(myCol24);   | |||
|  |             gridview.Columns.Add(myCol22); | |||
|  | 
 | |||
|  |             if (WmsConstants.OUT_LIGHT_ENABLE) | |||
|  |             { | |||
|  |                 gridview.Columns.Add(myCol29); | |||
|  |                 gridview.Columns.Add(myCol30); | |||
|  |             } | |||
|  |             gridview.Columns.Add(myCol2); | |||
|  |         | |||
|  |       | |||
|  |     | |||
|  |             | |||
|  |             gridview.Columns.Add(myCol23); | |||
|  |         | |||
|  |             gridview.Columns.Add(myCol101); | |||
|  |             gridview.Columns.Add(myCol5); | |||
|  |           //  gridview.Columns.Add(myCol17); | |||
|  |                gridview.Columns.Add(myCol15); | |||
|  |           | |||
|  |               gridview.Columns.Add(myCol4); | |||
|  | 
 | |||
|  |              gridview.Columns.Add(myCol14); | |||
|  |             gridview.Columns.Add(myCol3); | |||
|  |             gridview.Columns.Add(myCol16); | |||
|  |            | |||
|  |             gridview.Columns.Add(myCol8); | |||
|  |             //gridview.Columns.Add(myCol9); | |||
|  |                gridview.Columns.Add(myCol31); | |||
|  |             gridview.Columns.Add(myCol20); | |||
|  |             //   gridview.Columns.Add(myCol6); | |||
|  |               | |||
|  |          | |||
|  |             gridview.Columns.Add(myCol21); | |||
|  |            // gridview.Columns.Add(myCol12); | |||
|  |             gridview.Columns.Add(myCol1); | |||
|  |            | |||
|  |             gridview.Columns.Add(myCol18); | |||
|  |             //to show bottom scroll bar | |||
|  |             gridview.OptionsView.ColumnAutoWidth = false; | |||
|  |              | |||
|  |             gridview.Columns.Add(myCol3);  | |||
|  |             //  gridView2.Focus(); | |||
|  |             gridview.BestFitColumns(); | |||
|  |         } | |||
|  | 
 | |||
|  |         #endregion | |||
|  | 
 | |||
|  |         | |||
|  |           | |||
|  |         private void initialDataGrid() | |||
|  |         { | |||
|  | 
 | |||
|  |              | |||
|  |             this.gridView2.IndicatorWidth = 40; | |||
|  |             this.gridView2.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator); | |||
|  | 
 | |||
|  |             | |||
|  |             this.gridView1.IndicatorWidth = 40; | |||
|  |             this.gridView1.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator); | |||
|  | 
 | |||
|  |             //this.gridView3.IndicatorWidth = 40; | |||
|  |             //this.gridView3.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView_CustomDrawRowIndicator); | |||
|  | 
 | |||
|  |         } | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  |         private void gridView2_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) | |||
|  |         { | |||
|  | 
 | |||
|  |             if (sender == gridView2) | |||
|  |             { | |||
|  | 
 | |||
|  |                 if (e.Column.FieldName == "state") | |||
|  |                 { | |||
|  |                    | |||
|  |                     switch (e.DisplayText) | |||
|  |                     { | |||
|  |                         case "1" : | |||
|  |                             e.DisplayText = "已出货"; | |||
|  |                             break; | |||
|  |                         case "0": | |||
|  |                             e.DisplayText = "待出货"; | |||
|  | 
 | |||
|  |                             break; | |||
|  |                         case "2": | |||
|  |                             e.DisplayText = "出现错误"; | |||
|  |                             break; | |||
|  |                         case "": | |||
|  |                             e.DisplayText = "待出货"; | |||
|  |                             break; | |||
|  |                         //default:  | |||
|  |                         //    e.DisplayText = "未分配货位"; | |||
|  |                     } | |||
|  |                 } | |||
|  |             } | |||
|  |         } | |||
|  |   | |||
|  | 
 | |||
|  |        void gridView_RowCellStyle(object sender,DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e) | |||
|  |        { | |||
|  | 
 | |||
|  |             var currentView = sender as GridView; | |||
|  |            if( currentView == null){return;} | |||
|  |            string state = currentView.GetDataRow(e.RowHandle)["priority"].ToString().Trim(); | |||
|  |             | |||
|  |            if (state == "0") | |||
|  |            { | |||
|  |                return; | |||
|  |            } | |||
|  | 
 | |||
|  |            bool isFocused = e.RowHandle == currentView.FocusedRowHandle; | |||
|  |            DevExpress.Utils.AppearanceDefault rowStyle = null; | |||
|  |             DevExpress.Utils.AppearanceDefault appBlueRed =  | |||
|  |                new DevExpress.Utils.AppearanceDefault (Color.White, Color.Red, Color.Empty, Color.Blue, System.Drawing.Drawing2D.LinearGradientMode.Horizontal); | |||
|  |            DevExpress.Utils.AppearanceDefault appYB = | |||
|  |             new DevExpress.Utils.AppearanceDefault(Color.White, Color.Red, Color.Green); | |||
|  | 
 | |||
|  |            DevExpress.Utils.AppearanceDefault alertFocus = new DevExpress.Utils.AppearanceDefault(Color.White, Color.Red, Color.Green,  Color.Yellow); | |||
|  |            DevExpress.Utils.AppearanceDefault alert  = new DevExpress.Utils.AppearanceDefault(Color.Red, Color.White ); | |||
|  | 
 | |||
|  |            DevExpress.Utils.AppearanceDefault highPriorityFocus = new DevExpress.Utils.AppearanceDefault(Color.White, Color.Green); | |||
|  |            DevExpress.Utils.AppearanceDefault highPriority = new DevExpress.Utils.AppearanceDefault(Color.Green, Color.White); | |||
|  | 
 | |||
|  |            if (state == "1") | |||
|  |            { | |||
|  |                rowStyle = isFocused ? highPriorityFocus : highPriority; | |||
|  |            } | |||
|  |            else if (state == "2") | |||
|  |            { | |||
|  |                rowStyle = isFocused ? alertFocus : alert; | |||
|  |            } | |||
|  | 
 | |||
|  |              | |||
|  |            DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, rowStyle); | |||
|  |            /* | |||
|  |            if (sender == this.gridView2) | |||
|  |            { | |||
|  |                if (this.gridView2.GetDataRow(e.RowHandle)["state"].ToString().Trim() == "2") | |||
|  |                { | |||
|  |                    DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, alert); | |||
|  |                } | |||
|  |            }else if(sender == this.gridView1){ | |||
|  |                  | |||
|  |                if ( state == "2") | |||
|  |                { | |||
|  |                    if (currentView != null && e.RowHandle == currentView.FocusedRowHandle) | |||
|  |                    { | |||
|  |                        DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, alertFocus); | |||
|  |                    } | |||
|  |                    else | |||
|  |                    { | |||
|  |                        DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, alert); | |||
|  |                    } | |||
|  |                } | |||
|  |                else if (state == "1") | |||
|  |                { | |||
|  |                    DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, passed); | |||
|  |                }  | |||
|  |            } | |||
|  |            */ | |||
|  |        } | |||
|  | 
 | |||
|  |        /* | |||
|  |         private void setCurrentRequestDetail() | |||
|  |         { | |||
|  |             if (!getCurrentObject() || selectedRequest == null ) | |||
|  |             { | |||
|  |                 return; | |||
|  |             } | |||
|  |   | |||
|  |             showWaitForm(); | |||
|  | 
 | |||
|  |             try | |||
|  |             { | |||
|  | 
 | |||
|  |     | |||
|  |             } | |||
|  |             catch (Exception e) | |||
|  |             { | |||
|  |                 showErrorMsg(e.Message); | |||
|  |             } | |||
|  |             closeWaitForm(); | |||
|  | 
 | |||
|  |         } | |||
|  |         */ | |||
|  | 
 | |||
|  |          | |||
|  |   | |||
|  | 
 | |||
|  |         /* | |||
|  |         private void btnNewWave_Click(object sender, EventArgs e) | |||
|  |         { | |||
|  |             clearWaveData(); | |||
|  |             btnNewWave.Enabled = false; | |||
|  |             newWave(); | |||
|  |         } | |||
|  |          | |||
|  |         */ | |||
|  |    | |||
|  | 
 | |||
|  |         //-------------below moved from logic layer | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  |         WmsOutPickRequest outRequest = new WmsOutPickRequest(); | |||
|  |         WmsStockRecord stkRecord = new WmsStockRecord(); | |||
|  |         WmsOutPickLable pickLabelDetail = new WmsOutPickLable(); | |||
|  | 
 | |||
|  | 
 | |||
|  |          /// <summary> | |||
|  |         /// 点亮待拣选标签 | |||
|  |         /// </summary> | |||
|  |         private void lightLablesInSvc() | |||
|  |         { | |||
|  |             pickClient.lightLables(); | |||
|  |             closeClient(); | |||
|  |         } | |||
|  | 
 | |||
|  |         | |||
|  |         private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) | |||
|  |         { | |||
|  |             if (string.IsNullOrEmpty(e.DisplayText)) | |||
|  |             { | |||
|  |                 return; | |||
|  |             } | |||
|  | 
 | |||
|  |             if (e.Column.FieldName == WmsOutPickRequest.fields.priority.ToString()) | |||
|  |             { | |||
|  | 
 | |||
|  |                 if (!pickDetailStatus.ContainsValue(e.DisplayText)) | |||
|  |                 { | |||
|  | 
 | |||
|  |                     int display = -100; | |||
|  |                     string disTxt = e.DisplayText; | |||
|  | 
 | |||
|  |                     try | |||
|  |                     { | |||
|  |                         display = Convert.ToInt32(e.DisplayText); | |||
|  | 
 | |||
|  |                         e.DisplayText = this.pickPriority[display]; | |||
|  | 
 | |||
|  |                     } | |||
|  |                     catch | |||
|  |                     { | |||
|  |                         return; | |||
|  |                     } | |||
|  | 
 | |||
|  |                 } | |||
|  | 
 | |||
|  | 
 | |||
|  |                 //    e.DisplayText = pickDetailStatus.ContainsKey(display) ? pickDetailStatus[display] : display+""; | |||
|  | 
 | |||
|  |             } | |||
|  |               | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  |         } | |||
|  |          | |||
|  |       | |||
|  |           | |||
|  | 
 | |||
|  |         //---print .... | |||
|  | 
 | |||
|  |   | |||
|  |         private void simpleButton1_Click(object sender, EventArgs e) | |||
|  |         { | |||
|  |             queryTasks(); | |||
|  |         } | |||
|  | 
 | |||
|  |         string lastQuery; | |||
|  |         private void queryTasks() | |||
|  |         { | |||
|  |             try | |||
|  |             {   | |||
|  |                 this.gridControl1.DataSource =getTasks();    | |||
|  |                 closeClient(); | |||
|  |                 initialGridView2Columns(gridView1); | |||
|  | 
 | |||
|  |                 closeWaitForm(); | |||
|  |               | |||
|  | 
 | |||
|  |             } | |||
|  |             catch (Exception e) | |||
|  |             { | |||
|  |                 showErrorMsg(e, e.Message); | |||
|  |             } | |||
|  | 
 | |||
|  |             closeWaitForm(); | |||
|  |         } | |||
|  | 
 | |||
|  |         private void btnPrintCode_Click(object sender, EventArgs e) | |||
|  |         { | |||
|  |             | |||
|  |             showWaitForm(); | |||
|  |             DataTable dtPrint = null; | |||
|  |             try | |||
|  |             { | |||
|  | 
 | |||
|  |                 printIn reqportPrint = new printIn();  | |||
|  |            | |||
|  |                 dtPrint = getTasks(); | |||
|  |                 reqportPrint.printSeedsLightCode(dtPrint); | |||
|  |                 closeClient(); | |||
|  | 
 | |||
|  |             } | |||
|  |             catch (Exception er) | |||
|  |             { | |||
|  |                 showErrorMsg(er, er.Message); | |||
|  |                 closeClient(); | |||
|  |             } | |||
|  |             closeWaitForm(); | |||
|  |             if (dtPrint == null || dtPrint.Rows.Count == 0) | |||
|  |             { | |||
|  |                | |||
|  |                 // showErrorMsg("没有任务需要打印"); | |||
|  |                 return; | |||
|  |             } | |||
|  | 
 | |||
|  | 
 | |||
|  |         } | |||
|  | 
 | |||
|  |         DataTable getTasks() | |||
|  |         { | |||
|  |             int partion = this.comPartQuery.SelectedIndex == 0 ? 0 : ((Node)this.comPartQuery.SelectedItem).ID; | |||
|  |             int lineId = this.comLine.SelectedIndex == 0 ? 0 : ((Node)this.comLine.SelectedItem).ID; | |||
|  |             int wareHouse = this.comWarehouseQuery.SelectedIndex == 0 ? 0 : ((Node)this.comWarehouseQuery.SelectedItem).ID; | |||
|  |             string custName = filtRiskChar( txtCutName.Text); | |||
|  |             string date = string.Format("{0}-{1:D2}-{2:D}", dateEditFrom.DateTime.Year, dateEditFrom.DateTime.Month, dateEditFrom.DateTime.Day); | |||
|  |             string query =  this.txtCutName.Text.Trim().Length == 0 ? "" : string.Format("{0} like # '%{1}%';", "customerName", filtRiskChar(txtCutName.Text.Trim())); | |||
|  | 
 | |||
|  |             return pickClient.getLightTasks(query,wareHouse,partion, lineId, 0, date,chkLight.Checked); | |||
|  |         } | |||
|  | 
 | |||
|  |         private void btnChck_Click(object sender, EventArgs e) | |||
|  |         { | |||
|  | 
 | |||
|  |         } | |||
|  | 
 | |||
|  |          | |||
|  | 
 | |||
|  | 
 | |||
|  |     } | |||
|  | } |