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

📄 price_attemper.pas

📁 delphi的一个开发实例
💻 PAS
📖 第 1 页 / 共 4 页
字号:
        StringGrid1.Cells[22,0]:='颜色名称';        StringGrid1.Cells[23,0]:='商品条玛';
        StringGrid1.Cells[24,0]:='组册商品';        StringGrid1.Cells[25,0]:='生产厂家';
        StringGrid1.Cells[26,0]:='有效日期(月)';    StringGrid1.Cells[27,0]:='商品说明';
    end;
    if Public_Do='Business_Price_attemper' 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:=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;
        StringGrid1.ColWidths[0]:=40;   StringGrid1.ColWidths[1]:=150;  StringGrid1.ColWidths[2]:=150;
        StringGrid1.ColWidths[3]:=100;  StringGrid1.ColWidths[4]:=60;  StringGrid1.ColWidths[5]:=80;
        StringGrid1.ColWidths[6]:=150;   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.ColWidths[22]:=100; StringGrid1.ColWidths[23]:=100;
        StringGrid1.ColWidths[24]:=50;  StringGrid1.ColWidths[25]:=150;
        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]:='柱面度数';
        StringGrid1.Cells[22,0]:='颜色名称';        StringGrid1.Cells[23,0]:='商品条玛';
        StringGrid1.Cells[24,0]:='组册商品';        StringGrid1.Cells[25,0]:='生产厂家';
        StringGrid1.Cells[26,0]:='有效日期(月)';    StringGrid1.Cells[27,0]:='商品说明';
        with frm_data.ClientDataSet_Add do
        begin
            Close;
            CommandText:='';
            CommandText:='Select * from [V_Goods_dispatch_View] where Receipt_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:=frm_data.ClientDataSet_Add.FieldByName('Copy_Date').AsString;
            Edit2.Text:=frm_data.ClientDataSet_Add.FieldByName('Receipt_No').AsString;
            Edit3.Text:=frm_data.ClientDataSet_Add.FieldByName('FStorage_NO').AsString;
            Edit4.Text:=frm_data.ClientDataSet_Add.FieldByName('SStorage_NO').AsString;
            Edit5.Text:=frm_data.ClientDataSet_Add.FieldByName('FShop_NO').AsString;
            Edit6.Text:=frm_data.ClientDataSet_Add.FieldByName('SShop_NO').AsString;
            Edit7.Text:=frm_data.ClientDataSet_Add.FieldByName('Transactor').AsString;
            Edit8.Text:=frm_data.ClientDataSet_Add.FieldByName('proposer').AsString;
            Edit9.Text:=frm_data.ClientDataSet_Add.FieldByName('Condense').AsString;
            Edit10.Text:=frm_data.ClientDataSet_Add.FieldByName('D_Remark').AsString;
            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['Pass_NO'];//批号
                StringGrid1.Cells[4,k]:=frm_data.ClientDataSet_Add.FieldValues['Base_Monad'];//单位
                StringGrid1.Cells[5,k]:=frm_data.ClientDataSet_Add.FieldValues['amount'];//数量
                StringGrid1.Cells[6,k]:=frm_data.ClientDataSet_Add.FieldValues['D_Remark'];//配送说明
                StringGrid1.Cells[16,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Modal'];//商品类别
                StringGrid1.Cells[17,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Cards'];//商品品牌
                StringGrid1.Cells[18,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Brand'];//商品品种
                StringGrid1.Cells[19,k]:=frm_data.ClientDataSet_Add.FieldValues['Norms_Type'];//规格型号
                StringGrid1.Cells[20,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Sphere'];//球面度数
                StringGrid1.Cells[21,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Column'];//主面度数
                StringGrid1.Cells[22,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Color'];//商品颜色
                StringGrid1.Cells[23,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Coding'];//商品跳马
                StringGrid1.Cells[24,k]:=frm_data.ClientDataSet_Add.FieldValues['Enroll_Brand'];//注册商标
                StringGrid1.Cells[25,k]:=frm_data.ClientDataSet_Add.FieldValues['Valid_Month']; //有效日期
                StringGrid1.Cells[26,k]:=frm_data.ClientDataSet_Add.FieldValues['Valid_Day']; //有效日期
                StringGrid1.Cells[26,k]:=frm_data.ClientDataSet_Add.FieldValues['Remark']; //商品说明
                Next;
            end;
        end;

    end;
end;

procedure Tfrm_price_attemper.SpeedButton4Click(Sender: TObject);
begin
    frm_Public_Don:=Tfrm_Public_Don.Create(self);
    frm_Public_Don.ShowModal;
    if Public_Do='Storage_price_attemper' then
    begin
        P_check.Visible:=False;
        //保存为草稿
        if Public_Do_Result='02' then
        begin
            if Trim(Edit1.Text)='' then
            begin
                application.MessageBox('操作错误,【录单日期】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
                Edit1.SetFocus;
                Exit;
            end;
            if Trim(Edit2.Text)='' then
            begin
                application.MessageBox('操作错误,【单据编号】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
                Edit2.SetFocus;
                Exit;
            end;
            if Trim(Edit7.Text)='' then
            begin
                application.MessageBox('操作错误,【经手人】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
                Edit7.SetFocus;
                Exit;
            end;
            if Trim(Edit8.Text)='' then
            begin
                application.MessageBox('操作错误,【制单人】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
                Edit8.SetFocus;
                Exit;
            end;
            for i:=1 to Total_Count-1 do
            begin
                if StringGrid1.Cells[1,i]='' then
                begin
                    application.MessageBox('操作错误,【商品编号】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
                    Exit;
                end;
                if StringGrid1.Cells[5,i]='' then
                begin
                    application.MessageBox('操作错误,【数量】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
                    Exit;
                end;
            end;
            with frm_data.ClientDataSet_Add do
            begin
                Close;
                CommandText:='';
                CommandText:='INSERT INTO [Goods_dispatch](Copy_Date,dispatch_NO,FStorage_NO,SStorage_NO,FShop_NO,SShop_NO,Transactor,Proposer,Condense,D_Remark) values ('''+Trim(Edit1.Text)+''','''+Trim(Edit2.Text)+''','''+Trim(Edit3.Text)+''','''+Trim(Edit4.Text)+''','''+Trim(Edit5.Text)+''','''+Trim(Edit6.Text)+''','''+Trim(Edit7.Text)+''','''+Trim(Edit8.Text)+''','''+Trim(Edit9.Text)+''','''+Trim(Edit10.Text)+''')';
                try
                    ExecUte;
                    try
                        with frm_data.ClientDataSet_Add do
                        begin
                            Close;
                            CommandText:='';
                            CommandText:='Insert into [Receipt](Receipt_NO,Receipt_Name,Copy_Date,Proposer,Condense) values ('''+Trim(Edit2.Text)+''',''同价调拨单'','''+Trim(Edit1.Text)+''','''+Trim(Edit8.Text)+''','''+Trim(Edit9.Text)+''')';
                            try
                                ExecUte;
                                try
                                    for i:=1 to Total_Count-1 do
                                    begin
                                        with frm_data.ClientDataSet_Add do
                                        begin
                                            Close;
                                            CommandText:='';
                                            CommandText:='Insert into [Goods_dispatch_detail](dispatch_No,Goods_NO,Pass_NO,amount,GD_Remark) values ('''+Trim(Edit2.Text)+''','''+Trim(StringGrid1.Cells[1,i])+''','''+Trim(StringGrid1.Cells[3,i])+''','''+Trim(StringGrid1.Cells[5,i])+''','''+Trim(StringGrid1.Cells[6,i])+''')';
                                            try
                                                ExecUte;

⌨️ 快捷键说明

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