/** * IVR编辑 * */ list(); function list() { $.ajax({ url: huayi.config.callcenter_url + '/callcenterapi/api/sysivrconfig/loadivrlist', data: {}, async: true, dataType: 'json', type: 'get', //HTTP请求类型 success: function(data) { if(data.state.toLowerCase() == "success") { var IVRlistData= data.data; // alert(IVRlistData.length); if (IVRlistData.length>0) { for ( var i=0; i'+IVRlistData[i]+ '').appendTo('.ivrlist'); } } } }, error: function(xhr, type, errorThrown) { //异常处理; } }) } Ajax(); //获取详情 function Ajax() { $.ajax({ url: huayi.config.callcenter_url + '/callcenterapi/api/sysivrconfig/loadivr', data: {}, async: true, dataType: 'json', type: 'get', //HTTP请求类型 success: function(data) { if(data.state.toLowerCase() == "success") { $("#IVRedit").val(data.data); } }, error: function(xhr, type, errorThrown) { //异常处理; } }) } //提交按钮 $(function() { $(".ivrlist").on("click", "li",function(){ var listText=$(this).text(); $.ajax({ url: huayi.config.callcenter_url + '/callcenterapi/api/sysivrconfig/loadivr', data: { ivrname:listText }, async: true, dataType: 'json', type: 'get', //HTTP请求类型 success: function(data) { if(data.state.toLowerCase() == "success") { $("#IVRedit").val(data.data); } }, error: function(xhr, type, errorThrown) { //异常处理; } }) }); $('#sc_btns').on('click', function() { // alert($('#IVRedit').val()); if($('#IVRedit').val() == '') { mui.alert('请输入编辑内容!') //请输入编辑内容 } else { $.ajax({ type: "post", dataType: 'json', url: huayi.config.callcenter_url + '/callcenterapi/api/SysIVRConfig/editivr', async: true, data: { ivrcontent: $('#IVRedit').val() }, success: function(data) { if(data.state == "success") { layer.msg("修改成功"); window.location.reload(); } else { mui.toast(data.message); } } }); } }) })