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

📄 demand_enter.pas

📁 delphi的一个开发实例
💻 PAS
📖 第 1 页 / 共 5 页
字号:
        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:=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 ee1='' 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_Submit_adopt_detail do
        begin
            Close;
            CommandText:='';
            CommandText:='Select * from [V_Submit_adopt_View] where Receipt_No='''+List_No+'''';
            Open;
            k:=frm_data.ClientDataSet_Submit_adopt_detail.RecordCount;

            StringGrid1.RowCount:=k+1;
            //自动加载STRINGGRID的行数
            for K:=1 to StringGrid1.RowCount do
            begin
                StringGrid1.Cells[0,K]:=IntTostr(k); //表示第0列第i行的名称
            end;
            
            //******************
            Edit_Copy_Date.Text:=ForMatDateTime('yyyy''-''mm''-''dd',frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Copy_Date').AsDateTime);
            Edit_Submit_adopt_NO.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Receipt_No').AsString;
            Edit_Give_Name.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Give_Name').AsString;
            Edit_Storage_NO.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Storage_NO').AsString;
            Edit_Shop_NO.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Shop_NO').AsString;
            Edit_Transactor.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Transactor').AsString;
            Edit_Proposer.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Proposer').AsString;
            Edit_Condense.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Condense').AsString;
            Edit_Submit_Remark.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Submit_Remark').AsString;

            for k:=1 to k  do
            begin

                StringGrid1.Cells[1,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_NO'];//商品编号
                StringGrid1.Cells[2,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Name'];//商品名称
                StringGrid1.Cells[3,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Submit_amount'];//数量
                StringGrid1.Cells[4,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Submit_price'];//单价
                StringGrid1.Cells[5,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Submit_money'];//金额
                StringGrid1.Cells[6,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Submit_Detail_Remark'];//类别编号
                StringGrid1.Cells[7,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Base_Monad'];//
                StringGrid1.Cells[8,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Modal'];//
                StringGrid1.Cells[9,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Cards'];//
                StringGrid1.Cells[10,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Brand'];//
                StringGrid1.Cells[11,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Norms_Type'];//
                StringGrid1.Cells[12,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Sphere'];//
                StringGrid1.Cells[13,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Column'];//
                StringGrid1.Cells[14,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Color'];//
                StringGrid1.Cells[15,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Coding'];//
                StringGrid1.Cells[16,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Enroll_Brand'];//
                StringGrid1.Cells[17,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Factory']; //
                StringGrid1.Cells[18,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Valid_Month']; //
                StringGrid1.Cells[19,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Remark'];  //
                Next;
            end;

        end;
    end;
end;

procedure Tfrm_Demand_Enter.SpeedButton4Click(Sender: TObject);
var
    i,j,icol:integer;
    Check_Flag:string;
begin
    frm_Public_Don:=Tfrm_Public_Don.Create(self);
    frm_Public_Don.ShowModal;
    //直接操作入库界面
    if Public_Do='Demand_Enter_Str' then
    begin
        //直接过帐
        if Public_Do_Result='01' then
        begin
            with frm_data.ClientDataSet_Submit_adopt do
            begin
                Close;
                CommandText:='';
                Commandtext:='Select * from [V_Submit_adopt_View] where Receipt_No='''+Trim(Edit_Submit_adopt_NO.Text)+'''';
                try
                    Open;
                    if frm_data.ClientDataSet_Submit_adopt.RecordCount>0 then
                    begin
                        Check_Flag:=frm_data.ClientDataSet_Submit_adopt.FieldByName('Check_Result').AsString;
                        if Check_Flag='0' then   //单据没有完全审核
                        begin
                            Application.MessageBox('单据还没有完全审核,不能过帐',pchar(application.Title),mb_iconwarning);
                            Exit;
                        end;
                        if Check_Flag='1' then  //单据完全审核
                        begin
                            with frm_data.ClientDataSet_Submit_adopt do
                            begin
                                Close;
                                CommandText:='';
                                CommandText:='Update [Submit_adopt] set Give_Name='''+Trim(Edit_Give_Name.Text)+''',Storage_NO='''+Trim(Edit_Storage_NO.Text)+''',Transactor='''+Trim(Edit_Transactor.Text)+''',Shop_NO='''+Trim(Edit_Shop_NO.Text)+''',Submit_Remark='''+Trim(Edit_Submit_Remark.Text)+''',Condense='''+Trim(Edit_Condense.Text)+''' where Submit_adopt_NO='''+Trim(Edit_Submit_adopt_NO.Text)+'''';
                                try
                                    Execute;
                                    try
                                        for i:=1 to StringGrid1.RowCount-1 do
                                        begin
                                            with frm_data.ClientDataSet_Submit_adopt_detail do
                                            begin
                                                Close;
                                                frm_data.ClientDataSet_Add.CommandText:='';
                                                CommandText:='update [Submit_adopt_detail] set Submit_amount='''+Trim(StringGrid1.Cells[3,i])+''',Submit_price='''+Trim(StringGrid1.Cells[4,i])+''',Submit_money='''+Trim(StringGrid1.Cells[5,i])+''',Submit_Detail_Remark='''+Trim(StringGrid1.Cells[6,i])+''' where Submit_adopt_NO='''+Trim(Edit_Submit_adopt_NO.Text)+''' and Goods_NO='''+Trim(StringGrid1.Cells[1,i])+'''';
                                                try
                                                    Execute;
                                                except
                                                    Application.MessageBox('保存【受托代销入库明细】时连接服务器失败,不能过帐,请确认!',pchar(application.Title),mb_iconwarning);
                                                    Exit;
                                                end;
                                            end;
                                        end;
                                        with frm_data.ClientDataSet_Receipt do
                                        begin
                                            Close;
                                            Commandtext:='';
                                            Commandtext:='Update [Receipt] set Flag_sign=''单据'' where Receipt_No='''+Trim(Edit_Submit_adopt_NO.Text)+'''';
                                            try
                                                Execute;
                                                Application.MessageBox('恭喜你!【受托代销入库】直接单据过帐操作成功!请确认!',pchar(application.Title),mb_iconwarning);
                                            except
                                                Application.MessageBox('保存【受托代销入库审核表】时失败,不能过帐,请确认!',pchar(application.Title),mb_iconwarning);
                                                Exit;
                                            end;
                                        end;

⌨️ 快捷键说明

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