Brak opisu

AddAppeal.html 42KB

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