unit SQZCT;
interface
uses
Business.System, Business.Model, Business.Forms, Business.Data,
Business.Model.Flow;
type
TSQZCT = class(TForm)
FuncBroker: TFuncBroker;
InfoBrokerXKSQXX: TInfoBroker;
InfoBrokerJTXZXKSQSXSCYJXX: TInfoBroker;
InfoBrokerJTXZXKSQBYSLTZXX: TInfoBroker;
InfoBrokerLNGCSGXKZXX: TInfoBroker;
InfoBrokerJTXZXKSQBZTZXX: TInfoBroker;
InfoBrokerJTXZXKSQSLTZXX: TInfoBroker;
ControlBar: TControlBar;
DataNavigator: TDataNavigator;
DocViewBar: TDocViewBar;
PageControl: TPageControl;
TabSheet: TTabSheet;
DocViewXKSQXX_SQXK: TDocView;
TabSheet2: TTabSheet;
DocViewJTXZXKSQBYSLTZXX_JTXZXKSQBYSLTZS: TDocView;
TabSheet4: TTabSheet;
DocViewJTXZXKSQBZTZXX_JTXZXKSQBZTZS: TDocView;
TabSheet5: TTabSheet;
TabSheet1: TTabSheet;
DocViewJTXZXKSQSXSCYJXX_JTXZXKSQSXSCYJB: TDocView;
TabSheet3: TTabSheet;
DocViewLNGCSGXKZXX_LNXZSGXKZ: TDocView;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
DataSetBroker1: TDataSetBroker;
DocViewJTXZXKSQSLTZXX_JTXZXKSQSLTZS: TDocView;
FlowBroker1: TFlowBroker;
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure RadioButton4Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure FlowBroker1CreateFlowOutFlowTasks(Sender: TObject; Command: TFlowOutCommand);
procedure FlowBroker1AfterFlowOut(Sender: TObject; Command: TFlowOutCommand);
private
{private declarations}
public
{public declarations}
end;
implementation
procedure TSQZCT.RadioButton1Click(Sender: TObject);
begin
if TRadioButton(Sender).Checked then
Begin
// PageControl.ActivePage := TabSheet5;
TabSheet2.Show;
DataSetBroker1.DataSet.Edit;
DataSetBroker1.DataSet.FieldByName('DJANHZT').AsString :='不受理';
// DataSetBroker1.DataSet.ApplyUpdates;
end;
end;
procedure TSQZCT.RadioButton2Click(Sender: TObject);
begin
if TRadioButton(Sender).Checked then
Begin
// PageControl.ActivePage := TabSheet5;
TabSheet4.Show;
DataSetBroker1.DataSet.Edit;
DataSetBroker1.DataSet.FieldByName('DJANHZT').AsString :='受理';
// DataSetBroker1.DataSet.ApplyUpdates;
end;
TabSheet4.Show;
end;
procedure TSQZCT.RadioButton3Click(Sender: TObject);
begin
if TRadioButton(Sender).Checked then
Begin
// PageControl.ActivePage := TabSheet5;
TabSheet5.Show;
DataSetBroker1.DataSet.Edit;
DataSetBroker1.DataSet.FieldByName('DJANHZT').AsString :='受理';
// DataSetBroker1.DataSet.ApplyUpdates;
end;
end;
procedure TSQZCT.RadioButton4Click(Sender: TObject);
begin
if TRadioButton(Sender).Checked then
Begin
TabSheet3.Show;
DataSetBroker1.DataSet.Edit;
DataSetBroker1.DataSet.FieldByName('DJANHZT').AsString :='当场颁发许可';
// DataSetBroker1.DataSet.ApplyUpdates;
end;
end;
procedure TSQZCT.SpeedButton1Click(Sender: TObject);
begin
TabSheet1.Show;
end;
procedure TSQZCT.FlowBroker1CreateFlowOutFlowTasks(Sender: TObject; Command: TFlowOutCommand);
var
I: Integer;
lUnits: TList;
lContextCurrent: TContextCurrent;
begin
lUnits := TList.Create;
try
FlowBroker1.FlowControl.CurrentProcUnit.GetSuccedentUnits(lUnits,[TProcUnitKind.ukCondition],True);
for I := 0 to lUnits.Count - 1 do
begin
// dialogs.ShowMessage(TProcUnit(lUnits[I]).ID + TProcUnit(lUnits[I]).DisplayName);
if (TProcUnit(lUnits[I]).ID = 'BZ') AND RadioButton2.Checked then
begin
command.FlowTasks[0].Subject := '等待补正:' + DataSetBroker1.DataSet.FieldByName('JTXZXKSQSXJNR').AsString;
end
else
if (TProcUnit(lUnits[I]).ID = 'SL') And RadioButton3.Checked then
begin
command.FlowTasks[0].Subject := '大队审查意见:' + DataSetBroker1.DataSet.FieldByName('JTXZXKSQSXJNR').AsString;
end;
end;
finally
lUnits.Free;
end;
end;
procedure TSQZCT.FlowBroker1AfterFlowOut(Sender: TObject; Command: TFlowOutCommand);
var
I: Integer;
lUnits: TList;
lContextCurrent: TContextCurrent;
begin
lUnits := TList.Create;
try
FlowBroker1.FlowControl.CurrentProcUnit.GetSuccedentUnits(lUnits,[TProcUnitKind.ukCondition],True);
for I := 0 to lUnits.Count - 1 do
begin
// dialogs.ShowMessage(TProcUnit(lUnits[I]).ID + TProcUnit(lUnits[I]).DisplayName);
if (TProcUnit(lUnits[I]).ID = 'BYSL') AND RadioButton1.Checked then
begin
DataSetBroker1.DataSet.Edit;
DataSetBroker1.DataSet.FieldByName('XZXKZT').AsString :='0';//不许可
// DataSetBroker1.DataSet.ApplyUpdates;
end
else
if (TProcUnit(lUnits[I]).ID = 'CONDITION') AND RadioButton4.Checked then
begin
DataSetBroker1.DataSet.Edit;
DataSetBroker1.DataSet.FieldByName('XZXKZT').AsString :='2';//申请通过
// DataSetBroker1.DataSet.ApplyUpdates;
end
else
if RadioButton2.Checked then
begin
DataSetBroker1.DataSet.Edit;
DataSetBroker1.DataSet.FieldByName('XZXKZT').AsString :='4';//受理中
// DataSetBroker1.DataSet.ApplyUpdates;
end
else
if (TProcUnit(lUnits[I]).ID = 'SL') And RadioButton3.Checked then
begin
DataSetBroker1.DataSet.Edit;
DataSetBroker1.DataSet.FieldByName('XZXKZT').AsString :='4';//受理中
// DataSetBroker1.DataSet.ApplyUpdates;
end;
end;
finally
lUnits.Free;
end;
try
lContextCurrent := TContextCurrent.Create(Self.Context);
// dialogs.ShowMessage('当前操作者部门ID:' + lContextCurrent.Dept.ID);
// dialogs.ShowMessage('当前操作者岗位成员编号:' + lContextCurrent.PositionMember.ID);
if DataSetBroker1.DataSet.FieldByName('DLRYid').AsString <>nil then
begin
DataSetBroker1.DataSet.Edit;
DataSetBroker1.DataSet.FieldByName('DLBMBH').AsString := lContextCurrent.Dept.ID;
DataSetBroker1.DataSet.FieldByName('DLGWBH').AsString := lContextCurrent.PositionMember.ID;
DataSetBroker1.DataSet.FieldByName('DLRYid').AsString := lContextCurrent.Operator.ID;
// DataSetBroker1.DataSet.ApplyUpdates;
end;
finally
lContextCurrent.Free;
end;
// DataSetBroker1.DataSet.ApplyUpdates;
end;
end. |