Explorar o código

本期数量变更 -- 数量,禁止用户输入,用户输入0-9任意数字,等价于点击按钮调用变更令

MaiXinRong %!s(int64=5) %!d(string=hai) anos
pai
achega
746be24713
Modificáronse 2 ficheiros con 22 adicións e 9 borrados
  1. 3 2
      Frames/BillsMeasureFme.dfm
  2. 19 7
      Frames/BillsMeasureFme.pas

+ 3 - 2
Frames/BillsMeasureFme.dfm

@@ -64,6 +64,7 @@ object BillsMeasureFrame: TBillsMeasureFrame
       FrozenCol = 0
       FrozenRow = 0
       OnCurrentChanged = zgBillsMeasureCurrentChanged
+      OnCellCanEdit = zgBillsMeasureCellCanEdit
       OnCellButtonClick = zgBillsMeasureCellButtonClick
       OnCustomPaste = zgBillsMeasureCustomPaste
       OnCellGetColor = zgBillsMeasureCellGetColor
@@ -372,7 +373,7 @@ object BillsMeasureFrame: TBillsMeasureFrame
         Font.Style = []
         FieldName = 'CurQcQuantity'
         Width = 60
-        ReadOnly = False
+        ReadOnly = True
       end
       item
         Title.Caption = '|'#37329#39069
@@ -427,7 +428,7 @@ object BillsMeasureFrame: TBillsMeasureFrame
         Font.Style = []
         FieldName = 'CurPcQuantity'
         Width = 60
-        ReadOnly = False
+        ReadOnly = True
       end
       item
         Title.Caption = '|'#37329#39069

+ 19 - 7
Frames/BillsMeasureFme.pas

@@ -7,7 +7,7 @@ uses
   ColVisibleManager,
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, ZJGrid, ComCtrls, ToolWin, StdCtrls, ExtCtrls, sdGridDBA,
-  sdGridTreeDBA, sdDB, ActnList, dxBar, sdIDTree, JimLabels;
+  sdGridTreeDBA, sdDB, ActnList, dxBar, sdIDTree, JimLabels, ZJCells;
 
 type
   TBillsMeasureFrame = class(TFrame)
@@ -61,6 +61,8 @@ type
     procedure actnLocateZJJLExecute(Sender: TObject);
     procedure actnLocateZJJLUpdate(Sender: TObject);
     procedure actnCalculateAllUpdate(Sender: TObject);
+    procedure zgBillsMeasureCellCanEdit(Sender: TObject;
+      const ACoord: TPoint; var Allow: Boolean);
   private
     FBillsMeasureData: TBillsMeasureData;
     FShowPriceChange: Boolean;
@@ -133,7 +135,7 @@ implementation
 
 uses
   MainFrm, ProjectFme, ProjectData, ExportExcel, BGLDm, BGLSelectFrm,
-  Types, ZhAPI, BillsTree, mDataRecord, ConditionalDefines;
+  Types, ZhAPI, BillsTree, mDataRecord, ConditionalDefines, Math;
 
 { TBillsFrame }
 
@@ -317,11 +319,11 @@ var
 begin
   iCol := zgBillsMeasure.CurCol - zgBillsMeasure.FixedColCount;
   Result := (iCol = stdBillsMeasure.VisibleCol('CurDealQuantity'))
-         or (iCol = stdBillsMeasure.VisibleCol('CurDealTotalPrice'))
-         or (iCol = stdBillsMeasure.VisibleCol('CurQcQuantity'))
-         or (iCol = stdBillsMeasure.VisibleCol('CurQcTotalPrice'))
-         or (iCol = stdBillsMeasure.VisibleCol('CurPcQuantity'))
-         or (iCol = stdBillsMeasure.VisibleCol('CurPcTotalPrice'));
+         or (iCol = stdBillsMeasure.VisibleCol('CurDealTotalPrice'));
+         //or (iCol = stdBillsMeasure.VisibleCol('CurQcQuantity'))
+         //or (iCol = stdBillsMeasure.VisibleCol('CurQcTotalPrice'))
+         //or (iCol = stdBillsMeasure.VisibleCol('CurPcQuantity'))
+         //or (iCol = stdBillsMeasure.VisibleCol('CurPcTotalPrice'));
 end;
 
 procedure TBillsMeasureFrame.zgBillsMeasureCellButtonClick(Sender: TObject;
@@ -468,6 +470,9 @@ begin
   if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
       and (Key in [66, 98]) then
     ShowIsGather := not ShowIsGather;
+
+  if (Key in [48..57]) and (zgBillsMeasure.CurCol = 11) then
+    zgBillsMeasureCellButtonClick(Sender, zgBillsMeasure.CurCol, zgBillsMeasure.CurRow);
 end;
 
 procedure TBillsMeasureFrame.actnSetStageBookmarkExecute(Sender: TObject);
@@ -829,4 +834,11 @@ begin
   CanExecute := QuestMessage('请确认是否执行删除操作');
 end;
 
+procedure TBillsMeasureFrame.zgBillsMeasureCellCanEdit(Sender: TObject;
+  const ACoord: TPoint; var Allow: Boolean);
+begin
+  if (ACoord.X = 11) then
+    Allow := False;
+end;
+
 end.