Нет описания

OutboundAllo.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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>
  150. <!--小table-->
  151. <table id="xtable" border="0" cellspacing="" cellpadding="" style="width: 100%;">
  152. <tr>
  153. <th>当前未分配:</th>
  154. <td>
  155. <input type="text" class="Num_input" id="Fp_total" readonly="readonly" disabled="disabled"/> 条
  156. </td>
  157. </tr>
  158. <tr>
  159. <th>分配坐席:</th>
  160. <td style="padding: 0;">
  161. <!--table2-->
  162. <div style="width: 100%;">
  163. <table id="zxTab" data-click-to-select="true" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
  164. <thead>
  165. <tr>
  166. <th data-checkbox="true" data-align="center"></th>
  167. <th data-field="UserCode" data-align="center">坐席工号</th>
  168. <th data-field="Deparment" data-align="center">营业部</th>
  169. <th data-field="UserName" data-align="center">坐席名称</th>
  170. <th data-field="WWCCount" data-align="center">未执行任务</th>
  171. </tr>
  172. </thead>
  173. <tbody id="tbody">
  174. </tbody>
  175. </table>
  176. </div>
  177. </td>
  178. </tr>
  179. <tr>
  180. <th>分配策略:</th>
  181. <td>
  182. <div>
  183. <label for="">按数量平均分配</label>
  184. <input type="text" class="Num_input Pjfp_input" />条
  185. </div>
  186. <div>
  187. (为选择的坐席分配录入数量的任务)
  188. </div>
  189. </td>
  190. </tr>
  191. <tr style="border-bottom: 1px dotted #cccccc;text-align: center;">
  192. <td>
  193. </td>
  194. <td style="text-align: center;">
  195. <input type="button" name="" id="Submit" value="执行分配" />
  196. </td>
  197. </tr>
  198. </table>
  199. </div>
  200. </td>
  201. </tr>
  202. </table>
  203. </div>
  204. <!--右边-->
  205. <div class="col-sm-8" style="float: right;">
  206. <div class="tools_box">
  207. <div>
  208. <span>&nbsp;号码:<input class=" inputs" type="text" id="KeyWords" placeholder="输入号码" style="font-weight: normal;" /></span>
  209. <span>&nbsp;营业部:<select name="" class="inputs" id="depat"></select></span>
  210. <!--<span>&nbsp;营业部:<input class=" inputs" type="text" id="depat" placeholder="输入营业部" style="font-weight: normal;" /></span>-->
  211. <button class="btns searchGo size-14"> <i class="fa fa-search size-14"></i>&nbsp;搜索</button>
  212. </div>
  213. </div>
  214. <div>
  215. <table id="GetWFPList" class="table table-hover table-striped" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true" style="width:100%">
  216. <thead>
  217. <tr>
  218. <th data-field="F_Phone" data-align="center">号码</th>
  219. <th data-field="Expandfield2" data-align="center">营业部</th>
  220. </tr>
  221. </thead>
  222. <tbody id="tbody">
  223. </tbody>
  224. </table>
  225. </div>
  226. </div>
  227. </div>
  228. <input type="hidden" id="zxNum" />
  229. </div>
  230. <script>
  231. var Arruser; //分配坐席
  232. var Fpvalue; //分配数量
  233. var yingyebu; //营业部
  234. var Counts;
  235. var token = $.cookie("token");
  236. $(document).ready(function() {
  237. GetDepart(); //营业部
  238. GetSeatList(); //坐席列表
  239. GetWFPList(); //右边分配
  240. //回车搜索
  241. $('.inputs').on('keypress',function(e){
  242. if(e.keyCode == 13){
  243. GetWFPList();
  244. }
  245. });
  246. $(".searchGo").click(function() {
  247. GetWFPList();
  248. })
  249. });
  250. //分配坐席
  251. function GetSeatList() {
  252. var $tableLeft1 = $('#zxTab');
  253. $tableLeft1.bootstrapTable('destroy');
  254. //初始化表格,动态从服务器加载数据
  255. $tableLeft1.bootstrapTable({
  256. method: "get", //使用get请求到服务器获取数据
  257. url: huayi.config.callcenter_url + "CallOutPlan/GetSeatList",
  258. striped: true, //表格显示条纹
  259. pagination: true, //启动分页
  260. pageSize: 5, //每页显示的记录数
  261. pageNumber: 1, //当前第几页
  262. pageList: [5, 10, 50, 100], //记录数可选列表
  263. contentType: 'application/x-www-form-urlencoded',
  264. search: false, //是否启用查询
  265. showColumns: false, //显示下拉框勾选要显示的列
  266. showRefresh: false, //显示刷新按钮
  267. sidePagination: "server", //表示服务端请求
  268. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  269. //设置为limit可以获取limit, offset, search, sort, order
  270. queryParamsType: "undefined",
  271. queryParams: function queryParams(params) { //设置查询参数
  272. var param = {
  273. pageindex: params.pageNumber,
  274. pagesize: params.pageSize,
  275. token: token
  276. };
  277. return param;
  278. },
  279. onLoadSuccess: function(data) { //加载成功时执行
  280. // layer.msg("加载成功");
  281. },
  282. onLoadError: function() { //加载失败时执行
  283. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  284. }
  285. });
  286. }
  287. //提交分配
  288. $("#Submit").click(function() {
  289. if(!$('.Pjfp_input').val()) {
  290. layer.confirm('请输入分配数量', {
  291. btn: ['确定'] //按钮
  292. });
  293. return;
  294. }
  295. Arruser = $.map($('#zxTab').bootstrapTable('getSelections'),
  296. function(row) {
  297. console.log(row.UserCod);
  298. return row.UserCode;
  299. });
  300. yingyebu = $.map($('#zxTab').bootstrapTable('getSelections'),
  301. function(row) {
  302. console.log(row.UserCod);
  303. return row.Deparment;
  304. });
  305. if(Arruser.length<1){
  306. layer.msg('请选择坐席');
  307. return
  308. }
  309. Fpvalue = $('.Pjfp_input').val();
  310. VisitFPSet(Fpvalue, Arruser,yingyebu);
  311. //刷新表格
  312. GetWFPList();
  313. GetSeatList();
  314. });
  315. ///未分配列表
  316. function GetWFPList() {
  317. var $tableLeft = $('#GetWFPList');
  318. $tableLeft.bootstrapTable('destroy');
  319. //初始化表格,动态从服务器加载数据
  320. $tableLeft.bootstrapTable({
  321. method: "get", //使用get请求到服务器获取数据
  322. url: huayi.config.callcenter_url + "CallOutPlan/GetTaskWPF",
  323. striped: true, //表格显示条纹
  324. pagination: true, //启动分页
  325. pageSize: 10, //每页显示的记录数
  326. pageNumber: 1, //当前第几页
  327. pageList: [10, 20, 50, 100], //记录数可选列表
  328. contentType: 'application/x-www-form-urlencoded',
  329. search: false, //是否启用查询
  330. showColumns: false, //显示下拉框勾选要显示的列
  331. showRefresh: false, //显示刷新按钮
  332. sidePagination: "server", //表示服务端请求
  333. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  334. //设置为limit可以获取limit, offset, search, sort, order
  335. queryParamsType: "undefined",
  336. queryParams: function queryParams(params) { //设置查询参数
  337. var param = {
  338. pageindex: params.pageNumber,
  339. pagesize: params.pageSize,
  340. key: $("#KeyWords").val().trim(),
  341. yingyebu: $("#depat").val(),
  342. token: token
  343. };
  344. return param;
  345. },
  346. onLoadSuccess: function(data) { //加载成功时执行
  347. Counts = data.total;
  348. if(Counts == 0) {
  349. $("#Fp_total").attr("readOnly", "true").addClass("readOnly");
  350. } else {
  351. $("#Fp_total").attr("readOnly", false).removeClass("readOnly");
  352. }
  353. $("#Fp_total").val(Counts);
  354. $('.Pjfp_input').val('');
  355. },
  356. onLoadError: function() { //加载失败时执行
  357. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  358. }
  359. });
  360. }
  361. //获取营业部
  362. function GetDepart() {
  363. $.ajax({
  364. type: "get",
  365. url: huayi.config.callcenter_url + "CallOutPlan/GetDepartList",
  366. dataType: 'json',
  367. data: {
  368. token: $.cookie("token")
  369. },
  370. async: true,
  371. success: function(data) {
  372. var Count = data.data;
  373. $("<option value=''>--全部--</option>").appendTo($("#depat"));
  374. for(var i = 0; i < Count.length; i++) {
  375. $("<option value='" + Count[i].F_DeptName + "'>" + Count[i].F_DeptName + "</option>").appendTo($("#depat"));
  376. }
  377. }
  378. });
  379. }
  380. //限制字符串长度
  381. function cutContent(val) {
  382. if(val) {
  383. var str = '<div '
  384. if(val.length > 5) {
  385. str = str + ' title="' + val + '" ';
  386. val = val.substr(0, 4) + "...";
  387. }
  388. return str + '>' + val + '</div>';
  389. } else {
  390. return '';
  391. }
  392. }
  393. //分配 请求
  394. function VisitFPSet(Fpvalue, Arruser) {
  395. $.ajax({
  396. type: "post",
  397. url: huayi.config.callcenter_url + "CallOutPlan/fpdata",
  398. dataType: 'json',
  399. data: {
  400. fpvalue: Fpvalue,
  401. arruser: Arruser,
  402. key:$('#KeyWords').val(),
  403. yingyebu:$("#depat").val(),
  404. token: token
  405. },
  406. async: true,
  407. success: function(data) {
  408. if(data.state == "success") {
  409. GetSeatList();
  410. GetWFPList();
  411. layer.msg("分配成功");
  412. } else {
  413. layer.msg("分配失败");
  414. }
  415. }
  416. });
  417. }
  418. </script>
  419. </body>
  420. </html>