From b1375c708e0a2a111a7d0a9ddf4e08c8bceb078d Mon Sep 17 00:00:00 2001 From: wyf Date: Thu, 17 Jul 2025 14:40:21 +0000 Subject: [PATCH] SVN r876 SVN-Revision: r876 --- 插件库/Lskj.Control/AuditPanel2.Designer.cs | 149 +++-- 插件库/Lskj.Control/AuditPanel2.cs | 623 +++++++++++++++++++- 2 files changed, 713 insertions(+), 59 deletions(-) diff --git a/插件库/Lskj.Control/AuditPanel2.Designer.cs b/插件库/Lskj.Control/AuditPanel2.Designer.cs index 6ad9cc5..866cd8d 100644 --- a/插件库/Lskj.Control/AuditPanel2.Designer.cs +++ b/插件库/Lskj.Control/AuditPanel2.Designer.cs @@ -28,10 +28,9 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); this.dpb_Tools = new DevExpress.XtraEditors.DropDownButton(); - this.pMenu = new DevExpress.XtraBars.PopupMenu(this.components); - this.barManager1 = new DevExpress.XtraBars.BarManager(this.components); + this.pMenu = new DevExpress.XtraBars.PopupMenu(); + this.barManager1 = new DevExpress.XtraBars.BarManager(); this.barDockControlTop = new DevExpress.XtraBars.BarDockControl(); this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl(); this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl(); @@ -41,10 +40,11 @@ this.btnSave = new DevExpress.XtraEditors.SimpleButton(); this.btnAccradit = new DevExpress.XtraEditors.SimpleButton(); this.btnPrint = new DevExpress.XtraEditors.DropDownButton(); - this.pMprint = new DevExpress.XtraBars.PopupMenu(this.components); + this.pMprint = new DevExpress.XtraBars.PopupMenu(); this.btnAttach = new DevExpress.XtraEditors.SimpleButton(); this.btnSpare = new DevExpress.XtraEditors.SimpleButton(); this.pcTool = new DevExpress.XtraEditors.PanelControl(); + this.dbpFP = new DevExpress.XtraEditors.DropDownButton(); this.simpleButton2 = new DevExpress.XtraEditors.SimpleButton(); this.btnAdditional = new DevExpress.XtraEditors.SimpleButton(); this.btnRecord = new DevExpress.XtraEditors.SimpleButton(); @@ -68,6 +68,12 @@ this.gcDetail = new Lskj.Control.GridControlEx(); this.pcBillMain = new DevExpress.XtraEditors.XtraScrollableControl(); this.txt_billDocumentId = new Lskj.Control.LabelTextEdit(); + this.pmFP = new DevExpress.XtraBars.PopupMenu(); + this.barManager2 = new DevExpress.XtraBars.BarManager(); + this.barDockControl1 = new DevExpress.XtraBars.BarDockControl(); + this.barDockControl2 = new DevExpress.XtraBars.BarDockControl(); + this.barDockControl3 = new DevExpress.XtraBars.BarDockControl(); + this.barDockControl5 = new DevExpress.XtraBars.BarDockControl(); ((System.ComponentModel.ISupportInitialize)(this.pMenu)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pMprint)).BeginInit(); @@ -89,6 +95,8 @@ ((System.ComponentModel.ISupportInitialize)(this.pcBillDetail)).BeginInit(); this.pcBillDetail.SuspendLayout(); this.pcBillMain.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pmFP)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.barManager2)).BeginInit(); this.SuspendLayout(); // // dpb_Tools @@ -98,7 +106,7 @@ this.dpb_Tools.Appearance.Options.UseFont = true; this.dpb_Tools.DropDownArrowStyle = DevExpress.XtraEditors.DropDownArrowStyle.Show; this.dpb_Tools.DropDownControl = this.pMenu; - this.dpb_Tools.Location = new System.Drawing.Point(465, 6); + this.dpb_Tools.Location = new System.Drawing.Point(585, 6); this.dpb_Tools.Name = "dpb_Tools"; this.dpb_Tools.Size = new System.Drawing.Size(75, 26); this.dpb_Tools.TabIndex = 24; @@ -125,7 +133,7 @@ this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top; this.barDockControlTop.Location = new System.Drawing.Point(0, 0); this.barDockControlTop.Margin = new System.Windows.Forms.Padding(4); - this.barDockControlTop.Size = new System.Drawing.Size(1032, 0); + this.barDockControlTop.Size = new System.Drawing.Size(1152, 0); // // barDockControlBottom // @@ -133,7 +141,7 @@ this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom; this.barDockControlBottom.Location = new System.Drawing.Point(0, 780); this.barDockControlBottom.Margin = new System.Windows.Forms.Padding(4); - this.barDockControlBottom.Size = new System.Drawing.Size(1032, 0); + this.barDockControlBottom.Size = new System.Drawing.Size(1152, 0); // // barDockControlLeft // @@ -147,7 +155,7 @@ // this.barDockControlRight.CausesValidation = false; this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right; - this.barDockControlRight.Location = new System.Drawing.Point(1032, 0); + this.barDockControlRight.Location = new System.Drawing.Point(1152, 0); this.barDockControlRight.Margin = new System.Windows.Forms.Padding(4); this.barDockControlRight.Size = new System.Drawing.Size(0, 780); // @@ -157,7 +165,7 @@ this.btnClose.Appearance.Font = new System.Drawing.Font("宋体", 9F); this.btnClose.Appearance.Options.UseFont = true; this.btnClose.Enabled = false; - this.btnClose.Location = new System.Drawing.Point(951, 6); + this.btnClose.Location = new System.Drawing.Point(1071, 6); this.btnClose.Name = "btnClose"; this.btnClose.Size = new System.Drawing.Size(75, 26); this.btnClose.TabIndex = 22; @@ -169,7 +177,7 @@ this.btnBack.Appearance.Font = new System.Drawing.Font("宋体", 9F); this.btnBack.Appearance.Options.UseFont = true; this.btnBack.Enabled = false; - this.btnBack.Location = new System.Drawing.Point(870, 6); + this.btnBack.Location = new System.Drawing.Point(990, 6); this.btnBack.Name = "btnBack"; this.btnBack.Size = new System.Drawing.Size(75, 26); this.btnBack.TabIndex = 21; @@ -182,7 +190,7 @@ this.btnSave.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnSave.Appearance.Options.UseFont = true; this.btnSave.Enabled = false; - this.btnSave.Location = new System.Drawing.Point(708, 6); + this.btnSave.Location = new System.Drawing.Point(828, 6); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(75, 26); this.btnSave.TabIndex = 25; @@ -195,7 +203,7 @@ this.btnAccradit.Appearance.Font = new System.Drawing.Font("宋体", 9F); this.btnAccradit.Appearance.Options.UseFont = true; this.btnAccradit.Enabled = false; - this.btnAccradit.Location = new System.Drawing.Point(789, 6); + this.btnAccradit.Location = new System.Drawing.Point(909, 6); this.btnAccradit.Name = "btnAccradit"; this.btnAccradit.Size = new System.Drawing.Size(75, 26); this.btnAccradit.TabIndex = 20; @@ -210,7 +218,7 @@ this.btnPrint.Appearance.Options.UseFont = true; this.btnPrint.DropDownArrowStyle = DevExpress.XtraEditors.DropDownArrowStyle.Show; this.btnPrint.DropDownControl = this.pMprint; - this.btnPrint.Location = new System.Drawing.Point(546, 6); + this.btnPrint.Location = new System.Drawing.Point(666, 6); this.btnPrint.Name = "btnPrint"; this.btnPrint.Size = new System.Drawing.Size(75, 26); this.btnPrint.TabIndex = 26; @@ -226,7 +234,7 @@ this.btnAttach.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnAttach.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnAttach.Appearance.Options.UseFont = true; - this.btnAttach.Location = new System.Drawing.Point(627, 6); + this.btnAttach.Location = new System.Drawing.Point(747, 6); this.btnAttach.Name = "btnAttach"; this.btnAttach.Size = new System.Drawing.Size(75, 26); this.btnAttach.TabIndex = 23; @@ -238,7 +246,7 @@ this.btnSpare.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnSpare.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnSpare.Appearance.Options.UseFont = true; - this.btnSpare.Location = new System.Drawing.Point(384, 6); + this.btnSpare.Location = new System.Drawing.Point(504, 6); this.btnSpare.Name = "btnSpare"; this.btnSpare.Size = new System.Drawing.Size(75, 26); this.btnSpare.TabIndex = 27; @@ -248,6 +256,7 @@ // pcTool // this.pcTool.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; + this.pcTool.Controls.Add(this.dbpFP); this.pcTool.Controls.Add(this.simpleButton2); this.pcTool.Controls.Add(this.btnAdditional); this.pcTool.Controls.Add(this.btnRecord); @@ -263,15 +272,28 @@ this.pcTool.Dock = System.Windows.Forms.DockStyle.Bottom; this.pcTool.Location = new System.Drawing.Point(0, 743); this.pcTool.Name = "pcTool"; - this.pcTool.Size = new System.Drawing.Size(1032, 37); + this.pcTool.Size = new System.Drawing.Size(1152, 37); this.pcTool.TabIndex = 3; // + // dbpFP + // + this.dbpFP.AllowFocus = false; + this.dbpFP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.dbpFP.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.dbpFP.Appearance.Options.UseFont = true; + this.dbpFP.DropDownControl = this.pmFP; + this.dbpFP.Location = new System.Drawing.Point(84, 6); + this.dbpFP.Name = "dbpFP"; + this.dbpFP.Size = new System.Drawing.Size(75, 26); + this.dbpFP.TabIndex = 37; + this.dbpFP.Text = "分配"; + // // simpleButton2 // this.simpleButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.simpleButton2.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.simpleButton2.Appearance.Options.UseFont = true; - this.simpleButton2.Location = new System.Drawing.Point(221, 6); + this.simpleButton2.Location = new System.Drawing.Point(341, 6); this.simpleButton2.Name = "simpleButton2"; this.simpleButton2.Size = new System.Drawing.Size(75, 26); this.simpleButton2.TabIndex = 28; @@ -283,7 +305,7 @@ this.btnAdditional.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnAdditional.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnAdditional.Appearance.Options.UseFont = true; - this.btnAdditional.Location = new System.Drawing.Point(45, 6); + this.btnAdditional.Location = new System.Drawing.Point(165, 6); this.btnAdditional.Name = "btnAdditional"; this.btnAdditional.Size = new System.Drawing.Size(89, 26); this.btnAdditional.TabIndex = 27; @@ -295,7 +317,7 @@ this.btnRecord.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnRecord.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnRecord.Appearance.Options.UseFont = true; - this.btnRecord.Location = new System.Drawing.Point(140, 6); + this.btnRecord.Location = new System.Drawing.Point(260, 6); this.btnRecord.Name = "btnRecord"; this.btnRecord.Size = new System.Drawing.Size(75, 26); this.btnRecord.TabIndex = 27; @@ -307,7 +329,7 @@ this.btnReflash.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnReflash.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnReflash.Appearance.Options.UseFont = true; - this.btnReflash.Location = new System.Drawing.Point(303, 6); + this.btnReflash.Location = new System.Drawing.Point(423, 6); this.btnReflash.Name = "btnReflash"; this.btnReflash.Size = new System.Drawing.Size(75, 26); this.btnReflash.TabIndex = 27; @@ -320,7 +342,7 @@ this.panelControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.panelControl1.Location = new System.Drawing.Point(0, 0); this.panelControl1.Name = "panelControl1"; - this.panelControl1.Size = new System.Drawing.Size(1032, 743); + this.panelControl1.Size = new System.Drawing.Size(1152, 743); this.panelControl1.TabIndex = 4; // // splitMain @@ -333,7 +355,7 @@ this.splitMain.Panel1.Text = "Panel1"; this.splitMain.Panel2.Controls.Add(this.pcBillDetail); this.splitMain.Panel2.Text = "Panel2"; - this.splitMain.Size = new System.Drawing.Size(1028, 739); + this.splitMain.Size = new System.Drawing.Size(1148, 739); this.splitMain.SplitterPosition = 376; this.splitMain.TabIndex = 0; this.splitMain.Text = "splitContainerControl1"; @@ -347,7 +369,7 @@ this.tabMain.Location = new System.Drawing.Point(0, 0); this.tabMain.Name = "tabMain"; this.tabMain.SelectedTabPage = this.tabpage_finish; - this.tabMain.Size = new System.Drawing.Size(1028, 376); + this.tabMain.Size = new System.Drawing.Size(1148, 376); this.tabMain.TabIndex = 21; this.tabMain.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabpage_finish}); @@ -358,7 +380,7 @@ this.tabpage_finish.Controls.Add(this.gridFinish); this.tabpage_finish.Controls.Add(this.pl_top); this.tabpage_finish.Name = "tabpage_finish"; - this.tabpage_finish.Size = new System.Drawing.Size(1022, 347); + this.tabpage_finish.Size = new System.Drawing.Size(1142, 347); this.tabpage_finish.Text = "已完成单据"; // // gridFinish @@ -369,7 +391,8 @@ this.gridFinish.Margin = new System.Windows.Forms.Padding(4); this.gridFinish.Name = "gridFinish"; this.gridFinish.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum; - this.gridFinish.Size = new System.Drawing.Size(1022, 308); + this.gridFinish.Size = new System.Drawing.Size(1142, 308); + this.gridFinish.SysModel = null; this.gridFinish.TabIndex = 26; // // pl_top @@ -379,7 +402,7 @@ this.pl_top.Dock = System.Windows.Forms.DockStyle.Top; this.pl_top.Location = new System.Drawing.Point(0, 0); this.pl_top.Name = "pl_top"; - this.pl_top.Size = new System.Drawing.Size(1022, 39); + this.pl_top.Size = new System.Drawing.Size(1142, 39); this.pl_top.TabIndex = 25; // // pl_top_searchCond @@ -393,7 +416,7 @@ this.pl_top_searchCond.Dock = System.Windows.Forms.DockStyle.Fill; this.pl_top_searchCond.Location = new System.Drawing.Point(2, 2); this.pl_top_searchCond.Name = "pl_top_searchCond"; - this.pl_top_searchCond.Size = new System.Drawing.Size(850, 35); + this.pl_top_searchCond.Size = new System.Drawing.Size(970, 35); this.pl_top_searchCond.TabIndex = 23; // // labeldate_start @@ -477,7 +500,7 @@ this.pl_top_right.Controls.Add(this.simpleButton1); this.pl_top_right.Controls.Add(this.btnBackTop); this.pl_top_right.Dock = System.Windows.Forms.DockStyle.Right; - this.pl_top_right.Location = new System.Drawing.Point(852, 2); + this.pl_top_right.Location = new System.Drawing.Point(972, 2); this.pl_top_right.Name = "pl_top_right"; this.pl_top_right.Size = new System.Drawing.Size(168, 35); this.pl_top_right.TabIndex = 24; @@ -510,7 +533,7 @@ this.pcBillDetail.Dock = System.Windows.Forms.DockStyle.Fill; this.pcBillDetail.Location = new System.Drawing.Point(0, 0); this.pcBillDetail.Name = "pcBillDetail"; - this.pcBillDetail.Size = new System.Drawing.Size(1028, 358); + this.pcBillDetail.Size = new System.Drawing.Size(1148, 358); this.pcBillDetail.TabIndex = 0; // // gcDetail @@ -521,7 +544,8 @@ this.gcDetail.Margin = new System.Windows.Forms.Padding(8, 10, 8, 10); this.gcDetail.Name = "gcDetail"; this.gcDetail.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum; - this.gcDetail.Size = new System.Drawing.Size(1024, 236); + this.gcDetail.Size = new System.Drawing.Size(1144, 236); + this.gcDetail.SysModel = null; this.gcDetail.TabIndex = 12; // // pcBillMain @@ -530,7 +554,7 @@ this.pcBillMain.Dock = System.Windows.Forms.DockStyle.Top; this.pcBillMain.Location = new System.Drawing.Point(2, 2); this.pcBillMain.Name = "pcBillMain"; - this.pcBillMain.Size = new System.Drawing.Size(1024, 118); + this.pcBillMain.Size = new System.Drawing.Size(1144, 118); this.pcBillMain.TabIndex = 10; // // txt_billDocumentId @@ -550,9 +574,55 @@ this.txt_billDocumentId.TabIndex = 0; this.txt_billDocumentId.Visible = false; // + // pmFP + // + this.pmFP.Manager = this.barManager2; + this.pmFP.Name = "pmFP"; + // + // barManager2 + // + this.barManager2.DockControls.Add(this.barDockControl1); + this.barManager2.DockControls.Add(this.barDockControl2); + this.barManager2.DockControls.Add(this.barDockControl3); + this.barManager2.DockControls.Add(this.barDockControl5); + this.barManager2.Form = this; + this.barManager2.MaxItemId = 0; + // + // barDockControl1 + // + this.barDockControl1.CausesValidation = false; + this.barDockControl1.Dock = System.Windows.Forms.DockStyle.Top; + this.barDockControl1.Location = new System.Drawing.Point(0, 0); + this.barDockControl1.Size = new System.Drawing.Size(1152, 0); + // + // barDockControl2 + // + this.barDockControl2.CausesValidation = false; + this.barDockControl2.Dock = System.Windows.Forms.DockStyle.Bottom; + this.barDockControl2.Location = new System.Drawing.Point(0, 743); + this.barDockControl2.Size = new System.Drawing.Size(1152, 0); + // + // barDockControl3 + // + this.barDockControl3.CausesValidation = false; + this.barDockControl3.Dock = System.Windows.Forms.DockStyle.Left; + this.barDockControl3.Location = new System.Drawing.Point(0, 0); + this.barDockControl3.Size = new System.Drawing.Size(0, 743); + // + // barDockControl5 + // + this.barDockControl5.CausesValidation = false; + this.barDockControl5.Dock = System.Windows.Forms.DockStyle.Right; + this.barDockControl5.Location = new System.Drawing.Point(1152, 0); + this.barDockControl5.Size = new System.Drawing.Size(0, 743); + // // AuditPanel2 // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.Controls.Add(this.barDockControl3); + this.Controls.Add(this.barDockControl5); + this.Controls.Add(this.barDockControl2); + this.Controls.Add(this.barDockControl1); this.Controls.Add(this.panelControl1); this.Controls.Add(this.pcTool); this.Controls.Add(this.barDockControlLeft); @@ -560,7 +630,7 @@ this.Controls.Add(this.barDockControlBottom); this.Controls.Add(this.barDockControlTop); this.Name = "AuditPanel2"; - this.Size = new System.Drawing.Size(1032, 780); + this.Size = new System.Drawing.Size(1152, 780); ((System.ComponentModel.ISupportInitialize)(this.pMenu)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pMprint)).EndInit(); @@ -582,6 +652,8 @@ ((System.ComponentModel.ISupportInitialize)(this.pcBillDetail)).EndInit(); this.pcBillDetail.ResumeLayout(false); this.pcBillMain.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pmFP)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.barManager2)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -618,15 +690,4 @@ private DevExpress.XtraTab.XtraTabPage tabpage_finish; private GridControlEx gridFinish; private DevExpress.XtraEditors.PanelControl pl_top; - private DevExpress.XtraEditors.PanelControl pl_top_searchCond; - private LabelCheckDateEdit labeldate_start; - private LabelCheckAutoTextEdit labelcheck_finalAuditor; - private LabelTextEdit labeltxt_dataFlag; - private DevExpress.XtraEditors.SimpleButton btnSearch; - private LabelCheckDateEdit labeldate_end; - private DevExpress.XtraEditors.PanelControl pl_top_right; - private DevExpress.XtraEditors.SimpleButton simpleButton1; - private DevExpress.XtraEditors.SimpleButton btnBackTop; - public DevExpress.XtraEditors.SimpleButton simpleButton2; - } -} + private DevExpress.XtraEditors.PanelControl pl_top_s \ No newline at end of file diff --git a/插件库/Lskj.Control/AuditPanel2.cs b/插件库/Lskj.Control/AuditPanel2.cs index 4f5419a..e268668 100644 --- a/插件库/Lskj.Control/AuditPanel2.cs +++ b/插件库/Lskj.Control/AuditPanel2.cs @@ -76,10 +76,22 @@ namespace Lskj.Control /// 基础审批模型 /// public BaseAccraditationModel BaseAccraditModelObj; + + private DynamicPubAccraditionPopModel _sysModel; /// /// 单据入口参数模型 /// - public DynamicPubAccraditionPopModel SysModel; + public DynamicPubAccraditionPopModel SysModel + { + get + { + return _sysModel; + } + set + { + _sysModel = value; + } + } /// /// 主表控件 /// @@ -136,6 +148,15 @@ namespace Lskj.Control public DataRow SectionAccradit; #region 私有变量 /// + /// 数量名称 + /// + public string NumberMc; + /// + /// 主键字段 + /// + private string mRecordPrimaryField; + private string guidField = "xxxxx_guid"; + /// /// 自定义搜索控件 /// private MyControl _searchContrl; @@ -260,6 +281,16 @@ namespace Lskj.Control this.btnBack.Enabled = false; } this.GetPrintOtherParam(); + + //加载分配 + this.dbpFP.Click += new System.EventHandler(this.OnBtnFPOldClick); + BarButtonItem itemFPBatch = new BarButtonItem(); + itemFPBatch.Caption = "批量分配"; + itemFPBatch.ItemClick += new ItemClickEventHandler(OnBtnFPNewClick); + //分配 + this.pmFP.AddItems(new BarItem[] { itemFPBatch }); + + this.dbpFP.Visible = !string.IsNullOrWhiteSpace(this.BillModelObj.PopupUnionCode); } catch (Exception ex) { @@ -743,7 +774,7 @@ namespace Lskj.Control //this.btnAttach.Text = "附件"+"(" + AttachImpl.GetFileCount(this.BillModelObj.DirId + "", this.SysModel.BillDocumentId) + ")"; //记录推送用户 this.GetPushOpers(); - this.gcDetail.gridControl.Paint += new PaintEventHandler(gridBillInfo_Panint); + this.gcDetail.gridControl.Paint += new PaintEventHandler(gcDetail_Panint); //this.pcGrid.GridView.RowCellClick += new DevExpress.XtraGrid.Views.Grid.RowCellClickEventHandler(OnPcgridRowCellClick); //this.pcGrid.GridView.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(OnPcgridRowFocusedRowChanged); this._dtBillInfoFiled = BillAuditImpl.GetBillInfoData(this.SysModel.ModuleCode); @@ -767,7 +798,7 @@ namespace Lskj.Control /// 修改备注: /// 版本:1.0 /// - private void gridBillInfo_Panint(object sender, PaintEventArgs e) + private void gcDetail_Panint(object sender, PaintEventArgs e) { if (this.SysModel.StepOver != "1") return; GraphicsText graphicsText = new GraphicsText(); @@ -1338,12 +1369,12 @@ namespace Lskj.Control { try { - if (_printSaveParams != null && _printSaveParams.Count > 0) + if (_printSaveParams != null && _printSaveParams.Count > 0) { //打印完成后添加数据库 int result = BaseModuleImpl.SavePrintRecord(_printSaveParams[0], _printSaveParams[1], _printSaveParams[2], _printSaveParams[3], _printSaveParams[4]); } - + } catch (Exception ex) { @@ -1500,7 +1531,7 @@ namespace Lskj.Control this.btnClose.Visible = this._flowTypeStepModel.StepClosed == 1; //this.btnAccradit.Visible = BillAuditImpl.GetBillComfirm(this.SysModel.ConfirmId) < 0; - + } #endregion #region 右键菜单执行后刷新 @@ -1715,7 +1746,7 @@ namespace Lskj.Control finally { WaitForm.HideForm(); - if(!this.BaseAccraditModelObj.DisableAutomaticRefresh) RefreshTabPage(); + if (!this.BaseAccraditModelObj.DisableAutomaticRefresh) RefreshTabPage(); DataTable detailTable = gcDetail.GridControl.DataSourceTable(); detailTable.Clear(); this.ControlObj.ResetControlValue(); @@ -1725,14 +1756,14 @@ namespace Lskj.Control else { //主表必填 - if (!this.ControlObj.isRequiredFields(this.AuditModelObj.RequiredFields)) + if (!this.ControlObj.isRequiredFields(this.AuditModelObj.RequiredFields)) { MessageUtil.Show("单据内存在必填项未处理"); return; } //明细必填 - if (!this.gcDetail.GridControl.isRequiredFields(this.AuditModelObj.RequiredDetailFields, this.gcDetail.GridView)) + if (!this.gcDetail.GridControl.isRequiredFields(this.AuditModelObj.RequiredDetailFields, this.gcDetail.GridView)) { MessageUtil.Show("单据内存在必填项未处理"); return; @@ -1747,7 +1778,7 @@ namespace Lskj.Control } //选中上一次选中行行号 - if (SelectGridControlEx != null && oldRowHandle > 0) + if (SelectGridControlEx != null && oldRowHandle > 0) { SelectGridControlEx.GridView.SelectRowHandler(oldRowHandle); OnPcgridRowCellClick(SelectGridControlEx.GridView, null); @@ -1873,7 +1904,7 @@ namespace Lskj.Control { bool result = SaveBillData(); - if (result) + if (result) { //获取当前页签的GridControlEx和选中行行号 int oldRowHandle = 0; @@ -1930,7 +1961,7 @@ namespace Lskj.Control if (this.ControlObj.FindControl(model) != null) { string fieldValue = this.ControlObj.GetControlValue(model); - if (fieldValue == "****") continue; + if (fieldValue == "****") continue; //updateBuilder.AppendFormat("{0}='{1}',", model.FieldName, fieldValue); updateBuilder.Append(string.IsNullOrEmpty(fieldValue) ? string.Format("{0}={1}", model.FieldName, this.ControlObj.GetNullValue(model)) : string.Format("{0}=N'{1}',", model.FieldName, fieldValue.Contains("'") ? fieldValue.Replace("'", "''") : fieldValue)); @@ -2481,10 +2512,11 @@ namespace Lskj.Control DynamicPubAccraditionPopModel SysModel = tabPage.Tag as DynamicPubAccraditionPopModel; if (SysModel == null) { - this.btnClose .Enabled= this.btnSave.Enabled = this.btnAccradit.Enabled = this.btnBack.Enabled = this.btnSpare.Enabled = false; + this.btnClose.Enabled = this.btnSave.Enabled = this.btnAccradit.Enabled = this.btnBack.Enabled = this.btnSpare.Enabled = false; return; } - else { + else + { this.btnClose.Enabled = this.btnSave.Enabled = this.btnAccradit.Enabled = this.btnBack.Enabled = this.btnSpare.Enabled = true; } InitControl(SysModel); @@ -2776,4 +2808,565 @@ namespace Lskj.Control } catch (Exception ex) { - string M \ No newline at end of file + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + + } + #endregion + /// + /// 优化加载速度 + /// + protected override CreateParams CreateParams + { + get + { + CreateParams cp = base.CreateParams; + cp.ExStyle |= 0x02000000; + return cp; + } + } + + public EventHandler GridView_DoubleClick { get; set; } + + + /// + /// 导出明细 + /// + /// + /// + private void simpleButton2_Click(object sender, EventArgs e) + { + LogUtil.WriteDebug(this.SysModel.ModuleCode, "导出数据", this.SysModel.FormText, "单据明细导出", this.SysModel.ModuleId + ""); + this.gcDetail.GridControl.ToExcel(this.SysModel.FormText); + } + /// + /// 说明:分配明细 + /// 创建人:龚宇超 + /// 创建日期:2020-01-15 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The source of the event. + /// The instance containing the event data. + private void OnBtnFPOldClick(object sender, EventArgs e) + { + this.gcDetail.GridView.PostEditor(); + FPOld(); + } + private void OnBtnFPNewClick(object sender, EventArgs e) + { + this.gcDetail.GridView.PostEditor(); + FPNew(); + } + /// + /// 新版分配 + /// + private void FPNew(int rowHandle = 0) + { + try + { + this.gcDetail.GridView.FocusedRowHandle = rowHandle; + DataTable table = this.gcDetail.GridControl.DataSource as DataTable; + if (!table.Columns.Contains(guidField)) + { + table.Columns.Add(guidField, typeof(string)); + } + #region 创建分配界面 + string[] args = { this.SysModel.FormText, this.SysModel.UserId, this.SysModel.UserName, this.SysModel.Privilege, this.SysModel.ModuleCode, this.SysModel.ModuleId + "", this.BillModelObj.PopupUnionCode, "1000" }; + DynamicBaseSelectModel baseModel = new DynamicBaseSelectModel(args); + using (FrmBaseSelectBatch frmSelect = new FrmBaseSelectBatch(baseModel, this.ControlObj, this.gcDetail)) + { + frmSelect.Text = this.BillModelObj.TypeName; + frmSelect.InitControl(); + frmSelect.OnAfterFPCallback += OnAfterFPCallback; + #region 初始化第一条数据 + DataRow rowItem = this.gcDetail.GridView.GetFocusedDataRow(); + if (rowItem == null) + { + return; + } + rowItem[guidField] = Guid.NewGuid().ToString(); + if (!string.IsNullOrEmpty(mRecordPrimaryField) && table.Columns.Contains(this.mRecordPrimaryField)) + { + // 检查数据是否为分配后的行 + if (!string.IsNullOrEmpty(rowItem[this.mRecordPrimaryField] + "")) + { + if (this.gcDetail.GridView.FocusedRowHandle + 1 <= this.gcDetail.GridView.RowCount - 1) + { + int focusedRowHandle = this.gcDetail.GridView.FocusedRowHandle + 1; + this.gcDetail.GridView.FocusedRowHandle = focusedRowHandle; + if (this.gcDetail.GridView.FocusedRowHandle == focusedRowHandle) + { + FPNew(focusedRowHandle); + } + else + { + MessageUtil.Show("全部分配完毕"); + } + } + return; + } + } + if (!string.IsNullOrEmpty(mRecordPrimaryField)) + { + frmSelect.FpRows = table.Rows.Cast().Where(x => (rowItem[guidField] + "").Equals(x[guidField] + "")).ToArray(); + if (frmSelect.FpRows != null && frmSelect.FpRows.Length > 0) + { + List rows = frmSelect.FpRows.ToList(); + rows.Remove(rowItem); + frmSelect.FpRows = rows.ToArray(); + } + if (table.Columns.Contains(mRecordPrimaryField)) + { + frmSelect.FpOtherRows = table.Rows.Cast().Where(x => !(rowItem[guidField] + "").Equals(x[guidField] + "") && !string.IsNullOrEmpty(x[mRecordPrimaryField] + "")).ToArray(); + } + } + frmSelect.InitData(rowItem); + frmSelect.OnBtnFPClick(null, null); + #endregion + //frmSelect.ShowDialog(); + #endregion + } + } + catch (Exception ex) + { + MessageUtil.Show(ex.Message); + } + } + /// + /// 分配完成后回调 + /// + /// + /// + private void OnAfterFPCallback(object sender, EventArgs e) + { + WaitForm.ShowForm(); + try + { + // 临时禁用新增行(空白行) + if (this.BillModelObj.DefaultAddEmptyRow) this.gcDetail.GridView.OptionsView.NewItemRowPosition = NewItemRowPosition.None; + DataRow rowItem = this.gcDetail.GridView.GetFocusedDataRow(); + if (rowItem == null) + { + return; + } + DataTable table = this.gcDetail.GridControl.DataSource as DataTable; + FrmBaseSelectBatch frmSelect = (FrmBaseSelectBatch)sender; + rowItem[guidField] = Guid.NewGuid().ToString(); + if (!string.IsNullOrEmpty(mRecordPrimaryField) && table.Columns.Contains(this.mRecordPrimaryField)) + { + // 检查数据是否为分配后的行 + if (!string.IsNullOrEmpty(rowItem[this.mRecordPrimaryField] + "")) + { + if (this.gcDetail.GridView.FocusedRowHandle + 1 <= this.gcDetail.GridView.RowCount - 1) + { + this.gcDetail.GridView.FocusedRowHandle += 1; + OnAfterFPCallback(sender, e); + } + return; + } + } + if (!string.IsNullOrEmpty(mRecordPrimaryField)) + { + frmSelect.FpRows = table.Rows.Cast().Where(x => (rowItem[guidField] + "").Equals(x[guidField] + "")).ToArray(); + if (frmSelect.FpRows != null && frmSelect.FpRows.Length > 0) + { + List rows = frmSelect.FpRows.ToList(); + rows.Remove(rowItem); + frmSelect.FpRows = rows.ToArray(); + } + if (table.Columns.Contains(mRecordPrimaryField)) + { + frmSelect.FpOtherRows = table.Rows.Cast().Where(x => !(rowItem[guidField] + "").Equals(x[guidField] + "") && !string.IsNullOrEmpty(x[mRecordPrimaryField] + "")).ToArray(); + } + } + frmSelect.InitData(rowItem); + bool success = frmSelect.FP(); + if (success) + { + if (frmSelect.SelectedRows != null && frmSelect.SelectedRows.Length > 0) + { + // 增加标识列 + if (!table.Columns.Contains(frmSelect.RecordPrimaryField)) + { + this.mRecordPrimaryField = frmSelect.RecordPrimaryField; + table.Columns.Add(this.mRecordPrimaryField, typeof(String)); + } + foreach (DataRow item in frmSelect.SelectedRows) + { + DataRow newRow = table.NewRow(); + newRow.ItemArray = rowItem.ItemArray; + newRow[guidField] = rowItem[guidField]; + DataColumn IsIdentCol = newRow.Table.Columns.Cast().FirstOrDefault(x => x.ColumnName == BaseImpl.GetResult(string.Format("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='{0}' AND COLUMNPROPERTY(OBJECT_ID('{0}'),COLUMN_NAME,'IsIdentity')=1", BillModelObj.DetailTable)) + ""); + //自增长列分配按空值取 + if (IsIdentCol != null) + { + if (IsIdentCol.DataType == typeof(Decimal) || + IsIdentCol.DataType == typeof(Double) || + IsIdentCol.DataType == typeof(Int16) || + IsIdentCol.DataType == typeof(Int32) || + IsIdentCol.DataType == typeof(Int64)) + { + newRow[IsIdentCol.ColumnName] = 0; + } + } + foreach (DataColumn col in item.Table.Columns) + { + if (table.Columns.Contains(col.ColumnName)) + { + //newRow[col.ColumnName] = item[col.ColumnName]; + newRow[col.ColumnName] = item[col.ColumnName]; + GridColumn column = this.gcDetail.GridView.Columns[col.ColumnName]; + if (column != null) + { + GridColumnModel model = column.Tag as GridColumnModel; + if (!string.IsNullOrEmpty(model.UnionFields)) + { + this.SetUnionValue(model, rowItem[column.FieldName] + "", newRow); + } + SetCalcValue(model, rowItem[column.FieldName] + "", newRow); + } + } + } + newRow[frmSelect.AmountField] = item[frmSelect.AmountField]; + newRow[frmSelect.RecordPrimaryField] = item[frmSelect.RecordPrimaryField]; + table.Rows.Add(newRow); + } + NumberMc = frmSelect.AmountField; + table.Rows.Remove(rowItem); + // 重排顺序 + table.OrderBy(this.BillModelObj.DetailOrderField); + this.gcDetail.GridView.UpdateCurrentRow(); + this.gcDetail.GridView.ShowEditor(); + if (frmSelect.isNextOne) + { + int SourceRowIndex = this.gcDetail.GridView.GetFocusedDataSourceRowIndex(); + DataRow[] a = table.Rows.Cast().Where(x => string.IsNullOrEmpty(x[guidField].ToString())).ToArray(); + if (a.Length != 0) + { + this.gcDetail.GridView.FocusedRowHandle = SourceRowIndex; + OnAfterFPCallback(sender, e); + } + else + { + MessageUtil.Show("全部分配完毕"); + // frmSelect.SelectRowItem = null; + } + } + } + } + else + { + if (this.gcDetail.GridView.FocusedRowHandle + 1 <= this.gcDetail.GridView.RowCount - 1) + { + this.gcDetail.GridView.FocusedRowHandle += 1; + OnAfterFPCallback(sender, e); + } + else + { + MessageUtil.Show("全部分配完毕"); + } + } + } + catch (Exception) + { + throw; + } + finally + { + // 重新开启新增行(空白行) + if (this.BillModelObj.DefaultAddEmptyRow) this.gcDetail.GridView.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom; + WaitForm.HideForm(); + } + } + /// + /// 老版分配 + /// + private void FPOld() + { + try + { + DataRow rowItem = this.gcDetail.GridView.GetFocusedDataRow(); + if (rowItem == null) + { + MessageUtil.Show("请先选择一条明细在进行分配!"); + return; + } + DataTable table = this.gcDetail.GridControl.DataSource as DataTable; + if (!table.Columns.Contains(guidField)) + { + table.Columns.Add(guidField, typeof(string)); + } + rowItem[guidField] = Guid.NewGuid().ToString(); ; + if (!string.IsNullOrEmpty(mRecordPrimaryField) && table.Columns.Contains(this.mRecordPrimaryField)) + { + // 检查数据是否为分配后的行 + if (!string.IsNullOrEmpty(rowItem[this.mRecordPrimaryField] + "")) + { + MessageUtil.Show("该行数据为已分配后的数据,无需分配!"); + return; + } + } + string[] args = { this.SysModel.FormText, this.SysModel.UserId, this.SysModel.UserName, this.SysModel.Privilege, this.SysModel.ModuleCode, this.SysModel.ModuleId + "", this.BillModelObj.PopupUnionCode, "1000" }; + DynamicBaseSelectModel baseModel = new DynamicBaseSelectModel(args); + using (FrmBaseSelect frmSelect = new FrmBaseSelect(baseModel, this.ControlObj, this.gcDetail)) + { + //if (frmSelect.SelectRowItem == null) + //{ + // frmSelect = new FrmBaseSelect(baseModel, this.ControlObj, this.gcMain); + //} + frmSelect.Text = this.BillModelObj.TypeName; + frmSelect.SelectRowItem = rowItem; + bool isNextOne = false; + if (!string.IsNullOrEmpty(mRecordPrimaryField)) + { + frmSelect.FpRows = table.Rows.Cast().Where(x => (rowItem[guidField] + "").Equals(x[guidField] + "")).ToArray(); + if (frmSelect.FpRows != null && frmSelect.FpRows.Length > 0) + { + List rows = frmSelect.FpRows.ToList(); + rows.Remove(rowItem); + frmSelect.FpRows = rows.ToArray(); + } + if (table.Columns.Contains(mRecordPrimaryField)) + { + frmSelect.FpOtherRows = table.Rows.Cast().Where(x => !(rowItem[guidField] + "").Equals(x[guidField] + "") && !string.IsNullOrEmpty(x[mRecordPrimaryField] + "")).ToArray(); + } + } + if (frmSelect.ShowDialog() == DialogResult.OK) + { + if (frmSelect.SelectedRows != null && frmSelect.SelectedRows.Length > 0) + { + //if (frmSelect.isNextOne) + //{ + // isNextOne = true; + //} + //else + //{ + // isNextOne = false; + //} + // 增加标识列 + if (!table.Columns.Contains(frmSelect.RecordPrimaryField)) + { + this.mRecordPrimaryField = frmSelect.RecordPrimaryField; + table.Columns.Add(this.mRecordPrimaryField, typeof(String)); + } + + foreach (DataRow item in frmSelect.SelectedRows) + { + DataRow newRow = table.NewRow(); + newRow.ItemArray = rowItem.ItemArray; + newRow[guidField] = rowItem[guidField]; + DataColumn IsIdentCol = newRow.Table.Columns.Cast().FirstOrDefault(x => x.ColumnName == BaseImpl.GetResult(string.Format("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='{0}' AND COLUMNPROPERTY(OBJECT_ID('{0}'),COLUMN_NAME,'IsIdentity')=1", BillModelObj.DetailTable)) + ""); + //自增长列分配按空值取 + if (IsIdentCol != null) + { + if (IsIdentCol.DataType == typeof(Decimal) || + IsIdentCol.DataType == typeof(Double) || + IsIdentCol.DataType == typeof(Int16) || + IsIdentCol.DataType == typeof(Int32) || + IsIdentCol.DataType == typeof(Int64)) + { + newRow[IsIdentCol.ColumnName] = 0; + } + } + foreach (DataColumn col in item.Table.Columns) + { + if (table.Columns.Contains(col.ColumnName)) + { + //newRow[col.ColumnName] = item[col.ColumnName]; + newRow[col.ColumnName] = item[col.ColumnName]; + GridColumn column = this.gcDetail.GridView.Columns[col.ColumnName]; + if (column != null) + { + GridColumnModel model = column.Tag as GridColumnModel; + if (!string.IsNullOrEmpty(model.UnionFields)) + { + this.SetUnionValue(model, rowItem[column.FieldName] + "", newRow); + } + SetCalcValue(model, rowItem[column.FieldName] + "", newRow); + } + } + } + newRow[frmSelect.AmountField] = item[frmSelect.AmountField]; + newRow[frmSelect.RecordPrimaryField] = item[frmSelect.RecordPrimaryField]; + table.Rows.Add(newRow); + } + NumberMc = frmSelect.AmountField; + //double syAmount = frmSelect.GetSyAmount(); + //if (syAmount > 0) + //{ + // rowItem[frmSelect.AmountField] = frmSelect.GetSyAmount(); + //} + //else + //{ + // table.Rows.Remove(rowItem); + //} + table.Rows.Remove(rowItem); + // 重排顺序 + table.OrderBy(this.BillModelObj.DetailOrderField); + this.gcDetail.GridView.UpdateCurrentRow(); + this.gcDetail.GridView.ShowEditor(); + } + } + if (frmSelect.isNextOne) + { + int SourceRowIndex = this.gcDetail.GridView.GetFocusedDataSourceRowIndex(); + DataRow[] a = table.Rows.Cast().Where(x => string.IsNullOrEmpty(x[guidField].ToString())).ToArray(); + if (a.Length != 0) + { + this.gcDetail.GridView.FocusedRowHandle = SourceRowIndex; + OnBtnFPOldClick(null, null); + } + else + { + MessageUtil.Show("全部分配完毕"); + // frmSelect.SelectRowItem = null; + } + } + } + } + catch (Exception ex) + { + MessageUtil.Show(ex); + } + } + /// + /// 说明:计算列关联字段 + /// 创建人:龚宇超 + /// 创建日期:2017-12-18 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The model. + /// The field value. + protected virtual void SetUnionValue(GridColumnModel model, string fieldValue, DataRow rowItem) + { + DataTable table = this.gcDetail.gridControl.DataSourceTable(); + //DataRow rowItem = this.gridView.GetFocusedDataRow(); + string unionValues = model.UnionValues; + if (rowItem != null && model != null) + { + unionValues = ReplaceHelper.ReplaceRowParam(rowItem, unionValues.Replace("{" + model.FieldName + "}", fieldValue)); + if (this.ControlObj != null) + { + unionValues = ControlObj.ReplaceParentControlValue(unionValues); + } + try + { + string[] fields = model.UnionFields.Trim(',').Split(','); + DataRow rowResult = BaseImpl.GetDataRowResult(unionValues); + if (rowResult != null) + { + for (int i = 0; i < fields.Length; i++) + { + string field = fields[i]; + string value = rowResult.Table.Columns.Contains(field) ? rowResult[field] + "" : null; + rowItem[field] = value; + } + } + else + { + // 设置为空 + for (int i = 0; i < fields.Length; i++) + { + string field = fields[i]; + rowItem[field] = DBNull.Value; + } + } + } + catch (Exception ex) + { + LogHelper.Instance.WriteError(ex); + LogUtil.WriteError("计算列关联字段--错误-->" + unionValues, ex); + } + } + } + /// + /// 说明:计算列计算公式 + /// 创建人:龚宇超 + /// 创建日期:2017-12-18 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The model. + /// The field value. + protected virtual void SetCalcValue(GridColumnModel model, string fieldValue, DataRow rowItem) + { + try + { + DataTable table = this.gcDetail.gridControl.DataSourceTable(); + if (rowItem != null && model != null) + { + List calcModels = this.gcDetail.ObjmControlList.FindAll(x => !string.IsNullOrEmpty(x.CalcExpr)).OrderBy(y => y.CalcOrder).ToList(); + + foreach (GridColumnModel gridModel in calcModels) + { + // 计算顺序小于当前控件则不计算 + if (gridModel.CalcOrder < model.CalcOrder) continue; + + if (!gridModel.FieldName.Equals(model.FieldName, StringComparison.OrdinalIgnoreCase)) + { + bool isTruncate = false; + string calcExpr = gridModel.CalcExpr; + if (calcExpr.StartsWith("@truncate:")) + { + calcExpr = calcExpr.Substring(10); + isTruncate = true; + } + + try + { + if (this.ControlObj != null) + calcExpr = ControlObj.ReplaceParentControlValue(calcExpr); + + calcExpr = ReplaceHelper.ReplaceRowParam(rowItem, calcExpr); + //EvalHelper.Eval2(ReplaceHelper.ReplaceEvalCond(calcExpr)) + "" + string result = EvalHelper.Eval2(ReplaceHelper.ReplaceEvalCond(calcExpr)) + ""; + if (isTruncate) + { + result += result.Contains(".") ? "0000000000" : ".0000000000"; + rowItem[gridModel.FieldName] = result.Substring(0, result.IndexOf(".")) + result.Substring(result.IndexOf("."), model.Decimals + 1); + //this.gridView.SetRowCellValue(this.gridView.FocusedRowHandle, this.gridView.Columns[gridModel.FieldName], result.Substring(0, result.IndexOf(".")) + result.Substring(result.IndexOf("."), model.Decimals + 1)); + } + else + { + try + { + double d = 0; + if (!string.IsNullOrEmpty(result) && + !"NaN".Equals(result, StringComparison.OrdinalIgnoreCase) && + !"非数字".Equals(result, StringComparison.OrdinalIgnoreCase) && + !"undefined".Equals(result, StringComparison.OrdinalIgnoreCase) && + result != "∞" && result != "-∞" && + !"正无穷大".Equals(result, StringComparison.OrdinalIgnoreCase) && + !"负无穷大".Equals(result, StringComparison.OrdinalIgnoreCase) && + double.TryParse(result, out d)) + { + if (string.IsNullOrEmpty(gridModel.DataFormat)) + { + result = Math.Round(Convert.ToDouble(d), model.Decimals, MidpointRounding.AwayFromZero) + ""; + } + else + { + //计算后先执行保存小数位数 + result = string.Format("{0:" + gridModel.DataFormat + "}", Convert.ToDecimal(result)); + } + if (model.FieldType == 7 && result.Contains('%')) + { + result = (double.Parse(result.Replace("%", "")) * 0.01).ToString(); + } + rowItem[gridModel.FieldName] = result; + // 判断计算列有无关联值 + GridColumnModel UnionModel = calcModels.FirstOrDefault(x => x.FieldName == gridModel.FieldName); + if (!string.IsNullOrEmpty(UnionModel.UnionFields)) + { + this.SetUnionValue(UnionModel, rowItem[gridModel.FieldName] + "", rowItem); + } + //this.gridView.SetRowCellValue(this.g \ No newline at end of file