思念食品 UI

IVRgreeting.html 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>IVR欢迎词管理</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <script src="../Script/Common/huayi.load.js"></script>
  8. <script src="../Script/Common/huayi.config.js"></script>
  9. <link href="../css/init.css" rel="stylesheet" />
  10. <script src="../css/laydate/laydate.js"></script>
  11. <style>
  12. .questionTitle,
  13. .textarea-content {
  14. width: 75%!important;
  15. background-color: #FFF;
  16. background-image: none;
  17. border: 1px solid #e5e6e7 !important;
  18. border-radius: 1px;
  19. color: inherit;
  20. padding: 6px 12px;
  21. height: 34px;
  22. }
  23. .textarea-content {
  24. height: 140px!important;
  25. }
  26. #greetingState{
  27. padding-right: 10px;
  28. width: 90px;
  29. height: 25px;
  30. }
  31. .xg{
  32. padding-left: 10px;
  33. }
  34. </style>
  35. </head>
  36. <body class="gray-bg">
  37. <div class="wrapper wrapper-content animated fadeInRight">
  38. <div class="daoHang clearfix">
  39. <div class="dhLeft">
  40. <sapn>
  41. <i class="syIcon"></i>位置:
  42. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  43. <a href="javaScript:;">话务管理</a>&gt;
  44. <a href="" class="nowPosition">IVR欢迎词管理</a>
  45. </sapn>
  46. </div>
  47. <div class="dhRight">
  48. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  49. </div>
  50. </div>
  51. <div class="Content_box">
  52. <div class="complain Shows">
  53. <div class="th-box">
  54. <div class="toolBar clearfix">
  55. <div class="toolLeft" style="padding-top: 10px;padding-left: 10px;">
  56. 启用状态:<span class="enabled_state">测试</span>
  57. </div>
  58. <div class="toolRight">
  59. <!--关键词:<input type="text" id="keyGreetings" class="photo x-color inputs" />-->
  60. 状态: <select class="select_" id="greetingState">
  61. <option value="">全部</option>
  62. <option value="0">未启动</option>
  63. <option value="1">启动</option>
  64. <!--<option value="2">已失效</option>-->
  65. </select>
  66. 有效时间:
  67. <input class="photo x-color inputs laydate-icon" type="text" id="startTime" /> 至
  68. <input class="photo x-color inputs laydate-icon" type="text" id="endTime" />
  69. <a class="btns" title="点击进行搜索" id="search">搜索</a>
  70. <a class="btns" title="点击添加欢迎词" id="addGreetings">添加</a>
  71. </div>
  72. </div>
  73. </div>
  74. <div style="width: 100%;padding: 10px;">
  75. <table id="table1" data-row-style="rowStyle" data-query-params="queryParams">
  76. <thead>
  77. <tr>
  78. <th data-checkbox="true" data-align="center"></th>
  79. <th data-align="center" data-formatter="setCode">编号</th>
  80. <th data-field="Title" data-align="center">欢迎词标题</th>
  81. <th data-field="Content" data-formatter="formatterContent" data-align="center" title="Content">欢迎词内容</th>
  82. <th data-field="IsState" data-formatter="formatterSate" data-align="center">状态</th>
  83. <!--<th data-field="StartDate" data-align="center">生效时间</th>
  84. <th data-field="EndDate" data-align="center">失效时间</th>-->
  85. <th data-field="GroupCode" data-align="center">坐席组编号</th>
  86. <!--<th data-field="Type" data-formatter="type_of" data-align="center">类型</th>-->
  87. <!--<th data-field="F_CreateUser" data-align="center">创建用户</th>-->
  88. <th data-field="Remark" data-formatter="formatterContent" data-align="center">备注</th>
  89. <th data-align="center" data-formatter="Dispose">操作</th>
  90. </tr>
  91. </thead>
  92. </table>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. <script>
  98. $(document).ready(function() {
  99. state_enabled();
  100. laydate.skin('blue');
  101. laydate({
  102. elem: '#startTime',
  103. event: 'focus'
  104. });
  105. laydate({
  106. elem: '#endTime',
  107. event: 'focus'
  108. });
  109. initTable1();
  110. //搜索
  111. $('#search').click(function() {
  112. initTable1();
  113. })
  114. //添加
  115. $('#addGreetings').click(function() {
  116. layer.open({
  117. type: 2,
  118. content: "../CommonHtml/addGreetings.html?addFlag=true",
  119. title: '添加欢迎词',
  120. area: ['80%', '90%'],
  121. });
  122. });
  123. });
  124. //启用状态展示
  125. function state_enabled(){
  126. $.ajax({
  127. type:"get",
  128. url:huayi.config.callcenter_url +"IVRWords/GetIVRWordsState",
  129. async:true,
  130. data:{
  131. token:$.cookie("token"),
  132. },
  133. success:function(result){
  134. if(JSON.parse(result).data==false){
  135. $('.enabled_state').text('未启用')
  136. }else{
  137. $('.enabled_state').text('已启用')
  138. }
  139. }
  140. });
  141. }
  142. function initTable1() {
  143. //先销毁表格
  144. $('#table1').bootstrapTable('destroy');
  145. //初始化表格,动态从服务器加载数据
  146. $('#table1').bootstrapTable({
  147. method: "GET", //使用get请求到服务器获取数据
  148. url: huayi.config.callcenter_url + "IVRWords/GetList", //获取数据的Servlet地址
  149. contentType: "application/x-www-form-urlencoded",
  150. striped: true,
  151. striped: true, //表格显示条纹
  152. pagination: true, //启动分页
  153. pageSize: 10, //每页显示的记录数
  154. pageNumber: 1, //当前第几页
  155. pageList: [10, 20, 50, 100], //记录数可选列表
  156. search: false, //是否启用查询
  157. showColumns: false, //显示下拉框勾选要显示的列
  158. showRefresh: false, //显示刷新按钮
  159. sidePagination: "server", //表示服务端请求
  160. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  161. //设置为limit可以获取limit, offset, search, sort, order
  162. queryParamsType: "undefined",
  163. queryParams: function queryParams(params) { //设置查询参数
  164. var param = {
  165. pageindex: params.pageNumber,
  166. pagesize: params.pageSize,
  167. isstate: $('#greetingState').val(),
  168. // key: $('#keyGreetings').val(),//关键字
  169. starttime: $('#startTime').val(),//开始时间
  170. endtime: $('#endTime').val(),//结束时间
  171. token: $.cookie("token"),
  172. };
  173. return param;
  174. },
  175. onLoadSuccess: function() { //加载成功时执行
  176. //layer.msg("加载成功");
  177. },
  178. onLoadError: function() { //加载失败时执行
  179. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  180. }
  181. });
  182. }
  183. //操作
  184. //state状态:0未启动,1生效中,2已失效
  185. function Dispose(val, row) {
  186. if(row.FID ){
  187. return '<div class="imgs" >' +
  188. '<a class="xg" onclick=seeGreetings("' + row.FID + ',' + row.IsState +'")>查看</a>' +
  189. '<a class="xg" onclick="editGreetings(' + row.FID + ')">修改</a>' +
  190. '<a class="xg" onclick="delGreetings(' + row.FID + ')">删除 </a>' +
  191. '</div>';
  192. }
  193. //未启动和生效中都可以修改
  194. // if(row.F_IsState === 0 || row.F_IsState === 1){
  195. // return '<div class="imgs" >' +
  196. // '<a class="xg" onclick=seeGreetings("' + row.F_ID + ',' + row.F_IsState +'")>查看</a>' +
  197. // '<a class="xg" onclick="editGreetings(' + row.F_ID + ')">修改</a>' +
  198. // '<a class="xg" onclick="delGreetings(' + row.F_ID + ')">删除 </a>' +
  199. // '</div>';
  200. // }else{
  201. // return '<div class="imgs" >' +
  202. // '<a class="xg" onclick=seeGreetings("' + row.F_ID + ',' + row.F_IsState +'")>查看</a>' +
  203. // '<a class="xg" onclick="delGreetings(' + row.F_ID + ')">删除 </a>' +
  204. // '</div>';
  205. // }
  206. }
  207. //格式化状态
  208. function formatterSate(val){
  209. //state状态:0未启动,1生效中,2已失效
  210. if(val === 0){
  211. return '未启动';
  212. }else if(val === 1){
  213. return '启动';
  214. }
  215. }
  216. //格式化类型
  217. function type_of(val){
  218. //state状态:0未启动,1生效中,2已失效
  219. if(val === 1){
  220. return '文本';
  221. }else if(val === 2){
  222. return '语音文件';
  223. }
  224. }
  225. //查看
  226. function seeGreetings(seeGreetingsPrams) {
  227. layer.open({
  228. type: 2,
  229. content: "../CommonHtml/seeGreetings.html?seeGreetingsPrams=" + seeGreetingsPrams,
  230. title: '查看欢迎词',
  231. area: ['80%', '90%'],
  232. });
  233. }
  234. //修改
  235. function editGreetings(ids) {
  236. layer.open({
  237. type: 2,
  238. content: "../CommonHtml/addGreetings.html?greetingId=" + ids,
  239. title: '修改欢迎词',
  240. area: ['80%', '90%'],
  241. });
  242. }
  243. //格式化内容
  244. function formatterContent(val) {
  245. if(val) {
  246. var str = '<div'
  247. str = str + ' title="' + val + '" ';
  248. if(val.length > 22){
  249. str =str + '>' + val.substring(0, 22) + '...</div>';
  250. }
  251. else{
  252. str = str + '>' + val + '</div>';
  253. }
  254. return str
  255. }
  256. // if (str) {
  257. // var con = helper.filter.Transcoding(str);
  258. // return con = con.substr(0, 22) + "...";
  259. // } else {
  260. // return '-';
  261. // }
  262. }
  263. //删除
  264. function delGreetings(str) {
  265. layer.confirm('确定删除当前记录?', {
  266. btn: ['是', '否'] //按钮
  267. }, function() {
  268. $.post(huayi.config.callcenter_url + "IVRWords/Delele", {
  269. ids: str,
  270. token: $.cookie("token")
  271. }, function(data) {
  272. data = JSON.parse(data);
  273. /*验证请求*/
  274. if(data.state == "success") {
  275. layer.msg("删除成功");
  276. //重新加载
  277. initTable1();
  278. state_enabled();
  279. }
  280. });
  281. });
  282. }
  283. //编号
  284. function setCode(val, row, index) {
  285. return index + 1;
  286. }
  287. </script>
  288. </body>
  289. </html>