説明なし

selectCommon.js 960B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. function selectMultiple(obj) {
  2. var maindeptId = "";
  3. var maindeptId_ = obj.val(); //坐席
  4. if(maindeptId_ != null) {
  5. $(maindeptId_).each(function(i, n) {
  6. var obj2 = '';
  7. obj2 = n + ",";
  8. maindeptId += obj2;
  9. })
  10. maindeptId = maindeptId.substring(0, maindeptId.length - 1)
  11. } else {
  12. maindeptId = ""
  13. }
  14. return maindeptId
  15. }
  16. function selectCommon(obj){
  17. params = Object.assign(obj.params,{
  18. token: $.cookie("token"),
  19. })
  20. $.getJSON(
  21. huayi.config.callcenter_url + obj.apiUrl,params ,
  22. function(data) {
  23. console.log(data.rows)
  24. if(data.rows.length>0) {
  25. var content = data.rows;
  26. $(content).each(function(i, n) {
  27. $(
  28. "<option value='" +
  29. n[obj.selectValue] +
  30. "'>" +
  31. n[obj.selectName] +
  32. "</option>"
  33. ).appendTo($("#"+obj.id));
  34. });
  35. $("#"+obj.id).selectpicker({
  36. noneSelectedText: "请选择业务员", //默认显示内容
  37. });
  38. $("#"+obj.id).selectpicker("refresh");
  39. }
  40. }
  41. );
  42. }