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

📄 quality_check.pas

📁 delphi的一个开发实例
💻 PAS
📖 第 1 页 / 共 5 页
字号:
        Exit;
    end;
    StringGrid1.RowCount:=StringGrid1.RowCount-1;
    Total_Count:=StringGrid1.RowCount;//表示行数
    for i:=1 to StringGrid1.RowCount-1 do
    begin
        StringGrid1.Cells[0,i]:=IntTostr(i); //表示第0列第i行
    end;
end;

procedure Tfrm_Quality_Check.StringGrid1DrawCell(Sender: TObject; ACol,
  ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
    with sender as TStringGrid do
    begin
        if (GDFocused in state) then
        begin
            Pcol:=Acol;
            Prow:=ARow;
            func.String_Col:=ARow;
        end;
    end;
end;

procedure Tfrm_Quality_Check.StringGrid1DblClick(Sender: TObject);
var
    openstr:string;
    S1,s2,s3:string;
begin
    if Trim(Edit2.Text)='' then
    begin
        Application.MessageBox('操作失败,【单据编号】不能为空!',pchar(application.Title),mb_iconwarning);
        Edit2.SetFocus;
        Exit;
    end;
    if Trim(Edit3.Text)='' then
    begin
        Application.MessageBox('操作失败,【来货登记号】不能为空!',pchar(application.Title),mb_iconwarning);
        Edit3.SetFocus;
        Exit;
    end;
    if Trim(Edit4.Text)='' then
    begin
        Application.MessageBox('操作失败,【供货单位】不能为空!',pchar(application.Title),mb_iconwarning);
        Edit4.SetFocus;
        Exit;
    end;
    if Trim(Edit6.Text)='' then
    begin
        Application.MessageBox('操作失败,【经手人】不能为空!',pchar(application.Title),mb_iconwarning);
        Edit6.SetFocus;
        Exit;
    end;
    s1:='select Goods_NO,Goods_Name,Goods_Modal_No,Goods_Modal,Goods_Cards_NO,Goods_Cards,Goods_Brand_NO,';
    S2:='Goods_Brand,Norms_Type_NO,Norms_Type,Goods_Sphere,Goods_Column,Goods_Color_NO,Goods_Color,Goods_Coding,Enroll_Brand,Factory,';
    s3:='Goods_abbrev,Base_Monad,Whole_Monad,Valid_Month,Valid_Day,Remark from [Goods_Information]';
    openstr:=s1+s2+s3;
    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='Stock_0007' 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('Goods_Modal_No').AsString;//类别编号
                    StringGrid1.Cells[8,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Modal').AsString; //类别名称
                    StringGrid1.Cells[9,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Cards_NO').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_NO').AsString;//品种编号
                    StringGrid1.Cells[12,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Brand').AsString; //品种名称
                    StringGrid1.Cells[13,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Norms_Type_NO').AsString;//规格型号代码
                    StringGrid1.Cells[14,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Norms_Type').AsString;//规格型号名称
                    StringGrid1.Cells[15,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Sphere').AsString;//球面度数
                    StringGrid1.Cells[16,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Column').AsString;//柱面度数
                    StringGrid1.Cells[17,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Color_NO').AsString;//颜色代码
                    StringGrid1.Cells[18,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Color').AsString;//颜色名称
                    StringGrid1.Cells[19,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Coding').AsString;//商品条玛
                    StringGrid1.Cells[20,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Enroll_Brand').AsString;//注册商标
                    StringGrid1.Cells[21,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Factory').AsString;//生产厂家
                    StringGrid1.Cells[22,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_abbrev').AsString;//商品简称
                    StringGrid1.Cells[23,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Base_Monad').AsString;//基本单位
                    StringGrid1.Cells[24,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Whole_Monad').AsString;//整件单位
                    StringGrid1.Cells[25,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Valid_Month').AsString; //有效日期
                    StringGrid1.Cells[26,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Valid_Day').AsString; //有效日期
                    StringGrid1.Cells[27,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;


procedure Tfrm_Quality_Check.Edit1DblClick(Sender: TObject);
begin
    Edit1.Text:=ForMatDateTime('yyyy''-''mm''-''dd',now);
end;

procedure Tfrm_Quality_Check.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
    if Key=#13 then
        Edit1.Text:=ForMatDateTime('yyyy''-''mm''-''dd',now);
end;

procedure Tfrm_Quality_Check.Edit8KeyPress(Sender: TObject; var Key: Char);
begin
    if Key=#13 then
        Edit8.Text:=Handle_Man;
end;

procedure Tfrm_Quality_Check.Edit8DblClick(Sender: TObject);
begin
    Edit8.Text:=Handle_Man;
end;

procedure Tfrm_Quality_Check.Cmd1Click(Sender: TObject);
begin
    if Flag1=1 then
    begin
        if Application.MessageBox('确定需要【审核】该单据吗?请确认!',pchar(application.Title),mb_okcancel)=idok then
        begin
            try
                with frm_data.ClientDataSet4 do
                begin
                    Close;
                    Commandtext:='';
                    Commandtext:='Update [Receipt] set Examine_Man1='''+Trim(Handle_Man)+''' where Receipt_No='''+Trim(Edit2.Text)+''' and Receipt_Name=''质量验收单''';
                    Execute;
                    L1.Caption:='';
                    L1.Caption:=LevelName1+'【已审】';
                    Flag1:=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 Flag1=2 then
    begin
        if Application.MessageBox('确定需要【反审核】该单据吗?'+#13#10+'如果【反审核】你将使后面级别的人的【审核】作废,'+#13#10+'后面级别的人必须重新【审核】,才能够生效,请确认!',pchar(application.Title),mb_okcancel)=idok then
        begin
            try
                with frm_data.ClientDataSet4 do
                begin
                    Close;
                    Commandtext:='';
                    Commandtext:='Update [Receipt] set Examine_Man1='''',Examine_Man2='''',Examine_Man3='''',Examine_Man4='''',Examine_Man5='''' where Receipt_No='''+Trim(Edit2.Text)+''' and Receipt_Name=''质量验收单''';
                    Execute;

                    L1.Caption:=LevelName1+':'+Handle_Man;
                    L2.Caption:=LevelName2+':'+Handle_Man;
                    L3.Caption:=LevelName3+':'+Handle_Man;
                    L4.Caption:=LevelName4+':'+Handle_Man;
                    L5.Caption:=LevelName5+':'+Handle_Man;
                    Flag2:=1; Flag3:=1; Flag4:=1; Flag5:=1;
                    L1.Visible:=True;
                    Flag1:=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_Quality_Check.Cmd2Click(Sender: TObject);
begin
    if Flag2=1 then
    begin
        if Application.MessageBox('确定需要【审核】该单据吗?请确认!',pchar(application.Title),mb_okcancel)=idok then
        begin
            try
                with frm_data.ClientDataSet4 do
                begin
                    Close;
                    Commandtext:='';
                    Commandtext:='Update [Receipt] set Examine_Man2='''+Trim(Handle_Man)+''' where Receipt_No='''+Trim(Edit2.Text)+''' and Receipt_Name=''质量验收单''';
                    Execute;
                    L2.Caption:='';
                    L2.Caption:=LevelName2+'【已审】';
                    Flag2:=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 Flag2=2 then
    begin
        if Application.MessageBox('确定需要【反审核】该单据吗?'+#13#10+'如果【反审核】你将使后面级别的人的【审核】作废,'+#13#10+'后面级别的人必须重新【审核】,才能够生效,请确认!',pchar(application.Title),mb_okcancel)=idok then
        begin
            try
                with frm_data.ClientDataSet4 do
                begin
                    Close;
                    Commandtext:='';
                    Commandtext:='Update [Receipt] set Examine_Man2='''',Examine_Man3='''',Examine_Man4='''',Examine_Man5='''' where Receipt_No='''+Trim(Edit2.Text)+''' and Receipt_Name=''质量验收单''';
                    Execute;
                    L2.Caption:='';
                    L2.Caption:=LevelName2+':'+Handle_Man;
                    L2.Visible:=True;
                    L3.Caption:=LevelName3+':'+Handle_Man;
                    L4.Caption:=LevelName4+':'+Handle_Man;
                    L5.Caption:=LevelName5+':'+Handle_Man;
                    Flag2:=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_Quality_Check.Cmd3Click(Sender: TObject);
begin
    if Flag3=1 then
    begin
        if Application.MessageBox('确定需要【审核】该单据吗?请确认!',pchar(application.Title),mb_okcancel)=idok then
        begin
            try

⌨️ 快捷键说明

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