소스 검색

无中间计量数据时,下方显示详细信息不应报错

MaiXinRong 7 년 전
부모
커밋
831f1dc22d
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      DataModules/BillsMeasureDm.pas
  2. 3 1
      Frames/ZJJLFme.pas

+ 2 - 2
DataModules/BillsMeasureDm.pas

@@ -434,7 +434,7 @@ procedure TBillsMeasureData.sdvBillsMeasureSetText(var Text: String;
 var
   vNode: TBillsIDTreeNode;
 begin
-  {if not Assigned(AValue) then Exit;
+  if not Assigned(AValue) then Exit;
   // 修改后数据与原数据相同则不提交
   if not CheckValidData then
     Allow := False;
@@ -450,7 +450,7 @@ begin
 
   Text := Trim(Text);
   if Pos('=', Text) = 1 then
-    Text := Copy(Text, 2, Length(Text) - 1);  }
+    Text := Copy(Text, 2, Length(Text) - 1);
 
   DoCurChanged(vNode);
 end;

+ 3 - 1
Frames/ZJJLFme.pas

@@ -280,7 +280,9 @@ procedure TZJJLFrame.zgDetailInfoGetCellText(Sender: TObject;
     Rec: TsdDataRecord;
   begin
     Rec := saZJJL.DataView.Current;
-    if Rec.ValueByName('Type').AsInteger = Integer(ztFx) then
+    if not Assigned(Rec) then
+      Result := Format(RowFormats[riCurGatherMeasure], ['', ''])
+    else if Rec.ValueByName('Type').AsInteger = Integer(ztFx) then
       Result := Format(RowFormats[riCurGatherMeasure], ['½ð¶î', GetFloatStr(FZJJLData.GetZJJLCalcData(Rec, 'GatherTotalPrice'))])
     else
       Result := Format(RowFormats[riCurGatherMeasure], ['ÊýÁ¿', GetFloatStr(FZJJLData.GetZJJLCalcData(Rec, 'GatherQuantity'))]);