12345市长热线标准版-前端

addTongZhi.html 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  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. .model {
  102. position: fixed;
  103. top: 0;
  104. right: 0;
  105. bottom: 0;
  106. left: 0;
  107. height: 100%;
  108. width: 100%;
  109. background: rgba(0, 0, 0, 0.48);
  110. z-index: 100;
  111. display: none;
  112. }
  113. .tab-content {
  114. text-align: left;
  115. height: 200px;
  116. }
  117. .drfs {
  118. display: none;
  119. }
  120. .radio-inline input[type=radio] {
  121. margin-top: 5px;
  122. }
  123. .daoHang {
  124. border-bottom: 1px solid #ccc;
  125. margin-bottom: 20px;
  126. }
  127. .layui-laydate-footer .laydate-footer-btns .laydate-btns-clear:hover,
  128. .layui-laydate-footer .laydate-footer-btns .laydate-btns-now:hover,
  129. .layui-laydate-footer .laydate-footer-btns .laydate-btns-confirm:hover {
  130. color: #00a1cb;
  131. }
  132. </style>
  133. </head>
  134. <body>
  135. <div class="container-fluid">
  136. <div class="daoHang clearfix">
  137. <div class="dhLeft">
  138. <sapn><i class="syIcon"></i>位置:<a id="ReIndex">首页</a>&gt;<a href="javaScript:;">通知查询</a>&gt;<a href="" class="nowPosition">添加新通知</a></sapn>
  139. </div>
  140. <div class="dhRight"><a href="" title="刷新"><i class="fa fa-refresh"></i></a></div>
  141. </div>
  142. <form class="container-fluid2" enctype="multipart/form-data">
  143. <div class="row-fluid clearfix">
  144. <div class="bjleft col-md-6">
  145. <div class="bj-title">
  146. <i class="fa fa-user"></i> 基本信息
  147. </div>
  148. <div class="bjCon">
  149. <table style="width: 100%;">
  150. <tr>
  151. <th>所属类别:</th>
  152. <td>
  153. <select name="TaskCategoryId" class="leiBie"></select><span>(必填)</span>
  154. </td>
  155. </tr>
  156. <tr>
  157. <th>通知标题:</th>
  158. <td><input type="text" class="tzTitle" name="Name" /><span>(必填)</span></td>
  159. </tr>
  160. <tr>
  161. <th>通知模板:</th>
  162. <td>
  163. <select name="voicetempid" class="voicetempid"></select>
  164. </td>
  165. </tr>
  166. <tr>
  167. <th>通知内容:</th>
  168. <td>
  169. <textarea class="tzCon" name="TaskContent" rows="2" cols=""></textarea>
  170. <span>(必填)</span>
  171. </td>
  172. </tr>
  173. <tr>
  174. <th>执行方式:</th>
  175. <td>
  176. <div class="radio-inline ">
  177. <label>
  178. <input type="radio" name="IsExcuteNow" id="way1" value="true" checked="checked"> 立即执行
  179. </label>
  180. </div>
  181. <div class="radio-inline">
  182. <label>
  183. <input type="radio" name="IsExcuteNow" id="way2" value="false"> 定时执行
  184. </label>
  185. </div>
  186. </td>
  187. </tr>
  188. <tr>
  189. <th>失败重试次数:</th>
  190. <td><input type="text" class="failCount" name="LoopTime" value="0" /><span>(必填)</span></td>
  191. </tr>
  192. <tr>
  193. <th>通知号码:</th>
  194. <td>
  195. <button class="btns set_called" style="padding: 3px 10px;" type="button"><i class="fa fa-wrench" style="margin-right: 5px;"></i>设置</button>
  196. <span class="drfs" style="background-color: #ed4e2a;font-size: 12px;padding: 0 3px;margin-left: 5px;color: #fff;"></span>
  197. <input type="hidden" name="importtype" value="" id="importtype" />
  198. </td>
  199. </tr>
  200. </table>
  201. <br />
  202. </div>
  203. </div>
  204. <div class="bjright col-md-6">
  205. <div class="bj-title">
  206. <i class="fa fa-calendar"></i> 发送时间
  207. </div>
  208. <div class="bjCon ">
  209. <table style="width: 100%;">
  210. <tr>
  211. <th>开始日期:</th>
  212. <td>
  213. <i class="fa fa-calendar tub"></i>
  214. <input type="text" id="startdate" readonly="readonly" name="planstartdate" /><span>(必填)</span>
  215. </td>
  216. </tr>
  217. <tr>
  218. <th>结束日期:</th>
  219. <td>
  220. <i class="fa fa-calendar tub"></i>
  221. <input type="text" id="enddate" readonly="readonly" name="planenddate" /><span>(必填)</span>
  222. </td>
  223. </tr>
  224. <tr>
  225. <th>开始时间段1:</th>
  226. <td>
  227. <i class="fa fa-calendar tub"></i>
  228. <input type="text" id="usestrTime1" readonly="readonly" name="StartTime1" /><span>(必填)</span>
  229. </td>
  230. </tr>
  231. <tr>
  232. <th>结束时间段1:</th>
  233. <td>
  234. <i class="fa fa-calendar tub"></i>
  235. <input type="text" id="useendTime1" readonly="readonly" name="EndTime1" /><span>(必填)</span>
  236. </td>
  237. </tr>
  238. <tr>
  239. <th>开始时间段2:</th>
  240. <td>
  241. <i class="fa fa-calendar tub"></i>
  242. <input type="text" id="usestrTime2" readonly="readonly" name="StartTime2" /><span>(必填)</span>
  243. </td>
  244. </tr>
  245. <tr>
  246. <th>结束时间段2:</th>
  247. <td>
  248. <i class="fa fa-calendar tub"></i>
  249. <input type="text" id="useendTime2" readonly="readonly" name="EndTime2" /><span>(必填)</span>
  250. </td>
  251. </tr>
  252. </table>
  253. <br />
  254. <br />
  255. <br />
  256. <br />
  257. <br />
  258. <br />
  259. <br />
  260. </div>
  261. </div>
  262. </div>
  263. <p style="text-align: center; padding: 20px 0;">
  264. <button class="btns sureCun" type="button">保存</button>
  265. <button class="btns return" type="button">取消</button>
  266. </p>
  267. <!--设置被叫号码-->
  268. <div class="model addCall">
  269. <div class="box">
  270. <div class="btop clearfix">
  271. <p class="btl">设置被叫号码</p>
  272. <p class="btr addcbtr"><i class="fa fa-remove"></i></p>
  273. </div>
  274. <div class="boxCon">
  275. <ul class="nav nav-tabs" role="tablist">
  276. <li class="active"><a href="#import_from_telnos" role="tab" data-toggle="tab"><i class="fa fa-file"></i>Excel导入</a></li>
  277. <li><a href="#import_from_hmd" role="tab" data-toggle="tab"><i class="fa fa-table"></i>文本导入</a></li>
  278. <li><a href="#import_from_file" role="tab" data-toggle="tab"><i class="fa fa-reorder"></i>txt文件导入</a></li>
  279. </ul>
  280. <div class="tab-content">
  281. <div class="tab-pane fade active in" id="import_from_telnos">
  282. <a href="/VoiceNotification/files/Excel导入模板.xls">下载Excel模板</a>
  283. <br />
  284. 支持的Excel格式,每行一个号码,最多10万个号码:
  285. <br />
  286. <br />
  287. <input type="file" name="fileField" id="fileField" placeholder="号码列表" />
  288. </div>
  289. <div class="tab-pane fade" id="import_from_hmd">
  290. <br />
  291. 支持的文本文件格式,每行一个号码,最多10万个号码:
  292. <br />
  293. <br />
  294. <textarea class="haoDuan" name="PhoneList" rows="7" style="width: 100%; resize: none;"></textarea>
  295. </div>
  296. <div class="tab-pane fade" id="import_from_file">
  297. <br />
  298. 支持的文本文件格式,每行一个号码,最多10万个号码:
  299. <br />
  300. <br />
  301. <input type="file" name="fileField2" id="fileField2" placeholder="号码列表" />
  302. </div>
  303. </div>
  304. <div style="text-align: right;"><button class="btns queren" type="button">确认</button></div>
  305. </div>
  306. </div>
  307. </div>
  308. </form>
  309. </div>
  310. <script src="../js/jquery.form.min.js"></script>
  311. <script src="../js/laydate/laydate.js"></script>
  312. <script src="../js/adjustHeight.js"></script>
  313. <script>
  314. var token = $.cookie("token");
  315. var ImportType;//号码导入方式
  316. var haoma;
  317. //类别
  318. function LB(obj) {
  319. obj.empty();
  320. // $("<option value='-1'>所有分类</option>").appendTo(obj);
  321. $.getJSON(huayi.config.callcenter_url + "CallPlan/GetCategoryAllList2", {
  322. "token": token
  323. }, function (data) {
  324. if (data.state.toLowerCase() == "success") {
  325. var content = data.data;
  326. $(content).each(function (i, n) {
  327. $("<option value='" + n.id + "'>" + n.name + "</option>").appendTo(obj);
  328. })
  329. }
  330. })
  331. }
  332. function loadContent(obj) {
  333. obj.empty();
  334. $("<option value='-1'>请选择通知模板</option>").appendTo(obj);
  335. $.getJSON(huayi.config.callcenter_url + "CallPlan/GetVoiceTempTitleList", {
  336. "token": token
  337. }, function (data) {
  338. if (data.state.toLowerCase() == "success") {
  339. var content = data.data;
  340. $(content).each(function (i, n) {
  341. $("<option value='" + n.id + "'>" + n.title + "</option>").appendTo(obj);
  342. });
  343. obj.change(function () {
  344. var value = this.value;
  345. if (value != '-1') {
  346. $.getJSON(huayi.config.callcenter_url + "CallPlan/GetVoiceTemp", {
  347. token: token,
  348. id: value
  349. }, function (data) {
  350. if (data.state.toLowerCase() == "success") {
  351. $(".tzCon").val(data.data.content);
  352. }
  353. });
  354. }
  355. });
  356. }
  357. });
  358. }
  359. $(document).ready(function () {
  360. //返回首页
  361. $('#ReIndex').click(function () {
  362. top.home_index();
  363. })
  364. laydate.render({
  365. elem: '#startdate',
  366. type: 'date',
  367. theme: '#00a1cb',
  368. value: new Date()
  369. });
  370. laydate.render({
  371. elem: '#enddate',
  372. type: 'date',
  373. theme: '#00a1cb',
  374. value: new Date()
  375. });
  376. laydate.render({
  377. elem: '#usestrTime1',
  378. type: 'time',
  379. theme: '#00a1cb',
  380. value: new Date("2017/01/01 09:00:00")
  381. });
  382. laydate.render({
  383. elem: '#useendTime1',
  384. type: 'time',
  385. theme: '#00a1cb',
  386. value: new Date("2017/01/01 12:00:00")
  387. });
  388. laydate.render({
  389. elem: '#usestrTime2',
  390. type: 'time',
  391. theme: '#00a1cb',
  392. value: new Date("2017/01/01 14:00:00")
  393. });
  394. laydate.render({
  395. elem: '#useendTime2',
  396. type: 'time',
  397. theme: '#00a1cb',
  398. value: new Date("2017/01/01 18:00:00")
  399. });
  400. $('.set_called').click(function () {
  401. $('.addCall').show()
  402. })
  403. $('.addcbtr').click(function () {
  404. $('.addCall').hide();
  405. })
  406. LB($('.leiBie'))
  407. loadContent($('.voicetempid'));
  408. })
  409. $('.sureCun').click(function () {
  410. if ($('.tzTitle').val() == '') {
  411. layer.confirm('请输入标题!', {
  412. btn: ['确定']
  413. });
  414. return;
  415. } else if ($('.tzCon').val() == '') {
  416. layer.confirm('请输入内容!', {
  417. btn: ['确定']
  418. });
  419. return;
  420. } else if ($('.failCount').val() == '') {
  421. layer.confirm('请输入失败次数!', {
  422. btn: ['确定']
  423. });
  424. return;
  425. } else if ($('input[name="IsExcuteNow"]:checked').val() == 'false') {
  426. if ($('#usestrTime1').val() == '') {
  427. layer.confirm('请选择开始时间段1!', {
  428. btn: ['确定']
  429. });
  430. return;
  431. } else if ($('#useendTime1').val() == '') {
  432. layer.confirm('请选择结束时间段1!', {
  433. btn: ['确定']
  434. });
  435. return;
  436. } else if ($('#usestrTime2').val() == '') {
  437. layer.confirm('请选择开始时间段2!', {
  438. btn: ['确定']
  439. });
  440. return;
  441. } else if ($('#useendTime2').val() == '') {
  442. layer.confirm('请选择结束时间段2!', {
  443. btn: ['确定']
  444. });
  445. return;
  446. }
  447. formSubmit();
  448. } else {
  449. formSubmit();
  450. }
  451. })
  452. $('.queren').click(function () {
  453. $('.drfs').show();
  454. if ($('#import_from_telnos').hasClass('active')) {
  455. ImportType = 4;//文件导入
  456. $('.drfs').html('选择Excel导入');
  457. } else if ($('#import_from_hmd').hasClass('active')) {
  458. ImportType = 2;//号段导入
  459. haoma = $('.haoDuan').val();
  460. $('.drfs').html('选择文本导入');
  461. } else if ($('#import_from_file').hasClass('active')) {
  462. ImportType = 1;//号码列表导入
  463. haoma = $('.haomaList').val();
  464. $('.drfs').html('选择文件导入');
  465. }
  466. console.log(ImportType);
  467. $("#importtype").val(ImportType);
  468. $('.addCall').hide();
  469. })
  470. function formSubmit() {
  471. $(".container-fluid2")
  472. .attr("method", "post")
  473. .attr("action", huayi.config.callcenter_url + "Callplan/CreateOrUpdate")
  474. .attr("enctype", "multipart/form-data");
  475. $(".container-fluid2").ajaxSubmit({
  476. dataType: "json",
  477. data: { token: token },
  478. success: function (res) {
  479. if (res.state == "success") {
  480. top.$("iframe:visible")[0].src = "VoiceNotification/tongZhiChaXun.html";
  481. } else {
  482. layer.msg(res.message);
  483. }
  484. }
  485. });
  486. }
  487. </script>
  488. </body>
  489. </html>