|
|

楼主 |
发表于 2003/5/30 08:18:44
|
显示全部楼层
Dim workspace As New NotesUIWorkspace
Dim uidoc As notesuidocument
Dim udoc As notesdocument
Set uidoc = workspace.CurrentDocument
Set udoc = uidoc.document
flag = Val(uidoc.fieldgettext("flag"))
If flag = 0 Then
'取文档中的域值
'定义绘画
Dim session As New notessession
Dim db As notesdatabase
Dim view As notesview
Dim doc As notesdocument
'设定绘画
Set db = session.currentdatabase
Set view = db.getview("set_doc")
Set doc = view.getfirstdocument
udoc.name = udoc.ser_name(0)
'取文档值
mid_list = doc.globals_list_number(0)
first_list = udoc.temp_value(0)
'判断文档中的值来确定显示的值
midnum = Val(mid_list)
If midnum < 10 Then
last_list = first_list + "000" + Right(mid_list,1)
Elseif midnum < 100 Then
last_list = first_list + "00" + Right(mid_list,2)
Elseif midnum < 1000 Then
last_list = first_list + "0" + Right(mid_list,3)
Else
last_list = first_list + Right(mid_list,4)
End If
'给出正确的维修单流水号值
udoc.ser_list = last_list
udoc.ser_list_ch = last_list
midstr = Cstr(midnum+1)
doc.globals_list_number = midstr
Call doc.save(True, True)
udoc.flag = "1"
udoc.name = udoc.ser_name(0)
Call udoc.save(True,True)
Else
udoc.ser_list = udoc.ser_list_ch(0)
udoc.name = udoc.ser_name(0)
Call udoc.save(True,True)
End If
If udoc.rep_flag(0) = "1" Then
udoc.rep_name = udoc.rep(0)
Call udoc.save(True,True)
End If
If udoc.it_flag(0) = "1" Then
udoc.it_name = udoc.it(0)
Call udoc.save(True,True)
End If
If udoc.pri_flag(0) = "1" Then
udoc.pri_name = udoc.pri(0)
Call udoc.save(True,True)
End If
flag = Val(uidoc.fieldgettext("fix_flag"))
If flag = 0 Then
If udoc.ApprovalChoiceOS(0) = "同意外修" Or udoc.ApprovalChoiceOS(0) = "同意内修" Or udoc.ApprovalChoiceOS(0) = "不同意" Then
udoc.fix = udoc.ApprovalChoiceOS(0)
udoc.fix_way = udoc.ApprovalChoiceOS(0)
udoc.fix_flag = "1"
Call udoc.save(True,True)
Exit Sub
End If
Elseif flag = 1 Then
udoc.fix = udoc.fix_way(0)
Call udoc.save(True,True)
End If |
|