Няма описание

AddAppealDCL.html 50KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150
  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="../css/bootstrap-select.css" />
  8. <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  9. <link rel="stylesheet" href="../css/addappeal.css" />
  10. <link href="../css/layer/need/layer.css" />
  11. <link rel="stylesheet" href="../css/init.css" />
  12. <link rel="stylesheet" href="../js/layui/css/layui.css">
  13. <title>新增诉求工单</title>
  14. <style>
  15. .reflectCategory-wrapper {
  16. position: relative;
  17. }
  18. .reflectCategoryList-wrapper {
  19. display: none;
  20. position: absolute;
  21. top: 38px;
  22. z-index: 9999;
  23. line-height: 32px;
  24. background: #FFF;
  25. }
  26. #reflectCategoryList {
  27. height: 240px;
  28. background: #FFF;
  29. border: 1px solid #e5e6e7;
  30. overflow: auto;
  31. }
  32. #reflectCategoryList li {
  33. padding: 0 10px;
  34. width: 100%;
  35. line-height: 32px;
  36. }
  37. #reflectCategoryList li:hover {
  38. background: #00a1cb;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <input type="hidden" id="PID" value="" />
  44. <div class="wrapper wrapper-content animated fadeInRight">
  45. <div style="padding: 10px" class="tj_content clearFix">
  46. <div class="Common">
  47. <table>
  48. <tr>
  49. <th class="Importent">标题:</th>
  50. <td colspan="7">
  51. <input id="title" class="form-control" type="text" />
  52. </td>
  53. </tr>
  54. <tr class="content-wrapper">
  55. <th class="Importent">来电内容:</th>
  56. <td colspan="7">
  57. <textarea data-adaptheight id="content" class="form-control" name="" rows="" cols=""
  58. readonly="readonly"></textarea>
  59. </td>
  60. </tr>
  61. <tr class="workcontent-wrapper">
  62. <th class="Importent">工单内容:</th>
  63. <td colspan="7">
  64. <textarea data-adaptheight id="workcontent" class="form-control" name="" rows="" cols=""
  65. style="width: 100%;"></textarea>
  66. </td>
  67. </tr>
  68. <tr>
  69. <th>附件上传:</th>
  70. <td colspan="7">
  71. <div class="fileBox"></div>
  72. <!--<span class="fjnr"></span>-->
  73. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple"
  74. style="display: none" />
  75. <input class="input" type="button" value="上传" id="scwj" />
  76. <input class="input" type="button" value="删除附件" id="scfj" style="display: none" />
  77. <input type="hidden" id="file" />
  78. <span style="color: #ff0000; border: none">
  79. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  80. </span>
  81. </td>
  82. </tr>
  83. <tr>
  84. <th>处理方式:</th>
  85. <td colspan="7">
  86. <input type="radio" value="1" name="banli" class="Nows" />当即办理
  87. <input checked="true" type="radio" value="0" name="banli" class="Nows_" />网络转办
  88. <input id="threeWayCall" type="checkbox" value="1" name="" class="Nows_" />三方通话
  89. </td>
  90. </tr>
  91. <tr class="Nows_box Hidens">
  92. <th>办理内容:</th>
  93. <td colspan="7">
  94. <textarea id="result" name="" rows="" cols="" style="width: 100%; height: 80px;"></textarea>
  95. </td>
  96. </tr>
  97. <tr>
  98. <th class="Importent">姓名:</th>
  99. <td>
  100. <input type="text" id="cusname" class="form-control" />
  101. </td>
  102. <th>性别:</th>
  103. <td>
  104. <select class="form-control" id="SEX">
  105. <option value="">请选择</option>
  106. <option value="0">男</option>
  107. <option value="1">女</option>
  108. </select>
  109. </td>
  110. <th>来源:</th>
  111. <td>
  112. <select class="form-control" id="source"></select>
  113. </td>
  114. <th class="Importent">来电号码:</th>
  115. <td>
  116. <input type="text" id="cusphone" class="form-control" />
  117. </td>
  118. </tr>
  119. <tr>
  120. <th>类型:</th>
  121. <td>
  122. <select class="form-control" id="type"></select>
  123. </td>
  124. <th class="Importent">反映类别:</th>
  125. <td class="reflectCategory-wrapper">
  126. <input type="text" id="reflectCategory" class="form-control" autocomplete="off" />
  127. <div class="reflectCategoryList-wrapper">
  128. <ul id="reflectCategoryList">
  129. </ul>
  130. </div>
  131. </td>
  132. <!-- <td style="position: relative">
  133. <div class="inpBox">
  134. <input type="text" class="inps" />
  135. <i class="Cleans fa fa-close"></i>
  136. <i class="xl xl_one"></i>
  137. <div class="addTree xlAdd">
  138. <ul id="addTreeDemo" class="ztree"></ul>
  139. </div>
  140. </div>
  141. <div class="selDpart1">
  142. <ul id="sponsor"></ul>
  143. </div>
  144. </td> -->
  145. <th>来电号码密级:</th>
  146. <td>
  147. <input type="radio" name="mj" id="" value="0" />普通
  148. <input type="radio" name="mj" id="" value="1" />保密
  149. </td>
  150. <th>紧急程度:</th>
  151. <td>
  152. <select class="form-control" id="level">
  153. <!--<option value="0">选择</option>-->
  154. <option value="1">普通</option>
  155. <option value="2">紧急</option>
  156. </select>
  157. </td>
  158. </tr>
  159. <tr>
  160. <th>承办单位:</th>
  161. <td colspan="7">
  162. <!-- <input type="text" id="jbSelectText" class="form-control" style="width: 100%"/>
  163. <input type="hidden" id="jbSelect"> -->
  164. <select id="jbSelect" name="select" class="selectpicker show-tick form-control" multiple
  165. data-live-search="true">
  166. </select>
  167. </td>
  168. </tr>
  169. <tr class="phonetype-wrapper" style="display: none">
  170. <th class="">电话类别:</th>
  171. <td>
  172. <select class="form-control" id="phonetype">
  173. <option value="">请选择</option>
  174. </select>
  175. </td>
  176. </tr>
  177. <tr class="leaderCharge-wrapper" style="display: none;">
  178. <th class="">分管领导:</th>
  179. <td>
  180. <select class="select_ form-control" id="leaderCharge">
  181. <option value="">请选择</option>
  182. <option value="省长">省长</option>
  183. <option value="市长">市长</option>
  184. </select>
  185. </td>
  186. </tr>
  187. <tr class="limittimeWrapper">
  188. <th>办理时限:</th>
  189. <td colspan="3">
  190. <select class="startTime form-control" id="startTime"
  191. style="width: 200px; height: 30px; line-height: 30px;">
  192. <!--<option value="0">选择</option>-->
  193. <option value="1">一天</option>
  194. <option value="3">三天</option>
  195. <option value="5">五天</option>
  196. <option value="7">七天</option>
  197. </select>
  198. </td>
  199. </tr>
  200. <tr class="limittimesWrapper">
  201. <th>紧急时限:</th>
  202. <td colspan="">
  203. <input type="text" id="limittimes" class="form-control">
  204. </td>
  205. </tr>
  206. <tr class="limittimesWrapperCB" style="display: none;">
  207. <th>办理时限:</th>
  208. <td colspan="">
  209. <input type="text" id="limittimesCB" class="form-control" autocomplete="off">
  210. </td>
  211. </tr>
  212. <tr>
  213. <td colspan="8" style="text-align: center">
  214. <!-- <div class="btn_box"> -->
  215. <button class="btns BC">保存</button>
  216. <button class="btns auditBtn" style="display: none;">审核</button>
  217. <button class="btns JB">审核通过</button>
  218. <button class="btns thBtn">回退</button>
  219. <button class="btns associatWorkOrder">关联工单</button>
  220. <!--<button class="btns SavedSubmit">保存并提交</button>-->
  221. <!-- </div> -->
  222. </td>
  223. </tr>
  224. <tr>
  225. <th>事件地址:</th>
  226. <td>
  227. <select class="form-control" id="sourcearea"></select>
  228. </td>
  229. <th>乡镇:</th>
  230. <td>
  231. <select class="form-control" id="township"></select>
  232. </td>
  233. <th>村:</th>
  234. <td>
  235. <select class="form-control" id="village"></select>
  236. </td>
  237. </tr>
  238. <tr>
  239. <th class="Importent"></th>
  240. <td colspan="7">
  241. <input id="sourceaddress" class="form-control" type="text" placeholder="输入详细地址"
  242. style="width: 50%; padding-left: 15px" />
  243. </td>
  244. </tr>
  245. <tr>
  246. <th class="Importent"></th>
  247. <td colspan="7">
  248. <div style="width: 710px">
  249. <div id="myMap" style="width: 100%; height: 400px"></div>
  250. <input type="hidden" class="store_Lng" value="114.398996" />
  251. <input type="hidden" class="store_Lat" value="36.104678" />
  252. </div>
  253. </td>
  254. </tr>
  255. </table>
  256. </div>
  257. </div>
  258. </div>
  259. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  260. <script src="../js/layui/layui.js"></script>
  261. <script src="../css/laydate/laydate.js"></script>
  262. <script src="../js/bootstrap-select.js"></script>
  263. <script src="../js/adjustHeight.js"></script>
  264. <script src="../js/appeal/index.js"></script>
  265. <script src="../js/zTree/jquery.ztree.core.js"></script>
  266. <script src="../js/ztreeSelect.js"></script>
  267. <script>
  268. var wid = helper.request.queryString("wid");
  269. var workType = helper.request.queryString("workType");
  270. var IsExamine = helper.request.queryString("IsExamine"); // 0待审转办未审核、1待审转办已审核
  271. var roleCode = $.cookie("code");
  272. var submit;
  273. $(document).ready(function () {
  274. QY($("#sourcearea"));
  275. LY($("#source"));
  276. LB($("#type"));
  277. ZT($("#keys"));
  278. jbSelect($("#jbSelect"));
  279. getReactionCategory();
  280. // 电话类别
  281. getPhoneType($("#phonetype"));
  282. laydate.skin("blue");
  283. laydate({
  284. elem: "#limittimes",
  285. event: "focus",
  286. istime: true,
  287. format: 'YYYY-MM-DD hh:mm:ss'
  288. });
  289. laydate({
  290. elem: "#limittimesCB",
  291. event: "focus",
  292. // istime: true,
  293. format: 'YYYY-MM-DD'
  294. });
  295. $("#reflectCategory").bind("input propertychange", function () {
  296. $(".layui-dropdown").hide();
  297. if ($("#reflectCategory").val() == "") {
  298. $(".reflectCategoryList-wrapper").hide();
  299. return;
  300. }
  301. var debounceGetSearchReactionCategory = debounce(getSearchReactionCategory, 500)
  302. $(".reflectCategoryList-wrapper").show();
  303. debounceGetSearchReactionCategory($("#reflectCategory").val())
  304. })
  305. $("#reflectCategoryList").on("click", "li", function () {
  306. $(".reflectCategoryList-wrapper").hide();
  307. $("#reflectCategory").val($(this).attr("indexName"));
  308. $("#PID").val($(this).attr("index"));
  309. });
  310. // 管理员、中心话务员可编辑工单内容
  311. if (roleCode === "GLY") {
  312. $("#content").removeAttr("readonly")
  313. } else if (roleCode === "ZXHWY") {
  314. $(".workcontent-wrapper").hide()
  315. $("#content").removeAttr("readonly")
  316. }
  317. //当即办理
  318. $(' input[name="banli"]').change(function () {
  319. var val = $(this).val();
  320. if (val == "1") {
  321. $(".Nows_box").show();
  322. } else {
  323. $(".Nows_box").hide();
  324. }
  325. });
  326. // 营商管理 审核员审核 局营商办审核 0待审转办未审核、1待审转办已审核
  327. if (String(IsExamine) === "0") {
  328. $(".auditBtn").show();
  329. $(".JB").hide();
  330. } else if (String(IsExamine) === "1") {
  331. $(".auditBtn").hide();
  332. $(".JB").show();
  333. }
  334. $(".BC").click(function () {
  335. submit = 0;
  336. workType = ""
  337. Add();
  338. });
  339. $(".JB").click(function () {
  340. submit = 0;
  341. Add();
  342. });
  343. //上传附件
  344. $("#scwj").click(function () {
  345. $("#upFile").trigger("click");
  346. });
  347. $("#upFile").change(function () {
  348. upload();
  349. });
  350. $(".SavedSubmit").click(function () {
  351. submit = 1;
  352. Add();
  353. });
  354. $(".thBtn").click(function () {
  355. layer.open({
  356. type: 2,
  357. content: "../CommonHtml/BackDatil.html?wid=" + wid, //iframe的url,no代表不显示滚动条
  358. title: "工单回退",
  359. area: ["60%", "80%"], //宽高
  360. });
  361. });
  362. $(".associatWorkOrder").click(function () {
  363. layer.open({
  364. type: 2,
  365. content: "../CommonHtml/associatWorkOrder.html?wid=" +
  366. wid, //iframe的url,no代表不显示滚动条
  367. title: "关联工单",
  368. area: ["90%", "90%"], //宽高
  369. });
  370. });
  371. // 营商审核
  372. $(".auditBtn").click(function () {
  373. $.ajax({
  374. type: "post",
  375. url: huayi.config.callcenter_url +
  376. "WorkOrder/BusinessApproved",
  377. dataType: "json",
  378. async: false,
  379. data: {
  380. token: $.cookie("token"),
  381. workorderid: wid,
  382. },
  383. success: function (data) {
  384. if (data.state.toLowerCase() == "success") {
  385. var index = parent.layer.getFrameIndex(window
  386. .name); //先得到当前iframe层的索引
  387. parent.layer.close(index); //再执行关闭
  388. parent.$("#orderlist").bootstrapTable("refresh");
  389. parent.layer.msg("操作成功");
  390. }
  391. },
  392. });
  393. })
  394. if (wid) {
  395. $.ajax({
  396. type: "get",
  397. url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrderNew",
  398. dataType: "json",
  399. async: false,
  400. data: {
  401. workorderid: wid,
  402. type: 0, // 工单信息
  403. token: $.cookie("token"),
  404. },
  405. success: function (data) {
  406. if (data.state.toLowerCase() == "success") {
  407. var Data = data.data.data;
  408. $("#cusname").val(Data[0].F_CusName);
  409. $("#cusphone").val(Data[0].F_CusPhone);
  410. $("#conphone").val(Data[0].F_ConPhone);
  411. $("#title").val(Data[0].F_ComTitle);
  412. $("#content").val(Data[0].F_ComContent);
  413. if (Data[0].F_Content === "" || Data[0].F_Content === null) {
  414. $('#workcontent').val(Data[0].F_ComContent);
  415. } else {
  416. $('#workcontent').val(Data[0].F_Content);
  417. }
  418. $("#zipcode").val(Data[0].F_ZipCode);
  419. $("#result").val(Data[0].F_Result);
  420. $("#reflectCategory").val(Data[0].KeyName)
  421. $("#PID").val(Data[0].F_Key)
  422. if (Data[0].F_Longitude) {
  423. $(".store_Lng").val(Data[0].F_Longitude);
  424. $(".store_Lat").val(Data[0].F_Latitude);
  425. }
  426. //x性别
  427. $("#SEX option:selected").val(
  428. Data[0].F_CusSex + ""
  429. );
  430. if (Data[0].F_CusSex == "0") {
  431. $("#SEX option:selected").text("男"); //乡镇
  432. } else {
  433. $("#SEX option:selected").text("女"); //乡镇
  434. }
  435. //来源
  436. $("#source option:selected").val(Data[0].F_InfoSource + "");
  437. $("#source option:selected").text(Data[0].SourceName); //来源
  438. if (Data[0].F_InfoSource + "" === "4") {
  439. $(".leaderCharge-wrapper").show()
  440. $("#leaderCharge").val(Data[0].F_SplitUser)
  441. } else if (Data[0].F_InfoSource + "" === "1") {
  442. $(".phonetype-wrapper").show()
  443. $("#phonetype").val(Data[0].F_PhoneType)
  444. }
  445. //事件地址
  446. $("#sourcearea option:selected").val(
  447. Data[0].F_SourceArea + ""
  448. );
  449. $("#sourcearea option:selected").text(
  450. Data[0].AreaName
  451. );
  452. // 乡镇
  453. $("#township option:selected").val(
  454. Data[0].F_Township + ""
  455. );
  456. $("#township option:selected").text(
  457. Data[0].Township
  458. );
  459. // 村
  460. $("#village option:selected").val(
  461. Data[0].F_Village + ""
  462. );
  463. $("#village option:selected").text(
  464. Data[0].Village
  465. );
  466. //主题词
  467. $("#keys option:selected").val(
  468. Data[0].F_Key + ""
  469. );
  470. $("#keys option:selected").text(
  471. Data[0].KeyName
  472. ); //主题词
  473. //类型
  474. $("#type option:selected").val(
  475. Data[0].F_InfoType + ""
  476. );
  477. $("#type option:selected").text(
  478. Data[0].TypeName1
  479. ); //类型
  480. //紧急程度
  481. $("#level").val(Data[0].F_Level + "");
  482. if (workType === "cb") {
  483. $(".limittimeWrapper").hide()
  484. $(".limittimesWrapper").hide()
  485. $(".limittimesWrapperCB").show()
  486. } else {
  487. if (Data[0].F_Level == "2") {
  488. $("#level option:selected").text("紧急"); //乡镇
  489. $(".limittimesWrapper").show()
  490. $(".limittimeWrapper").hide()
  491. } else {
  492. $("#level option:selected").text("普通"); //乡镇
  493. $(".limittimesWrapper").hide()
  494. $(".limittimeWrapper").show()
  495. }
  496. }
  497. if (Data[0].F_IsResult == 1) {
  498. $(".Nows_box").toggle();
  499. }
  500. $(
  501. ' input[name="mj"][value="' +
  502. Data[0].F_IsProtect +
  503. '"]'
  504. ).prop("checked", "checked");
  505. $(
  506. ' input[name="banli"][value="' +
  507. Data[0].F_IsResult +
  508. '"]'
  509. ).prop("checked", "checked");
  510. if (String(Data[0].F_Business) === "1") {
  511. $('#threeWayCall').attr("checked", true);
  512. } else {
  513. $('#threeWayCall').attr("checked", false);
  514. }
  515. $("#sourceaddress").val(
  516. Data[0].F_SourceAddress
  517. );
  518. $(".F_FinalOpinion").val(
  519. Data[0].F_FinalOpinion
  520. );
  521. $(Data[0].File).each(function (k, q) {
  522. var strs =
  523. '<span class="files" fiel-num="' +
  524. q.F_FileId +
  525. '">' +
  526. q.F_FileName.substring(19) +
  527. '<i class="fa fa-remove del_file"></i></span>';
  528. $(strs)
  529. .appendTo($(".fileBox"))
  530. .find(".del_file")
  531. .click(function (event) {
  532. event.stopPropagation();
  533. $(this).parent().remove();
  534. file_num();
  535. });
  536. file_num();
  537. });
  538. }
  539. },
  540. });
  541. }
  542. });
  543. ///修改工单
  544. function Add() {
  545. var jbSelect = $("#jbSelect").val() == null ? "" : $("#jbSelect").val().join(",");
  546. var startTime = $("#startTime").val();
  547. var limittimes = $("#limittimes").val();
  548. var limittimesCB = $("#limittimesCB").val();
  549. var level = $("#level").val()
  550. var value = $(' input[name="banli"]:checked ').val();
  551. var content = $("#content").val();
  552. var threeWayCall;
  553. if ($('#threeWayCall').is(':checked')) {
  554. threeWayCall = 1;
  555. } else {
  556. threeWayCall = 0;
  557. }
  558. // if (!$("#cusname").val()) {
  559. // layer.msg("请输入姓名");
  560. // } else
  561. // if (!$("#cusphone").val()) {
  562. // layer.msg("请输入来电号码");
  563. // } else if (!$("#title").val()) {
  564. // layer.msg("请输入标题");
  565. // } else if (!$("#content").val()) {
  566. // layer.msg("请输入内容");
  567. // } else if (!$("#keys").val()) {
  568. // layer.msg("请选择主题词");
  569. // } else if (!$("#sourcearea").val()) {
  570. // layer.msg("请选择事发区域");
  571. // } else if (value == 1 && !$("#result").val()) {
  572. // layer.msg("请输入直办内容");
  573. // } else {
  574. $.ajax({
  575. type: "post",
  576. url: huayi.config.callcenter_url +
  577. "WorkOrder/EditWorkOrder",
  578. dataType: "json",
  579. async: true,
  580. data: {
  581. workorderid: wid,
  582. cusname: $("#cusname").val(), //=来电人姓名
  583. cussex: $("#SEX").val(),
  584. cusphone: $("#cusphone").val(), //=来电人电话
  585. zipcode: $("#zipcode").val(),
  586. conphone: $("#conphone").val(),
  587. title: $("#title").val(),
  588. content: $("#content").val(),
  589. workcontent: $("#workcontent").val(),
  590. files: $("#file").val(), //(多个用英文逗号,隔开)
  591. sourcearea: $("#sourcearea").val(), //=事发地域id
  592. sourceaddress: $("#sourceaddress").val(), //=事发详细地址
  593. source: $("#source").val(), //=来源
  594. splituser: $("#leaderCharge").val(), // 分管领导
  595. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  596. business: threeWayCall,
  597. result: $("#result").val(),
  598. keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开) keys
  599. type: $("#type").val(), //=类型
  600. bigtype: $("#bigtype").val(), //=大类别
  601. smalltype: $("#smalltype").val(), //=小类别
  602. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  603. level: $("#level").val(), //=(1普通2紧急)
  604. visittype: $("#visittype").val(), // 回访方式
  605. phonetype: $("#source").val() === "1" ? $("#phonetype").val() : "", // 电话类别
  606. issubmit: submit, //=(0保存1保存并提交)
  607. token: $.cookie("token"),
  608. },
  609. success: function (data) {
  610. if (data.state.toLowerCase() == "success") {
  611. if (workType === "cb") {
  612. layer.open({
  613. type: 2,
  614. content: "../CommonHtml/Cb.html?wid=" + wid + "&jbSelect=" +
  615. jbSelect + "&startTime=" + startTime + "&limittimes=" +
  616. limittimes + "&limittimesCB=" + limittimesCB +
  617. "&level=" + $("#level").val(), //iframe的url,no代表不显示滚动条
  618. title: "重办工单",
  619. area: ["95%", "95%"], //宽高
  620. });
  621. } else if (workType === "jb" || workType === "zzbl") {
  622. layer.confirm(
  623. "确定交办?", {
  624. btn: ["是", "否"], //按钮
  625. },
  626. function () {
  627. assign(workType, jbSelect, startTime, limittimes, level)
  628. }
  629. );
  630. // layer.open({
  631. // type: 2,
  632. // content: "../CommonHtml/jiaoban.html?wid=" + wid + "&jbSelect=" +
  633. // jbSelect + "&startTime=" + startTime + "&limittimes=" +
  634. // limittimes + "&level=" + $("#level").val() + "&workType=" +
  635. // workType, //iframe的url,no代表不显示滚动条
  636. // title: "工单交办",
  637. // area: ["95%", "95%"], //宽高
  638. // });
  639. // } else if (workType === "zzbl") {
  640. // layer.open({
  641. // type: 2,
  642. // content: "../CommonHtml/jiaoban.html?wid=" + wid + "&jbSelect=" +
  643. // jbSelect + "&startTime=" + startTime + "&limittimes=" +
  644. // limittimes + "&level=" + $("#level").val() + "&workType=" +
  645. // workType, //iframe的url,no代表不显示滚动条
  646. // title: "工单交办",
  647. // area: ["95%", "95%"], //宽高
  648. // });
  649. } else {
  650. var index = parent.layer.getFrameIndex(
  651. window.name
  652. ); //先得到当前iframe层的索引
  653. parent.layer.close(index); //再执行关闭
  654. parent
  655. .$("#orderlist")
  656. .bootstrapTable("refresh");
  657. parent.layer.msg(data.message);
  658. }
  659. $(".fileBox").html("");
  660. }
  661. },
  662. });
  663. // }
  664. }
  665. $("#level").click(function () {
  666. var level = $("#level").val();
  667. if (workType === "cb") {
  668. $(".limittimesWrapperCB").show()
  669. } else {
  670. if (level === "2") {
  671. $(".limittimesWrapper").show()
  672. $(".limittimeWrapper").hide()
  673. } else {
  674. $(".limittimesWrapper").hide()
  675. $(".limittimeWrapper").show()
  676. }
  677. }
  678. })
  679. //上传文件隐藏域值
  680. function file_num() {
  681. var str = "";
  682. var Str;
  683. $(".fileBox .files").each(function (j, m) {
  684. var aa = $(m).attr("fiel-num");
  685. console.log(aa);
  686. str += aa + ",";
  687. Str =
  688. str.substring(str.length - 1) == "," ?
  689. str.substring(0, str.length - 1) :
  690. str;
  691. });
  692. $("#file").val(Str);
  693. }
  694. //来源
  695. function LY(obj) {
  696. obj.empty();
  697. obj.append(
  698. '<option selected="selected" value="">请选择</option>'
  699. );
  700. $.ajax({
  701. type: "get",
  702. url: huayi.config.callcenter_url +
  703. "Dictionary/GetDicValueListById",
  704. dataType: "json",
  705. async: false,
  706. data: {
  707. token: $.cookie("token"),
  708. id: 1,
  709. },
  710. success: function (data) {
  711. if (data.state.toLowerCase() == "success") {
  712. var content = data.data;
  713. $(content).each(function (i, n) {
  714. $(
  715. "<option value='" +
  716. n.F_ValueId +
  717. "'>" +
  718. n.F_Value +
  719. "</option>"
  720. ).appendTo(obj);
  721. });
  722. }
  723. },
  724. });
  725. }
  726. //类别
  727. function LB(obj) {
  728. obj.empty();
  729. obj.append(
  730. '<option selected="selected" value="">请选择</option>'
  731. );
  732. $.ajax({
  733. type: "get",
  734. url: huayi.config.callcenter_url +
  735. "Dictionary/GetDicValueListById",
  736. dataType: "json",
  737. async: false,
  738. data: {
  739. token: $.cookie("token"),
  740. id: 2,
  741. },
  742. success: function (data) {
  743. if (data.state.toLowerCase() == "success") {
  744. var content = data.data;
  745. $(content).each(function (i, n) {
  746. $(
  747. "<option value='" +
  748. n.F_ValueId +
  749. "'>" +
  750. n.F_Value +
  751. "</option>"
  752. ).appendTo(obj);
  753. });
  754. }
  755. },
  756. });
  757. }
  758. // 主题
  759. function ZT(obj) {
  760. obj.empty();
  761. obj.append(
  762. '<option selected="selected" value="">请选择</option>'
  763. );
  764. $.ajax({
  765. type: "get",
  766. url: huayi.config.callcenter_url +
  767. "Dictionary/GetDicValueListById",
  768. dataType: "json",
  769. async: false,
  770. data: {
  771. token: $.cookie("token"),
  772. id: 3,
  773. },
  774. success: function (data) {
  775. if (data.state.toLowerCase() == "success") {
  776. var content = data.data;
  777. $(content).each(function (i, n) {
  778. $(
  779. "<option value='" +
  780. n.F_ValueId +
  781. "'>" +
  782. n.F_Value +
  783. "</option>"
  784. ).appendTo(obj);
  785. });
  786. }
  787. },
  788. });
  789. }
  790. //区域
  791. function QY(obj) {
  792. obj.empty();
  793. obj.append(
  794. '<option selected="selected" value="">请选择</option>'
  795. );
  796. $.ajax({
  797. type: "get",
  798. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  799. dataType: "json",
  800. async: false,
  801. data: {
  802. token: $.cookie("token"),
  803. },
  804. success: function (data) {
  805. if (data.state.toLowerCase() == "success") {
  806. var content = data.data;
  807. $(content).each(function (i, n) {
  808. if (n.F_AreaName !== "市区") {
  809. // if (n.F_AreaName === "文峰区") {
  810. // $("<option value='" + n.F_AreaId + "' selected='selected'>" + n
  811. // .F_AreaName + "</option>").appendTo(obj);
  812. // } else {
  813. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  814. "</option>").appendTo(obj);
  815. // }
  816. }
  817. });
  818. }
  819. },
  820. });
  821. }
  822. //获取乡镇、村
  823. function getTownshipVillage(obj, parentid) {
  824. obj.empty();
  825. obj.append('<option selected="selected" value="">请选择</option>');
  826. $.getJSON(
  827. huayi.config.callcenter_url + "Area/GetAreaChildren", {
  828. token: $.cookie("token"),
  829. parentid: parentid
  830. },
  831. function (data) {
  832. if (data.state.toLowerCase() == "success") {
  833. var content = data.data;
  834. $(content).each(function (i, n) {
  835. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(
  836. obj);
  837. });
  838. }
  839. }
  840. );
  841. }
  842. // 获取乡镇
  843. $("#sourcearea").change(function () {
  844. getTownshipVillage($("#township"), $("#sourcearea").val())
  845. })
  846. // 获取村
  847. $("#township").change(function () {
  848. getTownshipVillage($("#village"), $("#township").val())
  849. })
  850. $("#source").change(function () {
  851. if ($("#source").val() === "4") {
  852. $(".leaderCharge-wrapper").show()
  853. $(".phonetype-wrapper").hide()
  854. } else if ($("#source").val() === "1") {
  855. $(".leaderCharge-wrapper").hide()
  856. $(".phonetype-wrapper").show()
  857. } else {
  858. $(".leaderCharge-wrapper").hide()
  859. $(".phonetype-wrapper").hide()
  860. }
  861. })
  862. //上传文件
  863. function upload() {
  864. var Files = document.getElementById("upFile").files;
  865. if (Files.length > 0) {
  866. var formData = new FormData();
  867. for (var i = 0; i < Files.length; i++) {
  868. formData.append("file" + i, Files[i]);
  869. }
  870. formData.append("token", $.cookie("token"));
  871. var typeName = Files[0].name.split(".")[1];
  872. if (
  873. typeName == "png" ||
  874. typeName == "jpg" ||
  875. typeName == "mp4" ||
  876. typeName == "mp3" ||
  877. typeName == "pdf" ||
  878. typeName == "doc" ||
  879. typeName == "docx" ||
  880. typeName == "xls" ||
  881. typeName == "xlsx"
  882. ) {
  883. $.ajax({
  884. url: huayi.config.callcenter_url +
  885. "/WorkOrder/UploadFile",
  886. type: "POST",
  887. data: formData,
  888. /**
  889. *必须false才会自动加上正确的Content-Type
  890. */
  891. contentType: false,
  892. /**
  893. * 必须false才会避开jQuery对 formdata 的默认处理
  894. * XMLHttpRequest会对 formdata 进行正确的处理
  895. */
  896. processData: false,
  897. success: function (result) {
  898. document.getElementById(
  899. "upFile"
  900. ).outerHTML = document.getElementById(
  901. "upFile"
  902. ).outerHTML;
  903. $("#upFile").change(function () {
  904. upload();
  905. });
  906. var r = $.parseJSON(result);
  907. if (r.state.toLowerCase() == "success") {
  908. var a = r.data;
  909. $(a).each(function (i, n) {
  910. var strs =
  911. '<span class="files" fiel-num="' +
  912. n.F_FileId +
  913. '">' +
  914. n.F_FileName.substring(19) +
  915. '<i class="fa fa-remove del_file"></i></span>';
  916. $(strs)
  917. .appendTo($(".fileBox"))
  918. .find(".del_file")
  919. .click(function (event) {
  920. event.stopPropagation();
  921. $(this).parent().remove();
  922. file_num();
  923. });
  924. });
  925. file_num();
  926. }
  927. },
  928. });
  929. } else {
  930. layer.msg("格式不正确");
  931. }
  932. } else {
  933. layer.confirm("请上传文件!", {
  934. btn: ["确定"],
  935. });
  936. }
  937. }
  938. function closePage() {
  939. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  940. parent.layer.close(index); //再执行关闭
  941. parent.$("#orderlist").bootstrapTable("refresh");
  942. parent.layer.msg("操作成功");
  943. }
  944. function jbSelect(obj) {
  945. obj.empty();
  946. $.getJSON(huayi.config.callcenter_url + "Department/GetDeptList", {
  947. "token": $.cookie("token"),
  948. "iscbdw": 2,
  949. }, function (data) {
  950. if (data.state.toLowerCase() == "success") {
  951. var content = data.data;
  952. $("<option value=''>请选择</option>").appendTo(obj);
  953. $(content).each(function (i, n) {
  954. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(
  955. obj);
  956. })
  957. obj.selectpicker({
  958. noneSelectedText: '请选择' //默认显示内容
  959. });
  960. obj.selectpicker('refresh');
  961. obj.selectpicker('render');
  962. }
  963. })
  964. }
  965. function xbSelect(obj) {
  966. obj.empty();
  967. $.getJSON(huayi.config.callcenter_url + "Department/GetDeptList", {
  968. "token": $.cookie("token"),
  969. "iscbdw": 1,
  970. }, function (data) {
  971. if (data.state.toLowerCase() == "success") {
  972. var content = data.data;
  973. $(content).each(function (i, n) {
  974. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(
  975. obj);
  976. })
  977. obj.selectpicker({
  978. noneSelectedText: '请选择' //默认显示内容
  979. });
  980. obj.selectpicker('refresh');
  981. }
  982. })
  983. }
  984. //电话类别
  985. function getPhoneType(obj) {
  986. obj.empty();
  987. $.ajax({
  988. type: "get",
  989. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  990. dataType: "json",
  991. async: true,
  992. data: {
  993. "token": $.cookie("token"),
  994. id: 2498,
  995. },
  996. success: function (data) {
  997. if (data.state.toLowerCase() == "success") {
  998. var content = data.data;
  999. $(content).each(function (i, n) {
  1000. $("<option value='" + n.F_Value + "'>" + n.F_Remark + "</option>")
  1001. .appendTo(obj);
  1002. })
  1003. }
  1004. }
  1005. });
  1006. }
  1007. function getReactionCategory(pid = 38) {
  1008. $.get(
  1009. huayi.config.callcenter_url + "Dictionary/GetZTreeNew", {
  1010. token: $.cookie("token"),
  1011. pid: pid,
  1012. },
  1013. function (result) {
  1014. result = $.parseJSON(result);
  1015. var content = JSON.parse(result.data);
  1016. layui.use("dropdown", function () {
  1017. var dropdown = layui.dropdown;
  1018. dropdown.render({
  1019. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  1020. data: content,
  1021. id: "reflectCategory",
  1022. //菜单被点击的事件
  1023. click: function (obj) {
  1024. $("#reflectCategory").val(obj.title);
  1025. $("#PID").val(obj.id);
  1026. },
  1027. });
  1028. });
  1029. }
  1030. );
  1031. }
  1032. function getSearchReactionCategory(key) {
  1033. $("#reflectCategoryList").empty();
  1034. $.get(
  1035. huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
  1036. token: $.cookie("token"),
  1037. key: key,
  1038. },
  1039. function (result) {
  1040. result = $.parseJSON(result);
  1041. if (result.state.toLowerCase() === "success") {
  1042. var content = result.data;
  1043. if (content.length > 0) {
  1044. content.forEach(function (e, i) {
  1045. $(
  1046. "<li index='" +
  1047. e.id +
  1048. "' indexName='" +
  1049. e.name +
  1050. "'>" +
  1051. e.names +
  1052. "</li>"
  1053. ).appendTo("#reflectCategoryList");
  1054. });
  1055. } else {
  1056. $("<li index='' indexName=''>没有相关数据</li>").appendTo(
  1057. "#reflectCategoryList"
  1058. );
  1059. }
  1060. }
  1061. }
  1062. );
  1063. }
  1064. function debounce(fun, delay) {
  1065. return function (args) {
  1066. var that = this;
  1067. var _args = args;
  1068. clearTimeout(fun.id);
  1069. fun.id = setTimeout(function () {
  1070. fun.call(that, _args);
  1071. }, delay);
  1072. };
  1073. }
  1074. function assign(workType, jbSelect, startTime, limittimes, level) {
  1075. var assignedopinion = ""; // 交办意见
  1076. if (workType === "zzbl") {
  1077. assignAPI = "WorkOrder/HandleAssign"
  1078. } else {
  1079. assignAPI = "WorkOrder/AssignWorkOrderNew"
  1080. }
  1081. if (String(level) === "1") {
  1082. var assignedopinion = "请于1小时内与来电人取得联系(匿名除外),并于" + startTime +
  1083. "内将办理情况反馈来电人,并将办理结果报市长便民公开电话受理中心,同时做好来电人信息保密工作。(若超期将进行通报;若无故不回复,将转交市委市政府督查局。)"
  1084. } else if (String(level) === "2") {
  1085. var assignedopinion = "请于1小时内与来电人取得联系(匿名除外),并于" + limittimes +
  1086. "内将办理情况反馈来电人,并将办理结果报市长便民公开电话受理中心,同时做好来电人信息保密工作。(若超期将进行通报;若无故不回复,将转交市委市政府督查局。)"
  1087. }
  1088. $.ajax({
  1089. type: "post",
  1090. url: huayi.config.callcenter_url + assignAPI,
  1091. dataType: 'json',
  1092. async: true,
  1093. data: {
  1094. workorderid: wid,
  1095. maindeptid: jbSelect, //承办单位
  1096. limittime: startTime, //办理时限
  1097. limittimes: limittimes, // 紧急办理时限
  1098. assignedopinion: assignedopinion, //交办意见
  1099. state: 1, // 0保存,1保存并提交
  1100. assignid: "",
  1101. token: $.cookie("token"),
  1102. },
  1103. success: function (result) {
  1104. if (result.state.toLowerCase() == "success") {
  1105. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  1106. parent.layer.close(index); //再执行关闭
  1107. parent.$("#orderlist").bootstrapTable("refresh");
  1108. }
  1109. }
  1110. })
  1111. }
  1112. </script>
  1113. </body>
  1114. </html>