説明なし

AddAppeal.html 32KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  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. <link rel="stylesheet" href="../js/layui/css/layui.css">
  12. <title>新增诉求工单</title>
  13. <style>
  14. .reflectCategory-wrapper {
  15. position: relative;
  16. }
  17. .reflectCategoryList-wrapper {
  18. display: none;
  19. position: absolute;
  20. top: 38px;
  21. z-index: 9999;
  22. line-height: 32px;
  23. background: #FFF;
  24. }
  25. #reflectCategoryList {
  26. height: 240px;
  27. background: #FFF;
  28. border: 1px solid #e5e6e7;
  29. overflow: auto;
  30. }
  31. #reflectCategoryList li {
  32. padding: 0 10px;
  33. width: 100%;
  34. line-height: 32px;
  35. }
  36. #reflectCategoryList li:hover {
  37. background: #00a1cb;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <div class="wrapper wrapper-content animated fadeInRight">
  43. <div class="daoHang clearfix">
  44. <div class="dhLeft">
  45. <sapn>
  46. <i class="syIcon"></i>位置:
  47. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  48. <a href="javaScript:;">工单处理</a>&gt;
  49. <a href="" class="nowPosition">添加工单</a>
  50. </sapn>
  51. </div>
  52. <div class="dhRight">
  53. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  54. </div>
  55. </div>
  56. <div style="padding: 10px;" class="tj_content clearFix">
  57. <div class="Common">
  58. <table>
  59. <tr>
  60. <th class="Importent">标题:</th>
  61. <td colspan="7">
  62. <input id="title" class="form-control" type="text" style="width: 50%;" />
  63. </td>
  64. </tr>
  65. <tr>
  66. <th class="Importent">内容:</th>
  67. <td colspan="7">
  68. <textarea id="content" class="form-control" name="" rows="4" cols=""
  69. style="width: 100%;"></textarea>
  70. </td>
  71. </tr>
  72. <tr>
  73. <th>附件上传:</th>
  74. <td colspan="7">
  75. <div class="fileBox"></div>
  76. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple"
  77. style="display: none;">
  78. <input class="input" type="button" value="上传" id="scwj" />
  79. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  80. <input type="hidden" id="file" />
  81. <!--</br>-->
  82. <span style="color:#FF0000; border: none;">
  83. (文件格式为png,jpg,mp4,avi,wmv,mp3,pdf,doc,docx,xls,xlsx)
  84. </span>
  85. </td>
  86. </tr>
  87. <tr>
  88. <th>处理方式:</th>
  89. <td colspan="">
  90. <input type="radio" value="1" name="banli" class="Nows_ radioStyle" />当即办理
  91. <input checked="true" type="radio" value="0" name="banli" class="Nows_ radioStyle" />网络转办
  92. <input id="threeWayCall" type="checkbox" value="1" name="" class="Nows_ radioStyle" />三方通话
  93. </td>
  94. <th>来电号码密级:</th>
  95. <td>
  96. <input class="radioStyle" type="radio" name="mj" id="" value="0" />普通
  97. <input class="radioStyle" type="radio" name="mj" id="" value="1" checked="checked" />保密
  98. </td>
  99. </tr>
  100. <tr>
  101. </tr>
  102. <tr>
  103. <th class="">来电人:</th>
  104. <td>
  105. <input type="text" id="cusname" class="form-control" />
  106. </td>
  107. <th>性别:</th>
  108. <td>
  109. <select class="form-control" id="cussex">
  110. <option value="">请选择</option>
  111. <option value="0">男</option>
  112. <option value="1">女</option>
  113. </select>
  114. </td>
  115. <th class="Importent">来电号码:</th>
  116. <td>
  117. <input type="text" id="cusphone" class="form-control" />
  118. </td>
  119. </tr>
  120. <tr>
  121. <th>类型:</th>
  122. <td>
  123. <select class="form-control" id="type"></select>
  124. </td>
  125. <th class="Importent">反映类别:</th>
  126. <td class="reflectCategory-wrapper">
  127. <input type="text" id="reflectCategory" class="form-control" autocomplete="off" />
  128. <div class="reflectCategoryList-wrapper">
  129. <ul id="reflectCategoryList">
  130. </ul>
  131. </div>
  132. </td>
  133. <!-- <th class="Importent">反映类别:</th>
  134. <td style="position: relative">
  135. <div class="inpBox">
  136. <input type="text" class="inps" />
  137. <i class="Cleans fa fa-close"></i>
  138. <i class="xl xl_one"></i>
  139. <div class="addTree xlAdd">
  140. <ul id="addTreeDemo" class="ztree"></ul>
  141. </div>
  142. </div>
  143. <div class="selDpart1">
  144. <ul id="sponsor"></ul>
  145. </div>
  146. </td> -->
  147. <th class="Importent">紧急程度:</th>
  148. <td>
  149. <select class="form-control" id="level">
  150. <!--<option value="0">选择</option>-->
  151. <option value="1">普通</option>
  152. <option value="2">紧急</option>
  153. </select>
  154. </td>
  155. </tr>
  156. <tr>
  157. <th>来源:</th>
  158. <td>
  159. <select class="form-control" id="source"></select>
  160. </td>
  161. <th>自动派单:</th>
  162. <td>
  163. <select class="form-control" id="automaticDispatch">
  164. <option value="">请选择</option>
  165. <option value="1">是</option>
  166. <option value="">否</option>
  167. </select>
  168. </td>
  169. <th>回访方式:</th>
  170. <td>
  171. <select class="form-control" id="visittype">
  172. <option value="0">正常回访</option>
  173. <option value="1">无需回访</option>
  174. </select>
  175. </td>
  176. </tr>
  177. <!-- <tr>
  178. <th class="">工单平台:</th>
  179. <td>
  180. <select class="form-control" id="pingtai">
  181. <option value="">请选择</option>
  182. <option value="0">市工单</option>
  183. <option value="1">省工单</option>
  184. </select>
  185. </td>
  186. </tr> -->
  187. <tr class="leaderCharge-wrapper" style="display: none;">
  188. <th class="">分管领导:</th>
  189. <td>
  190. <select class="form-control" id="leaderCharge">
  191. <option value="">请选择</option>
  192. <option value="省长">省长</option>
  193. <option value="市长">市长</option>
  194. </select>
  195. </td>
  196. </tr>
  197. <tr class="phonetype-wrapper">
  198. <th class="">电话类别:</th>
  199. <td>
  200. <select class="form-control" id="phonetype">
  201. <option value="">请选择</option>
  202. </select>
  203. </td>
  204. </tr>
  205. <tr>
  206. <td colspan="8" style="text-align: center;">
  207. <div class="btn_box">
  208. <button class="btns BC">保存</button>
  209. <button class="btns SavedSubmit">保存并提交</button>
  210. </div>
  211. </td>
  212. </tr>
  213. <tr class="Nows_box Hidens">
  214. <th>直办内容:</th>
  215. <td colspan="7">
  216. <textarea id="result" class="form-control" name="" rows="3" cols=""
  217. style="width: 100%;"></textarea>
  218. <!-- <input type="text" style="width: 100%;" id="result" class="form-control" /> -->
  219. </td>
  220. </tr>
  221. <tr>
  222. <th>事发区域:</th>
  223. <td>
  224. <select class="form-control" id="sourcearea"></select>
  225. </td>
  226. <th>乡镇:</th>
  227. <td>
  228. <select class="form-control" id="township"></select>
  229. </td>
  230. <th>村:</th>
  231. <td>
  232. <select class="form-control" id="village"></select>
  233. </td>
  234. </tr>
  235. <tr>
  236. <th>详细地址:</th>
  237. <td colspan="3">
  238. <input id="sourceaddress" class="form-control" type="text" placeholder="输入详细地址"
  239. style="padding-left: 15px;" />
  240. </td>
  241. </tr>
  242. <tr>
  243. <th class="Importent"></th>
  244. <td colspan="7">
  245. <div style="width:710px">
  246. <div id="myMap" style="width:100%;height:400px;"></div>
  247. <input type="hidden" class="store_Lng" value="114.352482" />
  248. <input type="hidden" class="store_Lat" value="36.103442" />
  249. </div>
  250. </td>
  251. </tr>
  252. </table>
  253. </div>
  254. </div>
  255. </div>
  256. <input type="hidden" id="PID" value="" />
  257. <script src="../js/layui/layui.js"></script>
  258. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  259. <script src="../css/laydate/laydate.js"></script>
  260. <script src="../js/adjustHeight.js"></script>
  261. <script src="../js/zTree/jquery.ztree.core.js"></script>
  262. <script src="../js/appeal/index1.js"></script>
  263. <script src="../js/ztreeSelect.js"></script>
  264. <script>
  265. var submit;
  266. $(document).ready(function () {
  267. QY($("#sourcearea"));
  268. // 获取乡镇,默认文峰区
  269. getTownshipVillage($("#township"), 4965);
  270. LY($("#source"));
  271. LB($("#type"));
  272. ZT($("#keys"));
  273. getPhoneType($("#phonetype"));
  274. getReactionCategory();
  275. //当即办理
  276. $(' input[name="banli"]').change(function () {
  277. var val = $(this).val();
  278. if (val == "1") {
  279. $(".Nows_box").show();
  280. } else {
  281. $(".Nows_box").hide();
  282. }
  283. })
  284. $(".BC").click(function () {
  285. submit = 0;
  286. Add();
  287. })
  288. $('.SavedSubmit').click(function () {
  289. submit = 1;
  290. Add();
  291. })
  292. //上传附件
  293. $("#scwj").click(function () {
  294. $("#upFile").trigger("click");
  295. })
  296. $("#upFile").change(function () {
  297. upload();
  298. })
  299. $("#scfj").click(function () {
  300. // $(".fjnr").text("");
  301. // $("#scfj").hide();
  302. })
  303. $("#reflectCategory").bind("input propertychange", function () {
  304. $(".layui-dropdown").hide();
  305. if ($("#reflectCategory").val() == "") {
  306. $(".reflectCategoryList-wrapper").hide();
  307. return;
  308. }
  309. var debounceGetSearchReactionCategory = debounce(getSearchReactionCategory, 500)
  310. $(".reflectCategoryList-wrapper").show();
  311. debounceGetSearchReactionCategory($("#reflectCategory").val())
  312. })
  313. $("#reflectCategoryList").on("click", "li", function () {
  314. $(".reflectCategoryList-wrapper").hide();
  315. $("#reflectCategory").val($(this).attr("indexName"));
  316. $("#PID").val($(this).attr("index"));
  317. });
  318. });
  319. //添加工单
  320. function Add() {
  321. var threeWayCall;
  322. var value = $(' input[name="banli"]:checked ').val();
  323. var content = $("#content").val();
  324. if ($('#threeWayCall').is(':checked')) {
  325. threeWayCall = 1;
  326. } else {
  327. threeWayCall = 0;
  328. }
  329. if (!$("#cusphone").val()) {
  330. layer.msg("请输入来电号码");
  331. } else if (!$("#title").val()) {
  332. layer.msg("请输入标题");
  333. } else if (!$("#content").val()) {
  334. layer.msg("请输入内容");
  335. } else if (!$("#PID").val()) {
  336. layer.msg("请选择反映类别");
  337. // } else if (!$("#sourcearea").val()) {
  338. // layer.msg("请选择事发区域");
  339. } else if (value == 1 && !$('#result').val()) {
  340. layer.msg("请输入直办内容");
  341. // } else if (!$("#township").val()) {
  342. // layer.msg("请选择乡镇");
  343. // } else if (!$("#village").val()) {
  344. // layer.msg("请选择村");
  345. } else {
  346. $.ajax({
  347. type: "post",
  348. url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
  349. dataType: 'json',
  350. async: true,
  351. beforeSend: function () { //触发ajax请求开始时执行
  352. $('.BC').attr("disabled", true);
  353. $('.SavedSubmit').attr("disabled", true);
  354. $('.BC').text('提交中...');
  355. $('.SavedSubmit').text('提交中...');
  356. $(document).off('click', '.BC', Add);
  357. $(document).off('click', '.SavedSubmit', Add);
  358. },
  359. data: {
  360. cusname: $("#cusname").val(), //=来电人姓名
  361. cussex: $("#cussex").val(),
  362. cusphone: $("#cusphone").val().replace(/\s+/g, ""), //=来电人电话
  363. email: $("#email").val(),
  364. zipcode: $("#zipcode").val(),
  365. conphone: $("#conphone").val(),
  366. title: $("#title").val(),
  367. content: $("#content").val(),
  368. files: $("#file").val(), //(多个用英文逗号,隔开)
  369. sourcearea: $("#sourcearea").val(), //=事发地域id
  370. township: $("#township").val(), // 乡镇
  371. village: $("#village").val(), // 村
  372. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  373. longitude: $('.store_Lng').val(),
  374. latitude: $('.store_Lat').val(),
  375. source: $("#source").val(), //=来源
  376. splituser: $("#leaderCharge").val(), // 分管领导
  377. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  378. business: threeWayCall,
  379. result: $('#result').val(),
  380. keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开)
  381. type: $("#type").val(), //=类型
  382. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  383. level: $('#level').val(), //=(1普通2紧急)
  384. visittype: $("#visittype").val(), // 回访方式
  385. issubmit: submit, //=(0保存1保存并提交)
  386. phonetype: $("#source").val() === "1" ? $("#phonetype").val() : "", // 电话类别
  387. ispd: $("#automaticDispatch").val() === "1" ? "1" : "", // 自动派单
  388. // pingtai: $("#pingtai").val(), // 工单平台
  389. token: $.cookie("token")
  390. },
  391. success: function (data) {
  392. $('.BC').attr("disabled", false);
  393. $('.SavedSubmit').attr("disabled", false);
  394. $('.BC').text('保存');
  395. $('.SavedSubmit').text('保存并提交');
  396. $(document).on('click', '.BC', Add);
  397. $(document).on('click', '.SavedSubmit', Add);
  398. Clean();
  399. $('.fileBox').html('');
  400. layer.msg("创建工单成功");
  401. }
  402. });
  403. }
  404. }
  405. //上传文件
  406. function upload() {
  407. var Files = document.getElementById("upFile").files;
  408. console.log(Files);
  409. if (Files.length > 0) {
  410. var formData = new FormData();
  411. for (var i = 0; i < Files.length; i++) {
  412. formData.append('file' + i, Files[i]);
  413. }
  414. formData.append("token", $.cookie("token"));
  415. var typeName = Files[0].name.split('.')[1];
  416. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'avi' || typeName ==
  417. 'wmv' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' ||
  418. typeName == 'xls' || typeName == 'xlsx') {
  419. $.ajax({
  420. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  421. type: "POST",
  422. data: formData,
  423. /**
  424. *必须false才会自动加上正确的Content-Type
  425. */
  426. contentType: false,
  427. /**
  428. * 必须false才会避开jQuery对 formdata 的默认处理
  429. * XMLHttpRequest会对 formdata 进行正确的处理
  430. */
  431. processData: false,
  432. success: function (result) {
  433. document.getElementById("upFile").outerHTML = document.getElementById("upFile")
  434. .outerHTML;
  435. $("#upFile").change(function () {
  436. upload();
  437. });
  438. var r = $.parseJSON(result);
  439. if (r.state.toLowerCase() == "success") {
  440. var a = r.data;
  441. $(a).each(function (i, n) {
  442. var strs = '<span class="files" fiel-num="' + n.F_FileId +
  443. '">' + n.F_FileName.substring(19) +
  444. '<i class="fa fa-remove del_file"></i></span>'
  445. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  446. function (event) {
  447. event.stopPropagation();
  448. $(this).parent().remove();
  449. file_num()
  450. })
  451. })
  452. file_num();
  453. }
  454. }
  455. });
  456. } else {
  457. layer.msg("格式不正确");
  458. }
  459. } else {
  460. layer.confirm('请上传文件!', {
  461. btn: ['确定']
  462. });
  463. }
  464. }
  465. //上传文件隐藏域值
  466. function file_num() {
  467. var str = '';
  468. var Str;
  469. $('.fileBox .files').each(function (j, m) {
  470. var aa = $(m).attr("fiel-num")
  471. console.log(aa);
  472. str += aa + ",";
  473. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  474. })
  475. $("#file").val(Str);
  476. }
  477. //来源
  478. function LY(obj) {
  479. obj.empty();
  480. $.ajax({
  481. type: "get",
  482. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  483. dataType: "json",
  484. async: true,
  485. data: {
  486. "token": $.cookie("token"),
  487. id: 1
  488. },
  489. success: function (data) {
  490. if (data.state.toLowerCase() == "success") {
  491. var content = data.data;
  492. $(content).each(function (i, n) {
  493. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  494. .appendTo(obj);
  495. })
  496. }
  497. obj.val("1")
  498. }
  499. });
  500. }
  501. //类别
  502. function LB(obj) {
  503. obj.empty();
  504. $.ajax({
  505. type: "get",
  506. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  507. dataType: "json",
  508. async: true,
  509. data: {
  510. "token": $.cookie("token"),
  511. id: 2
  512. },
  513. success: function (data) {
  514. if (data.state.toLowerCase() == "success") {
  515. var content = data.data;
  516. $(content).each(function (i, n) {
  517. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  518. .appendTo(obj);
  519. })
  520. }
  521. }
  522. });
  523. }
  524. // 主题
  525. function ZT(obj) {
  526. obj.empty();
  527. $.ajax({
  528. type: "get",
  529. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  530. dataType: "json",
  531. async: true,
  532. data: {
  533. "token": $.cookie("token"),
  534. type: 1,
  535. id: 3
  536. },
  537. success: function (data) {
  538. if (data.state.toLowerCase() == "success") {
  539. var content = data.data;
  540. $(content).each(function (i, n) {
  541. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  542. .appendTo(obj);
  543. })
  544. }
  545. }
  546. });
  547. }
  548. //区域
  549. function QY(obj) {
  550. obj.empty();
  551. obj.append('<option selected="selected" value="">请选择</option>');
  552. $.ajax({
  553. type: "get",
  554. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  555. dataType: "json",
  556. async: true,
  557. data: {
  558. "token": $.cookie("token"),
  559. },
  560. success: function (data) {
  561. if (data.state.toLowerCase() == "success") {
  562. var content = data.data;
  563. $(content).each(function (i, n) {
  564. if (n.F_AreaName !== "市区") {
  565. if (n.F_AreaName === "文峰区") {
  566. $("<option value='" + n.F_AreaId + "' selected='selected'>" + n
  567. .F_AreaName + "</option>").appendTo(obj);
  568. } else {
  569. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  570. "</option>").appendTo(obj);
  571. }
  572. }
  573. })
  574. }
  575. }
  576. });
  577. }
  578. //获取乡镇、村
  579. function getTownshipVillage(obj, parentid) {
  580. obj.empty();
  581. obj.append('<option selected="selected" value="">请选择</option>');
  582. $.getJSON(
  583. huayi.config.callcenter_url + "Area/GetAreaChildren", {
  584. token: $.cookie("token"),
  585. parentid: parentid
  586. },
  587. function (data) {
  588. if (data.state.toLowerCase() == "success") {
  589. var content = data.data;
  590. $(content).each(function (i, n) {
  591. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(
  592. obj);
  593. });
  594. }
  595. }
  596. );
  597. }
  598. // 获取乡镇
  599. $("#sourcearea").change(function () {
  600. getTownshipVillage($("#township"), $("#sourcearea").val())
  601. })
  602. // 获取村
  603. $("#township").change(function () {
  604. getTownshipVillage($("#village"), $("#township").val())
  605. })
  606. //电话类别
  607. function getPhoneType(obj) {
  608. obj.empty();
  609. $.ajax({
  610. type: "get",
  611. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  612. dataType: "json",
  613. async: true,
  614. data: {
  615. "token": $.cookie("token"),
  616. id: 2498,
  617. },
  618. success: function (data) {
  619. if (data.state.toLowerCase() == "success") {
  620. var content = data.data;
  621. $(content).each(function (i, n) {
  622. $("<option value='" + n.F_Value + "'>" + n.F_Remark + "</option>")
  623. .appendTo(obj);
  624. })
  625. }
  626. }
  627. });
  628. }
  629. $("#source").change(function () {
  630. if ($("#source").val() === "4") {
  631. $(".leaderCharge-wrapper").show()
  632. $(".phonetype-wrapper").hide()
  633. } else if ($("#source").val() === "1") {
  634. $(".leaderCharge-wrapper").hide()
  635. $(".phonetype-wrapper").show()
  636. } else {
  637. $(".leaderCharge-wrapper").hide()
  638. $(".phonetype-wrapper").hide()
  639. }
  640. })
  641. function Clean() {
  642. $("#cusname").val(''); //=来电人姓名
  643. $("#cussex").val('');
  644. $("#cusphone").val(''); //=来电人电话
  645. $("#email").val('');
  646. $("#zipcode").val('');
  647. $("#conphone").val('');
  648. $("#title").val('');
  649. $("#content").val('');
  650. $("#sourcearea").val(); //=事发地域id
  651. $("#township").val(); // 乡镇
  652. $("#village").val(); // 村
  653. $('#sourceaddress').val(''); //=事发详细地址
  654. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  655. $("#type option:first").prop("selected", 'selected');
  656. $("#level option:first").prop("selected", 'selected');
  657. $("#visittype option:first").prop("selected", "selected");
  658. $("#keys option:first").prop("selected", 'selected');
  659. $('#result').val('');
  660. $(".inps").val('');
  661. $("#PID").val('');
  662. $("#reflectCategory").val("");
  663. $(".Cleans").hide();
  664. $('#threeWayCall').attr('checked', false);
  665. $("#file").val('');
  666. }
  667. function getReactionCategory(pid = 38) {
  668. $.get(
  669. huayi.config.callcenter_url + "Dictionary/GetZTreeNew", {
  670. token: $.cookie("token"),
  671. pid: pid,
  672. // pid: 2460,
  673. },
  674. function (result) {
  675. result = $.parseJSON(result);
  676. var content = JSON.parse(result.data);
  677. var content = result
  678. layui.use("dropdown", function () {
  679. var dropdown = layui.dropdown;
  680. dropdown.render({
  681. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  682. data: content,
  683. id: "reflectCategory",
  684. //菜单被点击的事件
  685. click: function (obj) {
  686. $("#reflectCategory").val(obj.title)
  687. $("#PID").val(obj.id)
  688. },
  689. });
  690. });
  691. }
  692. );
  693. }
  694. function getSearchReactionCategory(key) {
  695. $.get(
  696. huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
  697. token: $.cookie("token"),
  698. key: key,
  699. },
  700. function (result) {
  701. result = $.parseJSON(result);
  702. if (result.state.toLowerCase() === "success") {
  703. $("#reflectCategoryList").empty();
  704. var content = result.data;
  705. if (content.length > 0) {
  706. content.forEach(function (e, i) {
  707. $("<li index='" + e.id + "' indexName='" + e.name + "'>" + e.names +
  708. "</li>")
  709. .appendTo("#reflectCategoryList");
  710. });
  711. } else {
  712. $("<li index='' indexName=''>没有相关数据</li>").appendTo("#reflectCategoryList");
  713. }
  714. }
  715. }
  716. );
  717. }
  718. function debounce(fun, delay) {
  719. return function (args) {
  720. var that = this;
  721. var _args = args
  722. clearTimeout(fun.id)
  723. fun.id = setTimeout(function () {
  724. fun.call(that, _args)
  725. }, delay)
  726. }
  727. }
  728. </script>
  729. </body>
  730. </html>