📄 ser310_01.pas.svn-base
字号:
{$R *.dfm}
//设置按钮状态
procedure TSer310_01Form.SetButtonState(AInsUpd:Boolean);
begin
ActFirst.Enabled:=not AInsUpd;
ActPrior.Enabled:=not AInsUpd;
ActNext.Enabled:=not AInsUpd;
ActLast.Enabled:=not AInsUpd;
ActLocate.Enabled:=not AInsUpd;
ActSearch.Enabled:=not AInsUpd;
ActPrint.Enabled:=(ARights[5]='Y') and (not AInsUpd);
ActExit.Enabled:=True;
end;
procedure TSer310_01Form.SetInterface;
begin
Image1.Picture.Bitmap.LoadFromResourceName(AImgHandle,'TOPTITL');
ActFirst.Caption:=GetDBString('COM00005001'); //最前
ActPrior.Caption:=GetDBString('COM00005002'); //上移
ActNext.Caption:=GetDBString('COM00005003'); //下移
ActLast.Caption:=GetDBString('COM00005004'); //最后
ActLocate.Caption:=GetDBString('COM00005011'); //查找
ActSearch.Caption:=GetDBString('COM00005012'); //查询
ActPrint.Caption:=GetDBString('COM00005013'); //打印
ActExit.Caption:=GetDBString('COM00005015'); //退出
ActFirst.Hint:=GetDBString('COM00005001',2); //移到第一条记录
ActPrior.Hint:=GetDBString('COM00005002',2); //移到上一条记录
ActNext.Hint:=GetDBString('COM00005003',2); //移到下一条记录
ActLast.Hint:=GetDBString('COM00005004',2); //移到最后一条记录
ActLocate.Hint:=GetDBString('COM00005011',2); //快速定位记录
ActSearch.Hint:=GetDBString('COM00005012',2); //按条件查询数据
ActPrint.Hint:=GetDBString('COM00005013',2); //将数据打印出来
ActExit.Hint:=GetDBString('COM00005015',2); //关闭当前窗口
ActFirst2.Caption:=ActFirst.Caption; //最前
ActPrior2.Caption:=ActPrior.Caption; //上移
ActNext2.Caption:=ActNext.Caption; //下移
ActLast2.Caption:=ActLast.Caption; //最后
ActLocate2.Caption:=ActLocate.Caption; //查找
ActFirst2.Hint:=ActFirst.Hint; //移到第一条记录
ActPrior2.Hint:=ActPrior.Hint; //移到上一条记录
ActNext2.Hint:=ActNext.Hint; //移到下一条记录
ActLast2.Hint:=ActLast.Hint; //移到最后一条记录
ActLocate2.Hint:=ActLocate.Hint; //快速定位记录
ActFirst3.Caption:=ActFirst.Caption; //最前
ActPrior3.Caption:=ActPrior.Caption; //上移
ActNext3.Caption:=ActNext.Caption; //下移
ActLast3.Caption:=ActLast.Caption; //最后
ActLocate3.Caption:=ActLocate.Caption; //查找
ActFirst3.Hint:=ActFirst.Hint; //移到第一条记录
ActPrior3.Hint:=ActPrior.Hint; //移到上一条记录
ActNext3.Hint:=ActNext.Hint; //移到下一条记录
ActLast3.Hint:=ActLast.Hint; //移到最后一条记录
ActLocate3.Hint:=ActLocate.Hint; //快速定位记录
AType[0]:=GetDBString('TAS31001035'); //销售订单
AType[1]:=GetDBString('TAS31001036'); //来电记录
AType[2]:=GetDBString('TAS31001037'); //项目计划
AType[3]:=GetDBString('TAS31001038'); //手工输入
AUnit[0]:=GetDBString('TAS31001039'); //时
AUnit[1]:=GetDBString('TAS31001040'); //天
AUnit[2]:=GetDBString('TAS31001041'); //周
AUnit[3]:=GetDBString('TAS31001042'); //月
sbSearch.Caption:=GetDBString('TAS31001043'); //查询
Caption:=GetDBString('SER31001001');//'客户投诉跟踪'
TabSheet1.Caption:=GetDBString('SER31001002');//'解决方案'
TabSheet2.Caption:=GetDBString('SER31001003');//'派工记录'
TabSheet5.Caption:=GetDBString('SER31001004');//'处罚记录'
TabSheet6.Caption:=GetDBString('SER31001005');//'赔偿记录'
TabSheet7.Caption:=GetDBString('SER31001006');//'退货记录'
lblTaskCode.Caption:=GetDBString('SER31001007');//'来电编号'
lblTaskName.Caption:=GetDBString('SER31001008');//'来电名称'
lblTaskStatus.Caption:=GetDBString('SER31001009');//'来电状态'
lblTaskClass.Caption:=GetDBString('SER31001010');//'来电类别'
TabSheet3.Caption:=GetDBString('SER31001011');//'调查过程记录'
TabSheet4.Caption:=GetDBString('SER31001012');//'调查过程明细'
lblRepCode.Caption:=GetDBString('SER31001013');//'调查单号'
lblRepDays.Caption:=GetDBString('SER31001014');//'调查人员'
lblSupport.Caption:=GetDBString('SER31001015');//'调查日期'
lblRepDate.Caption:=GetDBString('SER31001016');//'部门名称'
lblPercent.Caption:=GetDBString('SER31001017');//'修改人员'
lblSupportDays.Caption:=GetDBString('SER31001019');//'受调查人'
lblContinue.Caption:=GetDBString('SER31001020');//'职位名称'
lblDelay.Caption:=GetDBString('SER31001021');//'调查客戶'
lblRepMemo.Caption:=GetDBString('SER31001022');//'制单日期'
Label1.Caption:=GetDBString('SER31001023');//'制单人员'
Label2.Caption:=GetDBString('SER31001024');//'修改日期'
sbSearch.Caption:=GetDBString('SER31001025');//'查询'
lblStatus.Caption:=GetDBString('SER31001026');//'来电状态'
Label3.Caption:=GetDBString('SER31001027');// '方案编号'
Label9.Caption:=GetDBString('SER31001028');// '方案状态'
Label5.Caption:=GetDBString('SER31001029');// '审核日期'
Label7.Caption:=GetDBString('SER31001030');// '审核人员'
Label8.Caption:=GetDBString('SER31001031');// '解决方法'
Label12.Caption:=GetDBString('SER31001032');//'制单日期'
Label10.Caption:=GetDBString('SER31001033');//'制单人员'
Label4.Caption:=GetDBString('SER31001034');// '修改日期'
Label6.Caption:=GetDBString('SER31001035');// '修改人员'
qrySer520S520_001.DisplayLabel:=GetDBString('SER31001027');//方案编号'
qrySer520S520_003.DisplayLabel:=GetDBString('SER31001028');//方案状态'
qrySer520S520_004.DisplayLabel:=GetDBString('SER31001029');//审核日期'
qrySer520S520_005.DisplayLabel:=GetDBString('SER31001030');//审核人员'
qrySer520S520_011.DisplayLabel:=GetDBString('SER31001031');//解决方法'
qrySer520S520_012.DisplayLabel:=GetDBString('SER31001032');//制单日期'
qrySer520S520_013.DisplayLabel:=GetDBString('SER31001033');//制单人员'
qrySer520S520_014.DisplayLabel:=GetDBString('SER31001034');//修改日期'
qrySer520S520_015.DisplayLabel:=GetDBString('SER31001035');//修改人员'
qrySer510S510_001.DisplayLabel:=GetDBString('SER31001036');//调查单号'
qrySer510S510_003.DisplayLabel:=GetDBString('SER31001037');//调查日期'
qrySer510H150_003.DisplayLabel:=GetDBString('SER31001038');//调查人员'
qrySer510S510_006.DisplayLabel:=GetDBString('SER31001039');//受调查人'
qrySer510S510_007.DisplayLabel:=GetDBString('SER31001040');//部门名称'
qrySer510S510_008.DisplayLabel:=GetDBString('SER31001041');//职位名称'
qrySer510S510_009.DisplayLabel:=GetDBString('SER31001042');//调查内容'
qrySer510S510_010.DisplayLabel:=GetDBString('SER31001043');//制单日期'
qrySer510S510_011.DisplayLabel:=GetDBString('SER31001044');//制单人员'
qrySer510S510_012.DisplayLabel:=GetDBString('SER31001045');//修改日期'
qrySer510S510_013.DisplayLabel:=GetDBString('SER31001046');//修改人员'
qrySer500S500_001.DisplayLabel:=GetDBString('SER31001047');//来电编号'
qrySer500S500_002.DisplayLabel:=GetDBString('SER31001048');//来电名称'
qrySer500S110_003.DisplayLabel:=GetDBString('SER31001049');//来电状态'
qrySer500S100_002.DisplayLabel:=GetDBString('SER31001050');//来电类别'
qrySer500S500_005.DisplayLabel:=GetDBString('SER31001051');//优先级别'
qrySer500S500_006.DisplayLabel:=GetDBString('SER31001052');//来电类型'
qrySer500S500_007.DisplayLabel:=GetDBString('SER31001053');//来电日期'
qrySer500S500_008.DisplayLabel:=GetDBString('SER31001054');//来电时间'
qrySer500S500_009.DisplayLabel:=GetDBString('SER31001055');//接听时间'
qrySer500H150_003.DisplayLabel:=GetDBString('SER31001056');//受理人员'
qrySer500S500_011.DisplayLabel:=GetDBString('SER31001057');//来电人员'
qrySer500S500_012.DisplayLabel:=GetDBString('SER31001058');//部门名称'
qrySer500S500_013.DisplayLabel:=GetDBString('SER31001059');//职务名称'
qrySer500S500_014.DisplayLabel:=GetDBString('SER31001060');//联系电话'
qrySer500S500_015.DisplayLabel:=GetDBString('SER31001061');//单据类型'
qrySer500S500_016.DisplayLabel:=GetDBString('SER31001062');//单据编号'
qrySer500O150_003.DisplayLabel:=GetDBString('SER31001063');//客户名称'
qrySer500S500_018.DisplayLabel:=GetDBString('SER31001064');//产品编号'
qrySer500S500_019.DisplayLabel:=GetDBString('SER31001065');//机身编号'
qrySer500S500_020.DisplayLabel:=GetDBString('SER31001066');//是否派工'
qrySer500S500_025.DisplayLabel:=GetDBString('SER31001067');//实际开始日期'
qrySer500S500_026.DisplayLabel:=GetDBString('SER31001068');//实际完成日期'
qrySer500S500_027.DisplayLabel:=GetDBString('SER31001069');//是否报价'
qrySer500S500_028.DisplayLabel:=GetDBString('SER31001070');//保养开始日期'
qrySer500S500_029.DisplayLabel:=GetDBString('SER31001071');//保养完成日期'
qrySer500S500_030.DisplayLabel:=GetDBString('SER31001072');//续保开始日期'
qrySer500S500_031.DisplayLabel:=GetDBString('SER31001073');//续保完成日期'
qrySer500S500_033.DisplayLabel:=GetDBString('SER31001074');//来电内容'
qrySer500S500_034.DisplayLabel:=GetDBString('SER31001075');//制单日期'
qrySer500S500_035.DisplayLabel:=GetDBString('SER31001076');//制单人员'
qrySer500S500_036.DisplayLabel:=GetDBString('SER31001077');//修改日期'
qrySer500S500_037.DisplayLabel:=GetDBString('SER31001078');//修改人员'
qrySer521S521_002.DisplayLabel:=GetDBString('SER31001079');//序号'
qrySer521S521_003.DisplayLabel:=GetDBString('SER31001080');//任务编号'
qrySer521S521_004.DisplayLabel:=GetDBString('SER31001081');//執行人员'
qrySer521S521_005.DisplayLabel:=GetDBString('SER31001082');//预计工时'
qrySer521S521_006.DisplayLabel:=GetDBString('SER31001083');//时间单位'
qrySer521S521_007.DisplayLabel:=GetDBString('SER31001084');//预计开始日期
qrySer521S521_008.DisplayLabel:=GetDBString('SER31001085');//预计完成日期'
qrySer522S522_002.DisplayLabel:=GetDBString('SER31001086');//序号'
qrySer522S522_003.DisplayLabel:=GetDBString('SER31001087');//预计日期'
qrySer522H150_003.DisplayLabel:=GetDBString('SER31001088');//员工姓名'
qrySer522S522_005.DisplayLabel:=GetDBString('SER31001089');//罚款金额'
qrySer523S523_002.DisplayLabel:=GetDBString('SER31001090');//序号'
qrySer523S523_003.DisplayLabel:=GetDBString('SER31001091');//预计日期'
qrySer523O150_003.DisplayLabel:=GetDBString('SER31001092');//客户名称'
qrySer523S523_005.DisplayLabel:=GetDBString('SER31001093');//赔偿金额'
qrySer524S524_002.DisplayLabel:=GetDBString('SER31001094');//序号'
qrySer524S524_003.DisplayLabel:=GetDBString('SER31001095');//预计日期'
qrySer524S524_004.DisplayLabel:=GetDBString('SER31001096');//货品编号'
qrySer524S524_005.DisplayLabel:=GetDBString('SER31001097');//货品数量'
qrySer524S524_006.DisplayLabel:=GetDBString('SER31001098');//货品单价'
qrySer524S524_007.DisplayLabel:=GetDBString('SER31001099');//货品金额'
cbStatus.ItemIndex:=0;
PageControl1.ActivePageIndex:=0;
PageControl2.ActivePageIndex:=0;
end;
procedure TSer310_01Form.FormCreate(Sender: TObject);
begin
inherited;
//使用颜色标明任务的状态。如:计划=黑色,执行=蓝色,完成=灰色,返工=红色
if GetSysParams('TAS0010')<>'Y' then
begin
dbgSer500.OnCustomDrawCell:=nil;
dbgSer510.OnCustomDrawCell:=nil;
end;
SetInterface;
SetButtonState(False);
LoadFromReg(Self); //这行一定放在打开数据集后面,否则无效
sbSearch.Click;
end;
procedure TSer310_01Form.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
qrySer500.Close;
qrySer510.Close;
qrySer520.Close;
qrySer521.Close;
qrySer522.Close;
qrySer523.Close;
qrySer524.Close;
end;
procedure TSer310_01Form.dbgTas520BackgroundDrawEvent(Sender: TObject;
ACanvas: TCanvas; ARect: TRect);
var
AText:string;
begin
inherited;
ARect.Left:=0;
ARect.Top:=0;
ACanvas.Brush.Color:=TdxDBGrid(Sender).GroupPanelColor;
ACanvas.Font.Color:=TdxDBGrid(Sender).GroupPanelFontColor;
//您可以把列标题拖放到此处使记录按此列进行分组
if TdxDBGrid(Sender).GroupColumnCount=0 then AText:=' '+GetDBString('NOT10001012') else AText:='';
Windows.FillRect(ACanvas.Handle, ARect, 0);
DrawText(ACanvas.Handle, PChar(AText), Length(AText), ARect, DT_LEFT or DT_EXPANDTABS or DT_NOPREFIX or DT_SINGLELINE or DT_VCENTER);
end;
procedure TSer310_01Form.sbSearchClick(Sender: TObject);
begin
inherited;
//查询
qrySer500.DisableControls;
qrySer500.Close;
qrySer500.SQL.Clear;
if cbStatus.ItemIndex=0 then
begin
qrySer500.SQL.Add('SELECT SER500.S500_001,S500_004,SER500.S500_002, SER110.S110_003, SER100.S100_002, SER500.S500_005,');
qrySer500.SQL.Add('SER500.S500_006, SER500.S500_007, SER500.S500_008, SER500.S500_009, HRM150.H150_003, SER500.S500_011,');
qrySer500.SQL.Add('SER500.S500_012, SER500.S500_013, SER500.S500_014, SER500.S500_015, SER500.S500_016, ORD150.O150_003,');
qrySer500.SQL.Add('SER500.S500_018, SER500.S500_019, SER500.S500_020, SER500.S500_025, SER500.S500_026, SER500.S500_027,');
qrySer500.SQL.Add(' SER500.S500_028, SER500.S500_029, SER500.S500_030, SER500.S500_031, SER500.S500_033, SER500.S500_034,');
qrySer500.SQL.Add('SER500.S500_035, SER500.S500_036, SER500.S500_037');
qrySer500.SQL.Add(' FROM (((SER500 LEFT JOIN SER110 ON SER500.S500_003=SER110.S110_001) LEFT JOIN SER100 ON SER500.S500_004=SER100.S100_001) LEFT JOIN HRM150 ON SER500.S500_010=HRM150.H150_001) LEFT JOIN ORD150 ON SER500.S500_017=ORD150.O150_001');
qrySer500.SQL.Add(' where s100_005=-1');
qrySer500.SQL.Add(' order by S500_001');
end else
begin
qrySer500.SQL.Add('SELECT SER500.S500_001,S500_004,SER500.S500_002, SER110.S110_003, SER100.S100_002, SER500.S500_005, SER500.S500_006,');
qrySer500.SQL.Add('SER500.S500_007, SER500.S500_008, SER500.S500_009, HRM150.H150_003, SER500.S500_011, SER500.S500_012, SER500.S500_013,');
qrySer500.SQL.Add('SER500.S500_014, SER500.S500_015, SER500.S500_016, ORD150.O150_003, SER500.S500_018, SER500.S500_019, SER500.S500_020, SER500.S500_025, SER500.S500_026, SER500.S500_027, SER500.S500_028, SER500.S500_029, SER500.S500_030, ');
qrySer500.SQL.Add('SER500.S500_031, SER500.S500_033, SER500.S500_034, SER500.S500_035, SER500.S500_036, SER500.S500_037');
qrySer500.SQL.Add(' FROM (((SER500 LEFT JOIN SER110 ON SER500.S500_003=SER110.S110_001) LEFT JOIN SER100 ON SER500.S500_004=SER100.S100_001) LEFT JOIN HRM150 ON SER500.S500_010=HRM150.H150_001) LEFT JOIN ORD150 ON SER500.S500_017=ORD150.O150_001');
qrySer500.SQL.Add(' where S500_004='+IntToStr(cbStatus.ItemIndex));
qrySer500.SQL.Add(' order by S500_001');
end;
qrySer500.Open;
qrySer500.EnableControls;
qrySer510.Close;
qrySer510.SQL.Clear;
qrySer510.SQL.Add('SELECT SER510.S510_001,S510_002, SER510.S510_003, HRM150.H150_003, SER510.S510_006, SER510.S510_007, SER510.S510_008, SER510.S510_009, SER510.S510_010, SER510.S510_011, SER510.S510_012, SER510.S510_013');
qrySer510.SQL.Add(' FROM SER510 LEFT JOIN HRM150 ON SER510.S510_004 = HRM150.H150_001');
qrySer510.SQL.Add(' where S510_002=:S500_001');
qrySer510.SQL.Add(' order by S510_001');
qrySer510.Open;
qrySer520.Close;
qrySer520.SQL.Clear;
qrySer520.SQL.Add('SELECT SER520.* FROM SER520 where S520_002=:S500_001 order by s520_001');
qrySer520.Open;
qrySer521.Close;
qrySer521.SQL.Clear;
qrySer521.SQL.Add('SELECT * FROM SER521 where S521_001=:S520_001');
qrySer521.Open;
qrySer522.Close;
qrySer522.SQL.Clear;
qrySer522.SQL.Add('SELECT S522_002,S522_003,H150_003,S522_005 FROM SER522 LEFT JOIN HRM150 ON SER522.S522_004 = HRM150.H150_001 where S522_001=:S520_001');
qrySer522.Open;
qrySer523.Close;
qrySer523.SQL.Clear;
qrySer523.SQL.Add('SELECT S523_002,S523_003,O150_003,S523_005 FROM SER523 LEFT JOIN ORD150 ON SER523.S523_004 = ORD150.O150_001 where S523_001=:S520_001');
qrySer523.Open;
qrySer524.Close;
qrySer524.SQL.Clear;
qrySer524.SQL.Add('SELECT SER524.S524_002, SER524.S524_003, SER524.S524_004, SER524.S524_005, SER524.S524_006, SER524.S524_007 FROM SER524 where S524_001=:S520_001');
qrySer524.Open;
Screen.Cursor:=crDefault;
end;
{
procedure TSer300_01Form.dbgSer510CustomDrawCell(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn;
ASelected, AFocused, ANewItemRow: Boolean; var AText: String;
var AColor: TColor; AFont: TFont; var AAlignment: TAlignment;
var ADone: Boolean);
begin
inherited;
if ANode.HasChildren then Exit;
if not ASelected then
if ANode.Values[dbgTas510T120_005.Index]<>null then AFont.Color:=ANode.Values[dbgTas510T120_005.Index];
end;
}
procedure TSer310_01Form.cbClassChange(Sender: TObject);
begin
inherited;
sbSearch.Click;
end;
procedure TSer310_01Form.ActFirstExecute(Sender: TObject);
begin
inherited;
//最前
if qrySer500.IsEmpty then Exit;
qrySer500.First;
ActFirst.Enabled:=False;
ActPrior.Enabled:=False;
ActNext.Enabled:=True;
ActLast.Enabled:=True;
end;
procedure TSer310_01Form.ActPriorExecute(Sender: TObject);
begin
inherited;
//上移
if qrySer500.IsEmpty then Exit;
qrySer500.Prior;
ActNext.Enabled:=not qrySer500.Eof;
ActLast.Enabled:=not qrySer500.Eof;
ActFirst.Enabled:=not qrySer500.Bof;
ActPrior.Enabled:=not qrySer500.Bof;
end;
procedure TSer310_01Form.ActNextExecute(Sender: TObject);
begin
inherited;
//下移
if qrySer500.IsEmpty then Exit;
qrySer500.Next;
ActNext.Enabled:=not qrySer500.Eof;
ActLast.Enabled:=not qrySer500.Eof;
ActFirst.Enabled:=not qrySer500.Bof;
ActPrior.Enabled:=not qrySer500.Bof;
end;
procedure TSer310_01Form.ActLastExecute(Sender: TObject);
begin
inherited;
//最后
if qrySer500.IsEmpty then Exit;
qrySer500.Last;
ActNext.Enabled:=False;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -