⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demand_fad.pas

📁 delphi的一个开发实例
💻 PAS
📖 第 1 页 / 共 4 页
字号:
                end;
            except
                Application.MessageBox('操作失败!,请确认!',pchar(application.Title),mb_iconwarning);
                Exit;
            end;
        end;
    end
    else if Flag3=2 then
    begin
        if Application.MessageBox('确定需要【反审核】该单据吗?'+#13#10+'如果【反审核】你将使后面级别的人的【审核】作废,'+#13#10+'后面级别的人必须重新【审核】,才能够生效,请确认!',pchar(application.Title),mb_okcancel)=idok then
        begin
            try
                with frm_data.ClientDataSet_Receipt do
                begin
                    Close;
                    Commandtext:='';
                    Commandtext:='Update [Receipt] set Examine_Man3='''',Examine_Man3='''',Examine_Man4='''',Examine_Man5='''' where Receipt_No='''+Trim(Edit_Submit_quit_NO.Text)+''' and Receipt_Name=''受托代销退货单''';
                    Execute;
                    L3.Caption:='';
                    L3.Caption:=LevelName2+':'+Handle_Man;
                    L3.Visible:=True;
                    L3.Caption:=LevelName3+':'+Handle_Man;
                    L4.Caption:=LevelName4+':'+Handle_Man;
                    L5.Caption:=LevelName5+':'+Handle_Man;
                    Flag3:=1;Flag3:=1; Flag4:=1; Flag5:=1;
                    Application.MessageBox('【反审核】操作成功!请确认',Pchar(application.Title),MB_ICONwarning);
                    Cmd_Check_Filsh;
                end;
            except
                Application.MessageBox('操作失败!,请确认!',pchar(application.Title),mb_iconwarning);
                Exit;
            end;
        end;
    end;
end;

procedure Tfrm_Demand_Fad.Cmd4Click(Sender: TObject);
begin
    if Flag4=1 then
    begin
        if Application.MessageBox('确定需要【审核】该单据吗?请确认!',pchar(application.Title),mb_okcancel)=idok then
        begin
            try
                with frm_data.ClientDataSet_Receipt do
                begin
                    Close;
                    Commandtext:='';
                    Commandtext:='Update [Receipt] set Examine_Man4='''+Trim(Handle_Man)+''' where Receipt_No='''+Trim(Edit_Submit_quit_NO.Text)+''' and Receipt_Name=''受托代销退货单''';
                    Execute;
                    L4.Caption:='';
                    L4.Caption:=LevelName4+'【已审】';
                    Flag4:=2;
                    Application.MessageBox('【审核】操作成功!请确认',Pchar(application.Title),MB_ICONwarning);
                    Cmd_Check_Filsh;
                end;
            except
                Application.MessageBox('操作失败!,请确认!',pchar(application.Title),mb_iconwarning);
                Exit;
            end;
        end;
    end
    else if Flag4=2 then
    begin
        if Application.MessageBox('确定需要【反审核】该单据吗?'+#13#10+'如果【反审核】你将使后面级别的人的【审核】作废,'+#13#10+'后面级别的人必须重新【审核】,才能够生效,请确认!',pchar(application.Title),mb_okcancel)=idok then
        begin
            try
                with frm_data.ClientDataSet_Receipt do
                begin
                    Close;
                    Commandtext:='';
                    Commandtext:='Update [Receipt] set Examine_Man4='''',Examine_Man5='''' where Receipt_No='''+Trim(Edit_Submit_quit_NO.Text)+''' and Receipt_Name=''受托代销退货单''';
                    Execute;

                    L4.Caption:=LevelName4+':'+Handle_Man;
                    L4.Visible:=True;
                    L5.Caption:=LevelName5+':'+Handle_Man;
                    Flag4:=1;Flag5:=1;
                    Application.MessageBox('【反审核】操作成功!请确认',Pchar(application.Title),MB_ICONwarning);
                    Cmd_Check_Filsh;
                end;
            except
                Application.MessageBox('操作失败!,请确认!',pchar(application.Title),mb_iconwarning);
                Exit;
            end;
        end;
    end;
end;

procedure Tfrm_Demand_Fad.Cmd5Click(Sender: TObject);
begin
    if Flag5=1 then
    begin
        if Application.MessageBox('确定需要【审核】该单据吗?请确认!',pchar(application.Title),mb_okcancel)=idok then
        begin
            try
                with frm_data.ClientDataSet_Receipt do
                begin
                    Close;
                    Commandtext:='';
                    Commandtext:='Update [Receipt] set Examine_Man5='''+Trim(Handle_Man)+''' where Receipt_No='''+Trim(Edit_Submit_quit_NO.Text)+''' and Receipt_Name=''受托代销退货单''';
                    Execute;
                    L5.Caption:='';
                    L5.Caption:=LevelName5+'【已审】';
                    Flag5:=2;
                    Application.MessageBox('【审核】操作成功!请确认',Pchar(application.Title),MB_ICONwarning);
                    Cmd_Check_Filsh;
                end;
            except
                Application.MessageBox('操作失败!,请确认!',pchar(application.Title),mb_iconwarning);
                Exit;
            end;
        end;
    end
    else if Flag5=2 then
    begin
        if Application.MessageBox('确定需要【反审核】该单据吗?'+#13#10+'如果【反审核】你将使后面级别的人的【审核】作废,'+#13#10+'后面级别的人必须重新【审核】,才能够生效,请确认!',pchar(application.Title),mb_okcancel)=idok then
        begin
            try
                with frm_data.ClientDataSet_Receipt do
                begin
                    Close;
                    Commandtext:='';
                    Commandtext:='Update [Receipt] set Examine_Man5='''' where Receipt_No='''+Trim(Edit_Submit_quit_NO.Text)+''' and Receipt_Name=''受托代销退货单''';
                    Execute;

                    L5.Caption:=LevelName5+':'+Handle_Man;
                    L5.Visible:=True;
                    Flag5:=1;
                    Application.MessageBox('【反审核】操作成功!请确认',Pchar(application.Title),MB_ICONwarning);
                    Cmd_Check_Filsh;
                end;
            except
                Application.MessageBox('操作失败!,请确认!',pchar(application.Title),mb_iconwarning);
                Exit;
            end;
        end;
    end;
end;

procedure Tfrm_Demand_Fad.Cmd_ZDRClick(Sender: TObject);
begin
    Edit_Proposer.Text:=Handle_Man;
end;

procedure Tfrm_Demand_Fad.Cmd_DWClick(Sender: TObject);
begin
    Check_Mond:='';
    Check_Mond:='Demand_Fad_Str';
    frm_Supply_Monad:=Tfrm_Supply_Monad.Create(self);
    frm_Supply_Monad.Caption:='【委托单位】';
    frm_Supply_Monad.ShowModal;
    Edit_Give_Name.Text:=check_Mond_Result;
    frm_Supply_Monad.Free;
end;

procedure Tfrm_Demand_Fad.Cmd_CKClick(Sender: TObject);
begin
    Check_Storage:='';
    Check_Storage_Result:='';
    Check_Storage:='Demand_Fad_Str';
    frm_Storage_Select:=Tfrm_Storage_Select.Create(self);
    frm_Storage_Select.ShowModal;
    Edit_Storage_Name.Text:=Trim(Check_Storage_Result);
    Edit_Storage_NO.Text:=Trim(Check_Storage_Result_NO);
    frm_Storage_Select.Free;
end;

procedure Tfrm_Demand_Fad.Cmd_DMClick(Sender: TObject);
begin
    ChildShop_Str:='';
    ChildShop_Result_NO:='';
    ChildShop_Result_Name:='';
    ChildShop_Str:='Demand_Fad_Str';
    frm_ChildShop_Select:=Tfrm_ChildShop_Select.Create(self);
    frm_ChildShop_Select.ShowModal;
    Edit_Shop_NO.Text:=ChildShop_Result_NO;
    Edit_Shop_Name.Text:=ChildShop_Result_Name;
    frm_ChildShop_Select.Free;
end;

procedure Tfrm_Demand_Fad.Cmd_JSRClick(Sender: TObject);
begin
    Employe_Check:='';
    Employe_Check:='Demand_Fad_Str';
    Employe_Check_Result:='';
    frm_Login_Man:=Tfrm_Login_Man.Create(self);
    frm_Login_Man.Caption:='经手人选择';
    frm_Login_Man.ShowModal;
    Edit_Transactor.Text:=Employe_Check_Result;
    frm_Login_Man.Free;
end;

procedure Tfrm_Demand_Fad.Edit_Copy_DateDblClick(Sender: TObject);
begin
    Edit_Copy_Date.Text:=Formatdatetime('yyyy''-''mm''-''dd',now);
end;

procedure Tfrm_Demand_Fad.Edit_Copy_DateKeyPress(Sender: TObject;
  var Key: Char);
begin
    if Key=#13 then
        Edit_Copy_Date.Text:=Formatdatetime('yyyy''-''mm''-''dd',now);
end;

procedure Tfrm_Demand_Fad.StringGrid1DrawCell(Sender: TObject; ACol,
  ARow: Integer; Rect: TRect; State: TGridDrawState);
var
    s:string;
    r:TRect;
begin
    with sender as TStringGrid do
    begin
        if (GDFocused in state) then
        begin
            Pcol:=Acol;
            Prow:=ARow;
            String_Col:=ARow;
        end;
    end;
    //文字垂直居中
    with StringGrid1 do
    begin
        Canvas.FillRect(Rect);
        s:=Cells[ACol,ARow];
        r:=Rect;
        DrawText(Canvas.Handle,PChar(s),Length(s),r,DT_CENTER or DT_SINGLELINE or DT_VCENTER);
    end;
end;
procedure Tfrm_Demand_Fad.StringGrid1DblClick(Sender: TObject);
begin
    if Trim(Edit_Submit_quit_NO.Text)='' then
    begin
        Application.MessageBox('操作失败,【单据编号】不能为空!',pchar(application.Title),mb_iconwarning);
        Edit_Submit_quit_NO.SetFocus;
        Exit;
    end;
    if Trim(Edit_Give_Name.Text)='' then
    begin
        Application.MessageBox('操作失败,【委托单位】不能为空!',pchar(application.Title),mb_iconwarning);
        Edit_Give_Name.SetFocus;
        Exit;
    end;
    if Trim(Edit_Transactor.Text)='' then
    begin
        Application.MessageBox('操作失败,【经手人】不能为空!',pchar(application.Title),mb_iconwarning);
        Edit_Transactor.SetFocus;
        Exit;
    end;
    if ((PCol=1) or (PCol=2))then //表示选择的是商品编号 选择的是第一列
    begin
        Goods_Check_str:='';
        frm_Goods_Check:=Tfrm_Goods_Check.Create(self);
        frm_Goods_Check.ShowModal;
        if Goods_Check_str='Demand_Fad_str' then
        begin
            try
                with frm_data.ClientDataSet_Add do
                begin
                    Close;
                    CommandText:='';
                    CommandText:='select * from [Goods_Information]  where Goods_No='''+Goods_No_Str+'''';
                    Open;
                    StringGrid1.Cells[1,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_NO').AsString;//商品名称
                    StringGrid1.Cells[2,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Name').AsString;//商品名称
                    StringGrid1.Cells[7,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Base_Monad').AsString; //类别名称
                    StringGrid1.Cells[9,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Modal').AsString; //类别名称
                    StringGrid1.Cells[10,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Cards').AsString; //品牌名称
                    StringGrid1.Cells[11,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Brand').AsString; //品种名称
                    StringGrid1.Cells[12,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Norms_Type').AsString;//规格型号名称
                    StringGrid1.Cells[13,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Sphere').AsString;//球面度数
                    StringGrid1.Cells[14,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Column').AsString;//柱面度数
                    StringGrid1.Cells[15,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Color').AsString;//颜色名称
                    StringGrid1.Cells[16,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Coding').AsString;//商品条玛
                    StringGrid1.Cells[17,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Enroll_Brand').AsString;//注册商标
                    StringGrid1.Cells[18,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Factory').AsString;//生产厂家
                    StringGrid1.Cells[19,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Valid_Day').AsString; //有效日期
                    StringGrid1.Cells[20,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Remark').AsString;  //备注说明
                end;
            except
                application.MessageBox('操作失败,请检查连接网络是否正常?请确认!',pchar(application.Title),mb_iconwarning);
            end;
        end;
        frm_Goods_Check.Free;
    end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -