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

📄 fund.asp

📁 这是去年开发的中移鼎讯手机进销存系统 大家
💻 ASP
字号:
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/ChkPurview.asp"-->
<%
''用户限权检查''只有分销点用户才有权限执行此页
Dim T,Action
Action	=	Trim(request("Action"))
T		= 	Trim(request("T"))
if T="" then
	T=0
end if
%>
<html>
<head>
<title>资金管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/mobile_sale.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript>

function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    } 	
}

function CheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll"&&e.disabled!=true)
       e.checked = form.chkAll.checked;
    }
}

function CheckAdd()
{
  if(document.form1.Pro_ID.value=="")
    {
      alert("请填写名称");
	  document.form1.Pro_ID.focus();
      return false;
    }
}
</script>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="topbg"> 
    <td height="22" colspan="2" align="center"><strong>回 笼 资 金 管 理</strong></td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30"><strong>管理导航:</strong></td>
    <td height="30">
	<a href="Fund.asp">回笼资金管理</a>&nbsp;|&nbsp;
	<a href="Fund.asp?T=1">今日回笼资金</a>
	<%
	if GetUserGPower=9999 then
		Response.Write "&nbsp;|&nbsp;<a href='FindFund.asp?Action=Add'>回笼资金统计</a>"
	end if
	if GetUserGPower=9 then
		Response.Write "&nbsp;|&nbsp;<a href='Fund.asp?Action=Add'>资金回笼添加</a>"
	end if
	%>
	
	</td>
  </tr>
</table><br>
<%

if Action="Add" then						'添加
	if  GetUserGPower=9 then
		call AddAdmin()
	else
		Call Msg("只有分销点用户才可以进行此项操作", 1,"")
	end if
elseif Action="SaveAdd" then				'保存添加
	if  GetUserGPower=9 then
		call SaveAdd()
	else
		Call Msg("只有分销点用户才可以进行此项操作", 1,"")
	end if
elseif Action="Modify" then					'修改
	if  GetUserGPower=9 then
		call Modify()
	else
		Call Msg("只有分销点用户才可以进行此项操作", 1,"")
	end if
elseif Action="SaveModify" then				'保存修改
	if  GetUserGPower=9 then
		call SaveModify()
	else
		Call Msg("只有分销点用户才可以进行此项操作", 1,"")
	end if
elseif Action="Del" then					'删除
	if  GetUserGPower=9 then
		call DelFund()
	else
		Call Msg("只有分销点用户才可以进行此项操作", 1,"")
	end if
else
	call main()
end if

Call CONN_End(Conn)
sub main()
	if GetUserGPower=9999 then				'省可查看所有
		if cint(T)=1 then
'			Sql = "select * from V_TodayFund where IsCheck=1  order by InTime desc;"
			Sql = "Select * from V_Fund where convert(varchar(10),Intime,120) = convert(varchar(10),getdate(),120)  order by InTime desc;"
		else
			Sql = "Select * from V_Fund  order by InTime desc;"
		end if
	elseif GetUserGPower=999 then			'可查看出本市
		if cint(T)=1 then
			Sql = "Select * from V_Fund where  CityID='"&Cstr(GetCityID)&"' and convert(varchar(10),Intime,120) = convert(varchar(10),getdate(),120)  order by InTime desc;"
		else
			Sql = "Select * from V_Fund where CityID='"&Cstr(GetCityID)&"' order by InTime desc;"
		end if	
	elseif GetUserGPower=99 then			'县级可以查看本县
		if cint(T)=1 then
			Sql = "Select * from V_Fund where  CountyID='"&Cstr(GetCountyID)&"' and convert(varchar(10),Intime,120) = convert(varchar(10),getdate(),120)  order by InTime desc;"
		else
			Sql = "Select * from V_Fund where CountyID='"&Cstr(GetCountyID)&"' order by InTime desc;"
		end if		
	elseif GetUserGPower=9 then				'只能查看自己的发布信息
		if cint(T)=1 then
			Sql = "Select * from V_Fund where  UserID='"&Cstr(GetUserID)&"' and convert(varchar(10),Intime,120) = convert(varchar(10),getdate(),120)  order by InTime desc;"
		else
			Sql = "Select * from V_Fund where UserID='"&Cstr(GetUserID)&"' order by InTime desc;"
		end if		
	end if

	Call sql_open(Rs,Sql,Conn,1,1)
