Nessuna descrizione

AddAppeal.html 41KB

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