Foxtable(狐表)用户栏目专家坐堂 → 动态列表唯一项目自动赋值


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

主题:动态列表唯一项目自动赋值

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


加好友 发短信
等级:一尾狐 帖子:410 积分:3084 威望:0 精华:0 注册:2018/11/23 10:41:00
动态列表唯一项目自动赋值  发帖心情 Post By:2019/10/15 8:16:00 [只看该作者]

老师您好,下面是药品订购的一段代码,怎么实现选了药品名称后,后面的生产厂家、规格如果是唯一的自动赋值,如果不唯一则进行手动选择。不知问题在哪?谢谢!
With .AddSelect("药品类别","药品类别","|" & DataTables("药品").SQLGetComboListString("药品类别"))
            .Attribute = """
        End With
        With .AddSelect("药品名称","药品名称","")
            .Attribute = """
        End With
        Dim dr As DataRow = DataTables("药品").SQLfind("药品名称 = '" & e.PostValues("药品名称") & "'")
        If dr IsNot Nothing Then
            With .AddInput("生产厂家","生产厂家","text")
                .Value = dr("生产厂家")
                .readonly = True
            End With
        Else
            With .AddSelect("生产厂家","生产厂家","")
                .Attribute = """
            End With
        End If
        Dim dr1 As DataRow = DataTables("药品").SQLfind("生产厂家 = '" & e.PostValues("生产厂家") & "'")
        If dr1 IsNot Nothing Then
            With .AddInput("规格","规格","text")
                .Value = dr1("规格")
                .readonly = True
            End With
        Else
            With .AddSelect("规格","规格","")
                .Attribute = "" '调用js函数
            End With
        End If
        .AddInput("药品代码","药品代码","text")
        .AddInput("价格","价格","number").Readonly = True
        With .AddInput("数量","数量","number")
            .Step = "1"
            .Attribute = ""
        End With
        .AddInput("金额","金额","number")


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


加好友 发短信
等级:超级版主 帖子:106680 积分:542589 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/10/15 9:13:00 [只看该作者]

Dim s1 as string = DataTables("药品").SQLGetComboListString("规格","生产厂家 = '" & e.PostValues("生产厂家") & "'")
if s1.contains("|") then
With .AddSelect("规格","规格","|" & s1)
                .Attribute = "" '调用js函数
            End With
else
            With .AddInput("规格","规格","text")
                .Value = s1
                .readonly = True
            End With
endif

 回到顶部