PingAnYeXianSZCG_Web 前端代码

OutboundAllo.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <link href="../css/initialize.css" rel="stylesheet" />
  7. <link href="../css/Table/table1.css" rel="stylesheet" />
  8. <script src="../js/jquery.min.js?v=2.1.4"></script>
  9. <script src="../js/plugins/layer/layer.min.js"></script>
  10. <script src="../Script/Common/huayi.load.js"></script>
  11. <script src="../Script/Common/huayi.config.js"></script>
  12. <title>外呼计划分配</title>
  13. <style>
  14. body {
  15. font-size: 14px;
  16. }
  17. .tools_box {
  18. padding: 10px;
  19. border: 1px solid #EDECFF;
  20. }
  21. .tools_box div {
  22. padding-left: 1px;
  23. font-weight: bold;
  24. }
  25. .red {
  26. color: #E43926;
  27. }
  28. .tools_box span {
  29. margin-left: 10px;
  30. }
  31. .tools_box li {
  32. margin-right: 10px;
  33. }
  34. #xtable th {
  35. /*width: 100px;
  36. padding: 5px 8px 5px 10px;*/
  37. color: #333;
  38. font-weight: 700;
  39. text-align: right;
  40. background: #f9f9f9;
  41. border-right: 1px dotted #cccccc;
  42. border-top: 1px dotted #cccccc;
  43. border-left: 1px dotted #cccccc;
  44. width: 100px;
  45. }
  46. #xtable td {
  47. padding: 6px 0 5px 10px;
  48. /*text-align: left;*/
  49. color: #717171;
  50. line-height: 200%;
  51. border-right: 1px dotted #cccccc;
  52. border-top: 1px dotted #cccccc;
  53. border-left: 1px dotted #cccccc;
  54. }
  55. .Num_input {
  56. width: 50px;
  57. padding: 5px;
  58. border-color: #CCCCCC;
  59. }
  60. .clearfix:after {
  61. content: "";
  62. display: block;
  63. clear: both;
  64. }
  65. #Submit {
  66. padding: 0 10px;
  67. height: 28px;
  68. line-height: 28px;
  69. background: #1ab394;
  70. font-weight: bold;
  71. color: #fff;
  72. border-radius: 3px;
  73. border: 1px solid #AED0EA;
  74. }
  75. .outline {
  76. border: 1px solid #21b9bb !important;
  77. }
  78. .whjh {
  79. position: absolute;
  80. top: 43px;
  81. z-index: 600;
  82. }
  83. .fixed-table-pagination {
  84. background: #F9F9F9;
  85. }
  86. #table1 thead {
  87. background: #f9f9f9;
  88. }
  89. #tbodys tr {
  90. background: #f9f9f9;
  91. }
  92. .hidens {
  93. display: none;
  94. }
  95. #GetWFPList td {
  96. padding: 8px;
  97. }
  98. .readOnly {
  99. background: #CCCCCC;
  100. color: red;
  101. }
  102. .daoHang {
  103. padding: 15px;
  104. }
  105. .daoHang .dhLeft a {
  106. font-size: 14px;
  107. color: #999;
  108. }
  109. .btns {
  110. background: #1ab394;
  111. color: #fff;
  112. padding: 6px 10px;
  113. outline: none;
  114. font-size: 12px;
  115. margin-left: 15px;
  116. border: 0;
  117. border-radius: 3px;
  118. box-sizing: border-box;
  119. }
  120. .inputs {
  121. border: 1px solid #e5e6e7;
  122. width: 150px;
  123. padding: 6px 12px;
  124. }
  125. .fixed-table-pagination{
  126. text-align: center;
  127. }
  128. </style>
  129. </head>
  130. <body>
  131. <div class="wrapper wrapper-content animated fadeInRight">
  132. <div class="daoHang clearfix">
  133. <div class="dhLeft">
  134. <sapn><i class="syIcon"></i>位置:
  135. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  136. <a href="javaScript:;">外呼管理</a>&gt;
  137. <a href="" style="color: #000;">外呼分配</a>
  138. </sapn>
  139. </div>
  140. </div>
  141. <!--整体table-->
  142. <div class="row">
  143. <div class="col-sm-4">
  144. <table border="0" cellspacing="3" cellpadding="3" class="clearfix" style="width: 100%;">
  145. <tr>
  146. <!--左边-->
  147. <td style="padding: 0px 2px 5px 2px; float: left; ">
  148. <!--头部-->
  149. <div class="tools_box">
  150. <div>
  151. <span class="color">外呼分配</span>
  152. </div>
  153. </div>
  154. <div>
  155. <!--小table-->
  156. <table id="xtable" border="0" cellspacing="" cellpadding="" style="width: 100%;">
  157. <tr>
  158. <th>当前未分配:</th>
  159. <td>
  160. <input type="text" class="Num_input" id="Fp_total" readonly="readonly" /> 条
  161. </td>
  162. </tr>
  163. <tr>
  164. <th>分配坐席:</th>
  165. <td style="padding: 0;">
  166. <!--table2-->
  167. <div style="width: 100%;">
  168. <table id="zxTab" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
  169. <thead>
  170. <tr>
  171. <th data-checkbox="true" data-align="center"></th>
  172. <th data-field="UserCode" data-align="center">坐席工号</th>
  173. <th data-field="UserName" data-align="center">坐席名称</th>
  174. <th data-field="WWCCount" data-align="center">未执行任务</th>
  175. </tr>
  176. </thead>
  177. <tbody id="tbody">
  178. </tbody>
  179. </table>
  180. </div>
  181. </td>
  182. </tr>
  183. <tr>
  184. <th>分配策略:</th>
  185. <td>
  186. <div>
  187. <label for="">按数量平均分配</label>
  188. <input type="text" class="Num_input Pjfp_input" />条
  189. </div>
  190. <div>
  191. (为选择的坐席分配录入数量的任务)
  192. </div>
  193. </td>
  194. </tr>
  195. <tr style="border-bottom: 1px dotted #cccccc;text-align: center;">
  196. <td>
  197. </td>
  198. <td style="text-align: center;">
  199. <input type="button" name="" id="Submit" value="执行分配" />
  200. </td>
  201. </tr>
  202. </table>
  203. </div>
  204. </td>
  205. </tr>
  206. </table>
  207. </div>
  208. <!--右边-->
  209. <div class="col-sm-8" style="float: right;">
  210. <div class="tools_box">
  211. <div>
  212. <span>外呼号码</span>
  213. <span>&nbsp;关键字:<input class=" inputs" type="text" id="KeyWords" /></span>
  214. <button class="btns searchGo size-14"> <i class="fa fa-search size-14"></i>&nbsp;搜索</button>
  215. </div>
  216. </div>
  217. <div>
  218. <table id="GetWFPList" class="table table-hover table-striped" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true" style="width:100%">
  219. <thead>
  220. <tr>
  221. <th data-checkbox="true" data-align="center"></th>
  222. <th data-field="F_Phone" data-align="center">号码</th>
  223. <th data-field="F_CusName" data-align="center">名称</th>
  224. </tr>
  225. </thead>
  226. <tbody id="tbody">
  227. </tbody>
  228. </table>
  229. </div>
  230. </div>
  231. </div>
  232. <input type="hidden" id="zxNum" />
  233. </div>
  234. <script>
  235. var Arruser; //分配坐席
  236. var Fpvalue; //分配数量
  237. var Counts;
  238. var token = $.cookie("token");
  239. $(document).ready(function() {
  240. GetSeatList(); //坐席列表
  241. GetWFPList(); //右边分配
  242. $(".searchGo").click(function() {
  243. GetWFPList();
  244. })
  245. });
  246. //分配坐席
  247. function GetSeatList() {
  248. var $tableLeft1 = $('#zxTab');
  249. $tableLeft1.bootstrapTable('destroy');
  250. //初始化表格,动态从服务器加载数据
  251. $tableLeft1.bootstrapTable({
  252. method: "get", //使用get请求到服务器获取数据
  253. url: huayi.config.callcenter_url + "CallOutPlan/GetSeatList",
  254. striped: true, //表格显示条纹
  255. pagination: true, //启动分页
  256. pageSize: 5, //每页显示的记录数
  257. pageNumber: 1, //当前第几页
  258. pageList: [5, 20, 50, 100], //记录数可选列表
  259. search: false, //是否启用查询
  260. showColumns: false, //显示下拉框勾选要显示的列
  261. showRefresh: false, //显示刷新按钮
  262. sidePagination: "server", //表示服务端请求
  263. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  264. //设置为limit可以获取limit, offset, search, sort, order
  265. queryParamsType: "undefined",
  266. queryParams: function queryParams(params) { //设置查询参数
  267. var param = {
  268. pageindex: params.pageNumber,
  269. pagesize: params.pageSize,
  270. token:token
  271. };
  272. return param;
  273. },
  274. onLoadSuccess: function(data) { //加载成功时执行
  275. // layer.msg("加载成功");
  276. },
  277. onLoadError: function() { //加载失败时执行
  278. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  279. }
  280. });
  281. }
  282. //提交分配
  283. $("#Submit").click(function() {
  284. if(!$('.Pjfp_input').val()) {
  285. layer.confirm('请输入分配数量', {
  286. btn: ['确定'] //按钮
  287. });
  288. return;
  289. }
  290. Arruser = $.map($('#zxTab').bootstrapTable('getSelections'),
  291. function(row) {
  292. console.log(row.UserCod);
  293. return row.UserCode;
  294. });
  295. Fpvalue = $('.Pjfp_input').val();
  296. VisitFPSet(Fpvalue, Arruser);
  297. //刷新表格
  298. GetWFPList();
  299. GetSeatList();
  300. });
  301. ///未分配列表
  302. function GetWFPList() {
  303. var $tableLeft = $('#GetWFPList');
  304. $tableLeft.bootstrapTable('destroy');
  305. //初始化表格,动态从服务器加载数据
  306. $tableLeft.bootstrapTable({
  307. method: "get", //使用get请求到服务器获取数据
  308. url: huayi.config.callcenter_url + "CallOutPlan/GetTaskWPF",
  309. striped: true, //表格显示条纹
  310. pagination: true, //启动分页
  311. pageSize: 10, //每页显示的记录数
  312. pageNumber: 1, //当前第几页
  313. pageList: [5, 20, 50, 100], //记录数可选列表
  314. search: false, //是否启用查询
  315. showColumns: false, //显示下拉框勾选要显示的列
  316. showRefresh: false, //显示刷新按钮
  317. sidePagination: "server", //表示服务端请求
  318. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  319. //设置为limit可以获取limit, offset, search, sort, order
  320. queryParamsType: "undefined",
  321. queryParams: function queryParams(params) { //设置查询参数
  322. var param = {
  323. pageindex: params.pageNumber,
  324. pagesize: params.pageSize,
  325. key: $("#KeyWords").val(),
  326. token: token
  327. };
  328. return param;
  329. },
  330. onLoadSuccess: function(data) { //加载成功时执行
  331. Counts = data.total;
  332. if(Counts == 0) {
  333. $("#Fp_total").attr("readOnly", "true").addClass("readOnly");
  334. } else {
  335. $("#Fp_total").attr("readOnly", false).removeClass("readOnly");
  336. }
  337. $("#Fp_total").val(Counts);
  338. $('.Pjfp_input').val('');
  339. },
  340. onLoadError: function() { //加载失败时执行
  341. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  342. }
  343. });
  344. }
  345. //限制字符串长度
  346. function cutContent(val) {
  347. if(val) {
  348. var str = '<div '
  349. if(val.length > 5) {
  350. str = str + ' title="' + val + '" ';
  351. val = val.substr(0, 4) + "...";
  352. }
  353. return str + '>' + val + '</div>';
  354. } else {
  355. return '';
  356. }
  357. }
  358. //分配 请求
  359. function VisitFPSet(Fpvalue, Arruser) {
  360. $.ajax({
  361. type: "post",
  362. url: huayi.config.callcenter_url + "CallOutPlan/fpdata",
  363. dataType: 'json',
  364. data: {
  365. fpvalue: Fpvalue,
  366. arruser: Arruser,
  367. token: token
  368. },
  369. async: true,
  370. success: function(data) {
  371. if(data.state == "success") {
  372. GetSeatList();
  373. GetWFPList();
  374. layer.msg("分配成功");
  375. } else {
  376. layer.msg("分配失败");
  377. }
  378. }
  379. });
  380. }
  381. </script>
  382. </body>
  383. </html>