Nenhuma Descrição

AddAppeal.html 32KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  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/mapIndex.js"></script>
  263. <!-- <script src="../js/appeal/index1.js"></script> -->
  264. <script src="../js/ztreeSelect.js"></script>
  265. <script>
  266. var submit;
  267. var roleCode = $.cookie("code");
  268. $(document).ready(function () {
  269. QY($("#sourcearea"));
  270. // 获取乡镇,默认文峰区
  271. getTownshipVillage($("#township"), 4965);
  272. LY($("#source"));
  273. LB($("#type"));
  274. ZT($("#keys"));
  275. getPhoneType($("#phonetype"));
  276. getReactionCategory();
  277. //当即办理
  278. $(' input[name="banli"]').change(function () {
  279. var val = $(this).val();
  280. if (val == "1") {
  281. $(".Nows_box").show();
  282. } else {
  283. $(".Nows_box").hide();
  284. }
  285. })
  286. $(".BC").click(function () {
  287. submit = 0;
  288. Add();
  289. })
  290. $('.SavedSubmit').click(function () {
  291. submit = 1;
  292. Add();
  293. })
  294. //上传附件
  295. $("#scwj").click(function () {
  296. $("#upFile").trigger("click");
  297. })
  298. $("#upFile").change(function () {
  299. upload();
  300. })
  301. $("#scfj").click(function () {
  302. // $(".fjnr").text("");
  303. // $("#scfj").hide();
  304. })
  305. $("#reflectCategory").bind("input propertychange", function () {
  306. $(".layui-dropdown").hide();
  307. if ($("#reflectCategory").val() == "") {
  308. $(".reflectCategoryList-wrapper").hide();
  309. return;
  310. }
  311. var debounceGetSearchReactionCategory = debounce(getSearchReactionCategory, 500)
  312. $(".reflectCategoryList-wrapper").show();
  313. debounceGetSearchReactionCategory($("#reflectCategory").val())
  314. })
  315. $("#reflectCategoryList").on("click", "li", function () {
  316. $(".reflectCategoryList-wrapper").hide();
  317. $("#reflectCategory").val($(this).attr("indexName"));
  318. $("#PID").val($(this).attr("index"));
  319. });
  320. });
  321. //添加工单
  322. function Add() {
  323. var threeWayCall;
  324. var value = $(' input[name="banli"]:checked ').val();
  325. var content = $("#content").val();
  326. if ($('#threeWayCall').is(':checked')) {
  327. threeWayCall = 1;
  328. } else {
  329. threeWayCall = 0;
  330. }
  331. if (!$("#cusphone").val()) {
  332. layer.msg("请输入来电号码");
  333. } else if (!$("#title").val()) {
  334. layer.msg("请输入标题");
  335. } else if (!$("#content").val()) {
  336. layer.msg("请输入内容");
  337. } else if (!$("#PID").val()) {
  338. layer.msg("请选择反映类别");
  339. } else if (!$("#sourcearea").val()) {
  340. layer.msg("请选择事发区域");
  341. } else if (value == 1 && !$('#result').val()) {
  342. layer.msg("请输入直办内容");
  343. // } else if (!$("#township").val()) {
  344. // layer.msg("请选择乡镇");
  345. // } else if (!$("#village").val()) {
  346. // layer.msg("请选择村");
  347. } else {
  348. $.ajax({
  349. type: "post",
  350. url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
  351. dataType: 'json',
  352. async: true,
  353. beforeSend: function () { //触发ajax请求开始时执行
  354. $('.BC').attr("disabled", true);
  355. $('.SavedSubmit').attr("disabled", true);
  356. $('.BC').text('提交中...');
  357. $('.SavedSubmit').text('提交中...');
  358. $(document).off('click', '.BC', Add);
  359. $(document).off('click', '.SavedSubmit', Add);
  360. },
  361. data: {
  362. cusname: $("#cusname").val(), //=来电人姓名
  363. cussex: $("#cussex").val(),
  364. cusphone: $("#cusphone").val().replace(/\s+/g, ""), //=来电人电话
  365. email: $("#email").val(),
  366. zipcode: $("#zipcode").val(),
  367. conphone: $("#conphone").val(),
  368. title: $("#title").val(),
  369. content: $("#content").val(),
  370. files: $("#file").val(), //(多个用英文逗号,隔开)
  371. sourcearea: $("#sourcearea").val(), //=事发地域id
  372. township: $("#township").val(), // 乡镇
  373. village: $("#village").val(), // 村
  374. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  375. longitude: $('.store_Lng').val(),
  376. latitude: $('.store_Lat').val(),
  377. source: $("#source").val(), //=来源
  378. splituser: $("#leaderCharge").val(), // 分管领导
  379. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  380. business: threeWayCall,
  381. result: $('#result').val(),
  382. keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开)
  383. type: $("#type").val(), //=类型
  384. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  385. level: $('#level').val(), //=(1普通2紧急)
  386. visittype: $("#visittype").val(), // 回访方式
  387. issubmit: submit, //=(0保存1保存并提交)
  388. phonetype: $("#source").val() === "1" ? $("#phonetype").val() : "", // 电话类别
  389. // ispd: $("#automaticDispatch").val() === "1" ? "1" : "", // 自动派单
  390. // pingtai: $("#pingtai").val(), // 工单平台
  391. token: $.cookie("token")
  392. },
  393. success: function (data) {
  394. $('.BC').attr("disabled", false);
  395. $('.SavedSubmit').attr("disabled", false);
  396. $('.BC').text('保存');
  397. $('.SavedSubmit').text('保存并提交');
  398. $(document).on('click', '.BC', Add);
  399. $(document).on('click', '.SavedSubmit', Add);
  400. Clean();
  401. $('.fileBox').html('');
  402. layer.msg("创建工单成功");
  403. }
  404. });
  405. }
  406. }
  407. //上传文件
  408. function upload() {
  409. var Files = document.getElementById("upFile").files;
  410. console.log(Files);
  411. if (Files.length > 0) {
  412. var formData = new FormData();
  413. for (var i = 0; i < Files.length; i++) {
  414. formData.append('file' + i, Files[i]);
  415. }
  416. formData.append("token", $.cookie("token"));
  417. var typeName = Files[0].name.split('.')[1];
  418. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'avi' || typeName ==
  419. 'wmv' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' ||
  420. typeName == 'xls' || typeName == 'xlsx') {
  421. $.ajax({
  422. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  423. type: "POST",
  424. data: formData,
  425. /**
  426. *必须false才会自动加上正确的Content-Type
  427. */
  428. contentType: false,
  429. /**
  430. * 必须false才会避开jQuery对 formdata 的默认处理
  431. * XMLHttpRequest会对 formdata 进行正确的处理
  432. */
  433. processData: false,
  434. success: function (result) {
  435. document.getElementById("upFile").outerHTML = document.getElementById("upFile")
  436. .outerHTML;
  437. $("#upFile").change(function () {
  438. upload();
  439. });
  440. var r = $.parseJSON(result);
  441. if (r.state.toLowerCase() == "success") {
  442. var a = r.data;
  443. $(a).each(function (i, n) {
  444. var strs = '<span class="files" fiel-num="' + n.F_FileId +
  445. '">' + n.F_FileName.substring(19) +
  446. '<i class="fa fa-remove del_file"></i></span>'
  447. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  448. function (event) {
  449. event.stopPropagation();
  450. $(this).parent().remove();
  451. file_num()
  452. })
  453. })
  454. file_num();
  455. }
  456. }
  457. });
  458. } else {
  459. layer.msg("格式不正确");
  460. }
  461. } else {
  462. layer.confirm('请上传文件!', {
  463. btn: ['确定']
  464. });
  465. }
  466. }
  467. //上传文件隐藏域值
  468. function file_num() {
  469. var str = '';
  470. var Str;
  471. $('.fileBox .files').each(function (j, m) {
  472. var aa = $(m).attr("fiel-num")
  473. console.log(aa);
  474. str += aa + ",";
  475. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  476. })
  477. $("#file").val(Str);
  478. }
  479. //来源
  480. function LY(obj) {
  481. obj.empty();
  482. $.ajax({
  483. type: "get",
  484. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  485. dataType: "json",
  486. async: true,
  487. data: {
  488. "token": $.cookie("token"),
  489. id: 1
  490. },
  491. success: function (data) {
  492. if (data.state.toLowerCase() == "success") {
  493. var content = data.data;
  494. $(content).each(function (i, n) {
  495. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  496. .appendTo(obj);
  497. })
  498. }
  499. obj.val("1")
  500. }
  501. });
  502. }
  503. //类别
  504. function LB(obj) {
  505. obj.empty();
  506. $.ajax({
  507. type: "get",
  508. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  509. dataType: "json",
  510. async: true,
  511. data: {
  512. "token": $.cookie("token"),
  513. id: 2
  514. },
  515. success: function (data) {
  516. if (data.state.toLowerCase() == "success") {
  517. var content = data.data;
  518. $(content).each(function (i, n) {
  519. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  520. .appendTo(obj);
  521. })
  522. }
  523. }
  524. });
  525. }
  526. // 主题
  527. function ZT(obj) {
  528. obj.empty();
  529. $.ajax({
  530. type: "get",
  531. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  532. dataType: "json",
  533. async: true,
  534. data: {
  535. "token": $.cookie("token"),
  536. type: 1,
  537. id: 3
  538. },
  539. success: function (data) {
  540. if (data.state.toLowerCase() == "success") {
  541. var content = data.data;
  542. $(content).each(function (i, n) {
  543. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  544. .appendTo(obj);
  545. })
  546. }
  547. }
  548. });
  549. }
  550. //区域
  551. function QY(obj) {
  552. obj.empty();
  553. obj.append('<option selected="selected" value="">请选择</option>');
  554. $.ajax({
  555. type: "get",
  556. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  557. dataType: "json",
  558. async: true,
  559. data: {
  560. "token": $.cookie("token"),
  561. },
  562. success: function (data) {
  563. if (data.state.toLowerCase() == "success") {
  564. var content = data.data;
  565. $(content).each(function (i, n) {
  566. if (n.F_AreaName !== "市区") {
  567. if (n.F_AreaName === "文峰区") {
  568. $("<option value='" + n.F_AreaId + "' selected='selected'>" + n
  569. .F_AreaName + "</option>").appendTo(obj);
  570. } else {
  571. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  572. "</option>").appendTo(obj);
  573. }
  574. }
  575. })
  576. }
  577. }
  578. });
  579. }
  580. //获取乡镇、村
  581. function getTownshipVillage(obj, parentid) {
  582. obj.empty();
  583. obj.append('<option selected="selected" value="">请选择</option>');
  584. $.getJSON(
  585. huayi.config.callcenter_url + "Area/GetAreaChildren", {
  586. token: $.cookie("token"),
  587. parentid: parentid
  588. },
  589. function (data) {
  590. if (data.state.toLowerCase() == "success") {
  591. var content = data.data;
  592. $(content).each(function (i, n) {
  593. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(
  594. obj);
  595. });
  596. }
  597. }
  598. );
  599. }
  600. // 获取乡镇
  601. $("#sourcearea").change(function () {
  602. getTownshipVillage($("#township"), $("#sourcearea").val())
  603. })
  604. // 获取村
  605. $("#township").change(function () {
  606. getTownshipVillage($("#village"), $("#township").val())
  607. })
  608. //电话类别
  609. function getPhoneType(obj) {
  610. obj.empty();
  611. $.ajax({
  612. type: "get",
  613. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  614. dataType: "json",
  615. async: true,
  616. data: {
  617. "token": $.cookie("token"),
  618. id: 2498,
  619. },
  620. success: function (data) {
  621. if (data.state.toLowerCase() == "success") {
  622. var content = data.data;
  623. $(content).each(function (i, n) {
  624. $("<option value='" + n.F_Value + "'>" + n.F_Remark + "</option>")
  625. .appendTo(obj);
  626. })
  627. }
  628. }
  629. });
  630. }
  631. $("#source").change(function () {
  632. if ($("#source").val() === "4") {
  633. $(".leaderCharge-wrapper").show()
  634. $(".phonetype-wrapper").hide()
  635. } else if ($("#source").val() === "1") {
  636. $(".leaderCharge-wrapper").hide()
  637. $(".phonetype-wrapper").show()
  638. } else {
  639. $(".leaderCharge-wrapper").hide()
  640. $(".phonetype-wrapper").hide()
  641. }
  642. })
  643. function Clean() {
  644. $("#cusname").val(''); //=来电人姓名
  645. $("#cussex").val('');
  646. $("#cusphone").val(''); //=来电人电话
  647. $("#email").val('');
  648. $("#zipcode").val('');
  649. $("#conphone").val('');
  650. $("#title").val('');
  651. $("#content").val('');
  652. $("#sourcearea").val(); //=事发地域id
  653. $("#township").val(); // 乡镇
  654. $("#village").val(); // 村
  655. $('#sourceaddress').val(''); //=事发详细地址
  656. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  657. $("#type option:first").prop("selected", 'selected');
  658. $("#level option:first").prop("selected", 'selected');
  659. $("#visittype option:first").prop("selected", "selected");
  660. $("#keys option:first").prop("selected", 'selected');
  661. $('#result').val('');
  662. $(".inps").val('');
  663. $("#PID").val('');
  664. $("#reflectCategory").val("");
  665. $(".Cleans").hide();
  666. $('#threeWayCall').attr('checked', false);
  667. $("#file").val('');
  668. }
  669. function getReactionCategory(pid = 38) {
  670. console.log("roleCode", roleCode)
  671. // 供暖专员只获取供暖问题
  672. if (roleCode === "GNZY") {
  673. pid = 2460;
  674. } else {
  675. pid = 38;
  676. }
  677. $.get(
  678. huayi.config.callcenter_url + "Dictionary/GetZTreeNew", {
  679. token: $.cookie("token"),
  680. pid: pid,
  681. },
  682. function (result) {
  683. result = $.parseJSON(result);
  684. var content = JSON.parse(result.data);
  685. layui.use("dropdown", function () {
  686. var dropdown = layui.dropdown;
  687. dropdown.render({
  688. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  689. data: content,
  690. id: "reflectCategory",
  691. //菜单被点击的事件
  692. click: function (obj) {
  693. $("#reflectCategory").val(obj.title)
  694. $("#PID").val(obj.id)
  695. },
  696. });
  697. });
  698. }
  699. );
  700. }
  701. function getSearchReactionCategory(key) {
  702. $.get(
  703. huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
  704. token: $.cookie("token"),
  705. key: key,
  706. },
  707. function (result) {
  708. result = $.parseJSON(result);
  709. if (result.state.toLowerCase() === "success") {
  710. $("#reflectCategoryList").empty();
  711. var content = result.data;
  712. if (content.length > 0) {
  713. content.forEach(function (e, i) {
  714. $("<li index='" + e.id + "' indexName='" + e.name + "'>" + e.names +
  715. "</li>")
  716. .appendTo("#reflectCategoryList");
  717. });
  718. } else {
  719. $("<li index='' indexName=''>没有相关数据</li>").appendTo("#reflectCategoryList");
  720. }
  721. }
  722. }
  723. );
  724. }
  725. function debounce(fun, delay) {
  726. return function (args) {
  727. var that = this;
  728. var _args = args
  729. clearTimeout(fun.id)
  730. fun.id = setTimeout(function () {
  731. fun.call(that, _args)
  732. }, delay)
  733. }
  734. }
  735. </script>
  736. </body>
  737. </html>