📄 ser200_01.pas.svn-base
字号:
//查询
ACust:='';
AItem:='';
AMachine:='';
if trim(edtCust.Text)<>'' then
begin
if not qryOrd150.Locate('O150_002',edtCust.Text,[]) then
begin
ShowMsg('UMS10000264'); //输入的客户编号无效
edtCust.SetFocus;
Abort;
end;
ACust:=qryOrd150.FieldByName('O150_001').AsString;
end;
if trim(edtItem.Text)<>'' then
begin
SYSDM.qryQuery.Close;
SYSDM.qryQuery.SQL.Clear;
SYSDM.qryQuery.SQL.Add('select A.O153_002 from ORD153 A, INV150 B where A.O153_002=B.I150_001 and A.O153_001='+ACust+' and B.I150_002='+''''+edtItem.Text+'''');
SYSDM.qryQuery.Open;
if SYSDM.qryQuery.IsEmpty then
begin
ShowMsg('UMS10000267'); //输入的产品编号无效
edtItem.SetFocus;
Abort;
end;
AItem:=SYSDM.qryQuery.FieldByName('O153_002').AsString;
end;
if trim(edtMachine.Text)<>'' then
begin
SYSDM.qryQuery.Close;
SYSDM.qryQuery.SQL.Clear;
SYSDM.qryQuery.SQL.Add('select O153_003 from ORD153 where O153_001='+ACust+' and O153_002='+AItem+' and O153_003='+''''+edtMachine.Text+'''');
SYSDM.qryQuery.Open;
if SYSDM.qryQuery.IsEmpty then
begin
ShowMsg('UMS10000268'); //输入的机身编号无效
edtMachine.SetFocus;
Abort;
end;
AMachine:=SYSDM.qryQuery.FieldByName('O153_003').AsString;
end;
Screen.Cursor:=crHourGlass;
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select SER500.*,S110_003,S100_003');
ADOQuery1.SQL.Add('from SER500,SER110,SER100');
ADOQuery1.SQL.Add('where S500_003=S110_001 and S500_004=S100_001' );
if edtCust.Text<>'' then ADOQuery1.SQL.Add(' and S500_017='+ACust);
if edtItem.Text<>'' then ADOQuery1.SQL.Add(' and S500_018='+AItem);
if edtMachine.Text<>'' then ADOQuery1.SQL.Add(' and S500_019='+''''+AMachine+'''');
ADOQuery1.SQL.Add('order by S500_017,S500_018,S500_019,S500_001');
ADOQuery1.Open;
Screen.Cursor:=crDefault;
end;
procedure TSer200_01Form.sbCustClick(Sender: TObject);
begin
inherited;
//客户编号查询
if not edtCust.Focused then edtCust.SetFocus;
HwSelDataForm:=THwSelDataForm.Create(Application);
HwSelDataForm.OpenSelData(qryOrd150,nil);
if HwSelDataForm.ShowModal=1 then //如果打开查询窗口成功,将ord150的指针指向想要的客户记录
begin
if qryOrd150.IsEmpty then Exit;
edtCust.Text:=qryOrd150.FieldByName('O150_002').AsString;
if edtCust.Text<>'' then
begin
ACust:=qryOrd150.FieldByName('O150_001').AsString;
end;
qryOrd153.Close;
qryOrd153.SQL.Clear;
qryOrd153.SQL.Add('select O153_001,O153_002,O153_003,O153_011,I150_002,I150_003 from ord153,inv150 where ORD153.O153_002=INV150.I150_001 and O153_001='+ACust);
qryOrd153.Open;
end;
edtItem.Text:='';
edtMachine.Text:='';
end;
procedure TSer200_01Form.SpeedButton1Click(Sender: TObject);
begin
inherited;
//产品编号查询
if not qryOrd150.Locate('O150_002',edtCust.Text,[]) then
begin
ShowMsg('UMS10000266'); //必须先输入正确的客户编号
edtCust.SetFocus;
Abort;
end;
if not edtItem.Focused then edtItem.SetFocus;
HwSelDataForm:=THwSelDataForm.Create(Application);
HwSelDataForm.OpenSelData(qryOrd153,nil);
if HwSelDataForm.ShowModal=1 then
begin
edtItem.Text:=qryOrd153.FieldByName('I150_002').AsString;
edtMachine.Text:=qryOrd153.FieldByName('O153_003').AsString;
AItem:=qryOrd153.FieldByName('O153_002').AsString;
AMachine:=edtMachine.Text;
end;
end;
procedure TSer200_01Form.SpeedButton2Click(Sender: TObject);
begin
inherited;
//机身编号查询
if not qryOrd150.Locate('O150_002',edtCust.Text,[]) then
begin
ShowMsg('UMS10000266'); //必须先输入正确的客户编号
edtCust.SetFocus;
Abort;
end;
if not edtMachine.Focused then edtMachine.SetFocus;
HwSelDataForm:=THwSelDataForm.Create(Application);
HwSelDataForm.OpenSelData(qryOrd153,nil);
if HwSelDataForm.ShowModal=1 then
begin
edtItem.Text:=qryOrd153.FieldByName('I150_002').AsString;
edtMachine.Text:=qryOrd153.FieldByName('O153_003').AsString;
AItem:=qryOrd153.FieldByName('O153_002').AsString;
AMachine:=qryOrd153.FieldByName('O153_003').AsString;
end;
end;
procedure TSer200_01Form.ReportGetValue(const ParName: String; var ParValue: Variant);
begin
inherited;
if ParName='S500_001' then ParValue:=ADOQuery1S500_001.DisplayLabel //来电编号
else if ParName='S500_002' then ParValue:=ADOQuery1S500_002.DisplayLabel //来电名称
else if ParName='S500_005' then ParValue:=ADOQuery1S500_005.DisplayLabel //优先级别
else if ParName='S500_006' then ParValue:=ADOQuery1S500_006.DisplayLabel //来电类型
else if ParName='S500_007' then ParValue:=ADOQuery1S500_007.DisplayLabel //来电日期
else if ParName='S500_008' then ParValue:=ADOQuery1S500_008.DisplayLabel //来电时间
else if ParName='S500_009' then ParValue:=ADOQuery1S500_009.DisplayLabel //接听时间
else if ParName='S500_010' then ParValue:=ADOQuery1S500_010.DisplayLabel //受理人员
else if ParName='S500_011' then ParValue:=ADOQuery1S500_011.DisplayLabel //来电人员
else if ParName='S500_012' then ParValue:=ADOQuery1S500_012.DisplayLabel //部门名称
else if ParName='S500_013' then ParValue:=ADOQuery1S500_013.DisplayLabel //职务名称
else if ParName='S500_014' then ParValue:=ADOQuery1S500_014.DisplayLabel //联系电话
else if ParName='S500_015' then ParValue:=ADOQuery1S500_015.DisplayLabel //单据类型
else if ParName='S500_016' then ParValue:=ADOQuery1S500_016.DisplayLabel //单据编号
else if ParName='S500_017' then ParValue:=ADOQuery1S500_017.DisplayLabel //客戶编号
else if ParName='S500_019' then ParValue:=ADOQuery1S500_019.DisplayLabel //机身编号
else if ParName='S500_020' then ParValue:=ADOQuery1S500_020.DisplayLabel //是否派工
else if ParName='S500_027' then ParValue:=ADOQuery1S500_027.DisplayLabel //是否报价
else if ParName='S500_028' then ParValue:=ADOQuery1S500_028.DisplayLabel //保养开始日期
else if ParName='S500_029' then ParValue:=ADOQuery1S500_029.DisplayLabel //保养完成日期
else if ParName='S500_030' then ParValue:=ADOQuery1S500_030.DisplayLabel //续保开始日期
else if ParName='S500_031' then ParValue:=ADOQuery1S500_031.DisplayLabel //续保完成日期
else if ParName='S500_032' then ParValue:=ADOQuery1S500_032.DisplayLabel //产品来源
else if ParName='S500_033' then ParValue:=ADOQuery1S500_033.DisplayLabel //来电内容
else if ParName='S500_034' then ParValue:=ADOQuery1S500_034.DisplayLabel //制单日期
else if ParName='S500_035' then ParValue:=ADOQuery1S500_035.DisplayLabel //制单人员
else if ParName='S500_036' then ParValue:=ADOQuery1S500_036.DisplayLabel //修改日期
else if ParName='S500_037' then ParValue:=ADOQuery1S500_037.DisplayLabel //修改人员
else if ParName='S110_003' then ParValue:=ADOQuery1S110_003.DisplayLabel //来电状态
else if ParName='S100_003' then ParValue:=ADOQuery1S100_003.DisplayLabel //来电类别
end;
procedure TSer200_01Form.ActPrintExecute(Sender: TObject);
begin
try
SYSDM.frReport2.OnGetValue:=ReportGetValue;
inherited;
finally
SYSDM.frReport2.OnGetValue:=nil;
end;
end;
initialization
RegisterClass(TSer200_01Form);
finalization
UnRegisterClass(TSer200_01Form);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -