Нет описания

AddAppealDCL.html 43KB

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