MaiXinRong hace 5 años
padre
commit
41c8229f0b
Se han modificado 3 ficheros con 81 adiciones y 15 borrados
  1. 38 0
      DataModules/PhasePayDm.pas
  2. 13 13
      Frames/ProjectFme.dfm
  3. 30 2
      Frames/ProjectFme.pas

+ 38 - 0
DataModules/PhasePayDm.pas

@@ -22,6 +22,7 @@ type
     function CheckMinus(AID: Integer): Boolean;
     function GetFormula(AID: Integer): string;
     function GetCalcType(AID: Integer): Integer;
+    function GetName(AID: Integer): string;
 
     function GetPayablePrice(AIndex: Integer): Double;
 
@@ -34,6 +35,7 @@ type
     function GetLastestPhasePay(AType: Integer): Double;
 
     procedure SetFieldValidChar;
+    function GetBqwc(AType: Integer): Double;
   public
     constructor Create(APhaseData: TObject);
     destructor Destroy; override;
@@ -58,6 +60,7 @@ type
     // AType表示不同类型,取值如下:
     // 1: 本期数据  2: 截止本期数据  3: 截止上期数据
     property LastestPhasePay[AType: Integer]: Double read GetLastestPhasePay;
+    property Bqwc[AType: Integer]: Double read GetBqwc;
     property Decimal: TCalcDecimal read FDecimal;
   end;
 
@@ -432,4 +435,39 @@ begin
   end;
 end;
 
+function TPhasePayData.GetBqwc(AType: Integer): Double;
+var
+  Rec: TsdDataRecord;
+  sTPField: string;
+  i: Integer;
+begin
+  case AType of
+    1: sTPField := 'TotalPrice' + IntToStr(TPhaseData(FPhaseData).PhaseProperty.AuditCount);
+    2: sTPField := 'EndTotalPrice' + IntToStr(TPhaseData(FPhaseData).PhaseProperty.AuditCount);
+    3: sTPField := 'PreTotalPrice' + IntToStr(TPhaseData(FPhaseData).PhaseProperty.AuditCount);
+  end;
+  Result := 0;
+  for i := 0 to sddPhasePay.RecordCount - 1 do
+  begin
+    Rec := sddPhasePay.Records[i];
+    // 检查是否为一般项
+    if GetName(Rec.ValueByName('ID').AsInteger) = '本期完成计量' then
+    begin
+      Result := Rec.ValueByName(sTPField).AsFloat;
+      Break;
+    end;
+  end;
+end;
+
+function TPhasePayData.GetName(AID: Integer): string;
+var
+  Rec: TsdDataRecord;
+begin
+  Result := '';
+  with TProjectData(TPhaseData(FPhaseData).ProjectData).DealPaymentData do
+    Rec := sddDealPayment.FindKey('idxID', AID);
+  if Assigned(Rec) then
+    Result := Rec.ValueByName('Name').AsString;
+end;
+
 end.

+ 13 - 13
Frames/ProjectFme.dfm

@@ -1,7 +1,7 @@
 object ProjectFrame: TProjectFrame
   Left = 0
   Top = 0
-  Width = 1169
+  Width = 1158
   Height = 528
   Font.Charset = ANSI_CHARSET
   Font.Color = clWindowText
@@ -124,12 +124,12 @@ object ProjectFrame: TProjectFrame
   object pnlView: TPanel
     Left = 65
     Top = 0
-    Width = 1104
+    Width = 1093
     Height = 528
     Align = alClient
     TabOrder = 1
     object sprAssistant: TSplitter
-      Left = 904
+      Left = 893
       Top = 22
       Height = 505
       Align = alRight
@@ -139,7 +139,7 @@ object ProjectFrame: TProjectFrame
     object pnlToolBar: TPanel
       Left = 1
       Top = 1
-      Width = 1102
+      Width = 1091
       Height = 21
       Align = alTop
       BevelOuter = bvNone
@@ -152,7 +152,7 @@ object ProjectFrame: TProjectFrame
       TabOrder = 0
       object tbToolsButton: TToolBar
         Tag = -1
-        Left = 530
+        Left = 519
         Top = 0
         Width = 572
         Height = 21
@@ -2730,7 +2730,7 @@ object ProjectFrame: TProjectFrame
       end
     end
     object jpsAssistant: TJimPages
-      Left = 907
+      Left = 896
       Top = 22
       Width = 196
       Height = 505
@@ -2815,7 +2815,7 @@ object ProjectFrame: TProjectFrame
     object jpsMain: TJimPages
       Left = 1
       Top = 22
-      Width = 903
+      Width = 892
       Height = 505
       ActivePage = jpsMainBillsCompile
       ActivePageIndex = 0
@@ -2825,7 +2825,7 @@ object ProjectFrame: TProjectFrame
         Tag = -1
         Left = 0
         Top = 0
-        Width = 903
+        Width = 892
         Height = 505
         TabName = 'BillsCompile'
         Caption = 'BillsCompile'
@@ -2834,7 +2834,7 @@ object ProjectFrame: TProjectFrame
         Tag = -1
         Left = 0
         Top = 0
-        Width = 903
+        Width = 892
         Height = 505
         TabName = 'BillsMeasure'
         Caption = 'Bills'
@@ -2843,7 +2843,7 @@ object ProjectFrame: TProjectFrame
         Tag = -1
         Left = 0
         Top = 0
-        Width = 903
+        Width = 892
         Height = 505
         TabName = 'BillsGather'
         Caption = 'PhaseCompare'
@@ -2852,7 +2852,7 @@ object ProjectFrame: TProjectFrame
         Tag = -1
         Left = 0
         Top = 0
-        Width = 903
+        Width = 892
         Height = 505
         TabName = 'PriceMargin'
         Caption = 'PriceMargin'
@@ -2861,7 +2861,7 @@ object ProjectFrame: TProjectFrame
         Tag = -1
         Left = 0
         Top = 0
-        Width = 903
+        Width = 892
         Height = 505
         TabName = 'StageCompare'
         Caption = 'StageCompare'
@@ -2870,7 +2870,7 @@ object ProjectFrame: TProjectFrame
         Tag = -1
         Left = 0
         Top = 0
-        Width = 903
+        Width = 892
         Height = 505
         TabName = 'OtherMeasure'
         Caption = 'OtherMeasure'

+ 30 - 2
Frames/ProjectFme.pas

@@ -209,7 +209,7 @@ uses
   ConstUnit, MD5Unit, sdIDTree, sdDB, mProgressFrm, ConditionalDefines,
   ProjectCommands, ProjectProperty, CheckerMemoFrm, BillsMeasureDm,
   ProgressHintFrm, mProgressProFrm, ReportManagerFrm, BillsCompileDm,
-  ScFileArchiverConsts, Math, ZJJLDm, Checker;
+  ScFileArchiverConsts, Math, ZJJLDm, Checker, PhasePayDm;
 
 {$R *.dfm}
 
@@ -821,11 +821,29 @@ begin
 end;
 
 procedure TProjectFrame.btnSubmitClick(Sender: TObject);
+var
+  sHint: string;
+  i: Integer;
+  c: TChecker;
+  vNext: TOrderCheckerFrame;
 begin
   if not CheckCanReport then Exit;
 
   Screen.Cursor := crHourGlass;
   try
+    FProjectData.CalculateAll;
+    sHint := Format('本期计量:¥%.2f元' + #13#10, [ProjectData.PhaseData.PhasePayData.Bqwc[1]]);
+
+    sHint := sHint + '审批流程:' + PHPWeb.RealName;
+    for i := 0 to ProjectData.Checkers.Count - 1 do
+    begin
+      c := ProjectData.Checkers.Item[i];
+      sHint := sHint + ' > ' + c.Name;
+    end;
+    sHint := sHint + #13#10;
+    sHint := sHint + '上报后将不可更改,确定要上报吗?';
+    if (not QuestMessageYesNo(sHint)) then Exit;
+    
     UpToWeb(True);
   finally
     Screen.Cursor := crDefault;
@@ -834,7 +852,16 @@ end;
 
 procedure TProjectFrame.btnPassClick(Sender: TObject);
 begin
-  btnSubmitClick(Sender);
+  if not CheckCanReport then Exit;
+
+  Screen.Cursor := crHourGlass;
+  try
+    ProjectData.CalculateAll;
+    
+    UpToWeb(True);
+  finally
+    Screen.Cursor := crDefault;
+  end;
 end;
 
 function TProjectFrame.IsUped: Boolean;  // 是否上传过
@@ -926,6 +953,7 @@ var sURL, sAppFile, sJsonFile_Bills, sJsonFile_Common, sAppFile_UnLock,
 
   begin
     Result := False;
+
     ProgressProCreate(100, '本地数据文件上传到云端');
     ProgressProRun('保存本地数据...', 0);
     ProjectData.Checkers.LastChecker := ProjectData.Checkers.FindByID(PHPWeb.UserID);