Bez popisu

AddAppeal.html 29KB

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