説明なし

AddAppeal.html 37KB

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