商丘12345 前端

addTongZhi.html 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.http.js"></script>
  7. <script src="../Script/Common/huayi.config.js"></script>
  8. <link rel="stylesheet" href="../css/init.css" />
  9. <title>添加新通知</title>
  10. <style>
  11. .bj-title {
  12. color: #ffffff;
  13. background-color: #00a1cb;
  14. padding: 8px 35px 8px 14px;
  15. text-shadow: 0 1px 0 rgba(179, 142, 142, 0.5);
  16. border: 1px solid #e5e5e5;
  17. }
  18. .bjCon table th {
  19. padding: 5px 8px 5px 0;
  20. text-align: right;
  21. width: 30%;
  22. }
  23. .bjCon table td {
  24. padding: 6px 0 5px 10px;
  25. text-align: left;
  26. color: #717171;
  27. line-height: 200%;
  28. position: relative;
  29. }
  30. .bjCon table td input[type=text] {
  31. border: 1px solid #e5e5e5;
  32. width: 240px;
  33. outline: 0;
  34. margin-right: 5px;
  35. padding-left: 10px;
  36. }
  37. .bjCon table td textarea {
  38. border: 1px solid #e5e5e5;
  39. resize: none;
  40. width: 80%;
  41. vertical-align: middle;
  42. outline: none;
  43. }
  44. .bjCon table td select {
  45. width: 240px;
  46. background-color: #ffffff;
  47. background-image: none !important;
  48. filter: none !important;
  49. border: 1px solid #e5e5e5;
  50. outline: none;
  51. height: 34px !important;
  52. line-height: 30px;
  53. margin-right: 5px;
  54. padding-left: 10px;
  55. }
  56. .bjCon {
  57. padding-top: 20px;
  58. border: 1px solid #e5e5e5;
  59. border-top: 0;
  60. }
  61. .bjright table td input {
  62. padding-left: 44px !important;
  63. }
  64. .tub {
  65. position: absolute;
  66. left: 18px;
  67. top: 13px;
  68. font-size: 18px;
  69. color: #ccc;
  70. }
  71. .box {
  72. width: 55%;
  73. margin: 0 auto;
  74. margin-top: 5%;
  75. }
  76. .box .btop {
  77. height: 35px;
  78. background: #00a1cb;
  79. color: #fff;
  80. line-height: 35px;
  81. padding: 0 15px;
  82. }
  83. .btl {
  84. float: left;
  85. margin: 0;
  86. }
  87. .btr {
  88. float: right;
  89. margin: 0;
  90. cursor: pointer;
  91. }
  92. .boxCon {
  93. width: 100%;
  94. min-height: 400px;
  95. background: #fff;
  96. text-align: center;
  97. padding: 10px 15px;
  98. height: auto;
  99. overflow-y: auto;
  100. }
  101. .boxCon1 {
  102. width: 100%;
  103. min-height: 100px;
  104. background: #fff;
  105. text-align: center;
  106. padding: 10px 15px;
  107. height: auto;
  108. overflow-y: auto;
  109. }
  110. .model {
  111. position: fixed;
  112. top: 0;
  113. right: 0;
  114. bottom: 0;
  115. left: 0;
  116. height: 100%;
  117. width: 100%;
  118. background: rgba(0, 0, 0, 0.48);
  119. z-index: 100;
  120. display: none;
  121. }
  122. .model1 {
  123. position: fixed;
  124. top: 0;
  125. right: 0;
  126. bottom: 0;
  127. left: 0;
  128. height: 100%;
  129. width: 100%;
  130. background: rgba(0, 0, 0, 0.48);
  131. z-index: 100;
  132. display: none;
  133. }
  134. .tab-content {
  135. text-align: left;
  136. height: 200px;
  137. }
  138. .drfs {
  139. display: none;
  140. }
  141. .radio-inline input[type=radio] {
  142. margin-top: 5px;
  143. }
  144. .daoHang {
  145. border-bottom: 1px solid #ccc;
  146. margin-bottom: 20px;
  147. }
  148. .layui-laydate-footer .laydate-footer-btns .laydate-btns-clear:hover,
  149. .layui-laydate-footer .laydate-footer-btns .laydate-btns-now:hover,
  150. .layui-laydate-footer .laydate-footer-btns .laydate-btns-confirm:hover {
  151. color: #00a1cb;
  152. }
  153. </style>
  154. </head>
  155. <body>
  156. <div class="container-fluid">
  157. <div class="daoHang clearfix">
  158. <div class="dhLeft">
  159. <sapn><i class="syIcon"></i>位置:<a id="ReIndex">首页</a>&gt;<a href="javaScript:;">通知查询</a>&gt;<a href="" class="nowPosition">添加新通知</a></sapn>
  160. </div>
  161. <div class="dhRight"><a href="" title="刷新"><i class="fa fa-refresh"></i></a></div>
  162. </div>
  163. <form class="container-fluid2" enctype="multipart/form-data">
  164. <div class="row-fluid clearfix">
  165. <div class="bjleft col-md-6" style="height:444px;">
  166. <div class="bj-title">
  167. <i class="fa fa-user"></i> 基本信息
  168. </div>
  169. <div class="bjCon" style="height:444px;">
  170. <table style="width: 100%;">
  171. <tr>
  172. <th>所属类别:</th>
  173. <td>
  174. <select name="TaskCategoryId" class="leiBie"></select><span>(必填)</span>
  175. </td>
  176. </tr>
  177. <tr>
  178. <th>通知标题:</th>
  179. <td><input type="text" class="tzTitle" name="Name" /><span>(必填)</span></td>
  180. </tr>
  181. <tr>
  182. <th>通知模板:</th>
  183. <td>
  184. <select name="voicetempid" class="voicetempid"></select>
  185. </td>
  186. </tr>
  187. <tr>
  188. <th>通知内容:</th>
  189. <td>
  190. <textarea class="tzCon" name="TaskContent" rows="2" cols="" id="TaskContent"></textarea>
  191. <span>(必填)</span>
  192. </td>
  193. </tr>
  194. <tr>
  195. <th>试听通知:</th>
  196. <td>
  197. <button class="btns try_listen" style="padding: 3px 10px;" type="button"><i class="fa fa-volume-up" style="margin-right: 5px;"></i>试听</button>
  198. </td>
  199. </tr>
  200. <tr>
  201. <th>执行方式:</th>
  202. <td>
  203. <div class="radio-inline ">
  204. <label>
  205. <input type="radio" name="IsExcuteNow" id="way1" value="true" checked="checked"> 立即执行
  206. </label>
  207. </div>
  208. <div class="radio-inline">
  209. <label>
  210. <input type="radio" name="IsExcuteNow" id="way2" value="false"> 定时执行
  211. </label>
  212. </div>
  213. </td>
  214. </tr>
  215. <tr>
  216. <th>失败重试次数:</th>
  217. <td><input type="text" class="failCount" name="LoopTime" value="0" /><span>(必填)</span></td>
  218. </tr>
  219. <tr>
  220. <th>通知号码:</th>
  221. <td>
  222. <button class="btns set_called" style="padding: 3px 10px;" type="button"><i class="fa fa-wrench" style="margin-right: 5px;"></i>设置</button>
  223. <span class="drfs" style="background-color: #ed4e2a;font-size: 12px;padding: 0 3px;margin-left: 5px;color: #fff;"></span>
  224. <input type="hidden" name="importtype" value="" id="importtype" />
  225. </td>
  226. </tr>
  227. </table>
  228. <br />
  229. </div>
  230. </div>
  231. <div class="bjright col-md-6">
  232. <div class="bj-title">
  233. <i class="fa fa-calendar"></i> 发送时间
  234. </div>
  235. <div class="bjCon" style="height:444px;">
  236. <table style="width: 100%;">
  237. <tr>
  238. <th>开始日期:</th>
  239. <td>
  240. <i class="fa fa-calendar tub"></i>
  241. <input type="text" id="startdate" readonly="readonly" name="planstartdate" /><span>(必填)</span>
  242. </td>
  243. </tr>
  244. <tr>
  245. <th>结束日期:</th>
  246. <td>
  247. <i class="fa fa-calendar tub"></i>
  248. <input type="text" id="enddate" readonly="readonly" name="planenddate" /><span>(必填)</span>
  249. </td>
  250. </tr>
  251. <tr>
  252. <th>开始时间段1:</th>
  253. <td>
  254. <i class="fa fa-calendar tub"></i>
  255. <input type="text" id="usestrTime1" readonly="readonly" name="StartTime1" /><span>(必填)</span>
  256. </td>
  257. </tr>
  258. <tr>
  259. <th>结束时间段1:</th>
  260. <td>
  261. <i class="fa fa-calendar tub"></i>
  262. <input type="text" id="useendTime1" readonly="readonly" name="EndTime1" /><span>(必填)</span>
  263. </td>
  264. </tr>
  265. <tr>
  266. <th>开始时间段2:</th>
  267. <td>
  268. <i class="fa fa-calendar tub"></i>
  269. <input type="text" id="usestrTime2" readonly="readonly" name="StartTime2" /><span>(必填)</span>
  270. </td>
  271. </tr>
  272. <tr>
  273. <th>结束时间段2:</th>
  274. <td>
  275. <i class="fa fa-calendar tub"></i>
  276. <input type="text" id="useendTime2" readonly="readonly" name="EndTime2" /><span>(必填)</span>
  277. </td>
  278. </tr>
  279. </table>
  280. <br />
  281. <br />
  282. <br />
  283. <br />
  284. <br />
  285. <br />
  286. <br />
  287. </div>
  288. </div>
  289. </div>
  290. <p style="text-align: center; padding: 20px 0;">
  291. <button class="btns sureCun" type="button">保存</button>
  292. <button class="btns return" type="button">取消</button>
  293. </p>
  294. <!--设置被叫号码-->
  295. <div class="model addCall">
  296. <div class="box">
  297. <div class="btop clearfix">
  298. <p class="btl">设置被叫号码</p>
  299. <p class="btr addcbtr"><i class="fa fa-remove"></i></p>
  300. </div>
  301. <div class="boxCon">
  302. <ul class="nav nav-tabs" role="tablist">
  303. <li class="active"><a href="#import_from_telnos" role="tab" data-toggle="tab"><i class="fa fa-file"></i>Excel导入</a></li>
  304. <li><a href="#import_from_hmd" role="tab" data-toggle="tab"><i class="fa fa-table"></i>文本导入</a></li>
  305. <li><a href="#import_from_file" role="tab" data-toggle="tab"><i class="fa fa-reorder"></i>txt文件导入</a></li>
  306. </ul>
  307. <div class="tab-content">
  308. <div class="tab-pane fade active in" id="import_from_telnos">
  309. <a href="/VoiceNotification/files/Excel导入模板.xls">下载Excel模板</a>
  310. <br />
  311. 支持的Excel格式,每行一个号码,最多10万个号码:
  312. <br />
  313. <br />
  314. <input type="file" name="fileField" id="fileField" placeholder="号码列表" />
  315. </div>
  316. <div class="tab-pane fade" id="import_from_hmd">
  317. <br />
  318. 支持的文本文件格式,每行一个号码,最多10万个号码:
  319. <br />
  320. <br />
  321. <textarea class="haoDuan" name="PhoneList" rows="7" style="width: 100%; resize: none;"></textarea>
  322. </div>
  323. <div class="tab-pane fade" id="import_from_file">
  324. <br />
  325. 支持的文本文件格式,每行一个号码,最多10万个号码:
  326. <br />
  327. <br />
  328. <input type="file" name="fileField2" id="fileField2" placeholder="号码列表" />
  329. </div>
  330. </div>
  331. <div style="text-align: right;"><button class="btns queren" type="button">确认</button></div>
  332. </div>
  333. </div>
  334. </div>
  335. <div class="model1">
  336. <div class="box">
  337. <div class="btop clearfix">
  338. <p class="btl">试听通知</p>
  339. <p class="btr closeaddListen"><i class="fa fa-remove"></i></p>
  340. </div>
  341. <div class="boxCon1">
  342. <table style="width: 40%; margin:0 auto;">
  343. <tr>
  344. <th>请添加试听号码:</th>
  345. <td>
  346. <input type="text" class="tzTitle" name="listenphone" id="listenphone" /><span>(必填)</span>
  347. </td>
  348. </tr>
  349. </table>
  350. <p style="text-align: center; padding: 20px 0;">
  351. <button class="btns tryListen" type="button">加入试听队列</button>
  352. </p>
  353. </div>
  354. </div>
  355. </div>
  356. </form>
  357. </div>
  358. <script src="../js/jquery.form.min.js"></script>
  359. <script src="../js/laydate/laydate.js"></script>
  360. <script src="../js/adjustHeight.js"></script>
  361. <script>
  362. var token = $.cookie("token");
  363. var ImportType;//号码导入方式
  364. var haoma;
  365. //类别
  366. function LB(obj) {
  367. obj.empty();
  368. // $("<option value='-1'>所有分类</option>").appendTo(obj);
  369. $.getJSON(huayi.config.callcenter_url + "CallPlan/GetCategoryAllList2", {
  370. "token": $.cookie("token")
  371. }, function (data) {
  372. if (data.state.toLowerCase() == "success") {
  373. var content = data.data;
  374. $(content).each(function (i, n) {
  375. $("<option value='" + n.id + "'>" + n.name + "</option>").appendTo(obj);
  376. })
  377. }
  378. })
  379. }
  380. function loadContent(obj) {
  381. obj.empty();
  382. $("<option value='-1'>请选择通知模板</option>").appendTo(obj);
  383. $.getJSON(huayi.config.callcenter_url + "CallPlan/GetVoiceTempTitleList", {
  384. "token": $.cookie("token")
  385. }, function (data) {
  386. if (data.state.toLowerCase() == "success") {
  387. var content = data.data;
  388. $(content).each(function (i, n) {
  389. $("<option value='" + n.id + "'>" + n.title + "</option>").appendTo(obj);
  390. });
  391. obj.change(function () {
  392. var value = this.value;
  393. if (value != '-1') {
  394. $.getJSON(huayi.config.callcenter_url + "CallPlan/GetVoiceTemp", {
  395. token: $.cookie("token"),
  396. id: value
  397. }, function (data) {
  398. if (data.state.toLowerCase() == "success") {
  399. $(".tzCon").val(data.data.content);
  400. }
  401. });
  402. }
  403. });
  404. }
  405. });
  406. }
  407. $(document).ready(function () {
  408. laydate.render({
  409. elem: '#startdate',
  410. type: 'date',
  411. theme: '#00a1cb',
  412. value: new Date()
  413. });
  414. laydate.render({
  415. elem: '#enddate',
  416. type: 'date',
  417. theme: '#00a1cb',
  418. value: new Date()
  419. });
  420. laydate.render({
  421. elem: '#usestrTime1',
  422. type: 'time',
  423. theme: '#00a1cb',
  424. value: new Date("2017/01/01 09:00:00")
  425. });
  426. laydate.render({
  427. elem: '#useendTime1',
  428. type: 'time',
  429. theme: '#00a1cb',
  430. value: new Date("2017/01/01 12:00:00")
  431. });
  432. laydate.render({
  433. elem: '#usestrTime2',
  434. type: 'time',
  435. theme: '#00a1cb',
  436. value: new Date("2017/01/01 14:00:00")
  437. });
  438. laydate.render({
  439. elem: '#useendTime2',
  440. type: 'time',
  441. theme: '#00a1cb',
  442. value: new Date("2017/01/01 18:00:00")
  443. });
  444. $('.set_called').click(function () {
  445. $('.addCall').show()
  446. })
  447. $('.addcbtr').click(function () {
  448. $('.addCall').hide();
  449. })
  450. $('.try_listen').click(function () {
  451. $('.model1').show()
  452. })
  453. $('.closeaddListen').click(function () {
  454. $('#listenphone').val('');
  455. $('.model1').hide()
  456. })
  457. $('.tryListen').click(function () {
  458. $.ajax({
  459. type: "get",
  460. url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
  461. async: true,
  462. dataType: 'json',
  463. data: {
  464. token: $.cookie("token"),
  465. phone: $('#listenphone').val()
  466. },
  467. success: function (result) {
  468. if (result.state.toLowerCase() == "success") {
  469. var fix = result.data.fix;
  470. $.ajax({
  471. type: "get",
  472. url: huayi.config.callcenter_url + "CallPlan/TryListen",
  473. async: true,
  474. dataType: 'json',
  475. data: {
  476. token: $.cookie("token"),
  477. phone: $('#listenphone').val(),
  478. text: $('#TaskContent').val(),
  479. fix: fix
  480. },
  481. success: function (res) {
  482. if (result.state.toLowerCase() == "success") {
  483. layer.msg(res.message);
  484. $('#listenphone').val('');
  485. $('.model1').hide()
  486. }
  487. }
  488. });
  489. }
  490. }
  491. });
  492. })
  493. LB($('.leiBie'))
  494. loadContent($('.voicetempid'));
  495. $('.sureCun').click(function () {
  496. if ($('.tzTitle').val() == '') {
  497. layer.confirm('请输入标题!', {
  498. btn: ['确定']
  499. });
  500. return;
  501. } else if ($('.tzCon').val() == '') {
  502. layer.confirm('请输入内容!', {
  503. btn: ['确定']
  504. });
  505. return;
  506. } else if ($('.failCount').val() == '') {
  507. layer.confirm('请输入失败次数!', {
  508. btn: ['确定']
  509. });
  510. return;
  511. } else if ($('input[name="IsExcuteNow"]:checked').val() == 'false') {
  512. if ($('#usestrTime1').val() == '') {
  513. layer.confirm('请选择开始时间段1!', {
  514. btn: ['确定']
  515. });
  516. return;
  517. } else if ($('#useendTime1').val() == '') {
  518. layer.confirm('请选择结束时间段1!', {
  519. btn: ['确定']
  520. });
  521. return;
  522. } else if ($('#usestrTime2').val() == '') {
  523. layer.confirm('请选择开始时间段2!', {
  524. btn: ['确定']
  525. });
  526. return;
  527. } else if ($('#useendTime2').val() == '') {
  528. layer.confirm('请选择结束时间段2!', {
  529. btn: ['确定']
  530. });
  531. return;
  532. }
  533. formSubmit();
  534. } else {
  535. formSubmit();
  536. }
  537. })
  538. $('.queren').click(function () {
  539. $('.drfs').show();
  540. if ($('#import_from_telnos').hasClass('active')) {
  541. ImportType = 4;//文件导入
  542. $('.drfs').html('选择Excel导入');
  543. } else if ($('#import_from_hmd').hasClass('active')) {
  544. ImportType = 2;//号段导入
  545. haoma = $('.haoDuan').val();
  546. $('.drfs').html('选择文本导入');
  547. } else if ($('#import_from_file').hasClass('active')) {
  548. ImportType = 1;//号码列表导入
  549. haoma = $('.haomaList').val();
  550. $('.drfs').html('选择文件导入');
  551. }
  552. console.log(ImportType);
  553. $("#importtype").val(ImportType);
  554. $('.addCall').hide();
  555. })
  556. $('.return').click(function () {
  557. top.$("iframe:visible")[0].src = "VoiceNotification/tongZhiChaXun.html";
  558. });
  559. function formSubmit() {
  560. $(".container-fluid2")
  561. .attr("method", "post")
  562. .attr("action", huayi.config.callcenter_url + "Callplan/CreateOrUpdate")
  563. .attr("enctype", "multipart/form-data");
  564. $(".container-fluid2").ajaxSubmit({
  565. dataType: "json",
  566. data: { token: $.cookie("token") },
  567. success: function (res) {
  568. if (res.state == "success") {
  569. top.$("iframe:visible")[0].src = "VoiceNotification/tongZhiChaXun.html";
  570. } else {
  571. layer.msg(res.message);
  572. }
  573. }
  574. });
  575. }
  576. });
  577. </script>
  578. </body>
  579. </html>