暂无描述

AddAppeal.html 43KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013
  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. if (source != "12") {
  681. obj.val('2501')
  682. }else{
  683. obj.val("1")
  684. }
  685. }else{
  686. obj.val("1")
  687. }
  688. }
  689. });
  690. }
  691. //类别
  692. function LB(obj) {
  693. obj.empty();
  694. $.ajax({
  695. type: "get",
  696. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  697. dataType: "json",
  698. async: true,
  699. data: {
  700. "token": $.cookie("token"),
  701. id: 2
  702. },
  703. success: function (data) {
  704. if (data.state.toLowerCase() == "success") {
  705. var content = data.data;
  706. $(content).each(function (i, n) {
  707. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  708. .appendTo(obj);
  709. })
  710. if(source == "12"){
  711. $("#type option:selected").val(12 + "");
  712. $("#type option:selected").text('建议'); //来源
  713. $("#type").attr("disabled",true)
  714. }
  715. }
  716. }
  717. });
  718. }
  719. // 主题
  720. function ZT(obj) {
  721. obj.empty();
  722. $.ajax({
  723. type: "get",
  724. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  725. dataType: "json",
  726. async: true,
  727. data: {
  728. "token": $.cookie("token"),
  729. type: 1,
  730. id: 3
  731. },
  732. success: function (data) {
  733. if (data.state.toLowerCase() == "success") {
  734. var content = data.data;
  735. $(content).each(function (i, n) {
  736. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  737. .appendTo(obj);
  738. })
  739. }
  740. }
  741. });
  742. }
  743. //区域
  744. function QY(obj) {
  745. obj.empty();
  746. obj.append('<option selected="selected" value="">请选择</option>');
  747. $.ajax({
  748. type: "get",
  749. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  750. dataType: "json",
  751. async: true,
  752. data: {
  753. "token": $.cookie("token"),
  754. },
  755. success: function (data) {
  756. if (data.state.toLowerCase() == "success") {
  757. var content = data.data;
  758. $(content).each(function (i, n) {
  759. if (n.F_AreaName !== "市区") {
  760. if (n.F_AreaName === "文峰区") {
  761. $("<option value='" + n.F_AreaId + "' selected='selected'>" + n
  762. .F_AreaName + "</option>").appendTo(obj);
  763. } else {
  764. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  765. "</option>").appendTo(obj);
  766. }
  767. }
  768. })
  769. }
  770. }
  771. });
  772. }
  773. //获取乡镇、村
  774. function getTownshipVillage(obj, parentid) {
  775. obj.empty();
  776. obj.append('<option selected="selected" value="">请选择</option>');
  777. $.getJSON(
  778. huayi.config.callcenter_url + "Area/GetAreaChildren", {
  779. token: $.cookie("token"),
  780. parentid: parentid
  781. },
  782. function (data) {
  783. if (data.state.toLowerCase() == "success") {
  784. var content = data.data;
  785. $(content).each(function (i, n) {
  786. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(
  787. obj);
  788. });
  789. }
  790. }
  791. );
  792. }
  793. // 获取乡镇
  794. $("#sourcearea").change(function () {
  795. getTownshipVillage($("#township"), $("#sourcearea").val())
  796. })
  797. // 获取村
  798. $("#township").change(function () {
  799. getTownshipVillage($("#village"), $("#township").val())
  800. })
  801. //电话类别
  802. function getPhoneType(obj) {
  803. obj.empty();
  804. $.ajax({
  805. type: "get",
  806. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  807. dataType: "json",
  808. async: true,
  809. data: {
  810. "token": $.cookie("token"),
  811. id: 2498,
  812. },
  813. success: function (data) {
  814. if (data.state.toLowerCase() == "success") {
  815. var content = data.data;
  816. $(content).each(function (i, n) {
  817. $("<option value='" + n.F_Value + "'>" + n.F_Remark + "</option>")
  818. .appendTo(obj);
  819. })
  820. }
  821. }
  822. });
  823. }
  824. $("#source").change(function () {
  825. if ($("#source").val() === "4") {
  826. $(".leaderCharge-wrapper").show()
  827. $(".phonetype-wrapper").hide()
  828. } else if ($("#source").val() === "1") {
  829. $(".leaderCharge-wrapper").hide()
  830. $(".phonetype-wrapper").show()
  831. } else {
  832. $(".leaderCharge-wrapper").hide()
  833. $(".phonetype-wrapper").hide()
  834. }
  835. })
  836. function Clean() {
  837. $("#cusname").val(''); //=来电人姓名
  838. $("#cussex").val('');
  839. $("#cusphone").val(''); //=来电人电话
  840. $("#email").val('');
  841. $("#zipcode").val('');
  842. $("#conphone").val('');
  843. $("#title").val('');
  844. $("#content").val('');
  845. $("#sourcearea").val(); //=事发地域id
  846. $("#township").val(); // 乡镇
  847. $("#village").val(); // 村
  848. $('#sourceaddress').val(''); //=事发详细地址
  849. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  850. $("#type option:first").prop("selected", 'selected');
  851. $("#level option:first").prop("selected", 'selected');
  852. $("#visittype option:first").prop("selected", "selected");
  853. $("#keys option:first").prop("selected", 'selected');
  854. $('#result').val('');
  855. $(".inps").val('');
  856. $("#PID").val('');
  857. $("#reflectCategory").val("");
  858. $(".Cleans").hide();
  859. $('#threeWayCall').attr('checked', false);
  860. $("#file").val('');
  861. }
  862. function getBigtype(obj){
  863. obj.empty();
  864. $.ajax({
  865. type: "get",
  866. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  867. dataType: "json",
  868. async: true,
  869. data: {
  870. "token": $.cookie("token"),
  871. type: 1,
  872. id: 3059
  873. },
  874. success: function (data) {
  875. if (data.state.toLowerCase() == "success") {
  876. var content = data.data;
  877. $(content).each(function (i, n) {
  878. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  879. .appendTo(obj);
  880. })
  881. }
  882. }
  883. });
  884. }
  885. function getBigtypeKey(obj,id){
  886. obj.empty();
  887. $.ajax({
  888. type: "get",
  889. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  890. dataType: "json",
  891. async: true,
  892. data: {
  893. "token": $.cookie("token"),
  894. type: 1,
  895. id: id
  896. },
  897. success: function (data) {
  898. if (data.state.toLowerCase() == "success") {
  899. var content = data.data;
  900. $(content).each(function (i, n) {
  901. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  902. .appendTo(obj);
  903. })
  904. }
  905. }
  906. });
  907. }
  908. function getReactionCategory(pid = 38) {
  909. console.log("roleCode", roleCode)
  910. // 供暖专员只获取供暖问题
  911. if (roleCode === "GNZY") {
  912. pid = 2460;
  913. } else {
  914. pid = 38;
  915. }
  916. $.get(
  917. huayi.config.callcenter_url + "Dictionary/GetZTreeNew", {
  918. token: $.cookie("token"),
  919. pid: pid,
  920. },
  921. function (result) {
  922. result = $.parseJSON(result);
  923. var content = JSON.parse(result.data);
  924. layui.use("dropdown", function () {
  925. var dropdown = layui.dropdown;
  926. dropdown.render({
  927. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  928. data: content,
  929. id: "reflectCategory",
  930. //菜单被点击的事件
  931. click: function (obj) {
  932. $("#reflectCategory").val(obj.title)
  933. $("#PID").val(obj.id)
  934. },
  935. });
  936. });
  937. }
  938. );
  939. }
  940. function getSearchReactionCategory(key) {
  941. $.get(
  942. huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
  943. token: $.cookie("token"),
  944. key: key,
  945. },
  946. function (result) {
  947. result = $.parseJSON(result);
  948. if (result.state.toLowerCase() === "success") {
  949. $("#reflectCategoryList").empty();
  950. var content = result.data;
  951. if (content.length > 0) {
  952. content.forEach(function (e, i) {
  953. $("<li index='" + e.id + "' indexName='" + e.name + "'>" + e.names +
  954. "</li>")
  955. .appendTo("#reflectCategoryList");
  956. });
  957. } else {
  958. $("<li index='' indexName=''>没有相关数据</li>").appendTo("#reflectCategoryList");
  959. }
  960. }
  961. }
  962. );
  963. }
  964. function debounce(fun, delay) {
  965. return function (args) {
  966. var that = this;
  967. var _args = args
  968. clearTimeout(fun.id)
  969. fun.id = setTimeout(function () {
  970. fun.call(that, _args)
  971. }, delay)
  972. }
  973. }
  974. </script>
  975. </body>
  976. </html>