Просмотр исходного кода

Merge branch '10.1.0' of http://192.168.1.41:3000/SmartCost/SmartCost into 10.1.0

builder 2 месяцев назад
Родитель
Сommit
2b919b8620

+ 28 - 1
Common/ScUtils.pas

@@ -5,7 +5,7 @@ interface
 uses
   Classes, SysUtils, Variants, Forms, StdCtrls, Types, Dialogs, Graphics,
   Windows, Controls, Messages, StrUtils, Math, ScMessage, ScConsts, DBClient,
-  Registry, ShlObj, ShellAPI, IniFiles, DB, TLHelp32, ADODB, WinSock, sdDB;
+  Registry, ShlObj, ShellAPI, IniFiles, DB, TLHelp32, ADODB, WinSock, sdDB, VCLUnZip;
 
 type
   TUniqueIdGenerator = class(TObject)
@@ -583,6 +583,7 @@ var
 
 function DeleteFolder(const AFolder: string; AToRecycleBin: Boolean = False): Boolean;
 function CopyFolder(const ASourceFolder, ATargetFolder: string): Boolean;
+function UnZip(const zipFile: string): string;  // 返回解压后的文件(只返回一个解压文件。如果有多个,则指定一个返回)
 
 implementation
 
@@ -6630,4 +6631,30 @@ begin
   Result := iAllLength;
 end;
 
+
+function UnZip(const zipFile: string): string;
+var
+  vUnZip: TVCLUnZip;
+  sPath: string;
+  i: Integer;
+begin
+  Result := '';
+  sPath := ExtractFilePath(zipFile);
+  vUnZip := TVCLUnZip.Create(nil);
+  try
+    vUnZip.ZipName := zipFile;
+//    vUnZip.Password := '1234578';
+    vUnZip.DestDir := sPath;
+    vUnZip.DoAll := True;
+    vUnZip.RecreateDirs := True;
+    vUnZip.RetainAttributes := True;
+    vUnZip.OverwriteMode := Always;
+    i := vUnZip.UnZip;
+    if i > 0 then
+      Result := sPath + 'main.xml';
+  finally
+    vUnZip.Free;
+  end;
+end;
+
 end.

+ 2 - 2
DPRs/CSL/SmartCost.dof

@@ -115,7 +115,7 @@ AutoIncBuild=1
 MajorVer=10
 MinorVer=1
 Release=4
-Build=496
+Build=497
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +126,7 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=SmartCost 2008专业版
-FileVersion=10.1.4.496
+FileVersion=10.1.4.497
 InternalName=SmartCost
 LegalCopyright=版权所有(C) 珠海纵横创新软件有限公司 2003-2016。保留所有权利。
 LegalTrademarks=SmartCost

BIN
DPRs/CSL/SmartCost.res


+ 5 - 4
MainModule/Model/ScXMLPort.pas

@@ -3453,10 +3453,10 @@ begin
     TScProject(AProject).RealTimeCalc := False;
 
     // 导入费率
-//    ImpFeeRate(AProject, AFeeRateRootNode);
+    ImpFeeRate(AProject, AFeeRateRootNode);
     // 导入项目工料机
     ImpProjectGLJ(AProject, AProjGLJRootNode);
-    {
+
     with TScProject(AProject).Bills do
     begin
       // 删除第一部分的子结点
@@ -3475,7 +3475,7 @@ begin
       TScProject(AProject).Bills.CalculateAll;
       // 最后存储
       TScProjBaseData(TScProject(AProject).ProjData).Save;
-    end;    }
+    end;    
   finally
     TScProject(AProject).RealTimeCalc := OldRealTimeCalc;
   end;
@@ -3675,7 +3675,6 @@ var
     if Result = nil then
     begin
       Result := vProjectGLJ.NewRecord;
-      Result.BeginUpdate;
       try
         Result.Code.AsString := sCode;
         Result.Name.AsString := sName;
@@ -3686,6 +3685,8 @@ var
         Result.Amount.AsCurrency := 0;
         Result.PeriodQtyCoe.AsFloat := 1;
         Result.Types.AsInteger := ADefaultType;
+        Result.CalculateType.AsInteger := 0;
+        Result.SortParam.AsInteger := 0;
         if ADefaultType = GLJ_Concrete then
           Result.TypeSort.AsInteger := 20
         else

+ 2 - 2
MainUI/Forms/ScMainFrm.pas

@@ -8392,8 +8392,8 @@ end;
 procedure TScMainForm.actnImpXML_QGUpdate(Sender: TObject);
 begin
   // AAAAAAAAAAAAAAA
-//  TAction(Sender).Visible := (BigProjManageView <> nil) and BigProjManageView.CurSelNodeIsBP;
-  TAction(Sender).Visible := False;
+  TAction(Sender).Visible := (BigProjManageView <> nil) and BigProjManageView.CurSelNodeIsBP;
+//  TAction(Sender).Visible := False;
 end;
 
 initialization

+ 13 - 13
MainUI/ProjectManage/ScBigProjManageView.dfm

@@ -47,24 +47,24 @@ object ScfrmBigProjManage: TScfrmBigProjManage
         Style = tbsDropDown
       end
       object tbOpenTender: TToolButton
-        Left = 40
+        Left = 42
         Top = 0
         Action = actnOpen
       end
       object tbImport: TToolButton
-        Left = 63
+        Left = 65
         Top = 0
         Action = actnImport
       end
       object tbExport: TToolButton
-        Left = 86
+        Left = 88
         Top = 0
         Action = actnExport
         DropdownMenu = ppmExportProject
         Style = tbsDropDown
       end
       object tbStaticBills: TToolButton
-        Left = 126
+        Left = 130
         Top = 0
         Hint = #22266#21270#28165#21333
         Caption = #22266#21270#28165#21333
@@ -72,12 +72,12 @@ object ScfrmBigProjManage: TScfrmBigProjManage
         ImageIndex = 20
       end
       object tbRenameBP: TToolButton
-        Left = 149
+        Left = 153
         Top = 0
         Action = actnEditBPName
       end
       object tobtn1: TToolButton
-        Left = 172
+        Left = 176
         Top = 0
         Width = 8
         Caption = 'tobtn1'
@@ -85,19 +85,19 @@ object ScfrmBigProjManage: TScfrmBigProjManage
         Style = tbsSeparator
       end
       object tbDelBP: TToolButton
-        Left = 180
+        Left = 184
         Top = 0
         Action = actnDelBP
       end
       object tobtn2: TToolButton
-        Left = 203
+        Left = 207
         Top = 0
         Width = 8
         ImageIndex = 19
         Style = tbsSeparator
       end
       object pnlShowLevel: TPanel
-        Left = 211
+        Left = 215
         Top = 0
         Width = 135
         Height = 22
@@ -126,7 +126,7 @@ object ScfrmBigProjManage: TScfrmBigProjManage
         end
       end
       object btn1: TToolButton
-        Left = 346
+        Left = 350
         Top = 0
         Width = 8
         Caption = 'btn1'
@@ -134,7 +134,7 @@ object ScfrmBigProjManage: TScfrmBigProjManage
         Style = tbsSeparator
       end
       object pnlFindPB: TPanel
-        Left = 354
+        Left = 358
         Top = 0
         Width = 195
         Height = 22
@@ -294,7 +294,7 @@ object ScfrmBigProjManage: TScfrmBigProjManage
             Width = 145
             Height = 20
             ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
-            ItemHeight = 12
+            ItemHeight = 0
             TabOrder = 2
             Visible = False
           end
@@ -304,7 +304,7 @@ object ScfrmBigProjManage: TScfrmBigProjManage
             Width = 145
             Height = 20
             ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
-            ItemHeight = 12
+            ItemHeight = 0
             TabOrder = 3
             Visible = False
           end

+ 23 - 3
MainUI/ProjectManage/ScBigProjManageView.pas

@@ -3402,9 +3402,8 @@ var
   strFile: string;
 begin
   ODlg := TOpenDialog.Create(nil);
+  {
   try
-//    ODlg.InitialDir := ExtractFilePath(Application.ExeName) + 'UserData\';
-//    ODlg.Filter := '数据交换规范文件(*.YGLT、*.YGLZ)|*.YGLT;*.YGLZ';
     ODlg.Filter := '全国造价数据标准文件(*.XML)|*.XML';
     if ODlg.Execute then
       strFile := ODlg.FileName
@@ -3412,10 +3411,31 @@ begin
       Exit;
   finally
     ODlg.Free;
+  end;   }
+
+  try
+    ODlg.Filter := '全国造价数据标准文件(*.jygs;*.gkgs;*.sjgs;*.sgys;*.qdys;*.gcjs;*.sjys)|*.jygs;*.gkgs;*.sjgs;*.sgys;*.qdys;*.gcjs;*.sjys';
+    if ODlg.Execute then
+      strFile := ODlg.FileName
+    else
+      Exit;
+  finally
+    ODlg.Free;
   end;
 
   if strFile <> '' then
-    ScXMLToBuildProject.ImportXML_QuanGuo(strFile, '');
+  begin
+    // 解压
+    strFile := UnZip(strFile);
+    if strFile <> '' then
+    begin
+      try
+        ScXMLToBuildProject.ImportXML_QuanGuo(strFile, '');
+      finally
+        DeleteFile(strFile);
+      end;
+    end;
+  end;
 end;
 
 procedure TScfrmBigProjManage.zgBuildProjectsPaste(Sender: TObject;