Dim bm As String
Dim gw As String
Dim name As String
Dim userid = Functions.Execute("验证函数",e,"xsbe.htm")
If userid > "" Then
wb.AppendCookie("userid",userid) '将用户名和密码写入cookie
Dim wxdr As DataRow = DataTables("users").SQLFind("userid='" & userid & "'")
If wxdr IsNot Nothing Then
gw = wxdr("position")
name = wxdr("name")
Dim wxdr1 As DataRow = DataTables("departments").SQLFind("id='" & wxdr("department") & "'")
If wxdr1 IsNot Nothing Then
bm= wxdr1("name")
End If
With wb.AddTable("","Table1")
.Alternate = 3
Dim nms() As String = {"报备人","用户姓名","楼盘","单元房号","客户等级","用户电话","用户微信","户型" ,"状态"}
.Head.AddRow(nms)
For Each r As DataRow In DataTables("终端用户").sqlSelect("[部门] = '" & bm & "'", "", "日期 Desc")
查询想设计两个等级设有 营销部
下辖 营销一部 营销二部 营销三部
部门 这一列分别会填入 营销一部 或 营销二部 或 营销三部
设计需求是:总监可以查看 营销一部 营销二部 营销三部 所有行
现在的代码只能分主管查看自己的部门
总监不能查看所有三个部门的行
求助
With .Body.AddRow(r("报备人"),r("用户姓名"),r("楼盘"),r("单元房号"),r("客户等级"),"<a href='tel:" & r("用户电话") & "'>" & r("用户电话") & "</a>",r("用户微信"),r("户型"),r("状态"))
'.AddCell(Format(r("日期"),"MM月dd日"))
End With
Next
End With
e.WriteString(wb.Build)
[此贴子已经被作者于2018/3/13 20:19:17编辑过]