Нет описания

AddAppeal.html 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  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" onkeyup="darptSearch()" />
  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 class="leaderCharge-wrapper" style="display: none;">
  178. <th class="">分管领导:</th>
  179. <td>
  180. <select class="form-control" id="leaderCharge">
  181. <option value="">请选择</option>
  182. <option value="省长">省长</option>
  183. <option value="市长">市长</option>
  184. </select>
  185. </td>
  186. </tr>
  187. <tr class="phonetype-wrapper">
  188. <th class="">电话类别:</th>
  189. <td>
  190. <select class="form-control" id="phonetype">
  191. <option value="">请选择</option>
  192. </select>
  193. </td>
  194. </tr>
  195. <tr>
  196. <td colspan="8" style="text-align: center;">
  197. <div class="btn_box">
  198. <button class="btns BC">保存</button>
  199. <button class="btns SavedSubmit">保存并提交</button>
  200. </div>
  201. </td>
  202. </tr>
  203. <tr class="Nows_box Hidens">
  204. <th>直办内容:</th>
  205. <td colspan="7">
  206. <textarea id="result" class="form-control" name="" rows="3" cols=""
  207. style="width: 100%;"></textarea>
  208. <!-- <input type="text" style="width: 100%;" id="result" class="form-control" /> -->
  209. </td>
  210. </tr>
  211. <tr>
  212. <th>事发区域:</th>
  213. <td>
  214. <select class="form-control" id="sourcearea" style="display: inline-block;"></select>
  215. </td>
  216. <td colspan="2">
  217. <input id="sourceaddress" class="form-control" type="text" placeholder="输入详细地址"
  218. style="padding-left: 15px;" />
  219. </td>
  220. </tr>
  221. <tr>
  222. <th class="Importent"></th>
  223. <td colspan="7">
  224. <div style="width:710px">
  225. <div id="myMap" style="width:100%;height:400px;"></div>
  226. <input type="hidden" class="store_Lng" value="114.352482" />
  227. <input type="hidden" class="store_Lat" value="36.103442" />
  228. </div>
  229. </td>
  230. </tr>
  231. </table>
  232. </div>
  233. </div>
  234. </div>
  235. <input type="hidden" id="PID" value="" />
  236. <script src="../js/layui/layui.js"></script>
  237. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  238. <script src="../css/laydate/laydate.js"></script>
  239. <script src="../js/adjustHeight.js"></script>
  240. <script src="../js/zTree/jquery.ztree.core.js"></script>
  241. <script src="../js/appeal/index1.js"></script>
  242. <script src="../js/ztreeSelect.js"></script>
  243. <script>
  244. var submit;
  245. $(document).ready(function () {
  246. QY($("#sourcearea"));
  247. LY($("#source"));
  248. LB($("#type"));
  249. ZT($("#keys"));
  250. getPhoneType($("#phonetype"));
  251. getReactionCategory();
  252. //当即办理
  253. $(' input[name="banli"]').change(function () {
  254. var val = $(this).val();
  255. if (val == "1") {
  256. $(".Nows_box").show();
  257. } else {
  258. $(".Nows_box").hide();
  259. }
  260. })
  261. $(".BC").click(function () {
  262. submit = 0;
  263. Add();
  264. })
  265. $('.SavedSubmit').click(function () {
  266. submit = 1;
  267. Add();
  268. })
  269. //上传附件
  270. $("#scwj").click(function () {
  271. $("#upFile").trigger("click");
  272. })
  273. $("#upFile").change(function () {
  274. upload();
  275. })
  276. $("#scfj").click(function () {
  277. // $(".fjnr").text("");
  278. // $("#scfj").hide();
  279. })
  280. $("#reflectCategory").bind("input propertychange", function () {
  281. $(".layui-dropdown").hide();
  282. if ($("#reflectCategory").val() == "") {
  283. $(".reflectCategoryList-wrapper").hide();
  284. return;
  285. }
  286. var debounceGetSearchReactionCategory = debounce(getSearchReactionCategory, 500)
  287. $(".reflectCategoryList-wrapper").show();
  288. debounceGetSearchReactionCategory($("#reflectCategory").val())
  289. })
  290. $("#reflectCategoryList").on("click", "li", function () {
  291. $(".reflectCategoryList-wrapper").hide();
  292. $("#reflectCategory").val($(this).attr("indexName"));
  293. $("#PID").val($(this).attr("index"));
  294. });
  295. });
  296. //添加工单
  297. function Add() {
  298. var threeWayCall;
  299. var value = $(' input[name="banli"]:checked ').val();
  300. var content = $("#content").val();
  301. if ($('#threeWayCall').is(':checked')) {
  302. threeWayCall = 1;
  303. } else {
  304. threeWayCall = 0;
  305. }
  306. if (!$("#cusphone").val()) {
  307. layer.msg("请输入来电号码");
  308. } else if (!$("#title").val()) {
  309. layer.msg("请输入标题");
  310. } else if (!$("#content").val()) {
  311. layer.msg("请输入内容");
  312. } else if (!$("#PID").val()) {
  313. layer.msg("请选择反映类别");
  314. // } else if (!$("#sourcearea").val()) {
  315. // layer.msg("请选择事发区域");
  316. } else if (value == 1 && !$('#result').val()) {
  317. layer.msg("请输入直办内容");
  318. } else {
  319. $.ajax({
  320. type: "post",
  321. url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
  322. dataType: 'json',
  323. async: true,
  324. beforeSend: function () { //触发ajax请求开始时执行
  325. $('.BC').attr("disabled", true);
  326. $('.SavedSubmit').attr("disabled", true);
  327. $('.BC').text('提交中...');
  328. $('.SavedSubmit').text('提交中...');
  329. $(document).off('click', '.BC', Add);
  330. $(document).off('click', '.SavedSubmit', Add);
  331. },
  332. data: {
  333. cusname: $("#cusname").val(), //=来电人姓名
  334. cussex: $("#cussex").val(),
  335. cusphone: $("#cusphone").val().replace(/\s+/g, ""), //=来电人电话
  336. email: $("#email").val(),
  337. zipcode: $("#zipcode").val(),
  338. conphone: $("#conphone").val(),
  339. title: $("#title").val(),
  340. content: $("#content").val(),
  341. files: $("#file").val(), //(多个用英文逗号,隔开)
  342. sourcearea: $("#sourcearea").val(), //=事发地域id
  343. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  344. longitude: $('.store_Lng').val(),
  345. latitude: $('.store_Lat').val(),
  346. source: $("#source").val(), //=来源
  347. splituser: $("#leaderCharge").val(), // 分管领导
  348. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  349. business: threeWayCall,
  350. result: $('#result').val(),
  351. keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开)
  352. type: $("#type").val(), //=类型
  353. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  354. level: $('#level').val(), //=(1普通2紧急)
  355. visittype: $("#visittype").val(), // 回访方式
  356. issubmit: submit, //=(0保存1保存并提交)
  357. phonetype: $("#source").val() === "1" ? $("#phonetype").val() : "", // 电话类别
  358. ispd: $("#automaticDispatch").val() === "1" ? "1" : "", // 自动派单
  359. token: $.cookie("token")
  360. },
  361. success: function (data) {
  362. $('.BC').attr("disabled", false);
  363. $('.SavedSubmit').attr("disabled", false);
  364. $('.BC').text('保存');
  365. $('.SavedSubmit').text('保存并提交');
  366. $(document).on('click', '.BC', Add);
  367. $(document).on('click', '.SavedSubmit', Add);
  368. Clean();
  369. $('.fileBox').html('');
  370. layer.msg("创建工单成功");
  371. }
  372. });
  373. }
  374. }
  375. //上传文件
  376. function upload() {
  377. var Files = document.getElementById("upFile").files;
  378. console.log(Files);
  379. if (Files.length > 0) {
  380. var formData = new FormData();
  381. for (var i = 0; i < Files.length; i++) {
  382. formData.append('file' + i, Files[i]);
  383. }
  384. formData.append("token", $.cookie("token"));
  385. var typeName = Files[0].name.split('.')[1];
  386. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'avi' || typeName ==
  387. 'wmv' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' ||
  388. typeName == 'xls' || typeName == 'xlsx') {
  389. $.ajax({
  390. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  391. type: "POST",
  392. data: formData,
  393. /**
  394. *必须false才会自动加上正确的Content-Type
  395. */
  396. contentType: false,
  397. /**
  398. * 必须false才会避开jQuery对 formdata 的默认处理
  399. * XMLHttpRequest会对 formdata 进行正确的处理
  400. */
  401. processData: false,
  402. success: function (result) {
  403. document.getElementById("upFile").outerHTML = document.getElementById("upFile")
  404. .outerHTML;
  405. $("#upFile").change(function () {
  406. upload();
  407. });
  408. var r = $.parseJSON(result);
  409. if (r.state.toLowerCase() == "success") {
  410. var a = r.data;
  411. $(a).each(function (i, n) {
  412. var strs = '<span class="files" fiel-num="' + n.F_FileId +
  413. '">' + n.F_FileName.substring(19) +
  414. '<i class="fa fa-remove del_file"></i></span>'
  415. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  416. function (event) {
  417. event.stopPropagation();
  418. $(this).parent().remove();
  419. file_num()
  420. })
  421. })
  422. file_num();
  423. }
  424. }
  425. });
  426. } else {
  427. layer.msg("格式不正确");
  428. }
  429. } else {
  430. layer.confirm('请上传文件!', {
  431. btn: ['确定']
  432. });
  433. }
  434. }
  435. //上传文件隐藏域值
  436. function file_num() {
  437. var str = '';
  438. var Str;
  439. $('.fileBox .files').each(function (j, m) {
  440. var aa = $(m).attr("fiel-num")
  441. console.log(aa);
  442. str += aa + ",";
  443. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  444. })
  445. $("#file").val(Str);
  446. }
  447. //来源
  448. function LY(obj) {
  449. obj.empty();
  450. $.ajax({
  451. type: "get",
  452. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  453. dataType: "json",
  454. async: true,
  455. data: {
  456. "token": $.cookie("token"),
  457. id: 1
  458. },
  459. success: function (data) {
  460. if (data.state.toLowerCase() == "success") {
  461. var content = data.data;
  462. $(content).each(function (i, n) {
  463. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  464. .appendTo(obj);
  465. })
  466. }
  467. obj.val("1")
  468. }
  469. });
  470. }
  471. //类别
  472. function LB(obj) {
  473. obj.empty();
  474. $.ajax({
  475. type: "get",
  476. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  477. dataType: "json",
  478. async: true,
  479. data: {
  480. "token": $.cookie("token"),
  481. id: 2
  482. },
  483. success: function (data) {
  484. if (data.state.toLowerCase() == "success") {
  485. var content = data.data;
  486. $(content).each(function (i, n) {
  487. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  488. .appendTo(obj);
  489. })
  490. }
  491. }
  492. });
  493. }
  494. // 主题
  495. function ZT(obj) {
  496. obj.empty();
  497. $.ajax({
  498. type: "get",
  499. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  500. dataType: "json",
  501. async: true,
  502. data: {
  503. "token": $.cookie("token"),
  504. type: 1,
  505. id: 3
  506. },
  507. success: function (data) {
  508. if (data.state.toLowerCase() == "success") {
  509. var content = data.data;
  510. $(content).each(function (i, n) {
  511. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  512. .appendTo(obj);
  513. })
  514. }
  515. }
  516. });
  517. }
  518. //区域
  519. function QY(obj) {
  520. obj.empty();
  521. obj.append('<option selected="selected" value="">请选择</option>');
  522. $.ajax({
  523. type: "get",
  524. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  525. dataType: "json",
  526. async: true,
  527. data: {
  528. "token": $.cookie("token"),
  529. },
  530. success: function (data) {
  531. if (data.state.toLowerCase() == "success") {
  532. var content = data.data;
  533. $(content).each(function (i, n) {
  534. if (n.F_AreaName == "安阳市") {
  535. $("<option selected='selected' value='" + n.F_AreaId + "'>" + n
  536. .F_AreaName + "</option>").appendTo(obj);
  537. } else {
  538. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  539. "</option>").appendTo(obj);
  540. }
  541. })
  542. }
  543. }
  544. });
  545. }
  546. //电话类别
  547. function getPhoneType(obj) {
  548. obj.empty();
  549. $.ajax({
  550. type: "get",
  551. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  552. dataType: "json",
  553. async: true,
  554. data: {
  555. "token": $.cookie("token"),
  556. id: 2498,
  557. },
  558. success: function (data) {
  559. if (data.state.toLowerCase() == "success") {
  560. var content = data.data;
  561. $(content).each(function (i, n) {
  562. $("<option value='" + n.F_Value + "'>" + n.F_Remark + "</option>")
  563. .appendTo(obj);
  564. })
  565. }
  566. }
  567. });
  568. }
  569. $("#source").click(function () {
  570. if ($("#source").val() === "4") {
  571. $(".leaderCharge-wrapper").show()
  572. $(".phonetype-wrapper").hide()
  573. } else if ($("#source").val() === "1") {
  574. $(".leaderCharge-wrapper").hide()
  575. $(".phonetype-wrapper").show()
  576. } else {
  577. $(".leaderCharge-wrapper").hide()
  578. $(".phonetype-wrapper").hide()
  579. }
  580. })
  581. function Clean() {
  582. $("#cusname").val(''); //=来电人姓名
  583. $("#cussex").val('');
  584. $("#cusphone").val(''); //=来电人电话
  585. $("#email").val('');
  586. $("#zipcode").val('');
  587. $("#conphone").val('');
  588. $("#title").val('');
  589. $("#content").val('');
  590. $("#sourcearea").val(); //=事发地域id
  591. $('#sourceaddress').val(''); //=事发详细地址
  592. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  593. $("#type option:first").prop("selected", 'selected');
  594. $("#level option:first").prop("selected", 'selected');
  595. $("#visittype option:first").prop("selected", "selected");
  596. $("#keys option:first").prop("selected", 'selected');
  597. $("#sourcearea option:first").prop("selected", 'selected');
  598. $('#result').val('');
  599. $(".inps").val('');
  600. $("#PID").val('');
  601. $("#reflectCategory").val("");
  602. $(".Cleans").hide();
  603. $('#threeWayCall').attr('checked', false);
  604. $("#file").val('');
  605. }
  606. function getReactionCategory(pid = 38) {
  607. $.get(
  608. huayi.config.callcenter_url + "Dictionary/GetZTreeNew", {
  609. token: $.cookie("token"),
  610. pid: pid,
  611. },
  612. function (result) {
  613. result = $.parseJSON(result);
  614. var content = JSON.parse(result.data);
  615. layui.use("dropdown", function () {
  616. var dropdown = layui.dropdown;
  617. dropdown.render({
  618. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  619. data: content,
  620. id: "reflectCategory",
  621. //菜单被点击的事件
  622. click: function (obj) {
  623. $("#reflectCategory").val(obj.title)
  624. $("#PID").val(obj.id)
  625. },
  626. });
  627. });
  628. }
  629. );
  630. }
  631. function getSearchReactionCategory(key) {
  632. $.get(
  633. huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
  634. token: $.cookie("token"),
  635. key: key,
  636. },
  637. function (result) {
  638. result = $.parseJSON(result);
  639. if (result.state.toLowerCase() === "success") {
  640. $("#reflectCategoryList").empty();
  641. var content = result.data;
  642. if (content.length > 0) {
  643. content.forEach(function (e, i) {
  644. $("<li index='" + e.id + "' indexName='" + e.name + "'>" + e.names +
  645. "</li>")
  646. .appendTo("#reflectCategoryList");
  647. });
  648. } else {
  649. $("<li index='' indexName=''>没有相关数据</li>").appendTo("#reflectCategoryList");
  650. }
  651. }
  652. }
  653. );
  654. }
  655. function debounce(fun, delay) {
  656. return function (args) {
  657. var that = this;
  658. var _args = args
  659. clearTimeout(fun.id)
  660. fun.id = setTimeout(function () {
  661. fun.call(that, _args)
  662. }, delay)
  663. }
  664. }
  665. </script>
  666. </body>
  667. </html>