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

📄 ywwizard.~pas

📁 企业端数据申报系统:单位管理模块 单位查询. 业务申报模块 在线数据下载 在线数据上传 在线业务申核 申报业务查询 磁盘数据导出 磁盘数据导入 在线业务模块 在线业务
💻 ~PAS
📖 第 1 页 / 共 5 页
字号:

    end else
    if (uptype='05') or (uptype='06') or (uptype='07') then
    begin
      if not OthchgCheck() then
        exit;

      //if fcTC_othchg_upreason.SelectedNode=nil then
      //begin
      //  application.MessageBox('请选择变动原因!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
      //  exit;
      //end;

      ls_upreason:=fcTC_othchg_upreason.SelectedNode.StringData;
      ls_cgdate:=trim(DE_othchg_cgdate.Text);
      ls_notes:=trim(M_othchg_notes.Text);

      datashare_form.Dbs.StartTransaction;
      try
        with datashare_form.Query1 do
        begin
          ls_sql:='select manid,status,psname,agcardno,psseno,cpseno from psarch where trim(iscode)='+#39+iscode+#39;
          close;
          sql.Clear;
          sql.Add(ls_sql);
          prepare;
          open;
          li_manid:=fieldbyname('manid').AsInteger;
          ls_status:=fieldbyname('status').AsString;
          ls_psname:=fieldbyname('psname').AsString;
          ls_agcardno:=fieldbyname('agcardno').AsString;
          li_psseno:=fieldbyname('psseno').AsInteger;
          li_cpseno:=fieldbyname('cpseno').AsInteger;

          ls_sql:='select opid from psupcase where manid='+inttostr(li_manid)+' and procflg='+#39+'1'+#39;
          close;
          sql.Clear;
          sql.Add(ls_sql);
          prepare;
          open;
          if RecordCount=0 then
          begin
            close;    //取得最大的opid
            sql.clear;
            ls_sql:='select max(opid) opid from psupcase';
            sql.add(ls_sql);
            prepare;
            open;
            li_opid:=fieldbyname('opid').AsInteger+1;

            ls_sql:='insert into psupcase(iscode,psname,agcardno,uptype,opid,upreason,cgdate,oristatus,opcode,opdate,procflg,notes,manid,psseno,cpseno,opname) ';
            ls_sql:=ls_sql+'values('+#39+iscode+#39+','+#39+ls_psname+#39+','+#39+ls_agcardno+#39+','+#39+uptype+#39+','+inttostr(li_opid)+','+#39+ls_upreason+#39+','+#39+ls_cgdate+#39+','+#39+ls_status+#39;
            ls_sql:=ls_sql+','+inttostr(main_form.user.OPERID)+',today(),'+#39+'1'+#39+','+#39+ls_notes+#39+','+inttostr(li_manid)+','+inttostr(li_psseno)+','+inttostr(li_cpseno)+','+#39+main_form.user.OPNAME+#39+')';
            close;
            sql.Clear;
            sql.Add(ls_sql);
            Execsql;
          end else
          begin
            li_opid:=fieldbyname('opid').AsInteger;
            ls_sql:='update psupcase set iscode='+#39+iscode+#39+',uptype='+#39+uptype+#39+',upreason='+#39+ls_upreason+#39+',cgdate='+#39+ls_cgdate+#39+',opcode='+inttostr(main_form.user.OPERID)+',opdate=today()';
            ls_sql:=ls_sql+',procflg='+#39+'1'+#39+',notes='+#39+ls_notes+#39+',psseno='+inttostr(li_manid)+',cpseno='+inttostr(li_cpseno)+',organid=null,oricpseno=null,oriorganid=null,itcode=null';
            ls_sql:=ls_sql+',psname='+#39+ls_psname+#39+',agcardno='+#39+ls_agcardno+#39+',opname='+#39+main_form.user.OPNAME+#39+' where manid='+inttostr(li_manid)+' and procflg='+#39+'1'+#39;
            close;
            sql.Clear;
            sql.Add(ls_sql);
            Execsql;
          end;

          ls_status:=QueryName('status','upreason','upcode='+#39+ls_upreason+#39);
          ls_sql:='update psarch set status='+chr(39)+ls_status+chr(39)+',chgreason='+chr(39)+ls_upreason+chr(39)+',chantime='+chr(39)+ls_cgdate+chr(39)+',chaninfo='+chr(39)+ls_notes+chr(39)+',itcode=null where manid='+inttostr(li_manid);
          close;
          sql.Clear;
          sql.Add(ls_sql);
          Execsql;
        end;
        datashare_form.Dbs.Commit;
      except
        on e:exception do
        begin
          datashare_form.Dbs.Rollback;
          application.MessageBox(pchar(e.Message),'恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
          exit;
        end;
      end;

    end else
    if uptype='04' then
    begin
      if not LoctranCheck() then
        exit;
      //if fcTC_loctran_neworgan.SelectedNode=nil then
      //begin
      //  application.MessageBox('请选择调动的目标单位或部门!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
      //  exit;
      //end;
      li_oriorganid:=strtoint(fcTC_loctran_oriorgan.SelectedNode.StringData);
      li_oricpseno:=GetOrganCpseno(query1,li_oriorganid);
      li_organid:=strtoint(fcTC_loctran_neworgan.SelectedNode.StringData);
      li_cpseno:=GetOrganCpseno(query1,li_organid);

      {if li_oricpseno<>li_cpseno then
      begin
        if fcTC_loctran_upreason.SelectedNode=nil then
        begin
          application.MessageBox('请选择调动原因!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
          exit;
        end;
        if fcTC_loctran_itcode.SelectedNode=nil then
        begin
          application.MessageBox('请选择补缴档次!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
          exit;
        end;
      end;  }

      if li_oricpseno<>li_cpseno then
      begin
        ls_upreason:=fcTC_loctran_upreason.SelectedNode.StringData;
        ls_cgdate:=trim(DE_loctran_cgdate.Text);
        li_itcode:=strtoint(fcTC_loctran_itcode.SelectedNode.StringData);
        lr_rewage:=strtofloat(E_loctran_rewage.Text);
        ls_notes:=trim(M_loctran_notes.Text);
      end;

      datashare_form.Dbs.StartTransaction;
      try
        with datashare_form.Query1 do
        begin
          ls_sql:='select manid,psname,agcardno,status,psseno from psarch where trim(iscode)='+#39+iscode+#39;
          close;
          sql.Clear;
          sql.Add(ls_sql);
          prepare;
          open;
          li_manid:=fieldbyname('manid').AsInteger;
          ls_psname:=fieldbyname('psname').AsString;
          ls_agcardno:=fieldbyname('agcardno').AsString;
          ls_status:=fieldbyname('status').AsString;
          li_psseno:=fieldbyname('psseno').AsInteger;

          ls_sql:='select opid from psupcase where manid='+inttostr(li_manid)+' and procflg='+#39+'1'+#39;
          close;
          sql.Clear;
          sql.Add(ls_sql);
          prepare;
          open;
          if RecordCount=0 then
          begin
            if li_oricpseno=li_cpseno then
            begin
              ls_sql:='update psarch set organid='+inttostr(li_organid)+' where manid='+inttostr(li_manid);
              close;
              sql.Clear;
              sql.Add(ls_sql);
              Execsql;
            end else
            begin
              close;    //取得最大的opid
              sql.clear;
              ls_sql:='select max(opid) opid from psupcase';
              sql.add(ls_sql);
              prepare;
              open;
              li_opid:=fieldbyname('opid').AsInteger+1;

              ls_sql:='insert into psupcase(iscode,uptype,upreason,cgdate,oristatus,opcode,opdate,procflg,notes,manid,opid,psseno,cpseno,organid,oricpseno,oriorganid,itcode,lockflg,psname,agcardno,opname) ';
              ls_sql:=ls_sql+'values('+#39+iscode+#39+','+#39+uptype+#39+','+#39+ls_upreason+#39+','+#39+ls_cgdate+#39+','+#39+ls_status+#39+','+inttostr(main_form.user.OPERID)+',today()';
              ls_sql:=ls_sql+','+#39+'1'+#39+','+#39+ls_notes+#39+','+inttostr(li_manid)+','+inttostr(li_opid)+','+inttostr(li_psseno)+','+inttostr(li_cpseno)+','+inttostr(li_organid)+','+inttostr(li_oricpseno)+','+inttostr(li_oriorganid);
              ls_sql:=ls_sql+','+inttostr(li_itcode)+','+#39+'0'+#39+','+#39+ls_psname+#39+','+#39+ls_agcardno+#39+','+#39+main_form.user.OPNAME+#39+')';
              close;
              sql.Clear;
              sql.Add(ls_sql);
              Execsql;

              ls_sql:='update psarch set chgreason='+#39+ls_upreason+#39+',chantime='+#39+ls_cgdate+#39+',itcode='+inttostr(li_itcode)+',chaninfo='+#39+ls_notes+#39;
              ls_sql:=ls_sql+',rewage='+floattostr(lr_rewage)+',cpseno='+inttostr(li_cpseno)+',organid='+inttostr(li_organid)+' where manid='+inttostr(li_manid);
              close;
              sql.Clear;
              sql.Add(ls_sql);
              Execsql;
            end;
          end else
          begin
            if li_oricpseno=li_cpseno then
            begin
              ls_sql:='update psarch set cpseno='+inttostr(li_cpseno)+',organid='+inttostr(li_organid)+',chgreason=null,chantime=null,chaninfo=null,itcode=null where manid='+inttostr(li_manid);
              close;
              sql.Clear;
              sql.Add(ls_sql);
              Execsql;

              ls_sql:='delete from psupcase where manid='+inttostr(li_manid)+' and procflg='+#39+'1'+#39;
              close;
              sql.Clear;
              sql.Add(ls_sql);
              Execsql;
            end else
            begin
              ls_sql:='update psarch set cpseno='+inttostr(li_cpseno)+',organid='+inttostr(li_organid)+',chgreason='+#39+ls_upreason+#39+',chantime='+#39+ls_cgdate+#39+',chaninfo='+#39+ls_notes+#39+',itcode='+inttostr(li_itcode)+',rewage='+floattostr(lr_rewage)+' where manid='+inttostr(li_manid);
              close;
              sql.Clear;
              sql.Add(ls_sql);
              Execsql;

              ls_sql:='update psupcase set uptype='+#39+uptype+#39+',upreason='+#39+ls_upreason+#39+',cgdate='+#39+ls_cgdate+#39+',opcode='+inttostr(main_form.user.OPERID)+',opdate=today(),procflg='+#39+'1'+#39+',notes='+#39+ls_notes+#39;
              ls_sql:=ls_sql+',cpseno='+inttostr(li_cpseno)+',organid='+inttostr(li_organid)+',oricpseno='+inttostr(li_oricpseno)+',oriorganid='+inttostr(li_oriorganid)+',itcode='+inttostr(li_itcode)+',opname='+#39+main_form.user.OPNAME+#39;
              ls_sql:=ls_sql+' where manid='+inttostr(li_manid)+' and procflg='+#39+'1'+#39;
              close;
              sql.Clear;
              sql.Add(ls_sql);
              Execsql;
            end;
          end;
        end;
        datashare_form.Dbs.Commit;
      except
        on e:exception do
        begin
          datashare_form.Dbs.Rollback;
          application.MessageBox(pchar(e.Message),'恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
          exit;
        end;
      end;


    end;


    M_info.Lines.Clear;
    M_info.Lines.Add('【'+QueryCodeName(uptype,'uptype')+'】业务办理成功!');
    M_info.Lines.Add('');
    M_info.Lines.Add('单击“继续”按钮继续办理业务。');
    M_info.Lines.Add('');
    M_info.Lines.Add('单击“完成”按钮退出业务向导。');
    FB_previous.Visible:=false;
    FB_next.Caption:='继 续';
    FB_cancel.Caption:='完 成';
    pagecontrol1.ActivePageIndex:=2;
  end else
  if pagecontrol1.ActivePageIndex=2 then
  begin
    FB_previous.Visible:=true;
    FB_previous.Enabled:=false;
    FB_next.Caption:='下一步 >';
    FB_cancel.Caption:='取 消';
    FCB_iscode.Text:='';
    RB_newinsure.Checked:=true;
    pagecontrol1.ActivePageIndex:=0;
    FCB_iscode.SetFocus;
  end;
end;


procedure Tywwizard_form.FB_cancelClick(Sender: TObject);
begin
  inherited;
  //tc_new.Canvas.Pen.Color:=clred;
  //tc_new.Canvas.Rectangle(fcTC_new_organ.Left-1,fcTC_new_organ.Top-1,fcTC_new_organ.Left+fcTC_new_organ.Width+1,fcTC_new_organ.Top+fcTC_new_organ.Height+1);
  //FormActivate(self);
  //exit;
  JoinSoci_form.ReOpen(JoinSoci_form.Query1);
  close;
end;

procedure Tywwizard_form.FB_helpClick(Sender: TObject);
begin
  inherited;
  if (HHCtrlHandle = 0) then
    application.MessageBox('帮助文件不存在!','恩普软件',MB_OK+MB_IconStop+MB_SystemModal)
  else
    FHelpSystemHook.HelpContext(1030100);
end;

procedure Tywwizard_form.FB_previousClick(Sender: TObject);
begin
  inherited;
  if pagecontrol1.ActivePageIndex=1 then
  begin
    pagecontrol1.ActivePageIndex:=0;
    FB_previous.Enabled:=false;
    Fb_next.Enabled:=true;
  end;
end;

procedure Tywwizard_form.fcTC_loctran_neworganChange(Sender: TObject);
var
  li_oricpseno,li_cpseno:integer;
begin
  inherited;
  if fcTC_loctran_neworgan.SelectedNode=nil then
    exit;

  li_oricpseno:=GetOrganCpseno(query1,strtoint(fcTC_loctran_oriorgan.SelectedNode.StringData));
  li_cpseno:=GetOrganCpseno(query1,strtoint(fcTC_loctran_neworgan.SelectedNode.StringData));
  if li_oricpseno=li_cpseno then
  begin
    fcTC_loctran_upreason.Enabled:=false;
    DE_loctran_cgdate.Enabled:=false;
    fcTC_loctran_itcode.Enabled:=false;
    E_loctran_rewage.Enabled:=false;
    M_loctran_notes.Enabled:=false;
  end else
  begin
    fcTC_loctran_upreason.Enabled:=true;
    DE_loctran_cgdate.Enabled:=true;
    fcTC_loctran_itcode.Enabled:=true;
    E_loctran_rewage.Enabled:=true;
    M_loctran_notes.Enabled:=true;
  end;
end;

procedure Tywwizard_form.FormClose(Sender: TObject;
  var Action: TCloseAction);
var
  i:integer;
begin
  inherited;
  for i:=componentcount-1 downto 0 do
  begin
    if components[i] is TShape then
      (components[i] as TShape).Free;
  end;
end;

procedure Tywwizard_form.FormActivate(Sender: TObject);
begin
  inherited;
  FCB_iscode.SetFocus;
end;

end.

⌨️ 快捷键说明

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