暂无描述

AddAppeal.html 37KB

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