Нет описания

AddAppeal.html 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  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. <th>自动派单:</th>
  128. <td>
  129. <select class="form-control" id="automaticDispatch">
  130. <option value="">请选择</option>
  131. <option value="1">是</option>
  132. <option value="">否</option>
  133. </select>
  134. </td>
  135. </tr>
  136. <tr class="leaderCharge-wrapper" style="display: none;">
  137. <th class="">分管领导:</th>
  138. <td>
  139. <select class="form-control" id="leaderCharge">
  140. <option value="">请选择</option>
  141. <option value="省长">省长</option>
  142. <option value="市长">市长</option>
  143. </select>
  144. </td>
  145. </tr>
  146. <tr class="phonetype-wrapper">
  147. <th class="">电话类别:</th>
  148. <td>
  149. <select class="form-control" id="phonetype">
  150. <option value="">请选择</option>
  151. </select>
  152. </td>
  153. </tr>
  154. <tr>
  155. <td colspan="8" style="text-align: center;">
  156. <div class="btn_box">
  157. <button class="btns BC">保存</button>
  158. <button class="btns SavedSubmit">保存并提交</button>
  159. </div>
  160. </td>
  161. </tr>
  162. <tr class="Nows_box Hidens">
  163. <th>直办内容:</th>
  164. <td colspan="7">
  165. <textarea id="result" class="form-control" name="" rows="3" cols=""
  166. style="width: 100%;"></textarea>
  167. <!-- <input type="text" style="width: 100%;" id="result" class="form-control" /> -->
  168. </td>
  169. </tr>
  170. <tr>
  171. <th>事发区域:</th>
  172. <td>
  173. <select class="form-control" id="sourcearea" style="display: inline-block;"></select>
  174. </td>
  175. <td colspan="2">
  176. <input id="sourceaddress" class="form-control" type="text" placeholder="输入详细地址"
  177. style="padding-left: 15px;" />
  178. </td>
  179. </tr>
  180. <tr>
  181. <th class="Importent"></th>
  182. <td colspan="7">
  183. <div style="width:710px">
  184. <div id="myMap" style="width:100%;height:400px;"></div>
  185. <input type="hidden" class="store_Lng" value="114.352482" />
  186. <input type="hidden" class="store_Lat" value="36.103442" />
  187. </div>
  188. </td>
  189. </tr>
  190. </table>
  191. </div>
  192. </div>
  193. </div>
  194. <input type="hidden" id="PID" value="" />
  195. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  196. <script src="../css/laydate/laydate.js"></script>
  197. <script src="../js/adjustHeight.js"></script>
  198. <script src="../js/zTree/jquery.ztree.core.js"></script>
  199. <script src="../js/appeal/index1.js"></script>
  200. <script src="../js/ztreeSelect.js"></script>
  201. <script>
  202. var submit;
  203. $(document).ready(function () {
  204. QY($("#sourcearea"));
  205. LY($("#source"));
  206. LB($("#type"));
  207. ZT($("#keys"));
  208. getPhoneType($("#phonetype"));
  209. //当即办理
  210. $(' input[name="banli"]').change(function () {
  211. var val = $(this).val();
  212. if (val == "1") {
  213. $(".Nows_box").show();
  214. } else {
  215. $(".Nows_box").hide();
  216. }
  217. })
  218. $(".BC").click(function () {
  219. submit = 0;
  220. Add();
  221. })
  222. $('.SavedSubmit').click(function () {
  223. submit = 1;
  224. Add();
  225. })
  226. //上传附件
  227. $("#scwj").click(function () {
  228. $("#upFile").trigger("click");
  229. })
  230. $("#upFile").change(function () {
  231. upload();
  232. })
  233. $("#scfj").click(function () {
  234. // $(".fjnr").text("");
  235. // $("#scfj").hide();
  236. })
  237. });
  238. //添加工单
  239. function Add() {
  240. var threeWayCall;
  241. var value = $(' input[name="banli"]:checked ').val();
  242. var content = $("#content").val();
  243. if($('#threeWayCall').is(':checked')) {
  244. threeWayCall = 1;
  245. } else {
  246. threeWayCall = 0;
  247. }
  248. // if (!$("#cusname").val()) {
  249. // layer.msg("请输入姓名");
  250. // } else
  251. if (!$("#cusphone").val()) {
  252. layer.msg("请输入来电号码");
  253. // } else if (!$("#conphone").val()) {
  254. // layer.msg("请输入联系电话");
  255. } else if (!$("#title").val()) {
  256. layer.msg("请输入标题");
  257. } else if (!$("#content").val()) {
  258. layer.msg("请输入内容");
  259. } else if (!$("#PID").val()) {
  260. layer.msg("请选择反映类别");
  261. // } else if (!$("#sourcearea").val()) {
  262. // layer.msg("请选择事发区域");
  263. } else if (value == 1 && !$('#result').val()) {
  264. layer.msg("请输入直办内容");
  265. } else {
  266. $.ajax({
  267. type: "post",
  268. url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
  269. dataType: 'json',
  270. async: true,
  271. beforeSend: function () { //触发ajax请求开始时执行
  272. $('.BC').attr("disabled", true);
  273. $('.SavedSubmit').attr("disabled", true);
  274. $('.BC').text('提交中...');
  275. $('.SavedSubmit').text('提交中...');
  276. $(document).off('click', '.BC', Add);
  277. $(document).off('click', '.SavedSubmit', Add);
  278. },
  279. data: {
  280. cusname: $("#cusname").val(), //=来电人姓名
  281. cussex: $("#cussex").val(),
  282. cusphone: $("#cusphone").val().replace(/\s+/g, ""), //=来电人电话
  283. email: $("#email").val(),
  284. zipcode: $("#zipcode").val(),
  285. conphone: $("#conphone").val(),
  286. title: $("#title").val(),
  287. content: $("#content").val(),
  288. files: $("#file").val(), //(多个用英文逗号,隔开)
  289. sourcearea: $("#sourcearea").val(), //=事发地域id
  290. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  291. longitude: $('.store_Lng').val(),
  292. latitude: $('.store_Lat').val(),
  293. source: $("#source").val(), //=来源
  294. splituser: $("#leaderCharge").val(), // 分管领导
  295. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  296. business: threeWayCall,
  297. result: $('#result').val(),
  298. keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开)
  299. type: $("#type").val(), //=类型
  300. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  301. level: $('#level').val(), //=(1普通2紧急)
  302. issubmit: submit, //=(0保存1保存并提交)
  303. phonetype: $("#source").val() === "1" ? $("#phonetype").val() : "", // 电话类别
  304. ispd: $("#automaticDispatch").val() === "1" ? "1" : "", // 自动派单
  305. token: $.cookie("token")
  306. },
  307. success: function (data) {
  308. $('.BC').attr("disabled", false);
  309. $('.SavedSubmit').attr("disabled", false);
  310. $('.BC').text('保存');
  311. $('.SavedSubmit').text('保存并提交');
  312. $(document).on('click', '.BC', Add);
  313. $(document).on('click', '.SavedSubmit', Add);
  314. Clean();
  315. $('.fileBox').html('');
  316. layer.msg("创建工单成功");
  317. }
  318. });
  319. }
  320. }
  321. //上传文件
  322. function upload() {
  323. var Files = document.getElementById("upFile").files;
  324. console.log(Files);
  325. if (Files.length > 0) {
  326. var formData = new FormData();
  327. for (var i = 0; i < Files.length; i++) {
  328. formData.append('file' + i, Files[i]);
  329. }
  330. formData.append("token", $.cookie("token"));
  331. var typeName = Files[0].name.split('.')[1];
  332. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'avi' || typeName ==
  333. 'wmv' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' ||
  334. typeName == 'xls' || typeName == 'xlsx') {
  335. $.ajax({
  336. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  337. type: "POST",
  338. data: formData,
  339. /**
  340. *必须false才会自动加上正确的Content-Type
  341. */
  342. contentType: false,
  343. /**
  344. * 必须false才会避开jQuery对 formdata 的默认处理
  345. * XMLHttpRequest会对 formdata 进行正确的处理
  346. */
  347. processData: false,
  348. success: function (result) {
  349. document.getElementById("upFile").outerHTML = document.getElementById("upFile")
  350. .outerHTML;
  351. $("#upFile").change(function () {
  352. upload();
  353. });
  354. var r = $.parseJSON(result);
  355. if (r.state.toLowerCase() == "success") {
  356. var a = r.data;
  357. $(a).each(function (i, n) {
  358. var strs = '<span class="files" fiel-num="' + n.F_FileId +
  359. '">' + n.F_FileName.substring(19) +
  360. '<i class="fa fa-remove del_file"></i></span>'
  361. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  362. function (event) {
  363. event.stopPropagation();
  364. $(this).parent().remove();
  365. file_num()
  366. })
  367. })
  368. file_num();
  369. }
  370. }
  371. });
  372. } else {
  373. layer.msg("格式不正确");
  374. }
  375. } else {
  376. layer.confirm('请上传文件!', {
  377. btn: ['确定']
  378. });
  379. }
  380. }
  381. //上传文件隐藏域值
  382. function file_num() {
  383. var str = '';
  384. var Str;
  385. $('.fileBox .files').each(function (j, m) {
  386. var aa = $(m).attr("fiel-num")
  387. console.log(aa);
  388. str += aa + ",";
  389. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  390. })
  391. $("#file").val(Str);
  392. }
  393. //来源
  394. function LY(obj) {
  395. obj.empty();
  396. $.ajax({
  397. type: "get",
  398. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  399. dataType: "json",
  400. async: true,
  401. data: {
  402. "token": $.cookie("token"),
  403. id: 1
  404. },
  405. success: function (data) {
  406. if (data.state.toLowerCase() == "success") {
  407. var content = data.data;
  408. $(content).each(function (i, n) {
  409. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  410. .appendTo(obj);
  411. })
  412. }
  413. obj.val("1")
  414. }
  415. });
  416. }
  417. //类别
  418. function LB(obj) {
  419. obj.empty();
  420. $.ajax({
  421. type: "get",
  422. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  423. dataType: "json",
  424. async: true,
  425. data: {
  426. "token": $.cookie("token"),
  427. id: 2
  428. },
  429. success: function (data) {
  430. if (data.state.toLowerCase() == "success") {
  431. var content = data.data;
  432. $(content).each(function (i, n) {
  433. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  434. .appendTo(obj);
  435. })
  436. }
  437. }
  438. });
  439. }
  440. // 主题
  441. function ZT(obj) {
  442. obj.empty();
  443. $.ajax({
  444. type: "get",
  445. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  446. dataType: "json",
  447. async: true,
  448. data: {
  449. "token": $.cookie("token"),
  450. type: 1,
  451. id: 3
  452. },
  453. success: function (data) {
  454. if (data.state.toLowerCase() == "success") {
  455. var content = data.data;
  456. $(content).each(function (i, n) {
  457. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  458. .appendTo(obj);
  459. })
  460. }
  461. }
  462. });
  463. }
  464. //区域
  465. function QY(obj) {
  466. obj.empty();
  467. obj.append('<option selected="selected" value="">请选择</option>');
  468. $.ajax({
  469. type: "get",
  470. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  471. dataType: "json",
  472. async: true,
  473. data: {
  474. "token": $.cookie("token"),
  475. },
  476. success: function (data) {
  477. if (data.state.toLowerCase() == "success") {
  478. var content = data.data;
  479. $(content).each(function (i, n) {
  480. if (n.F_AreaName == "安阳市") {
  481. $("<option selected='selected' value='" + n.F_AreaId + "'>" + n
  482. .F_AreaName + "</option>").appendTo(obj);
  483. } else {
  484. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  485. "</option>").appendTo(obj);
  486. }
  487. })
  488. }
  489. }
  490. });
  491. }
  492. //电话类别
  493. function getPhoneType(obj) {
  494. obj.empty();
  495. $.ajax({
  496. type: "get",
  497. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  498. dataType: "json",
  499. async: true,
  500. data: {
  501. "token": $.cookie("token"),
  502. id: 2498,
  503. },
  504. success: function (data) {
  505. if (data.state.toLowerCase() == "success") {
  506. var content = data.data;
  507. $(content).each(function (i, n) {
  508. $("<option value='" + n.F_Value + "'>" + n.F_Value + "</option>")
  509. .appendTo(obj);
  510. })
  511. }
  512. }
  513. });
  514. }
  515. $("#source").click(function () {
  516. if ($("#source").val() === "4") {
  517. $(".leaderCharge-wrapper").show()
  518. $(".phonetype-wrapper").hide()
  519. } else if ($("#source").val() === "1") {
  520. $(".leaderCharge-wrapper").hide()
  521. $(".phonetype-wrapper").show()
  522. } else {
  523. $(".leaderCharge-wrapper").hide()
  524. $(".phonetype-wrapper").hide()
  525. }
  526. })
  527. function Clean() {
  528. $("#cusname").val(''); //=来电人姓名
  529. $("#cussex").val('');
  530. $("#cusphone").val(''); //=来电人电话
  531. $("#email").val('');
  532. $("#zipcode").val('');
  533. $("#conphone").val('');
  534. $("#title").val('');
  535. $("#content").val('');
  536. $("#sourcearea").val(); //=事发地域id
  537. $('#sourceaddress').val(''); //=事发详细地址
  538. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  539. $("#type option:first").prop("selected", 'selected');
  540. $("#level option:first").prop("selected", 'selected');
  541. $("#keys option:first").prop("selected", 'selected');
  542. $("#sourcearea option:first").prop("selected", 'selected');
  543. $('#result').val('');
  544. $(".inps").val('');
  545. $("#PID").val('');
  546. $("#Dpment").val('');
  547. $(".Cleans").hide();
  548. $('#threeWayCall').attr('checked', false);
  549. }
  550. </script>
  551. </body>
  552. </html>