Call page_code(Rs,20)
If Not Rs.Eof Then
	IsFor=True
Else
	IsFor=False
	Response.write "<center><b><font color=red>暂无内容!</font></b></center>"
End IF
%>
<br>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
  <tr>
  <form name="myform" method="Post" action="Fund.asp" onsubmit="return confirm('确认这样操作吗?');">
     <td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr align="center" class="title">
    <td>产品名</td>
    <td>型号</td>
    <td>单价</td>
    <td>销售量</td>
    <td>销售单价</td>
    <td>金额(元)</td>
    <td>日期</td>
    <td>状态</td>
    <td  width="150" height="22"> 操作</td>
  </tr>
	<%
	For i= 1 to Rs.PageSize
	If Rs.Eof Then Exit For
	
	Dim Rst,Sqlt
	Dim MC,XH,DJ
	Sqlt="Select * from T_Product where Pro_ID="&Cstr(Rs("Pro_ID"))&""
	Call sql_open(Rst,Sqlt,conn,1,1)
	if Rst.eof and Rst.bof then
		MC = "Nothing"
		XH = "Nothing"
		DJ = "Nothing"
	else
		MC = Rst("Pro_MC")
		XH = Rst("Pro_XH")
		DJ = Rst("Pro_DJ")
	end if	
	%>
  <tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'"> 
    <td><a href="ShowFund.asp?ID=<%=rs("FundID")%>"><%=MC%></a></td>
    <td align="center"><%=XH%></td>
    <td align="center"><%=DJ%></td>
    <td align="center"><%=Rs("Sale_Num")%></td>
    <td align="center"><%=Rs("Price")%></td>
    <td align="center"><%=rs("FundZJ")%></td>
    <td align="center"><%=rs("InTime")%></td>
    <td align="center"><%
	if Rs("IsCheck")=1 then
		Response.write "已审核"
	else
		Response.write "未审核"
	end if
	%></td>
    <td width="150" align="center">
	<%
		If GetUserGPower=9 or GetUserGPower=9999 then
			Response.write "<a href='ShowFund.asp?ID=" & rs("FundID") & "'>查看</a>&nbsp;&nbsp;"
		end if
		
		If GetUserGPower=9 and Rs("IsCheck")=0 then
			Response.write "<a href='Fund.asp?Action=Modify&ID=" & rs("FundID") & "'>修改</a>&nbsp;&nbsp;"
			Response.write "<a href='Fund.asp?Action=Del&ID=" & rs("FundID") & "' onClick=""return confirm('确定要删除此进货单吗?');"">删除</a>"
		end if
	%></td>
  </tr>
	<%
	Rs.MoveNext
	Next
	%>
</table>  
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30">&nbsp;	</td>
	<td width="300"><%If IsFor Then Call page_code_down(Rs,"","条记录") %></td>
  </tr>
</table>
</td>
</form></tr></table>
<%
	Call Rs_End(Rs)
end sub

