Brak opisu

AddAppeal.html 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  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.config.js"></script>
  7. <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  8. <link href="../css/layer/need/layer.css" />
  9. <link rel="stylesheet" href="../css/init.css" />
  10. <link rel="stylesheet" href="../css/addappeal.css" />
  11. <title>新增诉求工单</title>
  12. </head>
  13. <body>
  14. <div class="wrapper wrapper-content animated fadeInRight">
  15. <div class="daoHang clearfix">
  16. <div class="dhLeft">
  17. <sapn>
  18. <i class="syIcon"></i>位置:
  19. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  20. <a href="javaScript:;">工单处理</a>&gt;
  21. <a href="" class="nowPosition">添加工单</a>
  22. </sapn>
  23. </div>
  24. <div class="dhRight">
  25. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  26. </div>
  27. </div>
  28. <div style="padding: 10px;" class="tj_content clearFix">
  29. <div class="Common">
  30. <table>
  31. <tr>
  32. <th class="Importent">标题:</th>
  33. <td colspan="7">
  34. <input id="title" class="form-control" type="text" style="width: 100%;" />
  35. </td>
  36. </tr>
  37. <tr>
  38. <th class="Importent">内容:</th>
  39. <td colspan="7">
  40. <textarea data-adaptheight id="content" class="form-control" name="" rows="3" cols=""
  41. style="width: 100%;"></textarea>
  42. </td>
  43. </tr>
  44. <tr>
  45. <th>附件上传:</th>
  46. <td colspan="7">
  47. <div class="fileBox"></div>
  48. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple"
  49. style="display: none;">
  50. <input class="input" type="button" value="上传" id="scwj" />
  51. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  52. <input type="hidden" id="file" />
  53. <!--</br>-->
  54. <span style="color:#FF0000; border: none;">
  55. (文件格式为png,jpg,mp4,avi,wmv,mp3,pdf,doc,docx,xls,xlsx)
  56. </span>
  57. </td>
  58. </tr>
  59. <!--<tr>
  60. <th>&nbsp;</th>
  61. <td></td>
  62. </tr>-->
  63. <tr>
  64. <th>处理方式:</th>
  65. <td colspan="">
  66. <input type="radio" value="1" name="banli" class="Nows_ radioStyle" />当即办理
  67. <input checked="true" type="radio" value="0" name="banli" class="Nows_ radioStyle" />网络转办
  68. <input id="threeWayCall" type="checkbox" value="1" name="" class="Nows_ radioStyle" />三方通话
  69. </td>
  70. <th>来电号码密级:</th>
  71. <td>
  72. <input class="radioStyle" type="radio" name="mj" id="" value="0" />普通
  73. <input class="radioStyle" type="radio" name="mj" id="" value="1" checked="checked" />保密
  74. </td>
  75. </tr>
  76. <tr>
  77. <th class="">来电人:</th>
  78. <td>
  79. <input type="text" id="cusname" class="form-control" />
  80. </td>
  81. <th>性别:</th>
  82. <td>
  83. <select class="form-control" id="cussex">
  84. <option value="">请选择</option>
  85. <option value="0">男</option>
  86. <option value="1">女</option>
  87. </select>
  88. </td>
  89. <th class="Importent">来电号码:</th>
  90. <td>
  91. <input type="text" id="cusphone" class="form-control" />
  92. </td>
  93. </tr>
  94. <tr>
  95. <th>类型:</th>
  96. <td>
  97. <select class="form-control" id="type"></select>
  98. </td>
  99. <th class="Importent">反映类别:</th>
  100. <td style="position: relative">
  101. <div class="inpBox">
  102. <input type="text" class="inps" onkeyup="darptSearch()" />
  103. <i class="Cleans fa fa-close"></i>
  104. <i class="xl xl_one"></i>
  105. <div class="addTree xlAdd">
  106. <ul id="addTreeDemo" class="ztree"></ul>
  107. </div>
  108. </div>
  109. <div class="selDpart1">
  110. <ul id="sponsor"></ul>
  111. </div>
  112. </td>
  113. <th class="Importent">紧急程度:</th>
  114. <td>
  115. <select class="form-control" id="level">
  116. <!--<option value="0">选择</option>-->
  117. <option value="1">普通</option>
  118. <option value="2">紧急</option>
  119. </select>
  120. </td>
  121. </tr>
  122. <tr>
  123. <th>来源:</th>
  124. <td>
  125. <select class="form-control" id="source"></select>
  126. </td>
  127. </tr>
  128. <tr class="leaderCharge-wrapper" style="display: none;">
  129. <th class="">分管领导:</th>
  130. <td>
  131. <select class="form-control" id="leaderCharge">
  132. <option value="">请选择</option>
  133. <option value="省长">省长</option>
  134. <option value="市长">市长</option>
  135. </select>
  136. </td>
  137. </tr>
  138. <tr class="phonetype-wrapper">
  139. <th class="">电话类别:</th>
  140. <td>
  141. <select class="form-control" id="phonetype">
  142. <option value="">请选择</option>
  143. </select>
  144. </td>
  145. </tr>
  146. <tr>
  147. <td colspan="8" style="text-align: center;">
  148. <div class="btn_box">
  149. <button class="btns BC">保存</button>
  150. <button class="btns SavedSubmit">保存并提交</button>
  151. </div>
  152. </td>
  153. </tr>
  154. <tr class="Nows_box Hidens">
  155. <th>直办内容:</th>
  156. <td colspan="7">
  157. <textarea id="result" class="form-control" name="" rows="3" cols=""
  158. style="width: 100%;"></textarea>
  159. <!-- <input type="text" style="width: 100%;" id="result" class="form-control" /> -->
  160. </td>
  161. </tr>
  162. <tr>
  163. <th>事发区域:</th>
  164. <td>
  165. <select class="form-control" id="sourcearea" style="display: inline-block;"></select>
  166. </td>
  167. <td colspan="2">
  168. <input id="sourceaddress" class="form-control" type="text" placeholder="输入详细地址"
  169. style="padding-left: 15px;" />
  170. </td>
  171. </tr>
  172. <tr>
  173. <th class="Importent"></th>
  174. <td colspan="7">
  175. <div style="width:710px">
  176. <div id="myMap" style="width:100%;height:400px;"></div>
  177. <input type="hidden" class="store_Lng" value="114.352482" />
  178. <input type="hidden" class="store_Lat" value="36.103442" />
  179. </div>
  180. </td>
  181. </tr>
  182. </table>
  183. </div>
  184. </div>
  185. </div>
  186. <input type="hidden" id="PID" value="" />
  187. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  188. <script src="../css/laydate/laydate.js"></script>
  189. <script src="../js/adjustHeight.js"></script>
  190. <script src="../js/zTree/jquery.ztree.core.js"></script>
  191. <script src="../js/appeal/index1.js"></script>
  192. <script src="../js/ztreeSelect.js"></script>
  193. <script>
  194. var submit;
  195. $(document).ready(function () {
  196. QY($("#sourcearea"));
  197. LY($("#source"));
  198. LB($("#type"));
  199. ZT($("#keys"));
  200. getPhoneType($("#phonetype"));
  201. //当即办理
  202. $(' input[name="banli"]').change(function () {
  203. var val = $(this).val();
  204. if (val == "1") {
  205. $(".Nows_box").show();
  206. } else {
  207. $(".Nows_box").hide();
  208. }
  209. })
  210. $(".BC").click(function () {
  211. submit = 0;
  212. Add();
  213. })
  214. $('.SavedSubmit').click(function () {
  215. submit = 1;
  216. Add();
  217. })
  218. //上传附件
  219. $("#scwj").click(function () {
  220. $("#upFile").trigger("click");
  221. })
  222. $("#upFile").change(function () {
  223. upload();
  224. })
  225. $("#scfj").click(function () {
  226. // $(".fjnr").text("");
  227. // $("#scfj").hide();
  228. })
  229. });
  230. //添加工单
  231. function Add() {
  232. var threeWayCall;
  233. var value = $(' input[name="banli"]:checked ').val();
  234. var content = $("#content").val();
  235. if($('#threeWayCall').is(':checked')) {
  236. threeWayCall = 1;
  237. } else {
  238. threeWayCall = 0;
  239. }
  240. // if (!$("#cusname").val()) {
  241. // layer.msg("请输入姓名");
  242. // } else
  243. if (!$("#cusphone").val()) {
  244. layer.msg("请输入来电号码");
  245. // } else if (!$("#conphone").val()) {
  246. // layer.msg("请输入联系电话");
  247. } else if (!$("#title").val()) {
  248. layer.msg("请输入标题");
  249. } else if (!$("#content").val()) {
  250. layer.msg("请输入内容");
  251. } else if (!$("#PID").val()) {
  252. layer.msg("请选择反映类别");
  253. // } else if (!$("#sourcearea").val()) {
  254. // layer.msg("请选择事发区域");
  255. } else if (value == 1 && !$('#result').val()) {
  256. layer.msg("请输入直办内容");
  257. } else {
  258. $.ajax({
  259. type: "post",
  260. url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
  261. dataType: 'json',
  262. async: true,
  263. beforeSend: function () { //触发ajax请求开始时执行
  264. $('.BC').attr("disabled", true);
  265. $('.SavedSubmit').attr("disabled", true);
  266. $('.BC').text('提交中...');
  267. $('.SavedSubmit').text('提交中...');
  268. $(document).off('click', '.BC', Add);
  269. $(document).off('click', '.SavedSubmit', Add);
  270. },
  271. data: {
  272. cusname: $("#cusname").val(), //=来电人姓名
  273. cussex: $("#cussex").val(),
  274. cusphone: $("#cusphone").val().replace(/\s+/g, ""), //=来电人电话
  275. email: $("#email").val(),
  276. zipcode: $("#zipcode").val(),
  277. conphone: $("#conphone").val(),
  278. title: $("#title").val(),
  279. content: $("#content").val(),
  280. files: $("#file").val(), //(多个用英文逗号,隔开)
  281. sourcearea: $("#sourcearea").val(), //=事发地域id
  282. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  283. longitude: $('.store_Lng').val(),
  284. latitude: $('.store_Lat').val(),
  285. source: $("#source").val(), //=来源
  286. splituser: $("#leaderCharge").val(), // 分管领导
  287. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  288. business: threeWayCall,
  289. result: $('#result').val(),
  290. keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开)
  291. type: $("#type").val(), //=类型
  292. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  293. level: $('#level').val(), //=(1普通2紧急)
  294. issubmit: submit, //=(0保存1保存并提交)
  295. phonetype: $("#source").val() === "1" ? $("#phonetype").val() : "", // 电话类别
  296. token: $.cookie("token")
  297. },
  298. success: function (data) {
  299. $('.BC').attr("disabled", false);
  300. $('.SavedSubmit').attr("disabled", false);
  301. $('.BC').text('保存');
  302. $('.SavedSubmit').text('保存并提交');
  303. $(document).on('click', '.BC', Add);
  304. $(document).on('click', '.SavedSubmit', Add);
  305. Clean();
  306. $('.fileBox').html('');
  307. layer.msg("创建工单成功");
  308. }
  309. });
  310. }
  311. }
  312. //上传文件
  313. function upload() {
  314. var Files = document.getElementById("upFile").files;
  315. console.log(Files);
  316. if (Files.length > 0) {
  317. var formData = new FormData();
  318. for (var i = 0; i < Files.length; i++) {
  319. formData.append('file' + i, Files[i]);
  320. }
  321. formData.append("token", $.cookie("token"));
  322. var typeName = Files[0].name.split('.')[1];
  323. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'avi' || typeName ==
  324. 'wmv' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' ||
  325. typeName == 'xls' || typeName == 'xlsx') {
  326. $.ajax({
  327. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  328. type: "POST",
  329. data: formData,
  330. /**
  331. *必须false才会自动加上正确的Content-Type
  332. */
  333. contentType: false,
  334. /**
  335. * 必须false才会避开jQuery对 formdata 的默认处理
  336. * XMLHttpRequest会对 formdata 进行正确的处理
  337. */
  338. processData: false,
  339. success: function (result) {
  340. document.getElementById("upFile").outerHTML = document.getElementById("upFile")
  341. .outerHTML;
  342. $("#upFile").change(function () {
  343. upload();
  344. });
  345. var r = $.parseJSON(result);
  346. if (r.state.toLowerCase() == "success") {
  347. var a = r.data;
  348. $(a).each(function (i, n) {
  349. var strs = '<span class="files" fiel-num="' + n.F_FileId +
  350. '">' + n.F_FileName.substring(19) +
  351. '<i class="fa fa-remove del_file"></i></span>'
  352. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  353. function (event) {
  354. event.stopPropagation();
  355. $(this).parent().remove();
  356. file_num()
  357. })
  358. })
  359. file_num();
  360. }
  361. }
  362. });
  363. } else {
  364. layer.msg("格式不正确");
  365. }
  366. } else {
  367. layer.confirm('请上传文件!', {
  368. btn: ['确定']
  369. });
  370. }
  371. }
  372. //上传文件隐藏域值
  373. function file_num() {
  374. var str = '';
  375. var Str;
  376. $('.fileBox .files').each(function (j, m) {
  377. var aa = $(m).attr("fiel-num")
  378. console.log(aa);
  379. str += aa + ",";
  380. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  381. })
  382. $("#file").val(Str);
  383. }
  384. //来源
  385. function LY(obj) {
  386. obj.empty();
  387. $.ajax({
  388. type: "get",
  389. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  390. dataType: "json",
  391. async: true,
  392. data: {
  393. "token": $.cookie("token"),
  394. id: 1
  395. },
  396. success: function (data) {
  397. if (data.state.toLowerCase() == "success") {
  398. var content = data.data;
  399. $(content).each(function (i, n) {
  400. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  401. .appendTo(obj);
  402. })
  403. }
  404. obj.val("1")
  405. }
  406. });
  407. }
  408. //类别
  409. function LB(obj) {
  410. obj.empty();
  411. $.ajax({
  412. type: "get",
  413. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  414. dataType: "json",
  415. async: true,
  416. data: {
  417. "token": $.cookie("token"),
  418. id: 2
  419. },
  420. success: function (data) {
  421. if (data.state.toLowerCase() == "success") {
  422. var content = data.data;
  423. $(content).each(function (i, n) {
  424. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  425. .appendTo(obj);
  426. })
  427. }
  428. }
  429. });
  430. }
  431. // 主题
  432. function ZT(obj) {
  433. obj.empty();
  434. $.ajax({
  435. type: "get",
  436. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  437. dataType: "json",
  438. async: true,
  439. data: {
  440. "token": $.cookie("token"),
  441. type: 1,
  442. id: 3
  443. },
  444. success: function (data) {
  445. if (data.state.toLowerCase() == "success") {
  446. var content = data.data;
  447. $(content).each(function (i, n) {
  448. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  449. .appendTo(obj);
  450. })
  451. }
  452. }
  453. });
  454. }
  455. //区域
  456. function QY(obj) {
  457. obj.empty();
  458. obj.append('<option selected="selected" value="">请选择</option>');
  459. $.ajax({
  460. type: "get",
  461. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  462. dataType: "json",
  463. async: true,
  464. data: {
  465. "token": $.cookie("token"),
  466. },
  467. success: function (data) {
  468. if (data.state.toLowerCase() == "success") {
  469. var content = data.data;
  470. $(content).each(function (i, n) {
  471. if (n.F_AreaName == "安阳市") {
  472. $("<option selected='selected' value='" + n.F_AreaId + "'>" + n
  473. .F_AreaName + "</option>").appendTo(obj);
  474. } else {
  475. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  476. "</option>").appendTo(obj);
  477. }
  478. })
  479. }
  480. }
  481. });
  482. }
  483. //电话类别
  484. function getPhoneType(obj) {
  485. obj.empty();
  486. $.ajax({
  487. type: "get",
  488. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  489. dataType: "json",
  490. async: true,
  491. data: {
  492. "token": $.cookie("token"),
  493. id: 2498,
  494. },
  495. success: function (data) {
  496. if (data.state.toLowerCase() == "success") {
  497. var content = data.data;
  498. $(content).each(function (i, n) {
  499. $("<option value='" + n.F_Value + "'>" + n.F_Value + "</option>")
  500. .appendTo(obj);
  501. })
  502. }
  503. }
  504. });
  505. }
  506. $("#source").click(function () {
  507. if ($("#source").val() === "4") {
  508. $(".leaderCharge-wrapper").show()
  509. $(".phonetype-wrapper").hide()
  510. } else if ($("#source").val() === "1") {
  511. $(".leaderCharge-wrapper").hide()
  512. $(".phonetype-wrapper").show()
  513. } else {
  514. $(".leaderCharge-wrapper").hide()
  515. $(".phonetype-wrapper").hide()
  516. }
  517. })
  518. function Clean() {
  519. $("#cusname").val(''); //=来电人姓名
  520. $("#cussex").val('');
  521. $("#cusphone").val(''); //=来电人电话
  522. $("#email").val('');
  523. $("#zipcode").val('');
  524. $("#conphone").val('');
  525. $("#title").val('');
  526. $("#content").val('');
  527. $("#sourcearea").val(); //=事发地域id
  528. $('#sourceaddress').val(''); //=事发详细地址
  529. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  530. $("#type option:first").prop("selected", 'selected');
  531. $("#level option:first").prop("selected", 'selected');
  532. $("#keys option:first").prop("selected", 'selected');
  533. $("#sourcearea option:first").prop("selected", 'selected');
  534. $('#result').val('');
  535. $(".inps").val('');
  536. $("#PID").val('');
  537. $("#Dpment").val('');
  538. $(".Cleans").hide();
  539. $('#threeWayCall').attr('checked', false);
  540. }
  541. </script>
  542. </body>
  543. </html>