Aucune description

AddAppeal.html 37KB

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