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

📄 quality_check.pas

📁 delphi的一个开发实例
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    StringGrid1.RowCount:=2;//初始行数
    StringGrid1.ColCount:=23;//总计列数
    iColcount:=StringGrid1.ColCount-1; //需要的填充数据的网络表格的列数
    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.ColWidths[22]:=100; 
    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]:='商品说明';

    //加载行号
    for i:=1 to StringGrid1.RowCount-1 do
    begin
        StringGrid1.Cells[0,i]:=IntTostr(i); //表示第0列第i行
    end;
    if Public_Do='Stock_0007' then
    begin
        P_Check.Visible:=False;
    end;
    if ((Public_Do='Business_Draft_0006') 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:=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_Add do
        begin
            Close;
            CommandText:='';
            CommandText:='Select * from [V_Stock_Quality_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('Stock_Write_NO').AsString;
            Edit4.Text:=frm_data.ClientDataSet_Add.FieldByName('Gather_Name').AsString;
            Edit5.Text:=frm_data.ClientDataSet_Add.FieldByName('Storage_Name').AsString;
            Edit6.Text:=frm_data.ClientDataSet_Add.FieldByName('Transactor').AsString;
            Edit7.Text:=frm_data.ClientDataSet_Add.FieldByName('Shop_NO').AsString;
            Edit8.Text:=frm_data.ClientDataSet_Add.FieldByName('Transactor').AsString;
            Edit9.Text:=frm_data.ClientDataSet_Add.FieldByName('Condense').AsString;
            Edit10.Text:=frm_data.ClientDataSet_Add.FieldByName('Quality_Remark').AsString;
            Edit11.Text:=frm_data.ClientDataSet_Add.FieldByName('Contract_NO').AsString;
            for k:=1 to k  do
            begin
                StringGrid1.Cells[1,k]:=frm_data.ClientDataSet_Add.FieldByName('Goods_NO').AsString;//商品编号
                StringGrid1.Cells[2,k]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Name').AsString;//商品名称
                StringGrid1.Cells[3,k]:=frm_data.ClientDataSet_Add.FieldByName('Total_Amount').AsString;//商品编号
                StringGrid1.Cells[4,k]:=frm_data.ClientDataSet_Add.FieldByName('Regular_Amount').AsString;//商品名称
                StringGrid1.Cells[5,k]:=frm_data.ClientDataSet_Add.FieldByName('Un_Regular_Amount').AsString;//数量
                StringGrid1.Cells[6,k]:=frm_data.ClientDataSet_Add.FieldByName('Check_Remark').AsString;//数量
                StringGrid1.Cells[7,k]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Modal').AsString; //类别名称
                StringGrid1.Cells[8,k]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Cards').AsString; //品牌名称
                StringGrid1.Cells[9,k]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Brand').AsString; //品种名称
                StringGrid1.Cells[10,k]:=frm_data.ClientDataSet_Add.FieldByName('Norms_Type').AsString;//规格型号名称
                StringGrid1.Cells[11,k]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Sphere').AsString;//球面度数
                StringGrid1.Cells[12,k]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Column').AsString;//柱面度数
                StringGrid1.Cells[13,k]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Color').AsString;//颜色名称
                StringGrid1.Cells[14,k]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Coding').AsString;//商品条玛
                StringGrid1.Cells[15,k]:=frm_data.ClientDataSet_Add.FieldByName('Enroll_Brand').AsString;//注册商标
                StringGrid1.Cells[16,k]:=frm_data.ClientDataSet_Add.FieldByName('Factory').AsString;//生产厂家
                StringGrid1.Cells[17,k]:=frm_data.ClientDataSet_Add.FieldByName('Goods_abbrev').AsString;//商品简称
                StringGrid1.Cells[18,k]:=frm_data.ClientDataSet_Add.FieldByName('Base_Monad').AsString;//基本单位
                StringGrid1.Cells[19,k]:=frm_data.ClientDataSet_Add.FieldByName('Whole_Monad').AsString;//整件单位
                StringGrid1.Cells[20,k]:=frm_data.ClientDataSet_Add.FieldByName('Valid_Month').AsString; //有效日期
                StringGrid1.Cells[21,k]:=frm_data.ClientDataSet_Add.FieldByName('Valid_Day').AsString; //有效日期
                StringGrid1.Cells[22,k]:=frm_data.ClientDataSet_Add.FieldByName('Remark').AsString;  //备注说明
                Next;
            end;

        end;
    end;
end;

procedure Tfrm_Quality_Check.Cmd_AddClick(Sender: TObject);
var
    i:integer;
begin
    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.Cmd_DeleteClick(Sender: TObject);
var
    i:integer;
begin
    if StringGrid1.RowCount=2 then
    begin

⌨️ 快捷键说明

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