No Description

AddAppeal.html 37KB

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