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

📄 g_bmbj.asp

📁 一个很好的在线购物系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
                end if      
             case  "销售回款(万元)"     
                   
                if monthid=""  then     
                   sql="select sum(Balmoney) as total from G_viewsell where year(gattime)='"&yearid&"' and departcode='"&sid&"'"     
                end if      
                if monthid<>"" then     
                   sql="select sum(Balmoney) as total from G_viewsell where year(gattime)='"&yearid&"' and month(gattime)='"&uu&"' and departcode='"&sid&"'"     
                end if      
     
            case  "丢单比率(%)"     
                  
              if monthid=""  then     
                sql="select count(Clientnum) as total from G_viewlost where year(reportdate)='"&yearid&"' and departcode='"&sid&"'"     
              end if       
             if monthid<>""  then     
                sql="select count(Clientnum) as total from G_viewlost where year(reportdate)='"&yearid&"' and closemonth='"&uu&"' and departcode='"&sid&"'"     
             end if      
         case  "人均访问客户次数(次)"     
                  
               if monthid=""  then     
                 sql="select count(ExecYN) as total from G_viewexec  where year(closedate)='"&yearid&"' and departcode='"&sid&"'"     
              end if       
              if monthid<>""  then     
                 sql="select count(ExecYN) as total from G_viewexec  where year(closedate)='"&yearid&"' and month(closedate)='"&uu&"' and departcode='"&sid&"'"     
              end if      
        case  "业务员行动计划完成率(%)"     
                  
               if monthid=""  then     
                 sql="select  count(ExecYN)as total,count(clientnum) as total1 from G_viewexec  where year(closedate)='"&yearid&"' and departcode='"&sid&"'"     
              end if       
              if monthid<>"" then     
                 sql="select count(ExecYN) as total,count(clientnum) as total1 from G_viewexec  where year(closedate)='"&yearid&"' and month(closedate)='"&uu&"' and departcode='"&sid&"'"     
              end if      
        case "新客户开发数量(家)"
               if monthid=""  then    
                 sql="select  count(clientnum) as total from D_clientInfo  where  (type='预期客户' or type='潜在客户') and  (year(rq)='"&yearid&"') and (departcode='"&sid&"')"    
              end if      
              if monthid<>"" then    
                 sql="select  count(clientnum) as total from D_clientInfo  where (type='预期客户' or type='潜在客户')  and  (year(rq)='"&yearid&"') and (month(rq)='"&uu&"') and (departcode='"&sid&"')"    
              end if   
     
     end select     
        set rstj=server.createobject("adodb.recordset")     
        rstj.open sql,Pubconn,1     
          
       'response.write sql     
       '******************完成值的情况******************************   
      select case  rsbm.fields(0).value
          case "订单金额(万元)" 
             if isnull(rstj("total")) then   
                 total=0   
             else   
                 total=rstj("total")/10000   
             end if    

          case  "销售回款(万元)"
             if isnull(rstj("total")) then   
                 total=0   
             else   
                total=rstj("total")/10000   
             end if    

          case  "丢单比率(%)"
              if yqtotal=0 then    '没有预期客户
                 total=0
              else
                 total=formatnumber(rstj("total")/yqtotal,2)
              end if        

          case  "人均访问客户次数(次)"
                if  ywytotal=0 then  ' 当没有业务时
                   total=0
                else
                  total=formatnumber(rstj("total")/ywytotal,2)
                end if  

          case  "业务员行动计划完成率(%)"
                 if  rstj("total1")=0 then    '分母为零时没有意义   
                    total=0   
                 else   
                     total=formatnumber(rstj("total")/rstj("total1"),2)   
                 end if 
           case "新客户开发数量(家)"
                      total=rstj("total")
      end select
    
       
    '*****************以下为目标值的情况*****************   
     
        
            if  rsbm.fields(1).value=""  then    
               objnum=0   
            else    
              objnum=rsbm.fields(1).value/10000    
           end if     
      
    
      if objnum=0 then    
          pernum=0    
      else    
          pernum=formatpercent(total/objnum,2)    
      end  if            
     
     %>                                                           
     <%     
     '四个值rsbm.fields(0).value,objnum,total,pernum    
     '将数据填写到临时表中    
     set bmbj=server.Createobject("adodb.recordset")    
     m_sql="select *  from G_Tblbmbj"    
     bmbj.open m_sql,Pubconn,1,3    
    
      bmbj.addnew    
        bmbj("object")=rsbm.fields(0).value    
        bmbj("objectnum")=objnum    
        bmbj("completenum")=total    
        bmbj("Percentnum")=pernum    
      bmbj.update    
         
     %>                                                                                                                      
      
    <%                                                                                   
     rsbm.movenext                                                                                  
     if rsbm.eof then exit for                                                                                  
  next                                                                                  
  %>     
  <%     
  S="select *  from G_Tblbmbj "    
  set bj=server.createobject("adodb.recordset")    
  bj.open S,pubconn,1     
       
  %>     
 <table border="1" cellspacing="0" width="654" height="30"  align="center">                                                                                       
                                                                                             
  <tr>                                                                                                       
                                                                                       
     <td width="114" height="24" align="center" bgcolor="#DDD2C4">                                                                                     
      <font size="2">项目     
      </font>     
     </td>                                                                                                     
    <td width="171" height="24" align="center" bgcolor="#DDD2C4">                                                                                   
     <font size="2">目标值</font>           
     </td>                                                                                                  
     <td width="98" height="24" align="center" bgcolor="#DDD2C4">                                                                                 
      <font size="2">完成值     
      </font>     
     </td>                                                                                                 
                                                                                                    
    <td width="253" height="24" align="center" bgcolor="#DDD2C4">                                                                                
     <font size="2">完成百分比       
     </font>       
     </td>                                                                                                 
                                                                                                    
  </tr>                                     
   <% for n=1 to bj.recordcount%>             
       <%if  n mod 2=1 then                         
            bg="#f7f7f7"                           
       else                         
            bg="#EDEBEC"                          
       end if%>      
    <%    
            
      
    
     select case  bj("object")    
       case  "订单金额(万元)"     
          'if bj("completenum")<>0 then    
            if bj("completenum")-bj("objectnum")>=0 then    
               bj.movenext    
               if bj.eof then exit for     
            end  if    
          'end if     
       case  "销售回款(万元)"    
           'if bj("completenum")<>0 then    
            if bj("completenum")-bj("objectnum")>=0 then    
               bj.movenext   
               if bj.eof then exit for      
            end  if    
          'end if     
     case  "丢单比率(%)"    
        'if bj("completenum")<>0 then    
               if bj("completenum")-bj("objectnum")<=0 then    
               bj.movenext   
               if bj.eof then exit for      
            end  if    
        ' end if     
       case  "人均访问客户次数(次)"    
         ' if bj("completenum")<>0 then    
    
            if bj("completenum")-bj("objectnum")>=0 then    
               bj.movenext   
               if bj.eof then exit for      
            end  if    
         ' end if     
      case  "业务员行动计划完成率(%)"      
             
         'if bj("completenum")<>0 then    
    
            if bj("completenum")-bj("objectnum")>=0 then    
               bj.movenext    
               if bj.eof then exit for     
            end  if    
         ' end  if  
     case "新客户开发数量(家)"
          ' if bj("completenum")<>0 then    
    
            if bj("completenum")-bj("objectnum")>=0 then    
               bj.movenext    
               if bj.eof then exit for     
            end  if    
         ' end  if  

 end select    
        
    %>           
                                                                                              
  <tr bgcolor="<%=bg%>">                                                              
                                                                                           
                                                                                                
    <td width="114" height="23" align="center" ><font size="2"><%=bj("object")%></td>                                                                                   
      <td width="171" height="23" align="center" ><font size="2"><%=bj("objectnum")%></font></td>        
                                                                                
      <td width="98" height="23" align="center" ><font size="2"><%=bj("completenum")%></font></td>            
               
             
                                                                                               
      <td width="253" height="23" align="center" ><font size="2"><%    
      if bj("objectnum")="0"  then    
         response.write "分母为零,无法分析"    
      else    
         response.write  bj("percentnum")    
             
      end  if %></font></td>        
          
                                                                                      
  </tr>     
 <%                                                                                  
     bj.movenext                                                                                  
     if bj.eof then exit for                                                                                  
  next %>                                                                      
                                                                                    
 </table>            
                                                                                          
                                                                                
<p align="left">      
            
            <a href="G_bjxx.asp"><font size="2">返回</font></a>             
             
                                                                                                                     
 </form>                                                                                                                       
<%         
rsbm.close          
set rsbm=nothing         
end if %>                   
                   
</body>                                                                                                                     
                                                                                                                     

⌨️ 快捷键说明

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