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

📄 stock_contract.pas

📁 delphi的一个开发实例
💻 PAS
📖 第 1 页 / 共 5 页
字号:
        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_Man5='''' where Receipt_No='''+Trim(Edit2.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_Stock_Contract.Cmd_SearchClick(Sender: TObject);
begin
    Stock_Contract_NO:='';
    Stock_Contract_Str:='';
    frm_Stock_Contract_Search:=Tfrm_Stock_Contract_Search.Create(self);
    frm_Stock_Contract_Search.ShowModal;
    frm_Stock_Contract_Search.Free;
end;

procedure Tfrm_Stock_Contract.SpeedButton2Click(Sender: TObject);
begin
    frm_Goods_Requipment_Search:=Tfrm_Goods_Requipment_Search.Create(self);
    frm_Goods_Requipment_Search.ShowModal;
    frm_Goods_Requipment_Search.Free;
end;

procedure Tfrm_Stock_Contract.FormShow(Sender: TObject);
var
    i,icount,k:integer;
    tt,yy,temppos:integer;
begin
    frm_Stock_Contract.Left:=170 * longint(Screen.Width) div 1024;
    frm_Stock_Contract.Top:=40 * longint(Screen.Height) div 768;
    frm_Stock_Contract.Width:=860 * longint(Screen.Width) div 1024;
    frm_Stock_Contract.Height:=715 * longint(Screen.Height) div 768;
    iColcount:=StringGrid1.ColCount-1; //需要的填充数据的网络表格的列数
    StringGrid1.RowCount:=2;  StringGrid1.ColCount:=22;

    Total_Count:=StringGrid1.RowCount;
    StringGrid1.ColWidths[0]:=40;   StringGrid1.ColWidths[1]:=150;  StringGrid1.ColWidths[2]:=150;
    StringGrid1.ColWidths[3]:=100;  StringGrid1.ColWidths[4]:=100;  StringGrid1.ColWidths[5]:=150;
    StringGrid1.ColWidths[6]:=50;   StringGrid1.ColWidths[7]:=80;   StringGrid1.ColWidths[8]:=100;
    StringGrid1.ColWidths[9]:=50;   StringGrid1.ColWidths[10]:=100; StringGrid1.ColWidths[11]:=100;
    StringGrid1.ColWidths[12]:=50;  StringGrid1.ColWidths[13]:=150; StringGrid1.ColWidths[14]:=150;
    StringGrid1.ColWidths[15]:=100; StringGrid1.ColWidths[16]:=100; StringGrid1.ColWidths[17]:=150;
    StringGrid1.ColWidths[18]:=50;  StringGrid1.ColWidths[19]:=80;  StringGrid1.ColWidths[20]:=100;
    StringGrid1.ColWidths[21]:=50;
    StringGrid1.Cells[0,0]:='行号';             StringGrid1.Cells[1,0]:='商品编号';
    StringGrid1.Cells[2,0]:='商品全名';         StringGrid1.Cells[3,0]:='单价';
    StringGrid1.Cells[4,0]:='数量';             StringGrid1.Cells[5,0]:='金额';
    StringGrid1.Cells[6,0]:='类别名称';         StringGrid1.Cells[7,0]:='品牌名称';
    StringGrid1.Cells[8,0]:='品种名称';         StringGrid1.Cells[9,0]:='规格型号名称';
    StringGrid1.Cells[10,0]:='球面度数';        StringGrid1.Cells[11,0]:='柱面度数';
    StringGrid1.Cells[12,0]:='颜色名称';        StringGrid1.Cells[13,0]:='商品条玛';
    StringGrid1.Cells[14,0]:='组册商品';        StringGrid1.Cells[15,0]:='生产厂家';
    StringGrid1.Cells[16,0]:='商品简称';        StringGrid1.Cells[17,0]:='基本单位(小)';
    StringGrid1.Cells[18,0]:='整件单位(大)';    StringGrid1.Cells[19,0]:='有效日期(月)';
    StringGrid1.Cells[20,0]:='有效日期(日)';    StringGrid1.Cells[21,0]:='备注说明';

    //加载行号
    for i:=1 to StringGrid1.RowCount-1 do
    begin
        StringGrid1.Cells[0,i]:=IntTostr(i); //表示第0列第i行
    end;
    //如果该界面是从主窗体加载过来的话
    if Public_Do='Stock_0002' then
    begin
        P_Check.Visible:=False;
    end;

    //草稿单据查看进行审核
    if ((Public_Do='Business_Draft_0002') and (SH_Level<>0)) then
    begin
        P_Check.Visible:=True;
        if Trim(ExamineMan1)<>'' then
        begin
            tempstr:=ExamineMan1;
            tt:=0;
            while pos(',',tempstr)>0 do //取得逗号的位置
            begin
                temppos:=pos(',',tempstr); //取得逗号的位置
                ss:=copy(tempstr,1,temppos-1);
                tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
                if ss=Handle_Man then
                begin
                    P1.Visible:=True; L1.Caption:=LevelName1+':'+ss;
                    if ee1='' then   //如果还没有审核
                    begin
                        L1.Caption:=LevelName1+':'+ss;
                        Flag1:=1;
                    end;
                    if ee1<>'' then  //如果已经审核
                    begin
                        L1.Caption:=LevelName1+'【已审】';
                        Flag1:=2;
                    end;
                end;
            end;
            Next;
        end;
        if Trim(ExamineMan2)<>'' then
        begin
            tempstr:=ExamineMan2;
            tt:=0;
            while pos(',',tempstr)>0 do //取得逗号的位置
            begin
                temppos:=pos(',',tempstr); //取得逗号的位置
                ss:=copy(tempstr,1,temppos-1);
                tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
                if ss=Handle_Man then
                begin
                    P2.Visible:=True;  L2.Caption:=LevelName2+':'+ss;
                    if ee2='' then
                    begin
                        L2.Caption:=LevelName2+':'+ss;
                        Flag2:=1;
                    end;
                    if ee2<>'' then
                    begin
                        L2.Caption:=LevelName2+'【已审】';
                        Flag2:=2;
                    end;
                end;
            end;
            Next;
        end;
        if Trim(ExamineMan3)<>'' then
        begin
            tempstr:=ExamineMan3;
            tt:=0;
            while pos(',',tempstr)>0 do //取得逗号的位置
            begin
                temppos:=pos(',',tempstr); //取得逗号的位置
                ss:=copy(tempstr,1,temppos-1);
                tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
                if ss=Handle_Man then
                begin
                    P3.Visible:=True;    L3.Caption:=LevelName3+':'+ss;
                    if ee3='' then
                    begin
                        L3.Caption:=LevelName3+':'+ss;
                        Flag3:=1;
                    end;
                    if ee3<>'' then
                    begin
                        L3.Caption:=LevelName3+'【已审】';
                        Flag3:=2;
                    end;
                end;
            end;
            Next;
        end;
        if Trim(ExamineMan4)<>'' then
        begin
            tempstr:=ExamineMan4;
            tt:=0;
            while pos(',',tempstr)>0 do //取得逗号的位置
            begin
                temppos:=pos(',',tempstr); //取得逗号的位置
                ss:=copy(tempstr,1,temppos-1);
                tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
                if ss=Handle_Man then
                begin
                    P4.Visible:=True; L4.Caption:=LevelName4+':'+ss;
                    if ee4='' then
                    begin
                        L4.Caption:=LevelName4+':'+ss;
                        Flag4:=1;
                    end;
                    if ee1<>'' then
                    begin
                        L4.Caption:=LevelName4+'【已审】';
                        Flag4:=2;
                    end;
                end;
            end;
            Next;
        end;
        if Trim(ExamineMan5)<>'' then
        begin
            tempstr:='';
            tempstr:=ExamineMan5;
            tt:=0;
            while pos(',',tempstr)>0 do //取得逗号的位置
            begin
                temppos:=pos(',',tempstr); //取得逗号的位置
                ss:=copy(tempstr,1,temppos-1);
                tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
                if ss=Handle_Man then
                begin
                    P5.Visible:=True;  L5.Caption:=LevelName5+':'+ss;
                    if ee5='' then
                    begin
                        L5.Caption:=LevelName5+':'+ss;
                        Flag5:=1;
                    end;
                    if ee5<>'' then
                    begin
                        L5.Caption:=LevelName5+'【已审】';
                        Flag5:=2;
                    end;
                end;
            end;
            Next;
        end;

        with frm_data.ClientDataSet_Add do
        begin
            Close;
            CommandText:='';
            CommandText:='Select * from [V_Goods_Stock_Contract_view] where Contract_No='''+List_No+'''';
            Open;
            k:=frm_data.ClientDataSet_Add.RecordCount;

            StringGrid1.RowCount:=k+1;
            //自动加载STRINGGRID的行数
            for K:=1 to StringGrid1.RowCount do
            begin
                StringGrid1.Cells[0,K]:=IntTostr(k); //表示第0列第i行的名称
            end;
            //******************
            Edit1.Text:=ForMatDateTime('yyyy''-''mm''-''dd',frm_data.ClientDataSet_Add.FieldValues['Copy_Date']);
            Edit2.Text:=frm_data.ClientDataSet_Add.FieldValues['Contract_No'];
            Edit3.Text:=ForMatDateTime('yyyy''-''mm''-''dd',frm_data.ClientDataSet_Add.FieldValues['Arrive_Date']);
            Edit4.Text:=frm_data.ClientDataSet_Add.FieldValues['wldw'];
            Edit5.Text:=frm_data.ClientDataSet_Add.FieldValues['transactor'];
            Edit7.Text:=frm_data.ClientDataSet_Add.FieldValues['Proposer'];
            Edit8.Text:=frm_data.ClientDataSet_Add.FieldValues['resume'];
            Edit9.Text:=frm_data.ClientDataSet_Add.FieldValues['Remark'];
            for k:=1 to k  do
            begin
                StringGrid1.Cells[1,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_NO'];//商品编号
                StringGrid1.Cells[2,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Name'];//商品名称
                StringGrid1.Cells[3,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_amount'];//数量
                StringGrid1.Cells[4,k]:=frm_data.ClientDataSet_Add.FieldValues['Price'];//单价
                StringGrid1.Cells[5,k]:=frm_data.ClientDataSet_Add.FieldValues['Money'];//金额
                StringGrid1.Cells[6,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Modal']; //类别名称
                StringGrid1.Cells[7,k]:=frm_data.ClientData

⌨️ 快捷键说明

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