Foxtable(狐表)用户栏目专家坐堂 → 扫码加查询


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

主题:扫码加查询

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


加好友 发短信
等级:婴狐 帖子:21 积分:238 威望:0 精华:0 注册:2023/6/24 15:18:00
扫码加查询  发帖心情 Post By:2024/9/20 11:25:00 [只看该作者]

怎么实现:扫码后在设备编号上输入扫码内容,根据扫码内容在“设备表”上查询相同的设备编号,将其设备名称输入到其输入框中;

With wb.AddInputGroup("form1", "ipg1", "设备维护")
        With .AddInputCell("ic1")
            .AddLabel("lbh", "设备编号", 0)
            .AddInput("number", "text", 1)
            .AddVcodeButton("scan", "扫码输入", 2) 
        End With
        With .AddInputCell("ic2")
            .AddLabel("lbh2", "设备名称", 0)
            .AddInput("设备名称", "text", 1)
        End With

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


加好友 发短信
等级:超级版主 帖子:109489 积分:557107 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/9/20 11:33:00 [只看该作者]

http://www.foxtable.com/mobilehelp/topics/0247.htmhttp://www.foxtable.com/mobilehelp/topics/0108.htm

2、在d:\web\lib目录下新建一个文本文件jssdk.js,内容为:

wx.ready(function () {
    document.getElementById('
scan').onclick = function () {
        wx.scanQRCode({
            needResult: 1,
            scanType: ['qrCode','barCode'],
            success: function (res) {
                document.getElementById('
number
').value = res.resultStr;
var result = sendAjaxText(res.resultStr,"查询.htm","",false);
document.getElementById("设备名称").value =result;
            }
        });
    };
});
wx.error(function (res) {
    //alert(res.errMsg);
});

后台代码
    Case "查询.htm"
        dim 编号 as string = e.PlainText
dim dr as datarow = datatables("表A").find("编号='" & 编号 & "'")
if dr isnot nothing
         e.WriteString(dr("名称"))
else
         e.WriteString("没有编号对应的名称")
end if
[此贴子已经被作者于2024/9/20 11:33:05编辑过]

 回到顶部