Нет описания

AddAppealDCL.html 48KB

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