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

📄 p_main.pas

📁 图书出版行业 对于图书样稿/清样/样书/成书的质检环节控制
💻 PAS
📖 第 1 页 / 共 2 页
字号:
         close;
         sql.Clear;
         sql.add('select * from 加印图书质检 where 质检状态3="未检" order by 质检开始时间 desc');
         open;
         s:=RecordCount;
         if (f>0) or (s>0) then
            begin
              f_information.Label1.Caption:='您有'+inttostr(f)+'本首印图书需要质检!';
              f_information.Label2.Caption:='您有'+inttostr(s)+'本加印图书需要质检!';
              f_information.Visible:=true;
              timer2.Enabled:=true;
              timer1.Enabled:=false;
            end;
       end;

     if qx=4 then
       begin
         sql.add('select * from 成书质检表 where 质检状态4="未检" order by 质检开始时间 desc');
         open;
         f:=RecordCount;
         close;
         sql.Clear;
         sql.add('select * from 加印图书质检 where 质检状态4="未检" order by 质检开始时间 desc');
         open;
         s:=RecordCount;
         if (f>0) or (s>0) then
            begin
              f_information.Label1.Caption:='您有'+inttostr(f)+'本首印图书需要质检!';
              f_information.Label2.Caption:='您有'+inttostr(s)+'本加印图书需要质检!';
              f_information.Visible:=true;
              timer2.Enabled:=true;
              timer1.Enabled:=false;
            end;
       end;

     if qx=5 then
       begin
         sql.add('select * from 成书质检表 where 质检状态5="未检" order by 质检开始时间 desc');
         open;
         f:=RecordCount;
         close;
         sql.Clear;
         sql.add('select * from 加印图书质检 where 质检状态5="未检" order by 质检开始时间 desc');
         open;
         s:=RecordCount;
         if (s>0) or (f>0) then
            begin
              f_information.Label1.Caption:='您有'+inttostr(f)+'本首印图书需要质检!';
              f_information.Label2.Caption:='您有'+inttostr(s)+'本加印图书需要质检!';
              f_information.Visible:=true;
              timer2.Enabled:=true;
              timer1.Enabled:=false;
            end;
       end;

     if qx=6 then
       begin
         sql.add('select * from 成书质检表 where 质检状态6="未检" order by 质检开始时间 desc');
         open;
         f:=RecordCount;
         close;
         sql.Clear;
         sql.add('select * from 加印图书质检 where 质检状态6="未检" order by 质检开始时间 desc');
         open;
         s:=RecordCount;
         if (f>0) or (s>0) then
            begin
              f_information.Label1.Caption:='您有'+inttostr(f)+'本首印图书需要质检!';
              f_information.Label2.Caption:='您有'+inttostr(s)+'本加印图书需要质检!';
              f_information.Visible:=true;
              timer2.Enabled:=true;
              timer1.Enabled:=false;
            end;
       end;

     if qx=7 then
       begin
         sql.add('select * from 成书质检表 where 质检状态1="已检" and 质检状态2="已检" and 质检状态3="已检" and 质检状态4="已检" and 质检状态5="已检" and 质检状态6="已检" and 质检状态7="未检" order by 质检开始时间 desc');
         open;
         f:=RecordCount;
         close;
         sql.Clear;
         sql.add('select * from 加印图书质检 where 质检状态1="已检" and 质检状态2="已检" and 质检状态3="已检" and 质检状态4="已检" and 质检状态5="已检" and 质检状态6="已检" and 质检状态7="未检" order by 质检开始时间 desc');
         open;
         s:=RecordCount;
         if (f>0) or (s>0) then
            begin
              f_information.Label1.Caption:='您有'+inttostr(f)+'本首印图书需要质检!';
              f_information.Label2.Caption:='您有'+inttostr(s)+'本加印图书需要质检!';
              f_information.Visible:=true;
              timer2.Enabled:=true;
              timer1.Enabled:=false;
            end;
       end;


     if qx=8 then
       begin
         sql.add('select * from 成书质检表 where 质检状态7="已检" and 质检状态8="未批" order by 质检开始时间 desc');
         open;
         f:=RecordCount;
         close;
         sql.Clear;
         sql.add('select * from 加印图书质检 where 质检状态7="已检" and  质检状态8="未批" order by 质检开始时间 desc');
         open;
         s:=RecordCount;
        if (f>0) or (s>0) then
            begin
              f_information.Label1.Caption:='您有'+inttostr(f)+'本首印图书需要质检!';
              f_information.Label2.Caption:='您有'+inttostr(s)+'本加印图书需要质检!';
              f_information.Visible:=true;
              timer2.Enabled:=true;
              timer1.Enabled:=false;
            end;
       end;

     if qx=9 then
       begin
         sql.add('select * from 成书质检表 where (质检状态8="已批" or 质检状态8="代批") and 质检状态9="未批" order by 质检开始时间 desc');
         open;
         f:=RecordCount;
         close;
         sql.Clear;
         sql.add('select * from 加印图书质检 where (质检状态8="已批" or 质检状态8="代批") and 质检状态9="未批" order by 质检开始时间 desc');
         open;
         s:=RecordCount;
        if (f>0) or (s>0) then
            begin
              f_information.Label1.Caption:='您有'+inttostr(f)+'本首印图书需要质检!';
              f_information.Label2.Caption:='您有'+inttostr(s)+'本加印图书需要质检!';
              f_information.Visible:=true;
              timer2.Enabled:=true;
              timer1.Enabled:=false;
            end;
       end;

     if qx=10 then
       begin
         sql.add('select * from 成书质检表 where (质检状态9="已批" or 质检状态9="代批") and 质检状态10="未批" order by 质检开始时间 desc');
         open;
         f:=RecordCount;
         close;
         sql.Clear;
         sql.add('select * from 加印图书质检 where (质检状态9="已批" or 质检状态9="代批") and 质检状态10="未批" order by 质检开始时间 desc');
         open;
         s:=RecordCount;
         if (f>0) or (s>0) then
            begin
              f_information.Label1.Caption:='您有'+inttostr(f)+'本首印图书需要质检!';
              f_information.Label2.Caption:='您有'+inttostr(s)+'本加印图书需要质检!';
              f_information.Visible:=true;
              timer2.Enabled:=true;
              timer1.Enabled:=false;
            end;
       end;



    end;



end;

procedure Tf_main.SpeedButton4Click(Sender: TObject);
begin
quickrep1.Print;
end;

procedure Tf_main.SpeedButton5Click(Sender: TObject);
begin
if (qx=1) and (query.fieldbyname('质检状态1').AsString='未检') then
  begin
    application.CreateForm(TF_cszj,F_cszj);
    f_cszj.ShowModal;
    f_cszj.Free;
  end;
if (qx=1) and (query.fieldbyname('质检状态1').AsString='已检') then
    begin
      Application.MessageBox('你已经质检,或者你无权限进行质检','提示',mb_ok);
      Exit;
    end;

if (qx=2) and (query.FieldByName('质检状态2').AsString='未检') then
  begin
    application.CreateForm(TF_cszj,F_cszj);
    f_cszj.ShowModal;
    f_cszj.Free;
  end;
if (qx=2) and (query.FieldByName('质检状态2').AsString='已检') then
    begin
      Application.MessageBox('你已经质检,或者你无权限进行质检','提示',mb_ok);
      Exit;
    end;

if (qx=3) and (query.FieldByName('质检状态3').AsString='未检') then
  begin
    application.CreateForm(TF_cszj,F_cszj);
    f_cszj.ShowModal;
    f_cszj.Free;
  end;
if (qx=3) and (query.FieldByName('质检状态3').AsString='已检') then
    begin
      Application.MessageBox('你已经质检,或者你无权限进行质检','提示',mb_ok);
      Exit;
    end;

if (qx=4) and (query.FieldByName('质检状态4').AsString='未检') then
  begin
    application.CreateForm(TF_cszj,F_cszj);
    f_cszj.ShowModal;
    f_cszj.Free;
  end;
