Açıklama Yok

AddAppealDCL.html 51KB

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