爱游戏

 
 注册成为天翎用户
热搜:
查看: 340|回复: 0

下拉框考虑历史数据脚本示例-爱游戏

[复制链接]
smart 发表于 2020-12-10 17:05:32 | |
  1. /**
  2. *        考虑历史数据:获取通用主数据类型返回options
  3. *        table:当前表名  docid:当前docid  valuename:当前字段名  type:通用主数据的类型
  4. */
  5. function getdatatype(table, docid, valuename, isnull) {
  6.     var opts = $tools.createoptions();
  7.     var sql1 = "select * from " table " where id='" docid "' ";
  8.     var data = findbysql(sql1);
  9.     var value1 = "";
  10.     if (data != null) {
  11.         value1 = data.getitemvalueasstring(valuename);
  12.     }
  13.     var sql = "select * from obpm_crm_new.tlk_客户状态 where item_status='有效' order by item_类别名称";
  14.     if (value1 != null && !"".equals(value1)) {
  15.         sql = "select * from obpm_crm_new.tlk_客户状态 where (item_status='有效') or (item_status='无效' and item_类别名称='" value1 "') order by item_类别名称";
  16.     }
  17.     if (isnull) {
  18.         opts.add("", "");
  19.     }
  20.     var query = querybysql(sql);
  21.     if (query != null && query.size() > 0) {
  22.         for (var it = query.iterator(); it.hasnext(); ) {
  23.             var doc = it.next();
  24.             var value = doc.getitemvalueasstring("类别名称");
  25.             var name = doc.getitemvalueasstring("类别名称");
  26.             opts.add(name, value);
  27.         }
  28.     }
  29.     return opts;
  30. };
复制代码
您需要登录后才可以回帖 登录 | 注册成为天翎用户

本版积分规则

||爱游戏 ( )

gmt 8, 2023-9-30 12:40

powered by x3.4

爱游戏 copyright © 2001-2020, tencent cloud.

返回列表
网站地图