if (qx=4) and (query.FieldByName('质检状态4').AsString='已检') then
    begin
      Application.MessageBox('你已经质检,或者你无权限进行质检','提示',mb_ok);
      Exit;
    end;

if (qx=5) and (query.FieldByName('质检状态5').AsString='未检') then
  begin
    application.CreateForm(TF_cszj,F_cszj);
    f_cszj.ShowModal;
    f_cszj.Free;
  end;
if (qx=5) and (query.FieldByName('质检状态5').AsString='已检') then
    begin
      Application.MessageBox('你已经质检,或者你无权限进行质检','提示',mb_ok);
      Exit;
    end;

if (qx=6) and (query.FieldByName('质检状态6').AsString='未检') then
  begin
    application.CreateForm(TF_cszj,F_cszj);
    f_cszj.ShowModal;
    f_cszj.Free;
  end;
if (qx=6) and (query.FieldByName('质检状态6').AsString='已检') then
    begin
      Application.MessageBox('你已经质检,或者你无权限进行质检','提示',mb_ok);
      Exit;
    end;

end;

procedure Tf_main.SpeedButton6Click(Sender: TObject);
begin
      if (qx=7) and (query.fieldbyname('质检状态7').AsString='未检')  then
          begin
            if (query.fieldbyname('质检状态1').AsString='已检') and (query.fieldbyname('质检状态2').AsString='已检') and (query.fieldbyname('质检状态3').AsString='已检') and (query.fieldbyname('质检状态4').AsString='已检') and (query.fieldbyname('质检状态5').AsString='已检') and (query.fieldbyname('质检状态6').AsString='已检')  then
              begin
              application.CreateForm(TF_sp,F_sp);
              f_sp.ShowModal;
              f_sp.Free;
              end;
            if (query.fieldbyname('质检状态1').AsString='未检') or (query.fieldbyname('质检状态2').AsString='未检') or (query.fieldbyname('质检状态3').AsString='未检') or (query.fieldbyname('质检状态4').AsString='未检') or (query.fieldbyname('质检状态5').AsString='未检') or (query.fieldbyname('质检状态6').AsString='未检')  then
              begin
               Application.MessageBox('上一质检环节没结束!','提示',mb_ok);
               Exit;
              end;
          end;
      if (qx=7) and  (query.fieldbyname('质检状态7').AsString='已检') then
         begin
           Application.MessageBox('此书已经质检!','提示',mb_ok);
           Exit;
         end;


      if (qx=8) and (query.fieldbyname('质检状态8').AsString='未批')  then
          begin
            if query.fieldbyname('质检状态7').AsString='已检' then
              begin
              application.CreateForm(TF_sp,F_sp);
              f_sp.ShowModal;
              f_sp.Free;
              end;
            if query.fieldbyname('质检状态7').AsString='未检'  then
              begin
               Application.MessageBox('上一质检环节没结束!','提示',mb_ok);
               Exit;
              end;
          end;
      if (qx=8) and  (query.fieldbyname('质检状态8').AsString='已批') then
         begin
           Application.MessageBox('此书已经审批!','提示',mb_ok);
           Exit;
         end;


      if (qx=9) and (query.fieldbyname('质检状态9').AsString='未批')  then
          begin
            if query.fieldbyname('质检状态8').AsString='已批' then
              begin
              application.CreateForm(TF_sp,F_sp);
              f_sp.ShowModal;
              f_sp.Free;
              end;
            if query.fieldbyname('质检状态8').AsString='未批'  then
              begin
               Application.MessageBox('上一质检环节没结束!','提示',mb_ok);
               Exit;
              end;
          end;
      if (qx=9) and  (query.fieldbyname('质检状态9').AsString='已批') then
         begin
           Application.MessageBox('此书已经审批!','提示',mb_ok);
           Exit;
         end;


      if (qx=10) and (query.fieldbyname('质检状态10').AsString='未批')  then
          begin
            if query.fieldbyname('质检状态9').AsString='已批' then
              begin
              application.CreateForm(TF_sp,F_sp);
              f_sp.ShowModal;
              f_sp.Free;
              end;
            if query.fieldbyname('质检状态9').AsString='未批'  then
              begin
               Application.MessageBox('上一质检环节没结束!','提示',mb_ok);
               Exit;
              end;
          end;
      if (qx=10) and  (query.fieldbyname('质检状态10').AsString='已批') then
         begin
           Application.MessageBox('此书已经审批!','提示',mb_ok);
           Exit;
         end;


