Foxtable(狐表)用户栏目专家坐堂 → [求助]移动开发 为什么字符型账号审批后返回的是数值型?


  共有1746人关注过本帖树形打印复制链接

主题:[求助]移动开发 为什么字符型账号审批后返回的是数值型?

帅哥哟,离线,有人找我吗?
shenyl0211
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:977 积分:6835 威望:0 精华:0 注册:2012/4/2 21:49:00
[求助]移动开发 为什么字符型账号审批后返回的是数值型?  发帖心情 Post By:2017/8/22 18:20:00 [只看该作者]

“项目借款”函数全部代码如下,关键代码已标红,为什么字符型的“账号”,用手机审批后返回的是科学计数法的数值,无法得知原来的账号?
谢谢!

Dim e As RequestEventArgs = args(0)
Dim rw,rw0,bmmc,nms(),nm,fqr,fqr1,jsr,jsr0 As String
Dim dr As DataRow
Dim dc As DataCol
Dim wb As new WeUI
Dim i As Integer
rw=pts(4) '全局变量
rw0=rw.SubString(1,2)
dr = DataTables(dtname).Find("[_Identify]=" & PrimaryKey) 'dtname=“项目借款”
If e.PostValues.count = 0 Then
    wb.AppendHTML("<style>.red{color:red;}</style>", True)
    wb.InsertHTML("<meta name='viewport' c>")
    wb.AddForm("","form1",dtname & ".htm")
    With wb.AddInputGroup("form1","ipg1","基本信息")
        bmmc=dr("申请部门")
        With .AddInput("申请部门","申请部门","text")
            .Value = dr("申请部门")
            .readonly=True
        End With
        With .AddInput("收款人","收款人","text")
            .Value = dr("收款人")
            .readonly=True
        End With
        With .AddInput("开户银行","开户银行","text")
            .Value = dr("开户银行")
            .readonly=True
        End With
        With .AddInput("账号","账号","text")
            .Value = dr("账号")
            .readonly=True
        End With
        With .Addinput("项目名称","项目名称","text")
            .value = dr("项目名称")
            .readonly=True
        End With
        With .AddInput("合同额","合同额","text")
            .Value = format(dr("合同额"),"#,###")
            .readonly=True
        End With
        With .AddInput("完成产值","完成产值","text")
            .Value = format(dr("完成产值"),"#,###")
            .readonly=True
        End With
        With .AddInput("预算成本","预算成本","text")
            .Value = format(dr("预算成本"),"#,###")
            .readonly=True
        End With
        With .AddInput("匹配成本","匹配成本","text")
            .Value = format(dr("匹配成本"),"#,###")
            .readonly=True
        End With
        With .AddInput("开累支出","开累支出","text")
            .Value = format(dr("开累支出"),"#,###")
            .readonly=True
        End With
        With .AddInput("允许借款","允许借款","text")
            .Value = format(dr("允许借款"),"#,###")
        End With
        With .AddInput("累计到款","累计到款","text")
            .Value = format(dr("累计到款"),"#,###")
            .readonly=True
        End With
        With .AddInput("借款余额","借款余额","text")
            .Value = format(dr("借款余额"),"#,###")
            .readonly=True
        End With
        With .AddInput("用途","用途","text")
            .Value = dr("用途")
            .readonly=True
        End With
        .AddInput("借款金额","借款金额","text").Value = format(dr("借款金额"),"#,###")
    End With
    With wb.AddInputGroup("form1","ipg2","备注")
        With .AddTextArea("备注",5)
            .class="red"
            .Value = dr("备注")
        End With
    End With
    With wb.AddInputGroup("form1","ipg3","审批信息")
        With .AddInput("申请人","申请人","text")
            .Value = dr("申请人")
            .Readonly= True
        End With
        With .AddInput("申请日期","申请日期","datetime-local")
            .value= Format(dr("申请日期"),"yyyy-MM-ddTHH:mm")
            .readonly=True
        End With
        With .AddInput("项目经理","项目经理","text")
            .Value =dr("项目经理")
            .readonly=True
        End With
        With .AddInput("复核日期","复核日期","datetime-local")
            If rw0="复核" Then
                .value= Format(Date.now,"yyyy-MM-ddTHH:mm")
            Else
                .value= Format(dr("复核日期"),"yyyy-MM-ddTHH:mm")
            End If
            .readonly=True
        End With
        If rw0="复核" Then
            .AddSelect("申请部门会计","申请部门会计", dr("申请部门会计") & "|" & DataTables("字典管理").SQLGetComboListString("财务人员","部门名称='" & bmmc & "'"))
        Else
            With .AddInput("申请部门会计","申请部门会计","text")
                .Value =dr("申请部门会计")
                .readonly=True
            End With
        End If
        If rw0<>"复核" Then
            With .AddInput("审核日期","审核日期","datetime-local")
                If rw0="审核" Then
                    .value= Format(Date.now,"yyyy-MM-ddTHH:mm")
                Else
                    .value= Format(dr("审核日期"),"yyyy-MM-ddTHH:mm")
                End If
                .readonly=True
            End With
        End If
        If rw0="复核" OrElse rw0="审核" Then
            .AddSelect("申请部门领导","申请部门领导", dr("申请部门领导") & "|" & DataTables("字典管理").SQLGetComboListString("部门领导","部门名称='" & bmmc & "'"))
        Else
            With .AddInput("申请部门领导","申请部门领导","text")
                .Value =dr("申请部门领导")
                .readonly=True
            End With
        End If
        If rw0<>"复核" AndAlso rw0<>"审核" Then
            With .AddInput("初批日期","初批日期","datetime-local")
                If rw0="初批" Then
                    .value= Format(Date.now,"yyyy-MM-ddTHH:mm")
                Else
                    .value= Format(dr("初批日期"),"yyyy-MM-ddTHH:mm")
                End If
                .readonly=True
            End With
        End If
        If rw0="复核" OrElse rw0="审核" OrElse rw0="初批" Then
            .AddSelect("财务部领导","财务部领导",dr("财务部领导") & "|" & DataTables("字典管理").SQLGetComboListString("部门领导","部门名称='财务部'"))
        Else
            With .AddInput("财务部领导","财务部领导","text")
                .Value =dr("财务部领导")
                .readonly=True
            End With
        End If
        If rw0<>"复核" AndAlso rw0<>"审核" AndAlso rw0<>"初批" Then
            With .AddInput("再批日期","再批日期","datetime-local")
                If rw0="再批" Then
                    .value= Format(Date.now,"yyyy-MM-ddTHH:mm")
                Else
                    .value= Format(dr("再批日期"),"yyyy-MM-ddTHH:mm")
                End If
                .readonly=True
            End With
        End If
        If rw0="复核" OrElse rw0="审核" OrElse rw0="初批" OrElse rw0="再批" Then
            .AddSelect("审计部领导","审计部领导",dr("审计部领导") & "|" & DataTables("字典管理").SQLGetComboListString("部门领导","审批部门='审计部'"))
        Else
            With .AddInput("审计部领导","审计部领导","text")
                .Value =dr("审计部领导")
                .readonly=True
            End With
        End If
        If rw0<>"复核" AndAlso rw0<>"审核" AndAlso rw0<>"初批" AndAlso rw0<>"再批" Then
            With .AddInput("备案日期","备案日期","datetime-local")
                If rw0="备案" Then
                    .value= Format(Date.now,"yyyy-MM-ddTHH:mm")
                Else
                    .value= Format(dr("备案日期"),"yyyy-MM-ddTHH:mm")
                End If
                .readonly=True
            End With
        End If
        If rw0<>"审批" AndAlso rw0<>"批转" AndAlso rw0<>"受理" Then
            .AddSelect("公司分管领导","公司分管领导",dr("公司分管领导") & "|" & DataTables("字典管理").SQLGetComboListString("分管领导","部门名称='" & bmmc & "'"))
        Else
            With .AddInput("公司分管领导","公司分管领导","text")
                .Value =dr("公司分管领导")
                .readonly=True
            End With
        End If
        If rw0="审批" OrElse rw0="批转" OrElse rw0="受理" Then
            With .AddInput("审批日期","审批日期","datetime-local")
                If rw0="审批" Then
                    .value= Format(Date.now,"yyyy-MM-ddTHH:mm")
                Else
                    .value= Format(dr("审批日期"),"yyyy-MM-ddTHH:mm")
                End If
                .readonly=True
            End With
        End If
        If rw0<>"批转" AndAlso rw0<>"受理" Then
            .AddSelect("总经理","总经理",dr("总经理") & "|" & DataTables("字典管理").SQLGetComboListString("部门领导","审批部门='总经理'"))
        Else
            With .AddInput("总经理","总经理","text")
                .Value =dr("总经理")
                .readonly=True
            End With
        End If
        If rw0="批转" OrElse rw0="受理" Then
            With .AddInput("批转日期","批转日期","datetime-local")
                If rw0="批转" Then
                    .value= Format(Date.now,"yyyy-MM-ddTHH:mm")
                Else
                    .value= Format(dr("批转日期"),"yyyy-MM-ddTHH:mm")
                End If
                .readonly=True
            End With
        End If
        If rw0<>"受理" Then 
            .AddSelect("财务部受理","财务部受理",dr("财务部受理") & "|" & DataTables("字典管理").SQLGetComboListString("财务人员","部门名称='" & bmmc & "'"))
        Else
            With .AddInput("受理日期","受理日期","datetime-local")
                .value= Format(Date.now,"yyyy-MM-ddTHH:mm")
                .readonly=True
            End With
        End If
    End With
    With wb.AddButtonGroup("form1","btg1",False)
        .Add("bt1",rw0,"submit").Value="审批"
        With .Add("bt2","驳回","submit")
            .kind=2
            .Value="驳回"
        End With
    End With
