📄 ser300_01.pas.svn-base
字号:
implementation
uses SYSDATA, CommFun, TasComm, HwPrint, Ser500_02, Ser510_02, Ser520_02, Ser530_02;
{$R *.dfm}
//设置按钮状态
procedure TSer300_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 TSer300_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'); //查询
TabSheet2.Caption:=GetDBString('SER30001079'); // 汇报明细
lblWorkCode.Caption:=GetDBString('TAS30001001'); // 汇报编号
lblDays.Caption:=GetDBString('SER30001004'); // 汇报日期
lblFactDays.Caption:=GetDBString('SER30001008'); // 制单人员
lblFromDate.Caption:=GetDBString('SER30001006'); // 后续处理
lblFactFromDate.Caption:=GetDBString('SER30001009'); // 修改日期
lblToDate.Caption:=GetDBString('SER30001007'); // 制单日期
lblFactToDate.Caption:=GetDBString('SER30001010'); // 修改人员
lblPerson.Caption:=GetDBString('SER30001003'); // 汇报人员
lblResolvent.Caption:=GetDBString('SER30001005'); // 汇报内容
TabSheet3.Caption:=GetDBString('SER30001080'); // 任务计划
TabSheet4.Caption:=GetDBString('SER30001081'); // 任务明细
lblRepCode.Caption:=GetDBString('SER30001043'); // 任务编号
lblRepDays.Caption:=GetDBString('SER30001044'); // 任务名称
lblSupport.Caption:=GetDBString('SER30001045'); // 任务状态
lblRepDate.Caption:=GetDBString('SER30001015'); // 优先级别
lblPercent.Caption:=GetDBString('SER30001048'); // 申报日期
// lblVor.Caption:=GetDBString('SER30001050'); // 来源类型
lblSupportDays.Caption:=GetDBString('SER30001052'); // 时间单位
lblContinue.Caption:=GetDBString('SER30001046'); // 任务类别
lblDelay.Caption:=GetDBString('SER30001051'); // 来源单号
lblRepMemo.Caption:=GetDBString('SER30001075'); // 任务说明
Label2.Caption:=GetDBString('SER30001053'); // 预计工时
Label4.Caption:=GetDBString('SER30001054'); // 预计开始日期
Label5.Caption:=GetDBString('SER30001055'); // 预计完成日期
Label1.Caption:=GetDBString('SER30001002'); // 来电编号
lblPhoStatus.Caption:=GetDBString('SER30001013'); // 来电状态
Label3.Caption:=GetDBString('SER30001012'); // 来电名称
lblPhoClass.Caption:=GetDBString('SER30001014'); // 来电类别
//
lblStatus.Caption:=GetDBString('SER30001082'); // 项目状态
qrySer530S530_001.DisplayLabel:=GetDBString('SER30001001'); //'汇报编号'
qrySer530S530_002.DisplayLabel:=GetDBString('SER30001002'); //'来电编号'
qrySer530S530_003.DisplayLabel:=GetDBString('SER30001003'); //'汇报人员'
qrySer530S530_004.DisplayLabel:=GetDBString('SER30001004'); //'汇报日期'
qrySer530S530_005.DisplayLabel:=GetDBString('SER30001005'); //'汇报内容'
qrySer530S530_006.DisplayLabel:=GetDBString('SER30001006'); //'后续处理'
qrySer530S530_007.DisplayLabel:=GetDBString('SER30001007'); //'制单日期'
qrySer530S530_008.DisplayLabel:=GetDBString('SER30001008'); //'制单人员'
qrySer530S530_009.DisplayLabel:=GetDBString('SER30001009'); //'修改日期'
qrySer530S530_010.DisplayLabel:=GetDBString('SER30001010'); //'修改人员'
qrySer500S500_001.DisplayLabel:=GetDBString('SER30001011'); //'来电编号'
qrySer500S500_002.DisplayLabel:=GetDBString('SER30001012'); //'来电名称'
qrySer500S110_003.DisplayLabel:=GetDBString('SER30001013'); //'来电状态'
qrySer500S100_002.DisplayLabel:=GetDBString('SER30001014'); //'来电类别'
qrySer500S500_005.DisplayLabel:=GetDBString('SER30001015'); //'优先级别'
qrySer500S500_006.DisplayLabel:=GetDBString('SER30001016'); //'来电类型'
qrySer500S500_007.DisplayLabel:=GetDBString('SER30001017'); //'来电日期'
qrySer500S500_008.DisplayLabel:=GetDBString('SER30001018'); //'来电时间'
qrySer500S500_009.DisplayLabel:=GetDBString('SER30001019'); //'接听时间'
qrySer500H150_003.DisplayLabel:=GetDBString('SER30001020'); //'受理人员'
qrySer500S500_011.DisplayLabel:=GetDBString('SER30001021'); //'来电人员'
qrySer500S500_012.DisplayLabel:=GetDBString('SER30001022'); //'部门名称'
qrySer500S500_013.DisplayLabel:=GetDBString('SER30001023'); //'职务名称'
qrySer500S500_014.DisplayLabel:=GetDBString('SER30001024'); //'联系电话'
qrySer500S500_015.DisplayLabel:=GetDBString('SER30001025'); //'单据类型'
qrySer500S500_016.DisplayLabel:=GetDBString('SER30001026'); //'单据编号'
qrySer500O150_003.DisplayLabel:=GetDBString('SER30001027'); //'客户名称'
qrySer500S500_018.DisplayLabel:=GetDBString('SER30001028'); //'产品编号'
qrySer500S500_019.DisplayLabel:=GetDBString('SER30001029'); //'机身编号'
qrySer500S500_020.DisplayLabel:=GetDBString('SER30001030'); //'是否派工'
qrySer500S500_025.DisplayLabel:=GetDBString('SER30001031'); //'实际开始日期'
qrySer500S500_026.DisplayLabel:=GetDBString('SER30001032'); //'实际完成日期'
qrySer500S500_027.DisplayLabel:=GetDBString('SER30001033'); //'是否报价'
qrySer500S500_028.DisplayLabel:=GetDBString('SER30001034'); //'保养开始日期'
qrySer500S500_029.DisplayLabel:=GetDBString('SER30001035'); //'保养完成日期'
qrySer500S500_030.DisplayLabel:=GetDBString('SER30001036'); //'续保开始日期'
qrySer500S500_031.DisplayLabel:=GetDBString('SER30001037'); //'续保完成日期'
qrySer500S500_033.DisplayLabel:=GetDBString('SER30001038'); //'来电内容'
qrySer500S500_034.DisplayLabel:=GetDBString('SER30001039'); //'制单日期'
qrySer500S500_035.DisplayLabel:=GetDBString('SER30001040'); //'制单人员'
qrySer500S500_036.DisplayLabel:=GetDBString('SER30001041'); //'修改日期'
qrySer500S500_037.DisplayLabel:=GetDBString('SER30001042'); //'修改人员'
qryTas510T510_001.DisplayLabel:=GetDBString('SER30001043'); //'任务编号'
qryTas510T510_002.DisplayLabel:=GetDBString('SER30001044'); //'任务名称'
qryTas510T120_003.DisplayLabel:=GetDBString('SER30001045'); //'任务状态'
qryTas510T100_002.DisplayLabel:=GetDBString('SER30001046'); //'任务类别'
qryTas510T510_005.DisplayLabel:=GetDBString('SER30001047'); //'优先级别'
qryTas510T510_006.DisplayLabel:=GetDBString('SER30001048'); //'申报日期'
qryTas510T510_007.DisplayLabel:=GetDBString('SER30001049'); //'需求日期'
qryTas510T510_008.DisplayLabel:=GetDBString('SER30001050'); //'来源类型'
qryTas510T510_009.DisplayLabel:=GetDBString('SER30001051'); //'来源单号'
qryTas510T510_011.DisplayLabel:=GetDBString('SER30001052'); //'时间单位'
qryTas510T510_012.DisplayLabel:=GetDBString('SER30001053'); //'预计工时'
qryTas510T510_025.DisplayLabel:=GetDBString('SER30001054'); //'预计开始日期'
qryTas510T510_026.DisplayLabel:=GetDBString('SER30001055'); //'预计完成日期'
qryTas510T510_013.DisplayLabel:=GetDBString('SER30001056'); //'实际工时'
qryTas510T510_027.DisplayLabel:=GetDBString('SER30001057'); //'实际开始日期'
qryTas510T510_028.DisplayLabel:=GetDBString('SER30001058'); //'实际完成日期'
qryTas510T510_014.DisplayLabel:=GetDBString('SER30001059'); //'完工比率'
qryTas510T510_015.DisplayLabel:=GetDBString('SER30001060'); //'工单总数'
qryTas510O150_002.DisplayLabel:=GetDBString('SER30001061'); //'客户编号'
qryTas510O150_003.DisplayLabel:=GetDBString('SER30001062'); //'客户名称'
qryTas510O150_005.DisplayLabel:=GetDBString('SER30001063'); //'电话号码'
qryTas510O150_012.DisplayLabel:=GetDBString('SER30001064'); //'客户地址'
qryTas510O151_002.DisplayLabel:=GetDBString('SER30001065'); //'联系人员'
qryTas510O151_004.DisplayLabel:=GetDBString('SER30001066'); //'职务名称'
qryTas510O150_007.DisplayLabel:=GetDBString('SER30001067'); //'电子邮件'
qryTas510I150_002.DisplayLabel:=GetDBString('SER30001068'); //'产品编号'
qryTas510I150_003.DisplayLabel:=GetDBString('SER30001069'); //'产品名称'
qryTas510I150_004.DisplayLabel:=GetDBString('SER30001070'); //'规格型号'
qryTas510I120_003.DisplayLabel:=GetDBString('SER30001071'); //'产品类别'
qryTas510M150_002.DisplayLabel:=GetDBString('SER30001072'); //'制造商号'
qryTas510M150_003.DisplayLabel:=GetDBString('SER30001073'); //'制造商名'
qryTas510T510_018.DisplayLabel:=GetDBString('SER30001074'); //'机身编号'
qryTas510T510_019.DisplayLabel:=GetDBString('SER30001075'); //'任务说明'
qryTas510T510_020.DisplayLabel:=GetDBString('SER30001076'); //'制单日期'
qryTas510T510_021.DisplayLabel:=GetDBString('SER30001077'); //'制单人员'
qryTas510T510_022.DisplayLabel:=GetDBString('SER30001078'); //'修改日期'
PageControl1.ActivePageIndex:=0;
PageControl2.ActivePageIndex:=0;
end;
procedure TSer300_01Form.FormCreate(Sender: TObject);
begin
inherited;
//使用颜色标明任务的状态。如:计划=黑色,执行=蓝色,完成=灰色,返工=红色
if GetSysParams('TAS0010')<>'Y' then
begin
// dbgTas500.OnCustomDrawCell:=nil;
// dbgTas510.OnCustomDrawCell:=nil;
end;
SetInterface;
SetButtonState(False);
LoadFromReg(Self); //这行一定放在打开数据集后面,否则无效
sbSearch.Click;
end;
procedure TSer300_01Form.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
{ qryTas500.Close;
qryTas510.Close;
qryTas520.Close;
qryTas530.Close;
qryTas120.Close;
qryOrd150.Close;
qryOrd151.Close;
qryHrm150.Close;
}end;
procedure TSer300_01Form.dbgSer530BackgroundDrawEvent(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 TSer300_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 not 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;
qrySer530.Close;
qrySer530.SQL.Clear;
qrySer530.SQL.Add('SELECT ser530.* from ser530 where s530_002=:s500_001');
qrySer530.Open;
qryOrd151.Close;
qryOrd151.SQL.Clear;
qryOrd151.SQL.Add('select * from ORD151 where O151_011<>0');
qryOrd151.Open;
qryTas510.Close;
qryTas510.SQL.Clear;
qryTas510.SQL.Add('select B.*,C.T100_002,D.T120_003,E.I150_002,E.I150_003,E.I150_004,F.I120_003,');
qryTas510.SQL.Add(' G.O150_001,G.O150_002,G.O150_003,G.O150_005,G.O150_007,G.O150_012,I.H150_002,I.H150_003,');
qryTas510.SQL.Add('H.O150_002 as M150_002,H.O150_003 as M150_003,D.T120_005');
qryTas510.SQL.Add(' from TAS510 B,TAS100 C,TAS120 D,INV150 E,INV120 F,ORD150 G,ORD150 H, HRM150 I');
qryTas510.SQL.Add(' where B.T510_004=C.T100_001 and B.T510_003=D.T120_001 and B.T510_024=I.H150_001 and');
qryTas510.SQL.Add('B.T510_016=G.O150_001 and B.T510_017=E.I150_001 and E.I150_005=F.I120_001 and');
qryTas510.SQL.Add('B.T510_016=G.O150_001 and B.T510_017=E.I150_001 and E.I150_010=H.O150_001');
qryTas510.SQL.Add('and T510_008=1 and T510_009=:s500_001');
qryTas510.SQL.Add('order by T510_001');
qryTas510.Open;
Screen.Cursor:=crDefault;
end;
procedure TSer300_01Form.qryTas510T510_008GetText(Sender: TField; var Text: String;
DisplayText: Boolean);
begin
inherited;
if qryTas510.IsEmpty then Exit;
case Sender.AsInteger of
0:Text:=AType[0]; //销售订单
1:Text:=AType[1]; //来电记录
2:Text:=AType[2]; //项目计划
3:Text:=AType[3]; //手工输入
end;
end;
procedure TSer300_01Form.qryTas510T510_011GetText(Sender: TField; var Text: String;
DisplayText: Boolean);
begin
inherited;
if qryTas510.IsEmpty then Exit;
case Sender.AsInteger of
0:Text:=AUnit[0]; //时
1:Text:=AUnit[1]; //天
2:Text:=AUnit[2]; //周
3:Text:=AUnit[3]; //月
end;
end;
procedure TSer300_01Form.dbgTas510CustomDrawCell(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 TSer300_01Form.cbClassChange(Sender: TObject);
begin
inherited;
sbSearch.Click;
end;
procedure TSer300_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 TSer300_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 TSer300_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 TSer300_01Form.ActLastExecute(Sender: TObject);
begin
inherited;
//最后
if qrySer500.IsEmpty then Exit;
qrySer500.Last;
ActNext.Enabled:=False;
ActLast.Enabled:=False;
ActFirst.Enabled:=True;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -