Bläddra i källkod

新增“变更性质”

MaiXinRong 9 år sedan
förälder
incheckning
6170f1104c
5 ändrade filer med 101 tillägg och 5 borttagningar
  1. 8 0
      DataModules/BGLDm.dfm
  2. 2 0
      DataModules/BGLDm.pas
  3. 41 1
      Frames/BGLFme.dfm
  4. 46 2
      Frames/BGLFme.pas
  5. 4 2
      Units/DataBaseTables.pas

+ 8 - 0
DataModules/BGLDm.dfm

@@ -60,6 +60,10 @@ object BGLData: TBGLData
     object cdsBGLExecutionRate: TFloatField
     object cdsBGLExecutionRate: TFloatField
       FieldName = 'ExecutionRate'
       FieldName = 'ExecutionRate'
     end
     end
+    object cdsBGLBGLType: TWideStringField
+      FieldName = 'BGLType'
+      Size = 10
+    end
   end
   end
   object cdsBGLView: TClientDataSet
   object cdsBGLView: TClientDataSet
     Aggregates = <>
     Aggregates = <>
@@ -109,6 +113,10 @@ object BGLData: TBGLData
     object cdsBGLViewExecutionRate: TFloatField
     object cdsBGLViewExecutionRate: TFloatField
       FieldName = 'ExecutionRate'
       FieldName = 'ExecutionRate'
     end
     end
+    object cdsBGLViewBGLType: TWideStringField
+      FieldName = 'BGLType'
+      Size = 10
+    end
   end
   end
   object dsBGL: TDataSource
   object dsBGL: TDataSource
     DataSet = cdsBGLView
     DataSet = cdsBGLView

+ 2 - 0
DataModules/BGLDm.pas

@@ -98,6 +98,8 @@ type
     cdsBGBillsViewTotalPrice: TFloatField;
     cdsBGBillsViewTotalPrice: TFloatField;
     cdsBGBillsViewUsedQuantity: TFloatField;
     cdsBGBillsViewUsedQuantity: TFloatField;
     cdsBGBillsViewLocked: TBooleanField;
     cdsBGBillsViewLocked: TBooleanField;
+    cdsBGLBGLType: TWideStringField;
+    cdsBGLViewBGLType: TWideStringField;
     procedure cdsBGBillsViewAfterInsert(DataSet: TDataSet);
     procedure cdsBGBillsViewAfterInsert(DataSet: TDataSet);
     procedure cdsBGBillsViewAfterPost(DataSet: TDataSet);
     procedure cdsBGBillsViewAfterPost(DataSet: TDataSet);
     procedure cdsBGBillsViewQuantityChange(Sender: TField);
     procedure cdsBGBillsViewQuantityChange(Sender: TField);

+ 41 - 1
Frames/BGLFme.dfm

@@ -117,7 +117,7 @@ object BGLFrame: TBGLFrame
         Height = 271
         Height = 271
         Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
         Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
         OptionsEx = []
         OptionsEx = []
-        ColCount = 7
+        ColCount = 8
         RowCount = 2
         RowCount = 2
         ShowGridLine = False
         ShowGridLine = False
         DefaultColWidth = 73
         DefaultColWidth = 73
@@ -129,6 +129,9 @@ object BGLFrame: TBGLFrame
         FrozenRow = 0
         FrozenRow = 0
         OnCopy = zgBGLCopy
         OnCopy = zgBGLCopy
         OnPaste = zgBGLPaste
         OnPaste = zgBGLPaste
+        OnGetCellEditor = zgBGLGetCellEditor
+        OnEditorLoadCell = zgBGLEditorLoadCell
+        OnEditorSaveCell = zgBGLEditorSaveCell
         OnMouseDown = zgBGLMouseDown
         OnMouseDown = zgBGLMouseDown
         Align = alClient
         Align = alClient
       end
       end
@@ -184,6 +187,25 @@ object BGLFrame: TBGLFrame
       end
       end
     end
     end
   end
   end
+  object cbbBGLType: TZjComboBox
+    Left = 198
+    Top = 160
+    Width = 145
+    Height = 20
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -12
+    Font.Name = 'smartSimSun'
+    Font.Style = []
+    ItemHeight = 12
+    ParentFont = False
+    TabOrder = 3
+    Visible = False
+    Items.Strings = (
+      #19968#33324
+      #36739#22823
+      #37325#22823)
+  end
   object zaBGL: TZjGridDBA
   object zaBGL: TZjGridDBA
     Columns = <
     Columns = <
       item
       item
@@ -277,6 +299,24 @@ object BGLFrame: TBGLFrame
         ReadOnly = False
         ReadOnly = False
       end
       end
       item
       item
+        Title.Caption = #21464#26356#24615#36136
+        Title.CaptionAcrossCols = '1'
+        Title.Font.Charset = GB2312_CHARSET
+        Title.Font.Color = clWindowText
+        Title.Font.Height = -12
+        Title.Font.Name = #23435#20307
+        Title.Font.Style = []
+        Alignment = taCenter
+        Font.Charset = GB2312_CHARSET
+        Font.Color = clWindowText
+        Font.Height = -12
+        Font.Name = #23435#20307
+        Font.Style = []
+        FieldName = 'BGLType'
+        Width = 60
+        ReadOnly = False
+      end
+      item
         Title.Caption = #24050#25191#34892'(%)'
         Title.Caption = #24050#25191#34892'(%)'
         Title.CaptionAcrossCols = '1'
         Title.CaptionAcrossCols = '1'
         Title.Font.Charset = GB2312_CHARSET
         Title.Font.Charset = GB2312_CHARSET

+ 46 - 2
Frames/BGLFme.pas

@@ -6,7 +6,7 @@ uses
   BGLDm,
   BGLDm,
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, ZjGridDBA, StdCtrls, DBCtrls, ZJGrid, ExtCtrls, ComCtrls,
   Dialogs, ZjGridDBA, StdCtrls, DBCtrls, ZJGrid, ExtCtrls, ComCtrls,
-  ToolWin, JimLabels, ActnList, DB, dxBar;
+  ToolWin, JimLabels, ActnList, DB, dxBar, ZJEdits;
 
 
 type
 type
   TBGLFrame = class(TFrame)
   TBGLFrame = class(TFrame)
@@ -33,6 +33,7 @@ type
     pnlBGL: TPanel;
     pnlBGL: TPanel;
     sprBGL: TSplitter;
     sprBGL: TSplitter;
     actnCopyBGLBlock: TAction;
     actnCopyBGLBlock: TAction;
+    cbbBGLType: TZjComboBox;
     procedure actnNewExecute(Sender: TObject);
     procedure actnNewExecute(Sender: TObject);
     procedure dbmPos_ReasonExit(Sender: TObject);
     procedure dbmPos_ReasonExit(Sender: TObject);
     procedure zgBGLMouseDown(Sender: TObject; Button: TMouseButton;
     procedure zgBGLMouseDown(Sender: TObject; Button: TMouseButton;
@@ -49,6 +50,12 @@ type
     procedure zgBGLPaste(Sender: TObject; const ABounds: TRect;
     procedure zgBGLPaste(Sender: TObject; const ABounds: TRect;
       var Allow: Boolean);
       var Allow: Boolean);
     procedure actnCopyBGLBlockUpdate(Sender: TObject);
     procedure actnCopyBGLBlockUpdate(Sender: TObject);
+    procedure zgBGLGetCellEditor(Sender: TObject; ACoord: TPoint;
+      var AControl: TWinControl);
+    procedure zgBGLEditorSaveCell(Sender: TObject; ACoord: TPoint;
+      AControl: TWinControl);
+    procedure zgBGLEditorLoadCell(Sender: TObject; ACoord: TPoint;
+      AControl: TWinControl);
   private
   private
     FBGLData: TBGLData;
     FBGLData: TBGLData;
 
 
@@ -62,7 +69,7 @@ implementation
 
 
 uses
 uses
   UtilMethods, MergeTextFrm, ProjectData, MainFrm, mEncryptEditions,
   UtilMethods, MergeTextFrm, ProjectData, MainFrm, mEncryptEditions,
-  BGLClipboard, ConstUnit;
+  BGLClipboard, ConstUnit, ZjCells;
 
 
 {$R *.dfm}
 {$R *.dfm}
 
 
@@ -72,7 +79,13 @@ constructor TBGLFrame.Create(AParent: TFrame; ABGLData: TBGLData);
 begin
 begin
   inherited Create(AParent);
   inherited Create(AParent);
   FBGLData := ABGLData;
   FBGLData := ABGLData;
+  zgBGL.CellClass.Cols[zaBGL.ColumnCol('BGLType')] := TZjComboCell;
   zaBGL.DataSet := FBGLData.cdsBGLView;
   zaBGL.DataSet := FBGLData.cdsBGLView;
+
+  zgBGL.OnGetCellEditor := zgBGLGetCellEditor;
+  zgBGL.OnEditorLoadCell := zgBGLEditorLoadCell;
+  zgBGL.OnEditorSaveCell := zgBGLEditorSaveCell;
+
   dbmPos_Reason.DataSource := FBGLData.dsBGL;
   dbmPos_Reason.DataSource := FBGLData.dsBGL;
   dbmDirection.DataSource := FBGLData.dsBGL;
   dbmDirection.DataSource := FBGLData.dsBGL;
   zaBGBills.DataSet := FBGLData.cdsBGBillsView;
   zaBGBills.DataSet := FBGLData.cdsBGBillsView;
@@ -193,4 +206,35 @@ begin
     TAction(Sender).Visible := False;
     TAction(Sender).Visible := False;
 end;
 end;
 
 
+procedure TBGLFrame.zgBGLGetCellEditor(Sender: TObject; ACoord: TPoint;
+  var AControl: TWinControl);
+begin
+  if ACoord.X = zaBGL.ColumnCol('BGLType') then
+    AControl := cbbBGLType;
+end;
+
+procedure TBGLFrame.zgBGLEditorSaveCell(Sender: TObject; ACoord: TPoint;
+  AControl: TWinControl);
+begin
+  if AControl = cbbBGLType then
+  begin
+    zaBGL.DataSet.Edit;
+    if cbbBGLType.ItemIndex = -1 then
+      zaBGL.DataSet.FieldByName('BGLType').Clear
+    else
+      zaBGL.DataSet.FieldByName('BGLType').AsString := cbbBGLType.Text;
+    zaBGL.DataSet.Post;
+  end;
+end;
+
+procedure TBGLFrame.zgBGLEditorLoadCell(Sender: TObject; ACoord: TPoint;
+  AControl: TWinControl);
+begin
+  if AControl = cbbBGLType then
+    if zaBGL.DataSet.FieldByName('BGLType').AsString = '' then
+      cbbBGLType.ItemIndex := -1
+    else
+      cbbBGLType.Text := zaBGL.DataSet.FieldByName('BGLType').AsString;
+end;
+
 end.
 end.

+ 4 - 2
Units/DataBaseTables.pas

@@ -328,7 +328,7 @@ const
 
 
   {变更令}
   {变更令}
   SBGL = 'BGL';
   SBGL = 'BGL';
-  tdBGL: array [0..10] of TScFieldDef =(
+  tdBGL: array [0..11] of TScFieldDef =(
     (FieldName: 'ID'; FieldType: ftInteger; Size: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
     (FieldName: 'ID'; FieldType: ftInteger; Size: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
     // 变更令号
     // 变更令号
     (FieldName: 'Code'; FieldType: ftString; Size: 50; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     (FieldName: 'Code'; FieldType: ftString; Size: 50; NotNull: False; PrimaryKey: False; ForceUpdate: False),
@@ -349,7 +349,9 @@ const
     // 创建期数
     // 创建期数
     (FieldName: 'CreatePhaseID'; FieldType: ftInteger; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     (FieldName: 'CreatePhaseID'; FieldType: ftInteger; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     // 已执行
     // 已执行
-    (FieldName: 'ExecutionRate'; FieldType: ftDouble; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
+    (FieldName: 'ExecutionRate'; FieldType: ftDouble; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 变更令类型:一般、较大、重大
+    (FieldName: 'BGLType'; FieldType: ftString; Size: 10; NotNull: False; PrimaryKey: False; ForceUpdate: False)
   );
   );
 
 
   SBGBills = 'BGBills';
   SBGBills = 'BGBills';