Else '接收表单数据
    If e.PostValues("bt2")="驳回" Then
        Functions.Execute("驳回",e)
        Return ""
    End If
    If cint(e.PostValues("借款金额"))=0 Then
        With wb.AddMsgPage("","msgpage","审批失败","《借款金额》必填!")
            .icon = "Warn"
            .AddButton("btn1","返回").Attribute = ""
        End With
        e.WriteString(wb.Build)
        Return ""
    End If
    If e.PostValues.ContainsKey("备注") AndAlso e.PostValues("备注").Length > 100 Then
        With wb.AddMsgPage("","msgpage","审批失败","《备注》长度不能超过100!")
            .icon = "Warn"
            .AddButton("btn1","返回").Attribute = ""
        End With
        e.WriteString(wb.Build)
        Return ""
    End If
    nms = new String() {"申请部门","收款人","开户银行","账号","项目名称","合同额","用途","项目经理","申请部门会计","申请部门领导","财务部领导","审计部领导","公司分管领导","总经理","财务部受理"}
    For Each nm In nms
        If e.PostValues.ContainsKey(nm) = False Then
            With wb.AddMsgPage("","msgpage","审批失败","请输入《 " & nm & " 》!")
                .icon = "Warn"
                .AddButton("btn1","返回").Attribute = ""
            End With
            e.WriteString(wb.Build)
            Return ""
        End If
    Next
    dr = DataTables(dtname).Find("[_Identify]=" & PrimaryKey)
    If dr IsNot Nothing Then
        If rw0 <> "受理" Then
            For Each dc In DataTables(dtname).DataCols
                If IsNumeric(dr(dc.name)) AndAlso dc.name<>"允许借款" Then
                'If IsNumeric(dr(dc.name)) Then
                    dr(dc.name) = cdbl(e.PostValues(dc.name))
                ElseIf dc.name<>"允许借款" Then
                    dr(dc.name) = e.PostValues(dc.name)
                End If
            Next
        Else
            dr("受理日期") = e.PostValues("受理日期")
        End If
        dr.Save()
        QQServer.Send(dr("申请部门") & "." & dr("申请人"),"-@|" & dtname & "|" & dr("_Identify") & "|已经" & rw0,True)
        If rw0 <> "受理" Then
            fqr=_username
            fqr1=department & "." &  _username
            If dr("借款金额")<=100000 Then
                nms = new String() {"项目经理","复核","申请部门会计","审核","申请部门领导","初批","财务部受理","受理"}
            ElseIf dr("借款金额")<=200000 Then
                nms = new String() {"项目经理","复核","申请部门会计","审核","申请部门领导","初批","财务部领导","再批","财务部受理","受理"}
            ElseIf dr("借款金额")<=500000 Then
                nms = new String() {"项目经理","复核","申请部门会计","审核","申请部门领导","初批","财务部领导","再批","审计部领导","备案","财务部受理","受理"}
            ElseIf dr("借款金额")<=1000000 Then
                nms = new String() {"项目经理","复核","申请部门会计","审核","申请部门领导","初批","财务部领导","再批","审计部领导","备案","公司分管领导","审批","财务部受理","受理"}
            Else
                nms = new String() {"项目经理","复核","申请部门会计","审核","申请部门领导","初批","财务部领导","再批","审计部领导","备案","公司分管领导","审批","总经理","批转","财务部受理","受理"}
            End If
            For i = 0 To nms.Length -4 Step 2
                If _username = dr(nms(i)) Then
                    jsr = nms(i+2)
                    jsr0 = dr(nms(i+2))
                    rw = "请" & nms(i+3) & "!"
                    rw0 = nms(i+3)
                    xxx = "+@" & dr("申请人") & "|" & dtname & "|" & dr("_Identify") & "|" & jsr0 & "|" & rw
                    Exit For
                End If
            Next
            dr = DataTables("人员管理").sqlFind("员工姓名='" & jsr0 & "'")
            QQServer.Send(dr("部门名称") & "." & jsr0,xxx,True)
            dr = DataTables("待批任务").AddNew
            dr("发送人") = fqr1
            dr("发送时间") = Date.now
            dr("发送信息") = xxx
            dr.save()
            With wb.AddMsgPage("","msgpage","审批完成","已通知 " & jsr & " -- " & jsr0 & " 进行" & rw0)
                .Icon="success"
                .AddButton("btn1","返回列表",PageURL)
                .AddButton("btn2","返回首页","首页.htm")
            End With
        Else
            wb.AppendHtml("<meta http-equiv='refresh' c>",True)'显示完成提示,3秒后自动返回原来的页面
            wb.AddToast("","t1", rw0 & "完成",0).Visible = True
        End If
    Else
        With wb.AddMsgPage("","msgpage","保存失败", "因为此申请已被删除!")
            .icon= "Warn"
            .AddButton("btn1","返回列表",PageURL)
        End With
    End If
End If
e.WriteString(wb.Build)

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/8/22 19:08:00 [只看该作者]

If IsNumeric(dr(dc.name)) AndAlso dc.name<>"允许借款" Then

 

改成

 

If dc. IsNumeric AndAlso dc.name<>"允许借款" Then


 回到顶部
帅哥哟,离线,有人找我吗?
shenyl0211
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:977 积分:6835 威望:0 精华:0 注册:2012/4/2 21:49:00
  发帖心情 Post By:2017/8/22 21:04:00 [只看该作者]

谢谢甜版

 回到顶部