sub AddAdmin()
'添加:省级用户(9999,A,C)
%>
<form method="post" action="Fund.asp" name="form1" onsubmit="javascript:return CheckAdd();">
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
    <tr class="title"> 
      <td height="22" colspan="2"> <div align="center">填写</div></td>
    </tr>
    <tr class="tdbg">
      <td width="35%" class="tdbg">产品名</td>
      <td width="65%" class="tdbg"><select name="Pro_ID" id="Pro_ID">
        <%Call Opt_N("T_Product","Pro_ID","Pro_MC","")%>
      </select></td>
    </tr>
    <tr class="tdbg">
      <td class="tdbg">销售数量</td>
      <td class="tdbg"><input name="Sale_Num" type="text" id="Sale_Num" maxlength="8">
        (台)</td>
    </tr>
    <tr class="tdbg">
      <td class="tdbg">销售单价</td>
      <td class="tdbg"><input name="Price" type="text" id="Price" maxlength="8">
        (元)</td>
    </tr>
    <tr class="tdbg">
      <td class="tdbg">销售情况</td>
      <td class="tdbg"><textarea name="FundInfo" cols="60" rows="6" id="FundInfo"></textarea></td>
    </tr>
    <tr class="tdbg">
      <td class="tdbg">&nbsp;</td>
      <td class="tdbg">&nbsp;</td>
    </tr>
    <tr> 
      <td height="40" colspan="2" align="center" class="tdbg"><input name="UserID" type="hidden" id="UserID" value="<%=GetUserID%>">        
      <input name="Action" type="hidden" id="Action" value="SaveAdd"> 
        <input  type="submit" name="Submit" value=" 添 加 " style="cursor:hand;"> 
        &nbsp; <input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='Fund.asp'" style="cursor:hand;"></td>
    </tr>

  </table>
</form>
<%
end sub

sub Modify()
	Dim FundID
	FundID=trim(Request("ID"))
	if FundID="" then
		Call Msg("请指定要修改的内容", 1,"")
		exit sub
	else
		FundID=Clng(FundID)
	end if
	
	Sql="Select * from T_Fund where FundID=" & FundID
	Call sql_open(Rs,Sql,Conn,1,3)
	If Rs.Bof And Rs.EOF Then
		Call Msg("不存在此内容", 1,"")
	Else
		If Rs("IsCheck")=1 then
			Call Msg("管理已经审核过,不允许修改",1,"")
		Else
%>
<form method="post" action="Fund.asp" name="form1" onsubmit="javascript:return CheckModify();">
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
    <tr class="title"> 
      <td height="22" colspan="2"> <div align="center">修改产品类别</div></td>
    </tr>
<!--
    <tr>
      <td width="35%" class="tdbg">流水号</td>
      <td width="65%" class="tdbg"><font color="#0000FF"><%=Rs("ZJNo")%></font></td>
    </tr>
-->
    <tr>
      <td class="tdbg">产品名</td>
      <td class="tdbg"><select name="Pro_ID" id="Pro_ID">
        <%Call Opt_N("T_Product","Pro_ID","Pro_MC",Rs("Pro_ID"))%>
      </select></td>
    </tr>
    <tr class="tdbg">
      <td class="tdbg">销售数量</td>
      <td class="tdbg"><input name="Sale_Num" type="text" id="Sale_Num" value="<%=Rs("Sale_Num")%>" maxlength="8">
        (台)</td>
    </tr>
    <tr class="tdbg">
      <td class="tdbg">销售单价</td>
      <td class="tdbg"><input name="Price" type="text" id="Price" value="<%=Rs("Price")%>" maxlength="8">
        (元)</td>
    </tr>
    <tr class="tdbg">
      <td class="tdbg">销售情况</td>
      <td class="tdbg"><textarea name="FundInfo" cols="60" rows="6" id="FundInfo"><%=Rs("FundInfo")%></textarea></td>
    </tr>
    <tr class="tdbg">
      <td class="tdbg">&nbsp;</td>
      <td class="tdbg">&nbsp;</td>
    </tr>

    <tr> 
      <td colspan="2" align="center" class="tdbg"><input name="UserID" type="hidden" id="UserID" value="<%=Rs("UserID")%>">
      <input name="FundID" type="hidden" id="FundID" value="<%=Rs("FundID")%>">        <input name="Action" type="hidden" id="Action" value="SaveModify"> 
        <input  type="submit" name="Submit" value="保存修改结果" style="cursor:hand;">
        &nbsp;
        <input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='Fund.asp'" style="cursor:hand;"></td>
    </tr>
  </table>
</form>
<%if Rs("isCheck")=2 then %>
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
    <tr class="topbg">
      <td><div align="center">留言</div></td>
    </tr>
    <tr class="tdbg">
      <td>
	  <%
	  if Rs("CInfo")<>"" then
	  	Response.write "<font color=#FF0000>"&Rs("CInfo")&"</font>"
	  End if
	  %>
	  </td>
    </tr>
  </table>
<%
end if
		End If
	End If
	Call Rs_End(Rs)
End Sub
%>
</body>
</html>
<%
'增加新组
Sub SaveAdd()
	Dim ZJNo,Pro_ID,Sale_Num,Price,FundZJ,FundInfo,UserID
'	ZJNo = trim("ZJ"&Format_Time(Now(),7)&RndNum(4))
	UserID=trim(Request("UserID"))
	Pro_ID=trim(Request("Pro_ID"))
	Sale_Num=trim(Request("Sale_Num"))
	Price=trim(Request("Price"))
'	FundZJ=trim(Request("FundZJ"))
	Call Isnum(Price,Price,1)
	Call Isnum(Sale_Num,Sale_Num,1)
	FundZJ=cint(Price)*cint(Sale_Num)
	FundInfo=trim(Request("FundInfo"))
	if Pro_ID="" then
		Call Msg("产品名不能为空", 1,"")
	end if
	Sql="Select * from T_Fund"
	Call sql_open(Rs,Sql,Conn,1,3)
   	rs.addnew
'	rs("ZJNo")=ZJNo					'流水号:ZJ+年月日时分秒+4位随机数
 	rs("UserID")=UserID
	rs("Pro_ID")=Pro_ID
	Rs("Sale_Num")=Sale_Num
	Rs("Price")=Price	
	rs("FundZJ")=FundZJ
	rs("FundInfo")=FundInfo
	rs.update
    Call Rs_End(Rs)
	Call Msg("添加成功",5,"fund.asp")
end sub
'修改
sub SaveModify()
	dim FundID,Pro_ID,Sale_Num,Price,FundZJ,FundInfo,UserID
	FundID=trim(Request("FundID"))
	UserID=trim(Request("UserID"))
	Pro_ID=trim(Request("Pro_ID"))
	Sale_Num=trim(Request("Sale_Num"))
	Price=trim(Request("Price"))	
'	FundZJ=trim(Request("FundZJ"))
	Call Isnum(Price,Price,1)
	Call Isnum(Sale_Num,Sale_Num,1)
	FundZJ=cint(Price)*cint(Sale_Num)
	FundInfo=trim(Request("FundInfo"))

	if FundID="" then
		Call Msg("请指定要修改的内容", 1,"")
	else
		FundID=Clng(FundID)
	end if
	Sql="Select * from T_Fund where FundID=" & FundID
	Call sql_open(Rs,Sql,Conn,1,3)
	if Rs.Bof and Rs.EOF then
		Call Msg("不存在此内容", 1,"")
		Call Rs_End(Rs)
		exit sub
	end if

	Rs("UserID")=UserID
	Rs("Pro_ID")=Pro_ID
	Rs("Sale_Num")=Sale_Num
	Rs("Price")=Price	
	Rs("FundZJ")=FundZJ
	Rs("FundInfo")=FundInfo
	if Rs("isCheck")=2 then
		Rs("isCheck")=0
	end if
	Rs("ModifyTime")=Now()
 	Rs.update
	Call Rs_End(Rs)
	Call Msg("修改成功",5,"fund.asp")
end sub

sub DelFund()
	dim FundID
	FundID=trim(Request("ID"))
	if FundID="" then
		Call Msg("请指定删除的内容", 1,"")
		exit sub
	end if
	if instr(FundID,",")>0 then
		FundID=replace(FundID," ","")
		Sql="Select * from T_Fund where FundID in (" & FundID & ")"
	else
		FundID=clng(FundID)
		sql="select * from T_Fund where FundID=" & FundID
	end if
	Call sql_open(Rs,Sql,Conn,1,3)
	do while not rs.eof

		rs.delete
		rs.update
		rs.movenext
	loop
	Call Rs_End(Rs)
	call main()
end sub
%>

⌨️ 快捷键说明

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