格式是这个样子的:岗位--职责;岗位--职责......
岗位中可能含有几个职责,一个人可以分别有几个不同有岗位。
1、将这个人的岗位列在一个列表框中,选中一个职责,另一个列表框中自动显示其对应的职责。
不知道server出了什么问题,寡不执行代理,害得我连最简单的一个代理都调不过去,耽误了近一个小时!!!!
视图名子写错了,取不到值,活该!!
现在数据可以读出来了。可却是这个样子的:
程序员--编写程序代码;程序员--对完成的软件进行测试;程序员--对销售出去的产品和用户协调实施;财务总监--管理公司资产账目;
下面要进行对字符串的操作,同时可能要定义数组。
first 读出的数据中,前面的岗位有可能重复。重复的只取一个就可以了。
second 指定了一个岗位,要能将其下属的所有职责列出来,有点难度:(
先做个备份:Sub Initialize Dim s As New NotesSession Dim db As NotesDatabase Dim curdoc,doc As NotesDocument Dim view As NotesView Dim htm,office As String Dim job,offi As String Dim jobs As Variant Dim excute As String excute = "@Unique(" Set curdoc = s.DocumentContext Set db = s.GetDatabase("TEST","renshiguanli.nsf",False) Set view = db.GetView("gangweizhize") Set doc = view.GetFirstDocument While Not doc Is Nothing If doc.name(0) = curdoc.thisuser(0) Then htm = htm & "您的岗位:" & doc.jobname(0) & "[ ]" Dim b As String Forall a In doc.alloffice htm = htm & a & "[ ]" b =Strleft(a,"--") excute = excute + "'" + b + "':" End Forall Else End If Set doc = view.GetNextDocument(doc) Wend htm = htm & excute & "'')" excute = excute & "'')" jobs = Evaluate(excute,curdoc) Forall c In jobs htm = htm + c End Forall curdoc.HTMLbody = htm End Sub |
通过以上的代理,现在显示的是这个样子:
程序员--编写程序代码
程序员--对完成的软件进行测试
程序员--对销售出去的产品和用户协调实施
财务总监--管理公司资产账目
@Unique('程序员':'程序员':'程序员':'财务总监':'')
您的岗位有:
程序员财务总监
可以将重复的岗位分检出来了:)
-------------------------------------------------------
以上显示的内容可以在主页显示,后面对于每条“岗位--职责” 的记录都加上一个“新建”
的操作,打开任务表单,直接将岗位和职责带到表单里面去。其实这是一个自己给自己下任务
的过程。当然,要是领导下任务的话要进行选择。
以上功能都已实现!
以下是完成给出选择职责列表的代码:
1、点"选择",打开selectjob?openform,后面加上username,标识被下任务的对象
在selectjob?openform打开时执行以下代理,给出列表:
Sub Initialize Dim s As New NotesSession Dim db As NotesDatabase Dim curdoc,doc As NotesDocument Dim view As NotesView Dim htm,office As String Dim job,offi As String Dim jobs As Variant Dim excute As String excute = "@Unique(" Set curdoc = s.DocumentContext Set db = s.GetDatabase("TEST","renshiguanli.nsf",False) Set view = db.GetView("gangweizhize") Set doc = view.GetFirstDocument While Not doc Is Nothing If doc.name(0) = curdoc.thisuser(0) Then htm = htm & curdoc.thisuser(0) & "的岗位职责列表:" & doc.jobname(0) & "[<br>]" Dim b,d As String If Not doc.alloffice(0)="" Then Forall a In doc.alloffice b =Strleft(a,"--") d =Strright(a,"--") htm = htm & {[<input type=radio name="selectjob" value="} htm = htm & {&job=}& b & {&office=} & d &{">]} htm = htm & a & "[<br>]" excute = excute + "'" + b + "':" End Forall Else htm="此用户没有指定岗位及职责!" End If Else End If Set doc = view.GetNextDocument(doc) Wend If Not htm = "此用户没有指定岗位及职责!" Then excute = excute & "'')" jobs = Evaluate(excute,curdoc) 'htm = htm & "[<br>]" & "您的岗位有:[<br>]" 'Forall c In jobs ' htm = "[<br>]" & htm + c 'End Forall End If curdoc.HTMLbody = htm End Sub |
和上面的一个代理差不多,只不过显示的不同。
通过选择某个记录,就可以将此记录的岗位和职责信息带到表单位中