function getDicObjFn(obj) { return { ele:obj.ele, apiUrl: "Dictionary/GetDicValueListById", params: { id: obj.id }, data: { textKey: 'F_Value', valueKey: 'F_ValueId' }, getValue:obj.getValue?obj.getValue:'', getText:obj.getText?obj.getText:'' } } function selectMultiple(obj) { var maindeptId = ""; var maindeptId_ = obj.val(); //坐席 if(maindeptId_ != null) { $(maindeptId_).each(function(i, n) { var obj2 = ''; obj2 = n + ","; maindeptId += obj2; }) maindeptId = maindeptId.substring(0, maindeptId.length) } else { maindeptId = "" } return maindeptId } //区域 function selectCommonFn(obj) { var dataParam = { token: $.cookie("token") } if (obj.params) { var resultParam = Object.assign(dataParam, obj.params) } $(obj.ele).empty(); $(obj.ele).append(''); $.ajax({ type: "get", url: huayi.config.callcenter_url + obj.apiUrl, dataType: "json", async: true, data: resultParam, success: function(data) { if(data.state.toLowerCase() == "success") { var content = data.data; $(content).each(function(i, n) { $("").appendTo($(obj.ele)); }) if (obj.getValue) { $(obj.ele +" option:selected").val(obj.getValue); $(obj.ele +" option:selected").text(obj.getText); } } } }); } //人员下拉 function personSelect(obj,rolecode,apiUrl) { obj.empty(); $.getJSON( huayi.config.callcenter_url + apiUrl, { rolecode: rolecode, token: $.cookie("token"), }, function (data) { if (data.state.toLowerCase() == "success") { var content = data.data; $("").appendTo(obj) $(content).each(function (i, n) { $( "" ).appendTo(obj); }); obj.selectpicker({ noneSelectedText: "请选择", //默认显示内容 }); obj.selectpicker("refresh"); } } ); }