| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- /**
- * 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.length; i++) {
- $('<li>'+IVRlistData[i]+
- '</li>').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);
- }
- }
- });
- }
- })
- })
|