| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 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('<option selected="selected" value="">请选择</option>');
- $.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) {
- $("<option value='" + n[obj.data.valueKey] + "'>" + n[obj.data.textKey] +
- "</option>").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;
- $("<option value=''>请选择</option>").appendTo(obj)
- $(content).each(function (i, n) {
- $( "<option value='" + n.F_UserCode + "'>" +
- n.F_UserName + "</option>" ).appendTo(obj);
- });
- obj.selectpicker({
- noneSelectedText: "请选择", //默认显示内容
- });
- obj.selectpicker("refresh");
- }
- }
- );
- }
|