Нет описания

AddAppealDCL.html 44KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028
  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. $("#zipcode").val(Data[0].F_ZipCode);
  400. $("#result").val(Data[0].F_Result);
  401. $("#reflectCategory").val(Data[0].KeyName)
  402. $("#PID").val(Data[0].F_Key)
  403. if (Data[0].F_Longitude) {
  404. $(".store_Lng").val(Data[0].F_Longitude);
  405. $(".store_Lat").val(Data[0].F_Latitude);
  406. }
  407. //x性别
  408. $("#SEX option:selected").val(
  409. Data[0].F_CusSex + ""
  410. );
  411. if (Data[0].F_CusSex == "0") {
  412. $("#SEX option:selected").text("男"); //乡镇
  413. } else {
  414. $("#SEX option:selected").text("女"); //乡镇
  415. }
  416. //来源
  417. $("#source option:selected").val(Data[0].F_InfoSource + "");
  418. $("#source option:selected").text(Data[0].SourceName); //来源
  419. if (Data[0].F_InfoSource + "" === "4") {
  420. $(".leaderCharge-wrapper").show()
  421. $("#leaderCharge").val(Data[0].F_SplitUser)
  422. }
  423. //事件地址
  424. $("#sourcearea option:selected").val(
  425. Data[0].F_SourceArea + ""
  426. );
  427. $("#sourcearea option:selected").text(
  428. Data[0].AreaName
  429. ); //事件地址
  430. //主题词
  431. $("#keys option:selected").val(
  432. Data[0].F_Key + ""
  433. );
  434. $("#keys option:selected").text(
  435. Data[0].KeyName
  436. ); //主题词
  437. //类型
  438. $("#type option:selected").val(
  439. Data[0].F_InfoType + ""
  440. );
  441. $("#type option:selected").text(
  442. Data[0].TypeName1
  443. ); //类型
  444. //紧急程度
  445. $("#level").val(Data[0].F_Level + "");
  446. if (workType === "cb") {
  447. $(".limittimeWrapper").hide()
  448. $(".limittimesWrapper").hide()
  449. $(".limittimesWrapperCB").show()
  450. } else {
  451. if (Data[0].F_Level == "2") {
  452. $("#level option:selected").text("紧急"); //乡镇
  453. $(".limittimesWrapper").show()
  454. $(".limittimeWrapper").hide()
  455. } else {
  456. $("#level option:selected").text("普通"); //乡镇
  457. $(".limittimesWrapper").hide()
  458. $(".limittimeWrapper").show()
  459. }
  460. }
  461. if (Data[0].F_IsResult == 1) {
  462. $(".Nows_box").toggle();
  463. }
  464. $(
  465. ' input[name="mj"][value="' +
  466. Data[0].F_IsProtect +
  467. '"]'
  468. ).prop("checked", "checked");
  469. $(
  470. ' input[name="banli"][value="' +
  471. Data[0].F_IsResult +
  472. '"]'
  473. ).prop("checked", "checked");
  474. if (String(Data[0].F_Business) === "1") {
  475. $('#threeWayCall').attr("checked", true);
  476. } else {
  477. $('#threeWayCall').attr("checked", false);
  478. }
  479. $("#sourceaddress").val(
  480. Data[0].F_SourceAddress
  481. );
  482. $(".F_FinalOpinion").val(
  483. Data[0].F_FinalOpinion
  484. );
  485. $(Data[0].File).each(function (k, q) {
  486. var strs =
  487. '<span class="files" fiel-num="' +
  488. q.F_FileId +
  489. '">' +
  490. q.F_FileName.substring(19) +
  491. '<i class="fa fa-remove del_file"></i></span>';
  492. $(strs)
  493. .appendTo($(".fileBox"))
  494. .find(".del_file")
  495. .click(function (event) {
  496. event.stopPropagation();
  497. $(this).parent().remove();
  498. file_num();
  499. });
  500. file_num();
  501. });
  502. }
  503. },
  504. });
  505. }
  506. });
  507. ///修改工单
  508. function Add() {
  509. var jbSelect = $("#jbSelect").val();
  510. var startTime = $("#startTime").val();
  511. var limittimes = $("#limittimes").val();
  512. var limittimesCB = $("#limittimesCB").val();
  513. //坐席
  514. // var usercodeID = "";
  515. // var usercode_ = $("#ZX").val(); //坐席
  516. // if (usercode_ != null) {
  517. // $(usercode_).each(function (i, n) {
  518. // var obj1 = "";
  519. // obj1 = n + ",";
  520. // usercodeID += obj1;
  521. // });
  522. // } else {
  523. // usercodeID = "";
  524. // }
  525. var value = $(' input[name="banli"]:checked ').val();
  526. var content = $("#content").val();
  527. var threeWayCall;
  528. if ($('#threeWayCall').is(':checked')) {
  529. threeWayCall = 1;
  530. } else {
  531. threeWayCall = 0;
  532. }
  533. // if (!$("#cusname").val()) {
  534. // layer.msg("请输入姓名");
  535. // } else
  536. // if (!$("#cusphone").val()) {
  537. // layer.msg("请输入来电号码");
  538. // } else if (!$("#title").val()) {
  539. // layer.msg("请输入标题");
  540. // } else if (!$("#content").val()) {
  541. // layer.msg("请输入内容");
  542. // } else if (!$("#keys").val()) {
  543. // layer.msg("请选择主题词");
  544. // } else if (!$("#sourcearea").val()) {
  545. // layer.msg("请选择事发区域");
  546. // } else if (value == 1 && !$("#result").val()) {
  547. // layer.msg("请输入直办内容");
  548. // } else {
  549. $.ajax({
  550. type: "post",
  551. url: huayi.config.callcenter_url +
  552. "WorkOrder/EditWorkOrder",
  553. dataType: "json",
  554. async: true,
  555. data: {
  556. workorderid: wid,
  557. cusname: $("#cusname").val(), //=来电人姓名
  558. cussex: $("#SEX").val(),
  559. cusphone: $("#cusphone").val(), //=来电人电话
  560. zipcode: $("#zipcode").val(),
  561. conphone: $("#conphone").val(),
  562. title: $("#title").val(),
  563. content: $("#content").val(),
  564. workcontent: $("#workcontent").val(),
  565. files: $("#file").val(), //(多个用英文逗号,隔开)
  566. sourcearea: $("#sourcearea").val(), //=事发地域id
  567. sourceaddress: $("#sourceaddress").val(), //=事发详细地址
  568. source: $("#source").val(), //=来源
  569. splituser: $("#leaderCharge").val(), // 分管领导
  570. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  571. business: threeWayCall,
  572. result: $("#result").val(),
  573. keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开) keys
  574. type: $("#type").val(), //=类型
  575. bigtype: $("#bigtype").val(), //=大类别
  576. smalltype: $("#smalltype").val(), //=小类别
  577. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  578. level: $("#level").val(), //=(1普通2紧急)
  579. visittype: $("#visittype").val(), // 回访方式
  580. issubmit: submit, //=(0保存1保存并提交)
  581. token: $.cookie("token"),
  582. },
  583. success: function (data) {
  584. if (data.state.toLowerCase() == "success") {
  585. if (workType === "cb") {
  586. layer.open({
  587. type: 2,
  588. content: "../CommonHtml/Cb.html?wid=" + wid + "&jbSelect=" +
  589. jbSelect + "&startTime=" + startTime + "&limittimes=" +
  590. limittimes + "&limittimesCB=" + limittimesCB +
  591. "&level=" + $("#level").val(), //iframe的url,no代表不显示滚动条
  592. title: "重办工单",
  593. area: ["95%", "95%"], //宽高
  594. });
  595. } else if (workType === "jb") {
  596. layer.open({
  597. type: 2,
  598. content: "../CommonHtml/jiaoban.html?wid=" + wid + "&jbSelect=" +
  599. jbSelect + "&startTime=" + startTime + "&limittimes=" +
  600. limittimes + "&level=" + $("#level").val() + "&workType=" +
  601. workType, //iframe的url,no代表不显示滚动条
  602. title: "工单交办",
  603. area: ["95%", "95%"], //宽高
  604. });
  605. } else if (workType === "zzbl") {
  606. layer.open({
  607. type: 2,
  608. content: "../CommonHtml/jiaoban.html?wid=" + wid + "&jbSelect=" +
  609. jbSelect + "&startTime=" + startTime + "&limittimes=" +
  610. limittimes + "&level=" + $("#level").val() + "&workType=" +
  611. workType, //iframe的url,no代表不显示滚动条
  612. title: "工单交办",
  613. area: ["95%", "95%"], //宽高
  614. });
  615. } else {
  616. var index = parent.layer.getFrameIndex(
  617. window.name
  618. ); //先得到当前iframe层的索引
  619. parent.layer.close(index); //再执行关闭
  620. parent
  621. .$("#orderlist")
  622. .bootstrapTable("refresh");
  623. parent.layer.msg(data.message);
  624. }
  625. $(".fileBox").html("");
  626. }
  627. },
  628. });
  629. // }
  630. }
  631. $("#level").click(function () {
  632. var level = $("#level").val();
  633. if (workType === "cb") {
  634. $(".limittimesWrapperCB").show()
  635. } else {
  636. if (level === "2") {
  637. $(".limittimesWrapper").show()
  638. $(".limittimeWrapper").hide()
  639. } else {
  640. $(".limittimesWrapper").hide()
  641. $(".limittimeWrapper").show()
  642. }
  643. }
  644. })
  645. //上传文件隐藏域值
  646. function file_num() {
  647. var str = "";
  648. var Str;
  649. $(".fileBox .files").each(function (j, m) {
  650. var aa = $(m).attr("fiel-num");
  651. console.log(aa);
  652. str += aa + ",";
  653. Str =
  654. str.substring(str.length - 1) == "," ?
  655. str.substring(0, str.length - 1) :
  656. str;
  657. });
  658. $("#file").val(Str);
  659. }
  660. //来源
  661. function LY(obj) {
  662. obj.empty();
  663. obj.append(
  664. '<option selected="selected" value="">请选择</option>'
  665. );
  666. $.ajax({
  667. type: "get",
  668. url: huayi.config.callcenter_url +
  669. "Dictionary/GetDicValueListById",
  670. dataType: "json",
  671. async: false,
  672. data: {
  673. token: $.cookie("token"),
  674. id: 1,
  675. },
  676. success: function (data) {
  677. if (data.state.toLowerCase() == "success") {
  678. var content = data.data;
  679. $(content).each(function (i, n) {
  680. $(
  681. "<option value='" +
  682. n.F_ValueId +
  683. "'>" +
  684. n.F_Value +
  685. "</option>"
  686. ).appendTo(obj);
  687. });
  688. }
  689. },
  690. });
  691. }
  692. //类别
  693. function LB(obj) {
  694. obj.empty();
  695. obj.append(
  696. '<option selected="selected" value="">请选择</option>'
  697. );
  698. $.ajax({
  699. type: "get",
  700. url: huayi.config.callcenter_url +
  701. "Dictionary/GetDicValueListById",
  702. dataType: "json",
  703. async: false,
  704. data: {
  705. token: $.cookie("token"),
  706. id: 2,
  707. },
  708. success: function (data) {
  709. if (data.state.toLowerCase() == "success") {
  710. var content = data.data;
  711. $(content).each(function (i, n) {
  712. $(
  713. "<option value='" +
  714. n.F_ValueId +
  715. "'>" +
  716. n.F_Value +
  717. "</option>"
  718. ).appendTo(obj);
  719. });
  720. }
  721. },
  722. });
  723. }
  724. // 主题
  725. function ZT(obj) {
  726. obj.empty();
  727. obj.append(
  728. '<option selected="selected" value="">请选择</option>'
  729. );
  730. $.ajax({
  731. type: "get",
  732. url: huayi.config.callcenter_url +
  733. "Dictionary/GetDicValueListById",
  734. dataType: "json",
  735. async: false,
  736. data: {
  737. token: $.cookie("token"),
  738. id: 3,
  739. },
  740. success: function (data) {
  741. if (data.state.toLowerCase() == "success") {
  742. var content = data.data;
  743. $(content).each(function (i, n) {
  744. $(
  745. "<option value='" +
  746. n.F_ValueId +
  747. "'>" +
  748. n.F_Value +
  749. "</option>"
  750. ).appendTo(obj);
  751. });
  752. }
  753. },
  754. });
  755. }
  756. //区域
  757. function QY(obj) {
  758. obj.empty();
  759. obj.append(
  760. '<option selected="selected" value="">请选择</option>'
  761. );
  762. $.ajax({
  763. type: "get",
  764. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  765. dataType: "json",
  766. async: false,
  767. data: {
  768. token: $.cookie("token"),
  769. },
  770. success: function (data) {
  771. if (data.state.toLowerCase() == "success") {
  772. var content = data.data;
  773. $(content).each(function (i, n) {
  774. if (n.F_AreaName != "安阳市") {
  775. $(
  776. "<option value='" +
  777. n.F_AreaId +
  778. "'>" +
  779. n.F_AreaName +
  780. "</option>"
  781. ).appendTo(obj);
  782. }
  783. });
  784. }
  785. },
  786. });
  787. }
  788. $("#source").click(function () {
  789. if ($("#source").val() === "4") {
  790. $(".leaderCharge-wrapper").show()
  791. } else {
  792. $(".leaderCharge-wrapper").hide()
  793. }
  794. })
  795. //上传文件
  796. function upload() {
  797. var Files = document.getElementById("upFile").files;
  798. if (Files.length > 0) {
  799. var formData = new FormData();
  800. for (var i = 0; i < Files.length; i++) {
  801. formData.append("file" + i, Files[i]);
  802. }
  803. formData.append("token", $.cookie("token"));
  804. var typeName = Files[0].name.split(".")[1];
  805. if (
  806. typeName == "png" ||
  807. typeName == "jpg" ||
  808. typeName == "mp4" ||
  809. typeName == "mp3" ||
  810. typeName == "pdf" ||
  811. typeName == "doc" ||
  812. typeName == "docx" ||
  813. typeName == "xls" ||
  814. typeName == "xlsx"
  815. ) {
  816. $.ajax({
  817. url: huayi.config.callcenter_url +
  818. "/WorkOrder/UploadFile",
  819. type: "POST",
  820. data: formData,
  821. /**
  822. *必须false才会自动加上正确的Content-Type
  823. */
  824. contentType: false,
  825. /**
  826. * 必须false才会避开jQuery对 formdata 的默认处理
  827. * XMLHttpRequest会对 formdata 进行正确的处理
  828. */
  829. processData: false,
  830. success: function (result) {
  831. document.getElementById(
  832. "upFile"
  833. ).outerHTML = document.getElementById(
  834. "upFile"
  835. ).outerHTML;
  836. $("#upFile").change(function () {
  837. upload();
  838. });
  839. var r = $.parseJSON(result);
  840. if (r.state.toLowerCase() == "success") {
  841. var a = r.data;
  842. $(a).each(function (i, n) {
  843. var strs =
  844. '<span class="files" fiel-num="' +
  845. n.F_FileId +
  846. '">' +
  847. n.F_FileName.substring(19) +
  848. '<i class="fa fa-remove del_file"></i></span>';
  849. $(strs)
  850. .appendTo($(".fileBox"))
  851. .find(".del_file")
  852. .click(function (event) {
  853. event.stopPropagation();
  854. $(this).parent().remove();
  855. file_num();
  856. });
  857. });
  858. file_num();
  859. }
  860. },
  861. });
  862. } else {
  863. layer.msg("格式不正确");
  864. }
  865. } else {
  866. layer.confirm("请上传文件!", {
  867. btn: ["确定"],
  868. });
  869. }
  870. }
  871. function closePage() {
  872. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  873. parent.layer.close(index); //再执行关闭
  874. parent.$("#orderlist").bootstrapTable("refresh");
  875. parent.layer.msg("操作成功");
  876. }
  877. // $("#jbSelectText").click(function() {
  878. // var jbSelect = $("#jbSelect").val();
  879. // var jbSelectText = encodeURIComponent($("#jbSelectText").val());
  880. // layer.open({
  881. // type: 2,
  882. // content: "../CommonHtml/organizer.html?jbSelect=" + jbSelect + "&jbSelectText=" + jbSelectText, //iframe的url,no代表不显示滚动条
  883. // title: '承办单位',
  884. // area: ['60%', '80%'], //宽高
  885. // });
  886. // })
  887. function jbSelect(obj) {
  888. obj.empty();
  889. $.getJSON(huayi.config.callcenter_url + "Department/GetDeptList", {
  890. "token": $.cookie("token"),
  891. "iscbdw": 2,
  892. }, function (data) {
  893. if (data.state.toLowerCase() == "success") {
  894. var content = data.data;
  895. $("<option value=''>请选择</option>").appendTo(obj);
  896. $(content).each(function (i, n) {
  897. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(
  898. obj);
  899. })
  900. obj.selectpicker({
  901. noneSelectedText: '请选择' //默认显示内容
  902. });
  903. obj.selectpicker('refresh');
  904. obj.selectpicker('render');
  905. }
  906. })
  907. }
  908. function xbSelect(obj) {
  909. obj.empty();
  910. $.getJSON(huayi.config.callcenter_url + "Department/GetDeptList", {
  911. "token": $.cookie("token"),
  912. "iscbdw": 1,
  913. }, function (data) {
  914. if (data.state.toLowerCase() == "success") {
  915. var content = data.data;
  916. $(content).each(function (i, n) {
  917. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(
  918. obj);
  919. })
  920. obj.selectpicker({
  921. noneSelectedText: '请选择' //默认显示内容
  922. });
  923. obj.selectpicker('refresh');
  924. }
  925. })
  926. }
  927. function getReactionCategory(pid = 38) {
  928. $.get(
  929. huayi.config.callcenter_url + "Dictionary/GetZTreeNew", {
  930. token: $.cookie("token"),
  931. pid: pid,
  932. },
  933. function (result) {
  934. result = $.parseJSON(result);
  935. var content = JSON.parse(result.data);
  936. layui.use("dropdown", function () {
  937. var dropdown = layui.dropdown;
  938. dropdown.render({
  939. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  940. data: content,
  941. id: "reflectCategory",
  942. //菜单被点击的事件
  943. click: function (obj) {
  944. $("#reflectCategory").val(obj.title);
  945. $("#PID").val(obj.id);
  946. },
  947. });
  948. });
  949. }
  950. );
  951. }
  952. function getSearchReactionCategory(key) {
  953. $("#reflectCategoryList").empty();
  954. $.get(
  955. huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
  956. token: $.cookie("token"),
  957. key: key,
  958. },
  959. function (result) {
  960. result = $.parseJSON(result);
  961. if (result.state.toLowerCase() === "success") {
  962. var content = result.data;
  963. if (content.length > 0) {
  964. content.forEach(function (e, i) {
  965. $(
  966. "<li index='" +
  967. e.id +
  968. "' indexName='" +
  969. e.name +
  970. "'>" +
  971. e.names +
  972. "</li>"
  973. ).appendTo("#reflectCategoryList");
  974. });
  975. } else {
  976. $("<li index='' indexName=''>没有相关数据</li>").appendTo(
  977. "#reflectCategoryList"
  978. );
  979. }
  980. }
  981. }
  982. );
  983. }
  984. function debounce(fun, delay) {
  985. return function (args) {
  986. var that = this;
  987. var _args = args;
  988. clearTimeout(fun.id);
  989. fun.id = setTimeout(function () {
  990. fun.call(that, _args);
  991. }, delay);
  992. };
  993. }
  994. </script>
  995. </body>
  996. </html>