| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- 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 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);
- }
- }
- }
- });
- }
|