end;



procedure Tf_main.SpeedButton7Click(Sender: TObject);
begin
   //quickrep1.PrinterSettings.FirstPage:=pagenum;
   //quickrep1.PrinterSettings.LastPage:=pagenum;
   quickrep1.Preview;
end;

procedure Tf_main.SpeedButton9Click(Sender: TObject);
begin
if (query.fieldbyname('发货').AsString='否') and (query.fieldbyname('质检状态10').AsString='已批') then
  begin
   query.fieldbyname('发货').AsString:='可';
   Application.MessageBox('本书确认可发货成功!','提示',mb_ok);
  end;

if (query.fieldbyname('发货').AsString='否') and (query.fieldbyname('质检状态10').AsString='未批') then
   Application.MessageBox('主管领导未审批!','提示',mb_ok);

if query.fieldbyname('发货').AsString='可' then
   Application.MessageBox('此书已标记为可发货状态!','提示',mb_ok);

end;

procedure Tf_main.N22Click(Sender: TObject);
begin
   application.CreateForm(TF_jiayin,F_jiayin);
   f_jiayin.ShowModal;
   f_jiayin.Free;
end;

procedure Tf_main.SpeedButton8Click(Sender: TObject);
begin
   application.CreateForm(TF_sysearch,F_sysearch);
   f_sysearch.ShowModal;
   f_sysearch.Free;
end;



procedure Tf_main.SpeedButton10Click(Sender: TObject);
begin
  with query do
   begin
      close;
      sql.Clear;
      sql.add('select * from 成书质检表 order by 质检开始时间 desc');
      //sql.Add('select * from 成书质检表 where datediff("d",质检开始时间,now)<=7  order by 质检开始时间 desc');
      open;
    end;
    timer1.Enabled:=true;
end;

procedure Tf_main.Timer2Timer(Sender: TObject);
begin
 PlaySound(PChar('msg.wav'),0,0);
end;

procedure Tf_main.Timer3Timer(Sender: TObject);
begin
Timer1.Enabled:=true;
end;

procedure Tf_main.SpeedButton11Click(Sender: TObject);
begin
      if (qx=90) and (query.fieldbyname('质检状态9').AsString='未批')  then
          begin
            if query.fieldbyname('质检状态8').AsString='已批' then
              begin
              application.CreateForm(TF_sp,F_sp);
              f_sp.ShowModal;
              f_sp.Free;
              end;
            if query.fieldbyname('质检状态8').AsString='未批'  then
              begin
               Application.MessageBox('上一质检环节没结束!','提示',mb_ok);
               Exit;
              end;
          end;
      if (qx=90) and  (query.fieldbyname('质检状态9').AsString='已批') then
         begin
           Application.MessageBox('此书已经审批!','提示',mb_ok);
           Exit;
         end;


      if (qx=100) and (query.fieldbyname('质检状态10').AsString='未批')  then
          begin
            if query.fieldbyname('质检状态9').AsString='已批' then
              begin
              application.CreateForm(TF_sp,F_sp);
              f_sp.ShowModal;
              f_sp.Free;
              end;
            if query.fieldbyname('质检状态9').AsString='未批'  then
              begin
               Application.MessageBox('上一质检环节没结束!','提示',mb_ok);
               Exit;
              end;
          end;
      if (qx=100) and  (query.fieldbyname('质检状态10').AsString='已批') then
         begin
           Application.MessageBox('此书已经审批!','提示',mb_ok);
           Exit;
         end;
end;

end.

⌨️ 快捷键说明

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