Нет описания

AddAppeal.html 27KB

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