📄 g_stuffbj.asp
字号:
if monthid="" then
sql="select count(Clientnum) as total from G_viewlost where year(reportdate)='"&yearid&"' and stuffnum='"&sid&"'"
end if
if monthid<>"" then
sql="select count(Clientnum) as total from G_viewlost where year(reportdate)='"&yearid&"' and closemonth='"&uu&"' and stuffnum='"&sid&"'"
end if
case "人均访问客户次数(次)"
if monthid="" then
sql="select count(ExecYN) as total from G_viewexec where year(closedate)='"&yearid&"' and stuffnum='"&sid&"'"
end if
if monthid<>"" then
sql="select count(ExecYN) as total from G_viewexec where year(closedate)='"&yearid&"' and month(closedate)='"&uu&"' and stuffnum='"&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 stuffnum='"&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 stuffnum='"&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 (stuffnum='"&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 (stuffnum='"&sid&"')"
end if
end select
set rstj=server.createobject("adodb.recordset")
rstj.open sql,Pubconn,1
'response.write sql&"<BR>"
'******************完成值的情况******************************
select case rsywy.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 "丢单比率(%)"
total=rstj("total")
case "人均访问客户次数(次)"
total=rstj("total")
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 rsywy.fields(1).value="" then
objnum=0
else
objnum=rsywy.fields(1).value/10000
end if
'以下为百分比的值
if objnum=0 then
pernum=0
else
pernum=formatpercent(total/objnum,2)
end if
%>
<%
'四个值rsywy.fields(0).value,objnum,total,pernum
'将数据填写到临时表中
set bmbj=server.Createobject("adodb.recordset")
m_sql="select * from G_Tblstuffbj"
bmbj.open m_sql,Pubconn,1,3
bmbj.addnew
bmbj("object")=rsywy.fields(0).value
bmbj("objectnum")=objnum
bmbj("completenum")=total
bmbj("Percentnum")=pernum
bmbj.update
%>
<%
rsywy.movenext
if rsywy.eof then exit for
next
%>
<%
S="select * from G_Tblstuffbj "
set bj=server.createobject("adodb.recordset")
bj.open S,pubconn,1,3
%>
<table border="1" cellspacing="0" width="100%" height="30" align="center">
<tr>
<td width="117" height="24" align="center" bgcolor="#DDD2C4">
<font size="2">项目
</font>
</td>
<td width="149" height="24" align="center" bgcolor="#DDD2C4">
<font size="2">目标值</font>
</td>
<td width="128" height="24" align="center" bgcolor="#DDD2C4">
<font size="2">完成值
</font>
</td>
<td width="262" 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="117" height="23" align="center" ><font size="2"><%=bj("object")%></td>
<td width="149" height="23" align="center" ><font size="2"><%=bj("objectnum")%></font></td>
<td width="128" height="23" align="center" ><font size="2"><%=bj("completenum")%></font></td>
<td width="262" 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">返回</a>
</form>
<%
rsywy.close
set rsywy=nothing
bj.close
set bj=nothing
end if %>
</body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -