新乡民调(来自息县民调) - 主标

IVRgreeting.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title></title>
  6. <meta charset="utf-8" />
  7. <title>IVR欢迎词管理</title>
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <script src="../Script/Common/huayi.load.js"></script>
  10. <script src="../Script/Common/huayi.config.js"></script>
  11. <!--<link rel="stylesheet" href="../css/laydate/need/laydate.css" />-->
  12. <link href="../css/init.css" rel="stylesheet" />
  13. <!--<script src="../css/laydate/laydate.js"></script>-->
  14. <script src="../js/laydate/laydate.js"></script>
  15. <style>
  16. .questionTitle,
  17. .textarea-content {
  18. width: 75% !important;
  19. background-color: #FFF;
  20. background-image: none;
  21. border: 1px solid #e5e6e7 !important;
  22. border-radius: 1px;
  23. color: inherit;
  24. padding: 6px 12px;
  25. height: 34px;
  26. }
  27. .textarea-content {
  28. height: 140px !important;
  29. }
  30. .select_ {
  31. width: 150px;
  32. background-color: #FFF;
  33. background-image: none;
  34. border: 1px solid #ccc;
  35. border-radius: 1px;
  36. color: inherit;
  37. padding: 6px 12px;
  38. outline: none;
  39. vertical-align: middle;
  40. }
  41. .time-box {
  42. position: relative;
  43. display: inline-block;
  44. /*width: 327px;*/
  45. }
  46. i.tub {
  47. position: absolute;
  48. right: 13px;
  49. top: 8px;
  50. font-size: 18px;
  51. color: #00a0ca;
  52. }
  53. .time-box input {
  54. width: 270px;
  55. padding: initial;
  56. height: 31px;
  57. border: initial;
  58. /* color: #1ab394; */
  59. outline: none;
  60. vertical-align: initial;
  61. padding-left: 10px;
  62. /*width: 100%;*/
  63. }
  64. .xg {
  65. margin-right: 5px;
  66. }
  67. #keyGreetings{
  68. height: 33px;
  69. }
  70. </style>
  71. </head>
  72. <body class="gray-bg">
  73. <!--<div class="wrapper wrapper-content animated fadeInRight">-->
  74. <div class="container-fluid">
  75. <div class="daoHang clearfix">
  76. <div class="dhLeft">
  77. <sapn>
  78. <i class="syIcon"></i>位置:
  79. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  80. <a href="javaScript:;">系统管理</a>&gt;
  81. <a href="javaScript:;">系统设置</a>&gt;
  82. <a href="" class="nowPosition" style="color: #000;">IVR设置</a>
  83. </sapn>
  84. </div>
  85. <!--<div class="dhRight">
  86. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  87. </div>-->
  88. </div>
  89. <div class="Content_box">
  90. <div class="complain Shows">
  91. <div class="th-box">
  92. <div class="toolBar clearfix">
  93. <div class="toolRight">
  94. <div class="form-group" style="display: inline-block;position: relative;">
  95. <label for="greetingTimes"><b class="text_require">*</b>有效时间</label>
  96. <div class="time-box">
  97. <i class="tub fa fa-calendar"></i>
  98. <input class="form-control laydate-icon" type="text" id="greetingTimes">
  99. </div>
  100. </div>
  101. 状态: <select class="select_" id="greetingState">
  102. <option value="">全部</option>
  103. <option value="0">未启动</option>
  104. <option value="1">生效中</option>
  105. <option value="2">已失效</option>
  106. </select>
  107. <!--有效时间:-->
  108. <!--<input class="photo x-color inputs laydate-icon" type="text" id="startTime" /> 至
  109. <input class="photo x-color inputs laydate-icon" type="text" id="endTime" />-->
  110. 关键词:<input type="text" id="keyGreetings" class="photo x-color inputs" />
  111. <a class="btns" title="点击进行搜索" id="search">搜索</a>
  112. <a class="btns" title="点击添加欢迎词" id="addGreetings">添加</a>
  113. </div>
  114. </div>
  115. </div>
  116. <div style="width: 100%;padding: 10px;">
  117. <table id="table1" data-row-style="rowStyle" data-query-params="queryParams">
  118. <thead>
  119. <tr>
  120. <th data-checkbox="true" data-align="center"></th>
  121. <th data-align="center" data-formatter="setCode">编号</th>
  122. <th data-field="F_Title" data-align="center">欢迎词标题</th>
  123. <th data-field="F_Content" data-formatter="formatterContent" data-align="center">欢迎词内容</th>
  124. <th data-field="F_IsState" data-formatter="formatterSate" data-align="center">状态</th>
  125. <!--<th data-field="F_Type" data-formatter="formatterType" data-align="center">类型</th>
  126. <th data-field="F_WavPath" data-formatter="setAutio" data-align="center">语音</th>-->
  127. <th data-field="F_StartDate" data-align="center">生效时间</th>
  128. <th data-field="F_EndDate" data-align="center">失效时间</th>
  129. <th data-field="F_CreateTime" data-align="center">创建时间</th>
  130. <th data-field="F_CreateUser" data-align="center">创建用户</th>
  131. <th data-field="F_Remark" data-formatter="formatterContent" data-align="center">备注信息</th>
  132. <th data-align="center" data-formatter="Dispose">操作</th>
  133. </tr>
  134. </thead>
  135. </table>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. <script>
  141. $(document).ready(function() {
  142. laydate.render({
  143. elem: '#greetingTimes',
  144. range: '~',
  145. // type: 'datetime',
  146. //max : 31,
  147. // min: 0,
  148. theme: '#00a1cb',
  149. });
  150. initTable1();
  151. //搜索
  152. $('#search').click(function() {
  153. initTable1();
  154. })
  155. //回车搜索
  156. $('#keyGreetings').on('keypress',function(e){
  157. if(e.keyCode==13){
  158. initTable1();
  159. }
  160. })
  161. //添加
  162. $('#addGreetings').click(function() {
  163. layer.open({
  164. type: 2,
  165. content: "./template/addGreetings.html?addFlag=true",
  166. title: '添加欢迎词',
  167. area: ['80%', '90%'],
  168. });
  169. });
  170. });
  171. function initTable1() {
  172. //先销毁表格
  173. $('#table1').bootstrapTable('destroy');
  174. //初始化表格,动态从服务器加载数据
  175. $('#table1').bootstrapTable({
  176. method: "GET", //使用get请求到服务器获取数据
  177. url: huayi.config.callcenter_url + "IVRWords/GetList", //获取数据的Servlet地址
  178. contentType: "application/x-www-form-urlencoded",
  179. striped: true,
  180. striped: true, //表格显示条纹
  181. pagination: true, //启动分页
  182. pageSize: 10, //每页显示的记录数
  183. pageNumber: 1, //当前第几页
  184. pageList: [10, 20, 50, 100], //记录数可选列表
  185. search: false, //是否启用查询
  186. showColumns: false, //显示下拉框勾选要显示的列
  187. showRefresh: false, //显示刷新按钮
  188. sidePagination: "server", //表示服务端请求
  189. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  190. //设置为limit可以获取limit, offset, search, sort, order
  191. queryParamsType: "undefined",
  192. queryParams: function queryParams(params) { //设置查询参数
  193. var param = {
  194. page: params.pageNumber,
  195. pagesize: params.pageSize,
  196. state: $('#greetingState').val(),
  197. key: $('#keyGreetings').val().trim(),//关键字
  198. bytime: $('#greetingTimes').val() && $('#greetingTimes').val().split('~')[0],//开始时间
  199. eytime: $('#greetingTimes').val() && $('#greetingTimes').val().split('~')[1],//结束时间
  200. token: $.cookie("token"),
  201. };
  202. return param;
  203. },
  204. onLoadSuccess: function() { //加载成功时执行
  205. //layer.msg("加载成功");
  206. },
  207. onLoadError: function() { //加载失败时执行
  208. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  209. }
  210. });
  211. }
  212. //操作
  213. //state状态:0未启动,1生效中,2已失效
  214. function Dispose(val, row) {
  215. //未启动和生效中都可以修改
  216. // debugger;
  217. if(row.F_IsState === 0 || row.F_IsState === 1){
  218. return '<div class="imgs" >' +
  219. '<a class="xg" onclick=seeGreetings("' + row.F_ID + ',' + row.F_IsState +'")>查看</a>' +
  220. '<a class="xg" onclick="editGreetings(' + row.F_ID + ')">修改</a>' +
  221. '<a class="xg" onclick="delGreetings(' + row.F_ID + ')">删除 </a>' +
  222. '</div>';
  223. }else{
  224. return '<div class="imgs" >' +
  225. '<a class="xg" onclick=seeGreetings("' + row.F_ID + ',' + row.F_IsState +'")>查看</a>' +
  226. '<a class="xg" onclick="delGreetings(' + row.F_ID + ')">删除 </a>' +
  227. '</div>';
  228. }
  229. }
  230. //格式化状态
  231. function formatterSate(val){
  232. //state状态:0未启动,1生效中,2已失效
  233. if(val === 0){
  234. return '未启动';
  235. }else if(val === 1){
  236. return '生效中';
  237. }else if(val === 2){
  238. return '已失效';
  239. }
  240. }
  241. //格式化类型
  242. function formatterType(val){
  243. //state状态:0未启动,1生效中,2已失效
  244. if(val === 1){
  245. return '文本';
  246. }else if(val === 2){
  247. return '语音文件';
  248. }
  249. }
  250. //查看
  251. function seeGreetings(seeGreetingsPrams) {
  252. layer.open({
  253. type: 2,
  254. content: "./template/seeGreetings.html?seeGreetingsPrams=" + seeGreetingsPrams,
  255. title: '查看欢迎词详情',
  256. area: ['80%', '90%'],
  257. });
  258. }
  259. //修改
  260. function editGreetings(ids) {
  261. layer.open({
  262. type: 2,
  263. content: "./template/addGreetings.html?greetingId=" + ids,
  264. title: '修改欢迎词',
  265. area: ['80%', '90%'],
  266. });
  267. }
  268. //格式化内容
  269. function formatterContent(str) {
  270. if (str) {
  271. var con = helper.filter.Transcoding(str);
  272. return con = con.substr(0, 22) + "...";
  273. } else {
  274. return '-';
  275. }
  276. }
  277. //删除
  278. function delGreetings(str) {
  279. layer.confirm('确定删除当前记录?', {
  280. btn: ['是', '否'] //按钮
  281. }, function() {
  282. $.post(huayi.config.callcenter_url + "IVRWords/DelIVRWords", {
  283. ids: str,
  284. token: $.cookie("token")
  285. }, function(data) {
  286. data = JSON.parse(data);
  287. /*验证请求*/
  288. if(data.state == "success") {
  289. layer.msg("删除成功");
  290. //重新加载
  291. initTable1();
  292. }
  293. });
  294. });
  295. }
  296. //编号
  297. function setCode(val, row, index) {
  298. return index + 1;
  299. }
  300. //音频
  301. function setAutio(val) {
  302. if(val) {
  303. return '<div class="imgs" style="cursor: pointer;">' +
  304. '<img src="../img/vice.png" alt="" onclick= seeAudio(this) item="' + val + '" />' +
  305. '</div>';
  306. } else {
  307. return '';
  308. }
  309. }
  310. var audios = '<div class="audio_box" style="margin:15px 0;">' +
  311. '<audio style="width: 100%;"class="audioCon" src="" controls="controls" ></audio>'+
  312. '</div>';
  313. function seeAudio(a){
  314. var bjLay = layer.open({
  315. type: 1,
  316. title: '录音详情',
  317. skin: 'layui-layer-demo', //加上边框
  318. area: ['40%', '30%'], //宽高
  319. // btn: ['关闭'],
  320. // yes: function(index, layero) {
  321. // $.ajax({
  322. // type: "post",
  323. // url: huayi.config.callcenter_url + "CallPlan/CreateOrUpdateCategory",
  324. // async: true,
  325. // dataType: 'json',
  326. // data: {
  327. // token: $.cookie("token"),
  328. // id: id,
  329. // name: $('.lb_name').val(),
  330. // parentid: $('#tks').val()
  331. // },
  332. // success: function(data) {
  333. // if(data.state.toLowerCase() == "success") {
  334. // layer.msg(data.message)
  335. // layer.close(bjLay)
  336. // $('.lb_name').val('');
  337. // initTable();
  338. // }
  339. // }
  340. // });
  341. // },
  342. // btn2: function() {
  343. // layer.close(bjLay)
  344. // },
  345. content: audios
  346. });
  347. $('.audioCon').attr('src',$(a).attr('item'))
  348. }
  349. </script>
  350. </body>
  351. </html>