Sin descripción

AddAppeal.html 43KB

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