Нет описания

AddAppeal.html 37KB

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