📄 getfwclqd.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "ShFwMain.h"
#include "getfwclqd.h"
#include "fwqd1.h"
#include "fwqd3.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "ColorButton"
#pragma resource "*.dfm"
TGetFwclQdForm *GetFwclQdForm;
//---------------------------------------------------------------------------
__fastcall TGetFwclQdForm::TGetFwclQdForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TGetFwclQdForm::FormCreate(TObject *Sender)
{
MainForm->ADOConnection1->Open();
DateTimePicker1->DateTime = Date();
DateTimePicker2->DateTime = Date();
RadioGroup2->ItemIndex = 0;
}
//---------------------------------------------------------------------------
void __fastcall TGetFwclQdForm::FormClose(TObject *Sender,
TCloseAction &Action)
{
MainForm->ADOConnection1->Close();
}
//---------------------------------------------------------------------------
void __fastcall TGetFwclQdForm::dxfColorButton2Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TGetFwclQdForm::dxfColorButton1Click(TObject *Sender)
{
AnsiString msql,sql;
ADOQuerytmp->Close();
ADOQuerytmp->SQL->Clear();
switch( RadioGroup2->ItemIndex) {
case 0: //受理未派工
case 1: //派工未结算
if( RadioGroup2->ItemIndex == 0)
msql="select distinct zxfwlx from fwsl where delflag='否' and slrq >=:P_startrq and slrq <=:P_endrq and pgflag='否'";
else
msql="select distinct zxfwlx from fwsl where delflag='否' and slrq >=:P_startrq and slrq <=:P_endrq and pgflag='是' and jsflag='否'";
ADOQuerytmp->SQL->Add(msql);
ADOQuerytmp->Parameters->ParamByName("P_startrq")->Value = DateTimePicker1->DateTime;
ADOQuerytmp->Parameters->ParamByName("P_endrq")->Value = DateTimePicker2->DateTime;
ADOQuerytmp->Open();
ADOQuery1->Close();
ADOQuery1->SQL->Clear();
if( RadioGroup2->ItemIndex == 0)
sql = "select * from fwsl where delflag='否' and slrq >=:P_startrq and slrq <=:P_endrq and pgflag='否' and zxfwlx=:zxfwlx order by dabh ";
else
sql = "select * from fwsl where delflag='否' and slrq >=:P_startrq and slrq <=:P_endrq and pgflag='是' and jsflag='否' and zxfwlx=:zxfwlx order by dabh ";
ADOQuery1->SQL->Add(sql);
ADOQuery1->Parameters->ParamByName("P_startrq")->Value = DateTimePicker1->DateTime;
ADOQuery1->Parameters->ParamByName("P_endrq")->Value = DateTimePicker2->DateTime;
ADOQuery1->Open();
TFwQdForm1 *FwQdForm1;
try
{
FwQdForm1 = new TFwQdForm1(Application);
FwQdForm1->QRLabel14->Caption = FormatDateTime("yyyy-mm-dd",DateTimePicker1->DateTime);
FwQdForm1->QRLabel15->Caption = FormatDateTime("yyyy-mm-dd",DateTimePicker2->DateTime);
FwQdForm1->QRLabel17->Caption = RadioGroup2->Items->Strings[RadioGroup2->ItemIndex];
FwQdForm1->QuickRep1->Preview();
delete FwQdForm1;
}
catch(...)
{
delete FwQdForm1;
Application->MessageBox("运行出现错误!","警告",MB_OK+MB_ICONWARNING);
}
break;
case 2: // 已结算
case 3: //回访
if( RadioGroup2->ItemIndex == 2)
msql="select distinct zxfwlx from fwsl where delflag='否' and slrq >=:P_startrq and slrq <=:P_endrq and jsflag='是'";
else
msql="select distinct zxfwlx from fwsl where delflag='否' and slrq >=:P_startrq and slrq <=:P_endrq and hfflag='是'";
ADOQuerytmp->SQL->Add(msql);
ADOQuerytmp->Parameters->ParamByName("P_startrq")->Value = DateTimePicker1->DateTime;
ADOQuerytmp->Parameters->ParamByName("P_endrq")->Value = DateTimePicker2->DateTime;
ADOQuerytmp->Open();
ADOQuery1->Close();
ADOQuery1->SQL->Clear();
if( RadioGroup2->ItemIndex == 2)
sql = "select * from fwsl,fwjs where fwsl.delflag='否' and fwsl.slrq >=:P_startrq and fwsl.slrq <=:P_endrq and fwsl.jsflag='是' and fwsl.zxfwlx=:zxfwlx and fwsl.dabh=fwjs.dabh and fwjs.jslx<>'回访' order by fwsl.dabh ";
else
sql = "select * from fwsl,fwjs where fwsl.delflag='否' and fwsl.slrq >=:P_startrq and fwsl.slrq <=:P_endrq and fwsl.hfflag='是' and fwsl.zxfwlx=:zxfwlx and fwjs.jslx='回访' and fwsl.dabh=fwjs.dabh order by fwsl.dabh ";
ADOQuery1->SQL->Add(sql);
ADOQuery1->Parameters->ParamByName("P_startrq")->Value = DateTimePicker1->DateTime;
ADOQuery1->Parameters->ParamByName("P_endrq")->Value = DateTimePicker2->DateTime;
ADOQuery1->Open();
TFwQdForm3 *FwQdForm3;
try
{
FwQdForm3 = new TFwQdForm3(Application);
FwQdForm3->hjgysfy = FwQdForm3->hjryfy = FwQdForm3->hjkhfy = FwQdForm3->hjfwspj = 0;
FwQdForm3->ljgysfy = FwQdForm3->ljryfy = FwQdForm3->ljkhfy = FwQdForm3->ljfwspj = 0;
FwQdForm3->gysfy = FwQdForm3->ryfy = 0;
FwQdForm3->QRLabel14->Caption = FormatDateTime("yyyy-mm-dd",DateTimePicker1->DateTime);
FwQdForm3->QRLabel15->Caption = FormatDateTime("yyyy-mm-dd",DateTimePicker2->DateTime);
FwQdForm3->QRLabel17->Caption = RadioGroup2->Items->Strings[RadioGroup2->ItemIndex];
FwQdForm3->QuickRep1->Preview();
delete FwQdForm3;
}
catch(...)
{
delete FwQdForm3;
Application->MessageBox("运行出现错误!","警告",MB_OK+MB_ICONWARNING);
}
break;
}
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -