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

AddAppealDCL.html 52KB

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