PingAnYeXianSZCG_Web 前端代码

VoiceMail.html 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>语音留言</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link href="../css/init.css" rel="stylesheet" />
  8. <script src="../Script/Common/huayi.load.js"></script>
  9. <script src="../Script/Common/huayi.config.js"></script>
  10. <link href="../css/Table/table1.css" rel="stylesheet" />
  11. <script src="../css/laydate/laydate.js"></script>
  12. <style>
  13. .LY:hover{
  14. color: #fff;
  15. }
  16. .LY:active{
  17. color: #fff!important;
  18. }
  19. </style>
  20. </head>
  21. <body class="gray-bg">
  22. <div class="wrapper wrapper-content animated fadeInRight">
  23. <div class="daoHang clearfix">
  24. <div class="dhLeft">
  25. <sapn><i class="syIcon"></i>位置:<a id="ReIndex">首页</a>&gt;<a href="javaScript:;">话务管理</a>&gt;<a href="" style="color: #000;">语音留言</a></sapn>
  26. </div>
  27. </div>
  28. <div class="th-box">
  29. <div class="th-bar">
  30. <a class="sc_btn deal max-right">处理</a>
  31. <a class="sc_btn remove">删除</a>
  32. <div class="seach-box fr">
  33. <ul>
  34. <li>电话号码:<input class="photo x-color" type="text" id="tel" /></li>
  35. <li>留言时间:<input class="photo x-color laydate-icon" type="text" id="lysj" /></li>
  36. <li>处理时间:<input class="laydate-icon photo x-color " type="text" id="clsj" /></li>
  37. <li>处理结果:
  38. <select name="" id="cljg" class="x-color select">
  39. <option value="-1">全部</option>
  40. <option value="0">未处理</option>
  41. <option value="1">已处理</option>
  42. <option value="2">注销</option>
  43. </select>
  44. </li>
  45. <li>
  46. <a class="sc_btn seach">搜索</a>
  47. </li>
  48. </ul>
  49. </div>
  50. </div>
  51. </div>
  52. <div style="width: 100%;padding: 10px;">
  53. <table id="list" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
  54. <thead>
  55. <tr>
  56. <th data-field="state" data-checkbox="true"></th>
  57. <th data-field="F_CallId" data-formatter="Code" data-align="center">编号</th>
  58. <th data-field="F_Phone" data-align="center">来电号码</th>
  59. <th data-field="F_RecFileUrl" data-align="center" data-formatter="setCode" data-align="center">留言</th>
  60. <th data-field="F_LeaveTime" data-align="center">留言时间</th>
  61. <th data-field="F_UserName" data-align="center">处理人</th>
  62. <th data-field="F_DealContent" data-align="center">处理结果</th>
  63. <th data-field="F_Status" data-align="center" data-formatter="clzt">处理状态</th>
  64. <th data-field="F_DealTime" data-align="center">处理时间</th>
  65. </tr>
  66. </thead>
  67. </table>
  68. </div>
  69. </div>
  70. <!--下载框-->
  71. <div class="t-shade">
  72. <div class="shade_k">
  73. <div class="shade_title">
  74. <span>录音播放与下载<srong class="cknum"></srong></span>
  75. <span class="setwin"><a>x</a></span>
  76. </div>
  77. <div class="shade_content">
  78. <div class="Ly_box audiojs">
  79. </div>
  80. <div class="boxCon LY_box">
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <script>
  86. $(document).ready(function () {
  87. /*日期选择*/
  88. laydate.skin('molv');
  89. //留言时间
  90. laydate({
  91. elem: '#lysj',
  92. event: 'focus',
  93. festival: true, //显示节日
  94. });
  95. //处理时间
  96. laydate({
  97. elem: '#clsj',
  98. festival: true, //显示节日
  99. event: 'focus'
  100. });
  101. /*查询*/
  102. $(".seach").click(function () {
  103. initTable();
  104. });
  105. $(".setwin").click(function () {
  106. $(".t-shade").removeClass("cx");
  107. $('audio')[0].pause();
  108. });
  109. /*删除内容*/
  110. $(".remove").click(function () {
  111. var ids = $.map($('#list').bootstrapTable('getSelections'),
  112. function (row) {
  113. return row.F_Id;
  114. });
  115. /*判断长度*/
  116. if (ids.length <= 0) {
  117. layer.confirm('没有可删除的选项?', {
  118. btn: ['确定'] //按钮
  119. });
  120. return;
  121. }
  122. remove();
  123. });
  124. /*处理内容*/
  125. $(".deal").click(function () {
  126. var ids = $.map($('#list').bootstrapTable('getSelections'),
  127. function (row) {
  128. return row.F_Id;
  129. });
  130. /*判断长度*/
  131. if (ids.length <= 0) {
  132. layer.confirm('没有可处理的选项?', {
  133. btn: ['确定'] //按钮
  134. });
  135. return;
  136. }
  137. deal();
  138. });
  139. initTable();
  140. })
  141. function initTable() {
  142. //先销毁表格
  143. $('#list').bootstrapTable('destroy');
  144. //初始化表格,动态从服务器加载数据
  145. $("#list").bootstrapTable({
  146. method: "get", //使用get请求到服务器获取数据
  147. url: huayi.config.callcenter_url + "Callleave/GetList", //获取数据的Servlet地址
  148. striped: true, //表格显示条纹
  149. pagination: true, //启动分页
  150. pageSize: 10, //每页显示的记录数
  151. pageNumber: 1, //当前第几页
  152. pageList: [10, 20, 50, 100], //记录数可选列表
  153. search: false, //是否启用查询
  154. showColumns: false, //显示下拉框勾选要显示的列
  155. showRefresh: false, //显示刷新按钮
  156. sidePagination: "server", //表示服务端请求
  157. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  158. //设置为limit可以获取limit, offset, search, sort, order
  159. queryParamsType: "undefined",
  160. queryParams: function queryParams(params) { //设置查询参数
  161. var param = {
  162. page: params.pageNumber,
  163. pagesize: params.pageSize,
  164. tel: $("#tel").val(),
  165. settime: $("#lysj").val(),
  166. removetime: $("#clsj").val(),
  167. status: $("#cljg").val(),
  168. token: $.cookie("token")
  169. };
  170. return param;
  171. },
  172. onLoadSuccess: function () { //加载成功时执行
  173. //layer.msg("加载成功");
  174. },
  175. onLoadError: function () { //加载失败时执行
  176. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  177. }
  178. });
  179. }
  180. function clzt(val) {
  181. var str = '';
  182. switch (val + '') {
  183. case '0': str = "未处理"; break;
  184. case '1': str = "已处理"; break;
  185. case '2': str = "注销"; break;
  186. }
  187. return str;
  188. }
  189. //音频
  190. function setCode(val) {
  191. if (val) {
  192. return '<div class="imgs">' +
  193. '<img src="../img/vice.png" alt="" onclick= ck(this) item="' + val+ '" />' +
  194. '</div>';
  195. }
  196. else {
  197. return '';
  198. }
  199. }
  200. //编号
  201. function Code(val,row,index){
  202. return index+1;
  203. }
  204. //录音
  205. function ck(val) {
  206. var path = $(val).attr("item");
  207. $(".t-shade").addClass("cx");
  208. $(".Ly_box").empty();
  209. $(".LY_box").empty();
  210. $('<audio style="width:100%;"class=" " src="' + path + '" loop="loop" controls="controls"></audio>').appendTo(".Ly_box");
  211. $('<a href="'+ path +'" class="sc_btn LY "download="'+ path +'">下载录音</a>').appendTo(".LY_box");
  212. }
  213. /*删除提示*/
  214. function remove() {
  215. layer.confirm('确定删除当前记录?', {
  216. btn: ['是', '否'] //按钮
  217. }, function () {
  218. /*执行删除*/
  219. var ids = $.map($('#list').bootstrapTable('getSelections'),
  220. function (row) {
  221. return row.F_Id;
  222. });
  223. /*发送请求*/
  224. $.post(huayi.config.callcenter_url + "Callleave/DelLeaveRecord", { ids: ids, token: $.cookie("token") }, function (result) {
  225. result = JSON.parse(result);
  226. if (result.state.toLowerCase() == "success") {
  227. layer.msg("删除成功");
  228. initTable();
  229. }
  230. })
  231. });
  232. }
  233. /*处理提示*/
  234. function deal() {
  235. layer.confirm('确定处理当前记录?', {
  236. btn: ['是', '否'] //按钮
  237. }, function () {
  238. /*执行删除*/
  239. var ids = $.map($('#list').bootstrapTable('getSelections'),
  240. function (row) {
  241. return row.F_Id;
  242. });
  243. /*发送请求*/
  244. $.post(huayi.config.callcenter_url + "Callleave/OptLeaveRecord", { ids: ids, token: $.cookie("token") }, function (result) {
  245. result = JSON.parse(result);
  246. if (result.state.toLowerCase() == "success") {
  247. layer.msg("处理成功");
  248. initTable();
  249. }
  250. })
  251. });
  252. }
  253. </script>
  254. </body>
  255. </html>