Нет описания

AddAppealDCL.html 45KB

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