|
@@ -98,6 +98,8 @@ type
|
|
|
cdsBGBillsViewUsedQuantity: TFloatField;
|
|
|
cdsBGLIsCloud: TBooleanField;
|
|
|
cdsBGLWebID: TIntegerField;
|
|
|
+ cdsBGLViewIsCloud: TBooleanField;
|
|
|
+ cdsBGLViewWebID: TIntegerField;
|
|
|
procedure cdsBGBillsViewAfterInsert(DataSet: TDataSet);
|
|
|
procedure cdsBGBillsViewAfterPost(DataSet: TDataSet);
|
|
|
procedure cdsBGBillsViewQuantityChange(Sender: TField);
|
|
@@ -136,6 +138,8 @@ type
|
|
|
procedure Close;
|
|
|
procedure Save;
|
|
|
|
|
|
+ function GetBGLCanEdit(ASerialNo: Integer): Boolean;
|
|
|
+
|
|
|
function AllBGLTotalPrice: Double;
|
|
|
|
|
|
function AllCloudBGLWebID: string;
|
|
@@ -431,6 +435,14 @@ var
|
|
|
iIncrement: Integer;
|
|
|
sNewCode: string;
|
|
|
begin
|
|
|
+ if cdsBGLViewIsCloud.AsBoolean then
|
|
|
+ begin
|
|
|
+ cdsBGLViewCode.Tag := 0;
|
|
|
+ WarningMessage('当前变更令不允许编辑。');
|
|
|
+ DataSet.Cancel;
|
|
|
+ Abort;
|
|
|
+ end;
|
|
|
+
|
|
|
// 变更令号不可为空
|
|
|
if cdsBGLViewCode.AsString = '' then
|
|
|
begin
|
|
@@ -713,7 +725,7 @@ procedure TBGLData.LoadCloudBGL(const ABGLs: string);
|
|
|
cdsBGLPos_Reason.AsString := ABGL.S['description'];
|
|
|
cdsBGLDirection.AsString := ABGL.S['basis'];
|
|
|
cdsBGLDrawingCode.AsString := ABGL.S['cnum'];
|
|
|
- cdsBGLApprovalCode.AsString := '';
|
|
|
+ cdsBGLApprovalCode.AsString := ABGL.S['bnum'];
|
|
|
cdsBGLCreatePhaseID.AsInteger := iCreatePhaseID;
|
|
|
cdsBGLBGLType.AsString := ABGL.S['changeNature'];
|
|
|
cdsBGLIsCloud.AsBoolean := True;
|
|
@@ -736,4 +748,27 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
+function TBGLData.GetBGLCanEdit(ASerialNo: Integer): Boolean;
|
|
|
+var
|
|
|
+ i: Integer;
|
|
|
+ bk: TBookmark;
|
|
|
+begin
|
|
|
+ cdsBGLView.DisableControls;
|
|
|
+ bk := cdsBGLView.GetBookmark;
|
|
|
+ cdsBGLView.First;
|
|
|
+ i := 0;
|
|
|
+ while (i < ASerialNo) and not cdsBGLView.Eof do
|
|
|
+ begin
|
|
|
+ cdsBGLView.Next;
|
|
|
+ Inc(i);
|
|
|
+ end;
|
|
|
+ if i = ASerialNo then
|
|
|
+ Result := not cdsBGLViewIsCloud.AsBoolean
|
|
|
+ else
|
|
|
+ Result := False;
|
|
|
+ cdsBGLView.GotoBookmark(bk);
|
|
|
+ cdsBGLView.FreeBookmark(bk);
|
|
|
+ cdsBGLView.EnableControls;
|
|
|
+end;
|
|
|
+
|
|
|
end.
|