PingAnYeXianSZCG_Web 前端代码

OutboundAllo.html 11KB

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